@silurus/ooxml 0.71.0 → 0.72.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -3
- package/THIRD_PARTY_NOTICES.md +73 -0
- package/dist/docx-CM-oHSyZ.js +10241 -0
- package/dist/docx.mjs +3 -3
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{find-cursor-DgyGlCIw.js → find-cursor-CABDFafh.js} +7899 -1280
- package/dist/highlight-rect-DIReGC3z.js +881 -0
- package/dist/index.mjs +4 -4
- package/dist/math.mjs +1 -1
- package/dist/{pptx-C2qCkfTT.js → pptx-WoReGPPJ.js} +1345 -1132
- package/dist/pptx.mjs +3 -3
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/render-worker-host-BNYGV6vm.js +27 -0
- package/dist/render-worker-host-CJc3E4ej.js +27 -0
- package/dist/render-worker-host-DcfYux0W.js +27 -0
- package/dist/{segments-BLmJVJRb.js → segments-2VsQNClV.js} +1 -1
- package/dist/types/docx.d.ts +230 -15
- package/dist/types/index.d.ts +364 -24
- package/dist/types/pptx.d.ts +117 -8
- package/dist/types/xlsx.d.ts +33 -1
- package/dist/visible-index-YRawP6W8.js +50 -0
- package/dist/{xlsx-1PnsOb7Z.js → xlsx-CHfWgWy8.js} +1307 -1255
- package/dist/xlsx.mjs +3 -3
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/docx-B84Lzf0A.js +0 -6396
- package/dist/highlight-rect-CBqVAarx.js +0 -911
- package/dist/render-worker-host-B_mY9aaj.js +0 -27
- package/dist/render-worker-host-CSA5bTZW.js +0 -27
- package/dist/render-worker-host-DL0cvjox.js +0 -27
- package/dist/visible-index-C4c37k-n.js +0 -17
- /package/dist/{mathjax-BRfWlbSJ.js → mathjax-Dk_JzbFj.js} +0 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
> **This entire codebase — Rust parsers, TypeScript renderers, tests, and tooling —
|
|
1
|
+
> **This entire codebase — Rust parsers, TypeScript renderers, tests, and tooling — is implemented by AI coding agents, primarily [Claude](https://claude.ai) and [Codex](https://openai.com/codex/)**, through iterative prompting. No human-written application code exists in this repository.
|
|
2
2
|
|
|
3
3
|
<details>
|
|
4
4
|
<summary><b>Why this project exists — a note from the author</b></summary>
|
|
@@ -11,7 +11,7 @@ In practice, it didn't happen. For more than a decade, no free, open-source libr
|
|
|
11
11
|
|
|
12
12
|
Generative AI changed that. A viewer is an unusually good fit for AI-driven iterative development ("vibe coding"): there is a spec to read and a correct output to aim for, so the work comes down to interpreting the specification and refining the rendering until it matches. Limiting the scope to viewing also avoids the most serious risk an Office library can carry — corrupting a user's files.
|
|
13
13
|
|
|
14
|
-
So I'm building this library with
|
|
14
|
+
So I'm building this library with AI coding agents, spec-first, and keeping it free to use. For some documents it already reproduces the desktop Office applications more faithfully than commercial libraries — and sometimes even the official Microsoft 365 web apps.
|
|
15
15
|
|
|
16
16
|
</details>
|
|
17
17
|
|
|
@@ -229,6 +229,20 @@ a transparent, selectable text layer per page/slide for native copy. In
|
|
|
229
229
|
worker boundary) and the viewer logs one warning — use the default `mode: 'main'`
|
|
230
230
|
for selectable text.
|
|
231
231
|
|
|
232
|
+
**Hyperlinks.** For DOCX/PPTX the link hit regions live on the text-selection
|
|
233
|
+
overlay, so hyperlink interaction requires `enableTextSelection: true`; when that
|
|
234
|
+
overlay is enabled, links are interactive by default. XLSX hit-tests cells
|
|
235
|
+
directly, so links are interactive out of the box. An external link opens in a
|
|
236
|
+
new tab (scheme-sanitized to `http` / `https` / `mailto` / `tel`, `noopener`),
|
|
237
|
+
and an internal target navigates within the document (docx bookmark, pptx slide
|
|
238
|
+
jump, xlsx sheet). Pass `onHyperlinkClick(target)` to take over the click
|
|
239
|
+
yourself.
|
|
240
|
+
Pass `enableHyperlinks: false` to disable hyperlink interactivity entirely — no
|
|
241
|
+
hit-testing, no pointer cursor over links, no default navigation, and
|
|
242
|
+
`onHyperlinkClick` is never called; links still render as authored but are inert.
|
|
243
|
+
This applies to every viewer that supports hyperlinks (`DocxViewer`,
|
|
244
|
+
`DocxScrollViewer`, `PptxViewer`, `PptxScrollViewer`, `XlsxViewer`).
|
|
245
|
+
|
|
232
246
|
**Master–detail / shared engine.** Inject an already-loaded headless engine so a
|
|
233
247
|
paged viewer and a scroll viewer (or several panes) share **one** parse. When you
|
|
234
248
|
inject, `load()` is unsupported (the engine is already loaded), the engine's own
|
|
@@ -416,7 +430,7 @@ const current = ref(0);
|
|
|
416
430
|
const total = ref(0);
|
|
417
431
|
|
|
418
432
|
onMounted(async () => {
|
|
419
|
-
viewer = new PptxViewer(canvas.value
|
|
433
|
+
viewer = new PptxViewer(canvas.value as HTMLCanvasElement, {
|
|
420
434
|
onSlideChange: (i, t) => { current.value = i; total.value = t; },
|
|
421
435
|
});
|
|
422
436
|
await viewer.load(props.src);
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -92,15 +92,88 @@ remains entirely MIT / Apache-2.0, with no copyleft licenses:
|
|
|
92
92
|
cargo license --manifest-path packages/mcp-server/Cargo.toml --avoid-dev-deps
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
+
## Unicode Character Database data
|
|
96
|
+
|
|
97
|
+
The line-breaking, vertical-orientation and Arabic-shaping logic is driven
|
|
98
|
+
by tables generated from the Unicode Character Database (UCD), © Unicode,
|
|
99
|
+
Inc., licensed under the [Unicode License v3](#unicode-license-v3-full-text)
|
|
100
|
+
(SPDX: `Unicode-3.0`), which expressly permits copying, modification and
|
|
101
|
+
redistribution of the data files with this notice.
|
|
102
|
+
|
|
103
|
+
Checked into this repository (generator inputs, each retaining its original
|
|
104
|
+
Unicode copyright header; not part of the npm tarball):
|
|
105
|
+
|
|
106
|
+
- `packages/core/scripts/VerticalOrientation.txt` (UAX #50
|
|
107
|
+
Vertical_Orientation, UCD 17.0.0)
|
|
108
|
+
- `packages/docx/scripts/ArabicShaping.txt` (Joining_Type / Joining_Group,
|
|
109
|
+
UCD 17.0.0)
|
|
110
|
+
- `packages/docx/scripts/DerivedJoiningType.txt` (UCD 17.0.0)
|
|
111
|
+
|
|
112
|
+
Shipped in `dist/` as UCD-derived data compiled from the above and from
|
|
113
|
+
`LineBreak.txt` / `DerivedGeneralCategory.txt` / `EastAsianWidth.txt`
|
|
114
|
+
(fetched at generation time, not checked in): the `*.generated.ts` tables
|
|
115
|
+
under `packages/core/src/text/` and `packages/docx/src/` (line-break
|
|
116
|
+
classes, East Asian width, vertical orientation, bidi character data,
|
|
117
|
+
Arabic joining classes).
|
|
118
|
+
|
|
119
|
+
The `unicode-ident` Rust crate listed above also carries `Unicode-3.0` in
|
|
120
|
+
its SPDX expression for the same reason (embedded UCD-derived tables).
|
|
121
|
+
|
|
95
122
|
## License texts
|
|
96
123
|
|
|
97
124
|
- **MIT** — see [LICENSE](./LICENSE) (this repository's own license; the
|
|
98
125
|
MIT-licensed dependencies above use the same standard text with their own
|
|
99
126
|
copyright holder).
|
|
127
|
+
- **Unicode License v3** — canonical text at
|
|
128
|
+
<https://www.unicode.org/license.txt>, reproduced below.
|
|
100
129
|
- **Apache License, Version 2.0** — full text at
|
|
101
130
|
<https://www.apache.org/licenses/LICENSE-2.0>, reproduced below for
|
|
102
131
|
convenience.
|
|
103
132
|
|
|
133
|
+
### Unicode License v3 (full text)
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
UNICODE LICENSE V3
|
|
137
|
+
|
|
138
|
+
COPYRIGHT AND PERMISSION NOTICE
|
|
139
|
+
|
|
140
|
+
Copyright © 1991-2026 Unicode, Inc.
|
|
141
|
+
|
|
142
|
+
NOTICE TO USER: Carefully read the following legal agreement. BY
|
|
143
|
+
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
|
|
144
|
+
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
|
|
145
|
+
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
|
|
146
|
+
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
|
|
147
|
+
|
|
148
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
149
|
+
copy of data files and any associated documentation (the "Data Files") or
|
|
150
|
+
software and any associated documentation (the "Software") to deal in the
|
|
151
|
+
Data Files or Software without restriction, including without limitation
|
|
152
|
+
the rights to use, copy, modify, merge, publish, distribute, and/or sell
|
|
153
|
+
copies of the Data Files or Software, and to permit persons to whom the
|
|
154
|
+
Data Files or Software are furnished to do so, provided that either (a)
|
|
155
|
+
this copyright and permission notice appear with all copies of the Data
|
|
156
|
+
Files or Software, or (b) this copyright and permission notice appear in
|
|
157
|
+
associated Documentation.
|
|
158
|
+
|
|
159
|
+
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
|
160
|
+
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
161
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
162
|
+
THIRD PARTY RIGHTS.
|
|
163
|
+
|
|
164
|
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
|
|
165
|
+
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
|
|
166
|
+
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
167
|
+
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
168
|
+
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
|
|
169
|
+
FILES OR SOFTWARE.
|
|
170
|
+
|
|
171
|
+
Except as contained in this notice, the name of a copyright holder shall
|
|
172
|
+
not be used in advertising or otherwise to promote the sale, use or other
|
|
173
|
+
dealings in these Data Files or Software without prior written
|
|
174
|
+
authorization of the copyright holder.
|
|
175
|
+
```
|
|
176
|
+
|
|
104
177
|
### Apache License 2.0 (full text)
|
|
105
178
|
|
|
106
179
|
```
|