@formicoidea/labre-core 0.41.0 → 0.42.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/LICENSE +384 -0
- package/dist/_pkgs/affine-block-bookmark/bookmark-block.js +2 -2
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.js +7 -1
- package/dist/_pkgs/affine-block-embed/embed-figma-block/embed-figma-block.js +2 -1
- package/dist/_pkgs/affine-block-embed/embed-github-block/embed-github-block.js +2 -1
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.d.ts +2 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.js +5 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.d.ts +1 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +30 -8
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/utils.d.ts +8 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/utils.js +19 -0
- package/dist/_pkgs/affine-block-embed/embed-loom-block/embed-loom-block.js +2 -1
- package/dist/_pkgs/affine-block-embed/embed-youtube-block/embed-youtube-block.js +2 -1
- package/dist/_pkgs/affine-block-frame/frame-manager.js +1 -1
- package/dist/_pkgs/affine-block-frame/frame-tool.js +1 -1
- package/dist/_pkgs/affine-block-frame/frame-toolbar.js +6 -1
- package/dist/_pkgs/affine-block-list/list-keymap.js +7 -0
- package/dist/_pkgs/affine-block-note/note-keymap.js +7 -1
- package/dist/_pkgs/affine-block-paragraph/paragraph-keymap.js +7 -1
- package/dist/_pkgs/affine-block-root/commands/pivot-commands.js +1 -8
- package/dist/_pkgs/affine-block-root/commands/tag-commands.js +1 -8
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.d.ts +9 -0
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.js +51 -0
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.d.ts +22 -0
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +46 -0
- package/dist/_pkgs/affine-block-root/edgeless/utils/pinch-zoom.d.ts +21 -0
- package/dist/_pkgs/affine-block-root/edgeless/utils/pinch-zoom.js +24 -0
- package/dist/_pkgs/affine-block-root/edgeless/utils/query.js +8 -0
- package/dist/_pkgs/affine-block-root/keyboard/keymap.js +1 -16
- package/dist/_pkgs/affine-block-surface/element-model/index.d.ts +21 -3
- package/dist/_pkgs/affine-block-surface/element-model/index.js +14 -2
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.d.ts +23 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.js +89 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.d.ts +7 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.js +5 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.d.ts +41 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +70 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.d.ts +49 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.js +257 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/tagged-path.d.ts +16 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/tagged-path.js +24 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.d.ts +24 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.js +66 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +4 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.js +4 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.d.ts +66 -4
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +241 -11
- package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +18 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend-toolbar.d.ts +81 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend-toolbar.js +81 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend.d.ts +136 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend.js +439 -0
- package/dist/_pkgs/affine-block-surface/extensions/reading-widget.d.ts +17 -3
- package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +35 -13
- package/dist/_pkgs/affine-block-surface/extensions/reading.d.ts +61 -1
- package/dist/_pkgs/affine-block-surface/extensions/reading.js +85 -39
- package/dist/_pkgs/affine-block-surface/extensions/record-action.d.ts +66 -0
- package/dist/_pkgs/affine-block-surface/extensions/record-action.js +145 -0
- package/dist/_pkgs/affine-block-surface/extensions/validation.d.ts +253 -28
- package/dist/_pkgs/affine-block-surface/extensions/validation.js +489 -41
- package/dist/_pkgs/affine-block-surface/framework-background/background-view.d.ts +115 -0
- package/dist/_pkgs/affine-block-surface/framework-background/background-view.js +185 -0
- package/dist/_pkgs/affine-block-surface/framework-background/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/framework-background/index.js +1 -0
- package/dist/_pkgs/affine-block-surface/framework-background/labels.d.ts +16 -1
- package/dist/_pkgs/affine-block-surface/framework-background/labels.js +31 -21
- package/dist/_pkgs/affine-block-surface/framework-background/renderer.js +29 -5
- package/dist/_pkgs/affine-block-surface/framework-background/stacking.d.ts +6 -4
- package/dist/_pkgs/affine-block-surface/framework-background/stacking.js +56 -8
- package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.d.ts +12 -0
- package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.js +15 -0
- package/dist/_pkgs/affine-block-surface/view.js +8 -1
- package/dist/_pkgs/affine-block-surface-ref/configs/slash-menu.js +1 -1
- package/dist/_pkgs/affine-components/color-picker/button.d.ts +56 -1
- package/dist/_pkgs/affine-components/color-picker/button.js +168 -23
- package/dist/_pkgs/affine-components/color-picker/framework-palette.d.ts +106 -0
- package/dist/_pkgs/affine-components/color-picker/framework-palette.js +177 -0
- package/dist/_pkgs/affine-components/color-picker/index.d.ts +2 -0
- package/dist/_pkgs/affine-components/color-picker/index.js +2 -0
- package/dist/_pkgs/affine-components/color-picker/palette-carousel.d.ts +85 -0
- package/dist/_pkgs/affine-components/color-picker/palette-carousel.js +440 -0
- package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.d.ts +31 -1
- package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.js +189 -63
- package/dist/_pkgs/affine-components/resource/resource.js +29 -16
- package/dist/_pkgs/affine-components/translations.d.ts +8 -0
- package/dist/_pkgs/affine-components/translations.js +17 -0
- package/dist/_pkgs/affine-foundation/view.js +2 -1
- package/dist/_pkgs/affine-gfx-brush/element-renderer.js +2 -2
- package/dist/_pkgs/affine-gfx-brush/toolbar/configs/brush.js +6 -1
- package/dist/_pkgs/affine-gfx-brush/toolbar/configs/highlighter.js +6 -1
- package/dist/_pkgs/affine-gfx-connector/connector-manager.d.ts +9 -1
- package/dist/_pkgs/affine-gfx-connector/connector-manager.js +61 -0
- package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.d.ts +7 -1
- package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.js +87 -17
- package/dist/_pkgs/affine-gfx-connector/element-renderer/index.js +78 -17
- package/dist/_pkgs/affine-gfx-connector/element-renderer/utils.d.ts +24 -2
- package/dist/_pkgs/affine-gfx-connector/element-renderer/utils.js +31 -8
- package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.d.ts +124 -3
- package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.js +216 -54
- package/dist/_pkgs/affine-gfx-connector/text/text.d.ts +13 -4
- package/dist/_pkgs/affine-gfx-connector/text/text.js +13 -44
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.d.ts +56 -0
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +72 -4
- package/dist/_pkgs/affine-gfx-connector/toolbar/hollow-endpoint-icons.d.ts +8 -0
- package/dist/_pkgs/affine-gfx-connector/toolbar/hollow-endpoint-icons.js +118 -0
- package/dist/_pkgs/affine-gfx-connector/view/view.d.ts +37 -1
- package/dist/_pkgs/affine-gfx-connector/view/view.js +97 -8
- package/dist/_pkgs/affine-gfx-group/command/group-api.js +1 -1
- package/dist/_pkgs/affine-gfx-group/store.js +0 -2
- package/dist/_pkgs/affine-gfx-group/translations.d.ts +9 -10
- package/dist/_pkgs/affine-gfx-group/translations.js +9 -13
- package/dist/_pkgs/affine-gfx-mindmap/templates/index.js +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/basket-elements.js +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/utils/import-mindmap.js +2 -2
- package/dist/_pkgs/affine-gfx-mindmap/translations.d.ts +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/translations.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/element-renderer/highlighter.js +2 -2
- package/dist/_pkgs/affine-gfx-shape/overlay/polygon-drawing-overlay.d.ts +6 -0
- package/dist/_pkgs/affine-gfx-shape/overlay/polygon-drawing-overlay.js +30 -1
- package/dist/_pkgs/affine-gfx-shape/polygon-tool.d.ts +20 -1
- package/dist/_pkgs/affine-gfx-shape/polygon-tool.js +9 -1
- package/dist/_pkgs/affine-gfx-shape/toolbar/config.js +6 -1
- package/dist/_pkgs/affine-gfx-shape/toolbar/palette-color-action.js +11 -1
- package/dist/_pkgs/affine-gfx-template/builtin/other.js +1 -1
- package/dist/_pkgs/affine-gfx-template/snapshot-from-action.js +32 -119
- package/dist/_pkgs/affine-gfx-template/toolbar/template-type.d.ts +1 -1
- package/dist/_pkgs/affine-gfx-text/dblclick-add-edgeless-text.d.ts +13 -1
- package/dist/_pkgs/affine-gfx-text/dblclick-add-edgeless-text.js +19 -4
- package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.d.ts +41 -0
- package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.js +57 -2
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.d.ts +8 -1
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +12 -2
- package/dist/_pkgs/affine-gfx-text/translations.d.ts +1 -0
- package/dist/_pkgs/affine-gfx-text/translations.js +2 -1
- package/dist/_pkgs/affine-inline-preset/markdown.js +5 -1
- package/dist/_pkgs/affine-model/consts/connector.d.ts +28 -2
- package/dist/_pkgs/affine-model/consts/connector.js +26 -0
- package/dist/_pkgs/affine-model/elements/bpmn/pool.js +1 -1
- package/dist/_pkgs/affine-model/elements/brush/brush.js +1 -1
- package/dist/_pkgs/affine-model/elements/c4/board.js +1 -1
- package/dist/_pkgs/affine-model/elements/c4/boundary.js +1 -1
- package/dist/_pkgs/affine-model/elements/connector/connector.d.ts +135 -0
- package/dist/_pkgs/affine-model/elements/connector/connector.js +246 -5
- package/dist/_pkgs/affine-model/elements/connector/end-label.d.ts +83 -0
- package/dist/_pkgs/affine-model/elements/connector/end-label.js +119 -0
- package/dist/_pkgs/affine-model/elements/connector/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/connector/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/context-map/context-map.js +1 -1
- package/dist/_pkgs/affine-model/elements/core-domain/core-domain.d.ts +28 -0
- package/dist/_pkgs/affine-model/elements/core-domain/core-domain.js +129 -2
- package/dist/_pkgs/affine-model/elements/cynefin/cynefin.d.ts +8 -0
- package/dist/_pkgs/affine-model/elements/cynefin/cynefin.js +45 -2
- package/dist/_pkgs/affine-model/elements/edgy/board.js +1 -1
- package/dist/_pkgs/affine-model/elements/edgy/facets.js +1 -1
- package/dist/_pkgs/affine-model/elements/estuarine/estuarine.d.ts +6 -0
- package/dist/_pkgs/affine-model/elements/estuarine/estuarine.js +36 -2
- package/dist/_pkgs/affine-model/elements/event-storming/event-storming.d.ts +18 -7
- package/dist/_pkgs/affine-model/elements/event-storming/event-storming.js +23 -8
- package/dist/_pkgs/affine-model/elements/framework-background/background.d.ts +16 -0
- package/dist/_pkgs/affine-model/elements/framework-background/background.js +18 -0
- package/dist/_pkgs/affine-model/elements/highlighter/highlighter.js +1 -1
- package/dist/_pkgs/affine-model/elements/index.d.ts +8 -0
- package/dist/_pkgs/affine-model/elements/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/shape/shape.js +1 -1
- package/dist/_pkgs/affine-model/elements/text/text.js +1 -1
- package/dist/_pkgs/affine-model/elements/uml/band.d.ts +39 -0
- package/dist/_pkgs/affine-model/elements/uml/band.js +31 -0
- package/dist/_pkgs/affine-model/elements/uml/diagram.d.ts +158 -0
- package/dist/_pkgs/affine-model/elements/uml/diagram.js +229 -0
- package/dist/_pkgs/affine-model/elements/uml/fragment.d.ts +161 -0
- package/dist/_pkgs/affine-model/elements/uml/fragment.js +205 -0
- package/dist/_pkgs/affine-model/elements/uml/index.d.ts +8 -0
- package/dist/_pkgs/affine-model/elements/uml/index.js +8 -0
- package/dist/_pkgs/affine-model/elements/uml/lifeline.d.ts +77 -0
- package/dist/_pkgs/affine-model/elements/uml/lifeline.js +89 -0
- package/dist/_pkgs/affine-model/elements/uml/node.d.ts +142 -0
- package/dist/_pkgs/affine-model/elements/uml/node.js +190 -0
- package/dist/_pkgs/affine-model/elements/uml/partition.d.ts +106 -0
- package/dist/_pkgs/affine-model/elements/uml/partition.js +172 -0
- package/dist/_pkgs/affine-model/elements/uml/region.d.ts +75 -0
- package/dist/_pkgs/affine-model/elements/uml/region.js +150 -0
- package/dist/_pkgs/affine-model/elements/uml/subject.d.ts +37 -0
- package/dist/_pkgs/affine-model/elements/uml/subject.js +108 -0
- package/dist/_pkgs/affine-model/elements/wardley/wardley.js +1 -1
- package/dist/_pkgs/affine-shared/services/embed-iframe/embed-iframe-config.d.ts +1 -0
- package/dist/_pkgs/affine-shared/services/font-loader/config.d.ts +7 -0
- package/dist/_pkgs/affine-shared/services/font-loader/config.js +43 -0
- package/dist/_pkgs/affine-shared/services/pivot-materiality-publisher.js +1 -9
- package/dist/_pkgs/affine-shared/services/telemetry-service/document-damage-watcher.d.ts +53 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/document-damage-watcher.js +95 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/index.js +1 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +26 -1
- package/dist/_pkgs/affine-shared/services/telemetry-service/telemetry-service.d.ts +2 -2
- package/dist/_pkgs/affine-shared/services/toolbar-service/command-action.d.ts +34 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/command-action.js +63 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/index.js +1 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +77 -7
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +97 -7
- package/dist/_pkgs/affine-shared/styles/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/styles/index.js +1 -0
- package/dist/_pkgs/affine-shared/styles/motion.d.ts +14 -0
- package/dist/_pkgs/affine-shared/styles/motion.js +38 -0
- package/dist/_pkgs/affine-shared/utils/event.d.ts +10 -0
- package/dist/_pkgs/affine-shared/utils/event.js +20 -0
- package/dist/_pkgs/affine-shared/utils/file/filesys.d.ts +16 -0
- package/dist/_pkgs/affine-shared/utils/file/filesys.js +25 -0
- package/dist/_pkgs/affine-shared/utils/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/utils/index.js +1 -0
- package/dist/_pkgs/affine-shared/utils/link-preview-refresh.d.ts +12 -0
- package/dist/_pkgs/affine-shared/utils/link-preview-refresh.js +13 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.d.ts +12 -4
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +27 -4
- package/dist/_pkgs/affine-widget-edgeless-toolbar/create-popper.js +13 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/index.d.ts +2 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/index.js +2 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.d.ts +80 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.js +270 -81
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/senior-menu-selection.d.ts +15 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/senior-menu-selection.js +15 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-weight-and-style-panel.js +8 -1
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-ghost-overlay.d.ts +42 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-ghost-overlay.js +100 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-placement-tool.d.ts +100 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-placement-tool.js +274 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/index.d.ts +3 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/index.js +3 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/translate-created.d.ts +25 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/translate-created.js +67 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +5 -0
- package/dist/_pkgs/global/gfx/xywh.js +7 -0
- package/dist/_pkgs/std/extension/command-registry.d.ts +158 -1
- package/dist/_pkgs/std/extension/command-registry.js +22 -0
- package/dist/_pkgs/std/gfx/index.d.ts +1 -1
- package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.d.ts +12 -0
- package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.js +20 -1
- package/dist/_pkgs/std/gfx/interactivity/manager.d.ts +10 -0
- package/dist/_pkgs/std/gfx/interactivity/manager.js +12 -0
- package/dist/_pkgs/std/gfx/model/surface/element-model.js +12 -7
- package/dist/_pkgs/std/gfx/model/surface/surface-model.d.ts +56 -0
- package/dist/_pkgs/std/gfx/model/surface/surface-model.js +84 -3
- package/dist/_pkgs/std/gfx/view/view.d.ts +11 -2
- package/dist/_pkgs/std/gfx/view/view.js +16 -2
- package/dist/commands.d.ts +6 -0
- package/dist/commands.js +8 -1
- package/dist/frameworks.d.ts +9 -0
- package/dist/frameworks.js +19 -0
- package/dist/translations.js +16 -0
- package/package.json +9 -4
- package/dist/_pkgs/affine-gfx-group/group-watcher.d.ts +0 -1
- package/dist/_pkgs/affine-gfx-group/group-watcher.js +0 -20
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createIdentifier } from '../../../global/di/index.js';
|
|
2
2
|
import { DisposableGroup } from '../../../global/disposable/index.js';
|
|
3
3
|
import { BlockSuiteError, ErrorCode } from '../../../global/exceptions/index.js';
|
|
4
|
-
import {} from '../../../global/gfx/index.js';
|
|
4
|
+
import { Bound } from '../../../global/gfx/index.js';
|
|
5
5
|
import { GfxPrimitiveElementModel } from '../model/surface/element-model.js';
|
|
6
6
|
export const GfxElementModelViewExtIdentifier = createIdentifier('GfxElementModelView');
|
|
7
7
|
export class GfxElementModelView {
|
|
@@ -104,7 +104,21 @@ export class GfxElementModelView {
|
|
|
104
104
|
onDragMove({ dx, dy, currentBound }) {
|
|
105
105
|
this.model.xywh = currentBound.moveDelta(dx, dy).serialize();
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Whether a box (marquee) selection takes this element. `false` keeps it
|
|
109
|
+
* out; anything else keeps the default (any overlap selects).
|
|
110
|
+
*
|
|
111
|
+
* A model may carry its own answer as `boxSelectable(box)` — a framework
|
|
112
|
+
* background does, to join a marquee only when the marquee contains it —
|
|
113
|
+
* and the default view defers to it, so every view of such a model gets the
|
|
114
|
+
* rule without restating it.
|
|
115
|
+
*/
|
|
116
|
+
onBoxSelected(context) {
|
|
117
|
+
const model = this.model;
|
|
118
|
+
if (typeof model.boxSelectable === 'function') {
|
|
119
|
+
return model.boxSelectable(Bound.from(context.box));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
108
122
|
/**
|
|
109
123
|
* Called when the view is destroyed.
|
|
110
124
|
* Override this method requires calling `super.onDestroyed()`.
|
package/dist/commands.d.ts
CHANGED
|
@@ -35,6 +35,12 @@ export declare function buildCommandRegistry(core: AnyCommandDescriptor[], group
|
|
|
35
35
|
* stay reachable on a board whose framework tooling is switched off; it is
|
|
36
36
|
* registered from the always-on connector view extension for the same reason.
|
|
37
37
|
*
|
|
38
|
+
* `export.svg` joins them on the same terms (`docs/adr/0025`): a board is a
|
|
39
|
+
* `FrameworkBackgroundElementModel` whatever framework drew it, and the picture
|
|
40
|
+
* it hands back is the canvas renderer's output replayed into SVG — so the
|
|
41
|
+
* command belongs to no framework, and a framework toggled off must still be
|
|
42
|
+
* able to export the boards already on the canvas.
|
|
43
|
+
*
|
|
38
44
|
* `auditCommands` is `'core'`-owned but NOT always-on: it rides the `ai-audit`
|
|
39
45
|
* capability switch, which is a second axis (see `OPTIONAL_CAPABILITIES`). The
|
|
40
46
|
* read side is filtered here, the registration side by `AuditViewExtension` in
|
package/dist/commands.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { coreCommands, pivotCommands, readingCommands, tagCommands, } from './_pkgs/affine-block-root/index.js';
|
|
2
|
-
import { auditCommands, mapQualityCommands } from './_pkgs/affine-block-surface/index.js';
|
|
2
|
+
import { auditCommands, exportSvgCommands, mapQualityCommands, } from './_pkgs/affine-block-surface/index.js';
|
|
3
3
|
import { edgeDirectionCommands } from './_pkgs/affine-gfx-connector/index.js';
|
|
4
4
|
import { shapeCommands } from './_pkgs/affine-gfx-shape/index.js';
|
|
5
5
|
import { toCommandManifestEntry, } from './_pkgs/std/index.js';
|
|
@@ -27,6 +27,12 @@ export function buildCommandRegistry(core, groups, flags) {
|
|
|
27
27
|
* stay reachable on a board whose framework tooling is switched off; it is
|
|
28
28
|
* registered from the always-on connector view extension for the same reason.
|
|
29
29
|
*
|
|
30
|
+
* `export.svg` joins them on the same terms (`docs/adr/0025`): a board is a
|
|
31
|
+
* `FrameworkBackgroundElementModel` whatever framework drew it, and the picture
|
|
32
|
+
* it hands back is the canvas renderer's output replayed into SVG — so the
|
|
33
|
+
* command belongs to no framework, and a framework toggled off must still be
|
|
34
|
+
* able to export the boards already on the canvas.
|
|
35
|
+
*
|
|
30
36
|
* `auditCommands` is `'core'`-owned but NOT always-on: it rides the `ai-audit`
|
|
31
37
|
* capability switch, which is a second axis (see `OPTIONAL_CAPABILITIES`). The
|
|
32
38
|
* read side is filtered here, the registration side by `AuditViewExtension` in
|
|
@@ -46,6 +52,7 @@ export function getCommands(flags) {
|
|
|
46
52
|
...readingCommands,
|
|
47
53
|
...shapeCommands,
|
|
48
54
|
...mapQualityCommands,
|
|
55
|
+
...exportSvgCommands,
|
|
49
56
|
...edgeDirectionCommands,
|
|
50
57
|
...(isCapabilityEnabled(flags, 'ai-audit') ? auditCommands : []),
|
|
51
58
|
], FRAMEWORK_COMMAND_GROUPS, flags);
|
package/dist/frameworks.d.ts
CHANGED
|
@@ -10,6 +10,15 @@ import type { OptionalBlock } from './flags.js';
|
|
|
10
10
|
* read it (through a type-strip transform) instead of hand-maintaining its own
|
|
11
11
|
* `FRAMEWORKS` array. Keep it that way. See `docs/adr/0008` § Packaging.
|
|
12
12
|
*
|
|
13
|
+
* `iconKey` names the senior button's 56×56 glyph, registered in the framework's
|
|
14
|
+
* OWN command-icon table under `<segment>.toolbar` and therefore resolvable
|
|
15
|
+
* through `getCommandIcon`. The button still imports the glyph directly; the
|
|
16
|
+
* registry entry is what a host — or the catalogue — can resolve without it.
|
|
17
|
+
* Unlike the 24×24 command glyphs, it is `width="100%"` and fills whatever
|
|
18
|
+
* box it is put in.
|
|
19
|
+
* `__tests__/commands/registry.unit.spec.ts` ("every framework declares its own
|
|
20
|
+
* senior icon key") pins it non-empty, unique and registered.
|
|
21
|
+
*
|
|
13
22
|
* `telemetryKey` and `telemetrySegment` hold the HISTORICAL PostHog values.
|
|
14
23
|
* They are the reason the identity unification is code-side only and existing
|
|
15
24
|
* dashboards keep working untouched — never "tidy" them.
|
package/dist/frameworks.js
CHANGED
|
@@ -162,6 +162,25 @@ export const FRAMEWORK_DESCRIPTORS = [
|
|
|
162
162
|
],
|
|
163
163
|
shortcuts: true,
|
|
164
164
|
},
|
|
165
|
+
{
|
|
166
|
+
id: 'uml',
|
|
167
|
+
labelKey: 'com.labre.framework.uml',
|
|
168
|
+
labelFallback: 'UML',
|
|
169
|
+
iconKey: 'uml.toolbar',
|
|
170
|
+
telemetryKey: 'uml',
|
|
171
|
+
telemetrySegment: 'uml toolbox',
|
|
172
|
+
bundle: 'framework-uml',
|
|
173
|
+
info: 'umlFramework',
|
|
174
|
+
pkg: '@labre/affine-gfx-uml',
|
|
175
|
+
dir: 'affine/gfx/uml',
|
|
176
|
+
extensions: [
|
|
177
|
+
// always-on: placed diagrams, subjects and nodes must paint with the
|
|
178
|
+
// button off, and their role vocabulary must stay readable
|
|
179
|
+
{ viewExtension: 'UmlRenderViewExtension' },
|
|
180
|
+
{ flag: 'uml', viewExtension: 'UmlViewExtension' },
|
|
181
|
+
],
|
|
182
|
+
shortcuts: true,
|
|
183
|
+
},
|
|
165
184
|
];
|
|
166
185
|
/**
|
|
167
186
|
* Bundles that are NOT frameworks: no senior button, no commands, no identity
|
package/dist/translations.js
CHANGED
|
@@ -219,6 +219,14 @@ const CHROME_KEYS = [
|
|
|
219
219
|
// and would leave every new format silently untranslated.
|
|
220
220
|
['com.labre.interchange.import.done', 'file imported'],
|
|
221
221
|
['com.labre.interchange.import.failed', 'This file could not be imported'],
|
|
222
|
+
// Rights lost WHILE the file was being read — the import's own sentence,
|
|
223
|
+
// because nothing is wrong with the file. It rides under the same "could not
|
|
224
|
+
// be imported" headline as a reader's refusal, which is what it is to the
|
|
225
|
+
// person who picked it.
|
|
226
|
+
[
|
|
227
|
+
'com.labre.interchange.import.readonly',
|
|
228
|
+
'This document became read-only while the file was being read, so nothing was imported.',
|
|
229
|
+
],
|
|
222
230
|
[
|
|
223
231
|
'com.labre.interchange.import.remarks',
|
|
224
232
|
'What the import could not keep as it was',
|
|
@@ -234,6 +242,14 @@ const CHROME_KEYS = [
|
|
|
234
242
|
['com.labre.interchange.import.drawn', 'drawn'],
|
|
235
243
|
['com.labre.interchange.import.carried', 'carried'],
|
|
236
244
|
['com.labre.interchange.import.quarantined', 'quarantined'],
|
|
245
|
+
// The one remark the shared materializer raises itself — a provisional name
|
|
246
|
+
// two imported elements were both handed. It belongs here with the pipeline's
|
|
247
|
+
// other words rather than in a reader's table, because no reader produces it:
|
|
248
|
+
// `materializeInterchangeImport` does, whichever format was read.
|
|
249
|
+
[
|
|
250
|
+
'com.labre.interchange.import.duplicate-provisional-name',
|
|
251
|
+
'Two imported elements were handed the same provisional name "{{name}}". Both are on the board; anything referring to that name points at the first of them.',
|
|
252
|
+
],
|
|
237
253
|
];
|
|
238
254
|
/**
|
|
239
255
|
* The block and widget packages' own wordings — one `readonly ChromeWording[]`
|
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.42.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"author": "lajola",
|
|
@@ -862,6 +862,10 @@
|
|
|
862
862
|
"types": "./dist/_pkgs/global/di/index.d.ts",
|
|
863
863
|
"import": "./dist/_pkgs/global/di/index.js"
|
|
864
864
|
},
|
|
865
|
+
"./_pkgs/global/di/types.js": {
|
|
866
|
+
"types": "./dist/_pkgs/global/di/types.d.ts",
|
|
867
|
+
"import": "./dist/_pkgs/global/di/types.js"
|
|
868
|
+
},
|
|
865
869
|
"./_pkgs/global/utils": {
|
|
866
870
|
"types": "./dist/_pkgs/global/utils/index.d.ts",
|
|
867
871
|
"import": "./dist/_pkgs/global/utils/index.js"
|
|
@@ -894,9 +898,9 @@
|
|
|
894
898
|
"clsx": "^2.1.1",
|
|
895
899
|
"collapse-white-space": "^2.1.0",
|
|
896
900
|
"date-fns": "^4.0.0",
|
|
897
|
-
"dompurify": "^3.
|
|
901
|
+
"dompurify": "^3.4.13",
|
|
898
902
|
"emoji-mart": "^5.6.0",
|
|
899
|
-
"fflate": "^0.8.
|
|
903
|
+
"fflate": "^0.8.3",
|
|
900
904
|
"file-type": "^21.0.0",
|
|
901
905
|
"fractional-indexing": "^3.2.0",
|
|
902
906
|
"html2canvas": "^1.4.1",
|
|
@@ -923,7 +927,7 @@
|
|
|
923
927
|
"micromark-extension-gfm-task-list-item": "^2.1.0",
|
|
924
928
|
"micromark-util-combine-extensions": "^2.0.0",
|
|
925
929
|
"minimatch": "^10.0.1",
|
|
926
|
-
"nanoid": "^5.
|
|
930
|
+
"nanoid": "^5.1.16",
|
|
927
931
|
"pdf-lib": "^1.17.1",
|
|
928
932
|
"quick-lru": "^7.0.1",
|
|
929
933
|
"rehype-parse": "^9.0.0",
|
|
@@ -934,6 +938,7 @@
|
|
|
934
938
|
"rxjs": "^7.8.1",
|
|
935
939
|
"shiki": "^3.0.0",
|
|
936
940
|
"simple-xml-to-json": "^1.2.2",
|
|
941
|
+
"svgcanvas": "2.6.0",
|
|
937
942
|
"ts-pattern": "^5.1.0",
|
|
938
943
|
"unified": "^11.0.5",
|
|
939
944
|
"unist-util-visit": "^5.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const groupRelationWatcherExtension: import("../store/index.js").ExtensionType;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SurfaceGroupLikeModel, surfaceMiddlewareExtension, } from '../affine-block-surface/index.js';
|
|
2
|
-
const groupRelationWatcher = (surface) => {
|
|
3
|
-
const disposables = [
|
|
4
|
-
surface.elementUpdated.subscribe(({ id, props, local }) => {
|
|
5
|
-
if (!local)
|
|
6
|
-
return;
|
|
7
|
-
const element = surface.getElementById(id);
|
|
8
|
-
// remove the group if it has no children
|
|
9
|
-
if (element instanceof SurfaceGroupLikeModel &&
|
|
10
|
-
props['childIds'] &&
|
|
11
|
-
element.childIds.length === 0) {
|
|
12
|
-
surface.deleteElement(id);
|
|
13
|
-
}
|
|
14
|
-
}),
|
|
15
|
-
];
|
|
16
|
-
return () => {
|
|
17
|
-
disposables.forEach(d => d.unsubscribe());
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export const groupRelationWatcherExtension = surfaceMiddlewareExtension('group-relation-watcher', groupRelationWatcher);
|