@docmentis/udoc-editor 0.0.1 → 0.8.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 (207) hide show
  1. package/LICENSE-APACHE +202 -0
  2. package/LICENSE-MIT +21 -0
  3. package/README.md +48 -0
  4. package/dist/arrange.d.ts +37 -0
  5. package/dist/arrange.d.ts.map +1 -0
  6. package/dist/arrange.js +431 -0
  7. package/dist/arrange.js.map +1 -0
  8. package/dist/clipboard.d.ts +12 -0
  9. package/dist/clipboard.d.ts.map +1 -0
  10. package/dist/clipboard.js +101 -0
  11. package/dist/clipboard.js.map +1 -0
  12. package/dist/commands.d.ts +12 -0
  13. package/dist/commands.d.ts.map +1 -0
  14. package/dist/commands.js +225 -0
  15. package/dist/commands.js.map +1 -0
  16. package/dist/components/ComboBox.d.ts +38 -0
  17. package/dist/components/ComboBox.d.ts.map +1 -0
  18. package/dist/components/ComboBox.js +57 -0
  19. package/dist/components/ComboBox.js.map +1 -0
  20. package/dist/components/ModeSwitch.d.ts +15 -0
  21. package/dist/components/ModeSwitch.d.ts.map +1 -0
  22. package/dist/components/ModeSwitch.js +94 -0
  23. package/dist/components/ModeSwitch.js.map +1 -0
  24. package/dist/components/NewSlideModal.d.ts +41 -0
  25. package/dist/components/NewSlideModal.d.ts.map +1 -0
  26. package/dist/components/NewSlideModal.js +136 -0
  27. package/dist/components/NewSlideModal.js.map +1 -0
  28. package/dist/components/PageControls.d.ts +78 -0
  29. package/dist/components/PageControls.d.ts.map +1 -0
  30. package/dist/components/PageControls.js +201 -0
  31. package/dist/components/PageControls.js.map +1 -0
  32. package/dist/components/PageSettingsModal.d.ts +27 -0
  33. package/dist/components/PageSettingsModal.d.ts.map +1 -0
  34. package/dist/components/PageSettingsModal.js +273 -0
  35. package/dist/components/PageSettingsModal.js.map +1 -0
  36. package/dist/components/PaintOptionsModal.d.ts +19 -0
  37. package/dist/components/PaintOptionsModal.d.ts.map +1 -0
  38. package/dist/components/PaintOptionsModal.js +103 -0
  39. package/dist/components/PaintOptionsModal.js.map +1 -0
  40. package/dist/components/TextControls.d.ts +49 -0
  41. package/dist/components/TextControls.d.ts.map +1 -0
  42. package/dist/components/TextControls.js +452 -0
  43. package/dist/components/TextControls.js.map +1 -0
  44. package/dist/context-menu.d.ts +46 -0
  45. package/dist/context-menu.d.ts.map +1 -0
  46. package/dist/context-menu.js +144 -0
  47. package/dist/context-menu.js.map +1 -0
  48. package/dist/edit-client.d.ts +121 -0
  49. package/dist/edit-client.d.ts.map +1 -0
  50. package/dist/edit-client.js +154 -0
  51. package/dist/edit-client.js.map +1 -0
  52. package/dist/edit-command.d.ts +7 -0
  53. package/dist/edit-command.d.ts.map +1 -0
  54. package/dist/edit-command.js +18 -0
  55. package/dist/edit-command.js.map +1 -0
  56. package/dist/edit-mode.d.ts +19 -0
  57. package/dist/edit-mode.d.ts.map +1 -0
  58. package/dist/edit-mode.js +214 -0
  59. package/dist/edit-mode.js.map +1 -0
  60. package/dist/editor.d.ts +101 -0
  61. package/dist/editor.d.ts.map +1 -0
  62. package/dist/editor.js +101 -0
  63. package/dist/editor.js.map +1 -0
  64. package/dist/fonts/faces.d.ts +28 -0
  65. package/dist/fonts/faces.d.ts.map +1 -0
  66. package/dist/fonts/faces.js +38 -0
  67. package/dist/fonts/faces.js.map +1 -0
  68. package/dist/fonts/preview.d.ts +98 -0
  69. package/dist/fonts/preview.d.ts.map +1 -0
  70. package/dist/fonts/preview.js +149 -0
  71. package/dist/fonts/preview.js.map +1 -0
  72. package/dist/formatting-marks.d.ts +23 -0
  73. package/dist/formatting-marks.d.ts.map +1 -0
  74. package/dist/formatting-marks.js +55 -0
  75. package/dist/formatting-marks.js.map +1 -0
  76. package/dist/grips.d.ts +14 -0
  77. package/dist/grips.d.ts.map +1 -0
  78. package/dist/grips.js +459 -0
  79. package/dist/grips.js.map +1 -0
  80. package/dist/i18n/ar.d.ts +4 -0
  81. package/dist/i18n/ar.d.ts.map +1 -0
  82. package/dist/i18n/ar.js +175 -0
  83. package/dist/i18n/ar.js.map +1 -0
  84. package/dist/i18n/de.d.ts +4 -0
  85. package/dist/i18n/de.d.ts.map +1 -0
  86. package/dist/i18n/de.js +175 -0
  87. package/dist/i18n/de.js.map +1 -0
  88. package/dist/i18n/en.d.ts +5 -0
  89. package/dist/i18n/en.d.ts.map +1 -0
  90. package/dist/i18n/en.js +176 -0
  91. package/dist/i18n/en.js.map +1 -0
  92. package/dist/i18n/es.d.ts +4 -0
  93. package/dist/i18n/es.d.ts.map +1 -0
  94. package/dist/i18n/es.js +175 -0
  95. package/dist/i18n/es.js.map +1 -0
  96. package/dist/i18n/fr.d.ts +4 -0
  97. package/dist/i18n/fr.d.ts.map +1 -0
  98. package/dist/i18n/fr.js +175 -0
  99. package/dist/i18n/fr.js.map +1 -0
  100. package/dist/i18n/index.d.ts +21 -0
  101. package/dist/i18n/index.d.ts.map +1 -0
  102. package/dist/i18n/index.js +42 -0
  103. package/dist/i18n/index.js.map +1 -0
  104. package/dist/i18n/ja.d.ts +4 -0
  105. package/dist/i18n/ja.d.ts.map +1 -0
  106. package/dist/i18n/ja.js +175 -0
  107. package/dist/i18n/ja.js.map +1 -0
  108. package/dist/i18n/ko.d.ts +4 -0
  109. package/dist/i18n/ko.d.ts.map +1 -0
  110. package/dist/i18n/ko.js +175 -0
  111. package/dist/i18n/ko.js.map +1 -0
  112. package/dist/i18n/messages.d.ts +316 -0
  113. package/dist/i18n/messages.d.ts.map +1 -0
  114. package/dist/i18n/messages.js +2 -0
  115. package/dist/i18n/messages.js.map +1 -0
  116. package/dist/i18n/pt-BR.d.ts +4 -0
  117. package/dist/i18n/pt-BR.d.ts.map +1 -0
  118. package/dist/i18n/pt-BR.js +175 -0
  119. package/dist/i18n/pt-BR.js.map +1 -0
  120. package/dist/i18n/ru.d.ts +4 -0
  121. package/dist/i18n/ru.d.ts.map +1 -0
  122. package/dist/i18n/ru.js +175 -0
  123. package/dist/i18n/ru.js.map +1 -0
  124. package/dist/i18n/zh-CN.d.ts +4 -0
  125. package/dist/i18n/zh-CN.d.ts.map +1 -0
  126. package/dist/i18n/zh-CN.js +175 -0
  127. package/dist/i18n/zh-CN.js.map +1 -0
  128. package/dist/i18n/zh-TW.d.ts +4 -0
  129. package/dist/i18n/zh-TW.d.ts.map +1 -0
  130. package/dist/i18n/zh-TW.js +175 -0
  131. package/dist/i18n/zh-TW.js.map +1 -0
  132. package/dist/icons.d.ts +97 -0
  133. package/dist/icons.d.ts.map +1 -0
  134. package/dist/icons.js +103 -0
  135. package/dist/icons.js.map +1 -0
  136. package/dist/index.d.ts +9 -0
  137. package/dist/index.d.ts.map +1 -0
  138. package/dist/index.js +14 -0
  139. package/dist/index.js.map +1 -0
  140. package/dist/insert.d.ts +21 -0
  141. package/dist/insert.d.ts.map +1 -0
  142. package/dist/insert.js +129 -0
  143. package/dist/insert.js.map +1 -0
  144. package/dist/menu-action.d.ts +73 -0
  145. package/dist/menu-action.d.ts.map +1 -0
  146. package/dist/menu-action.js +89 -0
  147. package/dist/menu-action.js.map +1 -0
  148. package/dist/mode.d.ts +21 -0
  149. package/dist/mode.d.ts.map +1 -0
  150. package/dist/mode.js +17 -0
  151. package/dist/mode.js.map +1 -0
  152. package/dist/new-slide.d.ts +21 -0
  153. package/dist/new-slide.d.ts.map +1 -0
  154. package/dist/new-slide.js +63 -0
  155. package/dist/new-slide.js.map +1 -0
  156. package/dist/page-controls.d.ts +20 -0
  157. package/dist/page-controls.d.ts.map +1 -0
  158. package/dist/page-controls.js +99 -0
  159. package/dist/page-controls.js.map +1 -0
  160. package/dist/paint.d.ts +52 -0
  161. package/dist/paint.d.ts.map +1 -0
  162. package/dist/paint.js +262 -0
  163. package/dist/paint.js.map +1 -0
  164. package/dist/ruler.d.ts +10 -0
  165. package/dist/ruler.d.ts.map +1 -0
  166. package/dist/ruler.js +97 -0
  167. package/dist/ruler.js.map +1 -0
  168. package/dist/state.d.ts +85 -0
  169. package/dist/state.d.ts.map +1 -0
  170. package/dist/state.js +28 -0
  171. package/dist/state.js.map +1 -0
  172. package/dist/styles.d.ts +2 -0
  173. package/dist/styles.d.ts.map +1 -0
  174. package/dist/styles.js +758 -0
  175. package/dist/styles.js.map +1 -0
  176. package/dist/tabs.d.ts +11 -0
  177. package/dist/tabs.d.ts.map +1 -0
  178. package/dist/tabs.js +153 -0
  179. package/dist/tabs.js.map +1 -0
  180. package/dist/text-format.d.ts +114 -0
  181. package/dist/text-format.d.ts.map +1 -0
  182. package/dist/text-format.js +315 -0
  183. package/dist/text-format.js.map +1 -0
  184. package/dist/tools.d.ts +35 -0
  185. package/dist/tools.d.ts.map +1 -0
  186. package/dist/tools.js +41 -0
  187. package/dist/tools.js.map +1 -0
  188. package/dist/version.d.ts +2 -0
  189. package/dist/version.d.ts.map +1 -0
  190. package/dist/version.js +7 -0
  191. package/dist/version.js.map +1 -0
  192. package/dist/worker/handlers.d.ts +11 -0
  193. package/dist/worker/handlers.d.ts.map +1 -0
  194. package/dist/worker/handlers.js +127 -0
  195. package/dist/worker/handlers.js.map +1 -0
  196. package/dist/worker/protocol.d.ts +190 -0
  197. package/dist/worker/protocol.d.ts.map +1 -0
  198. package/dist/worker/protocol.js +2 -0
  199. package/dist/worker/protocol.js.map +1 -0
  200. package/dist/worker/worker-source.d.ts +3 -0
  201. package/dist/worker/worker-source.d.ts.map +1 -0
  202. package/dist/worker/worker-source.js +11 -0
  203. package/dist/worker/worker.d.ts +2 -0
  204. package/dist/worker/worker.d.ts.map +1 -0
  205. package/dist/worker/worker.js +6 -0
  206. package/dist/worker/worker.js.map +1 -0
  207. package/package.json +68 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextControls.js","sourceRoot":"","sources":["../../src/components/TextControls.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAE9E,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAE,SA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AK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE;KACjC,CAAC;AACN,CAAC;AAED;;mEAEmE;AACnE,MAAM,UAAU,mBAAmB;IAC/B,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAE,EAAE,CAAC;AAC1F,CAAC"}
@@ -0,0 +1,46 @@
1
+ import type { MenuItem } from "@docmentis/udoc-ui/internal";
2
+ import type { MessageKey } from "./i18n/index.js";
3
+ /** A clipboard operation of edit mode's on the current selection / caret — a
4
+ * copy is the shell's (`COPY_MENU_ITEM`). */
5
+ export type ClipboardOp = "cut" | "paste";
6
+ /** What a Select ▸ … row widens the current table selection to. Named for the
7
+ * verbs (`selectTableRows` / `selectTableColumns` / `selectTable`) rather than
8
+ * the row labels: the commands widen to *every* row or column the selection
9
+ * touches, which the singular menu wording (Office's) understates. */
10
+ export type TableSelectScope = "rows" | "columns" | "table";
11
+ /**
12
+ * The canvas context menu in edit mode — what a right-click offers for the
13
+ * current selection: the shell's Copy row among edit mode's own. These are
14
+ * *acts on the selection*, not properties of it: they mean the same thing for a
15
+ * shape, a slide, or a range of text, so they belong beside the selection
16
+ * rather than on a toolbar tab competing for width with the controls that do
17
+ * vary by type.
18
+ *
19
+ * Cut and Copy gate on the engine's `copyable` verdict (Cut additionally on a
20
+ * delete kind — cut is copy-then-delete, so a copyable-but-locked object is only
21
+ * copied). Paste needs a document, not a selection: it reads the system
22
+ * clipboard, which may hold something to paste even when nothing is selected.
23
+ *
24
+ * Paste pastes the object, not merely its text: the copy path carries the
25
+ * fragment in a `text/html` envelope precisely so this row's async clipboard read
26
+ * can recover it (udoc-ui's `clipboard.ts` has the why). Ctrl/Cmd+V is still
27
+ * the quieter path — the async read is permission-gated, and Safari fronts it
28
+ * with its own paste-confirmation UI.
29
+ */
30
+ export declare const CONTEXT_MENU: readonly MenuItem<MessageKey>[];
31
+ /**
32
+ * The context menu as it reads over a **table** — the rows above plus the
33
+ * Select fly-out that widens the pick to whole rows, whole columns, or the
34
+ * whole table.
35
+ *
36
+ * A separate list rather than a conditional row, because the condition is not a
37
+ * property of the selection: it is *where the right-click landed*, which the
38
+ * canvas knows from the hit it already ran and nothing in the editor state
39
+ * records. So the menu is handed its list at open (see `ContextMenu.open`), and
40
+ * the Select rows simply do not exist anywhere but over a table — which is also
41
+ * how Office shows them. Their own `enabledWhen` is therefore just "a document
42
+ * is open": the right-click that produced this list already placed a selection
43
+ * inside the table, so all three have something to widen.
44
+ */
45
+ export declare const TABLE_CONTEXT_MENU: readonly MenuItem<MessageKey>[];
46
+ //# sourceMappingURL=context-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../src/context-menu.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAe,QAAQ,EAAiB,MAAM,6BAA6B,CAAC;AACxF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAYlD;8CAC8C;AAC9C,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,OAAO,CAAC;AAE1C;;;uEAGuE;AACvE,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAwB5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,YAAY,EAAE,SAAS,QAAQ,CAAC,UAAU,CAAC,EAqBvD,CAAC;AA2CF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,QAAQ,CAAC,UAAU,CAAC,EA0B7D,CAAC"}
@@ -0,0 +1,144 @@
1
+ // Edit mode's canvas context menu rows: the clipboard and Delete over any
2
+ // selection, and over a table the Select, Insert, Delete and Merge rows. The
3
+ // shell opens the menu (`UIExtension.contextMenuItems`).
4
+ import { allowsEdit, allowsTableEdit, COPY_MENU_ITEM, ICON_DELETE, ICON_TOOL_POINTER, } from "@docmentis/udoc-ui/internal";
5
+ import { ICON_CUT, ICON_INSERT_COLUMN_LEFT, ICON_INSERT_COLUMN_RIGHT, ICON_INSERT_ROW_ABOVE, ICON_INSERT_ROW_BELOW, ICON_MERGE_CELLS, ICON_PASTE, } from "./icons.js";
6
+ import { editAction } from "./menu-action.js";
7
+ /** Enabled whenever a document is open — the rows that act on the document at
8
+ * large rather than on the selection. */
9
+ const whenReady = (c) => c.ready;
10
+ /** A table structural edit on the selection's table — the context menu's
11
+ * Insert / Delete / Merge rows. Carries the sub-domain edit verbatim, so edit
12
+ * mode hands it straight to `executeOnSelection` under the `table` arm. */
13
+ const whenTableEdit = (kind) => (c) => allowsTableEdit(c.selection, kind);
14
+ const TABLE_SELECT_MENU = [
15
+ { action: editAction({ kind: "selectTable", scope: "rows" }), label: "table.selectRow", enabledWhen: whenReady },
16
+ {
17
+ action: editAction({ kind: "selectTable", scope: "columns" }),
18
+ label: "table.selectColumn",
19
+ enabledWhen: whenReady,
20
+ },
21
+ { action: editAction({ kind: "selectTable", scope: "table" }), label: "table.selectTable", enabledWhen: whenReady },
22
+ ];
23
+ /**
24
+ * The canvas context menu in edit mode — what a right-click offers for the
25
+ * current selection: the shell's Copy row among edit mode's own. These are
26
+ * *acts on the selection*, not properties of it: they mean the same thing for a
27
+ * shape, a slide, or a range of text, so they belong beside the selection
28
+ * rather than on a toolbar tab competing for width with the controls that do
29
+ * vary by type.
30
+ *
31
+ * Cut and Copy gate on the engine's `copyable` verdict (Cut additionally on a
32
+ * delete kind — cut is copy-then-delete, so a copyable-but-locked object is only
33
+ * copied). Paste needs a document, not a selection: it reads the system
34
+ * clipboard, which may hold something to paste even when nothing is selected.
35
+ *
36
+ * Paste pastes the object, not merely its text: the copy path carries the
37
+ * fragment in a `text/html` envelope precisely so this row's async clipboard read
38
+ * can recover it (udoc-ui's `clipboard.ts` has the why). Ctrl/Cmd+V is still
39
+ * the quieter path — the async read is permission-gated, and Safari fronts it
40
+ * with its own paste-confirmation UI.
41
+ */
42
+ export const CONTEXT_MENU = [
43
+ {
44
+ action: editAction({ kind: "clipboard", op: "cut" }),
45
+ label: "contextMenu.cut",
46
+ icon: ICON_CUT,
47
+ enabledWhen: (c) => c.selection.copyable && allowsEdit(c.selection, "deleteObjects", "deleteShapes"),
48
+ },
49
+ COPY_MENU_ITEM,
50
+ {
51
+ action: editAction({ kind: "clipboard", op: "paste" }),
52
+ label: "contextMenu.paste",
53
+ icon: ICON_PASTE,
54
+ enabledWhen: whenReady,
55
+ },
56
+ {
57
+ action: editAction({ kind: "delete" }),
58
+ label: "contextMenu.delete",
59
+ icon: ICON_DELETE,
60
+ enabledWhen: (c) => allowsEdit(c.selection, "deleteObjects", "deleteAnnotations", "deleteShapes"),
61
+ separatorBefore: true,
62
+ },
63
+ ];
64
+ const TABLE_INSERT_MENU = [
65
+ {
66
+ action: editAction({ kind: "tableEdit", edit: { insertRows: { before: true, count: 1 } } }),
67
+ label: "table.rowAbove",
68
+ icon: ICON_INSERT_ROW_ABOVE,
69
+ enabledWhen: whenTableEdit("insertRows"),
70
+ },
71
+ {
72
+ action: editAction({ kind: "tableEdit", edit: { insertRows: { before: false, count: 1 } } }),
73
+ label: "table.rowBelow",
74
+ icon: ICON_INSERT_ROW_BELOW,
75
+ enabledWhen: whenTableEdit("insertRows"),
76
+ },
77
+ {
78
+ action: editAction({ kind: "tableEdit", edit: { insertColumns: { before: true, count: 1 } } }),
79
+ label: "table.columnLeft",
80
+ icon: ICON_INSERT_COLUMN_LEFT,
81
+ enabledWhen: whenTableEdit("insertColumns"),
82
+ separatorBefore: true,
83
+ },
84
+ {
85
+ action: editAction({ kind: "tableEdit", edit: { insertColumns: { before: false, count: 1 } } }),
86
+ label: "table.columnRight",
87
+ icon: ICON_INSERT_COLUMN_RIGHT,
88
+ enabledWhen: whenTableEdit("insertColumns"),
89
+ },
90
+ ];
91
+ const TABLE_DELETE_MENU = [
92
+ {
93
+ action: editAction({ kind: "tableEdit", edit: "deleteRows" }),
94
+ label: "table.deleteRows",
95
+ enabledWhen: whenTableEdit("deleteRows"),
96
+ },
97
+ {
98
+ action: editAction({ kind: "tableEdit", edit: "deleteColumns" }),
99
+ label: "table.deleteColumns",
100
+ enabledWhen: whenTableEdit("deleteColumns"),
101
+ },
102
+ ];
103
+ /**
104
+ * The context menu as it reads over a **table** — the rows above plus the
105
+ * Select fly-out that widens the pick to whole rows, whole columns, or the
106
+ * whole table.
107
+ *
108
+ * A separate list rather than a conditional row, because the condition is not a
109
+ * property of the selection: it is *where the right-click landed*, which the
110
+ * canvas knows from the hit it already ran and nothing in the editor state
111
+ * records. So the menu is handed its list at open (see `ContextMenu.open`), and
112
+ * the Select rows simply do not exist anywhere but over a table — which is also
113
+ * how Office shows them. Their own `enabledWhen` is therefore just "a document
114
+ * is open": the right-click that produced this list already placed a selection
115
+ * inside the table, so all three have something to widen.
116
+ */
117
+ export const TABLE_CONTEXT_MENU = [
118
+ ...CONTEXT_MENU,
119
+ {
120
+ submenu: TABLE_SELECT_MENU,
121
+ label: "table.select",
122
+ icon: ICON_TOOL_POINTER,
123
+ enabledWhen: whenReady,
124
+ separatorBefore: true,
125
+ },
126
+ { submenu: TABLE_INSERT_MENU, label: "table.insert", icon: ICON_INSERT_ROW_BELOW, enabledWhen: whenReady },
127
+ { submenu: TABLE_DELETE_MENU, label: "table.delete", enabledWhen: whenReady },
128
+ // Merge / unmerge are one gesture each, not a family, so they sit flat
129
+ // rather than behind a third fly-out — and each greys on its own gate: a
130
+ // caret in one cell has no block to merge, an unmerged block none to split.
131
+ {
132
+ action: editAction({ kind: "tableEdit", edit: "mergeCells" }),
133
+ label: "table.mergeCells",
134
+ icon: ICON_MERGE_CELLS,
135
+ enabledWhen: whenTableEdit("mergeCells"),
136
+ separatorBefore: true,
137
+ },
138
+ {
139
+ action: editAction({ kind: "tableEdit", edit: "unmergeCells" }),
140
+ label: "table.unmergeCells",
141
+ enabledWhen: whenTableEdit("unmergeCells"),
142
+ },
143
+ ];
144
+ //# sourceMappingURL=context-menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-menu.js","sourceRoot":"","sources":["../src/context-menu.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,6EAA6E;AAC7E,yDAAyD;AACzD,OAAO,EACH,UAAU,EACV,eAAe,EACf,cAAc,EACd,WAAW,EACX,iBAAiB,GACpB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACH,QAAQ,EACR,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,UAAU,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAY9C;0CAC0C;AAC1C,MAAM,SAAS,GAAgB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AAE9C;;4EAE4E;AAC5E,MAAM,aAAa,GACf,CAAC,IAAmB,EAAe,EAAE,CACrC,CAAC,CAAC,EAAE,EAAE,CACF,eAAe,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAE3C,MAAM,iBAAiB,GAAoC;IACvD,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,SAAS,EAAE;IAChH;QACI,MAAM,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;QAC7D,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,SAAS;KACzB;IACD,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE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AC/D,GAAG,YAAY;IACf;QACI,OAAO,EAAE,iBAAiB;QAC1B,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,SAAS;QACtB,eAAe,EAAE,IAAI;KACxB;IACD,EAAE,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,qBAAqB,EAAE,WAAW,EAAE,SAAS,EAAE;IAC1G,EAAE,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE;IAC7E,uEAAuE;IACvE,yEAAyE;IACzE,4EAA4E;IAC5E;QACI,MAAM,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;QAC7D,KAAK,EAAE,kBAAkB;QACzB,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,aAAa,CAAC,YAAY,CAAC;QACxC,eAAe,EAAE,IAAI;KACxB;IACD;QACI,MAAM,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;QAC/D,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,aAAa,CAAC,cAAc,CAAC;KAC7C;CACJ,CAAC"}
@@ -0,0 +1,121 @@
1
+ import type { FontFamily, FontFamilySummary, SlideMasterSummary, UDocFragment } from "@docmentis/udoc-wasm";
2
+ import type { DocumentLayout } from "@docmentis/udoc-ui";
3
+ import type { SelectionHandle, ThemePalette, UIShellHost, WorkerClient } from "@docmentis/udoc-ui/internal";
4
+ import type { FontPreviewImage } from "./worker/protocol.js";
5
+ /** Edit mode's requests of the render worker, over the shell's client. */
6
+ export declare class EditClient {
7
+ #private;
8
+ constructor(client: WorkerClient);
9
+ /**
10
+ * Set whether content overflowing the page bounds is drawn. When on, an
11
+ * object that runs off the page stays visible within the spread (the
12
+ * viewport in paged view, or the page plus half the inter-page gap in
13
+ * continuous); when off it is clipped to the page. Sticky across opens in
14
+ * the worker like the view mode. Latest-wins, fire-and-forget.
15
+ */
16
+ setOverflowVisible(visible: boolean): void;
17
+ /**
18
+ * Toggle empty-placeholder authoring chrome — the dashed frame and "Click to
19
+ * add …" prompt shown on an empty presentation placeholder while editing. On
20
+ * in edit mode, off in a reading view. Sticky across opens in the worker like
21
+ * the backdrop; a no-op for doc types without placeholders. Latest-wins,
22
+ * fire-and-forget.
23
+ */
24
+ setPlaceholderPrompts(on: boolean): void;
25
+ /**
26
+ * Toggle formatting marks — `¶`, a dot per space, a tab's arrow, `↵` — drawn
27
+ * over composed text without reflowing it. Sticky across opens in the worker
28
+ * like the backdrop. Latest-wins, fire-and-forget.
29
+ */
30
+ setFormattingMarks(on: boolean): void;
31
+ /**
32
+ * Read the current slide's resolved theme color palette — the mapped scheme
33
+ * slots the color picker shows as "Theme Colors". Resolves to `null` for a
34
+ * doc type without a theme (only presentations carry one). Re-pull on open
35
+ * and on slide change, since a multi-master deck re-themes per slide.
36
+ */
37
+ themePalette(): Promise<ThemePalette | null>;
38
+ /**
39
+ * Read every font family available to the open document, sorted by name,
40
+ * with its `sourceType` and **without** its faces — the picker's list.
41
+ *
42
+ * `sourceType` says who can draw the family's own name in its own face:
43
+ * `Local` / `Url` / `Google` the browser loads into its own text stack (see
44
+ * `fonts/preview.ts`), and the rest go through {@link renderFontPreview}.
45
+ * {@link fontFamilies} is the same list carrying the faces; at ~1800
46
+ * families those are three quarters of the payload. Stable across the
47
+ * session, so pull this once on open and cache it. `[]` when no document is
48
+ * open or the doc type has no text font registry.
49
+ */
50
+ fontFamilySummaries(): Promise<FontFamilySummary[]>;
51
+ /**
52
+ * Read the families that are **loaded** — parsed and in hand this moment — a
53
+ * subset of {@link fontFamilySummaries}, in the same order.
54
+ *
55
+ * The set the document has actually used. **Not** stable across the session:
56
+ * fonts materialize lazily, so this grows as the document composes and as
57
+ * fonts are picked. Pull it when the picker is about to be shown rather than
58
+ * caching it. It orders the list and gates nothing.
59
+ */
60
+ loadedFontFamilyNames(): Promise<string[]>;
61
+ /**
62
+ * Read every font family available, sorted by name, each with its **faces**
63
+ * and its default `sourceType` — for a picker that greys out bold and
64
+ * italic per family.
65
+ *
66
+ * {@link fontFamilySummaries} is the same list without the faces, and is
67
+ * what a picker that only lists families should read.
68
+ */
69
+ fontFamilies(): Promise<FontFamily[]>;
70
+ /**
71
+ * Draw one family's name in its own face as a PNG **alpha mask** — the
72
+ * picker row for a family the browser can't load itself. `null` when nothing
73
+ * shaped.
74
+ *
75
+ * `size` is the em in CSS px; the reply's `width`/`height` are the CSS box,
76
+ * and the PNG behind it is already device-pixel-ratio scaled.
77
+ */
78
+ renderFontPreview(family: string, bold: boolean, italic: boolean, text: string, size: number): Promise<FontPreviewImage | null>;
79
+ /**
80
+ * Paste a {@link UDocFragment} the caller read back off the system
81
+ * clipboard — its objects are re-inserted with fresh ids and become the
82
+ * selection. A committing edit (one undo step), so it resolves with the
83
+ * document's new layout; the refreshed selection geometry follows via
84
+ * the client's `onSelection`.
85
+ */
86
+ paste(fragment: UDocFragment): Promise<DocumentLayout>;
87
+ /**
88
+ * Insert the image file `bytes` as a picture on the current page, centred
89
+ * and scaled down to fit, and select it. `contentType` is the file's MIME
90
+ * type; an empty one is read from the bytes. A committing edit (one undo
91
+ * step), so it resolves with the document's new layout; the selection
92
+ * follows via the client's `onSelection`.
93
+ */
94
+ insertImage(bytes: Uint8Array, contentType: string): Promise<DocumentLayout>;
95
+ /**
96
+ * Where geometry handle `index` of the selection lands if dragged to
97
+ * `(x, y)` — a point in that handle's **own local space** (the space the
98
+ * streamed handle's `point` is in), not CSS px.
99
+ *
100
+ * A handle travels the track its geometry describes and stops at the ends of
101
+ * its range, so this is what a live drag draws: the position the release will
102
+ * produce, resolved by the engine, with nothing written until then. Resolves
103
+ * the whole handle (drop it in place of the streamed one) or `null` when the
104
+ * selection offers none. Cheap enough to call per pointer-move; the caller
105
+ * coalesces it latest-wins, like the client's `hitTest`.
106
+ */
107
+ selectionHandlePreview(index: number, x: number, y: number): Promise<SelectionHandle | null>;
108
+ /**
109
+ * Every slide master, summarized for the New-Slide picker: its id, its
110
+ * slide layouts' ids (each at page `1 + index` within the slide master's
111
+ * plane), and the layout plane it renders on. The picker thumbnails each
112
+ * slide layout with the client's `renderPagePreview` and creates a slide on it
113
+ * via `Command.createSlide(index, layoutId)`.
114
+ */
115
+ slideMastersSummary(): Promise<SlideMasterSummary[]>;
116
+ }
117
+ /** What the shell lends edit mode, with edit mode's own client over its worker. */
118
+ export interface EditHost extends UIShellHost {
119
+ readonly edit: EditClient;
120
+ }
121
+ //# sourceMappingURL=edit-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-client.d.ts","sourceRoot":"","sources":["../src/edit-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC5G,OAAO,KAAK,EAAe,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE1E,0EAA0E;AAC1E,qBAAa,UAAU;;gBAGP,MAAM,EAAE,YAAY;IAehC;;;;;;OAMG;IACH,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAI1C;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI;IAIxC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI;IAIrC;;;;;OAKG;IACH,YAAY,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAI5C;;;;;;;;;;;OAWG;IACH,mBAAmB,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAInD;;;;;;;;OAQG;IACH,qBAAqB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAI1C;;;;;;;OAOG;IACH,YAAY,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;IAIrC;;;;;;;OAOG;IACH,iBAAiB,CACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACb,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAWnC;;;;;;OAMG;IACH,KAAK,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;IAItD;;;;;;OAMG;IACH,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAM5E;;;;;;;;;;;OAWG;IACH,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAI5F;;;;;;OAMG;IACH,mBAAmB,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;CAGvD;AAED,mFAAmF;AACnF,MAAM,WAAW,QAAS,SAAQ,WAAW;IACzC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC7B"}
@@ -0,0 +1,154 @@
1
+ /** Edit mode's requests of the render worker, over the shell's client. */
2
+ export class EditClient {
3
+ #client;
4
+ constructor(client) {
5
+ this.#client = client;
6
+ }
7
+ #request(request, options) {
8
+ return this.#client.request(request, options);
9
+ }
10
+ #post(request) {
11
+ this.#client.post(request);
12
+ }
13
+ /**
14
+ * Set whether content overflowing the page bounds is drawn. When on, an
15
+ * object that runs off the page stays visible within the spread (the
16
+ * viewport in paged view, or the page plus half the inter-page gap in
17
+ * continuous); when off it is clipped to the page. Sticky across opens in
18
+ * the worker like the view mode. Latest-wins, fire-and-forget.
19
+ */
20
+ setOverflowVisible(visible) {
21
+ this.#post({ type: "setOverflowVisible", visible });
22
+ }
23
+ /**
24
+ * Toggle empty-placeholder authoring chrome — the dashed frame and "Click to
25
+ * add …" prompt shown on an empty presentation placeholder while editing. On
26
+ * in edit mode, off in a reading view. Sticky across opens in the worker like
27
+ * the backdrop; a no-op for doc types without placeholders. Latest-wins,
28
+ * fire-and-forget.
29
+ */
30
+ setPlaceholderPrompts(on) {
31
+ this.#post({ type: "setPlaceholderPrompts", on });
32
+ }
33
+ /**
34
+ * Toggle formatting marks — `¶`, a dot per space, a tab's arrow, `↵` — drawn
35
+ * over composed text without reflowing it. Sticky across opens in the worker
36
+ * like the backdrop. Latest-wins, fire-and-forget.
37
+ */
38
+ setFormattingMarks(on) {
39
+ this.#post({ type: "setFormattingMarks", on });
40
+ }
41
+ /**
42
+ * Read the current slide's resolved theme color palette — the mapped scheme
43
+ * slots the color picker shows as "Theme Colors". Resolves to `null` for a
44
+ * doc type without a theme (only presentations carry one). Re-pull on open
45
+ * and on slide change, since a multi-master deck re-themes per slide.
46
+ */
47
+ themePalette() {
48
+ return this.#request({ type: "themePalette" });
49
+ }
50
+ /**
51
+ * Read every font family available to the open document, sorted by name,
52
+ * with its `sourceType` and **without** its faces — the picker's list.
53
+ *
54
+ * `sourceType` says who can draw the family's own name in its own face:
55
+ * `Local` / `Url` / `Google` the browser loads into its own text stack (see
56
+ * `fonts/preview.ts`), and the rest go through {@link renderFontPreview}.
57
+ * {@link fontFamilies} is the same list carrying the faces; at ~1800
58
+ * families those are three quarters of the payload. Stable across the
59
+ * session, so pull this once on open and cache it. `[]` when no document is
60
+ * open or the doc type has no text font registry.
61
+ */
62
+ fontFamilySummaries() {
63
+ return this.#request({ type: "fontFamilySummaries" });
64
+ }
65
+ /**
66
+ * Read the families that are **loaded** — parsed and in hand this moment — a
67
+ * subset of {@link fontFamilySummaries}, in the same order.
68
+ *
69
+ * The set the document has actually used. **Not** stable across the session:
70
+ * fonts materialize lazily, so this grows as the document composes and as
71
+ * fonts are picked. Pull it when the picker is about to be shown rather than
72
+ * caching it. It orders the list and gates nothing.
73
+ */
74
+ loadedFontFamilyNames() {
75
+ return this.#request({ type: "loadedFontFamilyNames" });
76
+ }
77
+ /**
78
+ * Read every font family available, sorted by name, each with its **faces**
79
+ * and its default `sourceType` — for a picker that greys out bold and
80
+ * italic per family.
81
+ *
82
+ * {@link fontFamilySummaries} is the same list without the faces, and is
83
+ * what a picker that only lists families should read.
84
+ */
85
+ fontFamilies() {
86
+ return this.#request({ type: "fontFamilies" });
87
+ }
88
+ /**
89
+ * Draw one family's name in its own face as a PNG **alpha mask** — the
90
+ * picker row for a family the browser can't load itself. `null` when nothing
91
+ * shaped.
92
+ *
93
+ * `size` is the em in CSS px; the reply's `width`/`height` are the CSS box,
94
+ * and the PNG behind it is already device-pixel-ratio scaled.
95
+ */
96
+ renderFontPreview(family, bold, italic, text, size) {
97
+ return this.#request({
98
+ type: "renderFontPreview",
99
+ family,
100
+ bold,
101
+ italic,
102
+ text,
103
+ size,
104
+ });
105
+ }
106
+ /**
107
+ * Paste a {@link UDocFragment} the caller read back off the system
108
+ * clipboard — its objects are re-inserted with fresh ids and become the
109
+ * selection. A committing edit (one undo step), so it resolves with the
110
+ * document's new layout; the refreshed selection geometry follows via
111
+ * the client's `onSelection`.
112
+ */
113
+ paste(fragment) {
114
+ return this.#request({ type: "paste", fragment }, { changesDocument: true });
115
+ }
116
+ /**
117
+ * Insert the image file `bytes` as a picture on the current page, centred
118
+ * and scaled down to fit, and select it. `contentType` is the file's MIME
119
+ * type; an empty one is read from the bytes. A committing edit (one undo
120
+ * step), so it resolves with the document's new layout; the selection
121
+ * follows via the client's `onSelection`.
122
+ */
123
+ insertImage(bytes, contentType) {
124
+ // Transfer a fresh copy of the buffer to avoid detaching the caller's.
125
+ const buffer = bytes.slice().buffer;
126
+ return this.#request({ type: "insertImage", bytes: buffer, contentType }, { transfer: [buffer] });
127
+ }
128
+ /**
129
+ * Where geometry handle `index` of the selection lands if dragged to
130
+ * `(x, y)` — a point in that handle's **own local space** (the space the
131
+ * streamed handle's `point` is in), not CSS px.
132
+ *
133
+ * A handle travels the track its geometry describes and stops at the ends of
134
+ * its range, so this is what a live drag draws: the position the release will
135
+ * produce, resolved by the engine, with nothing written until then. Resolves
136
+ * the whole handle (drop it in place of the streamed one) or `null` when the
137
+ * selection offers none. Cheap enough to call per pointer-move; the caller
138
+ * coalesces it latest-wins, like the client's `hitTest`.
139
+ */
140
+ selectionHandlePreview(index, x, y) {
141
+ return this.#request({ type: "selectionHandlePreview", index, x, y });
142
+ }
143
+ /**
144
+ * Every slide master, summarized for the New-Slide picker: its id, its
145
+ * slide layouts' ids (each at page `1 + index` within the slide master's
146
+ * plane), and the layout plane it renders on. The picker thumbnails each
147
+ * slide layout with the client's `renderPagePreview` and creates a slide on it
148
+ * via `Command.createSlide(index, layoutId)`.
149
+ */
150
+ slideMastersSummary() {
151
+ return this.#request({ type: "slideMastersSummary" });
152
+ }
153
+ }
154
+ //# sourceMappingURL=edit-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-client.js","sourceRoot":"","sources":["../src/edit-client.ts"],"names":[],"mappings":"AAOA,0EAA0E;AAC1E,MAAM,OAAO,UAAU;IACV,OAAO,CAAe;IAE/B,YAAY,MAAoB;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED,QAAQ,CACJ,OAAoB,EACpB,OAAoF;QAEpF,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAI,OAAO,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,OAAoB;QACtB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACH,kBAAkB,CAAC,OAAgB;QAC/B,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;O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mB;QAC9C,uEAAuE;QACvE,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACtG,CAAC;IAED;;;;;;;;;;;OAWG;IACH,sBAAsB,CAAC,KAAa,EAAE,CAAS,EAAE,CAAS;QACtD,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,wBAAwB,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;OAMG;IACH,mBAAmB;QACf,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAC1D,CAAC;CACJ"}
@@ -0,0 +1,7 @@
1
+ import type { UDocCommand } from "@docmentis/udoc-wasm";
2
+ /** Edit mode's command builders. */
3
+ export declare const EditCommand: {
4
+ /** Insert host-built `objects` (already carrying minted ids) on top of `pageId`. */
5
+ insertObjects: (pageId: string, objects: unknown[]) => UDocCommand;
6
+ };
7
+ //# sourceMappingURL=edit-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-command.d.ts","sourceRoot":"","sources":["../src/edit-command.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAmB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAWzE,oCAAoC;AACpC,eAAO,MAAM,WAAW;IACpB,oFAAoF;4BAC5D,MAAM,WAAW,OAAO,EAAE,KAAG,WAAW;CAOnE,CAAC"}
@@ -0,0 +1,18 @@
1
+ /** A large insert index that clamps to "append on top" in the engine (kept well
2
+ * inside the safe-integer range so it serializes as a plain `usize`). */
3
+ const APPEND_INDEX = 0x7fff_ffff;
4
+ /** Wrap a portable command in the doc-type-tagged `UDocCommand`. */
5
+ function portable(command) {
6
+ return { portable: command };
7
+ }
8
+ /** Edit mode's command builders. */
9
+ export const EditCommand = {
10
+ /** Insert host-built `objects` (already carrying minted ids) on top of `pageId`. */
11
+ insertObjects: (pageId, objects) => portable({
12
+ editObject: {
13
+ page: pageId,
14
+ command: { insertObjects: { parent: null, index: APPEND_INDEX, objects } },
15
+ },
16
+ }),
17
+ };
18
+ //# sourceMappingURL=edit-command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-command.js","sourceRoot":"","sources":["../src/edit-command.ts"],"names":[],"mappings":"AAOA;0EAC0E;AAC1E,MAAM,YAAY,GAAG,WAAW,CAAC;AAEjC,oEAAoE;AACpE,SAAS,QAAQ,CAAC,OAAwB;IACtC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AACjC,CAAC;AAED,oCAAoC;AACpC,MAAM,CAAC,MAAM,WAAW,GAAG;IACvB,oFAAoF;IACpF,aAAa,EAAE,CAAC,MAAc,EAAE,OAAkB,EAAe,EAAE,CAC/D,QAAQ,CAAC;QACL,UAAU,EAAE;YACR,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE;SAC7E;KACJ,CAAC;CACT,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { UIExtension } from "@docmentis/udoc-ui/internal";
2
+ import type { UDocEditorOptions } from "./editor.js";
3
+ import type { EditorMode } from "./mode.js";
4
+ /** Edit mode: the shell's extension, and the calls `UDocEditor` makes of it once mounted. */
5
+ export interface EditMode extends UIExtension {
6
+ /** Show or hide formatting marks; see `UDocEditor.setShowFormattingMarks`. */
7
+ setShowFormattingMarks(visible: boolean): void;
8
+ /** Show or hide the page ruler; see `UDocEditor.setShowRuler`. */
9
+ setShowRuler(visible: boolean): void;
10
+ /** The mode the editor is in; see `UDocEditor.mode`. */
11
+ currentMode(): EditorMode;
12
+ /** Switch to `mode`; see `UDocEditor.setMode`. */
13
+ setMode(mode: EditorMode): void;
14
+ /** Insert an image file as a picture; see `UDocEditor.insertImage`. */
15
+ insertImage(bytes: Uint8Array, contentType: string): Promise<void>;
16
+ }
17
+ /** Edit mode, as `options` configure it. */
18
+ export declare function editMode(options: UDocEditorOptions): EditMode;
19
+ //# sourceMappingURL=edit-mode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-mode.d.ts","sourceRoot":"","sources":["../src/edit-mode.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAW,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAsBrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAQ5C,6FAA6F;AAC7F,MAAM,WAAW,QAAS,SAAQ,WAAW;IACzC,8EAA8E;IAC9E,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/C,kEAAkE;IAClE,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACrC,wDAAwD;IACxD,WAAW,IAAI,UAAU,CAAC;IAC1B,kDAAkD;IAClD,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IAChC,uEAAuE;IACvE,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtE;AAwGD,4CAA4C;AAC5C,wBAAgB,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,QAAQ,CAqG7D"}