@lyads/visual-editor 0.0.0-stage → 1.0.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/CHANGELOG.md +15 -0
- package/LICENSE +201 -0
- package/NOTICE +8 -0
- package/README.md +135 -2
- package/THIRD_PARTY_NOTICES.md +21259 -0
- package/dist/application/block-placement.d.ts +30 -0
- package/dist/application/block-session.d.ts +135 -0
- package/dist/application/content-service.d.ts +73 -0
- package/dist/application/document-commands.d.ts +51 -0
- package/dist/application/document-metadata.d.ts +30 -0
- package/dist/application/document-presentation.d.ts +35 -0
- package/dist/application/email-insertion.d.ts +76 -0
- package/dist/application/host.d.ts +36 -0
- package/dist/application/image-link.d.ts +36 -0
- package/dist/application/section-layout.d.ts +25 -0
- package/dist/application/session.d.ts +128 -0
- package/dist/assets/browser-worker-D56tNvnb.js +1014 -0
- package/dist/assets/browser-worker-D56tNvnb.js.map +1 -0
- package/dist/block-controller-RjYGvOcn.js +2468 -0
- package/dist/block-controller-RjYGvOcn.js.map +1 -0
- package/dist/block-factory-C5oHi4Fm.js +5397 -0
- package/dist/block-factory-C5oHi4Fm.js.map +1 -0
- package/dist/blocks/block-checks.d.ts +34 -0
- package/dist/blocks/block-inspector.d.ts +55 -0
- package/dist/blocks/block-output.d.ts +28 -0
- package/dist/blocks/block-type.d.ts +124 -0
- package/dist/blocks/content-guard.d.ts +52 -0
- package/dist/blocks/conversion.d.ts +22 -0
- package/dist/blocks/definitions.d.ts +43 -0
- package/dist/blocks/device-styles.d.ts +31 -0
- package/dist/blocks/email-generator.d.ts +22 -0
- package/dist/blocks/email-preview.d.ts +23 -0
- package/dist/blocks/email-renderer.d.ts +20 -0
- package/dist/blocks/fields.d.ts +34 -0
- package/dist/blocks/page-generator.d.ts +16 -0
- package/dist/blocks/render-context.d.ts +58 -0
- package/dist/blocks/styles.d.ts +54 -0
- package/dist/blocks/types/embed.d.ts +40 -0
- package/dist/blocks/types/layout.d.ts +41 -0
- package/dist/blocks/types/media.d.ts +53 -0
- package/dist/blocks/types/structure.d.ts +44 -0
- package/dist/blocks/types/text.d.ts +88 -0
- package/dist/blocks/values.d.ts +64 -0
- package/dist/browser.js +69 -0
- package/dist/browser.js.map +1 -0
- package/dist/canvas-runtime/action-bar.d.ts +19 -0
- package/dist/canvas-runtime/auto-scroll.d.ts +10 -0
- package/dist/canvas-runtime/block-drag.d.ts +29 -0
- package/dist/canvas-runtime/bridge.d.ts +6 -0
- package/dist/canvas-runtime/context.d.ts +53 -0
- package/dist/canvas-runtime/document-sync.d.ts +21 -0
- package/dist/canvas-runtime/drop-targets.d.ts +34 -0
- package/dist/canvas-runtime/embed-markers.d.ts +15 -0
- package/dist/canvas-runtime/file-guard.d.ts +12 -0
- package/dist/canvas-runtime/image-tools.d.ts +31 -0
- package/dist/canvas-runtime/keyboard.d.ts +18 -0
- package/dist/canvas-runtime/main.d.ts +1 -0
- package/dist/canvas-runtime/messages.d.ts +26 -0
- package/dist/canvas-runtime/morph.d.ts +21 -0
- package/dist/canvas-runtime/navigation.d.ts +29 -0
- package/dist/canvas-runtime/overlay.d.ts +15 -0
- package/dist/canvas-runtime/pointer-intents.d.ts +14 -0
- package/dist/canvas-runtime/selection-layer.d.ts +16 -0
- package/dist/canvas-runtime/shared/shortcuts.d.ts +27 -0
- package/dist/canvas-runtime/text-editor.d.ts +55 -0
- package/dist/canvas-runtime/text-session.d.ts +39 -0
- package/dist/canvas-runtime/variable-marks.d.ts +20 -0
- package/dist/canvas-runtime/viewport.d.ts +10 -0
- package/dist/codecs/css.d.ts +74 -0
- package/dist/codecs/html.d.ts +81 -0
- package/dist/compilation/browser-compiler.d.ts +14 -0
- package/dist/compilation/browser-worker.d.ts +1 -0
- package/dist/compilation/compile-lanes.d.ts +18 -0
- package/dist/compilation/generated-mjml.d.ts +25 -0
- package/dist/compilation/guard.d.ts +40 -0
- package/dist/compilation/node-compiler.d.ts +17 -0
- package/dist/compilation/node-worker.d.ts +1 -0
- package/dist/composition/block-factory.d.ts +84 -0
- package/dist/composition/browser.d.ts +48 -0
- package/dist/composition/factory.d.ts +48 -0
- package/dist/composition/server.d.ts +43 -0
- package/dist/core/any-document.d.ts +16 -0
- package/dist/core/block-document.d.ts +215 -0
- package/dist/core/budget.d.ts +32 -0
- package/dist/core/canvas-contract.d.ts +29 -0
- package/dist/core/canvas-layout.d.ts +66 -0
- package/dist/core/catalog.d.ts +35 -0
- package/dist/core/document-presentation.d.ts +21 -0
- package/dist/core/document.d.ts +99 -0
- package/dist/core/history.d.ts +26 -0
- package/dist/core/html-content-model.d.ts +32 -0
- package/dist/core/html-escape.d.ts +2 -0
- package/dist/core/rich-text-format.d.ts +14 -0
- package/dist/core/rich-text-markup.d.ts +28 -0
- package/dist/core/section-layout.d.ts +83 -0
- package/dist/generated-mjml-CtzE-f3v.js +1235 -0
- package/dist/generated-mjml-CtzE-f3v.js.map +1 -0
- package/dist/identity-CJHb6l9N.js +13759 -0
- package/dist/identity-CJHb6l9N.js.map +1 -0
- package/dist/renderers/canvas-bridge.d.ts +75 -0
- package/dist/renderers/canvas-icons.d.ts +1 -0
- package/dist/renderers/canvas-runtime.generated.d.ts +3 -0
- package/dist/renderers/element-source.d.ts +13 -0
- package/dist/renderers/email-renderer.d.ts +14 -0
- package/dist/renderers/marked-preview.d.ts +34 -0
- package/dist/renderers/markup-tree.d.ts +36 -0
- package/dist/renderers/page-renderer.d.ts +15 -0
- package/dist/renderers/preview-document.d.ts +39 -0
- package/dist/renderers/preview-frame.d.ts +102 -0
- package/dist/renderers/section-scaffold.d.ts +16 -0
- package/dist/renderers/selection-preview.d.ts +47 -0
- package/dist/rich-text/command-executor.d.ts +26 -0
- package/dist/rich-text/commands.d.ts +36 -0
- package/dist/rich-text/document-builder.d.ts +52 -0
- package/dist/rich-text/formatting.d.ts +17 -0
- package/dist/rich-text/projection-export.d.ts +17 -0
- package/dist/rich-text/projection-rules.d.ts +13 -0
- package/dist/rich-text/schema.d.ts +50 -0
- package/dist/rich-text/whitespace.d.ts +7 -0
- package/dist/security/bounded-parser.d.ts +18 -0
- package/dist/security/conditional-comment.d.ts +30 -0
- package/dist/security/content-inventory.d.ts +78 -0
- package/dist/security/email-sanitizer.d.ts +36 -0
- package/dist/security/identity.d.ts +6 -0
- package/dist/security/markup-rules.d.ts +31 -0
- package/dist/security/policy.d.ts +61 -0
- package/dist/security/preview-message.d.ts +317 -0
- package/dist/security/rich-text-projection.d.ts +19 -0
- package/dist/security/sha256.d.ts +6 -0
- package/dist/security/source-markup.d.ts +53 -0
- package/dist/security/text-presentation.d.ts +19 -0
- package/dist/security/url-policy.d.ts +23 -0
- package/dist/server-worker.js +17 -0
- package/dist/server-worker.js.map +1 -0
- package/dist/server.js +79 -0
- package/dist/server.js.map +1 -0
- package/dist/templates/blank-email.d.ts +6 -0
- package/dist/templates/blocks/catalog.d.ts +31 -0
- package/dist/templates/catalog.d.ts +31 -0
- package/dist/visual-editor.css +2 -0
- package/dist/vue/block-controller.d.ts +106 -0
- package/dist/vue/block-workbench.d.ts +70 -0
- package/dist/vue/canvas/canvas-theme.d.ts +8 -0
- package/dist/vue/canvas/file-drop.d.ts +38 -0
- package/dist/vue/canvas/frame-window.d.ts +26 -0
- package/dist/vue/canvas/inline-text.d.ts +98 -0
- package/dist/vue/canvas/palette-drag.d.ts +55 -0
- package/dist/vue/canvas/piece-requests.d.ts +48 -0
- package/dist/vue/canvas/strip-reserve.d.ts +14 -0
- package/dist/vue/canvas-content-label.d.ts +5 -0
- package/dist/vue/components/BlockVisualEditor.vue.d.ts +44 -0
- package/dist/vue/components/CanvasSurface.vue.d.ts +11 -0
- package/dist/vue/components/CodeEditor.vue.d.ts +22 -0
- package/dist/vue/components/EditorBlockMenus.vue.d.ts +3 -0
- package/dist/vue/components/EditorBlockPalette.vue.d.ts +3 -0
- package/dist/vue/components/EditorDiagnostics.vue.d.ts +3 -0
- package/dist/vue/components/EditorDialogs.vue.d.ts +16 -0
- package/dist/vue/components/EditorDocumentMetadata.vue.d.ts +3 -0
- package/dist/vue/components/EditorDocumentStyles.vue.d.ts +15 -0
- package/dist/vue/components/EditorImageSizeControls.vue.d.ts +23 -0
- package/dist/vue/components/EditorLayoutControls.vue.d.ts +16 -0
- package/dist/vue/components/EditorLeftPanel.vue.d.ts +3 -0
- package/dist/vue/components/EditorNoticeIndicator.vue.d.ts +3 -0
- package/dist/vue/components/EditorPreview.vue.d.ts +8 -0
- package/dist/vue/components/EditorProperties.vue.d.ts +14 -0
- package/dist/vue/components/EditorRichTextControls.vue.d.ts +25 -0
- package/dist/vue/components/EditorSelectionPath.vue.d.ts +11 -0
- package/dist/vue/components/EditorShortcutHelp.vue.d.ts +3 -0
- package/dist/vue/components/EditorSourcePane.vue.d.ts +3 -0
- package/dist/vue/components/EditorStructureTree.vue.d.ts +3 -0
- package/dist/vue/components/EditorTemplateGallery.vue.d.ts +15 -0
- package/dist/vue/components/EditorTopBar.vue.d.ts +33 -0
- package/dist/vue/components/RichTextEditor.vue.d.ts +47 -0
- package/dist/vue/components/SelectionPreviewFrame.vue.d.ts +212 -0
- package/dist/vue/components/VisualEditor.vue.d.ts +53 -0
- package/dist/vue/components/blocks/BlockCanvas.vue.d.ts +15 -0
- package/dist/vue/components/blocks/BlockFieldControl.vue.d.ts +39 -0
- package/dist/vue/components/blocks/BlockGlobalStyles.vue.d.ts +3 -0
- package/dist/vue/components/blocks/BlockPalette.vue.d.ts +6 -0
- package/dist/vue/components/blocks/BlockProperties.vue.d.ts +5 -0
- package/dist/vue/components/blocks/BlockReview.vue.d.ts +5 -0
- package/dist/vue/components/properties/EditorPropertyAdvanced.vue.d.ts +8 -0
- package/dist/vue/components/properties/EditorPropertyContent.vue.d.ts +13 -0
- package/dist/vue/components/properties/EditorPropertyStyle.vue.d.ts +8 -0
- package/dist/vue/components/ui/EditorAnchoredMenu.vue.d.ts +36 -0
- package/dist/vue/components/ui/EditorBadge.vue.d.ts +18 -0
- package/dist/vue/components/ui/EditorButton.vue.d.ts +28 -0
- package/dist/vue/components/ui/EditorCheckbox.vue.d.ts +13 -0
- package/dist/vue/components/ui/EditorColorInput.vue.d.ts +27 -0
- package/dist/vue/components/ui/EditorConfirmDialog.vue.d.ts +35 -0
- package/dist/vue/components/ui/EditorContextMenu.vue.d.ts +27 -0
- package/dist/vue/components/ui/EditorContextPopover.vue.d.ts +33 -0
- package/dist/vue/components/ui/EditorEmpty.vue.d.ts +8 -0
- package/dist/vue/components/ui/EditorField.vue.d.ts +24 -0
- package/dist/vue/components/ui/EditorGroup.vue.d.ts +16 -0
- package/dist/vue/components/ui/EditorIcon.vue.d.ts +6 -0
- package/dist/vue/components/ui/EditorIconButton.vue.d.ts +19 -0
- package/dist/vue/components/ui/EditorInput.vue.d.ts +41 -0
- package/dist/vue/components/ui/EditorKeys.vue.d.ts +6 -0
- package/dist/vue/components/ui/EditorMeasurement.vue.d.ts +34 -0
- package/dist/vue/components/ui/EditorMenu.vue.d.ts +56 -0
- package/dist/vue/components/ui/EditorNotice.vue.d.ts +30 -0
- package/dist/vue/components/ui/EditorPropertyGroup.vue.d.ts +22 -0
- package/dist/vue/components/ui/EditorRecoveryDialog.vue.d.ts +23 -0
- package/dist/vue/components/ui/EditorScrollArea.vue.d.ts +13 -0
- package/dist/vue/components/ui/EditorSelect.vue.d.ts +25 -0
- package/dist/vue/components/ui/EditorSeparator.vue.d.ts +8 -0
- package/dist/vue/components/ui/EditorSidePanel.vue.d.ts +26 -0
- package/dist/vue/components/ui/EditorSwitch.vue.d.ts +12 -0
- package/dist/vue/components/ui/EditorTabs.vue.d.ts +28 -0
- package/dist/vue/components/ui/EditorTemplatePreview.vue.d.ts +9 -0
- package/dist/vue/components/ui/EditorTextToolbar.vue.d.ts +16 -0
- package/dist/vue/components/ui/EditorTree.vue.d.ts +37 -0
- package/dist/vue/components/ui/EditorUiProvider.vue.d.ts +13 -0
- package/dist/vue/components/ui/EditorVariablePicker.vue.d.ts +20 -0
- package/dist/vue/components/ui/color-style-value.d.ts +9 -0
- package/dist/vue/components/ui/composition-dismissal.d.ts +1 -0
- package/dist/vue/components/ui/editor-dialog-focus.d.ts +6 -0
- package/dist/vue/components/ui/numeric-style-value.d.ts +15 -0
- package/dist/vue/controller.d.ts +115 -0
- package/dist/vue/font-options.d.ts +6 -0
- package/dist/vue/icon-data.d.ts +233 -0
- package/dist/vue/icons.d.ts +5 -0
- package/dist/vue/locale.d.ts +7 -0
- package/dist/vue/outline.d.ts +26 -0
- package/dist/vue/projection-key.d.ts +7 -0
- package/dist/vue/properties/selection-properties.d.ts +40 -0
- package/dist/vue/properties/style-fields.d.ts +30 -0
- package/dist/vue/public.d.ts +14 -0
- package/dist/vue/recovery.d.ts +30 -0
- package/dist/vue/responsive-panel.d.ts +1 -0
- package/dist/vue/rich-text-commands.d.ts +29 -0
- package/dist/vue/services/block-command-definitions.d.ts +14 -0
- package/dist/vue/services/block-commands.d.ts +114 -0
- package/dist/vue/services/block-menu.d.ts +12 -0
- package/dist/vue/services/block-palette.d.ts +21 -0
- package/dist/vue/services/block-presentation.d.ts +16 -0
- package/dist/vue/services/diagnostic-groups.d.ts +25 -0
- package/dist/vue/services/image-requests.d.ts +80 -0
- package/dist/vue/services/live-change.d.ts +26 -0
- package/dist/vue/services/property-commands.d.ts +28 -0
- package/dist/vue/services/saved-blocks.d.ts +32 -0
- package/dist/vue/services/selection-path.d.ts +20 -0
- package/dist/vue/services/shortcuts.d.ts +39 -0
- package/dist/vue/services/structure-tree.d.ts +38 -0
- package/dist/vue/services/template-application.d.ts +33 -0
- package/dist/vue/services/tree-drag.d.ts +28 -0
- package/dist/vue/session/blocks.d.ts +44 -0
- package/dist/vue/session/guard.d.ts +13 -0
- package/dist/vue/session/structure.d.ts +36 -0
- package/dist/vue/session/text.d.ts +23 -0
- package/dist/vue/session/transfer.d.ts +23 -0
- package/dist/vue/theme.d.ts +20 -0
- package/dist/vue/variables.d.ts +21 -0
- package/dist/vue/workbench.d.ts +100 -0
- package/dist/vue.js +71418 -0
- package/dist/vue.js.map +1 -0
- package/package.json +125 -4
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EditorLocale } from './locale';
|
|
2
|
+
import type { EditorSelectItem } from './components/ui/EditorSelect.vue';
|
|
3
|
+
/** Labels the shared font allowlist for all editor typography controls. */
|
|
4
|
+
export declare class EditorFontOptions {
|
|
5
|
+
items(locale: EditorLocale): readonly EditorSelectItem[];
|
|
6
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
export declare const EDITOR_ICON_DATA: {
|
|
2
|
+
'square-pen': {
|
|
3
|
+
body: string;
|
|
4
|
+
};
|
|
5
|
+
'grip-vertical': {
|
|
6
|
+
body: string;
|
|
7
|
+
};
|
|
8
|
+
'arrow-up': {
|
|
9
|
+
body: string;
|
|
10
|
+
};
|
|
11
|
+
'arrow-down': {
|
|
12
|
+
body: string;
|
|
13
|
+
};
|
|
14
|
+
copy: {
|
|
15
|
+
body: string;
|
|
16
|
+
};
|
|
17
|
+
'trash-2': {
|
|
18
|
+
body: string;
|
|
19
|
+
};
|
|
20
|
+
'corner-left-up': {
|
|
21
|
+
body: string;
|
|
22
|
+
};
|
|
23
|
+
image: {
|
|
24
|
+
body: string;
|
|
25
|
+
};
|
|
26
|
+
'code-xml': {
|
|
27
|
+
body: string;
|
|
28
|
+
};
|
|
29
|
+
plus: {
|
|
30
|
+
body: string;
|
|
31
|
+
};
|
|
32
|
+
'app-window': {
|
|
33
|
+
body: string;
|
|
34
|
+
};
|
|
35
|
+
bold: {
|
|
36
|
+
body: string;
|
|
37
|
+
};
|
|
38
|
+
italic: {
|
|
39
|
+
body: string;
|
|
40
|
+
};
|
|
41
|
+
underline: {
|
|
42
|
+
body: string;
|
|
43
|
+
};
|
|
44
|
+
strikethrough: {
|
|
45
|
+
body: string;
|
|
46
|
+
};
|
|
47
|
+
link: {
|
|
48
|
+
body: string;
|
|
49
|
+
};
|
|
50
|
+
check: {
|
|
51
|
+
body: string;
|
|
52
|
+
};
|
|
53
|
+
x: {
|
|
54
|
+
body: string;
|
|
55
|
+
};
|
|
56
|
+
type: {
|
|
57
|
+
body: string;
|
|
58
|
+
};
|
|
59
|
+
list: {
|
|
60
|
+
body: string;
|
|
61
|
+
};
|
|
62
|
+
'list-ordered': {
|
|
63
|
+
body: string;
|
|
64
|
+
};
|
|
65
|
+
'chevron-down': {
|
|
66
|
+
body: string;
|
|
67
|
+
};
|
|
68
|
+
'chevron-up': {
|
|
69
|
+
body: string;
|
|
70
|
+
};
|
|
71
|
+
'chevron-left': {
|
|
72
|
+
body: string;
|
|
73
|
+
};
|
|
74
|
+
'chevron-right': {
|
|
75
|
+
body: string;
|
|
76
|
+
};
|
|
77
|
+
'chevrons-up-down': {
|
|
78
|
+
body: string;
|
|
79
|
+
};
|
|
80
|
+
search: {
|
|
81
|
+
body: string;
|
|
82
|
+
};
|
|
83
|
+
'loader-circle': {
|
|
84
|
+
body: string;
|
|
85
|
+
};
|
|
86
|
+
minus: {
|
|
87
|
+
body: string;
|
|
88
|
+
};
|
|
89
|
+
ellipsis: {
|
|
90
|
+
body: string;
|
|
91
|
+
};
|
|
92
|
+
'remove-formatting': {
|
|
93
|
+
body: string;
|
|
94
|
+
};
|
|
95
|
+
'arrow-down-to-line': {
|
|
96
|
+
body: string;
|
|
97
|
+
};
|
|
98
|
+
'arrow-up-to-line': {
|
|
99
|
+
body: string;
|
|
100
|
+
};
|
|
101
|
+
box: {
|
|
102
|
+
body: string;
|
|
103
|
+
};
|
|
104
|
+
braces: {
|
|
105
|
+
body: string;
|
|
106
|
+
};
|
|
107
|
+
'circle-question-mark': {
|
|
108
|
+
body: string;
|
|
109
|
+
};
|
|
110
|
+
'clipboard-copy': {
|
|
111
|
+
body: string;
|
|
112
|
+
};
|
|
113
|
+
'clipboard-paste': {
|
|
114
|
+
body: string;
|
|
115
|
+
};
|
|
116
|
+
'columns-2': {
|
|
117
|
+
body: string;
|
|
118
|
+
};
|
|
119
|
+
download: {
|
|
120
|
+
body: string;
|
|
121
|
+
};
|
|
122
|
+
file: {
|
|
123
|
+
body: string;
|
|
124
|
+
};
|
|
125
|
+
'file-json': {
|
|
126
|
+
body: string;
|
|
127
|
+
};
|
|
128
|
+
heading: {
|
|
129
|
+
body: string;
|
|
130
|
+
};
|
|
131
|
+
keyboard: {
|
|
132
|
+
body: string;
|
|
133
|
+
};
|
|
134
|
+
'layout-grid': {
|
|
135
|
+
body: string;
|
|
136
|
+
};
|
|
137
|
+
'layout-template': {
|
|
138
|
+
body: string;
|
|
139
|
+
};
|
|
140
|
+
'list-tree': {
|
|
141
|
+
body: string;
|
|
142
|
+
};
|
|
143
|
+
monitor: {
|
|
144
|
+
body: string;
|
|
145
|
+
};
|
|
146
|
+
'mouse-pointer-click': {
|
|
147
|
+
body: string;
|
|
148
|
+
};
|
|
149
|
+
palette: {
|
|
150
|
+
body: string;
|
|
151
|
+
};
|
|
152
|
+
moon: {
|
|
153
|
+
body: string;
|
|
154
|
+
};
|
|
155
|
+
'bookmark-plus': {
|
|
156
|
+
body: string;
|
|
157
|
+
};
|
|
158
|
+
'list-checks': {
|
|
159
|
+
body: string;
|
|
160
|
+
};
|
|
161
|
+
'circle-alert': {
|
|
162
|
+
body: string;
|
|
163
|
+
};
|
|
164
|
+
'circle-check': {
|
|
165
|
+
body: string;
|
|
166
|
+
};
|
|
167
|
+
'panel-bottom': {
|
|
168
|
+
body: string;
|
|
169
|
+
};
|
|
170
|
+
'panel-left': {
|
|
171
|
+
body: string;
|
|
172
|
+
};
|
|
173
|
+
'panel-right': {
|
|
174
|
+
body: string;
|
|
175
|
+
};
|
|
176
|
+
pilcrow: {
|
|
177
|
+
body: string;
|
|
178
|
+
};
|
|
179
|
+
'rectangle-vertical': {
|
|
180
|
+
body: string;
|
|
181
|
+
};
|
|
182
|
+
'redo-2': {
|
|
183
|
+
body: string;
|
|
184
|
+
};
|
|
185
|
+
'rotate-ccw': {
|
|
186
|
+
body: string;
|
|
187
|
+
};
|
|
188
|
+
'rows-2': {
|
|
189
|
+
body: string;
|
|
190
|
+
};
|
|
191
|
+
save: {
|
|
192
|
+
body: string;
|
|
193
|
+
};
|
|
194
|
+
smartphone: {
|
|
195
|
+
body: string;
|
|
196
|
+
};
|
|
197
|
+
square: {
|
|
198
|
+
body: string;
|
|
199
|
+
};
|
|
200
|
+
'square-dashed': {
|
|
201
|
+
body: string;
|
|
202
|
+
};
|
|
203
|
+
'square-plus': {
|
|
204
|
+
body: string;
|
|
205
|
+
};
|
|
206
|
+
tablet: {
|
|
207
|
+
body: string;
|
|
208
|
+
};
|
|
209
|
+
'text-cursor-input': {
|
|
210
|
+
body: string;
|
|
211
|
+
};
|
|
212
|
+
'triangle-alert': {
|
|
213
|
+
body: string;
|
|
214
|
+
};
|
|
215
|
+
'undo-2': {
|
|
216
|
+
body: string;
|
|
217
|
+
};
|
|
218
|
+
'unfold-vertical': {
|
|
219
|
+
body: string;
|
|
220
|
+
};
|
|
221
|
+
unlink: {
|
|
222
|
+
body: string;
|
|
223
|
+
};
|
|
224
|
+
upload: {
|
|
225
|
+
body: string;
|
|
226
|
+
};
|
|
227
|
+
sun: {
|
|
228
|
+
body: string;
|
|
229
|
+
};
|
|
230
|
+
info: {
|
|
231
|
+
body: string;
|
|
232
|
+
};
|
|
233
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { DocumentNode, EditorDocumentData } from '../core/document';
|
|
2
|
+
import { BlockCatalog } from '../core/catalog';
|
|
3
|
+
import { CanvasLayout } from '../core/canvas-layout';
|
|
4
|
+
import { UrlPolicy } from '../security/url-policy';
|
|
5
|
+
export interface OutlineEntry {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly parentId: string | null;
|
|
8
|
+
readonly index: number;
|
|
9
|
+
readonly depth: number;
|
|
10
|
+
readonly tag: string;
|
|
11
|
+
readonly label: string;
|
|
12
|
+
readonly labelKey?: string;
|
|
13
|
+
readonly node: DocumentNode;
|
|
14
|
+
}
|
|
15
|
+
/** Projects editable text without bringing document styles/classes into the host DOM. */
|
|
16
|
+
export declare class DocumentOutline {
|
|
17
|
+
private readonly urls;
|
|
18
|
+
private readonly capabilities;
|
|
19
|
+
private readonly layout;
|
|
20
|
+
private readonly rules;
|
|
21
|
+
constructor(urls?: UrlPolicy, capabilities?: BlockCatalog, layout?: CanvasLayout);
|
|
22
|
+
entries(document: EditorDocumentData): readonly OutlineEntry[];
|
|
23
|
+
text(node: DocumentNode): string;
|
|
24
|
+
editableTextNode(node: DocumentNode): DocumentNode | undefined;
|
|
25
|
+
richText(node: DocumentNode): string | undefined;
|
|
26
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EditorViewState } from './controller';
|
|
2
|
+
type ProjectionState = Pick<EditorViewState, 'document' | 'selectedNodeId' | 'readOnly' | 'mode'>;
|
|
3
|
+
/** Invalidates derived document views only after a committed document change. */
|
|
4
|
+
export declare const documentProjectionKey: (state: Pick<ProjectionState, "document">) => string;
|
|
5
|
+
/** Pending text updates do not change the selected canonical node or its capabilities. */
|
|
6
|
+
export declare const selectionProjectionKey: (state: ProjectionState) => string;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { EditorWorkbench } from '../workbench';
|
|
2
|
+
import type { EditorSelectItem } from '../components/ui/EditorSelect.vue';
|
|
3
|
+
/**
|
|
4
|
+
* What the properties panel knows about the selected block: its values, what can be edited and
|
|
5
|
+
* how a change is applied. Every change goes through the controller; a run of changes to one
|
|
6
|
+
* field is one history step, and a refused value leaves the accepted one in place.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useSelectionProperties(workbench: EditorWorkbench): {
|
|
9
|
+
errors: import("vue").Ref<Record<string, string>, Record<string, string>>;
|
|
10
|
+
disabled: import("vue").ComputedRef<boolean>;
|
|
11
|
+
selected: import("vue").ComputedRef<import("../outline").OutlineEntry | undefined>;
|
|
12
|
+
region: import("vue").ComputedRef<import("../../core/canvas-layout").CanvasRegion | undefined>;
|
|
13
|
+
capabilities: import("vue").ComputedRef<import("../session/structure").PropertyCapabilities | undefined>;
|
|
14
|
+
imageSize: import("vue").ComputedRef<import("../../application/document-presentation").ImageSizeContext | undefined>;
|
|
15
|
+
layout: import("vue").ComputedRef<import("../../core/section-layout").SectionLayoutContext | undefined>;
|
|
16
|
+
imageLink: import("vue").ComputedRef<import("../../application/image-link").ImageLinkContext | undefined>;
|
|
17
|
+
groups: import("vue").ComputedRef<{
|
|
18
|
+
id: import("./style-fields").StyleGroup;
|
|
19
|
+
label: string;
|
|
20
|
+
openByDefault: boolean;
|
|
21
|
+
selections: {
|
|
22
|
+
name: string;
|
|
23
|
+
label: string;
|
|
24
|
+
items: EditorSelectItem[];
|
|
25
|
+
}[];
|
|
26
|
+
measures: import("./style-fields").MeasureField[];
|
|
27
|
+
colors: import("./style-fields").ColorField[];
|
|
28
|
+
}[]>;
|
|
29
|
+
hasAttribute: (name: string) => boolean;
|
|
30
|
+
attribute: (name: string) => string;
|
|
31
|
+
inherited: (name: string) => boolean;
|
|
32
|
+
style: (name: string) => string;
|
|
33
|
+
apply: (field: string, action: () => boolean) => boolean;
|
|
34
|
+
applyLive: (field: string, action: () => boolean) => boolean;
|
|
35
|
+
updateStyle: (name: string, value: string) => void;
|
|
36
|
+
updateAttribute: (name: string, value: string) => void;
|
|
37
|
+
choices: (values: readonly (readonly [string, string])[]) => EditorSelectItem[];
|
|
38
|
+
withCurrent: (value: string, items: readonly EditorSelectItem[]) => EditorSelectItem[];
|
|
39
|
+
};
|
|
40
|
+
export type SelectionProperties = ReturnType<typeof useSelectionProperties>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** One row of the Style tab: which control edits which CSS property, and under which heading. */
|
|
2
|
+
export type StyleGroup = 'typography' | 'appearance' | 'layout' | 'borders';
|
|
3
|
+
export interface ChoiceField {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
/** Pairs of CSS value and catalog key. */
|
|
7
|
+
readonly options: readonly (readonly [string, string])[];
|
|
8
|
+
}
|
|
9
|
+
export interface MeasureField {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly label: string;
|
|
12
|
+
readonly minimum: number;
|
|
13
|
+
readonly units: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
export interface ColorField {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly label: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const STYLE_GROUPS: readonly {
|
|
20
|
+
readonly id: StyleGroup;
|
|
21
|
+
readonly label: string;
|
|
22
|
+
readonly open: boolean;
|
|
23
|
+
}[];
|
|
24
|
+
export declare const CHOICE_FIELDS: readonly ChoiceField[];
|
|
25
|
+
export declare const MEASURE_FIELDS: readonly MeasureField[];
|
|
26
|
+
export declare const COLOR_FIELDS: readonly ColorField[];
|
|
27
|
+
/** The heading a CSS property belongs to in the Style tab. */
|
|
28
|
+
export declare function styleGroup(name: string): StyleGroup;
|
|
29
|
+
/** Layout of a grid only exists in pages; an e-mail keeps its table structure. */
|
|
30
|
+
export declare const PAGE_ONLY_STYLES: readonly string[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import './styles.css';
|
|
2
|
+
export { default as VisualEditor } from './components/VisualEditor.vue';
|
|
3
|
+
export { EditorController } from './controller';
|
|
4
|
+
export { default as BlockVisualEditor } from './components/BlockVisualEditor.vue';
|
|
5
|
+
export { BlockEditorController } from './block-controller';
|
|
6
|
+
export type { BlockDestination } from './block-controller';
|
|
7
|
+
export { EditorLocale } from './locale';
|
|
8
|
+
export { EditorTheme } from './theme';
|
|
9
|
+
export type { EditorMessages } from './locale';
|
|
10
|
+
export type { EditorThemeOptions } from './theme';
|
|
11
|
+
export type { EditorVariable } from './variables';
|
|
12
|
+
export type { EditorImageChoice, EditorImagePicker, EditorImageRequest, } from './services/image-requests';
|
|
13
|
+
export type { EditorSavedBlock, EditorSavedBlockInput, EditorSavedBlocks, } from './services/saved-blocks';
|
|
14
|
+
export { SAVED_BLOCK_LIMITS } from './services/saved-blocks';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import type { EditorDocumentData, SourceInput } from '../core/document';
|
|
3
|
+
import type { PendingRichTextDraft } from '../application/session';
|
|
4
|
+
declare const recoverySchema: v.StrictObjectSchema<{
|
|
5
|
+
readonly format: v.LiteralSchema<"visual-editor-recovery-v1", undefined>;
|
|
6
|
+
readonly document: v.UnknownSchema;
|
|
7
|
+
readonly pendingSource: v.StrictObjectSchema<{
|
|
8
|
+
readonly html: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000000, undefined>]>;
|
|
9
|
+
readonly css: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 500000, undefined>]>;
|
|
10
|
+
}, undefined>;
|
|
11
|
+
readonly pendingRichText: v.ExactOptionalSchema<v.StrictObjectSchema<{
|
|
12
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
13
|
+
readonly html: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000000, undefined>]>;
|
|
14
|
+
readonly originalHtml: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000000, undefined>]>;
|
|
15
|
+
readonly changed: v.BooleanSchema<undefined>;
|
|
16
|
+
readonly valid: v.BooleanSchema<undefined>;
|
|
17
|
+
readonly blocked: v.ExactOptionalSchema<v.LiteralSchema<"oversized", undefined>, undefined>;
|
|
18
|
+
readonly documentId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
19
|
+
readonly baseRevision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
|
|
20
|
+
readonly editGeneration: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
|
|
21
|
+
}, undefined>, undefined>;
|
|
22
|
+
}, undefined>;
|
|
23
|
+
/** Pending source and canvas text are inert JSON. Reopening validates before projection. */
|
|
24
|
+
export declare class DocumentRecovery {
|
|
25
|
+
encode(document: EditorDocumentData, pendingSource: SourceInput, pendingRichText?: PendingRichTextDraft): string;
|
|
26
|
+
decode(value: unknown): (Omit<v.InferOutput<typeof recoverySchema>, 'document'> & {
|
|
27
|
+
readonly document: EditorDocumentData;
|
|
28
|
+
}) | undefined;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const EDITOR_PANEL_MEDIA_QUERY = "(max-width: 900px)";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RichTextCommandName, RichTextCommandState, RichTextCommands } from '../rich-text/commands';
|
|
2
|
+
import type { UrlPolicy } from '../security/url-policy';
|
|
3
|
+
/**
|
|
4
|
+
* Validates the value of a formatting command in the host, before any editor receives it: the
|
|
5
|
+
* same color, font, measure and link rules for the panel editor and for the preview frame.
|
|
6
|
+
*/
|
|
7
|
+
export declare class RichTextCommandValues {
|
|
8
|
+
private readonly urls;
|
|
9
|
+
private readonly colors;
|
|
10
|
+
private readonly fontSize;
|
|
11
|
+
private readonly lineHeight;
|
|
12
|
+
constructor(urls: () => UrlPolicy);
|
|
13
|
+
/** Returns undefined for a refused value; `null` asks to clear the style. */
|
|
14
|
+
resolve(command: RichTextCommandName, input: string | null | undefined): {
|
|
15
|
+
readonly value: string | null;
|
|
16
|
+
} | undefined;
|
|
17
|
+
}
|
|
18
|
+
/** Formatting commands for the editor inside the preview frame, sent as typed messages. */
|
|
19
|
+
export declare class RemoteRichTextCommands implements RichTextCommands {
|
|
20
|
+
#private;
|
|
21
|
+
private readonly values;
|
|
22
|
+
private readonly post;
|
|
23
|
+
private readonly colors;
|
|
24
|
+
constructor(values: RichTextCommandValues, post: (command: RichTextCommandName, value: string | null) => void);
|
|
25
|
+
get state(): RichTextCommandState;
|
|
26
|
+
/** Telemetry from the frame, already validated by the message policy. */
|
|
27
|
+
update(state: RichTextCommandState | undefined): void;
|
|
28
|
+
run(command: RichTextCommandName, value?: string | null): boolean;
|
|
29
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const BLOCK_COMMANDS: readonly ["editText", "selectParent", "insertBefore", "insertAfter", "insertInside", "duplicate", "moveUp", "moveDown", "editHtml", "replaceImage", "copy", "paste", "remove"];
|
|
2
|
+
export type BlockCommandName = (typeof BLOCK_COMMANDS)[number];
|
|
3
|
+
export interface BlockCommandItem {
|
|
4
|
+
readonly name: BlockCommandName;
|
|
5
|
+
readonly labelKey: string;
|
|
6
|
+
readonly icon: string;
|
|
7
|
+
/** Position of a separator: items of one group stay together. */
|
|
8
|
+
readonly group: number;
|
|
9
|
+
readonly enabled: boolean;
|
|
10
|
+
readonly danger?: boolean;
|
|
11
|
+
readonly keys?: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
/** The commands of a block in menu order, with their label, icon, group and keys. */
|
|
14
|
+
export declare const BLOCK_COMMAND_DEFINITIONS: readonly Omit<BlockCommandItem, 'enabled'>[];
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { ShallowRef } from 'vue';
|
|
2
|
+
import type { CanvasPlacement } from '../../core/canvas-layout';
|
|
3
|
+
import type { SourceInput } from '../../core/document';
|
|
4
|
+
import type { EditorController } from '../controller';
|
|
5
|
+
import type { BlockCommandItem, BlockCommandName } from './block-command-definitions';
|
|
6
|
+
export interface FrameRect {
|
|
7
|
+
readonly x: number;
|
|
8
|
+
readonly y: number;
|
|
9
|
+
readonly width: number;
|
|
10
|
+
readonly height: number;
|
|
11
|
+
}
|
|
12
|
+
export interface InsertionRequest {
|
|
13
|
+
readonly targetId: string;
|
|
14
|
+
readonly placement: CanvasPlacement;
|
|
15
|
+
/** Where the request was made, in page coordinates, to open the picker next to it. */
|
|
16
|
+
readonly anchor?: FrameRect;
|
|
17
|
+
/** Asked with the keyboard: the keyboard returns to the piece when the picker closes. */
|
|
18
|
+
readonly keyboard?: boolean;
|
|
19
|
+
/** Gives the keyboard back to where the request was made. */
|
|
20
|
+
readonly returnFocus?: () => void;
|
|
21
|
+
}
|
|
22
|
+
/** The menu of one block, open at a point of the page. */
|
|
23
|
+
export interface BlockMenuRequest {
|
|
24
|
+
readonly targetId: string;
|
|
25
|
+
readonly anchor: FrameRect;
|
|
26
|
+
/** Asked with the keyboard: its first item takes the keyboard. */
|
|
27
|
+
readonly keyboard?: boolean;
|
|
28
|
+
/** Gives the keyboard back to where the menu was asked for, when it is dismissed. */
|
|
29
|
+
readonly returnFocus?: () => void;
|
|
30
|
+
}
|
|
31
|
+
export interface SourceEdit {
|
|
32
|
+
readonly id: string;
|
|
33
|
+
readonly html: string;
|
|
34
|
+
}
|
|
35
|
+
/** What the commands need from the shell; none of it is document logic. */
|
|
36
|
+
export interface BlockCommandPorts {
|
|
37
|
+
controller(): EditorController;
|
|
38
|
+
/** Concludes a text being edited in the piece; false when it could not be concluded. */
|
|
39
|
+
flush(): Promise<boolean>;
|
|
40
|
+
editText(id: string): void;
|
|
41
|
+
replaceImage(id: string): void;
|
|
42
|
+
elementSource(id: string): string | undefined;
|
|
43
|
+
replaceElementSource(id: string, html: string): SourceInput | undefined;
|
|
44
|
+
notify(outcome: 'applied' | 'copied' | 'invalid'): void;
|
|
45
|
+
}
|
|
46
|
+
interface Removal {
|
|
47
|
+
readonly owner: EditorController;
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly documentId: string;
|
|
50
|
+
readonly revision: number;
|
|
51
|
+
/** Gives the keyboard back to the piece once the block is gone, on the block next to it. */
|
|
52
|
+
readonly returnFocus?: () => void;
|
|
53
|
+
}
|
|
54
|
+
/** Where a command was asked from, when the keyboard has to come back there afterwards. */
|
|
55
|
+
export interface CommandOrigin {
|
|
56
|
+
readonly keyboard?: boolean;
|
|
57
|
+
readonly returnFocus?: () => void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The single door for acting on a block. The action bar of the piece, the context menus, the
|
|
61
|
+
* tree, the keyboard and the panel all ask here, so a command means the same thing everywhere.
|
|
62
|
+
* Requests which need an answer from the person (confirm, pick a block, edit the HTML) are
|
|
63
|
+
* exposed as state for the shell to show; the document only changes through the controller.
|
|
64
|
+
*/
|
|
65
|
+
export declare class BlockCommandService {
|
|
66
|
+
#private;
|
|
67
|
+
private readonly ports;
|
|
68
|
+
private readonly clock;
|
|
69
|
+
readonly removal: ShallowRef<Removal | undefined>;
|
|
70
|
+
readonly insertion: ShallowRef<InsertionRequest | undefined>;
|
|
71
|
+
readonly sourceEdit: ShallowRef<SourceEdit | undefined>;
|
|
72
|
+
/** The menu of one block, asked for with the secondary button in the piece. */
|
|
73
|
+
readonly menu: ShallowRef<BlockMenuRequest | undefined>;
|
|
74
|
+
/** A copied block; markup already produced by this document, validated again when pasted. */
|
|
75
|
+
readonly clipboard: ShallowRef<string | undefined>;
|
|
76
|
+
/** Why the last HTML written for an element was refused, as catalog keys. */
|
|
77
|
+
readonly sourceProblems: ShallowRef<readonly string[]>;
|
|
78
|
+
constructor(ports: BlockCommandPorts, clock?: () => number);
|
|
79
|
+
/** A menu or the picker was dismissed: what the piece asks next, for a second, is not shown. */
|
|
80
|
+
dismissed(): void;
|
|
81
|
+
private state;
|
|
82
|
+
/** The commands offered for one block, in menu order, with what is possible right now. */
|
|
83
|
+
items(id: string | undefined): readonly BlockCommandItem[];
|
|
84
|
+
/** Runs a command on a block, by default the selected one. */
|
|
85
|
+
run(name: BlockCommandName, target?: string, anchor?: FrameRect, origin?: CommandOrigin): Promise<boolean>;
|
|
86
|
+
private apply;
|
|
87
|
+
/** Moves a block next to or into another one: the drop of the piece and of the tree. */
|
|
88
|
+
move(sourceId: string, targetId: string, placement: CanvasPlacement): Promise<boolean>;
|
|
89
|
+
/** A resize made with the handles of the image in the piece. */
|
|
90
|
+
resizeImage(id: string, width: number, height: number): Promise<boolean>;
|
|
91
|
+
/** `fromPiece`: asked by the frame, which is not shown right after a dismissal. */
|
|
92
|
+
openMenu(targetId: string, anchor: FrameRect | undefined, options?: Pick<BlockMenuRequest, 'keyboard' | 'returnFocus'> & {
|
|
93
|
+
fromPiece?: boolean;
|
|
94
|
+
}): void;
|
|
95
|
+
closeMenu(): void;
|
|
96
|
+
requestInsertion(request: InsertionRequest, fromPiece?: boolean): void;
|
|
97
|
+
cancelInsertion(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Adds a block of the palette. With a destination it goes exactly there; without one it goes
|
|
100
|
+
* after the selected block, inside it when it is a container, or to the end of the content.
|
|
101
|
+
*/
|
|
102
|
+
insert(type: string, destination?: Pick<InsertionRequest, 'targetId' | 'placement'> | 'end'): Promise<boolean>;
|
|
103
|
+
/** Applies the HTML a person wrote for one element: only that element changes, in one step. */
|
|
104
|
+
applySource(html: string): Promise<boolean>;
|
|
105
|
+
cancelSource(): void;
|
|
106
|
+
cancelRemoval(): void;
|
|
107
|
+
/** Removes the block the person confirmed, unless the document changed meanwhile. */
|
|
108
|
+
confirmRemoval(): Promise<boolean>;
|
|
109
|
+
/** The block before the one being removed, or the one after it, or the one which held it. */
|
|
110
|
+
private neighbour;
|
|
111
|
+
/** Another revision, document or owner: pending questions no longer describe what is on screen. */
|
|
112
|
+
invalidate(): void;
|
|
113
|
+
}
|
|
114
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BlockCommandItem } from './block-command-definitions';
|
|
2
|
+
export interface BlockMenuEntry {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly icon: string;
|
|
6
|
+
readonly group: number;
|
|
7
|
+
readonly disabled: boolean;
|
|
8
|
+
readonly danger?: boolean;
|
|
9
|
+
readonly kbds?: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
/** The commands of a block as menu entries: one shape for the piece and for the tree. */
|
|
12
|
+
export declare function blockMenuItems(items: readonly BlockCommandItem[], text: (key: string) => string): BlockMenuEntry[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BlockCategory } from './block-presentation';
|
|
2
|
+
export interface PaletteBlock {
|
|
3
|
+
readonly type: string;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly icon: string;
|
|
6
|
+
}
|
|
7
|
+
export interface PaletteGroup {
|
|
8
|
+
readonly category: BlockCategory;
|
|
9
|
+
readonly label: string;
|
|
10
|
+
readonly blocks: readonly PaletteBlock[];
|
|
11
|
+
}
|
|
12
|
+
/** Folds accents and case, so "titulo" finds "Título". */
|
|
13
|
+
export declare function searchKey(value: string): string;
|
|
14
|
+
/** The blocks a person can add, grouped by purpose and filtered by what they typed. */
|
|
15
|
+
export declare class BlockPalette {
|
|
16
|
+
private readonly text;
|
|
17
|
+
private readonly presentation;
|
|
18
|
+
constructor(text: (key: string) => string);
|
|
19
|
+
blocks(types: readonly string[]): readonly PaletteBlock[];
|
|
20
|
+
groups(types: readonly string[], query?: string): readonly PaletteGroup[];
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CanvasRegion } from '../../core/canvas-layout';
|
|
2
|
+
export type BlockCategory = 'structure' | 'text' | 'media' | 'actions' | 'other';
|
|
3
|
+
export declare const BLOCK_CATEGORIES: readonly BlockCategory[];
|
|
4
|
+
/**
|
|
5
|
+
* How a block is presented to a person: its category in the palette, its icon and the friendly
|
|
6
|
+
* name of what is selected. One table for the palette, the tree, the path and the piece.
|
|
7
|
+
*/
|
|
8
|
+
export declare class BlockPresentation {
|
|
9
|
+
private readonly labels;
|
|
10
|
+
category(type: string): BlockCategory;
|
|
11
|
+
icon(type: string): string;
|
|
12
|
+
/** Catalog key of the friendly name of a selectable region. */
|
|
13
|
+
regionLabelKey(region: CanvasRegion): string;
|
|
14
|
+
regionIcon(region: CanvasRegion): string;
|
|
15
|
+
static icons(): readonly string[];
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface DiagnosticLike {
|
|
2
|
+
readonly code: string;
|
|
3
|
+
readonly messageKey: string;
|
|
4
|
+
readonly severity?: string;
|
|
5
|
+
readonly count?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface DiagnosticGroup {
|
|
8
|
+
readonly key: string;
|
|
9
|
+
readonly code: string;
|
|
10
|
+
readonly messageKey: string;
|
|
11
|
+
readonly message: string;
|
|
12
|
+
readonly severity: 'error' | 'warning' | 'info';
|
|
13
|
+
readonly count: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Shows each notice once. Diagnostics which say the same thing are one line with a count, whether
|
|
17
|
+
* the count came with them or they simply repeat.
|
|
18
|
+
*/
|
|
19
|
+
export declare class DiagnosticGroups {
|
|
20
|
+
private readonly text;
|
|
21
|
+
constructor(text: (key: string) => string);
|
|
22
|
+
group(diagnostics: readonly DiagnosticLike[]): readonly DiagnosticGroup[];
|
|
23
|
+
/** A stable name for a set of notices, to remember that the person dismissed it. */
|
|
24
|
+
signature(groups: readonly DiagnosticGroup[]): string;
|
|
25
|
+
}
|