Skip to content

Commit cf70c3f

Browse files
committed
demo: ux improvements - drop zone, loading overlay, web worker parse, Line/LineArt off by default
1 parent ce4f39d commit cf70c3f

55 files changed

Lines changed: 5074 additions & 22 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vite/deps/_metadata.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"hash": "f05f3447",
3+
"configHash": "86da36e8",
4+
"lockfileHash": "e3b0c442",
5+
"browserHash": "82f036c2",
6+
"optimized": {},
7+
"chunks": {}
8+
}

.vite/deps/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}

Cargo.lock

Lines changed: 157 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ members = [
66
"crates/pdf-cos",
77
"crates/edgeparse-python",
88
"crates/edgeparse-node",
9+
"crates/edgeparse-wasm",
910
]
1011
default-members = [
1112
"crates/edgeparse-core",
@@ -24,7 +25,7 @@ description = "EdgeParse — High-performance PDF-to-structured-data extraction
2425
[workspace.dependencies]
2526
# PDF parsing (local fork of lopdf 0.39.0, renamed pdf-cos for clarity)
2627
# Using package alias so all existing `use lopdf::...` code works unchanged.
27-
lopdf = { package = "pdf-cos", path = "crates/pdf-cos", version = "0.39.0" }
28+
lopdf = { package = "pdf-cos", path = "crates/pdf-cos", version = "0.39.0", default-features = false }
2829
pdf-extract = "0.10.0"
2930

3031
# CLI

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,30 @@ publish-brew: ## Generate Homebrew formula and push to $(BREW_TAP_REPO)
506506
publish-all: publish-rust publish-python publish-node publish-cli publish-brew ## Publish everything: Rust crates + Python wheels + Node.js packages + CLI binaries + Homebrew formula
507507
$(call ok,All SDKs + CLI + Homebrew tap published)
508508

509+
# ══════════════════════════════════════════════════════════════════════════════
510+
## WASM
511+
# ══════════════════════════════════════════════════════════════════════════════
512+
513+
WASM_CRATE := crates/edgeparse-wasm
514+
515+
wasm-build: ## Build WASM package (release, --target web)
516+
$(call info,Building WASM package...)
517+
@cd $(WASM_CRATE) && wasm-pack build --target web --release --scope edgeparse
518+
$(call ok,WASM package built → $(WASM_CRATE)/pkg/)
519+
520+
wasm-check: ## Check WASM compilation (fast, no codegen)
521+
$(call info,Checking WASM compilation...)
522+
@cargo check --target wasm32-unknown-unknown -p edgeparse-wasm
523+
$(call ok,WASM check passed)
524+
525+
wasm-size: wasm-build ## Show WASM binary size
526+
@echo "Raw WASM size:"
527+
@du -h $(WASM_CRATE)/pkg/edgeparse_wasm_bg.wasm
528+
529+
wasm-clean: ## Remove WASM build artefacts (pkg/)
530+
$(call warn,Removing $(WASM_CRATE)/pkg/ ...)
531+
@rm -rf $(WASM_CRATE)/pkg/
532+
509533
# ══════════════════════════════════════════════════════════════════════════════
510534
## Clean
511535
# ══════════════════════════════════════════════════════════════════════════════

crates/edgeparse-core/Cargo.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,29 @@ rustdoc-args = ["--cfg", "docsrs"]
1717
all-features = false
1818

1919
[dependencies]
20-
lopdf = { workspace = true }
20+
lopdf = { workspace = true, default-features = false, features = ["chrono", "jiff", "time"] }
2121
serde = { workspace = true }
2222
serde_json = { workspace = true }
2323
thiserror = { workspace = true }
2424
anyhow = { workspace = true }
2525
log = { workspace = true }
26-
rayon = { workspace = true }
27-
image = { workspace = true }
26+
rayon = { workspace = true, optional = true }
27+
image = { workspace = true, optional = true }
2828
base64 = { workspace = true }
2929
regex = { workspace = true }
3030
unicode-normalization = { workspace = true }
3131
indexmap = { workspace = true }
3232
ordered-float = { workspace = true }
3333
ttf-parser = { workspace = true }
3434
euclid = { workspace = true }
35-
zip = { workspace = true }
35+
zip = { workspace = true, optional = true }
3636
reqwest = { workspace = true, optional = true }
3737
tokio = { workspace = true, optional = true }
3838

3939
[features]
40-
default = []
40+
default = ["native"]
41+
native = ["rayon", "image", "zip", "lopdf/rayon"]
42+
wasm = ["lopdf/wasm_js"]
4143
hybrid = ["dep:reqwest", "dep:tokio"]
4244

4345
[dev-dependencies]

0 commit comments

Comments
 (0)