@a3s-lab/office 0.31.0 → 0.33.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 (63) hide show
  1. package/README.md +63 -8
  2. package/dist/0~3539.js +2 -2
  3. package/dist/0~3557.js +1 -1
  4. package/dist/0~3635.js +1 -1
  5. package/dist/0~4808.js +1 -1
  6. package/dist/0~4980.js +1 -1
  7. package/dist/0~7048.js +1 -2
  8. package/dist/0~7240.js +1 -1
  9. package/dist/0~7614.js +1 -1
  10. package/dist/{0~6090.js → 0~8136.js} +71 -2
  11. package/dist/{0~4595.js → 0~9073.js} +3 -72
  12. package/dist/0~9445.js +1 -1
  13. package/dist/0~document-editor.js +1087 -6
  14. package/dist/0~markdown-editor.js +2 -2
  15. package/dist/0~pdf-page-organization-engine.js +187 -0
  16. package/dist/0~pdf-viewer.js +1014 -30
  17. package/dist/0~presentation-editor.js +2 -2
  18. package/dist/0~spreadsheet-editor.js +4 -3
  19. package/dist/0~work-docx-export.js +1 -1
  20. package/dist/0~work-docx-import.js +10 -27
  21. package/dist/0~work-docx-large-document-import.js +1 -1
  22. package/dist/0~work-office-diagnostics.js +3 -3
  23. package/dist/0~work-pptx-import.js +1 -1
  24. package/dist/{1544.js → 3266.js} +17 -1862
  25. package/dist/4121.js +13 -0
  26. package/dist/4166.js +3848 -0
  27. package/dist/{6282.js → 4174.js} +383 -10
  28. package/dist/9333.js +1849 -0
  29. package/dist/core.d.ts +1 -0
  30. package/dist/core.js +5259 -4
  31. package/dist/index.js +3 -3
  32. package/dist/internal/features/work/editors/document-compare-dialog.d.ts +14 -0
  33. package/dist/internal/features/work/editors/document-toolbar.d.ts +3 -1
  34. package/dist/internal/features/work/editors/pdf-editor-extensions.d.ts +11 -0
  35. package/dist/internal/features/work/editors/pdf-page-organization-engine.d.ts +2 -0
  36. package/dist/internal/features/work/editors/pdf-page-organization-plan.d.ts +10 -0
  37. package/dist/internal/features/work/editors/pdf-page-organization-types.d.ts +68 -0
  38. package/dist/internal/features/work/editors/pdf-page-organization-worker-client.d.ts +2 -0
  39. package/dist/internal/features/work/editors/pdf-page-organization-worker-protocol.d.ts +13 -0
  40. package/dist/internal/features/work/editors/pdf-page-organization.d.ts +3 -0
  41. package/dist/internal/features/work/editors/pdf-page-organization.worker.d.ts +1 -0
  42. package/dist/internal/features/work/editors/pdf-page-organizer-dialog.d.ts +17 -0
  43. package/dist/internal/features/work/editors/pdf-thumbnail-rail.d.ts +4 -0
  44. package/dist/internal/features/work/editors/pdf-toolbar.d.ts +2 -1
  45. package/dist/internal/features/work/editors/pdf-viewer.d.ts +3 -1
  46. package/dist/internal/features/work/editors/use-document-comparison.d.ts +9 -0
  47. package/dist/internal/features/work/editors/use-pdf-page-organization.d.ts +38 -0
  48. package/dist/internal/features/work/work-document-changes.d.ts +5 -0
  49. package/dist/internal/features/work/work-document-compare-diff.d.ts +38 -0
  50. package/dist/internal/features/work/work-document-compare-stability.d.ts +5 -0
  51. package/dist/internal/features/work/work-document-compare.d.ts +27 -0
  52. package/dist/office-kernel.wasm +0 -0
  53. package/dist/pdf-page-organization.worker.js +19667 -0
  54. package/dist/pdf-page-organization.worker.js.LICENSE.txt +14 -0
  55. package/dist/react.d.ts +1 -0
  56. package/dist/styles.css +509 -0
  57. package/dist/vue.d.ts +3 -1
  58. package/dist/vue.js +2 -0
  59. package/dist/web-component.d.ts +3 -1
  60. package/dist/web-component.js +9 -0
  61. package/docs/latest/en/browser-editor-architecture.md +52 -6
  62. package/package.json +10 -3
  63. package/dist/4104.js +0 -9336
package/README.md CHANGED
@@ -56,21 +56,25 @@ workflows, and a separate Rust automation plane.
56
56
 
57
57
  ## Latest on `main`
58
58
 
59
- The `0.31.0` release plus the current `main` branch expose these capabilities
59
+ The `0.33.0` release plus the current `main` branch expose these capabilities
60
60
  as normal user-facing Playground templates, with matching implementation
61
61
  detail in the documentation:
62
62
 
63
63
  | Editor | Latest capability | Public entry |
64
64
  | --- | --- | --- |
65
+ | Writer | Compare the current document with an imported DOCX, HTML, or TXT version and generate deterministic insertion, deletion, character-formatting, and paragraph-formatting revisions; combine a reviewed copy only after exact baseline verification | Playground **Latest capabilities → 文档比较** · [Document reference](docs/latest/en/components/document.mdx#document-compare-and-combine) |
65
66
  | 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
67
  | Writer | Mark primary and secondary index terms, cross-references, and bold/italic page numbers; insert, navigate, customize, and refresh a bounded native index with editable DOCX `XE` and `INDEX` round trips | Playground **Latest capabilities → 原生索引** · [Document reference](docs/latest/en/components/document.mdx#native-document-index) |
67
68
  | 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) |
68
69
  | 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) |
69
70
  | 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) |
71
+ | PDF | Insert, delete, rotate, reorder, extract, merge, and split pages through a dedicated Web Worker, with Blob-level Undo/Redo and independent binary reopen verification | Playground **Latest capabilities → 组织 PDF 页面** · [PDF reference](docs/latest/en/components/pdf.mdx#page-organization) |
70
72
 
71
- The same five entries remain available under **新建**. The highlighted strip
72
- exists so a capability is discoverable from the first Playground viewport
73
- instead of only through a deep documentation section or an `?e2e=` fixture.
73
+ All seven entries are reachable from the first Playground viewport. The six
74
+ content templates also remain under **新建**; **组织 PDF 页面** opens the normal
75
+ PDF file workflow because page organization must operate on host-provided source
76
+ bytes. The highlighted strip keeps each capability discoverable without a deep
77
+ documentation section or an `?e2e=` fixture.
74
78
 
75
79
  ## See it working
76
80
 
@@ -107,9 +111,9 @@ The images below are committed visual-regression baselines from the real
107
111
  </td>
108
112
  <td width="50%" valign="top">
109
113
  <a href="visual-tests/__snapshots__/linux/desktop-1280/pdf.png">
110
- <img src="visual-tests/__snapshots__/linux/desktop-1280/pdf.png" alt="A3S Office PDF editor with search, annotation, save, and download controls">
114
+ <img src="visual-tests/__snapshots__/linux/desktop-1280/pdf.png" alt="A3S Office PDF editor with search, annotation, page organization, save, and download controls">
111
115
  </a>
112
- <br><sub><strong>PDF</strong> — PDFium rendering, forms, annotations, Yjs overlays, and save</sub>
116
+ <br><sub><strong>PDF</strong> — PDFium rendering, forms, annotations, page organization, Yjs overlays, and save</sub>
113
117
  </td>
114
118
  </tr>
115
119
  </table>
@@ -132,7 +136,8 @@ baseline rather than one specific release.
132
136
  | Page layout and rendering | **Partial** — sections, margins, page size, columns, headers/footers, fields, and live pagination | Desktop-grade pagination, print layout, and vector output |
133
137
  | Tables, pictures, and equations | **Partial** — rich table geometry, floating pictures, crop/wrap, and structured OMML | Broader drawings, text boxes, charts, WordArt, and SmartArt |
134
138
  | 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 |
135
- | References and document generation | **Partial** — typed Table of Contents and native index authoring/refresh, bookmarks, links, captions, cross-references, citations, notes, and common fields | Mail merge, compare/combine, tables of figures/authorities, and broader fields |
139
+ | Document compare and combine | **Partial** — deterministic same-layout paragraph/heading comparison produces reviewable text, character-formatting, and paragraph-formatting revisions; reviewed-copy combine requires an exact reject-all baseline match | Mature structural, object, move-range, and multi-copy conflict handling |
140
+ | References and document generation | **Partial** — typed Table of Contents and native index authoring/refresh, bookmarks, links, captions, cross-references, citations, notes, and common fields | Mail merge, tables of figures/authorities, and broader fields |
136
141
  | Ribbon and shortcuts | **Supported** — responsive Office-style ribbon and editor-scoped daily-writing shortcuts | Complete desktop shortcut and contextual-tool surface |
137
142
  | 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 |
138
143
  | DOCX and PDF fidelity | **Partial** — source-aware DOCX preservation and live-layout raster PDF export | Broader legacy/OOXML compatibility and searchable vector PDF output |
@@ -171,7 +176,7 @@ baseline rather than one specific release.
171
176
  | Search and text evidence | **Supported with boundaries** — browser search and bounded native text-layer evidence | Broader tagged-PDF reading order and accessibility extraction |
172
177
  | Annotations, forms, and save | **Supported** — common annotations, appearance controls, form filling, history, and save | Broader stamps, measurements, form authoring, scripts, and signatures |
173
178
  | Existing text, image, and object editing | **Gap** — no safe production content-stream editing path | Direct text/object editing with font and layout recovery |
174
- | Page organization | **Gap** — insert, delete, rotate, reorder, extract, merge, and split are not yet editable | Complete page organization workflows |
179
+ | Page organization | **Supported with boundaries** — insert, delete, rotate, reorder, extract, merge, and split run in a dedicated Worker, replace one complete Blob per mutation, and participate in Undo/Redo | Broader document-level catalog preservation and signed/encrypted-file workflows |
175
180
  | Compression, conversion, and OCR | **Gap / host boundary** — provider contracts are required for authoritative conversion and OCR | Integrated optimization, conversion, and scanned-document recognition |
176
181
  | Signatures, protection, and redaction | **Gap / host boundary** — trusted identity and destructive-content guarantees are required | E-signing, certificate validation, encryption, sanitization, and true redaction |
177
182
  | AI and real-time collaboration | **Host-owned** — typed page/text evidence, Yjs review records, presence, and provider-neutral ports | Typically bundled with account, storage, and model services |
@@ -431,6 +436,51 @@ viewer or pre-initialize the PDFium Worker. On the local reference machine it
431
436
  improved median shell mount by 41.6 ms but did not improve the viewer-ready
432
437
  median, so Worker initialization remains the measured boundary.
433
438
 
439
+ ### Organize and persist PDF pages
440
+
441
+ Providing `onSave` enables the page organizer. Every insert, delete, rotate,
442
+ reorder, or merge produces one replacement PDF `Blob` and one page-history
443
+ record; extract and split return separate files without changing the source.
444
+ Use `onPageExport` when the host should persist those derived files instead of
445
+ letting the viewer download them:
446
+
447
+ ```tsx
448
+ import type { PdfPageOrganizationExport } from '@a3s-lab/office/react';
449
+ import { PdfViewer } from '@a3s-lab/office/react';
450
+
451
+ async function persistPageExports(
452
+ files: readonly PdfPageOrganizationExport[],
453
+ ): Promise<boolean> {
454
+ await Promise.all(
455
+ files.map(({ fileName, pageCount, pdf }) =>
456
+ storage.put(fileName, pdf, { pageCount }),
457
+ ),
458
+ );
459
+ return true;
460
+ }
461
+
462
+ <PdfViewer
463
+ fileName="contract.pdf"
464
+ loadSource={() => storage.get('contract.pdf')}
465
+ onSave={async (pdf) => {
466
+ await storage.put('contract.pdf', pdf);
467
+ return true;
468
+ }}
469
+ onPageExport={persistPageExports}
470
+ />;
471
+ ```
472
+
473
+ Page jobs load lazily in a dedicated Web Worker. The primary PDF is limited to
474
+ 256 MiB, a merged PDF to 128 MiB, and every result to 4,096 pages. Toolbar
475
+ Undo/Redo consumes native annotation or form history first, then page history.
476
+ Signed or encrypted PDFs fail closed; delete, reorder, and merge also reject
477
+ forms, outlines, or tagged structures whose page references cannot be safely
478
+ rewritten. Extract and split surface a diagnostic when document-level catalog
479
+ objects are intentionally not copied. Page organization is unavailable while
480
+ `collaboration` or `evidenceOverlay` is active because those modes identify an
481
+ immutable source PDF. See the complete
482
+ [PDF page-organization contract](docs/latest/en/components/pdf.mdx#page-organization).
483
+
434
484
  ### Persist a structured document snapshot
435
485
 
436
486
  Hosts that round-trip controlled document values across a process or language
@@ -1545,6 +1595,9 @@ bun run lint
1545
1595
  bun run typecheck
1546
1596
  bun run test
1547
1597
  bun run build
1598
+ bun run test:e2e:pdf-page-organization:check
1599
+ bun run test:e2e:pdf-page-organization
1600
+ bun run playground:visual:pdf-page-organization
1548
1601
  bun run test:e2e:large-pdf:check
1549
1602
  bun run test:e2e:large-pdf
1550
1603
  bun run performance:pdf
@@ -1569,6 +1622,8 @@ without hard-coded return URLs.
1569
1622
 
1570
1623
  - [Live Playground](https://a3s-lab.github.io/Office/)
1571
1624
  - [Documentation center](https://a3s-lab.github.io/Office/docs/)
1625
+ - [A3S Office 0.33.0 documentation](https://a3s-lab.github.io/Office/docs/0.33.0/)
1626
+ - [A3S Office 0.32.0 documentation](https://a3s-lab.github.io/Office/docs/0.32.0/)
1572
1627
  - [A3S Office 0.31.0 documentation](https://a3s-lab.github.io/Office/docs/0.31.0/)
1573
1628
  - [A3S Office 0.30.0 documentation](https://a3s-lab.github.io/Office/docs/0.30.0/)
1574
1629
  - [A3S Office 0.29.0 documentation](https://a3s-lab.github.io/Office/docs/0.29.0/)
package/dist/0~3539.js CHANGED
@@ -6,8 +6,8 @@ import { effectiveSpreadsheetCalculationSettings, workSpreadsheetCombinationSeri
6
6
  import { presentationChartLegendPositionLabel, presentationChartShowsLegend, normalizePresentationChartLegendPosition, presentationChartUsesNumericXAxis, normalizePresentationBubbleSizeRepresents, normalizePresentationBubbleScale, presentationChartAxes, normalizePresentationChartDataLabels, presentationChartTypeLabel, presentationChartDataLabelPositionLabel, normalizePresentationScatterStyle } from "./0~work-presentation-charts.js";
7
7
  import { OfficeCheckbox, CommittedOfficeNumberField, CollectionState } from "./0~7048.js";
8
8
  import { OfficeColorPicker } from "./0~3635.js";
9
- import { OfficeSelect } from "./0~4595.js";
10
- import { office_text_field_OfficeTextField, CommittedOfficeTextField } from "./0~6090.js";
9
+ import { OfficeSelect } from "./0~9073.js";
10
+ import { office_text_field_OfficeTextField, CommittedOfficeTextField } from "./0~8136.js";
11
11
  function spreadsheetAgentMenuItems(selection, onAgentRequest, applyProposal) {
12
12
  return [
13
13
  {
package/dist/0~3557.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useLayoutEffect, useMemo, useRef } from "react";
2
- import { matchesOfficeEditorKeyboardShortcut } from "./0~6090.js";
2
+ import { matchesOfficeEditorKeyboardShortcut } from "./0~8136.js";
3
3
  const DEFAULT_EXTENSION_PRIORITY = 100;
4
4
  function createOfficeEditorExtension(config) {
5
5
  const name = config.name.trim();
package/dist/0~3635.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Ban, Check, ChevronDown } from "lucide-react";
3
3
  import { useEffect, useRef, useState } from "react";
4
- import { button_Button, Popover } from "./0~6090.js";
4
+ import { button_Button, Popover } from "./0~8136.js";
5
5
  const THEME_COLORS = [
6
6
  '#111827',
7
7
  '#1f2937',
package/dist/0~4808.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import jszip from "jszip";
2
2
  import { normalizeDocumentIndexEntryDraft, serializeUtf8Xml, directChildren, xmlNamespacePrefix, normalizeDocumentLanguageTag, parseXml, firstDescendant, decodeXmlBytes, directChild, descendants, normalizeDocumentProofingLanguages, attribute as work_ooxml_package_attribute, normalizeDocumentIndexOptions } from "./4121.js";
3
- import { normalizeDocumentEmphasisMark, normalizeDocumentCharacterScalePercent, documentCitationStyle, normalizeDocumentKerningThresholdHalfPoints, normalizeDocumentCharacterPositionHalfPoints, normalizeDocumentCharacterSpacingTwips, normalizeDocumentTabStops, createDocumentBibliography, documentCitationStyleDetails } from "./6282.js";
3
+ import { normalizeDocumentEmphasisMark, normalizeDocumentCharacterScalePercent, documentCitationStyle, normalizeDocumentKerningThresholdHalfPoints, normalizeDocumentCharacterPositionHalfPoints, normalizeDocumentCharacterSpacingTwips, normalizeDocumentTabStops, createDocumentBibliography, documentCitationStyleDetails } from "./4174.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';
6
6
  const OFFICE_RELATIONSHIPS_NAMESPACE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships';
package/dist/0~4980.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import jszip from "jszip";
2
- import { documentNoteKey } from "./6282.js";
2
+ import { documentNoteKey } from "./4174.js";
3
3
  import { directChild, xmlNamespacePrefix, attribute, parseXml } from "./4121.js";
4
4
  import { DEFAULT_DOCUMENT_PAGE_COLOR, normalizeDocumentPageColor } from "./0~work-document-page-color.js";
5
5
  const MAX_NATIVE_ID = 2147483647;
package/dist/0~7048.js CHANGED
@@ -1,8 +1,7 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useId, useRef, useState } from "react";
3
3
  import { Check, ChevronDown, ChevronUp, Minus } from "lucide-react";
4
- import { Dialog } from "./0~4595.js";
5
- import { button_Button, office_text_field_OfficeTextField, office_text_field_OfficeTextArea } from "./0~6090.js";
4
+ import { button_Button, office_text_field_OfficeTextArea, office_text_field_OfficeTextField, Dialog } from "./0~8136.js";
6
5
  import { OFFICE_KERNEL_SPREADSHEET_MAX_ROWS as office_kernel_spreadsheet_protocol_OFFICE_KERNEL_SPREADSHEET_MAX_ROWS, isOfficeKernelSpreadsheetError } from "./4121.js";
7
6
  function CollectionState({ children, icon, actions, tone = 'neutral', role, className = '' }) {
8
7
  return /*#__PURE__*/ jsxs("div", {
package/dist/0~7240.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { documentRunBorderDomAttributes, normalizeDocumentRunBorder, normalizeDocumentParagraphBorder, serializeDocumentRunBorder, serializeDocumentRunShading, documentIndexEntryHtml, attribute as work_ooxml_package_attribute, documentScriptFontFallbackSlots, documentScriptFontsDomAttributes, documentHighlightFromDocxValue, documentTableOfContentsHtml, directChildren as work_ooxml_package_directChildren, documentParagraphShadingDomAttributes, serializeDocxThemeReference, documentParagraphBordersDomAttributes, normalizeDocumentScriptFontHint, normalizeDocumentScriptFonts, DOCUMENT_PARAGRAPH_BORDER_STYLES, normalizeDocumentParagraphBorders as work_document_paragraph_borders_normalizeDocumentParagraphBorders, DOCUMENT_PARAGRAPH_BORDER_EDGES, documentScriptFontFamily, normalizeDocumentThemeFont, normalizeDocumentParagraphId, documentHighlightDomAttributes, descendants, documentIndexHtml, documentHighlightCssColor, xmlNamespacePrefix, normalizeDocumentFontName, documentProofingDomAttributes, work_document_paragraph_shading_DOCUMENT_PARAGRAPH_SHADING_PATTERNS, directChild, documentScriptFontSegments, childPath, parseDocumentTableOfContentsInstruction, documentRunShadingDomAttributes } from "./4121.js";
2
2
  import { docxThemeFont, XML_NAMESPACE as work_docx_settings_xml_XML_NAMESPACE, parseDocumentIndexEntryInstruction, resolveDocxProofing, parseDocumentIndexInstruction, XMLNS_NAMESPACE as work_docx_settings_xml_XMLNS_NAMESPACE, STRICT_WORDPROCESSING_NAMESPACE, docxCharacterSpacingTwipsFromProperties, parseBoundedDocxInteger, xmlAttributeLocalName, docxCharacterScalePercentFromProperties, resolveDocxEmphasisMark, docxCharacterPositionHalfPointsFromProperties, docxThemeColor, parseDocxParagraphDefaultCollapsed, resolveDocxKerningThresholdHalfPoints, resolveDocxThemeResolver as work_docx_theme_resolveDocxThemeResolver, DOCX_WORDPROCESSING_NAMESPACES, xmlAttributeNamespace, parseDocxTwipsMeasure } from "./0~4808.js";
3
- import { normalizeDocumentEmphasisMark, normalizeDocumentPageBorders, documentCharacterPositionDomAttributes, DOCUMENT_PAGE_BORDER_EDGES, normalizeDocumentTabStops, documentTextCaseFromWordFlags, documentStrikeDomAttributes, documentAutoLineHeight, documentKerningDomAttributes, normalizeDocumentUnderlineColor, documentCharacterScaleDomAttributes, serializeDocumentParagraphFormatting, normalizeDocumentPaperSource, documentEquationText, documentLegacyTextEffectsDomAttributes, documentLegacyTextEffectsConflict, documentCharacterSpacingDomAttributes, normalizeDocumentParagraphIndent, normalizeDocumentEquation, renderDocumentAutoLineHeight, documentUnderlineDomAttributes, normalizeDocumentUnderlineStyle, applyDocumentTextCaseStyle, documentHiddenTextDomAttributes, importedDocumentCharacterFormatting, DOCUMENT_LEGACY_TEXT_EFFECT_NAMES, createDocumentEquationElement, normalizeDocumentPageGeometry, serializeDocumentTabStops, documentWordLineHeightFactor, documentEmphasisMarkDomAttributes, normalizeDocumentPageMargins } from "./6282.js";
3
+ import { normalizeDocumentEmphasisMark, normalizeDocumentPageBorders, documentCharacterPositionDomAttributes, DOCUMENT_PAGE_BORDER_EDGES, normalizeDocumentTabStops, documentTextCaseFromWordFlags, documentStrikeDomAttributes, documentAutoLineHeight, documentKerningDomAttributes, normalizeDocumentUnderlineColor, documentCharacterScaleDomAttributes, serializeDocumentParagraphFormatting, normalizeDocumentPaperSource, documentEquationText, documentLegacyTextEffectsDomAttributes, documentLegacyTextEffectsConflict, documentCharacterSpacingDomAttributes, normalizeDocumentParagraphIndent, normalizeDocumentEquation, renderDocumentAutoLineHeight, documentUnderlineDomAttributes, normalizeDocumentUnderlineStyle, applyDocumentTextCaseStyle, documentHiddenTextDomAttributes, importedDocumentCharacterFormatting, DOCUMENT_LEGACY_TEXT_EFFECT_NAMES, createDocumentEquationElement, normalizeDocumentPageGeometry, serializeDocumentTabStops, documentWordLineHeightFactor, documentEmphasisMarkDomAttributes, normalizeDocumentPageMargins } from "./4174.js";
4
4
  function docxCaptionSequenceKind(instruction) {
5
5
  const identifier = /^\s*SEQ\s+([^\s\\]+)/i.exec(instruction)?.[1]?.toLowerCase();
6
6
  if (!identifier) return null;
package/dist/0~7614.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import jszip from "jszip";
2
2
  import { descendants, directChildren, directChild, xmlNamespacePrefix, attribute, firstDescendant, parseXml } from "./4121.js";
3
3
  import { normalizePresentationChartDataLabelPosition, normalizePresentationChartDataLabels, normalizePresentationChartSeriesStyle } from "./0~work-presentation-charts.js";
4
- import { parseXlsxChartSeriesStyle, xlsxChartSeriesMarkerXml, parseXlsxTrendline, isSupportedXlsxChartLegend, isSupportedXlsxChartPlotLayout, isSupportedXlsxChartSeriesFormatting, parseXlsxChartPlotLayout, parseXlsxChartLegend, xlsxChartSeriesShapePropertiesXml, parseXlsxErrorBars } from "./4104.js";
4
+ import { parseXlsxChartSeriesStyle, xlsxChartSeriesMarkerXml, parseXlsxTrendline, isSupportedXlsxChartLegend, isSupportedXlsxChartPlotLayout, isSupportedXlsxChartSeriesFormatting, parseXlsxChartPlotLayout, parseXlsxChartLegend, xlsxChartSeriesShapePropertiesXml, parseXlsxErrorBars } from "./4166.js";
5
5
  import { workSpreadsheetChartSupportsErrorBars, workSpreadsheetChartSupportsGrouping, normalizeWorkSpreadsheetChartSmoothLines, workSpreadsheetChartSupportsSeriesAnalysis, normalizeWorkSpreadsheetChartSeriesStyle, normalizeWorkSpreadsheetErrorBars, normalizeWorkSpreadsheetChartOverlap, workSpreadsheetChartUsesNumericXAxis, workSpreadsheetChartSupportsBarSpacing, normalizeWorkSpreadsheetChartLegendOverlay, normalizeWorkSpreadsheetChartGapWidth, normalizeWorkSpreadsheetChartGrouping, workSpreadsheetChartSupportsTrendlines, workSpreadsheetChartSupportsSmoothLines, normalizeWorkSpreadsheetTrendline } from "./8715.js";
6
6
  import { createWorkSlideTransition } from "./0~work-presentation-transition.js";
7
7
  const PRESENTATION_NAMESPACE = 'http://schemas.openxmlformats.org/presentationml/2006/main';
@@ -1,7 +1,7 @@
1
1
  import { forwardRef, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { Bot, LocateFixed, UsersRound, X } from "lucide-react";
3
4
  import { createPortal } from "react-dom";
4
- import { Bot, LocateFixed, UsersRound } from "lucide-react";
5
5
  import { useOfficeCollaborationPresence, useOfficeCollaborationParticipantNavigation } from "./432.js";
6
6
  const focusableSelector = 'button:not(:disabled), input:not(:disabled):not([type="hidden"]), textarea:not(:disabled), select:not(:disabled), a[href], [contenteditable="true"], [tabindex]:not([tabindex="-1"])';
7
7
  const activeFocusScopes = [];
@@ -292,6 +292,75 @@ const icon_button_IconButton = /*#__PURE__*/ forwardRef(function({ label, toolti
292
292
  children: children
293
293
  });
294
294
  });
295
+ function Dialog({ title, description, children, footer, onClose, closeDisabled = false, className, focusKey, restoreFocusTarget }) {
296
+ const titleId = useId();
297
+ const descriptionId = useId();
298
+ const portalRootRef = useRef(null);
299
+ if (!portalRootRef.current && "u" > typeof document) portalRootRef.current = officeOverlayPortalRoot(document, restoreFocusTarget?.());
300
+ const focusScope = useDialogFocusScope({
301
+ onEscape: onClose,
302
+ escapeDisabled: closeDisabled,
303
+ restoreFocusTarget
304
+ });
305
+ useEffect(()=>{
306
+ if (void 0 !== focusKey) focusScope.focusInitial();
307
+ }, [
308
+ focusKey,
309
+ focusScope.focusInitial
310
+ ]);
311
+ const dialog = /*#__PURE__*/ jsx("dialog", {
312
+ open: true,
313
+ className: "ds-dialog-backdrop",
314
+ role: "presentation",
315
+ onCancel: (event)=>{
316
+ event.preventDefault();
317
+ if (!closeDisabled) onClose();
318
+ },
319
+ children: /*#__PURE__*/ jsxs("section", {
320
+ ref: focusScope.scopeRef,
321
+ className: `ds-dialog${className ? ` ${className}` : ''}`,
322
+ role: "dialog",
323
+ "aria-modal": "true",
324
+ "aria-labelledby": titleId,
325
+ "aria-describedby": description ? descriptionId : void 0,
326
+ onKeyDown: focusScope.handleKeyDown,
327
+ children: [
328
+ /*#__PURE__*/ jsxs("header", {
329
+ children: [
330
+ /*#__PURE__*/ jsxs("div", {
331
+ children: [
332
+ /*#__PURE__*/ jsx("h2", {
333
+ id: titleId,
334
+ children: title
335
+ }),
336
+ description && /*#__PURE__*/ jsx("p", {
337
+ id: descriptionId,
338
+ children: description
339
+ })
340
+ ]
341
+ }),
342
+ /*#__PURE__*/ jsx(icon_button_IconButton, {
343
+ label: "关闭",
344
+ disabled: closeDisabled,
345
+ onClick: onClose,
346
+ children: /*#__PURE__*/ jsx(X, {
347
+ size: 16
348
+ })
349
+ })
350
+ ]
351
+ }),
352
+ /*#__PURE__*/ jsx("div", {
353
+ className: "ds-dialog-body",
354
+ children: children
355
+ }),
356
+ footer && /*#__PURE__*/ jsx("footer", {
357
+ children: footer
358
+ })
359
+ ]
360
+ })
361
+ });
362
+ return "u" > typeof document && portalRootRef.current ? /*#__PURE__*/ createPortal(dialog, portalRootRef.current) : dialog;
363
+ }
295
364
  const office_text_field_OfficeTextField = /*#__PURE__*/ forwardRef(function({ className = '', type = 'text', ...props }, ref) {
296
365
  return /*#__PURE__*/ jsx("input", {
297
366
  ref: ref,
@@ -1340,4 +1409,4 @@ function useOfficeEditorWheelZoom({ enabled = true, scopeRef, onZoomIn, onZoomOu
1340
1409
  scopeRef
1341
1410
  ]);
1342
1411
  }
1343
- export { CommittedOfficeTextArea, CommittedOfficeTextField, MarkdownSourcePresenceLayer, OfficePresenceAvatar, OfficeTiptapPresenceLayer, Popover, WorkOfficeCollaborationParticipants, button_Button, icon_button_IconButton, matchesAriaKeyShortcuts, matchesOfficeEditorKeyboardShortcut, moveOfficeGridMenuFocus, moveOfficeMenuFocus, officeOverlayPortalRoot, officePresenceColor, officePresenceColorStyle, office_text_field_OfficeFileInput, office_text_field_OfficeTextArea, office_text_field_OfficeTextField, stepOfficeZoom, useDialogFocusScope, useOfficeEditorWheelZoom, useOfficePublishPresenceLocation, useOfficeRemoteParticipants };
1412
+ export { CommittedOfficeTextArea, CommittedOfficeTextField, Dialog, MarkdownSourcePresenceLayer, OfficePresenceAvatar, OfficeTiptapPresenceLayer, Popover, WorkOfficeCollaborationParticipants, button_Button, icon_button_IconButton, matchesAriaKeyShortcuts, matchesOfficeEditorKeyboardShortcut, moveOfficeGridMenuFocus, moveOfficeMenuFocus, officeOverlayPortalRoot, officePresenceColor, officePresenceColorStyle, office_text_field_OfficeFileInput, office_text_field_OfficeTextArea, office_text_field_OfficeTextField, stepOfficeZoom, useDialogFocusScope, useOfficeEditorWheelZoom, useOfficePublishPresenceLocation, useOfficeRemoteParticipants };
@@ -1,8 +1,8 @@
1
1
  import { Fragment as jsx_runtime_Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Fragment, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
3
3
  import { createPortal } from "react-dom";
4
- import { ArrowUpRight, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Eye, Minus, Plus, X } from "lucide-react";
5
- import { WorkOfficeCollaborationParticipants, moveOfficeMenuFocus, useDialogFocusScope, icon_button_IconButton, Popover, matchesAriaKeyShortcuts, officeOverlayPortalRoot } from "./0~6090.js";
4
+ import { ArrowUpRight, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Eye, Minus, Plus } from "lucide-react";
5
+ import { WorkOfficeCollaborationParticipants, moveOfficeMenuFocus, Popover, matchesAriaKeyShortcuts, officeOverlayPortalRoot } from "./0~8136.js";
6
6
  const CONTEXT_MENU_MARGIN = 8;
7
7
  const CONTEXT_MENU_TAB_STOP_SELECTOR = 'a[href]:not([tabindex="-1"]), button:not(:disabled):not([tabindex="-1"]), input:not(:disabled):not([type="hidden"]):not([tabindex="-1"]), select:not(:disabled):not([tabindex="-1"]), textarea:not(:disabled):not([tabindex="-1"]), [contenteditable="true"]:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])';
8
8
  function isWorkspaceContextMenuKeyboardEvent({ key, shiftKey }) {
@@ -274,75 +274,6 @@ function contextMenuAvailableBounds(ownerDocument, view, portalRoot) {
274
274
  function clampCoordinate(value, minimum, maximum) {
275
275
  return Math.max(minimum, Math.min(value, Math.max(minimum, maximum)));
276
276
  }
277
- function Dialog({ title, description, children, footer, onClose, closeDisabled = false, className, focusKey, restoreFocusTarget }) {
278
- const titleId = useId();
279
- const descriptionId = useId();
280
- const portalRootRef = useRef(null);
281
- if (!portalRootRef.current && "u" > typeof document) portalRootRef.current = officeOverlayPortalRoot(document, restoreFocusTarget?.());
282
- const focusScope = useDialogFocusScope({
283
- onEscape: onClose,
284
- escapeDisabled: closeDisabled,
285
- restoreFocusTarget
286
- });
287
- useEffect(()=>{
288
- if (void 0 !== focusKey) focusScope.focusInitial();
289
- }, [
290
- focusKey,
291
- focusScope.focusInitial
292
- ]);
293
- const dialog = /*#__PURE__*/ jsx("dialog", {
294
- open: true,
295
- className: "ds-dialog-backdrop",
296
- role: "presentation",
297
- onCancel: (event)=>{
298
- event.preventDefault();
299
- if (!closeDisabled) onClose();
300
- },
301
- children: /*#__PURE__*/ jsxs("section", {
302
- ref: focusScope.scopeRef,
303
- className: `ds-dialog${className ? ` ${className}` : ''}`,
304
- role: "dialog",
305
- "aria-modal": "true",
306
- "aria-labelledby": titleId,
307
- "aria-describedby": description ? descriptionId : void 0,
308
- onKeyDown: focusScope.handleKeyDown,
309
- children: [
310
- /*#__PURE__*/ jsxs("header", {
311
- children: [
312
- /*#__PURE__*/ jsxs("div", {
313
- children: [
314
- /*#__PURE__*/ jsx("h2", {
315
- id: titleId,
316
- children: title
317
- }),
318
- description && /*#__PURE__*/ jsx("p", {
319
- id: descriptionId,
320
- children: description
321
- })
322
- ]
323
- }),
324
- /*#__PURE__*/ jsx(icon_button_IconButton, {
325
- label: "关闭",
326
- disabled: closeDisabled,
327
- onClick: onClose,
328
- children: /*#__PURE__*/ jsx(X, {
329
- size: 16
330
- })
331
- })
332
- ]
333
- }),
334
- /*#__PURE__*/ jsx("div", {
335
- className: "ds-dialog-body",
336
- children: children
337
- }),
338
- footer && /*#__PURE__*/ jsx("footer", {
339
- children: footer
340
- })
341
- ]
342
- })
343
- });
344
- return "u" > typeof document && portalRootRef.current ? /*#__PURE__*/ createPortal(dialog, portalRootRef.current) : dialog;
345
- }
346
277
  function OfficeSelect({ ariaLabel, value, options, onValueChange, disabled = false, placeholder = '请选择', className = '', ariaKeyShortcuts, initialFocus = false }) {
347
278
  const reactId = useId().replaceAll(':', '');
348
279
  const [open, setOpen] = useState(false);
@@ -1293,4 +1224,4 @@ function WorkOfficeZoomControls({ zoom, minimum = 50, maximum = 200, step = 10,
1293
1224
  ]
1294
1225
  });
1295
1226
  }
1296
- export { Dialog, OfficeSelect, Tabs, WorkOfficePreviewBar, WorkOfficeRibbon, WorkOfficeRibbonButton, WorkOfficeRibbonGroup, WorkOfficeStatusBar, WorkOfficeZoomControls, WorkspaceContextMenu, isWorkspaceContextMenuKeyboardEvent, workspaceContextMenuPosition };
1227
+ export { OfficeSelect, Tabs, WorkOfficePreviewBar, WorkOfficeRibbon, WorkOfficeRibbonButton, WorkOfficeRibbonGroup, WorkOfficeStatusBar, WorkOfficeZoomControls, WorkspaceContextMenu, isWorkspaceContextMenuKeyboardEvent, workspaceContextMenuPosition };
package/dist/0~9445.js CHANGED
@@ -2,7 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Minus, Plus, Table2 } from "lucide-react";
3
3
  import { useEffect, useRef, useState } from "react";
4
4
  import { materializeWorkFile } from "./9356.js";
5
- import { Popover } from "./0~6090.js";
5
+ import { Popover } from "./0~8136.js";
6
6
  async function readOfficeFileAsDataUrl(file) {
7
7
  const ownedFile = await materializeWorkFile(file);
8
8
  return new Promise((resolve, reject)=>{