@docmentis/udoc-editor 0.8.15 → 0.8.16
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/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +51 -9
- package/dist/commands.js.map +1 -1
- package/dist/components/PageControls.d.ts +13 -6
- package/dist/components/PageControls.d.ts.map +1 -1
- package/dist/components/PageControls.js +42 -33
- package/dist/components/PageControls.js.map +1 -1
- package/dist/components/PageSettingsModal.d.ts +0 -2
- package/dist/components/PageSettingsModal.d.ts.map +1 -1
- package/dist/components/PageSettingsModal.js +54 -56
- package/dist/components/PageSettingsModal.js.map +1 -1
- package/dist/components/{NewSlideModal.d.ts → SlideLayoutModal.d.ts} +15 -11
- package/dist/components/SlideLayoutModal.d.ts.map +1 -0
- package/dist/components/{NewSlideModal.js → SlideLayoutModal.js} +34 -18
- package/dist/components/SlideLayoutModal.js.map +1 -0
- package/dist/docmentis-theme.d.ts +4 -0
- package/dist/docmentis-theme.d.ts.map +1 -0
- package/dist/docmentis-theme.js +6 -0
- package/dist/docmentis-theme.js.map +1 -0
- package/dist/edit-client.d.ts +9 -1
- package/dist/edit-client.d.ts.map +1 -1
- package/dist/edit-client.js +10 -0
- package/dist/edit-client.js.map +1 -1
- package/dist/edit-command.d.ts +3 -1
- package/dist/edit-command.d.ts.map +1 -1
- package/dist/edit-command.js +7 -0
- package/dist/edit-command.js.map +1 -1
- package/dist/edit-mode.d.ts.map +1 -1
- package/dist/edit-mode.js +22 -10
- package/dist/edit-mode.js.map +1 -1
- package/dist/editor.d.ts +7 -6
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +6 -5
- package/dist/editor.js.map +1 -1
- package/dist/i18n/ar.js +10 -10
- package/dist/i18n/ar.js.map +1 -1
- package/dist/i18n/de.js +10 -10
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/en.js +10 -10
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.js +10 -10
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/fr.js +10 -10
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/ja.js +10 -10
- package/dist/i18n/ja.js.map +1 -1
- package/dist/i18n/ko.js +10 -10
- package/dist/i18n/ko.js.map +1 -1
- package/dist/i18n/messages.d.ts +18 -18
- package/dist/i18n/messages.d.ts.map +1 -1
- package/dist/i18n/pt-BR.js +10 -10
- package/dist/i18n/pt-BR.js.map +1 -1
- package/dist/i18n/ru.js +10 -10
- package/dist/i18n/ru.js.map +1 -1
- package/dist/i18n/zh-CN.js +10 -10
- package/dist/i18n/zh-CN.js.map +1 -1
- package/dist/i18n/zh-TW.js +10 -10
- package/dist/i18n/zh-TW.js.map +1 -1
- package/dist/icons.d.ts +24 -0
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +24 -0
- package/dist/icons.js.map +1 -1
- package/dist/image.d.ts +11 -7
- package/dist/image.d.ts.map +1 -1
- package/dist/image.js +44 -7
- package/dist/image.js.map +1 -1
- package/dist/insert.d.ts +24 -12
- package/dist/insert.d.ts.map +1 -1
- package/dist/insert.js +306 -51
- package/dist/insert.js.map +1 -1
- package/dist/line-edit.d.ts +30 -0
- package/dist/line-edit.d.ts.map +1 -0
- package/dist/line-edit.js +87 -0
- package/dist/line-edit.js.map +1 -0
- package/dist/markup.d.ts +25 -5
- package/dist/markup.d.ts.map +1 -1
- package/dist/markup.js +73 -15
- package/dist/markup.js.map +1 -1
- package/dist/opacity.d.ts +19 -0
- package/dist/opacity.d.ts.map +1 -0
- package/dist/opacity.js +45 -0
- package/dist/opacity.js.map +1 -0
- package/dist/page-commands.d.ts +16 -0
- package/dist/page-commands.d.ts.map +1 -0
- package/dist/page-commands.js +122 -0
- package/dist/page-commands.js.map +1 -0
- package/dist/page-controls.d.ts +27 -1
- package/dist/page-controls.d.ts.map +1 -1
- package/dist/page-controls.js +30 -14
- package/dist/page-controls.js.map +1 -1
- package/dist/paint.d.ts +59 -12
- package/dist/paint.d.ts.map +1 -1
- package/dist/paint.js +225 -104
- package/dist/paint.js.map +1 -1
- package/dist/ruler-controls.d.ts +6 -0
- package/dist/ruler-controls.d.ts.map +1 -1
- package/dist/ruler-controls.js +18 -3
- package/dist/ruler-controls.js.map +1 -1
- package/dist/ruler-edits.d.ts +2 -5
- package/dist/ruler-edits.d.ts.map +1 -1
- package/dist/ruler-edits.js +13 -20
- package/dist/ruler-edits.js.map +1 -1
- package/dist/ruler.d.ts +7 -1
- package/dist/ruler.d.ts.map +1 -1
- package/dist/ruler.js +41 -11
- package/dist/ruler.js.map +1 -1
- package/dist/shape-gallery.d.ts +9 -4
- package/dist/shape-gallery.d.ts.map +1 -1
- package/dist/shape-gallery.js +9 -16
- package/dist/shape-gallery.js.map +1 -1
- package/dist/slide-commands.d.ts +38 -0
- package/dist/slide-commands.d.ts.map +1 -0
- package/dist/slide-commands.js +191 -0
- package/dist/slide-commands.js.map +1 -0
- package/dist/slide-shape.d.ts +24 -3
- package/dist/slide-shape.d.ts.map +1 -1
- package/dist/slide-shape.js +65 -10
- package/dist/slide-shape.js.map +1 -1
- package/dist/state.d.ts +12 -5
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +1 -0
- package/dist/state.js.map +1 -1
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +108 -63
- package/dist/styles.js.map +1 -1
- package/dist/tabs.d.ts +1 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +99 -40
- package/dist/tabs.js.map +1 -1
- package/dist/text-format.d.ts.map +1 -1
- package/dist/text-format.js +2 -2
- package/dist/text-format.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/handlers.d.ts.map +1 -1
- package/dist/worker/handlers.js +6 -0
- package/dist/worker/handlers.js.map +1 -1
- package/dist/worker/protocol.d.ts +13 -2
- package/dist/worker/protocol.d.ts.map +1 -1
- package/dist/worker/worker-source.js +1 -1
- package/package.json +3 -3
- package/dist/components/NewSlideModal.d.ts.map +0 -1
- package/dist/components/NewSlideModal.js.map +0 -1
- package/dist/new-slide.d.ts +0 -20
- package/dist/new-slide.d.ts.map +0 -1
- package/dist/new-slide.js +0 -90
- package/dist/new-slide.js.map +0 -1
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { allowsEdit, ICON_DELETE, ICON_SLIDE_ADD } from "@docmentis/udoc-ui/internal";
|
|
2
|
+
import { createSlideLayoutModal } from "./components/SlideLayoutModal.js";
|
|
3
|
+
import { ICON_CHANGE_LAYOUT } from "./icons.js";
|
|
4
|
+
/** An insert index past any deck's end, which the engine clamps — the end of
|
|
5
|
+
* the section the slide is put in. */
|
|
6
|
+
const APPEND_INDEX = 0x7fff_ffff;
|
|
7
|
+
/** Create a slide at `index` (clamped), seeded with its layout's content
|
|
8
|
+
* placeholders. `layout` is the slide-layout id to build on; omit it to copy
|
|
9
|
+
* the neighbor slide's layout. `slideSection` is the section it joins, `index`
|
|
10
|
+
* clamped into its run; omit it to join the section of the slide it follows. */
|
|
11
|
+
function createSlide(index, layout, slideSection) {
|
|
12
|
+
return {
|
|
13
|
+
presentation: {
|
|
14
|
+
editSlide: {
|
|
15
|
+
command: {
|
|
16
|
+
insertSlide: {
|
|
17
|
+
index,
|
|
18
|
+
...(layout == null ? {} : { layout }),
|
|
19
|
+
...(slideSection == null ? {} : { slideSection }),
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/** Put the slides `ids` on the slide layout `layout`, in one undo step. */
|
|
27
|
+
function setSlidesLayout(ids, layout) {
|
|
28
|
+
return { presentation: { editSlide: { command: { setSlidesLayout: { ids, layout } } } } };
|
|
29
|
+
}
|
|
30
|
+
/** Delete the slides picked in the thumbnails, or else the current slide — by
|
|
31
|
+
* id, as whatever else is selected is on it, not it. */
|
|
32
|
+
async function deleteSlides(host) {
|
|
33
|
+
const { selectedPages, pageIndex } = host.store.getState();
|
|
34
|
+
if (selectedPages.length > 0)
|
|
35
|
+
return host.deleteSelection();
|
|
36
|
+
const id = await host.edit.slideId(pageIndex);
|
|
37
|
+
if (id === null)
|
|
38
|
+
return;
|
|
39
|
+
await host.commit(() => host.client.execute({ presentation: { editSlide: { command: { deleteSlides: { ids: [id] } } } } }));
|
|
40
|
+
}
|
|
41
|
+
/** The 0-based slides Change Layout acts on: those of the sections selected in
|
|
42
|
+
* the thumbnails, else the slides selected there, else the current slide —
|
|
43
|
+
* an empty section's selection leaving only that. */
|
|
44
|
+
function layoutTargets(state) {
|
|
45
|
+
const { selectedPages, selectedSlideSections, slideSections, pageIndex } = state;
|
|
46
|
+
const inSections = slideSections
|
|
47
|
+
.filter((section) => selectedSlideSections.includes(section.id))
|
|
48
|
+
.flatMap((section) => Array.from({ length: section.count }, (_, slide) => section.start + slide));
|
|
49
|
+
if (inSections.length > 0)
|
|
50
|
+
return inSections;
|
|
51
|
+
return selectedPages.length > 0 ? [...selectedPages] : [pageIndex];
|
|
52
|
+
}
|
|
53
|
+
/** Mount the layout picker into `host` — once, re-seeded with the current
|
|
54
|
+
* layout roster each open. */
|
|
55
|
+
export function mountSlideLayouts(host, i18n) {
|
|
56
|
+
const modal = createSlideLayoutModal(i18n);
|
|
57
|
+
modal.mount(host.root);
|
|
58
|
+
const execute = (command) => host.commit(() => host.client.execute(command));
|
|
59
|
+
const renderPreview = (plane, page, scale) => host.client.renderPagePreview(plane, page, scale);
|
|
60
|
+
// Pull every slide master's summary, flattened to pickable options (each
|
|
61
|
+
// slide layout previews on the slide masters' plane, after its slide
|
|
62
|
+
// master's page), with the current slide's size, which every slide layout
|
|
63
|
+
// shares.
|
|
64
|
+
const roster = async () => {
|
|
65
|
+
const [slideMasters, slideSize] = await Promise.all([
|
|
66
|
+
host.client.presentation.slideMasters(),
|
|
67
|
+
host.client.pageDisplaySize(0, host.store.getState().pageIndex),
|
|
68
|
+
]);
|
|
69
|
+
const options = slideMasters.flatMap((slideMaster) => slideMaster.slideLayouts.map((slideLayout, index) => ({
|
|
70
|
+
layout: slideLayout.id,
|
|
71
|
+
plane: slideMaster.plane,
|
|
72
|
+
page: slideMaster.page + 1 + index,
|
|
73
|
+
name: slideLayout.name,
|
|
74
|
+
})));
|
|
75
|
+
// Zero in a deck with no slides yet.
|
|
76
|
+
return { options, slideSize: slideSize.width > 0 && slideSize.height > 0 ? slideSize : null };
|
|
77
|
+
};
|
|
78
|
+
return {
|
|
79
|
+
// Falls back to the copy-neighbor default when no slide layouts are
|
|
80
|
+
// available. The new slide lands at the end of the last section selected
|
|
81
|
+
// in the thumbnails — an empty one too — else right after the last slide
|
|
82
|
+
// selected there, else after the current slide — the 0-based page index
|
|
83
|
+
// nearest the viewport top — PowerPoint-style.
|
|
84
|
+
async newSlide() {
|
|
85
|
+
const { selectedPages, pageIndex, slideSections, selectedSlideSections } = host.store.getState();
|
|
86
|
+
const section = [...slideSections].reverse().find((s) => selectedSlideSections.includes(s.id))?.id;
|
|
87
|
+
const insertIndex = section !== undefined
|
|
88
|
+
? APPEND_INDEX
|
|
89
|
+
: (selectedPages.length > 0 ? Math.max(...selectedPages) : pageIndex) + 1;
|
|
90
|
+
const { options, slideSize } = await roster();
|
|
91
|
+
if (options.length === 0) {
|
|
92
|
+
void execute(createSlide(insertIndex, undefined, section));
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
modal.open({
|
|
96
|
+
heading: i18n.t("command.createSlide"),
|
|
97
|
+
label: i18n.t("newSlide.label"),
|
|
98
|
+
current: null,
|
|
99
|
+
options,
|
|
100
|
+
slideSize,
|
|
101
|
+
renderPreview,
|
|
102
|
+
onPick: (layout) => void execute(createSlide(insertIndex, layout, section)),
|
|
103
|
+
});
|
|
104
|
+
},
|
|
105
|
+
// The slides are read as the picker opens, by id: a peer's edit while it
|
|
106
|
+
// is open can move them, or delete one, which the engine then skips. The
|
|
107
|
+
// layout they all share is marked, the slide's own when there's one.
|
|
108
|
+
async changeLayout() {
|
|
109
|
+
const slides = layoutTargets(host.store.getState());
|
|
110
|
+
const [{ options, slideSize }, ids, layouts] = await Promise.all([
|
|
111
|
+
roster(),
|
|
112
|
+
Promise.all(slides.map((slide) => host.edit.slideId(slide))),
|
|
113
|
+
Promise.all(slides.map((slide) => host.client.presentation.slideLayoutId(slide))),
|
|
114
|
+
]);
|
|
115
|
+
const held = ids.filter((id) => id !== null);
|
|
116
|
+
if (held.length === 0 || options.length === 0)
|
|
117
|
+
return;
|
|
118
|
+
const label = i18n.t("command.changeLayout");
|
|
119
|
+
modal.open({
|
|
120
|
+
heading: label,
|
|
121
|
+
label,
|
|
122
|
+
current: new Set(layouts).size === 1 ? layouts[0] : null,
|
|
123
|
+
options,
|
|
124
|
+
slideSize,
|
|
125
|
+
renderPreview,
|
|
126
|
+
onPick: (layout) => void execute(setSlidesLayout(held, layout)),
|
|
127
|
+
});
|
|
128
|
+
},
|
|
129
|
+
destroy: () => modal.destroy(),
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The New Slide command, opening the picker with `open` — a document-level
|
|
134
|
+
* action, live whatever is selected: the slide lands after the current one,
|
|
135
|
+
* or the slides or sections picked in the thumbnails. Not in the Slide Master
|
|
136
|
+
* view, which shows no slide to put it after.
|
|
137
|
+
*/
|
|
138
|
+
export function newSlideCommand(open) {
|
|
139
|
+
return {
|
|
140
|
+
id: "createSlide",
|
|
141
|
+
label: "command.createSlide",
|
|
142
|
+
icon: ICON_SLIDE_ADD,
|
|
143
|
+
group: "slide",
|
|
144
|
+
run: { kind: "action", press: open },
|
|
145
|
+
enabledWhen: (c) => c.ready && c.presentationView !== "slideMaster",
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* The Delete Slide command, over `host` once edit mode is mounted: the slides
|
|
150
|
+
* picked in the thumbnails, or else the current one. On a deck's slides, not its
|
|
151
|
+
* notes pages or the Slide Master view. Greyed with a section picked, which holds
|
|
152
|
+
* its slides' pages too but goes by its own edits: Delete removes the section,
|
|
153
|
+
* and its menu offers to take the slides with it.
|
|
154
|
+
*/
|
|
155
|
+
export function deleteSlideCommand(host) {
|
|
156
|
+
return {
|
|
157
|
+
id: "deleteSlide",
|
|
158
|
+
label: "thumbnails.deleteSlide",
|
|
159
|
+
icon: ICON_DELETE,
|
|
160
|
+
group: "slide",
|
|
161
|
+
run: {
|
|
162
|
+
kind: "action",
|
|
163
|
+
press: () => {
|
|
164
|
+
const mounted = host();
|
|
165
|
+
if (mounted)
|
|
166
|
+
void deleteSlides(mounted);
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
enabledWhen: (c) => c.ready &&
|
|
170
|
+
c.presentationView === "normal" &&
|
|
171
|
+
c.pageCount > 0 &&
|
|
172
|
+
!allowsEdit(c.selection, "deleteSlideSections"),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* The Change Layout command, opening the picker with `open` — live whatever is
|
|
177
|
+
* selected, as New Slide is: it acts on the current slide unless slides or
|
|
178
|
+
* sections are picked in the thumbnails. On a deck's slides, not its notes
|
|
179
|
+
* pages or the Slide Master view, and not with no slide to change.
|
|
180
|
+
*/
|
|
181
|
+
export function changeLayoutCommand(open) {
|
|
182
|
+
return {
|
|
183
|
+
id: "changeLayout",
|
|
184
|
+
label: "command.changeLayout",
|
|
185
|
+
icon: ICON_CHANGE_LAYOUT,
|
|
186
|
+
group: "slide",
|
|
187
|
+
run: { kind: "action", press: open },
|
|
188
|
+
enabledWhen: (c) => c.ready && c.presentationView === "normal" && c.pageCount > 0,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=slide-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slide-commands.js","sourceRoot":"","sources":["../src/slide-commands.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGtF,OAAO,EAAE,sBAAsB,EA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C;AACN,CAAC"}
|
package/dist/slide-shape.d.ts
CHANGED
|
@@ -1,13 +1,34 @@
|
|
|
1
|
-
import type { ShapeNode } from "@docmentis/udoc-wasm";
|
|
1
|
+
import type { PaintColor, PaintFill, ShapeNode } from "@docmentis/udoc-wasm";
|
|
2
2
|
import type { ShapePoint } from "@docmentis/udoc-ui/internal";
|
|
3
3
|
import type { GalleryShape } from "./shape-gallery.js";
|
|
4
|
+
/** The fill and line a new shape states over its style — what was last specified
|
|
5
|
+
* for it. Null for either takes it from the style. */
|
|
6
|
+
export interface SlideShapePaint {
|
|
7
|
+
readonly fill: PaintFill | null;
|
|
8
|
+
readonly line: PaintFill | null;
|
|
9
|
+
}
|
|
10
|
+
/** What `shape`'s style paints it with on its own: the colors an opacity specified
|
|
11
|
+
* with no color of its own is taken over. */
|
|
12
|
+
export declare function slideShapeColors(shape: GalleryShape): {
|
|
13
|
+
fill: PaintColor;
|
|
14
|
+
line: PaintColor;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A text box across the box of `p0` and `p1` (the slide's points), its id `id`:
|
|
18
|
+
* a rectangle with no style, so no fill or outline, holding `text` in the story
|
|
19
|
+
* `story`, wrapped at its width. Its text takes the deck's defaults. It says it
|
|
20
|
+
* fits its lines, as PowerPoint's does, so PowerPoint resizes it once it's edited
|
|
21
|
+
* there; the engine lays it out at the size it's given, and doesn't resize it.
|
|
22
|
+
*/
|
|
23
|
+
export declare function slideTextBox(id: string, story: string, text: string, p0: ShapePoint, p1: ShapePoint): ShapeNode;
|
|
4
24
|
/**
|
|
5
25
|
* The slide shape `shape` spanning `p0 → p1` (the slide's points), its id `id`
|
|
6
26
|
* and its text's story `story`. A line is a connector running from `p0` to
|
|
7
27
|
* `p1`, by flipping the box its preset runs corner to corner across, with its
|
|
8
28
|
* arrowheads at `p1` — and at `p0` too for a double arrow. Anything else spans
|
|
9
29
|
* the box of the two points, unflipped, with an empty text body to type into.
|
|
10
|
-
* Fill, outline and text color come from the theme, through its style
|
|
30
|
+
* Fill, outline and text color come from the theme, through its style, under the
|
|
31
|
+
* `paint` it states; a line and an open outline take no fill.
|
|
11
32
|
*/
|
|
12
|
-
export declare function slideShape(id: string, story: string, shape: GalleryShape, p0: ShapePoint, p1: ShapePoint): ShapeNode;
|
|
33
|
+
export declare function slideShape(id: string, story: string, shape: GalleryShape, p0: ShapePoint, p1: ShapePoint, paint?: SlideShapePaint): ShapeNode;
|
|
13
34
|
//# sourceMappingURL=slide-shape.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slide-shape.d.ts","sourceRoot":"","sources":["../src/slide-shape.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slide-shape.d.ts","sourceRoot":"","sources":["../src/slide-shape.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,UAAU,EACV,SAAS,EAIT,SAAS,EAKZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA6BvD;uDACuD;AACvD,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;CACnC;AAED;8CAC8C;AAC9C,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAG5F;AA4BD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,GAAG,SAAS,CAuC/G;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACtB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,YAAY,EACnB,EAAE,EAAE,UAAU,EACd,EAAE,EAAE,UAAU,EACd,KAAK,GAAE,eAA4C,GACpD,SAAS,CAuCX"}
|
package/dist/slide-shape.js
CHANGED
|
@@ -21,20 +21,27 @@ const LINE_STYLE = {
|
|
|
21
21
|
};
|
|
22
22
|
/** An arrowhead, sized by the line it ends. */
|
|
23
23
|
const ARROWHEAD = { kind: "triangle", width: null, length: null };
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
/** What `shape`'s style paints it with on its own: the colors an opacity specified
|
|
25
|
+
* with no color of its own is taken over. */
|
|
26
|
+
export function slideShapeColors(shape) {
|
|
27
|
+
const { fillRef, lineRef } = shape.line || shape.outline ? LINE_STYLE : SHAPE_STYLE;
|
|
28
|
+
return { fill: fillRef.color ?? scheme("accent1"), line: lineRef.color ?? scheme("accent1") };
|
|
29
|
+
}
|
|
30
|
+
/** A line's own outline: its arrowheads and the paint specified for it, the rest
|
|
31
|
+
* from its style. Null with neither. */
|
|
32
|
+
function ownLine(shape, fill) {
|
|
33
|
+
if (!shape.arrows && !fill)
|
|
27
34
|
return null;
|
|
28
35
|
return {
|
|
29
36
|
width: null,
|
|
30
37
|
cap: null,
|
|
31
38
|
compound: null,
|
|
32
39
|
align: null,
|
|
33
|
-
fill
|
|
40
|
+
fill,
|
|
34
41
|
dash: null,
|
|
35
42
|
join: null,
|
|
36
43
|
headEnd: shape.arrows === "both" ? ARROWHEAD : null,
|
|
37
|
-
tailEnd: ARROWHEAD,
|
|
44
|
+
tailEnd: shape.arrows ? ARROWHEAD : null,
|
|
38
45
|
};
|
|
39
46
|
}
|
|
40
47
|
/** An empty text body, centred both ways — what a press in the shape lands a
|
|
@@ -42,7 +49,54 @@ function arrowedLine(shape) {
|
|
|
42
49
|
function emptyBody(story) {
|
|
43
50
|
return {
|
|
44
51
|
properties: { anchor: "center" },
|
|
45
|
-
story: { id: story, blocks: [{ paragraph: { properties: [{ align: "center" }], spans: [] } }] },
|
|
52
|
+
story: { id: story, blocks: [{ paragraph: { properties: { props: [{ align: "center" }] }, spans: [] } }] },
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A text box across the box of `p0` and `p1` (the slide's points), its id `id`:
|
|
57
|
+
* a rectangle with no style, so no fill or outline, holding `text` in the story
|
|
58
|
+
* `story`, wrapped at its width. Its text takes the deck's defaults. It says it
|
|
59
|
+
* fits its lines, as PowerPoint's does, so PowerPoint resizes it once it's edited
|
|
60
|
+
* there; the engine lays it out at the size it's given, and doesn't resize it.
|
|
61
|
+
*/
|
|
62
|
+
export function slideTextBox(id, story, text, p0, p1) {
|
|
63
|
+
return {
|
|
64
|
+
shape: {
|
|
65
|
+
id,
|
|
66
|
+
nonVisual: { name: "TextBox", description: null, title: null, hidden: false, placeholder: null },
|
|
67
|
+
properties: {
|
|
68
|
+
transform: {
|
|
69
|
+
offset: { x: Math.min(p0.x, p1.x), y: Math.min(p0.y, p1.y) },
|
|
70
|
+
extents: { width: Math.abs(p1.x - p0.x), height: Math.abs(p1.y - p0.y) },
|
|
71
|
+
rotation: 0,
|
|
72
|
+
flipH: false,
|
|
73
|
+
flipV: false,
|
|
74
|
+
},
|
|
75
|
+
geometry: { preset: { preset: "rect", adjustValues: [] } },
|
|
76
|
+
fill: null,
|
|
77
|
+
line: null,
|
|
78
|
+
effects: null,
|
|
79
|
+
scene3d: null,
|
|
80
|
+
shape3d: null,
|
|
81
|
+
},
|
|
82
|
+
style: null,
|
|
83
|
+
textBody: {
|
|
84
|
+
properties: { wrap: "square", autoFit: "shape" },
|
|
85
|
+
story: {
|
|
86
|
+
id: story,
|
|
87
|
+
blocks: [
|
|
88
|
+
{
|
|
89
|
+
paragraph: {
|
|
90
|
+
properties: { props: [] },
|
|
91
|
+
spans: [{ regular: { properties: { props: [] }, text } }],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
textTransform: null,
|
|
98
|
+
diagramPoint: null,
|
|
99
|
+
},
|
|
46
100
|
};
|
|
47
101
|
}
|
|
48
102
|
/**
|
|
@@ -51,9 +105,10 @@ function emptyBody(story) {
|
|
|
51
105
|
* `p1`, by flipping the box its preset runs corner to corner across, with its
|
|
52
106
|
* arrowheads at `p1` — and at `p0` too for a double arrow. Anything else spans
|
|
53
107
|
* the box of the two points, unflipped, with an empty text body to type into.
|
|
54
|
-
* Fill, outline and text color come from the theme, through its style
|
|
108
|
+
* Fill, outline and text color come from the theme, through its style, under the
|
|
109
|
+
* `paint` it states; a line and an open outline take no fill.
|
|
55
110
|
*/
|
|
56
|
-
export function slideShape(id, story, shape, p0, p1) {
|
|
111
|
+
export function slideShape(id, story, shape, p0, p1, paint = { fill: null, line: null }) {
|
|
57
112
|
const nonVisual = {
|
|
58
113
|
name: shape.name,
|
|
59
114
|
description: null,
|
|
@@ -70,8 +125,8 @@ export function slideShape(id, story, shape, p0, p1) {
|
|
|
70
125
|
flipV: shape.line && p1.y < p0.y,
|
|
71
126
|
},
|
|
72
127
|
geometry: { preset: { preset: shape.preset, adjustValues: [] } },
|
|
73
|
-
fill: null,
|
|
74
|
-
line:
|
|
128
|
+
fill: shape.line || shape.outline ? null : paint.fill,
|
|
129
|
+
line: ownLine(shape, paint.line),
|
|
75
130
|
effects: null,
|
|
76
131
|
scene3d: null,
|
|
77
132
|
shape3d: null,
|
package/dist/slide-shape.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slide-shape.js","sourceRoot":"","sources":["../src/slide-shape.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slide-shape.js","sourceRoot":"","sources":["../src/slide-shape.ts"],"names":[],"mappings":"AAmBA,6EAA6E;AAC7E,SAAS,MAAM,CAAC,MAAwB,EAAE,KAAc;IACpD,OAAO,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,KA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,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI;QACrD,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC;QAChC,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,IAAI;KAChB,CAAC;IACF,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QACb,OAAO;YACH,SAAS,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;SAC1G,CAAC;IACN,CAAC;IACD,OAAO;QACH,KAAK,EAAE;YACH,EAAE;YACF,SAAS;YACT,UAAU;YACV,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW;YAC/C,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC;YAC1B,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,IAAI;SACrB;KACJ,CAAC;AACN,CAAC"}
|
package/dist/state.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FontFamilySummary, PaintLine, ParagraphStyleSummary } from "@docmentis/udoc-wasm";
|
|
1
|
+
import type { FontFamilySummary, PaintLine, ParagraphStyleSummary, UDocSelectionProperties } from "@docmentis/udoc-wasm";
|
|
2
2
|
import type { Action, CommandContext, SelectionPaint, SelectionTextFormat, Store, ThemePalette, UIState } from "@docmentis/udoc-ui/internal";
|
|
3
3
|
import type { CropAspect } from "./crop-box.js";
|
|
4
4
|
import type { EditorMode } from "./mode.js";
|
|
@@ -64,9 +64,10 @@ export interface EditState {
|
|
|
64
64
|
*/
|
|
65
65
|
selectionPaint: SelectionPaint;
|
|
66
66
|
/**
|
|
67
|
-
* What a drop on the ruler moves from — the
|
|
68
|
-
*
|
|
69
|
-
* selection reports, projected from the engine's selection
|
|
67
|
+
* What a drop on the ruler's tab stops and margins moves from — the
|
|
68
|
+
* selection's resolved tab stops, and its shape's text insets. Pushed from
|
|
69
|
+
* the worker's selection reports, projected from the engine's selection
|
|
70
|
+
* properties.
|
|
70
71
|
*/
|
|
71
72
|
selectionRuler: SelectionRuler;
|
|
72
73
|
/**
|
|
@@ -76,7 +77,13 @@ export interface EditState {
|
|
|
76
77
|
*/
|
|
77
78
|
selectionLine: PaintLine | null;
|
|
78
79
|
/**
|
|
79
|
-
*
|
|
80
|
+
* The engine's properties of the selection — what the Fill and Line panels'
|
|
81
|
+
* Opacity reads and carries back, keeping everything but the opacity. Null
|
|
82
|
+
* with nothing reported.
|
|
83
|
+
*/
|
|
84
|
+
selectionProperties: UDocSelectionProperties | null;
|
|
85
|
+
/**
|
|
86
|
+
* Whether the current page of an image takes what the Image tab
|
|
80
87
|
* draws: false for an animated or a vector page, and for any other doc
|
|
81
88
|
* type. Re-read as the current page and the document change.
|
|
82
89
|
*/
|
package/dist/state.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,iBAAiB,EACjB,SAAS,EACT,qBAAqB,EACrB,uBAAuB,EAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EACR,MAAM,EACN,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,KAAK,EACL,YAAY,EACZ,OAAO,EACV,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;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AM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAE/F"}
|
package/dist/state.js
CHANGED
package/dist/state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAWjG,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAyHzD,kCAAkC;AAClC,MAAM,CAAC,MAAM,kBAAkB,GAAc;IACzC,SAAS,EAAE,IAAI;IACf,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,EAAE;IAChB,qBAAqB,EAAE,EAAE;IACzB,eAAe,EAAE,EAAE;IACnB,aAAa,EAAE,2BAA2B;IAC1C,cAAc,EAAE,qBAAqB;IACrC,cAAc,EAAE,qBAAqB;IACrC,aAAa,EAAE,IAAI;IACnB,mBAAmB,EAAE,IAAI;IACzB,eAAe,EAAE,KAAK;IACtB,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,SAAS;IACvB,cAAc,EAAE,IAAI;IACpB,WAAW,EAAE,KAAK;CACrB,CAAC;AAEF,oCAAoC;AACpC,MAAM,UAAU,SAAS,CAAC,KAAc;IACpC,OAAO,KAAK,CAAC,SAAsB,CAAC;AACxC,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,WAAW,CAAC,OAAuB;IAC/C,OAAO,OAAO,CAAC,SAAsB,CAAC;AAC1C,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,eAAe,CAAC,KAA6B,EAAE,MAA0B;IACrF,KAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,SAAS,EAAE,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;AAC9G,CAAC"}
|
package/dist/styles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY,QA+hCxB,CAAC"}
|