@a3s-lab/office 0.29.0 → 0.30.0

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.
Files changed (50) hide show
  1. package/README.md +100 -3
  2. package/dist/{0~7043.js → 0~7231.js} +160 -2
  3. package/dist/{0~5093.js → 0~7360.js} +233 -52
  4. package/dist/0~document-editor.js +1159 -149
  5. package/dist/0~spreadsheet-editor.js +183 -34
  6. package/dist/0~work-docx-export.js +299 -11
  7. package/dist/0~work-docx-import.js +30 -7
  8. package/dist/0~work-office-diagnostics.js +125 -5
  9. package/dist/1544.js +13 -1
  10. package/dist/4104.js +29 -6
  11. package/dist/4121.js +1939 -1
  12. package/dist/6282.js +501 -1006
  13. package/dist/internal/features/work/editors/document-command-catalog.d.ts +18 -0
  14. package/dist/internal/features/work/editors/document-font-dialog-model.d.ts +5 -2
  15. package/dist/internal/features/work/editors/document-font-dialog-run-shading-model.d.ts +23 -0
  16. package/dist/internal/features/work/editors/document-font-dialog-run-shading-section.d.ts +8 -0
  17. package/dist/internal/features/work/editors/document-page-chrome-ribbon.d.ts +2 -1
  18. package/dist/internal/features/work/editors/document-proofing-dialog-model.d.ts +22 -0
  19. package/dist/internal/features/work/editors/document-proofing-dialog.d.ts +7 -0
  20. package/dist/internal/features/work/editors/document-table-of-contents-dialog.d.ts +10 -0
  21. package/dist/internal/features/work/editors/document-toolbar.d.ts +3 -1
  22. package/dist/internal/features/work/editors/spreadsheet-data-validation.d.ts +7 -1
  23. package/dist/internal/features/work/editors/use-document-insert-commands.d.ts +2 -0
  24. package/dist/internal/features/work/work-document-character-formatting.d.ts +8 -0
  25. package/dist/internal/features/work/work-document-format-changes.d.ts +6 -0
  26. package/dist/internal/features/work/work-document-highlight.d.ts +9 -0
  27. package/dist/internal/features/work/work-document-outline.d.ts +1 -0
  28. package/dist/internal/features/work/work-document-paragraph-shading.d.ts +6 -0
  29. package/dist/internal/features/work/work-document-proofing.d.ts +19 -0
  30. package/dist/internal/features/work/work-document-run-shading.d.ts +12 -0
  31. package/dist/internal/features/work/work-document-table-of-contents-node.d.ts +18 -0
  32. package/dist/internal/features/work/work-document-table-of-contents.d.ts +51 -0
  33. package/dist/internal/features/work/work-document-word-line-metrics.d.ts +3 -0
  34. package/dist/internal/features/work/work-docx-field-instructions.d.ts +1 -1
  35. package/dist/internal/features/work/work-docx-import.d.ts +3 -1
  36. package/dist/internal/features/work/work-docx-proofing-diagnostics.d.ts +3 -0
  37. package/dist/internal/features/work/work-docx-proofing.d.ts +38 -0
  38. package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +7 -0
  39. package/dist/internal/features/work/work-docx-run-shading-diagnostics.d.ts +3 -0
  40. package/dist/internal/features/work/work-docx-run-shading-export.d.ts +17 -0
  41. package/dist/internal/features/work/work-docx-run-shading.d.ts +20 -0
  42. package/dist/internal/features/work/work-docx-table-of-contents-export.d.ts +11 -0
  43. package/dist/internal/features/work/work-docx-table-of-contents-import.d.ts +15 -0
  44. package/dist/internal/features/work/work-spreadsheet-data-validation.d.ts +7 -0
  45. package/dist/internal/features/work/work-types.d.ts +9 -0
  46. package/dist/internal/kernel/office-kernel-protocol.d.ts +1 -0
  47. package/dist/office-kernel.wasm +0 -0
  48. package/dist/styles.css +311 -4
  49. package/docs/latest/en/browser-editor-architecture.md +50 -1
  50. package/package.json +12 -2
package/README.md CHANGED
@@ -54,6 +54,23 @@ workflows, and a separate Rust automation plane.
54
54
  - **Automate deterministically** through the native CLI, standard MCP server,
55
55
  or packaged Office Skill.
56
56
 
57
+ ## Latest on `main`
58
+
59
+ The `0.30.0` release and current Pages deployment expose these capabilities as
60
+ normal user-facing Playground templates, with matching implementation detail
61
+ in the versioned documentation:
62
+
63
+ | Editor | Latest capability | Public entry |
64
+ | --- | --- | --- |
65
+ | Writer | Insert, customize, navigate, and explicitly refresh a typed Table of Contents with heading and native outline levels 1–9, hyperlinks, page numbers, alignment, four leader styles, and native DOCX `TOC` round trips | Playground **Latest capabilities → 可更新目录** · [Document reference](docs/latest/en/components/document.mdx#native-table-of-contents) |
66
+ | Writer | Native character shading with exact `w:shd` patterns, foreground/background color identity, explicit resets, authoring, and DOCX reopen | Playground **Latest capabilities → 字符底纹** · [Document reference](docs/latest/en/components/document.mdx#native-character-shading) |
67
+ | Writer | Independent Latin, East Asian, and bidi proofing languages plus explicit `w:noProof` inclusion/exclusion | Playground **Latest capabilities → 校对语言** · [Document reference](docs/latest/en/components/document.mdx#native-proofing-languages) |
68
+ | Spreadsheet | Complete common Data Validation input, blank/dropdown, and Stop/Warning/Information error settings with native XLSX round trips | Playground **Latest capabilities → 数据验证** · [Spreadsheet reference](docs/latest/en/components/spreadsheet.mdx#data-validation) |
69
+
70
+ The same four entries remain available under **新建**. The highlighted strip
71
+ exists so a capability is discoverable from the first Playground viewport
72
+ instead of only through a deep documentation section or an `?e2e=` fixture.
73
+
57
74
  ## See it working
58
75
 
59
76
  The images below are committed visual-regression baselines from the real
@@ -110,11 +127,11 @@ baseline rather than one specific release.
110
127
 
111
128
  | Capability | A3S Office today | Traditional Office baseline |
112
129
  | --- | --- | --- |
113
- | Text, paragraphs, lists, and styles | **Supported** — structured editing, independent native ASCII, high ANSI, East Asian, and complex-script font slots with direct/theme identity, native all-caps and small-caps effects, exact DOCX character scale plus signed spacing, half-point kerning thresholds, all five native East Asian emphasis marks, native hidden text with explicit visible resets, native character borders with 25 visible line styles plus `nil` and `none`, direct or theme color, width, spacing, shadow, and frame semantics, four independent native outline/shadow/emboss/imprint effects with conflict-safe authoring, and baseline position in one advanced font dialog, all 18 native DOCX underline values with direct or theme color identity, independent native single/double strikethrough with explicit resets, formatting revisions, clipboard, format painter, and undo/redo | Mature authoring with a broader long-tail style and typography catalog |
130
+ | Text, paragraphs, lists, and styles | **Supported** — structured editing, independent native ASCII, high ANSI, East Asian, and complex-script font slots with direct/theme identity, independent Latin/East Asian/bidi proofing-language slots and explicit proofing inclusion/exclusion, native all-caps and small-caps effects, exact DOCX character scale plus signed spacing, half-point kerning thresholds, all five native East Asian emphasis marks, native hidden text with explicit visible resets, native character borders with 25 visible line styles plus `nil` and `none`, direct or theme color, width, spacing, shadow, and frame semantics, four independent native outline/shadow/emboss/imprint effects with conflict-safe authoring, and baseline position in one advanced font dialog, all 18 native DOCX underline values with direct or theme color identity, independent native single/double strikethrough with explicit resets, formatting revisions, clipboard, format painter, and undo/redo | Mature authoring with a broader long-tail style and typography catalog |
114
131
  | Page layout and rendering | **Partial** — sections, margins, page size, columns, headers/footers, fields, and live pagination | Desktop-grade pagination, print layout, and vector output |
115
132
  | Tables, pictures, and equations | **Partial** — rich table geometry, floating pictures, crop/wrap, and structured OMML | Broader drawings, text boxes, charts, WordArt, and SmartArt |
116
133
  | Comments, revisions, and collaboration | **Partial** — comments, suggestions, text/format revisions, decisions, Yjs presence, and host relay contracts | Full revision families plus integrated sharing and review services |
117
- | References and document generation | **Partial** — bookmarks, links, captions, cross-references, citations, notes, and common fields | TOC/index authoring, mail merge, compare/combine, and broader fields |
134
+ | References and document generation | **Partial** — typed Table of Contents authoring and refresh, bookmarks, links, captions, cross-references, citations, notes, and common fields | Index authoring, mail merge, compare/combine, and broader fields |
118
135
  | Ribbon and shortcuts | **Supported** — responsive Office-style ribbon and editor-scoped daily-writing shortcuts | Complete desktop shortcut and contextual-tool surface |
119
136
  | Very large documents | **Supported with boundaries** — bounded 100,000-block plain-document windows and measured edit/navigation budgets | Native-engine virtualization with device-dependent limits |
120
137
  | DOCX and PDF fidelity | **Partial** — source-aware DOCX preservation and live-layout raster PDF export | Broader legacy/OOXML compatibility and searchable vector PDF output |
@@ -127,7 +144,7 @@ baseline rather than one specific release.
127
144
  | Formatting and style rendering | **Partial** — native fonts, colors, borders, alignment, number formats, cell styles, all 17 native non-solid OOXML pattern fills, native linear/path XLSX gradients, and one Format Cells surface that authors none, solid, pattern, or gradient fills with exact geometry and 2–256 ordered stops; static date/time entry, contrast-safe font preview, native XLSX rich-text runs, selected-text font formatting, direct formula-bar/F2 insertion or deletion, and bounded authenticated formatted-HTML paste | Disjoint multi-edit rich-text authoring, broader themes, locale formats, and advanced style effects |
128
145
  | Ribbon and shortcuts | **Partial** — common Office-style Home/Data/View commands, grid-scoped shortcuts, and focused Font-dialog aliases | Larger command catalog and platform-specific accelerators |
129
146
  | Formulas and recalculation | **Partial** — dependency-aware calculation and common formula paths | Wider functions, arrays, volatile semantics, and calculation parity |
130
- | Tables, pivots, charts, and rules | **Partial** — native tables, pivots, charts, conditional formatting, and validation | Calculated columns, slicers, pivot charts, advanced rules, and analysis |
147
+ | Tables, pivots, charts, and rules | **Partial** — native tables, pivots, charts, conditional formatting, and common validation rules with complete input/error-setting authoring | Calculated columns, slicers, pivot charts, custom/dependent validation rules, advanced analysis, and broader browser alert flows |
131
148
  | Large worksheets | **Supported with boundaries** — maximum-dimension sparse import/editing and viewport-bounded Canvas painting | Highly optimized native grid with hardware-dependent limits |
132
149
  | Files and printing | **Partial** — XLS/XLSX/ODS/CSV import, XLSX export, and PDF output | Broader round trips, external data, print fidelity, and legacy conversion |
133
150
  | External data, macros, and specialist analysis | **Gap** — active macros are never executed; bounded models are still needed for data connections and solver-like tools | Established data, macro/add-in, scenario, and optimization ecosystems |
@@ -216,6 +233,19 @@ is requested. The complete gap inventory and exit evidence live in the
216
233
  undoable action. Safe inline DOCX fields round-trip natively, while nested,
217
234
  incomplete, cross-paragraph, deleted, or instructionless structures stay
218
235
  text and produce an explicit compatibility warning.
236
+ Writer Table of Contents blocks reuse the same heading outline and live
237
+ Worker/WASM page resolver instead of maintaining parallel heading or page
238
+ state. Insert, customize, and explicit refresh each commit one TipTap
239
+ transaction and one Undo record. Semantic headings and native outline-level
240
+ paragraphs cover levels 1–9; included items without a native paragraph
241
+ identity receive one in the same transaction so hyperlinks survive
242
+ structural edits. Page-number visibility and alignment,
243
+ dot/dash/underline/no leaders, and at most 512 cached entries remain typed in
244
+ the DOM. DOCX export writes a native `w:sdt`/`TOC` content control and live
245
+ field with cached entries; import accepts the common `\\o`, `\\h`, `\\z`,
246
+ `\\u`, full-range `\\n`, and space-separator `\\p` subset while diagnosing
247
+ lossy custom style mappings. The Playground's **可更新目录** template exposes
248
+ the complete flow.
219
249
  - **Framework choice** — React components, Vue 3 adapters, Custom Elements,
220
250
  and a framework-neutral Core API over the same engine.
221
251
  - **Responsive computation** — Lazy editor chunks, cancellable Workers,
@@ -577,6 +607,34 @@ Protection ranges, passwordless editable ranges, and conditional formatting
577
607
  also remain compact and round-trip through native XLSX records without
578
608
  allocating every covered cell.
579
609
 
610
+ ### Complete Spreadsheet data-validation settings
611
+
612
+ Data → Data Validation authors list, whole-number, decimal, date, and text-length
613
+ rules across one or more selected ranges. The same dialog now owns the complete
614
+ common input and error metadata: `allowBlank`, `showDropdownArrow`,
615
+ `hintTitle`, `hintValue`, `prohibitInput`, `errorStyle`, `errorTitle`, and
616
+ `errorMessage`. Titles are bounded to 32 Unicode code points, the input message
617
+ to 255, and the error message to 225. Disabling a message keeps its text so a
618
+ later re-enable does not discard the user's draft.
619
+
620
+ The mounted grid reads compact rules without expanding blank cells, honors
621
+ `allowBlank`, can hide the in-cell list arrow, shows the authored input title
622
+ and message, and uses the authored error title and message when rejecting an
623
+ invalid value. The current Fortune boundary still has one blocking browser
624
+ alert path whenever error alerts are enabled. `stop`, `warning`, and
625
+ `information` therefore round-trip as exact native file semantics, but the
626
+ browser does not yet reproduce the separate warning/information confirmation
627
+ branches of a desktop suite. Custom formulas and dependent lists also remain
628
+ explicit gaps.
629
+
630
+ XLSX import and export preserve `allowBlank`, `showErrorMessage`,
631
+ `showInputMessage`, `errorStyle`, `errorTitle`, `error`, `promptTitle`, and
632
+ `prompt`. The public `showDropdownArrow` name describes what users see, while
633
+ SpreadsheetML stores the inverse in `showDropDown`. On the public Playground
634
+ home page, choose **新建 → 数据验证** to inspect list, date, and priority
635
+ examples with all three alert styles. This is a normal user-facing template,
636
+ not an `?e2e=` fixture or a documentation-only example.
637
+
580
638
  Native XLSX pattern fills retain all 17 non-solid OOXML pattern identities plus
581
639
  their foreground and background RGB, theme, indexed, automatic, and tint color
582
640
  origins. Canvas draws them only for visible cells, behind text and below table
@@ -757,6 +815,44 @@ layout. Browser and PDF paint are bounded visual approximations; the OOXML
757
815
  semantics remain exact. The Playground's **字符边框** template exercises the
758
816
  complete authoring and one-step Undo path.
759
817
 
818
+ Native Writer character shading retains one exact `w:shd` value rather than a
819
+ flattened CSS fill. The typed model preserves every WordprocessingML pattern,
820
+ direct or automatic foreground/background colors, independent theme channels
821
+ with tint and shade, and explicit `nil`. Document defaults, paragraph and
822
+ character styles, conditional table styles, body, page chrome, notes,
823
+ formatting revisions, strict/transitional import, exact export, and reopen use
824
+ the same resolver. Invalid or spoofed leaves fail closed and are diagnosed.
825
+
826
+ The shared `Cmd/Ctrl+D` Advanced Font Settings dialog distinguishes mixed,
827
+ Follow style, explicit no-shading, and editable pattern/color states; changes
828
+ commit with Format Painter and one-step Undo semantics. The DOM stores bounded
829
+ JSON in `data-office-run-shading`, while CSS projects patterns without changing
830
+ line geometry, so eligible content stays on the Worker/WASM path. Native
831
+ `w:highlight` remains independent and takes display precedence without
832
+ clobbering shading. The Playground's **字符底纹** template demonstrates the
833
+ complete flow.
834
+
835
+ Native Writer proofing languages retain the three independent WordprocessingML
836
+ `w:lang` slots: Latin `w:val`, East Asian `w:eastAsia`, and bidi `w:bidi`.
837
+ Native `w:noProof` remains an independent three-state property: inherited,
838
+ explicitly checked with `w:val="false"`, or excluded from proofing. The Review
839
+ ribbon's **设置校对语言** dialog accepts bounded BCP 47 language tags, keeps
840
+ untouched mixed slots unchanged, exposes Follow style for each slot, and applies
841
+ the touched language and proofing-state fields through one transaction and one
842
+ Undo record. The same contract is available while editing headers and footers.
843
+
844
+ Document defaults, paragraph and character styles, body text, headers,
845
+ footers, footnotes, endnotes, formatting revisions, strict/transitional DOCX
846
+ import, exact export, and reopen share the closed model. Malformed, duplicated,
847
+ misplaced, namespace-spoofed, nested, text-bearing, extra-attribute, invalid-tag,
848
+ or invalid on/off input fails closed and appears in compatibility diagnostics.
849
+ The DOM stores canonical JSON in `data-office-proofing-languages`, stores an
850
+ explicit Boolean in `data-office-no-proof`, and projects the effective `lang`
851
+ and `spellcheck` attributes without claiming a bundled dictionary or grammar
852
+ service. Valid effective languages also reach the Worker/WASM text-layout run
853
+ and RustyBuzz shaping buffer. The Playground's **校对语言** template demonstrates
854
+ Latin, East Asian, bidi, explicitly checked, and excluded states.
855
+
760
856
  Supported native OMML equations now survive as bounded structured objects in
761
857
  the document body, headers, footers, footnotes, and endnotes. Inline and display
762
858
  math, Unicode runs with literal/normal-text semantics, math script/style,
@@ -1457,6 +1553,7 @@ without hard-coded return URLs.
1457
1553
 
1458
1554
  - [Live Playground](https://a3s-lab.github.io/Office/)
1459
1555
  - [Documentation center](https://a3s-lab.github.io/Office/docs/)
1556
+ - [A3S Office 0.30.0 documentation](https://a3s-lab.github.io/Office/docs/0.30.0/)
1460
1557
  - [A3S Office 0.29.0 documentation](https://a3s-lab.github.io/Office/docs/0.29.0/)
1461
1558
  - [A3S Office 0.28.0 documentation](https://a3s-lab.github.io/Office/docs/0.28.0/)
1462
1559
  - [A3S Office 0.27.0 documentation](https://a3s-lab.github.io/Office/docs/0.27.0/)
@@ -1,5 +1,5 @@
1
1
  import jszip from "jszip";
2
- import { serializeUtf8Xml, directChildren, xmlNamespacePrefix, parseXml, firstDescendant, decodeXmlBytes, directChild, descendants, attribute as work_ooxml_package_attribute } from "./4121.js";
2
+ import { serializeUtf8Xml, directChildren, xmlNamespacePrefix, normalizeDocumentLanguageTag, parseXml, firstDescendant, decodeXmlBytes, directChild, descendants, normalizeDocumentProofingLanguages, attribute as work_ooxml_package_attribute } from "./4121.js";
3
3
  import { normalizeDocumentEmphasisMark, normalizeDocumentCharacterScalePercent, documentCitationStyle, normalizeDocumentKerningThresholdHalfPoints, normalizeDocumentCharacterPositionHalfPoints, normalizeDocumentCharacterSpacingTwips, normalizeDocumentTabStops, createDocumentBibliography, documentCitationStyleDetails } from "./6282.js";
4
4
  const BIBLIOGRAPHY_NAMESPACE = 'http://schemas.openxmlformats.org/officeDocument/2006/bibliography';
5
5
  const CUSTOM_XML_NAMESPACE = 'http://schemas.openxmlformats.org/officeDocument/2006/customXml';
@@ -1251,6 +1251,164 @@ function hexFactor(value) {
1251
1251
  function isDocxThemeResolver(source) {
1252
1252
  return Boolean(source && 'colors' in source && source.colors instanceof Map && 'fonts' in source && source.fonts instanceof Map);
1253
1253
  }
1254
+ const LANGUAGE_ATTRIBUTES = new Map([
1255
+ [
1256
+ 'val',
1257
+ 'latin'
1258
+ ],
1259
+ [
1260
+ 'eastAsia',
1261
+ 'eastAsia'
1262
+ ],
1263
+ [
1264
+ 'bidi',
1265
+ 'bidi'
1266
+ ]
1267
+ ]);
1268
+ function inspectDocxProofingLanguages(properties) {
1269
+ if (!properties) return {
1270
+ status: 'absent',
1271
+ spoofedCount: 0
1272
+ };
1273
+ const matches = directChildren(properties, 'lang');
1274
+ if (!matches.length) return {
1275
+ status: 'absent',
1276
+ spoofedCount: 0
1277
+ };
1278
+ const native = matches.filter((element)=>isWordElement(element));
1279
+ const spoofedCount = matches.length - native.length;
1280
+ if (1 !== matches.length || 1 !== native.length) return {
1281
+ status: 'invalid',
1282
+ spoofedCount
1283
+ };
1284
+ const element = native[0];
1285
+ if (!element || element.childNodes.length) return {
1286
+ status: 'invalid',
1287
+ spoofedCount
1288
+ };
1289
+ const languages = {};
1290
+ for (const attribute of Array.from(element.attributes)){
1291
+ if (work_docx_proofing_isNamespaceDeclaration(attribute)) continue;
1292
+ const name = wordAttributeLocalName(element, attribute);
1293
+ const slot = name ? LANGUAGE_ATTRIBUTES.get(name) : void 0;
1294
+ if (!slot) return {
1295
+ status: 'invalid',
1296
+ spoofedCount
1297
+ };
1298
+ const language = normalizeDocumentLanguageTag(attribute.value);
1299
+ if (!language) return {
1300
+ status: 'invalid',
1301
+ spoofedCount
1302
+ };
1303
+ languages[slot] = language;
1304
+ }
1305
+ return Object.keys(languages).length ? {
1306
+ status: 'valid',
1307
+ value: languages,
1308
+ spoofedCount
1309
+ } : {
1310
+ status: 'invalid',
1311
+ spoofedCount
1312
+ };
1313
+ }
1314
+ function inspectDocxNoProof(properties) {
1315
+ if (!properties) return {
1316
+ status: 'absent',
1317
+ spoofedCount: 0
1318
+ };
1319
+ const matches = directChildren(properties, 'noProof');
1320
+ if (!matches.length) return {
1321
+ status: 'absent',
1322
+ spoofedCount: 0
1323
+ };
1324
+ const native = matches.filter((element)=>isWordElement(element));
1325
+ const spoofedCount = matches.length - native.length;
1326
+ if (1 !== matches.length || 1 !== native.length) return {
1327
+ status: 'invalid',
1328
+ spoofedCount
1329
+ };
1330
+ const element = native[0];
1331
+ if (!element || element.childNodes.length) return {
1332
+ status: 'invalid',
1333
+ spoofedCount
1334
+ };
1335
+ const attributes = Array.from(element.attributes).filter((attribute)=>!work_docx_proofing_isNamespaceDeclaration(attribute));
1336
+ if (attributes.length > 1 || attributes.some((attribute)=>'val' !== wordAttributeLocalName(element, attribute))) return {
1337
+ status: 'invalid',
1338
+ spoofedCount
1339
+ };
1340
+ if (!attributes.length) return {
1341
+ status: 'valid',
1342
+ value: true,
1343
+ spoofedCount
1344
+ };
1345
+ const value = onOffValue(attributes[0]?.value);
1346
+ return void 0 === value ? {
1347
+ status: 'invalid',
1348
+ spoofedCount
1349
+ } : {
1350
+ status: 'valid',
1351
+ value,
1352
+ spoofedCount
1353
+ };
1354
+ }
1355
+ function resolveDocxProofing(propertySources) {
1356
+ let languages;
1357
+ let noProof;
1358
+ let invalidCount = 0;
1359
+ let spoofedCount = 0;
1360
+ for (const properties of propertySources){
1361
+ const languageInspection = inspectDocxProofingLanguages(properties);
1362
+ spoofedCount += languageInspection.spoofedCount;
1363
+ if ('valid' === languageInspection.status) languages = {
1364
+ ...languages,
1365
+ ...languageInspection.value
1366
+ };
1367
+ else if ('invalid' === languageInspection.status) invalidCount += 1;
1368
+ const noProofInspection = inspectDocxNoProof(properties);
1369
+ spoofedCount += noProofInspection.spoofedCount;
1370
+ if ('valid' === noProofInspection.status) noProof = noProofInspection.value;
1371
+ else if ('invalid' === noProofInspection.status) invalidCount += 1;
1372
+ }
1373
+ return {
1374
+ languages,
1375
+ noProof,
1376
+ invalidCount,
1377
+ spoofedCount
1378
+ };
1379
+ }
1380
+ function documentProofingLanguageDocxOptions(source) {
1381
+ const languages = normalizeDocumentProofingLanguages(source);
1382
+ if (!languages) return;
1383
+ return {
1384
+ ...languages.latin ? {
1385
+ value: languages.latin
1386
+ } : {},
1387
+ ...languages.eastAsia ? {
1388
+ eastAsia: languages.eastAsia
1389
+ } : {},
1390
+ ...languages.bidi ? {
1391
+ bidirectional: languages.bidi
1392
+ } : {}
1393
+ };
1394
+ }
1395
+ function isWordElement(element) {
1396
+ return DOCX_WORDPROCESSING_NAMESPACES.has(element.namespaceURI ?? '');
1397
+ }
1398
+ function work_docx_proofing_isNamespaceDeclaration(attribute) {
1399
+ return 'xmlns' === attribute.name || 'xmlns' === attribute.prefix || 'http://www.w3.org/2000/xmlns/' === attribute.namespaceURI;
1400
+ }
1401
+ function wordAttributeLocalName(element, attribute) {
1402
+ if (attribute.namespaceURI === element.namespaceURI) return attribute.localName;
1403
+ const prefix = element.prefix ?? element.tagName.split(':')[0];
1404
+ const lexicalPrefix = prefix ? `${prefix}:` : '';
1405
+ return null === attribute.namespaceURI && lexicalPrefix && attribute.name.startsWith(lexicalPrefix) ? attribute.name.slice(lexicalPrefix.length) : null;
1406
+ }
1407
+ function onOffValue(source) {
1408
+ const value = source?.trim().toLowerCase();
1409
+ if ('1' === value || 'true' === value || 'on' === value) return true;
1410
+ if ('0' === value || 'false' === value || 'off' === value) return false;
1411
+ }
1254
1412
  function paragraphAlignment(element, docx) {
1255
1413
  const alignment = element.style.textAlign;
1256
1414
  if ('center' === alignment) return docx.AlignmentType.CENTER;
@@ -1579,4 +1737,4 @@ function isParagraphPartRoot(root, path) {
1579
1737
  const expected = /^word\/header\d*\.xml$/i.test(path) ? 'hdr' : /^word\/footer\d*\.xml$/i.test(path) ? 'ftr' : /^word\/footnotes\.xml$/i.test(path) ? 'footnotes' : /^word\/endnotes\.xml$/i.test(path) ? 'endnotes' : 'document';
1580
1738
  return root.localName === expected && DOCX_WORDPROCESSING_NAMESPACES.has(root.namespaceURI ?? '');
1581
1739
  }
1582
- export { DOCX_COLOR_SCHEME_MAPPING_ATTRIBUTES, DOCX_WORDPROCESSING_NAMESPACES, DocxParagraphDefaultCollapsedPatchCollector, STRICT_WORDPROCESSING_NAMESPACE, XMLNS_NAMESPACE, XML_NAMESPACE, assertXmlRoot, cloneXmlElement, createDocxThemeResolver, cssColorToHex, cssFontFamily, cssFontSize, dataBoolean, docxCharacterPositionHalfPointsFromProperties, docxCharacterPositionValue, docxCharacterScalePercentFromProperties, docxCharacterScaleValue, docxCharacterSpacingTwipsFromProperties, docxCharacterSpacingValue, docxEmphasisMarkRunOptions, docxKerningThresholdValue, docxThemeColor, docxThemeFont, domDirection, hasNonWhitespaceXmlText, inspectDocxEmphasisMark, inspectDocxKerningThresholdHalfPoints, mergeDocxIgnorableExtensions, mergeDocxIgnorableExtensionsAtPairs, paragraphAlignment, paragraphBidirectional, paragraphDirectionOptions, paragraphIndent, paragraphPaginationOptions, paragraphSpacingOptions, paragraphTabStops, parseBoundedDocxInteger, parseDocxColorSchemeMappingElement, parseDocxParagraphDefaultCollapsed, parseDocxTwipsMeasure, patchDocxBibliography, patchDocxExplicitZeroCharacterSpacing, patchDocxExplicitZeroKerningThresholds, patchDocxParagraphDefaultCollapsed, readDocxBibliography, resolveDocxEmphasisMark, resolveDocxKerningThresholdHalfPoints, resolveDocxThemeResolver, xmlAttributeLocalName, xmlAttributeNamespace, xmlDeclaredPrefix, xmlNamespaceUri };
1740
+ export { DOCX_COLOR_SCHEME_MAPPING_ATTRIBUTES, DOCX_WORDPROCESSING_NAMESPACES, DocxParagraphDefaultCollapsedPatchCollector, STRICT_WORDPROCESSING_NAMESPACE, XMLNS_NAMESPACE, XML_NAMESPACE, assertXmlRoot, cloneXmlElement, createDocxThemeResolver, cssColorToHex, cssFontFamily, cssFontSize, dataBoolean, documentProofingLanguageDocxOptions, docxCharacterPositionHalfPointsFromProperties, docxCharacterPositionValue, docxCharacterScalePercentFromProperties, docxCharacterScaleValue, docxCharacterSpacingTwipsFromProperties, docxCharacterSpacingValue, docxEmphasisMarkRunOptions, docxKerningThresholdValue, docxThemeColor, docxThemeFont, domDirection, hasNonWhitespaceXmlText, inspectDocxEmphasisMark, inspectDocxKerningThresholdHalfPoints, inspectDocxNoProof, inspectDocxProofingLanguages, mergeDocxIgnorableExtensions, mergeDocxIgnorableExtensionsAtPairs, paragraphAlignment, paragraphBidirectional, paragraphDirectionOptions, paragraphIndent, paragraphPaginationOptions, paragraphSpacingOptions, paragraphTabStops, parseBoundedDocxInteger, parseDocxColorSchemeMappingElement, parseDocxParagraphDefaultCollapsed, parseDocxTwipsMeasure, patchDocxBibliography, patchDocxExplicitZeroCharacterSpacing, patchDocxExplicitZeroKerningThresholds, patchDocxParagraphDefaultCollapsed, readDocxBibliography, resolveDocxEmphasisMark, resolveDocxKerningThresholdHalfPoints, resolveDocxProofing, resolveDocxThemeResolver, xmlAttributeLocalName, xmlAttributeNamespace, xmlDeclaredPrefix, xmlNamespaceUri };