@portone/docx-editor 0.6.8 → 0.6.9

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 (189) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/CONTRIBUTING.md +2 -2
  3. package/dist/DocxEditor.d.ts +9 -9
  4. package/dist/core.d.ts +27 -27
  5. package/dist/docx/commentOnlyChange.d.ts +3 -3
  6. package/dist/docx/comments/durable.d.ts +4 -4
  7. package/dist/docx/comments/grammar.d.ts +2 -2
  8. package/dist/docx/comments/model.d.ts +1 -1
  9. package/dist/docx/comments/parts.d.ts +6 -6
  10. package/dist/docx/comments/people.d.ts +4 -4
  11. package/dist/docx/comments/policy.d.ts +1 -1
  12. package/dist/docx/comments/reading.d.ts +1 -1
  13. package/dist/docx/comments/writing.d.ts +3 -3
  14. package/dist/docx/comments.d.ts +3 -3
  15. package/dist/docx/compareDocx.d.ts +3 -3
  16. package/dist/docx/exportDocx.d.ts +4 -4
  17. package/dist/docx/exportRefs.d.ts +4 -4
  18. package/dist/docx/formatting/attrs.d.ts +8 -8
  19. package/dist/docx/formatting/context.d.ts +6 -6
  20. package/dist/docx/formatting/direct.d.ts +3 -3
  21. package/dist/docx/formatting/resolve.d.ts +5 -5
  22. package/dist/docx/formatting/runProperties.d.ts +3 -3
  23. package/dist/docx/formatting/styles.d.ts +5 -5
  24. package/dist/docx/formatting/tabStops.d.ts +2 -2
  25. package/dist/docx/formatting.d.ts +7 -7
  26. package/dist/docx/headersFooters.d.ts +6 -6
  27. package/dist/docx/hyperlink.d.ts +1 -1
  28. package/dist/docx/identities.d.ts +1 -1
  29. package/dist/docx/importDocx.d.ts +3 -3
  30. package/dist/docx/importParagraph.d.ts +4 -4
  31. package/dist/docx/importPolicy.d.ts +1 -1
  32. package/dist/docx/importPreserved.d.ts +1 -1
  33. package/dist/docx/importTable.d.ts +2 -2
  34. package/dist/docx/invariants.d.ts +4 -4
  35. package/dist/docx/media.d.ts +2 -2
  36. package/dist/docx/newLists.d.ts +2 -2
  37. package/dist/docx/notes/newNote.d.ts +3 -3
  38. package/dist/docx/notes/numbering.d.ts +2 -2
  39. package/dist/docx/notes/reading.d.ts +3 -3
  40. package/dist/docx/notes/references.d.ts +1 -1
  41. package/dist/docx/notes/writing.d.ts +2 -2
  42. package/dist/docx/numberingPlanner.d.ts +2 -2
  43. package/dist/docx/paraProps.d.ts +2 -2
  44. package/dist/docx/partPlan.d.ts +4 -4
  45. package/dist/docx/partPlanners.d.ts +2 -2
  46. package/dist/docx/protectionPolicy.d.ts +5 -5
  47. package/dist/docx/runProps.d.ts +4 -4
  48. package/dist/docx/scan.d.ts +1 -1
  49. package/dist/docx/sdt.d.ts +1 -1
  50. package/dist/docx/sections.d.ts +2 -2
  51. package/dist/docx/serializeBlock.d.ts +1 -1
  52. package/dist/docx/serializeParagraph.d.ts +1 -1
  53. package/dist/docx/serializePreserved.d.ts +3 -3
  54. package/dist/docx/serializeSdtBlock.d.ts +1 -1
  55. package/dist/docx/serializeStory.d.ts +2 -2
  56. package/dist/docx/serializeTable.d.ts +2 -2
  57. package/dist/docx/session.d.ts +9 -9
  58. package/dist/docx/story.d.ts +6 -6
  59. package/dist/docx/storyParts.d.ts +7 -7
  60. package/dist/docx/storyProjection.d.ts +1 -1
  61. package/dist/docx/tableFormatting/conditions.d.ts +2 -2
  62. package/dist/docx/tableFormatting/editing.d.ts +2 -2
  63. package/dist/docx/tableFormatting/reading.d.ts +5 -5
  64. package/dist/docx/tableFormatting.d.ts +3 -3
  65. package/dist/docx/tableTemplate.d.ts +2 -2
  66. package/dist/docx/wrappers.d.ts +2 -2
  67. package/dist/download.d.ts +2 -2
  68. package/dist/editor/clipboard/blockReaders.d.ts +3 -3
  69. package/dist/editor/clipboard/htmlReader.d.ts +4 -4
  70. package/dist/editor/clipboard/images.d.ts +1 -1
  71. package/dist/editor/clipboard/internalChannel.d.ts +3 -3
  72. package/dist/editor/clipboard/normalizers.d.ts +4 -4
  73. package/dist/editor/clipboard/parser.d.ts +2 -2
  74. package/dist/editor/clipboard/plugin.d.ts +2 -2
  75. package/dist/editor/clipboard/readContext.d.ts +4 -4
  76. package/dist/editor/clipboard/readers.d.ts +2 -2
  77. package/dist/editor/commands/commentCommands.d.ts +3 -3
  78. package/dist/editor/commands/comments/editing.d.ts +1 -1
  79. package/dist/editor/commands/comments/model.d.ts +1 -1
  80. package/dist/editor/commands/comments/reading.d.ts +1 -1
  81. package/dist/editor/commands/exportQueries.d.ts +2 -2
  82. package/dist/editor/commands/fidelityQueries.d.ts +2 -2
  83. package/dist/editor/commands/formatting/propertyCommands.d.ts +1 -1
  84. package/dist/editor/commands/formatting/reading.d.ts +2 -2
  85. package/dist/editor/commands/formatting/shared.d.ts +1 -1
  86. package/dist/editor/commands/formattingCommands.d.ts +2 -2
  87. package/dist/editor/commands/index.d.ts +39 -39
  88. package/dist/editor/commands/listCommands.d.ts +4 -4
  89. package/dist/editor/commands/noteCommands.d.ts +1 -1
  90. package/dist/editor/commands/noteQueries.d.ts +3 -3
  91. package/dist/editor/commands/paragraphCommands.d.ts +1 -1
  92. package/dist/editor/commands/spacingCommands.d.ts +1 -1
  93. package/dist/editor/createEditor.d.ts +6 -6
  94. package/dist/editor/documentStyles.d.ts +3 -3
  95. package/dist/editor/editorDocument.d.ts +6 -6
  96. package/dist/editor/formatSource.d.ts +1 -1
  97. package/dist/editor/imageFiles.d.ts +2 -2
  98. package/dist/editor/insertImage.d.ts +1 -1
  99. package/dist/editor/notes/noteSurface.d.ts +4 -4
  100. package/dist/editor/paragraphEdits.d.ts +2 -2
  101. package/dist/editor/paragraphPlacement.d.ts +1 -1
  102. package/dist/editor/plugins/commentComposer.d.ts +1 -1
  103. package/dist/editor/plugins/commentDecorations.d.ts +2 -2
  104. package/dist/editor/plugins/displayDerivation.d.ts +2 -2
  105. package/dist/editor/plugins/documentProtection.d.ts +2 -2
  106. package/dist/editor/plugins/keymap.d.ts +1 -1
  107. package/dist/editor/plugins/noteLifecycle.d.ts +1 -1
  108. package/dist/editor/plugins/noteNavigation.d.ts +1 -1
  109. package/dist/editor/plugins/noteNumbering.d.ts +1 -1
  110. package/dist/editor/plugins/numberingDecorations.d.ts +2 -2
  111. package/dist/editor/plugins/paragraphDisplay.d.ts +1 -1
  112. package/dist/editor/plugins/tabLayout.d.ts +1 -1
  113. package/dist/editor/plugins/tableDisplay.d.ts +1 -1
  114. package/dist/editor/stories/storyMarkup.d.ts +1 -1
  115. package/dist/editor/stories/storyState.d.ts +4 -4
  116. package/dist/editor/stories/storyView.d.ts +4 -4
  117. package/dist/editor/views/runMarkView.d.ts +1 -1
  118. package/dist/index.d.ts +26 -26
  119. package/dist/model/format.d.ts +1 -1
  120. package/dist/numbering/listRegistry.d.ts +1 -1
  121. package/dist/numbering/listTemplate.d.ts +1 -1
  122. package/dist/numbering/markers.d.ts +2 -2
  123. package/dist/numbering/parseNumbering.d.ts +5 -5
  124. package/dist/numbering/writeNumbering.d.ts +1 -1
  125. package/dist/ooxml/element.d.ts +1 -1
  126. package/dist/ooxml/partSplice.d.ts +2 -2
  127. package/dist/ooxml/precedence.d.ts +1 -1
  128. package/dist/ooxml/props.d.ts +1 -1
  129. package/dist/ooxml/simpleTypes.d.ts +1 -1
  130. package/dist/ooxml/tabStops.d.ts +1 -1
  131. package/dist/ooxml/tagScan.d.ts +1 -1
  132. package/dist/ooxml/units.d.ts +2 -2
  133. package/dist/ooxml/xml.d.ts +1 -1
  134. package/dist/page/PageGuides.d.ts +2 -2
  135. package/dist/page/blockKinds.d.ts +1 -1
  136. package/dist/page/demands/footnoteDemands.d.ts +1 -1
  137. package/dist/page/demands/index.d.ts +1 -1
  138. package/dist/page/kinds/index.d.ts +1 -1
  139. package/dist/page/kinds/paragraphKind.d.ts +1 -1
  140. package/dist/page/kinds/sdtBlockKind.d.ts +1 -1
  141. package/dist/page/kinds/tableKind.d.ts +1 -1
  142. package/dist/page/measureBlocks.d.ts +1 -1
  143. package/dist/page/pageDecorations.d.ts +3 -3
  144. package/dist/page/pageLayout.d.ts +4 -4
  145. package/dist/page/usePageLayout.d.ts +2 -2
  146. package/dist/schema/clipboard.d.ts +1 -1
  147. package/dist/schema/controlEdges.d.ts +1 -1
  148. package/dist/schema/displayDerivation.d.ts +1 -1
  149. package/dist/schema/docxSchema.d.ts +1 -1
  150. package/dist/schema/guards.d.ts +4 -4
  151. package/dist/schema/index.d.ts +5 -5
  152. package/dist/schema/locks.d.ts +1 -1
  153. package/dist/schema/preservedGuards.d.ts +1 -1
  154. package/dist/schema/protectionState.d.ts +1 -1
  155. package/dist/schema/rendering.d.ts +1 -1
  156. package/dist/styles/inlineStyle.d.ts +3 -3
  157. package/dist/styles/lineSpacings.d.ts +1 -1
  158. package/dist/table/cellBorders.d.ts +1 -1
  159. package/dist/table/cellFormatting.d.ts +3 -3
  160. package/dist/table/format.d.ts +1 -1
  161. package/dist/table/gridBorders.d.ts +2 -2
  162. package/dist/table/index.d.ts +5 -5
  163. package/dist/table/resize.d.ts +1 -1
  164. package/dist/table/widths.d.ts +1 -1
  165. package/dist/ui/AlignMenu.d.ts +2 -2
  166. package/dist/ui/CellStyleGroup.d.ts +3 -3
  167. package/dist/ui/ColorPicker.d.ts +1 -1
  168. package/dist/ui/CommentsPanel.d.ts +1 -1
  169. package/dist/ui/FontFamilySelect.d.ts +3 -3
  170. package/dist/ui/FontSizeSelect.d.ts +2 -2
  171. package/dist/ui/LinkCard.d.ts +1 -1
  172. package/dist/ui/ParagraphStyleSelect.d.ts +3 -3
  173. package/dist/ui/SpacingMenu.d.ts +2 -2
  174. package/dist/ui/TableMenu.d.ts +2 -2
  175. package/dist/ui/TableSizePicker.d.ts +1 -1
  176. package/dist/ui/TextMenu.d.ts +2 -2
  177. package/dist/ui/Toolbar.d.ts +4 -4
  178. package/dist/ui/ZoomSelect.d.ts +1 -1
  179. package/dist/ui/comments/CommentComposer.d.ts +1 -1
  180. package/dist/ui/comments/useCommentRailLayout.d.ts +1 -1
  181. package/dist/ui/noteItems.d.ts +1 -1
  182. package/dist/ui/notes/NoteAreas.d.ts +5 -5
  183. package/dist/ui/notes/NoteList.d.ts +3 -3
  184. package/dist/ui/notes/StoryRow.d.ts +5 -5
  185. package/dist/ui/notes/noteBands.d.ts +7 -7
  186. package/dist/ui/notes/noteHeights.d.ts +2 -2
  187. package/dist/ui/notes/useStorySurface.d.ts +5 -5
  188. package/dist/ui/presets.d.ts +3 -3
  189. package/package.json +5 -3
@@ -2,10 +2,10 @@
2
2
  import type { EditorState } from "prosemirror-state";
3
3
  import type { EditorView } from "prosemirror-view";
4
4
  import { type ReactElement } from "react";
5
- import type { ActiveSurface } from "../editor/stories/storyView";
6
- import type { FontFallbacks } from "../styles/fontStack";
7
- import type { DocxEditorPresets } from "./presets";
8
- import type { DocxEditorZoom } from "./zoom";
5
+ import type { ActiveSurface } from "../editor/stories/storyView.js";
6
+ import type { FontFallbacks } from "../styles/fontStack.js";
7
+ import type { DocxEditorPresets } from "./presets.js";
8
+ import type { DocxEditorZoom } from "./zoom.js";
9
9
  /** One editing surface the toolbar can act on: the document's own, or a story's */
10
10
  export interface ToolbarSurface {
11
11
  view: EditorView;
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from "react";
2
- import { type DocxEditorZoom } from "./zoom";
2
+ import { type DocxEditorZoom } from "./zoom.js";
3
3
  export interface ZoomSelectProps {
4
4
  zoom: DocxEditorZoom;
5
5
  onZoomChange: (zoom: DocxEditorZoom) => void;
@@ -1,5 +1,5 @@
1
1
  import { type ReactElement } from "react";
2
- import type { CommentAuthor } from "../../editor/commands/commentCommands";
2
+ import type { CommentAuthor } from "../../editor/commands/commentCommands.js";
3
3
  interface FocusedTextareaProps {
4
4
  label: string;
5
5
  value: string;
@@ -1,6 +1,6 @@
1
1
  import type { EditorView } from "prosemirror-view";
2
2
  import { type RefObject } from "react";
3
- import type { DocumentComment } from "../../editor/commands/commentCommands";
3
+ import type { DocumentComment } from "../../editor/commands/commentCommands.js";
4
4
  export declare const COMPOSER_POSITION = "composer";
5
5
  interface CommentRailLayoutOptions {
6
6
  panel: RefObject<HTMLElement | null>;
@@ -9,7 +9,7 @@
9
9
  */
10
10
  import type { LucideIcon } from "lucide-react";
11
11
  import type { Command } from "prosemirror-state";
12
- import type { SurfaceCapabilities } from "../editor/stories/storyView";
12
+ import type { SurfaceCapabilities } from "../editor/stories/storyView.js";
13
13
  export interface NoteItem {
14
14
  readonly label: string;
15
15
  readonly icon: LucideIcon;
@@ -10,11 +10,11 @@
10
10
  * left scrolls inside it.
11
11
  */
12
12
  import type { CSSProperties, ReactElement } from "react";
13
- import type { NoteRow } from "../../editor/commands/noteQueries";
14
- import type { PageOverlay } from "../../page/usePageLayout";
15
- import { type StoryKey } from "../../schema/stories";
16
- import type { FontFallbacks } from "../../styles/fontStack";
17
- import { type NoteHeightReport, type RowEditing } from "./StoryRow";
13
+ import type { NoteRow } from "../../editor/commands/noteQueries.js";
14
+ import type { PageOverlay } from "../../page/usePageLayout.js";
15
+ import { type StoryKey } from "../../schema/stories.js";
16
+ import type { FontFallbacks } from "../../styles/fontStack.js";
17
+ import { type NoteHeightReport, type RowEditing } from "./StoryRow.js";
18
18
  /** The room one page keeps for notes, as the notes drawn in it are placed and named */
19
19
  export interface NoteArea {
20
20
  readonly page: number;
@@ -10,9 +10,9 @@
10
10
  * wraps here where it would on the page.
11
11
  */
12
12
  import type { CSSProperties, ReactElement } from "react";
13
- import type { NoteRow } from "../../editor/commands/noteQueries";
14
- import type { PagePixels } from "../../page/pageLayout";
15
- import type { FontFallbacks } from "../../styles/fontStack";
13
+ import type { NoteRow } from "../../editor/commands/noteQueries.js";
14
+ import type { PagePixels } from "../../page/pageLayout.js";
15
+ import type { FontFallbacks } from "../../styles/fontStack.js";
16
16
  export interface NoteListProps {
17
17
  readonly footnotes: readonly NoteRow[];
18
18
  readonly endnotes: readonly NoteRow[];
@@ -13,11 +13,11 @@
13
13
  import type { Node as PMNode } from "prosemirror-model";
14
14
  import type { EditorState } from "prosemirror-state";
15
15
  import { type ReactElement } from "react";
16
- import type { EditorDocument } from "../../editor/editorDocument";
17
- import { type StoryMarkupOptions } from "../../editor/stories/storyMarkup";
18
- import { type StoryCaret, type StoryExtensions, type StoryHost } from "../../editor/stories/storyView";
19
- import type { StoryKey } from "../../schema/stories";
20
- import type { FontFallbacks } from "../../styles/fontStack";
16
+ import type { EditorDocument } from "../../editor/editorDocument.js";
17
+ import { type StoryMarkupOptions } from "../../editor/stories/storyMarkup.js";
18
+ import { type StoryCaret, type StoryExtensions, type StoryHost } from "../../editor/stories/storyView.js";
19
+ import type { StoryKey } from "../../schema/stories.js";
20
+ import type { FontFallbacks } from "../../styles/fontStack.js";
21
21
  export type DrawStory = (story: PMNode, options: StoryMarkupOptions) => DocumentFragment;
22
22
  /** Hands on the height a row stands at on the paper, the zoom taken back out */
23
23
  export type NoteHeightReport = (key: StoryKey, height: number) => void;
@@ -13,13 +13,13 @@
13
13
  */
14
14
  import type { EditorState } from "prosemirror-state";
15
15
  import type { CSSProperties, ReactElement } from "react";
16
- import { type NoteRow } from "../../editor/commands/noteQueries";
17
- import type { DemandBand } from "../../page/demands";
18
- import type { PagePixels, TrailingRows } from "../../page/pageLayout";
19
- import type { PageOverlay } from "../../page/usePageLayout";
20
- import type { StoryKey } from "../../schema/stories";
21
- import { type FontFallbacks } from "../../styles/fontStack";
22
- import type { NoteHeightReport, RowEditing } from "./StoryRow";
16
+ import { type NoteRow } from "../../editor/commands/noteQueries.js";
17
+ import type { DemandBand } from "../../page/demands/index.js";
18
+ import type { PagePixels, TrailingRows } from "../../page/pageLayout.js";
19
+ import type { PageOverlay } from "../../page/usePageLayout.js";
20
+ import type { StoryKey } from "../../schema/stories.js";
21
+ import { type FontFallbacks } from "../../styles/fontStack.js";
22
+ import type { NoteHeightReport, RowEditing } from "./StoryRow.js";
23
23
  /** What a document's notes ask of the page layout, and what is needed to draw them */
24
24
  export interface NoteBands {
25
25
  /**
@@ -1,5 +1,5 @@
1
- import type { StoryKey } from "../../schema/stories";
2
- import type { NoteHeightReport } from "./StoryRow";
1
+ import type { StoryKey } from "../../schema/stories.js";
2
+ import type { NoteHeightReport } from "./StoryRow.js";
3
3
  /**
4
4
  * The height each note stands at, as its row last reported it, for the document `of` names.
5
5
  *
@@ -8,11 +8,11 @@
8
8
  */
9
9
  import type { EditorState } from "prosemirror-state";
10
10
  import type { EditorView } from "prosemirror-view";
11
- import type { NoteRow } from "../../editor/commands/noteQueries";
12
- import { type EditorDocument } from "../../editor/editorDocument";
13
- import { type ActiveSurface, type StoryExtensions, type StoryHost } from "../../editor/stories/storyView";
14
- import type { StoryKey } from "../../schema/stories";
15
- import type { RowEditing } from "./StoryRow";
11
+ import type { NoteRow } from "../../editor/commands/noteQueries.js";
12
+ import { type EditorDocument } from "../../editor/editorDocument.js";
13
+ import { type ActiveSurface, type StoryExtensions, type StoryHost } from "../../editor/stories/storyView.js";
14
+ import type { StoryKey } from "../../schema/stories.js";
15
+ import type { RowEditing } from "./StoryRow.js";
16
16
  /** A view and the state on screen, which is what the mounting component holds as React state */
17
17
  export interface LiveSurface {
18
18
  readonly view: EditorView;
@@ -1,7 +1,7 @@
1
1
  /** Optional picker values; omitted fields use the package's exported defaults. */
2
- import type { ColorRow } from "../styles/colors";
3
- import type { LineSpacingOption } from "../styles/lineSpacings";
4
- import type { CellBorderOption } from "../table/cellBorders";
2
+ import type { ColorRow } from "../styles/colors.js";
3
+ import type { LineSpacingOption } from "../styles/lineSpacings.js";
4
+ import type { CellBorderOption } from "../table/cellBorders.js";
5
5
  export interface DocxEditorPresets {
6
6
  fonts?: readonly string[];
7
7
  colors?: readonly ColorRow[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portone/docx-editor",
3
- "version": "0.6.8",
3
+ "version": "0.6.9",
4
4
  "description": "A simple DOCX editor for React, built directly on OOXML.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -73,6 +73,7 @@
73
73
  "react": ">=18"
74
74
  },
75
75
  "devDependencies": {
76
+ "@babel/parser": "^8.1.2",
76
77
  "@biomejs/biome": "2.6.6",
77
78
  "@changesets/changelog-github": "^1.0.0",
78
79
  "@changesets/cli": "^3.0.1",
@@ -102,17 +103,18 @@
102
103
  "vitest": "^5.0.0"
103
104
  },
104
105
  "scripts": {
105
- "build": "node scripts/build.mjs && tsc -p tsconfig.build.json",
106
+ "build": "node scripts/build.mjs",
106
107
  "dev": "vite --config demo/vite.config.ts --open",
107
108
  "build:demo": "vite build --config demo/vite.config.ts",
108
109
  "dev:site": "pnpm --filter @portone/docx-editor-site dev",
109
110
  "build:site": "pnpm --filter @portone/docx-editor-site build",
110
111
  "bench": "vitest run --config vitest.bench.config.ts --disableConsoleIntercept",
111
- "check": "pnpm lint && pnpm typecheck && pnpm test && pnpm test:fixtures && pnpm test:site-release && pnpm test:release && pnpm check:demo-library",
112
+ "check": "pnpm lint && pnpm typecheck && pnpm test && pnpm test:fixtures && pnpm test:build && pnpm test:site-release && pnpm test:release && pnpm check:demo-library",
112
113
  "typecheck": "tsc --noEmit && tsc --noEmit -p e2e && tsc --noEmit -p demo && pnpm --filter @portone/docx-editor-site typecheck",
113
114
  "lint": "pnpm biome check . --diagnostic-level=error",
114
115
  "test": "vitest run",
115
116
  "test:fixtures": "node --test scripts/sanitize-fixture.test.mjs",
117
+ "test:build": "node --test scripts/module-specifiers.test.mjs",
116
118
  "test:package": "vitest run --dir packaging --no-file-parallelism",
117
119
  "verify:package": "node scripts/verify-package.mjs",
118
120
  "check:demo-library": "node scripts/demo-library-pin.mjs",