@datalking/begonia-browser-sdk 0.0.0-stage → 0.1.1
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.md +661 -0
- package/README.md +8 -2
- package/dist/browser-advanced-ooxml-command-types.d.ts +3 -0
- package/dist/browser-advanced-ooxml-edit-plan-shape.d.ts +3 -0
- package/dist/browser-advanced-ooxml-inspector-controller.d.ts +2 -0
- package/dist/browser-advanced-ooxml-inspector-formats.d.ts +71 -0
- package/dist/browser-advanced-ooxml-inspector-snapshot.d.ts +3 -0
- package/dist/browser-advanced-ooxml-inspector-types.d.ts +56 -0
- package/dist/browser-advanced-ooxml-nodeview-events.d.ts +168 -0
- package/dist/browser-advanced-ooxml-subtree-chart.d.ts +13 -0
- package/dist/browser-advanced-ooxml-subtree-editor.d.ts +38 -0
- package/dist/browser-advanced-ooxml-subtree-math-insertions.d.ts +2 -0
- package/dist/browser-advanced-ooxml-subtree-math-serialize.d.ts +3 -0
- package/dist/browser-advanced-ooxml-subtree-math-shared.d.ts +16 -0
- package/dist/browser-advanced-ooxml-subtree-math.d.ts +7 -0
- package/dist/browser-advanced-ooxml-subtree-shape-insertions.d.ts +2 -0
- package/dist/browser-advanced-ooxml-subtree-shape-parse.d.ts +3 -0
- package/dist/browser-advanced-ooxml-subtree-shape-sections.d.ts +16 -0
- package/dist/browser-advanced-ooxml-subtree-shape-types.d.ts +12 -0
- package/dist/browser-advanced-ooxml-subtree-shape.d.ts +4 -0
- package/dist/browser-advanced-ooxml-surface-feature-helpers.d.ts +3 -0
- package/dist/browser-advanced-ooxml-surface-feature.d.ts +4 -0
- package/dist/browser-command-controller.d.ts +2 -0
- package/dist/browser-command-types.d.ts +263 -0
- package/dist/browser-comment-target-selection.d.ts +22 -0
- package/dist/browser-document-api-selection.d.ts +26 -0
- package/dist/browser-editor-active-comment-selection.d.ts +21 -0
- package/dist/browser-editor-active-comment.d.ts +16 -0
- package/dist/browser-editor-active-revision.d.ts +19 -0
- package/dist/browser-editor-advanced-ooxml-chart.d.ts +22 -0
- package/dist/browser-editor-advanced-ooxml-core.d.ts +25 -0
- package/dist/browser-editor-advanced-ooxml-math.d.ts +10 -0
- package/dist/browser-editor-advanced-ooxml-nodeview-bridge.d.ts +5 -0
- package/dist/browser-editor-advanced-ooxml-shape.d.ts +25 -0
- package/dist/browser-editor-advanced-ooxml.d.ts +4 -0
- package/dist/browser-editor-backend-access.d.ts +9 -0
- package/dist/browser-editor-backend-adapter-v1.d.ts +4 -0
- package/dist/browser-editor-backend-adapter.d.ts +17 -0
- package/dist/browser-editor-collaboration-state-types.d.ts +15 -0
- package/dist/browser-editor-comment-navigation.d.ts +16 -0
- package/dist/browser-editor-comment-replay-target.d.ts +23 -0
- package/dist/browser-editor-comment-target-selection-v1.d.ts +7 -0
- package/dist/browser-editor-comments-controller.d.ts +4 -0
- package/dist/browser-editor-comments-types.d.ts +47 -0
- package/dist/browser-editor-comments-write-state.d.ts +11 -0
- package/dist/browser-editor-contracts-v1.d.ts +47 -0
- package/dist/browser-editor-contracts.d.ts +59 -0
- package/dist/browser-editor-create.d.ts +7 -0
- package/dist/browser-editor-domain-types.d.ts +87 -0
- package/dist/browser-editor-host.d.ts +14 -0
- package/dist/browser-editor-inline-format-actions.d.ts +19 -0
- package/dist/browser-editor-inline-format-state.d.ts +7 -0
- package/dist/browser-editor-mount-controller.d.ts +23 -0
- package/dist/browser-editor-mount.d.ts +8 -0
- package/dist/browser-editor-node-selection-rebase.d.ts +21 -0
- package/dist/browser-editor-node-selection-target-types.d.ts +9 -0
- package/dist/browser-editor-point-context.d.ts +27 -0
- package/dist/browser-editor-point-position.d.ts +3 -0
- package/dist/browser-editor-point-types.d.ts +16 -0
- package/dist/browser-editor-preserved-range-shared.d.ts +31 -0
- package/dist/browser-editor-preserved-range-state.d.ts +39 -0
- package/dist/browser-editor-preserved-range-target-selection.d.ts +29 -0
- package/dist/browser-editor-projected-selection-change-ranges.d.ts +14 -0
- package/dist/browser-editor-projected-selection-review-rebase.d.ts +26 -0
- package/dist/browser-editor-projected-selection-review-state.d.ts +20 -0
- package/dist/browser-editor-projected-selection-review-transitions.d.ts +33 -0
- package/dist/browser-editor-projection-snapshot.d.ts +41 -0
- package/dist/browser-editor-range-selection.d.ts +10 -0
- package/dist/browser-editor-review-comment-selection.d.ts +12 -0
- package/dist/browser-editor-review-projection.d.ts +16 -0
- package/dist/browser-editor-review-selection-state.d.ts +39 -0
- package/dist/browser-editor-runtime-v1.d.ts +16 -0
- package/dist/browser-editor-selection-capture-create.d.ts +8 -0
- package/dist/browser-editor-selection-capture.d.ts +17 -0
- package/dist/browser-editor-selection-geometry.d.ts +35 -0
- package/dist/browser-editor-selection-handle.d.ts +6 -0
- package/dist/browser-editor-selection-orientation.d.ts +14 -0
- package/dist/browser-editor-selection-rebase-targets-surface.d.ts +34 -0
- package/dist/browser-editor-selection-rebase-targets-types.d.ts +39 -0
- package/dist/browser-editor-selection-rebase-targets.d.ts +37 -0
- package/dist/browser-editor-selection-rebase.d.ts +29 -0
- package/dist/browser-editor-selection-restore.d.ts +23 -0
- package/dist/browser-editor-selection-snapshot.d.ts +35 -0
- package/dist/browser-editor-selection-target-from-block-path.d.ts +3 -0
- package/dist/browser-editor-surface-projection-mode.d.ts +10 -0
- package/dist/browser-editor-text-target-selection.d.ts +29 -0
- package/dist/browser-editor-track-change-navigation.d.ts +8 -0
- package/dist/browser-editor-track-change-types.d.ts +69 -0
- package/dist/browser-editor-track-changes-controller.d.ts +6 -0
- package/dist/browser-editor-types-collaboration.d.ts +57 -0
- package/dist/browser-editor-types-controller.d.ts +139 -0
- package/dist/browser-editor-types-shared.d.ts +205 -0
- package/dist/browser-editor-types-state.d.ts +45 -0
- package/dist/browser-editor-types.d.ts +7 -0
- package/dist/browser-editor-ui-controller.d.ts +4 -0
- package/dist/browser-editor-ui-source.d.ts +5 -0
- package/dist/browser-editor-ui-types.d.ts +73 -0
- package/dist/browser-editor-ui.d.ts +2 -0
- package/dist/browser-editor-view-intent.d.ts +35 -0
- package/dist/browser-editor-viewport/browser-editor-viewport-bounds.d.ts +41 -0
- package/dist/browser-editor-viewport/browser-editor-viewport-normalize.d.ts +25 -0
- package/dist/browser-editor-viewport-context-types.d.ts +19 -0
- package/dist/browser-editor-viewport-geometry.d.ts +45 -0
- package/dist/browser-editor-viewport-helpers.d.ts +2 -0
- package/dist/browser-editor-viewport-scroll-into-view.d.ts +30 -0
- package/dist/browser-editor-viewport-session-navigation.d.ts +4 -0
- package/dist/browser-editor-viewport-session-patch.d.ts +3 -0
- package/dist/browser-editor-viewport-session-state-types.d.ts +23 -0
- package/dist/browser-editor-viewport-session-state.d.ts +4 -0
- package/dist/browser-editor-viewport-types.d.ts +21 -0
- package/dist/browser-headless-toolbar-types.d.ts +92 -0
- package/dist/browser-headless-toolbar.d.ts +3 -0
- package/dist/browser-paginated-preview-binding-projection.d.ts +9 -0
- package/dist/browser-paginated-preview-controller-state.d.ts +84 -0
- package/dist/browser-paginated-preview-controller.d.ts +16 -0
- package/dist/browser-paginated-preview-editor-binding.d.ts +28 -0
- package/dist/browser-paginated-preview-helpers.d.ts +35 -0
- package/dist/browser-paginated-preview-lifecycle-reset.d.ts +18 -0
- package/dist/browser-paginated-preview-mode-state.d.ts +9 -0
- package/dist/browser-paginated-preview-navigation-anchor.d.ts +4 -0
- package/dist/browser-paginated-preview-pins.d.ts +17 -0
- package/dist/browser-paginated-preview-position-hit.d.ts +31 -0
- package/dist/browser-paginated-preview-reset-plan.d.ts +31 -0
- package/dist/browser-paginated-preview-selection-actions.d.ts +13 -0
- package/dist/browser-paginated-preview-selection-v1.d.ts +1 -0
- package/dist/browser-paginated-preview-selection.d.ts +20 -0
- package/dist/browser-paginated-preview-session-state.d.ts +51 -0
- package/dist/browser-paginated-preview-text-selection.d.ts +21 -0
- package/dist/browser-paginated-preview-ui-controller.d.ts +19 -0
- package/dist/browser-paginated-preview-view-model.d.ts +35 -0
- package/dist/browser-review-comment-types.d.ts +33 -0
- package/dist/browser-review-revision-types.d.ts +41 -0
- package/dist/browser-slash-menu-controller.d.ts +2 -0
- package/dist/browser-theme.d.ts +26 -0
- package/dist/command.js +5 -0
- package/dist/editor.d.ts +36 -0
- package/dist/editor.js +4 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +5 -0
- package/dist/ooxml.d.ts +17 -0
- package/dist/ooxml.js +4 -0
- package/dist/paginated-preview-selection-table/preview-selection-table-hit.d.ts +7 -0
- package/dist/paginated-preview-selection-table/preview-selection-table-resolve.d.ts +76 -0
- package/dist/paginated-preview-selection-v1/preview-selection-v1-handle.d.ts +7 -0
- package/dist/paginated-preview-selection-v1/preview-selection-v1-resolve.d.ts +33 -0
- package/dist/preview.d.ts +7 -0
- package/dist/preview.js +1 -0
- package/dist/theme.js +1 -0
- package/dist/v1.d.ts +40 -0
- package/dist/v1.js +9 -0
- package/package.json +63 -4
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AdvancedOoxmlShapeModel } from '@datalking/begonia-document-api/ooxml-contracts';
|
|
2
|
+
import type { BrowserAdvancedOoxmlShapeEditOperation } from './browser-advanced-ooxml-nodeview-events.ts';
|
|
3
|
+
export declare function planShapeNodeViewEdits(current: AdvancedOoxmlShapeModel, next: AdvancedOoxmlShapeModel): BrowserAdvancedOoxmlShapeEditOperation[];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { BrowserAdvancedOoxmlInspectorController, BrowserAdvancedOoxmlInspectorSource } from './browser-advanced-ooxml-inspector-types.ts';
|
|
2
|
+
export declare function createBrowserAdvancedOoxmlInspectorController(source: BrowserAdvancedOoxmlInspectorSource): BrowserAdvancedOoxmlInspectorController;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { AdvancedOoxmlChartAxis, AdvancedOoxmlChartLegend, AdvancedOoxmlChartModel, AdvancedOoxmlChartSeries, AdvancedOoxmlShapeModel } from '@datalking/begonia-document-api/ooxml-contracts';
|
|
2
|
+
export interface ChartSeriesDraft {
|
|
3
|
+
id: string;
|
|
4
|
+
order: string;
|
|
5
|
+
name: string;
|
|
6
|
+
categories: string;
|
|
7
|
+
values: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ChartAxisDraft {
|
|
10
|
+
id: string;
|
|
11
|
+
kind: AdvancedOoxmlChartAxis['kind'] | 'unknown';
|
|
12
|
+
title: string;
|
|
13
|
+
formatCode: string;
|
|
14
|
+
orientation: NonNullable<AdvancedOoxmlChartAxis['orientation']> | 'unknown';
|
|
15
|
+
}
|
|
16
|
+
export interface ChartLegendDraft {
|
|
17
|
+
enabled: 'true' | 'false';
|
|
18
|
+
visible: 'true' | 'false';
|
|
19
|
+
position: NonNullable<AdvancedOoxmlChartLegend['position']> | 'unknown';
|
|
20
|
+
overlay: 'unknown' | 'true' | 'false';
|
|
21
|
+
}
|
|
22
|
+
export interface ShapeModelDraft {
|
|
23
|
+
label: string;
|
|
24
|
+
shapeType: string;
|
|
25
|
+
textBody: string;
|
|
26
|
+
geometryPreset: string;
|
|
27
|
+
geometryCustomPathCount?: string;
|
|
28
|
+
fillKind: NonNullable<AdvancedOoxmlShapeModel['fill']>['kind'] | 'unknown';
|
|
29
|
+
fillColor: string;
|
|
30
|
+
strokeColor: string;
|
|
31
|
+
strokeWidthEmu: string;
|
|
32
|
+
strokeDash: string;
|
|
33
|
+
widthEmu: string;
|
|
34
|
+
heightEmu: string;
|
|
35
|
+
offsetXEmu?: string;
|
|
36
|
+
offsetYEmu?: string;
|
|
37
|
+
rotation: string;
|
|
38
|
+
flipH?: 'unknown' | 'true' | 'false';
|
|
39
|
+
flipV?: 'unknown' | 'true' | 'false';
|
|
40
|
+
anchorKind: NonNullable<AdvancedOoxmlShapeModel['anchor']>['kind'] | 'unknown';
|
|
41
|
+
anchorWrap: NonNullable<AdvancedOoxmlShapeModel['anchor']>['wrap'] | 'unknown';
|
|
42
|
+
anchorBehindDoc?: 'unknown' | 'true' | 'false';
|
|
43
|
+
anchorAllowOverlap?: 'unknown' | 'true' | 'false';
|
|
44
|
+
anchorLayoutInCell?: 'unknown' | 'true' | 'false';
|
|
45
|
+
anchorRelativeHeight?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function trimToNull(value: string): string | null;
|
|
48
|
+
export declare function booleanSelectValue(value: boolean | null | undefined): 'unknown' | 'true' | 'false';
|
|
49
|
+
export declare function parseBooleanSelect(value: string): boolean | null;
|
|
50
|
+
export declare function linesToParagraphs(value: string): string[];
|
|
51
|
+
export declare function textToChartTextBody(value: string): {
|
|
52
|
+
paragraphs: string[];
|
|
53
|
+
plainText: string;
|
|
54
|
+
} | null;
|
|
55
|
+
export declare function textToShapeTextBody(value: string): {
|
|
56
|
+
paragraphs: string[];
|
|
57
|
+
plainText: string;
|
|
58
|
+
} | null;
|
|
59
|
+
export declare function seriesDraftsFromModel(model: AdvancedOoxmlChartModel): ChartSeriesDraft[];
|
|
60
|
+
export declare function axisDraftsFromModel(model: AdvancedOoxmlChartModel): ChartAxisDraft[];
|
|
61
|
+
export declare function legendDraftFromModel(model: AdvancedOoxmlChartModel): ChartLegendDraft;
|
|
62
|
+
export declare function appendEmptySeriesDraft(drafts: readonly ChartSeriesDraft[]): ChartSeriesDraft[];
|
|
63
|
+
export declare function appendEmptyAxisDraft(drafts: readonly ChartAxisDraft[]): ChartAxisDraft[];
|
|
64
|
+
export declare function parseChartSeriesDraft(draft: ChartSeriesDraft): AdvancedOoxmlChartSeries;
|
|
65
|
+
export declare function parseChartAxisDraft(draft: ChartAxisDraft): AdvancedOoxmlChartAxis;
|
|
66
|
+
export declare function parseChartLegendDraft(draft: ChartLegendDraft): AdvancedOoxmlChartLegend | null;
|
|
67
|
+
export declare function mergeChartModelWithDrafts(model: AdvancedOoxmlChartModel, title: string, chartType: string, textBody: string, drafts: readonly ChartSeriesDraft[], options?: {
|
|
68
|
+
axes?: readonly ChartAxisDraft[];
|
|
69
|
+
legend?: ChartLegendDraft | null;
|
|
70
|
+
}): AdvancedOoxmlChartModel;
|
|
71
|
+
export declare function mergeShapeModelWithDrafts(model: AdvancedOoxmlShapeModel, draft: ShapeModelDraft): AdvancedOoxmlShapeModel;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { BrowserAdvancedOoxmlInspectorSnapshot, BrowserAdvancedOoxmlInspectorSnapshotSource } from './browser-advanced-ooxml-inspector-types.ts';
|
|
2
|
+
export declare function emptyBrowserAdvancedOoxmlInspectorSnapshot(documentMode?: BrowserAdvancedOoxmlInspectorSnapshot['documentMode'], trackingEnabled?: boolean): BrowserAdvancedOoxmlInspectorSnapshot;
|
|
3
|
+
export declare function readBrowserAdvancedOoxmlInspectorSnapshot(state: BrowserAdvancedOoxmlInspectorSnapshotSource): BrowserAdvancedOoxmlInspectorSnapshot;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
type DocumentApi = any;
|
|
2
|
+
|
|
3
|
+
import type { DocumentPermissionActor } from '@datalking/begonia-document-api/review';
|
|
4
|
+
import type { AdvancedOoxmlChartModel, AdvancedOoxmlChartRecord, AdvancedOoxmlChartSeries, AdvancedOoxmlMathDisplayMode, AdvancedOoxmlMathModel, AdvancedOoxmlMathRecord, AdvancedOoxmlMathStructure, AdvancedOoxmlRecord, AdvancedOoxmlShapeModel, AdvancedOoxmlShapeRecord } from '@datalking/begonia-document-api/ooxml-contracts';
|
|
5
|
+
import type { BrowserEditorAdvancedOoxmlActions } from './browser-editor-contracts-v1.ts';
|
|
6
|
+
import type { BrowserEditorUiSource } from './browser-editor-ui-source.ts';
|
|
7
|
+
import type { BrowserDocumentMode } from './browser-editor-types-shared.ts';
|
|
8
|
+
export interface BrowserAdvancedOoxmlInspectorBaseSelection<TRecord extends AdvancedOoxmlRecord> {
|
|
9
|
+
record: TRecord;
|
|
10
|
+
trackingEnabled: boolean;
|
|
11
|
+
documentMode: BrowserDocumentMode;
|
|
12
|
+
}
|
|
13
|
+
export interface BrowserAdvancedOoxmlInspectorMathSelection extends BrowserAdvancedOoxmlInspectorBaseSelection<AdvancedOoxmlMathRecord> {
|
|
14
|
+
family: 'math';
|
|
15
|
+
model: AdvancedOoxmlMathModel;
|
|
16
|
+
plainText: string;
|
|
17
|
+
displayMode: AdvancedOoxmlMathDisplayMode;
|
|
18
|
+
structures: readonly AdvancedOoxmlMathStructure[];
|
|
19
|
+
}
|
|
20
|
+
export interface BrowserAdvancedOoxmlInspectorChartSelection extends BrowserAdvancedOoxmlInspectorBaseSelection<AdvancedOoxmlChartRecord> {
|
|
21
|
+
family: 'chart';
|
|
22
|
+
model: AdvancedOoxmlChartModel;
|
|
23
|
+
series: readonly AdvancedOoxmlChartSeries[];
|
|
24
|
+
seriesCount: number;
|
|
25
|
+
categoryCount: number;
|
|
26
|
+
}
|
|
27
|
+
export interface BrowserAdvancedOoxmlInspectorShapeSelection extends BrowserAdvancedOoxmlInspectorBaseSelection<AdvancedOoxmlShapeRecord> {
|
|
28
|
+
family: 'shape';
|
|
29
|
+
model: AdvancedOoxmlShapeModel;
|
|
30
|
+
}
|
|
31
|
+
export type BrowserAdvancedOoxmlInspectorSelection = BrowserAdvancedOoxmlInspectorMathSelection | BrowserAdvancedOoxmlInspectorChartSelection | BrowserAdvancedOoxmlInspectorShapeSelection;
|
|
32
|
+
export type BrowserAdvancedOoxmlInspectorSource = BrowserEditorUiSource;
|
|
33
|
+
export interface BrowserAdvancedOoxmlInspectorSnapshot {
|
|
34
|
+
selected: BrowserAdvancedOoxmlInspectorSelection | null;
|
|
35
|
+
trackingEnabled: boolean;
|
|
36
|
+
documentMode: BrowserDocumentMode;
|
|
37
|
+
}
|
|
38
|
+
export interface BrowserAdvancedOoxmlInspectorController extends Omit<BrowserEditorAdvancedOoxmlActions, 'removeSelectedAdvancedOoxml'> {
|
|
39
|
+
readonly actor: DocumentPermissionActor | null;
|
|
40
|
+
readonly documentApi: DocumentApi;
|
|
41
|
+
getSnapshot(): BrowserAdvancedOoxmlInspectorSnapshot;
|
|
42
|
+
subscribe(listener: (snapshot: BrowserAdvancedOoxmlInspectorSnapshot) => void): () => void;
|
|
43
|
+
removeSelected(): ReturnType<DocumentApi['ooxml']['remove']>;
|
|
44
|
+
destroy(): void;
|
|
45
|
+
}
|
|
46
|
+
export interface BrowserAdvancedOoxmlInspectorSnapshotSource {
|
|
47
|
+
advancedOoxml: {
|
|
48
|
+
selected: AdvancedOoxmlRecord | null;
|
|
49
|
+
};
|
|
50
|
+
documentMode: BrowserDocumentMode | string | null;
|
|
51
|
+
trackingEnabled?: boolean;
|
|
52
|
+
toolbar?: {
|
|
53
|
+
trackingEnabled?: boolean;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export type ReadBrowserAdvancedOoxmlInspectorSnapshot = (state: BrowserAdvancedOoxmlInspectorSnapshotSource) => BrowserAdvancedOoxmlInspectorSnapshot;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import type { AdvancedOoxmlChartAxis, AdvancedOoxmlChartLegend, AdvancedOoxmlChartModel, AdvancedOoxmlChartPlotArea, AdvancedOoxmlChartSeries, AdvancedOoxmlChartTextBody, AdvancedOoxmlMathModel, AdvancedOoxmlMathDisplayMode, AdvancedOoxmlShapeAnchor, AdvancedOoxmlShapeChild, AdvancedOoxmlShapeConnector, AdvancedOoxmlShapeEffects, AdvancedOoxmlShapeFill, AdvancedOoxmlShapeGeometry, AdvancedOoxmlShapeModel, AdvancedOoxmlShapePicture, AdvancedOoxmlShapeStroke, AdvancedOoxmlShapeTransform, AdvancedOoxmlShapeWordArt } from '@datalking/begonia-document-api/ooxml-contracts';
|
|
2
|
+
export declare const browserAdvancedOoxmlNodeViewActionEvent = "ald:advanced-ooxml-nodeview-action";
|
|
3
|
+
export type BrowserAdvancedOoxmlMathEditOperation = {
|
|
4
|
+
type: 'set-display-mode';
|
|
5
|
+
displayMode: AdvancedOoxmlMathDisplayMode;
|
|
6
|
+
} | {
|
|
7
|
+
type: 'set-plain-text';
|
|
8
|
+
text: string;
|
|
9
|
+
displayMode: AdvancedOoxmlMathDisplayMode;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'replace-model';
|
|
12
|
+
model: AdvancedOoxmlMathModel;
|
|
13
|
+
};
|
|
14
|
+
export type BrowserAdvancedOoxmlChartEditOperation = {
|
|
15
|
+
type: 'set-metadata';
|
|
16
|
+
title: string | null;
|
|
17
|
+
chartType: string | null;
|
|
18
|
+
subtitle: string | null;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'set-text-body';
|
|
21
|
+
textBody: AdvancedOoxmlChartTextBody | null;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'set-plot-area';
|
|
24
|
+
plotArea: AdvancedOoxmlChartPlotArea | null;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'set-legend';
|
|
27
|
+
legend: AdvancedOoxmlChartLegend | null;
|
|
28
|
+
} | {
|
|
29
|
+
type: 'set-series';
|
|
30
|
+
target: number | string;
|
|
31
|
+
series: AdvancedOoxmlChartSeries;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'set-series-list';
|
|
34
|
+
series: AdvancedOoxmlChartSeries[];
|
|
35
|
+
} | {
|
|
36
|
+
type: 'upsert-series';
|
|
37
|
+
seriesId?: string | null;
|
|
38
|
+
series: AdvancedOoxmlChartSeries;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'append-series';
|
|
41
|
+
series: AdvancedOoxmlChartSeries;
|
|
42
|
+
} | {
|
|
43
|
+
type: 'remove-series';
|
|
44
|
+
target: number | string;
|
|
45
|
+
} | {
|
|
46
|
+
type: 'set-axes';
|
|
47
|
+
axes: AdvancedOoxmlChartAxis[];
|
|
48
|
+
} | {
|
|
49
|
+
type: 'upsert-axis';
|
|
50
|
+
axisId?: string | null;
|
|
51
|
+
axis: AdvancedOoxmlChartAxis;
|
|
52
|
+
} | {
|
|
53
|
+
type: 'remove-axis';
|
|
54
|
+
axisId: string;
|
|
55
|
+
} | {
|
|
56
|
+
type: 'replace-model';
|
|
57
|
+
model: AdvancedOoxmlChartModel;
|
|
58
|
+
};
|
|
59
|
+
export type BrowserAdvancedOoxmlShapeEditOperation = {
|
|
60
|
+
type: 'set-metadata';
|
|
61
|
+
label: string | null;
|
|
62
|
+
shapeType: string | null;
|
|
63
|
+
groupKind: string | null;
|
|
64
|
+
} | {
|
|
65
|
+
type: 'set-watermark';
|
|
66
|
+
isWatermark: boolean;
|
|
67
|
+
} | {
|
|
68
|
+
type: 'set-text-body';
|
|
69
|
+
paragraphs: string[];
|
|
70
|
+
} | {
|
|
71
|
+
type: 'set-geometry';
|
|
72
|
+
geometry: AdvancedOoxmlShapeGeometry | null;
|
|
73
|
+
} | {
|
|
74
|
+
type: 'set-transform';
|
|
75
|
+
transform: AdvancedOoxmlShapeTransform | null;
|
|
76
|
+
} | {
|
|
77
|
+
type: 'set-fill';
|
|
78
|
+
fill: AdvancedOoxmlShapeFill | null;
|
|
79
|
+
} | {
|
|
80
|
+
type: 'set-stroke';
|
|
81
|
+
stroke: AdvancedOoxmlShapeStroke | null;
|
|
82
|
+
} | {
|
|
83
|
+
type: 'set-effects';
|
|
84
|
+
effects: AdvancedOoxmlShapeEffects | null;
|
|
85
|
+
} | {
|
|
86
|
+
type: 'set-anchor';
|
|
87
|
+
anchor: AdvancedOoxmlShapeAnchor | null;
|
|
88
|
+
} | {
|
|
89
|
+
type: 'set-children';
|
|
90
|
+
children: AdvancedOoxmlShapeChild[];
|
|
91
|
+
} | {
|
|
92
|
+
type: 'set-child';
|
|
93
|
+
target: number | string;
|
|
94
|
+
child: AdvancedOoxmlShapeChild;
|
|
95
|
+
} | {
|
|
96
|
+
type: 'append-child';
|
|
97
|
+
child: AdvancedOoxmlShapeChild;
|
|
98
|
+
} | {
|
|
99
|
+
type: 'append-child-to-parent';
|
|
100
|
+
parentTarget: string | null;
|
|
101
|
+
child: AdvancedOoxmlShapeChild;
|
|
102
|
+
} | {
|
|
103
|
+
type: 'move-child';
|
|
104
|
+
target: number | string;
|
|
105
|
+
parentTarget: string | null;
|
|
106
|
+
beforeTarget: string | null;
|
|
107
|
+
} | {
|
|
108
|
+
type: 'remove-child';
|
|
109
|
+
target: number | string;
|
|
110
|
+
} | {
|
|
111
|
+
type: 'set-connector';
|
|
112
|
+
connector: AdvancedOoxmlShapeConnector | null;
|
|
113
|
+
} | {
|
|
114
|
+
type: 'set-picture';
|
|
115
|
+
picture: AdvancedOoxmlShapePicture | null;
|
|
116
|
+
} | {
|
|
117
|
+
type: 'set-word-art';
|
|
118
|
+
wordArt: AdvancedOoxmlShapeWordArt | null;
|
|
119
|
+
} | {
|
|
120
|
+
type: 'replace-model';
|
|
121
|
+
model: AdvancedOoxmlShapeModel;
|
|
122
|
+
};
|
|
123
|
+
export type BrowserAdvancedOoxmlNodeViewActionDetail = {
|
|
124
|
+
family: 'math';
|
|
125
|
+
action: 'replace-math-model';
|
|
126
|
+
objectId: string;
|
|
127
|
+
model: AdvancedOoxmlMathModel;
|
|
128
|
+
} | {
|
|
129
|
+
family: 'math';
|
|
130
|
+
action: 'set-math-plain-text';
|
|
131
|
+
objectId: string;
|
|
132
|
+
text: string;
|
|
133
|
+
displayMode: AdvancedOoxmlMathDisplayMode;
|
|
134
|
+
} | {
|
|
135
|
+
family: 'chart';
|
|
136
|
+
action: 'replace-chart-model';
|
|
137
|
+
objectId: string;
|
|
138
|
+
model: AdvancedOoxmlChartModel;
|
|
139
|
+
} | {
|
|
140
|
+
family: 'shape';
|
|
141
|
+
action: 'replace-shape-model';
|
|
142
|
+
objectId: string;
|
|
143
|
+
model: AdvancedOoxmlShapeModel;
|
|
144
|
+
} | {
|
|
145
|
+
family: 'math';
|
|
146
|
+
action: 'apply-math-edits';
|
|
147
|
+
objectId: string;
|
|
148
|
+
model: AdvancedOoxmlMathModel;
|
|
149
|
+
edits: BrowserAdvancedOoxmlMathEditOperation[];
|
|
150
|
+
} | {
|
|
151
|
+
family: 'chart';
|
|
152
|
+
action: 'apply-chart-edits';
|
|
153
|
+
objectId: string;
|
|
154
|
+
model: AdvancedOoxmlChartModel;
|
|
155
|
+
edits: BrowserAdvancedOoxmlChartEditOperation[];
|
|
156
|
+
} | {
|
|
157
|
+
family: 'shape';
|
|
158
|
+
action: 'apply-shape-edits';
|
|
159
|
+
objectId: string;
|
|
160
|
+
model: AdvancedOoxmlShapeModel;
|
|
161
|
+
edits: BrowserAdvancedOoxmlShapeEditOperation[];
|
|
162
|
+
} | {
|
|
163
|
+
family: 'math' | 'chart' | 'shape';
|
|
164
|
+
action: 'remove-advanced-ooxml';
|
|
165
|
+
objectId: string;
|
|
166
|
+
};
|
|
167
|
+
export declare function isBrowserAdvancedOoxmlNodeViewActionDetail(value: unknown): value is BrowserAdvancedOoxmlNodeViewActionDetail;
|
|
168
|
+
export declare function dispatchBrowserAdvancedOoxmlNodeViewAction(target: EventTarget, detail: BrowserAdvancedOoxmlNodeViewActionDetail): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AdvancedOoxmlChartModel } from '@datalking/begonia-document-api/ooxml-contracts';
|
|
2
|
+
import { type StructuredEditorEntry } from './browser-advanced-ooxml-subtree-editor.ts';
|
|
3
|
+
export interface ChartSubtreeInsertion {
|
|
4
|
+
label: string;
|
|
5
|
+
createEntry(): StructuredEditorEntry;
|
|
6
|
+
}
|
|
7
|
+
export interface ChartSubtreeInsertionContext {
|
|
8
|
+
childKeys?: readonly string[];
|
|
9
|
+
containerKey?: string | null;
|
|
10
|
+
}
|
|
11
|
+
export declare function chartStructuredEntriesFromModel(model: AdvancedOoxmlChartModel): (import("./browser-advanced-ooxml-subtree-editor.ts").StructuredEditorField | import("./browser-advanced-ooxml-subtree-editor.ts").StructuredEditorSection)[];
|
|
12
|
+
export declare function chartModelFromStructuredEntries(entries: readonly StructuredEditorEntry[], fallback: AdvancedOoxmlChartModel): AdvancedOoxmlChartModel;
|
|
13
|
+
export declare function createChartSubtreeInsertions(context?: ChartSubtreeInsertionContext): readonly ChartSubtreeInsertion[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface StructuredEditorField {
|
|
2
|
+
type: 'field';
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
export interface StructuredEditorSection {
|
|
8
|
+
type: 'section';
|
|
9
|
+
key: string;
|
|
10
|
+
label: string;
|
|
11
|
+
children: StructuredEditorEntry[];
|
|
12
|
+
}
|
|
13
|
+
export type StructuredEditorEntry = StructuredEditorField | StructuredEditorSection;
|
|
14
|
+
export interface StructuredEditorController {
|
|
15
|
+
readonly dom: HTMLElement;
|
|
16
|
+
appendEntry(entry: StructuredEditorEntry): void;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
focus(): void;
|
|
19
|
+
readEntries(): StructuredEditorEntry[];
|
|
20
|
+
readSelection(): StructuredEditorSelectionSnapshot;
|
|
21
|
+
removeSelectedEntry(): boolean;
|
|
22
|
+
setEntries(entries: readonly StructuredEditorEntry[]): void;
|
|
23
|
+
}
|
|
24
|
+
export interface StructuredEditorChangeEvent {
|
|
25
|
+
entries: StructuredEditorEntry[];
|
|
26
|
+
}
|
|
27
|
+
export interface StructuredEditorSelectionSnapshot {
|
|
28
|
+
sectionKeys: string[];
|
|
29
|
+
containerKey: string | null;
|
|
30
|
+
childKeys: string[];
|
|
31
|
+
}
|
|
32
|
+
export interface CreateStructuredEditorControllerOptions {
|
|
33
|
+
onChange?: (event: StructuredEditorChangeEvent) => void;
|
|
34
|
+
onSelectionChange?: (selection: StructuredEditorSelectionSnapshot) => void;
|
|
35
|
+
}
|
|
36
|
+
export declare function structuredField(key: string, label: string, value?: string): StructuredEditorField;
|
|
37
|
+
export declare function structuredSection(key: string, label: string, children?: readonly StructuredEditorEntry[]): StructuredEditorSection;
|
|
38
|
+
export declare function createStructuredEditorController(host: HTMLElement, entries: readonly StructuredEditorEntry[], options?: CreateStructuredEditorControllerOptions): StructuredEditorController;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AdvancedOoxmlMathModel } from '@datalking/begonia-document-api/ooxml-contracts';
|
|
2
|
+
import { type StructuredEditorEntry } from './browser-advanced-ooxml-subtree-editor.ts';
|
|
3
|
+
export declare function mathStructuredEntriesFromModel(model: AdvancedOoxmlMathModel): StructuredEditorEntry[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AdvancedOoxmlMathNode } from '@datalking/begonia-document-api/ooxml-contracts';
|
|
2
|
+
import { type StructuredEditorEntry } from './browser-advanced-ooxml-subtree-editor.ts';
|
|
3
|
+
export interface MathSubtreeInsertion {
|
|
4
|
+
label: string;
|
|
5
|
+
createEntry(): StructuredEditorEntry;
|
|
6
|
+
}
|
|
7
|
+
export interface MathSubtreeInsertionContext {
|
|
8
|
+
containerKey?: string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function normalizeMathInsertionContainerKey(containerKey: string | null | undefined): string | null;
|
|
11
|
+
export declare function isMathSequenceContainer(containerKey: string | null | undefined): boolean;
|
|
12
|
+
export declare function textNode(value: string): AdvancedOoxmlMathNode;
|
|
13
|
+
export declare function emptyTextNode(): import("@datalking/begonia-ooxml-families").OoxmlMathNode;
|
|
14
|
+
export declare function textEntry(value?: string): import("./browser-advanced-ooxml-subtree-editor.ts").StructuredEditorField;
|
|
15
|
+
export declare function wrapSingleSlot(key: string, label: string): import("./browser-advanced-ooxml-subtree-editor.ts").StructuredEditorSection;
|
|
16
|
+
export declare function assertNever(value: never): never;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AdvancedOoxmlMathModel } from '@datalking/begonia-document-api/ooxml-contracts';
|
|
2
|
+
import type { StructuredEditorEntry } from './browser-advanced-ooxml-subtree-editor.ts';
|
|
3
|
+
import { createMathSubtreeInsertions } from './browser-advanced-ooxml-subtree-math-insertions.ts';
|
|
4
|
+
import { mathStructuredEntriesFromModel } from './browser-advanced-ooxml-subtree-math-serialize.ts';
|
|
5
|
+
export type { MathSubtreeInsertion, MathSubtreeInsertionContext, } from './browser-advanced-ooxml-subtree-math-shared.ts';
|
|
6
|
+
export { createMathSubtreeInsertions, mathStructuredEntriesFromModel };
|
|
7
|
+
export declare function mathModelFromStructuredEntries(entries: readonly StructuredEditorEntry[]): AdvancedOoxmlMathModel;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AdvancedOoxmlShapeModel } from '@datalking/begonia-document-api/ooxml-contracts';
|
|
2
|
+
import type { StructuredEditorEntry } from './browser-advanced-ooxml-subtree-editor.ts';
|
|
3
|
+
export declare function shapeModelFromStructuredEntries(entries: readonly StructuredEditorEntry[], fallback: AdvancedOoxmlShapeModel): AdvancedOoxmlShapeModel;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AdvancedOoxmlShapeModel } from '@datalking/begonia-document-api/ooxml-contracts';
|
|
2
|
+
import { type StructuredEditorEntry } from './browser-advanced-ooxml-subtree-editor.ts';
|
|
3
|
+
import type { ShapeChild, ShapeChildKind } from './browser-advanced-ooxml-subtree-shape-types.ts';
|
|
4
|
+
export declare function childSection(child: ShapeChild): StructuredEditorEntry;
|
|
5
|
+
export declare function geometrySection(geometry: AdvancedOoxmlShapeModel['geometry'] | ShapeChild['geometry']): import("./browser-advanced-ooxml-subtree-editor.ts").StructuredEditorSection;
|
|
6
|
+
export declare function transformSection(transform: AdvancedOoxmlShapeModel['transform'] | ShapeChild['transform']): import("./browser-advanced-ooxml-subtree-editor.ts").StructuredEditorSection;
|
|
7
|
+
export declare function groupTransformSection(groupTransform: AdvancedOoxmlShapeModel['groupTransform'] | ShapeChild['groupTransform']): import("./browser-advanced-ooxml-subtree-editor.ts").StructuredEditorSection;
|
|
8
|
+
export declare function fillSection(fill: AdvancedOoxmlShapeModel['fill']): import("./browser-advanced-ooxml-subtree-editor.ts").StructuredEditorSection;
|
|
9
|
+
export declare function strokeSection(stroke: AdvancedOoxmlShapeModel['stroke']): import("./browser-advanced-ooxml-subtree-editor.ts").StructuredEditorSection;
|
|
10
|
+
export declare function effectsSection(effects: AdvancedOoxmlShapeModel['effects'] | ShapeChild['effects']): import("./browser-advanced-ooxml-subtree-editor.ts").StructuredEditorSection;
|
|
11
|
+
export declare function anchorSection(anchor: AdvancedOoxmlShapeModel['anchor']): import("./browser-advanced-ooxml-subtree-editor.ts").StructuredEditorSection;
|
|
12
|
+
export declare function connectorSection(connector: AdvancedOoxmlShapeModel['connector'] | ShapeChild['connector']): import("./browser-advanced-ooxml-subtree-editor.ts").StructuredEditorSection;
|
|
13
|
+
export declare function pictureSection(picture: AdvancedOoxmlShapeModel['picture'] | ShapeChild['picture']): import("./browser-advanced-ooxml-subtree-editor.ts").StructuredEditorSection;
|
|
14
|
+
export declare function wordArtSection(wordArt: AdvancedOoxmlShapeModel['wordArt'] | ShapeChild['wordArt']): import("./browser-advanced-ooxml-subtree-editor.ts").StructuredEditorSection;
|
|
15
|
+
export declare function shapeStructuredEntriesFromModel(model: AdvancedOoxmlShapeModel): StructuredEditorEntry[];
|
|
16
|
+
export declare function childInsertion(kind: ShapeChildKind): import("./browser-advanced-ooxml-subtree-editor.ts").StructuredEditorSection;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AdvancedOoxmlShapeModel } from '@datalking/begonia-document-api/ooxml-contracts';
|
|
2
|
+
import type { StructuredEditorEntry } from './browser-advanced-ooxml-subtree-editor.ts';
|
|
3
|
+
export interface ShapeSubtreeInsertion {
|
|
4
|
+
label: string;
|
|
5
|
+
createEntry(): StructuredEditorEntry;
|
|
6
|
+
}
|
|
7
|
+
export interface ShapeSubtreeInsertionContext {
|
|
8
|
+
childKeys?: readonly string[];
|
|
9
|
+
containerKey?: string | null;
|
|
10
|
+
}
|
|
11
|
+
export type ShapeChild = AdvancedOoxmlShapeModel['children'][number];
|
|
12
|
+
export type ShapeChildKind = ShapeChild['kind'];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createShapeSubtreeInsertions } from './browser-advanced-ooxml-subtree-shape-insertions.ts';
|
|
2
|
+
export { shapeModelFromStructuredEntries } from './browser-advanced-ooxml-subtree-shape-parse.ts';
|
|
3
|
+
export { shapeStructuredEntriesFromModel } from './browser-advanced-ooxml-subtree-shape-sections.ts';
|
|
4
|
+
export type { ShapeSubtreeInsertion, ShapeSubtreeInsertionContext, } from './browser-advanced-ooxml-subtree-shape-types.ts';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { BrowserCommandController, BrowserCommandControllerSource, CreateBrowserCommandControllerOptions } from './browser-command-types.ts';
|
|
2
|
+
export declare function createBrowserCommandController(input: BrowserCommandControllerSource, options?: CreateBrowserCommandControllerOptions): BrowserCommandController;
|