@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.
- package/LICENSE-APACHE +202 -0
- package/LICENSE-MIT +21 -0
- package/README.md +48 -0
- package/dist/arrange.d.ts +37 -0
- package/dist/arrange.d.ts.map +1 -0
- package/dist/arrange.js +431 -0
- package/dist/arrange.js.map +1 -0
- package/dist/clipboard.d.ts +12 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/clipboard.js +101 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/commands.d.ts +12 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +225 -0
- package/dist/commands.js.map +1 -0
- package/dist/components/ComboBox.d.ts +38 -0
- package/dist/components/ComboBox.d.ts.map +1 -0
- package/dist/components/ComboBox.js +57 -0
- package/dist/components/ComboBox.js.map +1 -0
- package/dist/components/ModeSwitch.d.ts +15 -0
- package/dist/components/ModeSwitch.d.ts.map +1 -0
- package/dist/components/ModeSwitch.js +94 -0
- package/dist/components/ModeSwitch.js.map +1 -0
- package/dist/components/NewSlideModal.d.ts +41 -0
- package/dist/components/NewSlideModal.d.ts.map +1 -0
- package/dist/components/NewSlideModal.js +136 -0
- package/dist/components/NewSlideModal.js.map +1 -0
- package/dist/components/PageControls.d.ts +78 -0
- package/dist/components/PageControls.d.ts.map +1 -0
- package/dist/components/PageControls.js +201 -0
- package/dist/components/PageControls.js.map +1 -0
- package/dist/components/PageSettingsModal.d.ts +27 -0
- package/dist/components/PageSettingsModal.d.ts.map +1 -0
- package/dist/components/PageSettingsModal.js +273 -0
- package/dist/components/PageSettingsModal.js.map +1 -0
- package/dist/components/PaintOptionsModal.d.ts +19 -0
- package/dist/components/PaintOptionsModal.d.ts.map +1 -0
- package/dist/components/PaintOptionsModal.js +103 -0
- package/dist/components/PaintOptionsModal.js.map +1 -0
- package/dist/components/TextControls.d.ts +49 -0
- package/dist/components/TextControls.d.ts.map +1 -0
- package/dist/components/TextControls.js +452 -0
- package/dist/components/TextControls.js.map +1 -0
- package/dist/context-menu.d.ts +46 -0
- package/dist/context-menu.d.ts.map +1 -0
- package/dist/context-menu.js +144 -0
- package/dist/context-menu.js.map +1 -0
- package/dist/edit-client.d.ts +121 -0
- package/dist/edit-client.d.ts.map +1 -0
- package/dist/edit-client.js +154 -0
- package/dist/edit-client.js.map +1 -0
- package/dist/edit-command.d.ts +7 -0
- package/dist/edit-command.d.ts.map +1 -0
- package/dist/edit-command.js +18 -0
- package/dist/edit-command.js.map +1 -0
- package/dist/edit-mode.d.ts +19 -0
- package/dist/edit-mode.d.ts.map +1 -0
- package/dist/edit-mode.js +214 -0
- package/dist/edit-mode.js.map +1 -0
- package/dist/editor.d.ts +101 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/editor.js +101 -0
- package/dist/editor.js.map +1 -0
- package/dist/fonts/faces.d.ts +28 -0
- package/dist/fonts/faces.d.ts.map +1 -0
- package/dist/fonts/faces.js +38 -0
- package/dist/fonts/faces.js.map +1 -0
- package/dist/fonts/preview.d.ts +98 -0
- package/dist/fonts/preview.d.ts.map +1 -0
- package/dist/fonts/preview.js +149 -0
- package/dist/fonts/preview.js.map +1 -0
- package/dist/formatting-marks.d.ts +23 -0
- package/dist/formatting-marks.d.ts.map +1 -0
- package/dist/formatting-marks.js +55 -0
- package/dist/formatting-marks.js.map +1 -0
- package/dist/grips.d.ts +14 -0
- package/dist/grips.d.ts.map +1 -0
- package/dist/grips.js +459 -0
- package/dist/grips.js.map +1 -0
- package/dist/i18n/ar.d.ts +4 -0
- package/dist/i18n/ar.d.ts.map +1 -0
- package/dist/i18n/ar.js +175 -0
- package/dist/i18n/ar.js.map +1 -0
- package/dist/i18n/de.d.ts +4 -0
- package/dist/i18n/de.d.ts.map +1 -0
- package/dist/i18n/de.js +175 -0
- package/dist/i18n/de.js.map +1 -0
- package/dist/i18n/en.d.ts +5 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +176 -0
- package/dist/i18n/en.js.map +1 -0
- package/dist/i18n/es.d.ts +4 -0
- package/dist/i18n/es.d.ts.map +1 -0
- package/dist/i18n/es.js +175 -0
- package/dist/i18n/es.js.map +1 -0
- package/dist/i18n/fr.d.ts +4 -0
- package/dist/i18n/fr.d.ts.map +1 -0
- package/dist/i18n/fr.js +175 -0
- package/dist/i18n/fr.js.map +1 -0
- package/dist/i18n/index.d.ts +21 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +42 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/ja.d.ts +4 -0
- package/dist/i18n/ja.d.ts.map +1 -0
- package/dist/i18n/ja.js +175 -0
- package/dist/i18n/ja.js.map +1 -0
- package/dist/i18n/ko.d.ts +4 -0
- package/dist/i18n/ko.d.ts.map +1 -0
- package/dist/i18n/ko.js +175 -0
- package/dist/i18n/ko.js.map +1 -0
- package/dist/i18n/messages.d.ts +316 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +2 -0
- package/dist/i18n/messages.js.map +1 -0
- package/dist/i18n/pt-BR.d.ts +4 -0
- package/dist/i18n/pt-BR.d.ts.map +1 -0
- package/dist/i18n/pt-BR.js +175 -0
- package/dist/i18n/pt-BR.js.map +1 -0
- package/dist/i18n/ru.d.ts +4 -0
- package/dist/i18n/ru.d.ts.map +1 -0
- package/dist/i18n/ru.js +175 -0
- package/dist/i18n/ru.js.map +1 -0
- package/dist/i18n/zh-CN.d.ts +4 -0
- package/dist/i18n/zh-CN.d.ts.map +1 -0
- package/dist/i18n/zh-CN.js +175 -0
- package/dist/i18n/zh-CN.js.map +1 -0
- package/dist/i18n/zh-TW.d.ts +4 -0
- package/dist/i18n/zh-TW.d.ts.map +1 -0
- package/dist/i18n/zh-TW.js +175 -0
- package/dist/i18n/zh-TW.js.map +1 -0
- package/dist/icons.d.ts +97 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +103 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/insert.d.ts +21 -0
- package/dist/insert.d.ts.map +1 -0
- package/dist/insert.js +129 -0
- package/dist/insert.js.map +1 -0
- package/dist/menu-action.d.ts +73 -0
- package/dist/menu-action.d.ts.map +1 -0
- package/dist/menu-action.js +89 -0
- package/dist/menu-action.js.map +1 -0
- package/dist/mode.d.ts +21 -0
- package/dist/mode.d.ts.map +1 -0
- package/dist/mode.js +17 -0
- package/dist/mode.js.map +1 -0
- package/dist/new-slide.d.ts +21 -0
- package/dist/new-slide.d.ts.map +1 -0
- package/dist/new-slide.js +63 -0
- package/dist/new-slide.js.map +1 -0
- package/dist/page-controls.d.ts +20 -0
- package/dist/page-controls.d.ts.map +1 -0
- package/dist/page-controls.js +99 -0
- package/dist/page-controls.js.map +1 -0
- package/dist/paint.d.ts +52 -0
- package/dist/paint.d.ts.map +1 -0
- package/dist/paint.js +262 -0
- package/dist/paint.js.map +1 -0
- package/dist/ruler.d.ts +10 -0
- package/dist/ruler.d.ts.map +1 -0
- package/dist/ruler.js +97 -0
- package/dist/ruler.js.map +1 -0
- package/dist/state.d.ts +85 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +28 -0
- package/dist/state.js.map +1 -0
- package/dist/styles.d.ts +2 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +758 -0
- package/dist/styles.js.map +1 -0
- package/dist/tabs.d.ts +11 -0
- package/dist/tabs.d.ts.map +1 -0
- package/dist/tabs.js +153 -0
- package/dist/tabs.js.map +1 -0
- package/dist/text-format.d.ts +114 -0
- package/dist/text-format.d.ts.map +1 -0
- package/dist/text-format.js +315 -0
- package/dist/text-format.js.map +1 -0
- package/dist/tools.d.ts +35 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +41 -0
- package/dist/tools.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +7 -0
- package/dist/version.js.map +1 -0
- package/dist/worker/handlers.d.ts +11 -0
- package/dist/worker/handlers.d.ts.map +1 -0
- package/dist/worker/handlers.js +127 -0
- package/dist/worker/handlers.js.map +1 -0
- package/dist/worker/protocol.d.ts +190 -0
- package/dist/worker/protocol.d.ts.map +1 -0
- package/dist/worker/protocol.js +2 -0
- package/dist/worker/protocol.js.map +1 -0
- package/dist/worker/worker-source.d.ts +3 -0
- package/dist/worker/worker-source.d.ts.map +1 -0
- package/dist/worker/worker-source.js +11 -0
- package/dist/worker/worker.d.ts +2 -0
- package/dist/worker/worker.d.ts.map +1 -0
- package/dist/worker/worker.js +6 -0
- package/dist/worker/worker.js.map +1 -0
- package/package.json +68 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,mDAAmD;AACnD,EAAE;AACF,uEAAuE;AACvE,+EAA+E;AAC/E,4BAA4B;AAC5B,MAAM,GAAG,GAAG,CAAC,OAA6B,EAAE,GAAG,MAAiB,EAAU,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,GAAG,MAAM,CAAC,CAAC;AAErH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6uB9B,CAAC"}
|
package/dist/tabs.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UDocType } from "@docmentis/udoc-ui";
|
|
2
|
+
import type { CommandId, ToolbarTab } from "@docmentis/udoc-ui/internal";
|
|
3
|
+
import type { MessageKey } from "./i18n/index.js";
|
|
4
|
+
/** A command edit mode's tabs name: udoc-ui's, or the editor's own. */
|
|
5
|
+
export type EditCommandId = CommandId | "fontFamily" | "fontSize" | "bold" | "italic" | "underline" | "strikethrough" | "superscript" | "subscript" | "widthScale" | "textFill" | "textHighlight" | "paragraphAlign" | "lineSpacing" | "bulletList" | "numberList" | "shapeFillColor" | "shapeStrokeColor" | "shapeArrange" | "objectFillColor" | "objectStrokeColor" | "objectArrange" | "formattingMarks" | "createSlide" | "insertImage" | "insertShape";
|
|
6
|
+
/** A tab of edit mode's. */
|
|
7
|
+
type EditTab = ToolbarTab<MessageKey>;
|
|
8
|
+
/** Edit mode's tab strip for a document of `docType`. */
|
|
9
|
+
export declare function editTabs(docType: UDocType | null): readonly EditTab[];
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../src/tabs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,uEAAuE;AACvE,MAAM,MAAM,aAAa,GACnB,SAAS,GACT,YAAY,GACZ,UAAU,GACV,MAAM,GACN,QAAQ,GACR,WAAW,GACX,eAAe,GACf,aAAa,GACb,WAAW,GACX,YAAY,GACZ,UAAU,GACV,eAAe,GACf,gBAAgB,GAChB,aAAa,GACb,YAAY,GACZ,YAAY,GACZ,gBAAgB,GAChB,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,mBAAmB,GACnB,eAAe,GACf,iBAAiB,GACjB,aAAa,GACb,aAAa,GACb,aAAa,CAAC;AAEpB,4BAA4B;AAC5B,KAAK,OAAO,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;AA4JtC,yDAAyD;AACzD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,OAAO,EAAE,CAWrE"}
|
package/dist/tabs.js
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { ANNOTATE_TAB } from "@docmentis/udoc-ui/internal";
|
|
2
|
+
/**
|
|
3
|
+
* The text-formatting commands — the character half first (the font family /
|
|
4
|
+
* size fields, the Bold / Italic / Underline / Strikethrough / Superscript /
|
|
5
|
+
* Subscript toggles, the Scale dropdown, the Text Color / Highlight pickers),
|
|
6
|
+
* then the paragraph half (the Align + Indent dropdown, the Line & Paragraph
|
|
7
|
+
* Spacing dropdown, and the two list split buttons). Shared by the doc-type Text
|
|
8
|
+
* tab (always shown, greyed when the selection can't take them) and the
|
|
9
|
+
* contextual Home tab (shown only when the selection is editable text). One
|
|
10
|
+
* source of truth so the two never drift.
|
|
11
|
+
*
|
|
12
|
+
* The paragraph controls stay a **short** band on purpose: four entries, each
|
|
13
|
+
* dropping its long tail into its own menu. The exact measures — indents and
|
|
14
|
+
* spacing in points, first-line vs hanging, borders and shading, the pagination
|
|
15
|
+
* keeps — belong in a Paragraph dialog, not in toolbar width.
|
|
16
|
+
*
|
|
17
|
+
* The Show Formatting Marks toggle closes the list. It is live whatever is
|
|
18
|
+
* selected, so Home shows it in every state — on wordprocessing only, which is
|
|
19
|
+
* what its predicate asks rather than the selection.
|
|
20
|
+
*/
|
|
21
|
+
const TEXT_COMMANDS = [
|
|
22
|
+
"fontFamily",
|
|
23
|
+
"fontSize",
|
|
24
|
+
"bold",
|
|
25
|
+
"italic",
|
|
26
|
+
"underline",
|
|
27
|
+
"strikethrough",
|
|
28
|
+
"superscript",
|
|
29
|
+
"subscript",
|
|
30
|
+
"widthScale",
|
|
31
|
+
"textFill",
|
|
32
|
+
"textHighlight",
|
|
33
|
+
"paragraphAlign",
|
|
34
|
+
"lineSpacing",
|
|
35
|
+
"bulletList",
|
|
36
|
+
"numberList",
|
|
37
|
+
"formattingMarks",
|
|
38
|
+
];
|
|
39
|
+
/**
|
|
40
|
+
* The shape-appearance commands — the Fill / Line color pickers and the
|
|
41
|
+
* Arrange dropdown (order / align / rotate / group) over a drawing's shapes. On
|
|
42
|
+
* the Shape tab and the contextual Home tab, like {@link TEXT_COMMANDS}.
|
|
43
|
+
*/
|
|
44
|
+
const SHAPE_COMMANDS = ["shapeFillColor", "shapeStrokeColor", "shapeArrange"];
|
|
45
|
+
/**
|
|
46
|
+
* The object-appearance commands — the {@link SHAPE_COMMANDS} of a PDF's page
|
|
47
|
+
* objects, gated on the object edits. On the portable profile's Object tab and
|
|
48
|
+
* its contextual Home tab.
|
|
49
|
+
*/
|
|
50
|
+
const OBJECT_COMMANDS = ["objectFillColor", "objectStrokeColor", "objectArrange"];
|
|
51
|
+
/**
|
|
52
|
+
* The Home tab, **contextual** (see {@link ToolbarTab.contextual}): it carries
|
|
53
|
+
* the full text ({@link TEXT_COMMANDS}) and shape ({@link SHAPE_COMMANDS})
|
|
54
|
+
* control sets but shows only the ones the current selection can take, so it
|
|
55
|
+
* reads as a selection-driven property band — empty with nothing selected, the
|
|
56
|
+
* text controls for editable text, the shape controls for a graphics object. The
|
|
57
|
+
* clipboard + format-copy group it once held moved to the canvas context menu
|
|
58
|
+
* (`CONTEXT_MENU` in udoc-ui's `commands.ts`) — those act on the selection and
|
|
59
|
+
* mean the same thing for every selection type, so they don't earn toolbar
|
|
60
|
+
* width.
|
|
61
|
+
*/
|
|
62
|
+
const HOME_TAB = {
|
|
63
|
+
id: "home",
|
|
64
|
+
label: "ribbon.home",
|
|
65
|
+
commands: [...TEXT_COMMANDS, ...SHAPE_COMMANDS],
|
|
66
|
+
contextual: true,
|
|
67
|
+
};
|
|
68
|
+
/** The portable Insert tab: Shapes, dragged out as the page's own objects. */
|
|
69
|
+
const PORTABLE_INSERT_TAB = { id: "insert", label: "ribbon.insert", commands: ["insertShape"] };
|
|
70
|
+
/** The presentation Insert tab: Image, a picture on the current slide. */
|
|
71
|
+
const PRESENTATION_INSERT_TAB = { id: "insert", label: "ribbon.insert", commands: ["insertImage"] };
|
|
72
|
+
/**
|
|
73
|
+
* The Shape tab — appearance + arrangement for graphics objects. Fill / Line
|
|
74
|
+
* split buttons (color per channel), then the `arrange` dropdown whose fly-outs
|
|
75
|
+
* cover Order (z-order), Align (align / distribute to the selection or the page),
|
|
76
|
+
* and Rotate (quarter-turn rotations + flips), plus Group / Ungroup. On the
|
|
77
|
+
* presentation strip, not the default one.
|
|
78
|
+
*/
|
|
79
|
+
const SHAPE_TAB = { id: "shape", label: "ribbon.shape", commands: SHAPE_COMMANDS };
|
|
80
|
+
/**
|
|
81
|
+
* The Object tab — the portable (PDF) counterpart of {@link SHAPE_TAB}: its own
|
|
82
|
+
* {@link OBJECT_COMMANDS}, over the page's content objects (paths, text, images)
|
|
83
|
+
* rather than DrawingML shapes.
|
|
84
|
+
*/
|
|
85
|
+
const OBJECT_TAB = { id: "object", label: "ribbon.object", commands: OBJECT_COMMANDS };
|
|
86
|
+
/**
|
|
87
|
+
* The Text tab — character formatting for the current text selection. The font
|
|
88
|
+
* dropdown (typeface) then the Bold / Italic toggles. For the doc types whose
|
|
89
|
+
* text edits through the shared text engine (presentation + wordprocessing);
|
|
90
|
+
* PDF (line-structured, read-oriented text) and spreadsheets don't carry it.
|
|
91
|
+
*/
|
|
92
|
+
const TEXT_TAB = { id: "text", label: "ribbon.text", commands: TEXT_COMMANDS };
|
|
93
|
+
/** The presentation Text tab — {@link TEXT_TAB} without the two controls a deck
|
|
94
|
+
* has no use for: Scale (`w:w` is docx's, and DrawingML has no horizontal glyph
|
|
95
|
+
* scale) and Show Formatting Marks (Word's toggle). The tab drops them rather
|
|
96
|
+
* than greying them for good. */
|
|
97
|
+
const PRESENTATION_TEXT_TAB = {
|
|
98
|
+
...TEXT_TAB,
|
|
99
|
+
commands: TEXT_COMMANDS.filter((id) => id !== "widthScale" && id !== "formattingMarks"),
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* The portable Home tab. Like {@link HOME_TAB}, but with the
|
|
103
|
+
* {@link OBJECT_COMMANDS} a PDF's page objects take in place of the shape ones.
|
|
104
|
+
*/
|
|
105
|
+
const PORTABLE_HOME_TAB = {
|
|
106
|
+
id: "home",
|
|
107
|
+
label: "ribbon.home",
|
|
108
|
+
commands: [...TEXT_COMMANDS, ...OBJECT_COMMANDS],
|
|
109
|
+
contextual: true,
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* The presentation Home tab. Like {@link HOME_TAB} (text controls for a text
|
|
113
|
+
* selection, shape controls for a graphics object) but with **New Slide**
|
|
114
|
+
* prepended — shown only with nothing selected (see `whenNoSelection`), so the
|
|
115
|
+
* empty canvas offers "add a slide" where a selection would offer its property
|
|
116
|
+
* controls. Slide delete / reorder stay in the Thumbnails navigator.
|
|
117
|
+
*/
|
|
118
|
+
const PRESENTATION_HOME_TAB = {
|
|
119
|
+
id: "home",
|
|
120
|
+
label: "ribbon.home",
|
|
121
|
+
commands: ["createSlide", ...TEXT_COMMANDS, ...SHAPE_COMMANDS],
|
|
122
|
+
contextual: true,
|
|
123
|
+
};
|
|
124
|
+
/** The strip of a doc type with none of its own: Home. */
|
|
125
|
+
const DEFAULT_TABS = [HOME_TAB];
|
|
126
|
+
/** The portable (PDF) strip: its own Home and Insert, then Object (the page's
|
|
127
|
+
* content objects) and Annotate, but no Text tab. */
|
|
128
|
+
const PORTABLE_TABS = [PORTABLE_HOME_TAB, PORTABLE_INSERT_TAB, OBJECT_TAB, ANNOTATE_TAB];
|
|
129
|
+
/** The presentation strip: the slide-aware Home and its own Insert, then Text
|
|
130
|
+
* (character formatting) and Shape (free-floating graphics). */
|
|
131
|
+
const PRESENTATION_TABS = [
|
|
132
|
+
PRESENTATION_HOME_TAB,
|
|
133
|
+
PRESENTATION_INSERT_TAB,
|
|
134
|
+
PRESENTATION_TEXT_TAB,
|
|
135
|
+
SHAPE_TAB,
|
|
136
|
+
];
|
|
137
|
+
/** The wordprocessing strip: Home plus Text. No Shape tab yet — the flow
|
|
138
|
+
* document has no free-floating shapes. */
|
|
139
|
+
const WORDPROCESSING_TABS = [HOME_TAB, TEXT_TAB];
|
|
140
|
+
/** Edit mode's tab strip for a document of `docType`. */
|
|
141
|
+
export function editTabs(docType) {
|
|
142
|
+
switch (docType) {
|
|
143
|
+
case "portable":
|
|
144
|
+
return PORTABLE_TABS;
|
|
145
|
+
case "presentation":
|
|
146
|
+
return PRESENTATION_TABS;
|
|
147
|
+
case "wordprocessing":
|
|
148
|
+
return WORDPROCESSING_TABS;
|
|
149
|
+
default:
|
|
150
|
+
return DEFAULT_TABS;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=tabs.js.map
|
package/dist/tabs.js.map
ADDED
|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AAO,EAAE,CAAC;QACd,KAAK,UAAU;YACX,OAAO,aAAa,CAAC;QACzB,KAAK,cAAc;YACf,OAAO,iBAAiB,CAAC;QAC7B,KAAK,gBAAgB;YACjB,OAAO,mBAAmB,CAAC;QAC/B;YACI,OAAO,YAAY,CAAC;IAC5B,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { TextCharacterProperty, TextNumberFormat, TextParagraphProperty, UDocType } from "@docmentis/udoc-wasm";
|
|
2
|
+
import type { EnabledWhen, MenuItem, PaintSpec, UIShellHost } from "@docmentis/udoc-ui/internal";
|
|
3
|
+
import type { I18n, MessageKey } from "./i18n/index.js";
|
|
4
|
+
/** A boolean character-style the Text tab toggles — the `b` / `i` / `u` /
|
|
5
|
+
* `strike` of a span's character properties, and the two directions of its
|
|
6
|
+
* `baseline`. Superscript and subscript are one field, so turning one on
|
|
7
|
+
* replaces the other. */
|
|
8
|
+
export type TextFormatProperty = "bold" | "italic" | "underline" | "strikethrough" | "superscript" | "subscript";
|
|
9
|
+
/** Which of the two list split buttons a command / gallery belongs to. A bullet
|
|
10
|
+
* and an auto-number are one model field (the numbering level a paragraph
|
|
11
|
+
* renders) but two toolbar controls, read apart by the level's format — the same
|
|
12
|
+
* split the engine's `bulleted` / `numbered` consensus makes. */
|
|
13
|
+
export type ListKind = "bulleted" | "numbered";
|
|
14
|
+
/**
|
|
15
|
+
* One entry in a list split button's gallery — a marker style a paragraph can be
|
|
16
|
+
* put in. Carries the **model** pieces (a numbering level's format and its
|
|
17
|
+
* `%1`-style pattern), not a UI token the shell would have to translate: the host
|
|
18
|
+
* builds the numbering the edit carries.
|
|
19
|
+
*/
|
|
20
|
+
export interface ListStyle {
|
|
21
|
+
/** Stable key for the split button's last-used memory. */
|
|
22
|
+
id: string;
|
|
23
|
+
/** The row's accessible name. */
|
|
24
|
+
label: MessageKey;
|
|
25
|
+
/** The row's visible sample — the first markers as the list renders them. */
|
|
26
|
+
preview: string;
|
|
27
|
+
format: TextNumberFormat;
|
|
28
|
+
/** The auto-number pattern (`"%1."` → `1.`). Empty for a bullet, whose
|
|
29
|
+
* character *is* its text. */
|
|
30
|
+
pattern: string;
|
|
31
|
+
}
|
|
32
|
+
/** The bullet gallery — the characters PowerPoint and Word offer first. The
|
|
33
|
+
* first entry is what the main button applies until one is picked. */
|
|
34
|
+
export declare const BULLET_STYLES: readonly ListStyle[];
|
|
35
|
+
/** The auto-number gallery — the six numberings both suites lead with. */
|
|
36
|
+
export declare const NUMBER_STYLES: readonly ListStyle[];
|
|
37
|
+
/** The gallery a list split button's caret opens. */
|
|
38
|
+
export declare function listStyles(list: ListKind): readonly ListStyle[];
|
|
39
|
+
/** The Text tab's character-format controls (font / size / the style toggles /
|
|
40
|
+
* text color) all write character properties, so they enable exactly when
|
|
41
|
+
* the selection accepts a text `setCharacterProperties` edit — a non-empty
|
|
42
|
+
* range in editable text. A bare caret (no spans to restyle) or a non-text
|
|
43
|
+
* selection leaves them greyed. */
|
|
44
|
+
export declare const whenTextFormat: EnabledWhen;
|
|
45
|
+
/** The Text tab's *paragraph* controls (align / indent / spacing / the two list
|
|
46
|
+
* toggles). Deliberately **not** {@link whenTextFormat}: a character format
|
|
47
|
+
* needs spans to cover, so a bare caret leaves it greyed, while a caret is
|
|
48
|
+
* always *inside* a paragraph — clicking in a line and pressing Center is the
|
|
49
|
+
* ordinary gesture, so these gate on the paragraph edit instead. */
|
|
50
|
+
export declare const whenParagraphFormat: EnabledWhen;
|
|
51
|
+
/** The Scale dropdown: a character format like {@link whenTextFormat}, on the
|
|
52
|
+
* one doc type that can hold it — `w:w` is docx's, and DrawingML has no
|
|
53
|
+
* horizontal glyph scale to write it to. */
|
|
54
|
+
export declare const whenWidthScale: EnabledWhen;
|
|
55
|
+
/** The `TextCharacterProperty` a Text-tab toggle sets for `property` at `on` —
|
|
56
|
+
* bold / italic / strikethrough are plain booleans; underline carries a style,
|
|
57
|
+
* where *off* is the explicit "None" that overrides an inherited style.
|
|
58
|
+
*
|
|
59
|
+
* Superscript and subscript write the `docType`'s own encoding of a
|
|
60
|
+
* `TextBaselineAlign`: docx's categorical `Superscript` / `Subscript`, pptx's
|
|
61
|
+
* `Percent` at PowerPoint's values — what a deck's own super/subscripts load
|
|
62
|
+
* as. *Off* is the explicit `Baseline`, overriding an inherited shift. */
|
|
63
|
+
export declare function textFormatProperty(property: TextFormatProperty, on: boolean, docType: UDocType | null): TextCharacterProperty;
|
|
64
|
+
/** Which side of a paragraph the Line & Paragraph Spacing menu's space switches
|
|
65
|
+
* govern — `w:spacing@before` / `@after`. */
|
|
66
|
+
export type ParagraphSpaceEdge = "before" | "after";
|
|
67
|
+
/**
|
|
68
|
+
* The Align & Indent dropdown: the four text alignments as one exclusive set
|
|
69
|
+
* (the row the selection already holds is marked, none when its paragraphs
|
|
70
|
+
* disagree), then the two indent steps below a divider.
|
|
71
|
+
*
|
|
72
|
+
* They share a menu because they answer the same question — *where does this
|
|
73
|
+
* paragraph sit across the column* — and because neither half alone earns a
|
|
74
|
+
* trigger. Every row runs on a bare caret, so the whole menu is
|
|
75
|
+
* {@link whenParagraphFormat}: unlike the character controls beside it, nothing
|
|
76
|
+
* here needs a range.
|
|
77
|
+
*/
|
|
78
|
+
export declare const PARAGRAPH_ALIGN_MENU: readonly MenuItem<MessageKey>[];
|
|
79
|
+
/** The gap the Space Before / After switches turn *on*, in points — Word's own
|
|
80
|
+
* default for its Add Space commands. Off writes zero, not a clear (see
|
|
81
|
+
* {@link LINE_SPACING_MENU}). */
|
|
82
|
+
export declare const PARAGRAPH_SPACE_POINTS = 10;
|
|
83
|
+
/** The Scale dropdown: the horizontal glyph scales as one exclusive set, the
|
|
84
|
+
* one the selection shares marked. */
|
|
85
|
+
export declare const WIDTH_SCALE_MENU: readonly MenuItem<MessageKey>[];
|
|
86
|
+
/**
|
|
87
|
+
* The Line & Paragraph Spacing dropdown: the line-spacing multiples as one
|
|
88
|
+
* exclusive set, then the space-above / space-below switches below a divider.
|
|
89
|
+
*
|
|
90
|
+
* The two halves are one control because they are one question asked at two
|
|
91
|
+
* scales — the gap *inside* a paragraph and the gaps *around* it. The switches
|
|
92
|
+
* are genuinely independent on/off state (unlike the multiples), so they draw a
|
|
93
|
+
* switch rather than a mark: on writes {@link PARAGRAPH_SPACE_POINTS}, off writes
|
|
94
|
+
* zero, which is the explicit "no gap" a style's own spacing must be overridden
|
|
95
|
+
* with — not a clear back to it.
|
|
96
|
+
*/
|
|
97
|
+
export declare const LINE_SPACING_MENU: readonly MenuItem<MessageKey>[];
|
|
98
|
+
/** The text edits of the selection, on the shell `host` lends; `i18n` names
|
|
99
|
+
* the busy hold a font download waits under. */
|
|
100
|
+
export declare function createTextEdits(host: UIShellHost, i18n: I18n): {
|
|
101
|
+
setCharacterProperties: (properties: TextCharacterProperty[]) => Promise<void>;
|
|
102
|
+
formatTextSelection: (property: TextFormatProperty, on: boolean) => Promise<void>;
|
|
103
|
+
fontFamilySelection: (font: string) => Promise<void>;
|
|
104
|
+
fontSizeSelection: (size: number) => Promise<void>;
|
|
105
|
+
textFillSelection: (paint: PaintSpec) => Promise<void>;
|
|
106
|
+
setParagraphProperties: (properties: TextParagraphProperty[]) => Promise<void>;
|
|
107
|
+
indentSelection: (delta: number) => Promise<void>;
|
|
108
|
+
toggleParagraphSpace: (edge: ParagraphSpaceEdge) => Promise<void>;
|
|
109
|
+
listSelection: (style: ListStyle | null) => Promise<void>;
|
|
110
|
+
textHighlightSelection: (paint: PaintSpec) => Promise<void>;
|
|
111
|
+
};
|
|
112
|
+
/** The text edits {@link createTextEdits} makes. */
|
|
113
|
+
export type TextEdits = ReturnType<typeof createTextEdits>;
|
|
114
|
+
//# sourceMappingURL=text-format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-format.d.ts","sourceRoot":"","sources":["../src/text-format.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,QAAQ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CREASE, ICON_PARAGRAPH_CENTER, ICON_PARAGRAPH_JUSTIFY, ICON_PARAGRAPH_LEFT, ICON_PARAGRAPH_RIGHT, } from "./icons.js";
|
|
4
|
+
import { editAction } from "./menu-action.js";
|
|
5
|
+
import { paintToDrawingColor, paintToDrawingFill } from "./paint.js";
|
|
6
|
+
import { editState, editStateOf } from "./state.js";
|
|
7
|
+
/** The bullet gallery — the characters PowerPoint and Word offer first. The
|
|
8
|
+
* first entry is what the main button applies until one is picked. */
|
|
9
|
+
export const BULLET_STYLES = [
|
|
10
|
+
{ id: "disc", label: "list.disc", preview: "•", format: { bullet: "•" }, pattern: "" },
|
|
11
|
+
{ id: "circle", label: "list.circle", preview: "○", format: { bullet: "○" }, pattern: "" },
|
|
12
|
+
{ id: "square", label: "list.square", preview: "▪", format: { bullet: "▪" }, pattern: "" },
|
|
13
|
+
{ id: "diamond", label: "list.diamond", preview: "◆", format: { bullet: "◆" }, pattern: "" },
|
|
14
|
+
{ id: "arrow", label: "list.arrow", preview: "➤", format: { bullet: "➤" }, pattern: "" },
|
|
15
|
+
{ id: "dash", label: "list.dash", preview: "–", format: { bullet: "–" }, pattern: "" },
|
|
16
|
+
];
|
|
17
|
+
/** The auto-number gallery — the six numberings both suites lead with. */
|
|
18
|
+
export const NUMBER_STYLES = [
|
|
19
|
+
{ id: "decimal", label: "list.decimal", preview: "1. 2. 3.", format: "decimal", pattern: "%1." },
|
|
20
|
+
{ id: "decimalParen", label: "list.decimalParen", preview: "1) 2) 3)", format: "decimal", pattern: "%1)" },
|
|
21
|
+
{ id: "lowerLetter", label: "list.lowerLetter", preview: "a. b. c.", format: "lowerLetter", pattern: "%1." },
|
|
22
|
+
{ id: "upperLetter", label: "list.upperLetter", preview: "A. B. C.", format: "upperLetter", pattern: "%1." },
|
|
23
|
+
{ id: "lowerRoman", label: "list.lowerRoman", preview: "i. ii. iii.", format: "lowerRoman", pattern: "%1." },
|
|
24
|
+
{ id: "upperRoman", label: "list.upperRoman", preview: "I. II. III.", format: "upperRoman", pattern: "%1." },
|
|
25
|
+
];
|
|
26
|
+
/** The gallery a list split button's caret opens. */
|
|
27
|
+
export function listStyles(list) {
|
|
28
|
+
return list === "bulleted" ? BULLET_STYLES : NUMBER_STYLES;
|
|
29
|
+
}
|
|
30
|
+
/** The Text tab's character-format controls (font / size / the style toggles /
|
|
31
|
+
* text color) all write character properties, so they enable exactly when
|
|
32
|
+
* the selection accepts a text `setCharacterProperties` edit — a non-empty
|
|
33
|
+
* range in editable text. A bare caret (no spans to restyle) or a non-text
|
|
34
|
+
* selection leaves them greyed. */
|
|
35
|
+
export const whenTextFormat = (c) => allowsTextEdit(c.selection, "setCharacterProperties");
|
|
36
|
+
/** The Text tab's *paragraph* controls (align / indent / spacing / the two list
|
|
37
|
+
* toggles). Deliberately **not** {@link whenTextFormat}: a character format
|
|
38
|
+
* needs spans to cover, so a bare caret leaves it greyed, while a caret is
|
|
39
|
+
* always *inside* a paragraph — clicking in a line and pressing Center is the
|
|
40
|
+
* ordinary gesture, so these gate on the paragraph edit instead. */
|
|
41
|
+
export const whenParagraphFormat = (c) => allowsTextEdit(c.selection, "setParagraphProperties");
|
|
42
|
+
/** The Scale dropdown: a character format like {@link whenTextFormat}, on the
|
|
43
|
+
* one doc type that can hold it — `w:w` is docx's, and DrawingML has no
|
|
44
|
+
* horizontal glyph scale to write it to. */
|
|
45
|
+
export const whenWidthScale = (c) => whenTextFormat(c) && c.docType === "wordprocessing";
|
|
46
|
+
/** The `TextCharacterProperty` a Text-tab toggle sets for `property` at `on` —
|
|
47
|
+
* bold / italic / strikethrough are plain booleans; underline carries a style,
|
|
48
|
+
* where *off* is the explicit "None" that overrides an inherited style.
|
|
49
|
+
*
|
|
50
|
+
* Superscript and subscript write the `docType`'s own encoding of a
|
|
51
|
+
* `TextBaselineAlign`: docx's categorical `Superscript` / `Subscript`, pptx's
|
|
52
|
+
* `Percent` at PowerPoint's values — what a deck's own super/subscripts load
|
|
53
|
+
* as. *Off* is the explicit `Baseline`, overriding an inherited shift. */
|
|
54
|
+
export function textFormatProperty(property, on, docType) {
|
|
55
|
+
const categorical = docType === "wordprocessing";
|
|
56
|
+
switch (property) {
|
|
57
|
+
case "bold":
|
|
58
|
+
return { bold: on };
|
|
59
|
+
case "italic":
|
|
60
|
+
return { italic: on };
|
|
61
|
+
case "underline":
|
|
62
|
+
return { underline: { style: on ? "single" : "none" } };
|
|
63
|
+
case "strikethrough":
|
|
64
|
+
return { strike: on };
|
|
65
|
+
case "superscript":
|
|
66
|
+
return { baselineAlign: on ? (categorical ? "superscript" : { percent: 0.3 }) : "baseline" };
|
|
67
|
+
case "subscript":
|
|
68
|
+
return { baselineAlign: on ? (categorical ? "subscript" : { percent: -0.25 }) : "baseline" };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The Align & Indent dropdown: the four text alignments as one exclusive set
|
|
73
|
+
* (the row the selection already holds is marked, none when its paragraphs
|
|
74
|
+
* disagree), then the two indent steps below a divider.
|
|
75
|
+
*
|
|
76
|
+
* They share a menu because they answer the same question — *where does this
|
|
77
|
+
* paragraph sit across the column* — and because neither half alone earns a
|
|
78
|
+
* trigger. Every row runs on a bare caret, so the whole menu is
|
|
79
|
+
* {@link whenParagraphFormat}: unlike the character controls beside it, nothing
|
|
80
|
+
* here needs a range.
|
|
81
|
+
*/
|
|
82
|
+
export const PARAGRAPH_ALIGN_MENU = [
|
|
83
|
+
{
|
|
84
|
+
action: editAction({ kind: "paragraphAlign", align: "left" }),
|
|
85
|
+
label: "paragraph.alignLeft",
|
|
86
|
+
icon: ICON_PARAGRAPH_LEFT,
|
|
87
|
+
enabledWhen: whenParagraphFormat,
|
|
88
|
+
activeWhen: (c) => editStateOf(c).selectionText.align === "left",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
action: editAction({ kind: "paragraphAlign", align: "center" }),
|
|
92
|
+
label: "paragraph.center",
|
|
93
|
+
icon: ICON_PARAGRAPH_CENTER,
|
|
94
|
+
enabledWhen: whenParagraphFormat,
|
|
95
|
+
activeWhen: (c) => editStateOf(c).selectionText.align === "center",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
action: editAction({ kind: "paragraphAlign", align: "right" }),
|
|
99
|
+
label: "paragraph.alignRight",
|
|
100
|
+
icon: ICON_PARAGRAPH_RIGHT,
|
|
101
|
+
enabledWhen: whenParagraphFormat,
|
|
102
|
+
activeWhen: (c) => editStateOf(c).selectionText.align === "right",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
action: editAction({ kind: "paragraphAlign", align: "justify" }),
|
|
106
|
+
label: "paragraph.justify",
|
|
107
|
+
icon: ICON_PARAGRAPH_JUSTIFY,
|
|
108
|
+
enabledWhen: whenParagraphFormat,
|
|
109
|
+
activeWhen: (c) => editStateOf(c).selectionText.align === "justify",
|
|
110
|
+
},
|
|
111
|
+
// Never marked: an indent is a step, not a state — there is no "current"
|
|
112
|
+
// increase for a row to wear. Both stay live at the margin, as in Word: the
|
|
113
|
+
// engine no-ops a step that would move nothing.
|
|
114
|
+
{
|
|
115
|
+
action: editAction({ kind: "indent", delta: 1 }),
|
|
116
|
+
label: "paragraph.increaseIndent",
|
|
117
|
+
icon: ICON_INDENT_INCREASE,
|
|
118
|
+
enabledWhen: (c) => allowsTextEdit(c.selection, "indentParagraphs"),
|
|
119
|
+
separatorBefore: true,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
action: editAction({ kind: "indent", delta: -1 }),
|
|
123
|
+
label: "paragraph.decreaseIndent",
|
|
124
|
+
icon: ICON_INDENT_DECREASE,
|
|
125
|
+
enabledWhen: (c) => allowsTextEdit(c.selection, "indentParagraphs"),
|
|
126
|
+
},
|
|
127
|
+
];
|
|
128
|
+
/** The line-spacing multiples the spacing menu offers — the Word / Google Docs
|
|
129
|
+
* set. A paragraph spaced in *points* matches none of them and marks nothing;
|
|
130
|
+
* the exact measure belongs in the (later) Paragraph dialog. */
|
|
131
|
+
const LINE_SPACINGS = [1, 1.15, 1.5, 2];
|
|
132
|
+
/** The gap the Space Before / After switches turn *on*, in points — Word's own
|
|
133
|
+
* default for its Add Space commands. Off writes zero, not a clear (see
|
|
134
|
+
* {@link LINE_SPACING_MENU}). */
|
|
135
|
+
export const PARAGRAPH_SPACE_POINTS = 10;
|
|
136
|
+
/** One line-spacing row: `1.5` reads as "1.5", `1` as "Single" and `2` as
|
|
137
|
+
* "Double" — the names those two multiples go by in every office suite. */
|
|
138
|
+
function lineSpacingItem(lines) {
|
|
139
|
+
const label = lines === 1
|
|
140
|
+
? "paragraph.lineSpacingSingle"
|
|
141
|
+
: lines === 2
|
|
142
|
+
? "paragraph.lineSpacingDouble"
|
|
143
|
+
: ["paragraph.lineSpacingLines", { lines }];
|
|
144
|
+
return {
|
|
145
|
+
action: editAction({ kind: "lineSpacing", lines }),
|
|
146
|
+
label,
|
|
147
|
+
enabledWhen: whenParagraphFormat,
|
|
148
|
+
activeWhen: (c) => editStateOf(c).selectionText.lineSpacing === lines,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
/** The scales the Scale dropdown offers, as factors — Word's own list. */
|
|
152
|
+
const WIDTH_SCALES = [2, 1.5, 1, 0.9, 0.8, 0.66, 0.5, 0.33];
|
|
153
|
+
/** The Scale dropdown: the horizontal glyph scales as one exclusive set, the
|
|
154
|
+
* one the selection shares marked. */
|
|
155
|
+
export const WIDTH_SCALE_MENU = WIDTH_SCALES.map((scale) => ({
|
|
156
|
+
action: editAction({ kind: "widthScale", scale }),
|
|
157
|
+
label: ["format.percent", { percent: Math.round(scale * 100) }],
|
|
158
|
+
enabledWhen: whenWidthScale,
|
|
159
|
+
activeWhen: (c) => editStateOf(c).selectionText.widthScale === scale,
|
|
160
|
+
}));
|
|
161
|
+
/**
|
|
162
|
+
* The Line & Paragraph Spacing dropdown: the line-spacing multiples as one
|
|
163
|
+
* exclusive set, then the space-above / space-below switches below a divider.
|
|
164
|
+
*
|
|
165
|
+
* The two halves are one control because they are one question asked at two
|
|
166
|
+
* scales — the gap *inside* a paragraph and the gaps *around* it. The switches
|
|
167
|
+
* are genuinely independent on/off state (unlike the multiples), so they draw a
|
|
168
|
+
* switch rather than a mark: on writes {@link PARAGRAPH_SPACE_POINTS}, off writes
|
|
169
|
+
* zero, which is the explicit "no gap" a style's own spacing must be overridden
|
|
170
|
+
* with — not a clear back to it.
|
|
171
|
+
*/
|
|
172
|
+
export const LINE_SPACING_MENU = [
|
|
173
|
+
...LINE_SPACINGS.map(lineSpacingItem),
|
|
174
|
+
{
|
|
175
|
+
action: editAction({ kind: "paragraphSpace", edge: "before" }),
|
|
176
|
+
label: "paragraph.spaceBefore",
|
|
177
|
+
enabledWhen: whenParagraphFormat,
|
|
178
|
+
separatorBefore: true,
|
|
179
|
+
checked: (c) => (editStateOf(c).selectionText.spaceBefore ?? 0) > 0,
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
action: editAction({ kind: "paragraphSpace", edge: "after" }),
|
|
183
|
+
label: "paragraph.spaceAfter",
|
|
184
|
+
enabledWhen: whenParagraphFormat,
|
|
185
|
+
checked: (c) => (editStateOf(c).selectionText.spaceAfter ?? 0) > 0,
|
|
186
|
+
},
|
|
187
|
+
];
|
|
188
|
+
/** The text edits of the selection, on the shell `host` lends; `i18n` names
|
|
189
|
+
* the busy hold a font download waits under. */
|
|
190
|
+
export function createTextEdits(host, i18n) {
|
|
191
|
+
const { store, client, commit, hold } = host;
|
|
192
|
+
// Text character formatting — the Text tab's controls over the current text
|
|
193
|
+
// selection (a shape's text on a slide, the body caret in a doc). Each rides
|
|
194
|
+
// the same `executeOnSelection` seam as Fill / typing: the shell emits a
|
|
195
|
+
// format-blind character-property edit, the worker tags it (`Presentation` /
|
|
196
|
+
// `Wordprocessing`), and the editor overlays it on the selected range, keeping
|
|
197
|
+
// the selection so toggles chain. Only the two text doc types carry a
|
|
198
|
+
// character-property edit, so this no-ops for the rest (their `SelectionEdit`
|
|
199
|
+
// has no such kind); the Text tab is likewise gated to them (see `profiles.ts`).
|
|
200
|
+
function textDocType() {
|
|
201
|
+
const docType = store.getState().docType;
|
|
202
|
+
return docType === "presentation" || docType === "wordprocessing";
|
|
203
|
+
}
|
|
204
|
+
/** Overlay set-value character `properties` on the text selection. */
|
|
205
|
+
function setCharacterProperties(properties) {
|
|
206
|
+
if (!textDocType())
|
|
207
|
+
return Promise.resolve();
|
|
208
|
+
return commit(() => client.executeOnSelection({ kind: "setCharacterProperties", properties }));
|
|
209
|
+
}
|
|
210
|
+
/** Toggle a character style (bold / italic / underline / strikethrough): set
|
|
211
|
+
* the explicit value, so turning a style *off* overrides an inherited one. */
|
|
212
|
+
function formatTextSelection(property, on) {
|
|
213
|
+
return setCharacterProperties([textFormatProperty(property, on, store.getState().docType)]);
|
|
214
|
+
}
|
|
215
|
+
/** Apply a typeface to the text selection (the Latin / default script slot). */
|
|
216
|
+
async function fontFamilySelection(font) {
|
|
217
|
+
if (!textDocType())
|
|
218
|
+
return;
|
|
219
|
+
// Load first, apply second. A family the document has never used lays out
|
|
220
|
+
// in a stand-in and reflows when the real one lands, so applying first
|
|
221
|
+
// makes one click move the text twice. Every face the change will
|
|
222
|
+
// produce is fetched, not just one — a selection with a bold word in it
|
|
223
|
+
// renders in two binaries, and getting one still leaves the other to
|
|
224
|
+
// reflow on its own.
|
|
225
|
+
//
|
|
226
|
+
// The wait returns at once for a family already here — every use after
|
|
227
|
+
// the first — so the hold below usually costs nothing and shows nothing.
|
|
228
|
+
//
|
|
229
|
+
// It is held because the wait splits one click into two moments. Left
|
|
230
|
+
// interactive, a selection moved in between is what the font lands on:
|
|
231
|
+
// the faces were read from one range and applied to another. Refusing
|
|
232
|
+
// input for the wait makes those the same range, which is the fix — not
|
|
233
|
+
// carrying the old selection through, which would yank it back under a
|
|
234
|
+
// user who has already moved on.
|
|
235
|
+
//
|
|
236
|
+
// Cancelling abandons the pick. Nothing is applied and the document is as
|
|
237
|
+
// it was; the download it was waiting on still lands and installs, so
|
|
238
|
+
// picking the same family again is instant.
|
|
239
|
+
const { bold, italic } = editState(store.getState()).selectionText;
|
|
240
|
+
const proceed = await hold(i18n.t("busy.loadingFont", { font }), client.ensureFont(font, facesToLoad(bold, italic)));
|
|
241
|
+
if (!proceed)
|
|
242
|
+
return;
|
|
243
|
+
await setCharacterProperties([{ fontLatin: { named: { name: font } } }]);
|
|
244
|
+
}
|
|
245
|
+
/** Apply a point size to the text selection. */
|
|
246
|
+
function fontSizeSelection(size) {
|
|
247
|
+
return setCharacterProperties([{ size: size }]);
|
|
248
|
+
}
|
|
249
|
+
/** Apply a text color (the span fill) to the text selection. */
|
|
250
|
+
function textFillSelection(paint) {
|
|
251
|
+
return setCharacterProperties([{ fill: paintToDrawingFill(paint) }]);
|
|
252
|
+
}
|
|
253
|
+
/** Overlay set-value paragraph `properties` on every paragraph the text
|
|
254
|
+
* selection touches — the paragraph half of the Text tab. A caret is inside
|
|
255
|
+
* a paragraph, so unlike {@link setCharacterProperties} this needs no range. */
|
|
256
|
+
function setParagraphProperties(properties) {
|
|
257
|
+
if (!textDocType())
|
|
258
|
+
return Promise.resolve();
|
|
259
|
+
return commit(() => client.executeOnSelection({ kind: "setParagraphProperties", properties }));
|
|
260
|
+
}
|
|
261
|
+
/** Step the touched paragraphs' indent by `delta` levels — the Align & Indent
|
|
262
|
+
* menu's two steps. Relative, so the engine (not the toolbar) decides what a
|
|
263
|
+
* step means for each paragraph and stops at the margin. */
|
|
264
|
+
function indentSelection(delta) {
|
|
265
|
+
if (!textDocType())
|
|
266
|
+
return Promise.resolve();
|
|
267
|
+
return commit(() => client.executeOnSelection({ kind: "indentParagraphs", delta }));
|
|
268
|
+
}
|
|
269
|
+
/** Flip the space above / below the touched paragraphs. Off writes an explicit
|
|
270
|
+
* zero rather than clearing the key: the gap the switch is turning off is
|
|
271
|
+
* usually the paragraph *style's*, which only a specified zero overrides. */
|
|
272
|
+
function toggleParagraphSpace(edge) {
|
|
273
|
+
const format = editState(store.getState()).selectionText;
|
|
274
|
+
const current = edge === "before" ? format.spaceBefore : format.spaceAfter;
|
|
275
|
+
const points = (current ?? 0) > 0 ? 0 : PARAGRAPH_SPACE_POINTS;
|
|
276
|
+
return setParagraphProperties([
|
|
277
|
+
edge === "before" ? { spacingBefore: { points } } : { spacingAfter: { points } },
|
|
278
|
+
]);
|
|
279
|
+
}
|
|
280
|
+
/** Put the touched paragraphs into `style`'s list, or take them out when it is
|
|
281
|
+
* `null`. Off writes `"none"` — the explicit no-bullet — not a clear: a
|
|
282
|
+
* placeholder's own list style is what a paragraph falls back to, and only a
|
|
283
|
+
* specified suppression overrides it. */
|
|
284
|
+
function listSelection(style) {
|
|
285
|
+
if (!style)
|
|
286
|
+
return setParagraphProperties([{ numbering: "none" }]);
|
|
287
|
+
return setParagraphProperties([
|
|
288
|
+
{ numbering: { inline: { format: style.format, textPattern: style.pattern } } },
|
|
289
|
+
]);
|
|
290
|
+
}
|
|
291
|
+
/** Apply a highlight to the text selection. The highlight is a bare color, so
|
|
292
|
+
* "no fill" clears the highlight key (back to un-highlighted). */
|
|
293
|
+
function textHighlightSelection(paint) {
|
|
294
|
+
if (!textDocType())
|
|
295
|
+
return Promise.resolve();
|
|
296
|
+
const color = paintToDrawingColor(paint);
|
|
297
|
+
if (!color) {
|
|
298
|
+
return commit(() => client.executeOnSelection({ kind: "clearCharacterProperties", keys: ["highlight"] }));
|
|
299
|
+
}
|
|
300
|
+
return setCharacterProperties([{ highlight: color }]);
|
|
301
|
+
}
|
|
302
|
+
return {
|
|
303
|
+
setCharacterProperties,
|
|
304
|
+
formatTextSelection,
|
|
305
|
+
fontFamilySelection,
|
|
306
|
+
fontSizeSelection,
|
|
307
|
+
textFillSelection,
|
|
308
|
+
setParagraphProperties,
|
|
309
|
+
indentSelection,
|
|
310
|
+
toggleParagraphSpace,
|
|
311
|
+
listSelection,
|
|
312
|
+
textHighlightSelection,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
//# sourceMappingURL=text-format.js.map
|
|
@@ -0,0 +1 @@
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