ooxml-ui 1.11.0 → 1.12.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/dist/chunk-GSXOZCAN.js +75 -0
- package/dist/{chunk-QVPO35YI.js → chunk-N3BQ3IIJ.js} +1 -1
- package/dist/docx/context-menu-actions.d.ts +1 -1
- package/dist/docx/decoration-cache.d.ts +16 -0
- package/dist/docx/editor-core.d.ts +3 -0
- package/dist/docx/locales/en-ribbon.d.ts +34 -0
- package/dist/docx/locales/en.d.ts +34 -0
- package/dist/docx/localization-strings.d.ts +34 -0
- package/dist/docx/model-adapter.d.ts +1 -1
- package/dist/docx/page-controller.d.ts +1 -1
- package/dist/docx/page-navigator.d.ts +1 -0
- package/dist/docx/paragraph-decoration-cache.d.ts +28 -0
- package/dist/docx/print-block-pages.d.ts +3 -0
- package/dist/docx/print-editing-index.d.ts +1 -0
- package/dist/docx/print-editing.d.ts +1 -1
- package/dist/docx/print-layout-view.d.ts +2 -0
- package/dist/docx/print-layout.d.ts +5 -0
- package/dist/docx/print-page-window.d.ts +16 -0
- package/dist/docx/ribbon-action.d.ts +6 -0
- package/dist/docx/ribbon-home-menus.d.ts +3 -0
- package/dist/docx/ribbon-icons.d.ts +3 -0
- package/dist/docx/ribbon-native-tabs.d.ts +2 -0
- package/dist/docx/ribbon-parts.d.ts +2 -2
- package/dist/docx.js +815 -154
- package/dist/index.js +2 -2
- package/dist/pointer-gesture.d.ts +10 -0
- package/dist/pptx/{chunk-J3T77ZMS.mjs → chunk-GD2XJ32O.mjs} +16 -85
- package/dist/pptx/{chunk-BPQVJLHW.cjs → chunk-WP7PQCJ5.cjs} +59 -107
- package/dist/pptx/dom/index.cjs +202 -202
- package/dist/pptx/dom/index.mjs +2 -2
- package/dist/pptx/index.cjs +2754 -2754
- package/dist/pptx/index.mjs +1 -1
- package/dist/pptx/render/editor-gestures.d.ts.map +1 -1
- package/dist/pptx/render/element-interaction.d.ts +3 -87
- package/dist/pptx/render/element-interaction.d.ts.map +1 -1
- package/dist/pptx/render/responsive/touch-target.d.ts +1 -2
- package/dist/pptx/render/responsive/touch-target.d.ts.map +1 -1
- package/dist/teams.js +1 -1
- package/dist/touch-targets.d.ts +4 -0
- package/dist/touch-targets.d.ts.map +1 -0
- package/dist/visio.js +33 -3
- package/dist/xlsx/formula-bar/styles.d.ts +1 -1
- package/dist/xlsx/grid/styles.d.ts +1 -1
- package/dist/xlsx/ribbon/cell-style-gallery.d.ts +10 -0
- package/dist/xlsx/sheet-tabs/styles.d.ts +1 -1
- package/dist/xlsx.js +193 -73
- package/package.json +2 -2
- /package/dist/{chunk-JZP5L2AZ.js → chunk-B7NCMLSK.js} +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// src/pointer-gesture.ts
|
|
2
|
+
function ownsCaptureLoss(owner, event) {
|
|
3
|
+
return event.target === owner;
|
|
4
|
+
}
|
|
5
|
+
function trackPointerPan(owner, start, onMove, onEnd) {
|
|
6
|
+
const left = owner.scrollLeft, top = owner.scrollTop;
|
|
7
|
+
return trackPointerGesture(owner, start.pointerId, {
|
|
8
|
+
move: (event) => {
|
|
9
|
+
if (Math.hypot(start.clientX - event.clientX, start.clientY - event.clientY) < 4) return;
|
|
10
|
+
owner.scrollLeft = left + start.clientX - event.clientX;
|
|
11
|
+
owner.scrollTop = top + start.clientY - event.clientY;
|
|
12
|
+
onMove();
|
|
13
|
+
},
|
|
14
|
+
commit: onEnd,
|
|
15
|
+
cancel: onEnd
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function trackPointerGesture(owner, pointerId, callbacks) {
|
|
19
|
+
const win = owner.ownerDocument.defaultView;
|
|
20
|
+
const Abort = win?.AbortController ?? AbortController;
|
|
21
|
+
const events = new Abort();
|
|
22
|
+
const options = { signal: events.signal };
|
|
23
|
+
let active = true;
|
|
24
|
+
const finish = (event) => {
|
|
25
|
+
if (!active) return;
|
|
26
|
+
active = false;
|
|
27
|
+
events.abort();
|
|
28
|
+
if (owner.hasPointerCapture?.(pointerId)) owner.releasePointerCapture(pointerId);
|
|
29
|
+
if (event) callbacks.commit(event);
|
|
30
|
+
else callbacks.cancel();
|
|
31
|
+
};
|
|
32
|
+
owner.addEventListener(
|
|
33
|
+
"pointermove",
|
|
34
|
+
(event) => {
|
|
35
|
+
if (event.pointerId === pointerId) callbacks.move(event);
|
|
36
|
+
},
|
|
37
|
+
options
|
|
38
|
+
);
|
|
39
|
+
owner.addEventListener(
|
|
40
|
+
"pointerup",
|
|
41
|
+
(event) => {
|
|
42
|
+
if (event.pointerId === pointerId) finish(event);
|
|
43
|
+
},
|
|
44
|
+
options
|
|
45
|
+
);
|
|
46
|
+
owner.addEventListener(
|
|
47
|
+
"pointercancel",
|
|
48
|
+
(event) => {
|
|
49
|
+
if (event.pointerId === pointerId) finish();
|
|
50
|
+
},
|
|
51
|
+
options
|
|
52
|
+
);
|
|
53
|
+
owner.addEventListener(
|
|
54
|
+
"lostpointercapture",
|
|
55
|
+
(event) => {
|
|
56
|
+
if (event.pointerId === pointerId && ownsCaptureLoss(owner, event)) finish();
|
|
57
|
+
},
|
|
58
|
+
options
|
|
59
|
+
);
|
|
60
|
+
owner.ownerDocument.addEventListener(
|
|
61
|
+
"keydown",
|
|
62
|
+
(event) => {
|
|
63
|
+
if (event.key === "Escape") {
|
|
64
|
+
event.preventDefault();
|
|
65
|
+
finish();
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
options
|
|
69
|
+
);
|
|
70
|
+
win?.addEventListener("blur", () => finish(), options);
|
|
71
|
+
owner.setPointerCapture?.(pointerId);
|
|
72
|
+
return () => finish();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { ownsCaptureLoss, trackPointerGesture, trackPointerPan };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineSmartArt } from './chunk-PXIYHFZ5.js';
|
|
2
|
-
import { TEAMS_TAGS, registerTeams } from './chunk-
|
|
2
|
+
import { TEAMS_TAGS, registerTeams } from './chunk-B7NCMLSK.js';
|
|
3
3
|
import { installOfficeUiTheme } from './chunk-S6ZXU442.js';
|
|
4
4
|
import { registerControls } from './chunk-FUQYUUIQ.js';
|
|
5
5
|
import { definePresence } from './chunk-L7JV5FVE.js';
|
|
@@ -7,4 +7,4 @@ export declare function copyOrCut(view: EditorView, op: 'cut' | 'copy'): Promise
|
|
|
7
7
|
/** Whether the browser will let us read the clipboard; `true` when it cannot say. */
|
|
8
8
|
export declare function clipboardReadAllowed(): Promise<boolean>;
|
|
9
9
|
/** Uses ProseMirror's HTML parser for formatted content, with a plain-text API fallback. */
|
|
10
|
-
export declare function pasteClipboard(view: EditorView): Promise<boolean>;
|
|
10
|
+
export declare function pasteClipboard(view: EditorView, plainText?: boolean): Promise<boolean>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Node } from 'prosemirror-model';
|
|
2
|
+
import type { DecorationSet } from 'prosemirror-view';
|
|
3
|
+
/** Selection transactions retain the document and all formatting inputs. */
|
|
4
|
+
export declare class DecorationCache {
|
|
5
|
+
private doc;
|
|
6
|
+
private inputs;
|
|
7
|
+
private value;
|
|
8
|
+
get(doc: Node, inputs: readonly unknown[]): DecorationSet | undefined;
|
|
9
|
+
set(doc: Node, inputs: readonly unknown[], value: DecorationSet): DecorationSet;
|
|
10
|
+
clear(): void;
|
|
11
|
+
}
|
|
12
|
+
/** ProseMirror retains attribute objects across text-only edits. */
|
|
13
|
+
export declare class AttributeCache<T> {
|
|
14
|
+
private entries;
|
|
15
|
+
resolve(attributes: object, inputs: readonly unknown[], create: () => T): T;
|
|
16
|
+
}
|
|
@@ -70,6 +70,7 @@ export declare class EditorCore {
|
|
|
70
70
|
readonly viewOptions: ViewOptions;
|
|
71
71
|
readonly dirtyState: DirtyState;
|
|
72
72
|
readonly pageTracker: PageTracker;
|
|
73
|
+
private wordText;
|
|
73
74
|
constructor(element: HTMLElement);
|
|
74
75
|
contentWidth(): number;
|
|
75
76
|
canEditBody(): boolean;
|
|
@@ -81,4 +82,6 @@ export declare class EditorCore {
|
|
|
81
82
|
pendingCollaboration(): import("ooxml-core/docx/ui").StepBatch | null;
|
|
82
83
|
applyTransaction(transaction: Transaction, remote?: boolean): void;
|
|
83
84
|
refreshControls(): void;
|
|
85
|
+
/** Scrolling only changes page state, never formatting controls or document statistics. */
|
|
86
|
+
refreshPageStatus(): void;
|
|
84
87
|
}
|
|
@@ -210,6 +210,10 @@ export declare const enRibbon: {
|
|
|
210
210
|
readonly 'Capitalize Each Word': 'Capitalize Each Word';
|
|
211
211
|
readonly 'tOGGLE cASE': 'tOGGLE cASE';
|
|
212
212
|
readonly Paste: 'Paste';
|
|
213
|
+
readonly 'Paste options': 'Paste options';
|
|
214
|
+
readonly 'Keep text only': 'Keep text only';
|
|
215
|
+
readonly 'Bullets options': 'Bullets options';
|
|
216
|
+
readonly 'Numbering options': 'Numbering options';
|
|
213
217
|
readonly Cut: 'Cut';
|
|
214
218
|
readonly Copy: 'Copy';
|
|
215
219
|
readonly 'Grow font': 'Grow font';
|
|
@@ -395,4 +399,34 @@ export declare const enRibbon: {
|
|
|
395
399
|
readonly 'dyn.exact': 'Exact {n} pt';
|
|
396
400
|
readonly 'dyn.atLeast': 'At least {n} pt';
|
|
397
401
|
readonly 'Enter a BCP 47 language tag, such as en-US or ar-SA.': 'Enter a BCP 47 language tag, such as en-US or ar-SA.';
|
|
402
|
+
readonly 'tab.design': 'Design';
|
|
403
|
+
readonly 'tab.mailings': 'Mailings';
|
|
404
|
+
readonly 'tab.help': 'Help';
|
|
405
|
+
readonly 'Document Formatting': 'Document Formatting';
|
|
406
|
+
readonly Themes: 'Themes';
|
|
407
|
+
readonly Colors: 'Colors';
|
|
408
|
+
readonly Fonts: 'Fonts';
|
|
409
|
+
readonly 'Paragraph spacing': 'Paragraph spacing';
|
|
410
|
+
readonly 'Set as Default': 'Set as Default';
|
|
411
|
+
readonly Create: 'Create';
|
|
412
|
+
readonly Envelopes: 'Envelopes';
|
|
413
|
+
readonly Labels: 'Labels';
|
|
414
|
+
readonly 'Start Mail Merge': 'Start Mail Merge';
|
|
415
|
+
readonly 'Select Recipients': 'Select Recipients';
|
|
416
|
+
readonly 'Edit Recipient List': 'Edit Recipient List';
|
|
417
|
+
readonly 'Write & Insert Fields': 'Write & Insert Fields';
|
|
418
|
+
readonly 'Highlight Merge Fields': 'Highlight Merge Fields';
|
|
419
|
+
readonly 'Address Block': 'Address Block';
|
|
420
|
+
readonly 'Greeting Line': 'Greeting Line';
|
|
421
|
+
readonly 'Insert Merge Field': 'Insert Merge Field';
|
|
422
|
+
readonly Rules: 'Rules';
|
|
423
|
+
readonly 'Match Fields': 'Match Fields';
|
|
424
|
+
readonly 'Update Labels': 'Update Labels';
|
|
425
|
+
readonly 'Preview Results': 'Preview Results';
|
|
426
|
+
readonly 'Find Recipient': 'Find Recipient';
|
|
427
|
+
readonly 'Check for Errors': 'Check for Errors';
|
|
428
|
+
readonly Finish: 'Finish';
|
|
429
|
+
readonly 'Finish & Merge': 'Finish & Merge';
|
|
430
|
+
readonly Help: 'Help';
|
|
431
|
+
readonly 'Not available in this editor': 'Not available in this editor';
|
|
398
432
|
};
|
|
@@ -512,6 +512,10 @@ export declare const en: {
|
|
|
512
512
|
readonly 'Capitalize Each Word': 'Capitalize Each Word';
|
|
513
513
|
readonly 'tOGGLE cASE': 'tOGGLE cASE';
|
|
514
514
|
readonly Paste: 'Paste';
|
|
515
|
+
readonly 'Paste options': 'Paste options';
|
|
516
|
+
readonly 'Keep text only': 'Keep text only';
|
|
517
|
+
readonly 'Bullets options': 'Bullets options';
|
|
518
|
+
readonly 'Numbering options': 'Numbering options';
|
|
515
519
|
readonly Cut: 'Cut';
|
|
516
520
|
readonly Copy: 'Copy';
|
|
517
521
|
readonly 'Grow font': 'Grow font';
|
|
@@ -695,6 +699,36 @@ export declare const en: {
|
|
|
695
699
|
readonly 'dyn.exact': 'Exact {n} pt';
|
|
696
700
|
readonly 'dyn.atLeast': 'At least {n} pt';
|
|
697
701
|
readonly 'Enter a BCP 47 language tag, such as en-US or ar-SA.': 'Enter a BCP 47 language tag, such as en-US or ar-SA.';
|
|
702
|
+
readonly 'tab.design': 'Design';
|
|
703
|
+
readonly 'tab.mailings': 'Mailings';
|
|
704
|
+
readonly 'tab.help': 'Help';
|
|
705
|
+
readonly 'Document Formatting': 'Document Formatting';
|
|
706
|
+
readonly Themes: 'Themes';
|
|
707
|
+
readonly Colors: 'Colors';
|
|
708
|
+
readonly Fonts: 'Fonts';
|
|
709
|
+
readonly 'Paragraph spacing': 'Paragraph spacing';
|
|
710
|
+
readonly 'Set as Default': 'Set as Default';
|
|
711
|
+
readonly Create: 'Create';
|
|
712
|
+
readonly Envelopes: 'Envelopes';
|
|
713
|
+
readonly Labels: 'Labels';
|
|
714
|
+
readonly 'Start Mail Merge': 'Start Mail Merge';
|
|
715
|
+
readonly 'Select Recipients': 'Select Recipients';
|
|
716
|
+
readonly 'Edit Recipient List': 'Edit Recipient List';
|
|
717
|
+
readonly 'Write & Insert Fields': 'Write & Insert Fields';
|
|
718
|
+
readonly 'Highlight Merge Fields': 'Highlight Merge Fields';
|
|
719
|
+
readonly 'Address Block': 'Address Block';
|
|
720
|
+
readonly 'Greeting Line': 'Greeting Line';
|
|
721
|
+
readonly 'Insert Merge Field': 'Insert Merge Field';
|
|
722
|
+
readonly Rules: 'Rules';
|
|
723
|
+
readonly 'Match Fields': 'Match Fields';
|
|
724
|
+
readonly 'Update Labels': 'Update Labels';
|
|
725
|
+
readonly 'Preview Results': 'Preview Results';
|
|
726
|
+
readonly 'Find Recipient': 'Find Recipient';
|
|
727
|
+
readonly 'Check for Errors': 'Check for Errors';
|
|
728
|
+
readonly Finish: 'Finish';
|
|
729
|
+
readonly 'Finish & Merge': 'Finish & Merge';
|
|
730
|
+
readonly Help: 'Help';
|
|
731
|
+
readonly 'Not available in this editor': 'Not available in this editor';
|
|
698
732
|
readonly "(No style)": string;
|
|
699
733
|
readonly "Add tab stop at (inches)": string;
|
|
700
734
|
readonly "Aligned at (inches)": string;
|
|
@@ -509,6 +509,10 @@ export declare const strings: {
|
|
|
509
509
|
readonly 'Capitalize Each Word': 'Capitalize Each Word';
|
|
510
510
|
readonly 'tOGGLE cASE': 'tOGGLE cASE';
|
|
511
511
|
readonly Paste: 'Paste';
|
|
512
|
+
readonly 'Paste options': 'Paste options';
|
|
513
|
+
readonly 'Keep text only': 'Keep text only';
|
|
514
|
+
readonly 'Bullets options': 'Bullets options';
|
|
515
|
+
readonly 'Numbering options': 'Numbering options';
|
|
512
516
|
readonly Cut: 'Cut';
|
|
513
517
|
readonly Copy: 'Copy';
|
|
514
518
|
readonly 'Grow font': 'Grow font';
|
|
@@ -692,6 +696,36 @@ export declare const strings: {
|
|
|
692
696
|
readonly 'dyn.exact': 'Exact {n} pt';
|
|
693
697
|
readonly 'dyn.atLeast': 'At least {n} pt';
|
|
694
698
|
readonly 'Enter a BCP 47 language tag, such as en-US or ar-SA.': 'Enter a BCP 47 language tag, such as en-US or ar-SA.';
|
|
699
|
+
readonly 'tab.design': 'Design';
|
|
700
|
+
readonly 'tab.mailings': 'Mailings';
|
|
701
|
+
readonly 'tab.help': 'Help';
|
|
702
|
+
readonly 'Document Formatting': 'Document Formatting';
|
|
703
|
+
readonly Themes: 'Themes';
|
|
704
|
+
readonly Colors: 'Colors';
|
|
705
|
+
readonly Fonts: 'Fonts';
|
|
706
|
+
readonly 'Paragraph spacing': 'Paragraph spacing';
|
|
707
|
+
readonly 'Set as Default': 'Set as Default';
|
|
708
|
+
readonly Create: 'Create';
|
|
709
|
+
readonly Envelopes: 'Envelopes';
|
|
710
|
+
readonly Labels: 'Labels';
|
|
711
|
+
readonly 'Start Mail Merge': 'Start Mail Merge';
|
|
712
|
+
readonly 'Select Recipients': 'Select Recipients';
|
|
713
|
+
readonly 'Edit Recipient List': 'Edit Recipient List';
|
|
714
|
+
readonly 'Write & Insert Fields': 'Write & Insert Fields';
|
|
715
|
+
readonly 'Highlight Merge Fields': 'Highlight Merge Fields';
|
|
716
|
+
readonly 'Address Block': 'Address Block';
|
|
717
|
+
readonly 'Greeting Line': 'Greeting Line';
|
|
718
|
+
readonly 'Insert Merge Field': 'Insert Merge Field';
|
|
719
|
+
readonly Rules: 'Rules';
|
|
720
|
+
readonly 'Match Fields': 'Match Fields';
|
|
721
|
+
readonly 'Update Labels': 'Update Labels';
|
|
722
|
+
readonly 'Preview Results': 'Preview Results';
|
|
723
|
+
readonly 'Find Recipient': 'Find Recipient';
|
|
724
|
+
readonly 'Check for Errors': 'Check for Errors';
|
|
725
|
+
readonly Finish: 'Finish';
|
|
726
|
+
readonly 'Finish & Merge': 'Finish & Merge';
|
|
727
|
+
readonly Help: 'Help';
|
|
728
|
+
readonly 'Not available in this editor': 'Not available in this editor';
|
|
695
729
|
readonly "(No style)": string;
|
|
696
730
|
readonly "Add tab stop at (inches)": string;
|
|
697
731
|
readonly "Aligned at (inches)": string;
|
|
@@ -2,5 +2,5 @@ import { EditorState, Transaction } from 'prosemirror-state';
|
|
|
2
2
|
import type { DocumentModel } from 'ooxml-core/docx';
|
|
3
3
|
import type { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
4
4
|
export declare function modelToDoc(model: DocumentModel): ProseMirrorNode;
|
|
5
|
-
export declare function docToModel(doc: ReturnType<typeof modelToDoc>, prior: DocumentModel): DocumentModel;
|
|
5
|
+
export declare function docToModel(doc: ReturnType<typeof modelToDoc>, prior: DocumentModel, previousDoc?: ProseMirrorNode): DocumentModel;
|
|
6
6
|
export declare function assignMissingParagraphIds(state: EditorState): Transaction | null;
|
|
@@ -61,7 +61,7 @@ export declare class PageController {
|
|
|
61
61
|
setZoom(percent: number, sideBySide?: boolean): void;
|
|
62
62
|
/** Switches between continuous and paginated presentations of the existing editor. */
|
|
63
63
|
setViewMode(mode: 'draft' | 'print'): void;
|
|
64
|
-
/** Re-lays out Print Layout after a model change (
|
|
64
|
+
/** Re-lays out Print Layout after a model change (coalesced by the layout view). */
|
|
65
65
|
relayout(): void;
|
|
66
66
|
print(): void;
|
|
67
67
|
}
|
|
@@ -3,6 +3,7 @@ import { type EditorLocale } from './localization.js';
|
|
|
3
3
|
export interface PageNavigatorHost {
|
|
4
4
|
/** Laid-out page sheets in order; empty until a layout exists. */
|
|
5
5
|
pages(): HTMLElement[];
|
|
6
|
+
pageSnapshot?(index: number): HTMLElement | undefined;
|
|
6
7
|
/** Changes whenever the layout was rebuilt. */
|
|
7
8
|
version(): number;
|
|
8
9
|
goTo(page: number): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Node } from 'prosemirror-model';
|
|
2
|
+
import { Decoration } from 'prosemirror-view';
|
|
3
|
+
type Attributes = Parameters<typeof Decoration.inline>[2];
|
|
4
|
+
interface Descriptor {
|
|
5
|
+
from: number;
|
|
6
|
+
to: number;
|
|
7
|
+
attrs: Attributes;
|
|
8
|
+
spec: object | undefined;
|
|
9
|
+
kind: 'inline' | 'node';
|
|
10
|
+
}
|
|
11
|
+
interface Entry {
|
|
12
|
+
inputs: readonly unknown[];
|
|
13
|
+
descriptors: Descriptor[];
|
|
14
|
+
hasScale: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Store paragraph-local descriptors without mapping a separate tree through the whole document. */
|
|
17
|
+
export declare class ParagraphDecorationBuilder {
|
|
18
|
+
readonly descriptors: Descriptor[];
|
|
19
|
+
inline(from: number, to: number, attrs: Attributes, spec?: object): Decoration;
|
|
20
|
+
node(from: number, to: number, attrs: Attributes, spec?: object): Decoration;
|
|
21
|
+
}
|
|
22
|
+
export declare class ParagraphDecorationCache {
|
|
23
|
+
private entries;
|
|
24
|
+
get(node: Node, inputs: readonly unknown[]): Entry | undefined;
|
|
25
|
+
set(node: Node, inputs: readonly unknown[], builder: ParagraphDecorationBuilder, hasScale: boolean): Entry;
|
|
26
|
+
place(value: Entry, start: number): Decoration[];
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -9,4 +9,4 @@ export interface PrintEditingBridge {
|
|
|
9
9
|
export declare function createPrintEditingBridge(pages: HTMLElement, paper: HTMLElement, getView: () => EditorView | undefined, resolveHit: (target: Element, clientX: number) => {
|
|
10
10
|
blockId: string;
|
|
11
11
|
offset: number;
|
|
12
|
-
} | null, scrollContainer?: HTMLElement): PrintEditingBridge;
|
|
12
|
+
} | null, scrollContainer?: HTMLElement, ensureBlock?: (id: string, offset: number) => void): PrintEditingBridge;
|
|
@@ -20,6 +20,8 @@ export interface PrintLayoutController {
|
|
|
20
20
|
} | null;
|
|
21
21
|
/** The laid-out page sheets currently in the DOM, in order. */
|
|
22
22
|
pageElements(): HTMLElement[];
|
|
23
|
+
pageSnapshot(index: number): HTMLElement | undefined;
|
|
24
|
+
ensureBlock(id: string, offset: number): void;
|
|
23
25
|
/** Increments on every layout pass so dependants (the page navigator) know when to rebuild. */
|
|
24
26
|
layoutVersion(): number;
|
|
25
27
|
/** Scrolls the given 1-based page to the top of the scroll container. */
|
|
@@ -8,6 +8,9 @@ export interface PrintLayoutHandle {
|
|
|
8
8
|
/** The scrollable element holding one sheet per page; mount this in the DOM. */
|
|
9
9
|
element: HTMLElement;
|
|
10
10
|
pageCount: number;
|
|
11
|
+
showPages(center: number, pinned?: number): void;
|
|
12
|
+
renderAll(): void;
|
|
13
|
+
pageSnapshot(index: number): HTMLElement | undefined;
|
|
11
14
|
/**
|
|
12
15
|
* Best-effort click-to-cursor mapping: given the line element under a
|
|
13
16
|
* click and its horizontal offset, measures the displayed text fragments
|
|
@@ -21,6 +24,8 @@ export interface PrintLayoutHandle {
|
|
|
21
24
|
} | null;
|
|
22
25
|
}
|
|
23
26
|
export interface PrintLayoutOptions {
|
|
27
|
+
virtual?: boolean;
|
|
28
|
+
onPageRender?: (sheet: HTMLElement, index: number) => void;
|
|
24
29
|
/** Line numbering by section index; sections without an entry print no numbers. */
|
|
25
30
|
lineNumbers?: ReadonlyArray<PrintLineNumbering | undefined>;
|
|
26
31
|
/** Page borders by section index; drawn on each page they apply to. */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Fixed-size page shells keep scroll geometry stable while only nearby content is mounted. */
|
|
2
|
+
export declare class PrintPageWindow {
|
|
3
|
+
private readonly root;
|
|
4
|
+
private readonly virtual;
|
|
5
|
+
private pages;
|
|
6
|
+
private mounted;
|
|
7
|
+
private revision;
|
|
8
|
+
constructor(root: HTMLElement, virtual: boolean);
|
|
9
|
+
add(sheet: HTMLElement, draw: () => () => void): void;
|
|
10
|
+
mount(index: number): void;
|
|
11
|
+
private unmount;
|
|
12
|
+
private changed;
|
|
13
|
+
show(center: number, pinned?: number): void;
|
|
14
|
+
all(): void;
|
|
15
|
+
snapshot(index: number): HTMLElement | undefined;
|
|
16
|
+
}
|
|
@@ -3,6 +3,8 @@ import type { MultilingualAction } from './multilingual-ribbon.js';
|
|
|
3
3
|
import type { ReviewDisplayMode } from './review-display.js';
|
|
4
4
|
/** Every command the ribbon can raise, dispatched as a `ribbon-action` event. */
|
|
5
5
|
export type RibbonAction = {
|
|
6
|
+
type: 'help';
|
|
7
|
+
} | {
|
|
6
8
|
type: 'format';
|
|
7
9
|
key: 'bold' | 'italic' | 'underline' | 'strike' | 'superscript' | 'subscript';
|
|
8
10
|
} | {
|
|
@@ -26,6 +28,10 @@ export type RibbonAction = {
|
|
|
26
28
|
} | {
|
|
27
29
|
type: 'clipboard';
|
|
28
30
|
key: 'cut' | 'copy' | 'paste';
|
|
31
|
+
plainText?: boolean;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'underline';
|
|
34
|
+
value: import('./font-format.js').UnderlineKind;
|
|
29
35
|
} | {
|
|
30
36
|
type: 'fontStep';
|
|
31
37
|
direction: 'grow' | 'shrink';
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/** Line icons for ribbon buttons on a 24x24 grid, drawn with `currentColor` so themes apply. */
|
|
2
2
|
declare const paths: {
|
|
3
|
+
readonly envelope: 'M3 5h18v14H3z M3 5l9 7 9-7';
|
|
4
|
+
readonly field: 'M4 3h16v18H4z M10 8l-3 4 3 4 M14 8l3 4-3 4';
|
|
5
|
+
readonly help: 'M9 8a3 3 0 1 1 4 2.8c-1 .5-1 1.2-1 2.2 M12 17h.01 M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20';
|
|
3
6
|
readonly close: 'M6 6l12 12 M18 6L6 18';
|
|
4
7
|
readonly paste: 'M8 4h8v3H8z M6 5.5H5v15h14v-15h-1 M9 12h6 M9 15.5h6';
|
|
5
8
|
readonly cut: 'M6 3l9 12 M18 3l-9 12 M7 15.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5z M17 15.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5z';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RibbonAction } from './ribbon-action.js';
|
|
2
2
|
import { type RibbonIcon } from './ribbon-icons.js';
|
|
3
3
|
/** Building blocks for ribbon tabs: buttons, selects, labelled groups and rows. */
|
|
4
|
-
export declare const button: (label: string, text: string, action: RibbonAction, className?: string) => HTMLButtonElement;
|
|
4
|
+
export declare const button: (label: string, text: string, action: RibbonAction | null, className?: string) => HTMLButtonElement;
|
|
5
5
|
export declare const select: (label: string, values: Array<[string, string]>, action: (value: string) => RibbonAction) => HTMLSelectElement;
|
|
6
6
|
/**
|
|
7
7
|
* Word's dropdown command: an icon over a caption with a caret. The real `<select>` stays in the
|
|
@@ -34,7 +34,7 @@ export declare const launcher: (label: string, action: RibbonAction) => HTMLButt
|
|
|
34
34
|
export declare const group: (label: string, ...children: HTMLElement[]) => HTMLDivElement;
|
|
35
35
|
export declare const row: (...children: HTMLElement[]) => HTMLDivElement;
|
|
36
36
|
/** An icon button. `large` stacks a caption under a 28px icon, as Word's big commands do. */
|
|
37
|
-
export declare const tool: (label: string, icon: RibbonIcon, action: RibbonAction, options?: {
|
|
37
|
+
export declare const tool: (label: string, icon: RibbonIcon, action: RibbonAction | null, options?: {
|
|
38
38
|
large?: boolean;
|
|
39
39
|
inline?: boolean;
|
|
40
40
|
caption?: string;
|