@formicoidea/labre-core 0.50.0 → 0.52.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/_pkgs/affine-block-attachment/asset-picker.d.ts +24 -0
- package/dist/_pkgs/affine-block-attachment/asset-picker.js +87 -0
- package/dist/_pkgs/affine-block-attachment/configs/slash-menu.js +3 -20
- package/dist/_pkgs/affine-block-attachment/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-attachment/index.js +1 -0
- package/dist/_pkgs/affine-block-attachment/utils.d.ts +9 -1
- package/dist/_pkgs/affine-block-attachment/utils.js +9 -0
- package/dist/_pkgs/affine-block-bookmark/adapters/markdown/markdown.js +14 -1
- package/dist/_pkgs/affine-block-bookmark/adapters/notion-html.js +5 -1
- package/dist/_pkgs/affine-block-database/adapters/markdown.js +5 -3
- package/dist/_pkgs/affine-block-embed/common/adapters/html.js +5 -3
- package/dist/_pkgs/affine-block-embed/common/adapters/markdown.js +11 -0
- package/dist/_pkgs/affine-block-frame/frame-template.d.ts +58 -0
- package/dist/_pkgs/affine-block-frame/frame-template.js +207 -0
- package/dist/_pkgs/affine-block-frame/frame-toolbar.js +19 -3
- package/dist/_pkgs/affine-block-frame/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-frame/index.js +1 -0
- package/dist/_pkgs/affine-block-frame/translations.d.ts +7 -0
- package/dist/_pkgs/affine-block-frame/translations.js +16 -1
- package/dist/_pkgs/affine-block-frame/view.js +6 -0
- package/dist/_pkgs/affine-block-image/asset-picker.d.ts +63 -0
- package/dist/_pkgs/affine-block-image/asset-picker.js +183 -0
- package/dist/_pkgs/affine-block-image/commands/insert-images.d.ts +5 -0
- package/dist/_pkgs/affine-block-image/commands/insert-images.js +8 -8
- package/dist/_pkgs/affine-block-image/components/page-image-block.d.ts +11 -0
- package/dist/_pkgs/affine-block-image/components/page-image-block.js +81 -12
- package/dist/_pkgs/affine-block-image/configs/replace-action.d.ts +9 -0
- package/dist/_pkgs/affine-block-image/configs/replace-action.js +27 -0
- package/dist/_pkgs/affine-block-image/configs/toolbar.js +6 -0
- package/dist/_pkgs/affine-block-image/crop/crop-controller.d.ts +46 -0
- package/dist/_pkgs/affine-block-image/crop/crop-controller.js +104 -0
- package/dist/_pkgs/affine-block-image/crop/crop-math.d.ts +70 -0
- package/dist/_pkgs/affine-block-image/crop/crop-math.js +141 -0
- package/dist/_pkgs/affine-block-image/crop/crop-overlay.d.ts +57 -0
- package/dist/_pkgs/affine-block-image/crop/crop-overlay.js +343 -0
- package/dist/_pkgs/affine-block-image/crop/crop-toolbar.d.ts +12 -0
- package/dist/_pkgs/affine-block-image/crop/crop-toolbar.js +78 -0
- package/dist/_pkgs/affine-block-image/crop/write-crop.d.ts +16 -0
- package/dist/_pkgs/affine-block-image/crop/write-crop.js +57 -0
- package/dist/_pkgs/affine-block-image/edgeless-clipboard-config.js +4 -1
- package/dist/_pkgs/affine-block-image/effects.js +2 -0
- package/dist/_pkgs/affine-block-image/image-block.d.ts +2 -0
- package/dist/_pkgs/affine-block-image/image-block.js +2 -0
- package/dist/_pkgs/affine-block-image/image-edgeless-block.d.ts +2 -0
- package/dist/_pkgs/affine-block-image/image-edgeless-block.js +36 -8
- package/dist/_pkgs/affine-block-image/image-resize-manager.js +15 -0
- package/dist/_pkgs/affine-block-image/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-image/index.js +1 -0
- package/dist/_pkgs/affine-block-image/translations.d.ts +15 -0
- package/dist/_pkgs/affine-block-image/translations.js +43 -0
- package/dist/_pkgs/affine-block-image/utils.d.ts +13 -0
- package/dist/_pkgs/affine-block-image/utils.js +10 -1
- package/dist/_pkgs/affine-block-root/clipboard/page-clipboard.js +5 -0
- package/dist/_pkgs/affine-block-root/commands/page-export-commands.d.ts +2 -0
- package/dist/_pkgs/affine-block-root/commands/page-export-commands.js +71 -0
- package/dist/_pkgs/affine-block-root/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-root/index.js +1 -0
- package/dist/_pkgs/affine-block-root/view.js +8 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/capability.d.ts +30 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/capability.js +44 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/colors.d.ts +26 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/colors.js +82 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/command.d.ts +18 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/command.js +91 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/index.d.ts +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/index.js +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/writer.d.ts +50 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/writer.js +732 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/draw-image-block.d.ts +12 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/draw-image-block.js +15 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +7 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.d.ts +7 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.js +60 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.d.ts +2 -2
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.js +2 -2
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/marker-version.d.ts +6 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/marker-version.js +8 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.d.ts +28 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +66 -6
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.d.ts +2 -7
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.js +2 -6
- package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +2 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.js +2 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-export.d.ts +84 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-export.js +150 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +24 -2
- package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +23 -2
- package/dist/_pkgs/affine-block-surface/extensions/interchange.js +4 -1
- package/dist/_pkgs/affine-block-surface/extensions/legend-role.d.ts +18 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend-role.js +20 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend.d.ts +2 -19
- package/dist/_pkgs/affine-block-surface/extensions/legend.js +2 -18
- package/dist/_pkgs/affine-block-surface/extensions/svg-sanitize.d.ts +67 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sanitize.js +235 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.js +9 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +17 -13
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +52 -80
- package/dist/_pkgs/affine-block-surface/extensions/xml-element.d.ts +98 -0
- package/dist/_pkgs/affine-block-surface/extensions/xml-element.js +261 -0
- package/dist/_pkgs/affine-block-surface/extensions/xml-reader.d.ts +238 -0
- package/dist/_pkgs/affine-block-surface/extensions/xml-reader.js +570 -0
- package/dist/_pkgs/affine-block-surface/framework-background/def.js +1 -1
- package/dist/_pkgs/affine-block-surface/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/index.js +1 -0
- package/dist/_pkgs/affine-block-surface/interchange-headless.d.ts +29 -0
- package/dist/_pkgs/affine-block-surface/interchange-headless.js +32 -0
- package/dist/_pkgs/affine-block-surface/view.js +22 -2
- package/dist/_pkgs/affine-block-table/adapters/utils.js +24 -1
- package/dist/_pkgs/affine-gfx-note/toolbar/note-menu.js +5 -8
- package/dist/_pkgs/affine-gfx-template/contribute.d.ts +14 -4
- package/dist/_pkgs/affine-gfx-template/contribute.js +47 -6
- package/dist/_pkgs/affine-gfx-template/toolbar/builtin-templates.d.ts +7 -2
- package/dist/_pkgs/affine-gfx-template/toolbar/builtin-templates.js +14 -40
- package/dist/_pkgs/affine-gfx-template/toolbar/resolve-name.d.ts +1 -1
- package/dist/_pkgs/affine-gfx-template/toolbar/resolve-name.js +1 -1
- package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.d.ts +4 -4
- package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.js +9 -9
- package/dist/_pkgs/affine-gfx-template/toolbar/template-type.d.ts +2 -4
- package/dist/_pkgs/affine-gfx-template/translations.d.ts +5 -0
- package/dist/_pkgs/affine-gfx-template/translations.js +9 -0
- package/dist/_pkgs/affine-inline-footnote/adapters/markdown/inline-delta.js +6 -0
- package/dist/_pkgs/affine-inline-footnote/adapters/markdown/markdown-inline.js +7 -0
- package/dist/_pkgs/affine-inline-link/adapters/html/html-inline.js +4 -1
- package/dist/_pkgs/affine-inline-link/adapters/html/inline-delta.js +3 -1
- package/dist/_pkgs/affine-inline-link/adapters/markdown/inline-delta.js +4 -1
- package/dist/_pkgs/affine-inline-link/adapters/notion-html/html-inline.js +2 -1
- package/dist/_pkgs/affine-inline-link/link-node/affine-link.d.ts +7 -0
- package/dist/_pkgs/affine-inline-link/link-node/affine-link.js +37 -0
- package/dist/_pkgs/affine-inline-link/link-node/index.d.ts +1 -0
- package/dist/_pkgs/affine-inline-link/link-node/index.js +1 -0
- package/dist/_pkgs/affine-inline-link/link-node/propose-views.d.ts +22 -0
- package/dist/_pkgs/affine-inline-link/link-node/propose-views.js +59 -0
- package/dist/_pkgs/affine-model/blocks/image/image-crop.d.ts +48 -0
- package/dist/_pkgs/affine-model/blocks/image/image-crop.js +78 -0
- package/dist/_pkgs/affine-model/blocks/image/image-model.d.ts +6 -0
- package/dist/_pkgs/affine-model/blocks/image/image-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/image/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/blocks/image/index.js +1 -0
- package/dist/_pkgs/affine-model/consts/shape.d.ts +2 -0
- package/dist/_pkgs/affine-model/consts/shape.js +5 -0
- package/dist/_pkgs/affine-model/elements/bpmn/consts.d.ts +31 -0
- package/dist/_pkgs/affine-model/elements/bpmn/consts.js +31 -0
- package/dist/_pkgs/affine-model/elements/bpmn/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/bpmn/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/bpmn/pool.d.ts +0 -25
- package/dist/_pkgs/affine-model/elements/bpmn/pool.js +1 -25
- package/dist/_pkgs/affine-model/elements/shape/shape.d.ts +0 -2
- package/dist/_pkgs/affine-model/elements/shape/shape.js +1 -2
- package/dist/_pkgs/affine-model/elements/uml/consts.d.ts +133 -0
- package/dist/_pkgs/affine-model/elements/uml/consts.js +107 -0
- package/dist/_pkgs/affine-model/elements/uml/diagram.d.ts +1 -79
- package/dist/_pkgs/affine-model/elements/uml/diagram.js +1 -53
- package/dist/_pkgs/affine-model/elements/uml/fragment.d.ts +0 -15
- package/dist/_pkgs/affine-model/elements/uml/fragment.js +1 -15
- package/dist/_pkgs/affine-model/elements/uml/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/uml/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/uml/partition.d.ts +0 -20
- package/dist/_pkgs/affine-model/elements/uml/partition.js +1 -20
- package/dist/_pkgs/affine-model/elements/uml/region.d.ts +0 -11
- package/dist/_pkgs/affine-model/elements/uml/region.js +1 -11
- package/dist/_pkgs/affine-model/headless.d.ts +19 -0
- package/dist/_pkgs/affine-model/headless.js +19 -0
- package/dist/_pkgs/affine-shared/headless.d.ts +10 -0
- package/dist/_pkgs/affine-shared/headless.js +10 -0
- package/dist/_pkgs/affine-shared/services/asset-picker-service.d.ts +63 -0
- package/dist/_pkgs/affine-shared/services/asset-picker-service.js +20 -0
- package/dist/_pkgs/affine-shared/services/frame-template-service.d.ts +83 -0
- package/dist/_pkgs/affine-shared/services/frame-template-service.js +17 -0
- package/dist/_pkgs/affine-shared/services/index.d.ts +3 -0
- package/dist/_pkgs/affine-shared/services/index.js +3 -0
- package/dist/_pkgs/affine-shared/services/thread-marks-service.d.ts +69 -0
- package/dist/_pkgs/affine-shared/services/thread-marks-service.js +20 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +6 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +10 -0
- package/dist/_pkgs/affine-widget-drag-handle/watchers/drag-event-watcher.js +8 -3
- package/dist/_pkgs/affine-widget-keyboard-toolbar/config.js +4 -16
- package/dist/_pkgs/affine-widget-linked-doc/transformers/html.d.ts +7 -0
- package/dist/_pkgs/affine-widget-linked-doc/transformers/html.js +25 -24
- package/dist/_pkgs/affine-widget-linked-doc/transformers/index.d.ts +1 -1
- package/dist/_pkgs/affine-widget-linked-doc/transformers/markdown.d.ts +7 -0
- package/dist/_pkgs/affine-widget-linked-doc/transformers/markdown.js +26 -25
- package/dist/_pkgs/affine-widget-linked-doc/transformers/utils.d.ts +23 -0
- package/dist/_pkgs/affine-widget-linked-doc/transformers/utils.js +14 -0
- package/dist/_pkgs/affine-widget-thread-marks/effects.d.ts +1 -0
- package/dist/_pkgs/affine-widget-thread-marks/effects.js +4 -0
- package/dist/_pkgs/affine-widget-thread-marks/excerpt.d.ts +19 -0
- package/dist/_pkgs/affine-widget-thread-marks/excerpt.js +68 -0
- package/dist/_pkgs/affine-widget-thread-marks/index.d.ts +5 -0
- package/dist/_pkgs/affine-widget-thread-marks/index.js +8 -0
- package/dist/_pkgs/affine-widget-thread-marks/toolbar.d.ts +49 -0
- package/dist/_pkgs/affine-widget-thread-marks/toolbar.js +108 -0
- package/dist/_pkgs/affine-widget-thread-marks/translations.d.ts +9 -0
- package/dist/_pkgs/affine-widget-thread-marks/translations.js +11 -0
- package/dist/_pkgs/affine-widget-thread-marks/view.d.ts +12 -0
- package/dist/_pkgs/affine-widget-thread-marks/view.js +25 -0
- package/dist/_pkgs/affine-widget-thread-marks/widget.d.ts +51 -0
- package/dist/_pkgs/affine-widget-thread-marks/widget.js +214 -0
- package/dist/commands.js +5 -2
- package/dist/extensions/view.js +2 -0
- package/dist/host-panels.d.ts +24 -1
- package/dist/host-panels.js +61 -10
- package/dist/interchange.d.ts +1 -0
- package/dist/interchange.js +1 -0
- package/dist/model/headless.d.ts +1 -0
- package/dist/model/headless.js +1 -0
- package/dist/shared/headless.d.ts +1 -0
- package/dist/shared/headless.js +1 -0
- package/dist/translations.js +10 -1
- package/package.json +13 -1
package/dist/host-panels.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { EdgelessFrameManagerIdentifier } from './_pkgs/affine-block-frame/index.js';
|
|
2
2
|
import { AFFINE_FRAME_PREVIEW, } from './_pkgs/affine-fragment-frame-panel/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { interchangeExportActions } from './_pkgs/affine-block-surface/index.js';
|
|
4
|
+
import { DocModeProvider, translateKey, } from './_pkgs/affine-shared/services/index.js';
|
|
4
5
|
import { getRegisteredCommands, isCommandAvailable, runCommandAsync, } from './_pkgs/std/index.js';
|
|
5
6
|
import { GfxControllerIdentifier } from './_pkgs/std/gfx/index.js';
|
|
7
|
+
import { frameworkDescriptor } from './frameworks.js';
|
|
6
8
|
/**
|
|
7
9
|
* `@labre/affine/host-panels` — the verbs a host's own panel calls (ADR 0034
|
|
8
10
|
* §4, docs/integrate/08-host-panels.md).
|
|
@@ -68,6 +70,17 @@ export { frameCommands, reorderFramesParams, } from './_pkgs/affine-block-frame/
|
|
|
68
70
|
* value.
|
|
69
71
|
*/
|
|
70
72
|
export { formatPropertyValue, isPropertyValueEmpty, } from './_pkgs/affine-fragment-doc-title/index.js';
|
|
73
|
+
/*
|
|
74
|
+
* The "has a thread" seam (ADR 0038). The editor marks what the host says
|
|
75
|
+
* has a discussion and asks the host to open one, with an excerpt it
|
|
76
|
+
* computes; the host registers `ThreadMarksExtension({ marks$, openThread })`
|
|
77
|
+
* among its editor extensions. Gathered here with its types so a host's
|
|
78
|
+
* discussion module imports one entry; `threadExcerpt` is the excerpt the
|
|
79
|
+
* editor hands `openThread`, for a host that starts a discussion from its
|
|
80
|
+
* own UI.
|
|
81
|
+
*/
|
|
82
|
+
export { ThreadMarksExtension } from './_pkgs/affine-shared/services/index.js';
|
|
83
|
+
export { threadExcerpt, } from './_pkgs/affine-widget-thread-marks/index.js';
|
|
71
84
|
/**
|
|
72
85
|
* The document's frames in presentation order, first slide first — the order
|
|
73
86
|
* `canvas.frame.reorder` writes and the presentation walks. Works in page mode
|
|
@@ -129,10 +142,35 @@ export function createFramePreview(std, frame, options = {}) {
|
|
|
129
142
|
preview.fillScreen = options.fillScreen;
|
|
130
143
|
return preview;
|
|
131
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Everything on the `'view-menu'` surface: the registered commands, then
|
|
147
|
+
* one export per framework `*:export` capability in the interchange registry
|
|
148
|
+
* (`interchangeExportActions`, ADR 0034 amendment of 2026-10-14) — derived
|
|
149
|
+
* at read time, so what a flag removed from the registry is not listed.
|
|
150
|
+
*/
|
|
151
|
+
function viewMenuEntries(std) {
|
|
152
|
+
const registered = getRegisteredCommands(std)
|
|
153
|
+
.filter(command => command.surfaces.includes('view-menu'))
|
|
154
|
+
.map(command => ({ command }));
|
|
155
|
+
const derived = interchangeExportActions(std).map(({ command, capability }) => {
|
|
156
|
+
const framework = frameworkDescriptor(capability.framework);
|
|
157
|
+
return {
|
|
158
|
+
command,
|
|
159
|
+
labelParams: {
|
|
160
|
+
framework: framework
|
|
161
|
+
? translateKey(std, framework.labelKey, framework.labelFallback)
|
|
162
|
+
: capability.framework,
|
|
163
|
+
extension: capability.format.extensions[0],
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
return [...registered, ...derived];
|
|
168
|
+
}
|
|
132
169
|
/**
|
|
133
170
|
* The actions proper to the view the editor shows now, in their declared
|
|
134
171
|
* order: the commands registered on the `'view-menu'` surface whose `scope`
|
|
135
|
-
* is this mode (or `'global'`) and whose `when` holds
|
|
172
|
+
* is this mode (or `'global'`) and whose `when` holds, and on the canvas
|
|
173
|
+
* one export per framework format the interchange registry can write.
|
|
136
174
|
*
|
|
137
175
|
* `mode` is the view the host shows; omitted, it is read from
|
|
138
176
|
* `DocModeProvider`, and a provider that does not know (the library default
|
|
@@ -147,21 +185,34 @@ export function createFramePreview(std, frame, options = {}) {
|
|
|
147
185
|
*/
|
|
148
186
|
export function getViewActions(std, mode) {
|
|
149
187
|
const view = mode ?? std.getOptional(DocModeProvider)?.getEditorMode();
|
|
150
|
-
return
|
|
151
|
-
.filter(command => command.
|
|
152
|
-
.filter(command => command.
|
|
153
|
-
.
|
|
154
|
-
.
|
|
155
|
-
.map(command => ({
|
|
188
|
+
return viewMenuEntries(std)
|
|
189
|
+
.filter(({ command }) => command.scope === 'global' || !view || command.scope === view)
|
|
190
|
+
.filter(({ command }) => !command.when || command.when(std))
|
|
191
|
+
.sort((a, b) => (a.command.order ?? 0) - (b.command.order ?? 0))
|
|
192
|
+
.map(({ command, labelParams }) => ({
|
|
156
193
|
id: command.id,
|
|
157
194
|
section: command.category ?? 'display',
|
|
158
|
-
label: translateKey(std, command.labelKey, command.labelFallback),
|
|
195
|
+
label: translateKey(std, command.labelKey, command.labelFallback, labelParams),
|
|
159
196
|
labelKey: command.labelKey,
|
|
197
|
+
...(labelParams ? { labelParams } : {}),
|
|
160
198
|
...(command.iconKey ? { iconKey: command.iconKey } : {}),
|
|
161
199
|
...(command.checked ? { checked: command.checked(std) } : {}),
|
|
162
200
|
disabled: !isCommandAvailable(std, command),
|
|
163
201
|
}));
|
|
164
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* The exports of the view the editor shows now — the `'export'` section of
|
|
205
|
+
* {@link getViewActions}, in the same order: what a host lists in ONE
|
|
206
|
+
* "Export…" menu. On the page: Markdown and HTML. On the canvas: PNG and PDF
|
|
207
|
+
* (with an `ExportManager`), draw.io, SVG (with a canvas renderer), one entry
|
|
208
|
+
* per framework format the registry writes (`canvas.export.<framework>.<format>`,
|
|
209
|
+
* listed while the board holds that framework's elements), then Markdown and
|
|
210
|
+
* HTML. Every one resolves {@link runViewAction} with `{ file }` and downloads
|
|
211
|
+
* nothing.
|
|
212
|
+
*/
|
|
213
|
+
export function getViewExports(std, mode) {
|
|
214
|
+
return getViewActions(std, mode).filter(action => action.section === 'export');
|
|
215
|
+
}
|
|
165
216
|
/**
|
|
166
217
|
* Run one entry of {@link getViewActions} by its id, through `runCommand`'s
|
|
167
218
|
* bottleneck (usage and telemetry recorded once), and wait for it.
|
|
@@ -174,7 +225,7 @@ export function getViewActions(std, mode) {
|
|
|
174
225
|
* with no file.
|
|
175
226
|
*/
|
|
176
227
|
export async function runViewAction(std, id) {
|
|
177
|
-
const command =
|
|
228
|
+
const command = viewMenuEntries(std).find(entry => entry.command.id === id)?.command;
|
|
178
229
|
if (!command)
|
|
179
230
|
return {};
|
|
180
231
|
if (command.when && !command.when(std))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './_pkgs/affine-block-surface/interchange-headless.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './_pkgs/affine-block-surface/interchange-headless.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../_pkgs/affine-model/headless.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../_pkgs/affine-model/headless.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../_pkgs/affine-shared/headless.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../_pkgs/affine-shared/headless.js';
|
package/dist/translations.js
CHANGED
|
@@ -5,7 +5,7 @@ import { EMBED_WORDINGS } from './_pkgs/affine-block-embed/translations.js';
|
|
|
5
5
|
import { EMBED_DOC_WORDINGS } from './_pkgs/affine-block-embed-doc/translations.js';
|
|
6
6
|
import { FRAME_CHROME_WORDINGS, FRAME_WORDINGS, } from './_pkgs/affine-block-frame/translations.js';
|
|
7
7
|
import { IMAGE_WORDINGS } from './_pkgs/affine-block-image/translations.js';
|
|
8
|
-
import { EXEMPTION_FALLBACK, EXPORT_SVG_WORDINGS, PROVENANCE_FALLBACK, READING_FRAME_WORDINGS, SEVERITY_FALLBACK, SVG_SKETCH_WORDINGS, USER_LAYER_SEED_WORDINGS, } from './_pkgs/affine-block-surface/index.js';
|
|
8
|
+
import { EXEMPTION_FALLBACK, EXPORT_SVG_WORDINGS, INTERCHANGE_EXPORT_WORDINGS, PROVENANCE_FALLBACK, READING_FRAME_WORDINGS, SEVERITY_FALLBACK, SVG_SKETCH_WORDINGS, USER_LAYER_SEED_WORDINGS, } from './_pkgs/affine-block-surface/index.js';
|
|
9
9
|
import { SURFACE_REF_CHROME_WORDINGS, SURFACE_REF_WORDINGS, } from './_pkgs/affine-block-surface-ref/translations.js';
|
|
10
10
|
import { ADAPTER_PANEL_WORDINGS } from './_pkgs/affine-fragment-adapter-panel/translations.js';
|
|
11
11
|
import { DOC_TITLE_WORDINGS } from './_pkgs/affine-fragment-doc-title/translations.js';
|
|
@@ -41,6 +41,7 @@ import { EDGELESS_TOOLBAR_WORDINGS } from './_pkgs/affine-widget-edgeless-toolba
|
|
|
41
41
|
import { ZOOM_TOOLBAR_WORDINGS } from './_pkgs/affine-widget-edgeless-zoom-toolbar/translations.js';
|
|
42
42
|
import { LINKED_DOC_WORDINGS } from './_pkgs/affine-widget-linked-doc/translations.js';
|
|
43
43
|
import { REMOTE_SELECTION_WORDINGS } from './_pkgs/affine-widget-remote-selection/translations.js';
|
|
44
|
+
import { THREAD_MARKS_WORDINGS } from './_pkgs/affine-widget-thread-marks/translations.js';
|
|
44
45
|
import { SLASH_MENU_WORDINGS } from './_pkgs/affine-widget-slash-menu/translations.js';
|
|
45
46
|
import { TOOLBAR_WIDGET_WORDINGS } from './_pkgs/affine-widget-toolbar/translations.js';
|
|
46
47
|
import { collectTranslationKeys, commandCategoryTranslationEntries, commandTranslationEntries, mergeTranslationEntries, } from './_pkgs/std/index.js';
|
|
@@ -243,6 +244,12 @@ const CHROME_KEYS = [
|
|
|
243
244
|
'com.labre.interchange.import.readonly',
|
|
244
245
|
'This page became read-only while the file was being read, so nothing was imported.',
|
|
245
246
|
],
|
|
247
|
+
// The host's upload ceiling (`FileSizeLimitProvider`) applied to an import,
|
|
248
|
+
// before the file is read. `{{size}}` is the formatted ceiling.
|
|
249
|
+
[
|
|
250
|
+
'com.labre.interchange.import.too-large',
|
|
251
|
+
'This file is larger than {{size}}, the most this editor imports.',
|
|
252
|
+
],
|
|
246
253
|
[
|
|
247
254
|
'com.labre.interchange.import.remarks',
|
|
248
255
|
'What the import could not keep as it was',
|
|
@@ -303,6 +310,7 @@ const PACKAGE_WORDINGS = [
|
|
|
303
310
|
ZOOM_TOOLBAR_WORDINGS,
|
|
304
311
|
LINKED_DOC_WORDINGS,
|
|
305
312
|
REMOTE_SELECTION_WORDINGS,
|
|
313
|
+
THREAD_MARKS_WORDINGS,
|
|
306
314
|
TOOLBAR_WIDGET_WORDINGS,
|
|
307
315
|
COMPONENTS_WORDINGS,
|
|
308
316
|
INLINE_LATEX_WORDINGS,
|
|
@@ -317,6 +325,7 @@ const PACKAGE_WORDINGS = [
|
|
|
317
325
|
ROOT_CHROME_WORDINGS,
|
|
318
326
|
SVG_SKETCH_WORDINGS,
|
|
319
327
|
EXPORT_SVG_WORDINGS,
|
|
328
|
+
INTERCHANGE_EXPORT_WORDINGS,
|
|
320
329
|
READING_FRAME_WORDINGS,
|
|
321
330
|
STD_WORDINGS,
|
|
322
331
|
ATTACHMENT_WORDINGS,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formicoidea/labre-core",
|
|
3
3
|
"description": "Labre editor — the full BlockSuite-derived editor as one package.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.52.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"author": "lajola",
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"types": "./dist/effects.d.ts",
|
|
19
19
|
"import": "./dist/effects.js"
|
|
20
20
|
},
|
|
21
|
+
"./interchange": {
|
|
22
|
+
"types": "./dist/interchange.d.ts",
|
|
23
|
+
"import": "./dist/interchange.js"
|
|
24
|
+
},
|
|
21
25
|
"./ext-loader": {
|
|
22
26
|
"types": "./dist/ext-loader/index.d.ts",
|
|
23
27
|
"import": "./dist/ext-loader/index.js"
|
|
@@ -778,6 +782,10 @@
|
|
|
778
782
|
"types": "./dist/shared/consts.d.ts",
|
|
779
783
|
"import": "./dist/shared/consts.js"
|
|
780
784
|
},
|
|
785
|
+
"./shared/headless": {
|
|
786
|
+
"types": "./dist/shared/headless.d.ts",
|
|
787
|
+
"import": "./dist/shared/headless.js"
|
|
788
|
+
},
|
|
781
789
|
"./shared/selection": {
|
|
782
790
|
"types": "./dist/shared/selection.d.ts",
|
|
783
791
|
"import": "./dist/shared/selection.js"
|
|
@@ -834,6 +842,10 @@
|
|
|
834
842
|
"types": "./dist/model/index.d.ts",
|
|
835
843
|
"import": "./dist/model/index.js"
|
|
836
844
|
},
|
|
845
|
+
"./model/headless": {
|
|
846
|
+
"types": "./dist/model/headless.d.ts",
|
|
847
|
+
"import": "./dist/model/headless.js"
|
|
848
|
+
},
|
|
837
849
|
"./sync": {
|
|
838
850
|
"types": "./dist/sync/index.d.ts",
|
|
839
851
|
"import": "./dist/sync/index.js"
|