@formicoidea/labre-core 0.32.0 → 0.34.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/dist/_pkgs/affine-block-attachment/attachment-block.js +3 -3
- package/dist/_pkgs/affine-block-attachment/configs/toolbar.d.ts +2 -2
- package/dist/_pkgs/affine-block-attachment/configs/toolbar.js +9 -7
- package/dist/_pkgs/affine-block-bookmark/configs/toolbar.js +12 -12
- package/dist/_pkgs/affine-block-callout/callout-block.js +1 -1
- package/dist/_pkgs/affine-block-code/code-block-inline.js +1 -1
- package/dist/_pkgs/affine-block-code/code-block.js +2 -2
- package/dist/_pkgs/affine-block-code/code-toolbar/config.js +9 -1
- package/dist/_pkgs/affine-block-code/code-toolbar/index.js +1 -1
- package/dist/_pkgs/affine-block-database/data-source.js +1 -2
- package/dist/_pkgs/affine-block-database/database-block.js +2 -2
- package/dist/_pkgs/affine-block-database/external-data-source.js +1 -1
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-text-block.js +1 -1
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.js +1 -1
- package/dist/_pkgs/affine-block-embed/common/render-linked-doc.js +3 -3
- package/dist/_pkgs/affine-block-embed/configs/toolbar.js +11 -11
- package/dist/_pkgs/affine-block-embed/embed-figma-block/embed-figma-service.js +1 -1
- package/dist/_pkgs/affine-block-embed/embed-html-block/configs/toolbar.js +5 -5
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.d.ts +7 -7
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +14 -14
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +2 -2
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/toolbar.js +10 -10
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-linked-doc-block.js +4 -4
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/utils.js +1 -1
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/components/embed-synced-doc-card.js +5 -4
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/configs/toolbar.js +10 -10
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-synced-doc-block.js +1 -1
- package/dist/_pkgs/affine-block-frame/frame-manager.js +3 -1
- package/dist/_pkgs/affine-block-frame/frame-tool.js +1 -1
- package/dist/_pkgs/affine-block-frame/frame-toolbar.js +2 -2
- package/dist/_pkgs/affine-block-image/components/page-image-block.js +1 -1
- package/dist/_pkgs/affine-block-image/configs/toolbar.js +4 -4
- package/dist/_pkgs/affine-block-image/image-edgeless-block.js +1 -1
- package/dist/_pkgs/affine-block-list/utils/forward-delete.js +1 -1
- package/dist/_pkgs/affine-block-note/commands/select-block.js +1 -1
- package/dist/_pkgs/affine-block-note/commands/select-blocks-between.js +1 -1
- package/dist/_pkgs/affine-block-note/configs/toolbar.js +2 -2
- package/dist/_pkgs/affine-block-note/move-block.js +1 -1
- package/dist/_pkgs/affine-block-paragraph/utils/forward-delete.js +2 -2
- package/dist/_pkgs/affine-block-paragraph/utils/merge-with-prev.js +1 -1
- package/dist/_pkgs/affine-block-root/configs/toolbar.d.ts +6 -4
- package/dist/_pkgs/affine-block-root/configs/toolbar.js +6 -6
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/misc.d.ts +10 -10
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/misc.js +4 -4
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.d.ts +7 -7
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.js +9 -9
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.js +1 -1
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +3 -1
- package/dist/_pkgs/affine-block-root/edgeless/utils/clipboard-utils.js +1 -1
- package/dist/_pkgs/affine-block-surface/adapters/markdown/element-adapter/type.js +1 -1
- package/dist/_pkgs/affine-block-surface/adapters/plain-text/element-adapter/type.js +1 -1
- package/dist/_pkgs/affine-block-surface/element-model/index.d.ts +18 -3
- package/dist/_pkgs/affine-block-surface/element-model/index.js +12 -2
- package/dist/_pkgs/affine-block-surface/extensions/audit.js +23 -6
- package/dist/_pkgs/affine-block-surface/extensions/crud-extension.js +10 -5
- package/dist/_pkgs/affine-block-surface/extensions/editor-anchored-panel.js +2 -1
- package/dist/_pkgs/affine-block-surface/extensions/element-renderer.js +1 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +1 -1
- 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 +172 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +404 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +323 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange.js +64 -0
- package/dist/_pkgs/affine-block-surface/extensions/map-quality-widget.js +61 -61
- package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.d.ts +248 -0
- package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.js +248 -0
- package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +78 -80
- package/dist/_pkgs/affine-block-surface/extensions/reading.js +2 -2
- package/dist/_pkgs/affine-block-surface/extensions/spotlight.d.ts +21 -0
- package/dist/_pkgs/affine-block-surface/extensions/spotlight.js +17 -3
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +107 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +958 -0
- package/dist/_pkgs/affine-block-surface/extensions/validation.d.ts +809 -20
- package/dist/_pkgs/affine-block-surface/extensions/validation.js +1661 -50
- package/dist/_pkgs/affine-block-surface/extensions/violation-detail-widget.d.ts +50 -6
- package/dist/_pkgs/affine-block-surface/extensions/violation-detail-widget.js +129 -32
- package/dist/_pkgs/affine-block-surface/framework-background/def.d.ts +289 -0
- package/dist/_pkgs/affine-block-surface/framework-background/def.js +126 -1
- package/dist/_pkgs/affine-block-surface/framework-background/labels.d.ts +42 -2
- package/dist/_pkgs/affine-block-surface/framework-background/labels.js +80 -4
- package/dist/_pkgs/affine-block-surface/framework-background/renderer.js +172 -11
- 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/renderer/element-highlight-overlay.d.ts +17 -0
- package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.js +66 -0
- package/dist/_pkgs/affine-block-surface/renderer/overlay.js +1 -1
- package/dist/_pkgs/affine-block-surface/view.js +5 -0
- package/dist/_pkgs/affine-block-surface-ref/configs/toolbar.js +4 -4
- package/dist/_pkgs/affine-block-surface-ref/portal/note.js +2 -2
- package/dist/_pkgs/affine-block-table/commands.js +1 -1
- package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.js +1 -1
- package/dist/_pkgs/affine-components/embed-card-modal/embed-card-edit-modal.js +1 -1
- package/dist/_pkgs/affine-components/filterable-list/styles.js +1 -1
- package/dist/_pkgs/affine-components/highlight-dropdown-menu/highlight-duotone-icon.js +8 -8
- package/dist/_pkgs/affine-components/highlight-dropdown-menu/text-duotone-icon.js +11 -11
- package/dist/_pkgs/affine-components/icons/text.js +426 -426
- package/dist/_pkgs/affine-components/open-doc-dropdown-menu/dropdown-menu.d.ts +2 -0
- package/dist/_pkgs/affine-components/peek/peekable.js +1 -1
- package/dist/_pkgs/affine-components/resource/resource.js +2 -0
- package/dist/_pkgs/affine-components/toolbar/index.d.ts +1 -0
- package/dist/_pkgs/affine-components/toolbar/index.js +1 -0
- package/dist/_pkgs/affine-components/toolbar/menu-button.js +1 -1
- package/dist/_pkgs/affine-components/toolbar/picker-menu.d.ts +55 -0
- package/dist/_pkgs/affine-components/toolbar/picker-menu.js +47 -0
- package/dist/_pkgs/affine-components/view-dropdown-menu/dropdown-menu.js +27 -14
- package/dist/_pkgs/affine-fragment-frame-panel/body/frame-panel-body.js +2 -2
- package/dist/_pkgs/affine-fragment-frame-panel/header/frame-panel-header.js +2 -2
- package/dist/_pkgs/affine-fragment-frame-panel/header/frames-setting-menu.js +1 -1
- package/dist/_pkgs/affine-fragment-outline/mobile-outline-panel.js +1 -1
- package/dist/_pkgs/affine-gfx-brush/toolbar/components/pen/pen-tool-button.js +1 -1
- package/dist/_pkgs/affine-gfx-connector/connector-manager.js +7 -10
- package/dist/_pkgs/affine-gfx-connector/connector-tool.d.ts +19 -1
- package/dist/_pkgs/affine-gfx-connector/connector-tool.js +10 -2
- package/dist/_pkgs/affine-gfx-connector/connector-watcher.js +1 -4
- package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.js +2 -1
- package/dist/_pkgs/affine-gfx-connector/direction/invert-direction.js +1 -3
- package/dist/_pkgs/affine-gfx-connector/element-renderer/index.js +1 -1
- package/dist/_pkgs/affine-gfx-connector/element-renderer/utils.js +1 -1
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/adapter/markdown/index.js +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/adapter/utils.js +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/templates/index.js +583 -4
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-menu.js +23 -23
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-tool-button.js +5 -1
- package/dist/_pkgs/affine-gfx-mindmap/view/utils.js +1 -1
- package/dist/_pkgs/affine-gfx-note/overlay/overlay.js +1 -1
- package/dist/_pkgs/affine-gfx-note/toolbar/note-senior-button.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/consts.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/draggable/shape-draggable.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/element-renderer/shape/polygon.js +17 -9
- package/dist/_pkgs/affine-gfx-shape/element-renderer/shape/utils.js +8 -3
- package/dist/_pkgs/affine-gfx-shape/element-view.js +19 -12
- package/dist/_pkgs/affine-gfx-shape/overlay/polygon-drawing-overlay.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/overlay/polygon-vertex-editing-overlay.js +12 -7
- package/dist/_pkgs/affine-gfx-shape/overlay/shape-overlay.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/polygon-tool.js +4 -2
- package/dist/_pkgs/affine-gfx-shape/shape-tool.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/text/edgeless-shape-text-editor.js +1 -3
- package/dist/_pkgs/affine-gfx-template/builtin/other.js +66 -17
- package/dist/_pkgs/affine-gfx-template/toolbar/overlay-scrollbar.js +1 -1
- package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.js +1 -1
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +1 -1
- package/dist/_pkgs/affine-inline-link/command.js +1 -1
- package/dist/_pkgs/affine-inline-link/link-node/configs/toolbar.d.ts +4 -4
- package/dist/_pkgs/affine-inline-link/link-node/configs/toolbar.js +6 -6
- package/dist/_pkgs/affine-inline-preset/command/format-block.js +1 -1
- package/dist/_pkgs/affine-inline-preset/command/format-native.js +2 -2
- package/dist/_pkgs/affine-inline-preset/command/format-text.js +1 -1
- package/dist/_pkgs/affine-inline-preset/inline-spec.js +1 -1
- package/dist/_pkgs/affine-inline-reference/reference-node/configs/toolbar.d.ts +4 -4
- package/dist/_pkgs/affine-inline-reference/reference-node/configs/toolbar.js +6 -6
- package/dist/_pkgs/affine-inline-reference/reference-node/reference-node.js +1 -1
- package/dist/_pkgs/affine-model/elements/bpmn/node.d.ts +40 -7
- package/dist/_pkgs/affine-model/elements/bpmn/node.js +4 -2
- package/dist/_pkgs/affine-model/elements/bpmn/pool.d.ts +135 -17
- package/dist/_pkgs/affine-model/elements/bpmn/pool.js +148 -26
- package/dist/_pkgs/affine-model/elements/c4/board.d.ts +88 -0
- package/dist/_pkgs/affine-model/elements/c4/board.js +128 -0
- package/dist/_pkgs/affine-model/elements/c4/boundary.d.ts +63 -0
- package/dist/_pkgs/affine-model/elements/c4/boundary.js +134 -0
- package/dist/_pkgs/affine-model/elements/c4/index.d.ts +3 -0
- package/dist/_pkgs/affine-model/elements/c4/index.js +3 -0
- package/dist/_pkgs/affine-model/elements/c4/node.d.ts +97 -0
- package/dist/_pkgs/affine-model/elements/c4/node.js +130 -0
- package/dist/_pkgs/affine-model/elements/connector/connector.js +1 -1
- package/dist/_pkgs/affine-model/elements/context-map/context-map.d.ts +27 -0
- package/dist/_pkgs/affine-model/elements/context-map/context-map.js +94 -0
- package/dist/_pkgs/affine-model/elements/context-map/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/context-map/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/core-domain/core-domain.d.ts +34 -17
- package/dist/_pkgs/affine-model/elements/core-domain/core-domain.js +28 -26
- package/dist/_pkgs/affine-model/elements/cynefin/cynefin.d.ts +7 -2
- package/dist/_pkgs/affine-model/elements/cynefin/cynefin.js +9 -4
- package/dist/_pkgs/affine-model/elements/edgy/board.d.ts +7 -2
- package/dist/_pkgs/affine-model/elements/edgy/board.js +9 -4
- package/dist/_pkgs/affine-model/elements/edgy/facets.d.ts +20 -3
- package/dist/_pkgs/affine-model/elements/edgy/facets.js +13 -4
- package/dist/_pkgs/affine-model/elements/estuarine/estuarine.d.ts +7 -2
- package/dist/_pkgs/affine-model/elements/estuarine/estuarine.js +9 -4
- package/dist/_pkgs/affine-model/elements/event-storming/event-storming.d.ts +36 -0
- package/dist/_pkgs/affine-model/elements/event-storming/event-storming.js +103 -0
- package/dist/_pkgs/affine-model/elements/event-storming/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/event-storming/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/framework-background/background.d.ts +7 -2
- package/dist/_pkgs/affine-model/elements/framework-background/background.js +9 -4
- package/dist/_pkgs/affine-model/elements/framework-background/hit-test.d.ts +48 -0
- package/dist/_pkgs/affine-model/elements/framework-background/hit-test.js +55 -0
- package/dist/_pkgs/affine-model/elements/framework-background/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/framework-background/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/index.d.ts +11 -0
- package/dist/_pkgs/affine-model/elements/index.js +3 -0
- package/dist/_pkgs/affine-model/elements/shape/api/polygon.js +2 -8
- package/dist/_pkgs/affine-shared/adapters/html/block-adapter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/markdown/block-adapter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/markdown/delta-converter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/notion-html/block-adapter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/notion-html/delta-converter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/plain-text/block-adapter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/plain-text/delta-converter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/utils/color.js +5 -2
- package/dist/_pkgs/affine-shared/commands/model-crud/draft-selected-models.js +1 -1
- package/dist/_pkgs/affine-shared/commands/selection/focus-block-end.js +1 -1
- package/dist/_pkgs/affine-shared/commands/selection/focus-block-start.js +1 -1
- package/dist/_pkgs/affine-shared/consts/index.d.ts +10 -0
- package/dist/_pkgs/affine-shared/consts/index.js +10 -0
- package/dist/_pkgs/affine-shared/services/artefact-catalogue-service.d.ts +55 -0
- package/dist/_pkgs/affine-shared/services/artefact-catalogue-service.js +35 -0
- package/dist/_pkgs/affine-shared/services/audit-service.d.ts +11 -0
- package/dist/_pkgs/affine-shared/services/command-usage-service.d.ts +31 -0
- package/dist/_pkgs/affine-shared/services/command-usage-service.js +109 -0
- package/dist/_pkgs/affine-shared/services/comment-service/block-comment-manager.js +1 -1
- package/dist/_pkgs/affine-shared/services/doc-display-meta-service.js +1 -1
- package/dist/_pkgs/affine-shared/services/edit-props-store.d.ts +11 -0
- package/dist/_pkgs/affine-shared/services/edit-props-store.js +15 -0
- package/dist/_pkgs/affine-shared/services/embed-iframe/embed-iframe-config.js +1 -1
- package/dist/_pkgs/affine-shared/services/index.d.ts +2 -0
- package/dist/_pkgs/affine-shared/services/index.js +2 -0
- package/dist/_pkgs/affine-shared/services/pivot-materiality-publisher.js +2 -1
- package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +73 -1
- package/dist/_pkgs/affine-shared/services/toolbar-service/action.d.ts +32 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/action.js +16 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/flags.d.ts +10 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/flags.js +32 -1
- package/dist/_pkgs/affine-shared/services/toolbar-service/registry.d.ts +44 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/registry.js +161 -3
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +106 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +201 -0
- package/dist/_pkgs/affine-shared/services/translation-service/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/services/translation-service/index.js +1 -0
- package/dist/_pkgs/affine-shared/services/universe-tag-defs-service.js +5 -3
- package/dist/_pkgs/affine-shared/test-utils/affine-template.js +1 -1
- package/dist/_pkgs/affine-shared/utils/edgeless.js +1 -1
- package/dist/_pkgs/affine-shared/utils/file/filesys.d.ts +34 -0
- package/dist/_pkgs/affine-shared/utils/file/filesys.js +48 -7
- package/dist/_pkgs/affine-shared/utils/zod-schema.js +1 -3
- package/dist/_pkgs/affine-widget-drag-handle/utils.js +1 -1
- package/dist/_pkgs/affine-widget-edgeless-auto-connect/index.js +1 -1
- package/dist/_pkgs/affine-widget-edgeless-dragging-area/edgeless-dragging-area-rect.js +1 -1
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-default.d.ts +14 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-default.js +40 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.d.ts +158 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +572 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/catalogue-groups.d.ts +41 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/catalogue-groups.js +49 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/chord-format.d.ts +13 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/chord-format.js +50 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/edgeless-toolbar.d.ts +6 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/edgeless-toolbar.js +15 -5
- package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.d.ts +2 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.js +2 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/extension/index.d.ts +7 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/index.d.ts +4 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/index.js +4 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.d.ts +19 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.js +51 -10
- package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +9 -0
- package/dist/_pkgs/affine-widget-keyboard-toolbar/config.js +2 -1
- package/dist/_pkgs/affine-widget-keyboard-toolbar/icons.js +98 -98
- package/dist/_pkgs/affine-widget-keyboard-toolbar/keyboard-tool-panel.js +1 -1
- package/dist/_pkgs/affine-widget-linked-doc/import-doc/import-doc.js +1 -1
- package/dist/_pkgs/affine-widget-linked-doc/linked-doc-popover.js +1 -1
- package/dist/_pkgs/affine-widget-page-dragging-area/index.js +1 -1
- package/dist/_pkgs/affine-widget-remote-selection/doc/doc-remote-selection.js +1 -1
- package/dist/_pkgs/affine-widget-slash-menu/config.js +2 -1
- package/dist/_pkgs/affine-widget-toolbar/toolbar.js +11 -2
- package/dist/_pkgs/affine-widget-toolbar/utils.d.ts +19 -2
- package/dist/_pkgs/affine-widget-toolbar/utils.js +28 -9
- package/dist/_pkgs/data-view/core/group-by/renderer/boolean-group.js +11 -11
- package/dist/_pkgs/data-view/core/utils/menu-title.js +17 -17
- package/dist/_pkgs/data-view/view-presets/calendar/pc/actions.js +8 -12
- package/dist/_pkgs/data-view/view-presets/calendar/pc/view.js +52 -40
- package/dist/_pkgs/data-view/view-presets/table/mobile/group.js +3 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/group.js +3 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/group-title.js +18 -18
- package/dist/_pkgs/std/clipboard/utils.js +4 -1
- package/dist/_pkgs/std/extension/command-registry.d.ts +195 -5
- package/dist/_pkgs/std/extension/command-registry.js +218 -4
- package/dist/_pkgs/std/extension/shortcut.js +2 -1
- package/dist/_pkgs/std/extension/translation-manifest.d.ts +46 -1
- package/dist/_pkgs/std/extension/translation-manifest.js +58 -0
- package/dist/_pkgs/std/gfx/grid.js +1 -1
- package/dist/_pkgs/std/gfx/highlight.d.ts +84 -0
- package/dist/_pkgs/std/gfx/highlight.js +112 -0
- package/dist/_pkgs/std/gfx/index.d.ts +2 -1
- package/dist/_pkgs/std/gfx/index.js +1 -0
- package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.js +17 -3
- package/dist/_pkgs/std/gfx/model/surface/element-model.d.ts +160 -0
- package/dist/_pkgs/std/gfx/model/surface/element-model.js +75 -1
- package/dist/_pkgs/std/gfx/model/surface/role.js +5 -3
- package/dist/_pkgs/std/gfx/model/surface/surface-model.js +2 -1
- package/dist/_pkgs/std/gfx/selection.js +1 -1
- package/dist/_pkgs/std/gfx/viewport.js +1 -1
- package/dist/_pkgs/std/inline/extensions/inline-manager.js +1 -1
- package/dist/_pkgs/std/inline/extensions/markdown-matcher.js +1 -1
- package/dist/_pkgs/std/scope/std-scope.d.ts +2 -1
- package/dist/_pkgs/std/scope/std-scope.js +2 -0
- package/dist/_pkgs/std/utils/gfx.js +2 -0
- package/dist/_pkgs/store/model/store/crud.js +4 -1
- package/dist/commands.js +1 -1
- package/dist/extensions/command-usage.d.ts +23 -0
- package/dist/extensions/command-usage.js +37 -0
- package/dist/extensions/view.js +12 -0
- package/dist/frameworks.js +32 -0
- package/dist/shortcuts.d.ts +20 -6
- package/dist/shortcuts.js +7 -9
- package/dist/translations.js +98 -3
- package/package.json +13 -1
|
@@ -12,6 +12,61 @@ export function ToolbarModuleExtension(module) {
|
|
|
12
12
|
},
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* What separates a flavour from the OWNER of one of its modules.
|
|
17
|
+
*
|
|
18
|
+
* A module is registered under one DI variant, and until now that variant WAS
|
|
19
|
+
* the flavour — so a flavour held at most two modules, its own key and its
|
|
20
|
+
* `custom:` twin, and a third contributor got a `DuplicateServiceDefinitionError`
|
|
21
|
+
* at setup rather than a menu entry. That ceiling was invisible until two
|
|
22
|
+
* frameworks needed the same element: `affine:surface:group` carries the native
|
|
23
|
+
* group operations, `custom:affine:surface:group` carries Wardley's
|
|
24
|
+
* qualification dropdown, and a C4 component IS a group — so C4's morph had
|
|
25
|
+
* nowhere at all to be registered.
|
|
26
|
+
*
|
|
27
|
+
* {@link toolbarModuleKey} gives it one. `custom:affine:surface:group#c4-morph`
|
|
28
|
+
* is a DISTINCT DI variant and therefore never collides, while
|
|
29
|
+
* {@link ToolbarRegistryExtension.modulesFor} still hands it to the row drawn
|
|
30
|
+
* for `custom:affine:surface:group`. Nothing about the existing keys changes:
|
|
31
|
+
* a module registered under a bare flavour is that flavour's first module, and
|
|
32
|
+
* every registration in the library before this one stays exactly as it was.
|
|
33
|
+
*/
|
|
34
|
+
const MODULE_OWNER_SEPARATOR = '#';
|
|
35
|
+
/** The flavour a DI variant speaks for, owner suffix and all. */
|
|
36
|
+
export function toolbarModuleFlavour(variant) {
|
|
37
|
+
const at = variant.indexOf(MODULE_OWNER_SEPARATOR);
|
|
38
|
+
return at < 0 ? variant : variant.slice(0, at);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A second (or third) module on one flavour, named by who contributes it.
|
|
42
|
+
*
|
|
43
|
+
* The owner is never shown and never parsed back — it exists so two
|
|
44
|
+
* contributors cannot claim one DI variant. Use a stable, framework-scoped
|
|
45
|
+
* name (`c4-morph`), because it is the identity the container refuses
|
|
46
|
+
* duplicates on.
|
|
47
|
+
*/
|
|
48
|
+
export function toolbarModuleKey(flavour, owner) {
|
|
49
|
+
// Checked ALWAYS, and deliberately not behind a `process.env.NODE_ENV` dev
|
|
50
|
+
// guard. This library is published SOURCE-FIRST, so a `process` reference is
|
|
51
|
+
// not erased by anybody's build: a host consuming raw ESM would meet
|
|
52
|
+
// `ReferenceError: process is not defined` the moment a framework registered
|
|
53
|
+
// a shared toolbar module — i.e. at editor setup, on every document. The
|
|
54
|
+
// check costs one falsy test and one `includes` on a short string, run a
|
|
55
|
+
// handful of times per editor, which is nothing next to being the only
|
|
56
|
+
// `process` reference in the shipped source.
|
|
57
|
+
//
|
|
58
|
+
// What it prevents is silent: an empty owner produces `flavour#`, which is a
|
|
59
|
+
// DIFFERENT variant from `flavour` and would therefore register a second
|
|
60
|
+
// module the bare-key lookups below never see, and an owner carrying the
|
|
61
|
+
// separator makes `toolbarModuleFlavour` cut in the wrong place, filing the
|
|
62
|
+
// module under a flavour nobody draws.
|
|
63
|
+
if (!owner || owner.includes(MODULE_OWNER_SEPARATOR)) {
|
|
64
|
+
throw new Error(`toolbarModuleKey: owner must be non-empty and free of "${MODULE_OWNER_SEPARATOR}" (got ${JSON.stringify(owner)})`);
|
|
65
|
+
}
|
|
66
|
+
return `${flavour}${MODULE_OWNER_SEPARATOR}${owner}`;
|
|
67
|
+
}
|
|
68
|
+
/** One shared empty answer, so a miss allocates nothing and can be frozen. */
|
|
69
|
+
const NO_MODULES = Object.freeze([]);
|
|
15
70
|
export class ToolbarRegistryExtension extends Extension {
|
|
16
71
|
constructor(std) {
|
|
17
72
|
super();
|
|
@@ -21,18 +76,121 @@ export class ToolbarRegistryExtension extends Extension {
|
|
|
21
76
|
this.message$ = signal(null);
|
|
22
77
|
this.placement$ = signal('top');
|
|
23
78
|
this.flags = new Flags();
|
|
79
|
+
/**
|
|
80
|
+
* The modules grouped by the FLAVOUR they speak for, computed once.
|
|
81
|
+
*
|
|
82
|
+
* Once, because the registrations are fixed for the life of a container —
|
|
83
|
+
* they are DI impls, added at setup and never afterwards — while
|
|
84
|
+
* {@link modulesFor} is asked six times per toolbar render, and a toolbar
|
|
85
|
+
* re-renders on every selection change, every drag frame and every zoom
|
|
86
|
+
* notch.
|
|
87
|
+
*
|
|
88
|
+
* A module registered under the BARE flavour leads its group, and the rest
|
|
89
|
+
* follow in registration order. The order is what decides nothing much —
|
|
90
|
+
* `renderToolbar` sorts the merged actions by `placement`, `id` and `score`
|
|
91
|
+
* — and it is pinned all the same, because "which module answers a bare-key
|
|
92
|
+
* question" must not depend on which framework happened to be registered
|
|
93
|
+
* first.
|
|
94
|
+
*
|
|
95
|
+
* Each group is FROZEN: it is handed out by {@link modulesFor} on every
|
|
96
|
+
* render, and a caller that sorted or spliced the answer in place would
|
|
97
|
+
* silently rewrite the registry for every later render.
|
|
98
|
+
*/
|
|
99
|
+
this.#grouped = null;
|
|
24
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Every module of every flavour, keyed by the DI variant it was registered
|
|
103
|
+
* under — which for a shared flavour carries an owner suffix. Read
|
|
104
|
+
* {@link modulesFor} instead unless the variant itself is the question.
|
|
105
|
+
*/
|
|
25
106
|
get modules() {
|
|
26
107
|
return this.std.provider.getAll(ToolbarModuleIdentifier);
|
|
27
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* The modules grouped by the FLAVOUR they speak for, computed once.
|
|
111
|
+
*
|
|
112
|
+
* Once, because the registrations are fixed for the life of a container —
|
|
113
|
+
* they are DI impls, added at setup and never afterwards — while
|
|
114
|
+
* {@link modulesFor} is asked six times per toolbar render, and a toolbar
|
|
115
|
+
* re-renders on every selection change, every drag frame and every zoom
|
|
116
|
+
* notch.
|
|
117
|
+
*
|
|
118
|
+
* A module registered under the BARE flavour leads its group, and the rest
|
|
119
|
+
* follow in registration order. The order is what decides nothing much —
|
|
120
|
+
* `renderToolbar` sorts the merged actions by `placement`, `id` and `score`
|
|
121
|
+
* — and it is pinned all the same, because "which module answers a bare-key
|
|
122
|
+
* question" must not depend on which framework happened to be registered
|
|
123
|
+
* first.
|
|
124
|
+
*
|
|
125
|
+
* Each group is FROZEN: it is handed out by {@link modulesFor} on every
|
|
126
|
+
* render, and a caller that sorted or spliced the answer in place would
|
|
127
|
+
* silently rewrite the registry for every later render.
|
|
128
|
+
*/
|
|
129
|
+
#grouped;
|
|
130
|
+
get #groups() {
|
|
131
|
+
if (!this.#grouped) {
|
|
132
|
+
const groups = new Map();
|
|
133
|
+
for (const [variant, module] of this.modules) {
|
|
134
|
+
const flavour = toolbarModuleFlavour(variant);
|
|
135
|
+
const group = groups.get(flavour);
|
|
136
|
+
if (!group)
|
|
137
|
+
groups.set(flavour, [module]);
|
|
138
|
+
else if (variant === flavour)
|
|
139
|
+
group.unshift(module);
|
|
140
|
+
else
|
|
141
|
+
group.push(module);
|
|
142
|
+
}
|
|
143
|
+
for (const group of groups.values())
|
|
144
|
+
Object.freeze(group);
|
|
145
|
+
this.#grouped = groups;
|
|
146
|
+
}
|
|
147
|
+
return this.#grouped;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Every module contributing to one flavour's row — the bare-key module
|
|
151
|
+
* first, then the owner-suffixed ones in registration order.
|
|
152
|
+
*/
|
|
153
|
+
modulesFor(flavour) {
|
|
154
|
+
return this.#groups.get(flavour) ?? NO_MODULES;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* The config registered under the flavour ITSELF, or `null`.
|
|
158
|
+
*
|
|
159
|
+
* Deliberately not "the first module of this flavour". The callers of this
|
|
160
|
+
* method ask a question about one identified registration — does this block
|
|
161
|
+
* flavour have a toolbar of its own, where does that toolbar sit — and an
|
|
162
|
+
* owner-suffixed contributor is an ADDITION to a row, not a stand-in for the
|
|
163
|
+
* module that defines it. Answering with a contributor would make the reply
|
|
164
|
+
* depend on which frameworks a host happened to switch on: with `wardley`
|
|
165
|
+
* off and `c4` on, `custom:affine:surface:group` has no bare module at all,
|
|
166
|
+
* and returning C4's morph there would let a placement (or a `has`-style
|
|
167
|
+
* probe) be decided by a menu that only some builds ship.
|
|
168
|
+
*/
|
|
28
169
|
getModuleBy(flavour) {
|
|
29
|
-
return this.
|
|
170
|
+
return (this.modulesFor(flavour).find(module => module.id.variant === flavour)
|
|
171
|
+
?.config ?? null);
|
|
30
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* Where a flavour's row sits: the first module of it that actually SAYS.
|
|
175
|
+
*
|
|
176
|
+
* A row is one row however many modules contribute to it, so the placement
|
|
177
|
+
* is a property of the flavour and not of a registration — and a contributor
|
|
178
|
+
* that declares none must not be read as declaring the default. Scanning for
|
|
179
|
+
* the first module with a `placement` keeps the answer the same whether the
|
|
180
|
+
* framework that states it is registered first, last, or under an owner.
|
|
181
|
+
*/
|
|
31
182
|
getModulePlacement(flavour, fallback = 'top') {
|
|
32
|
-
return (this
|
|
33
|
-
this
|
|
183
|
+
return (this.#placementOf(`custom:${flavour}`) ??
|
|
184
|
+
this.#placementOf(flavour) ??
|
|
34
185
|
fallback);
|
|
35
186
|
}
|
|
187
|
+
#placementOf(flavour) {
|
|
188
|
+
for (const module of this.modulesFor(flavour)) {
|
|
189
|
+
if (module.config.placement)
|
|
190
|
+
return module.config.placement;
|
|
191
|
+
}
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
36
194
|
static setup(di) {
|
|
37
195
|
di.addImpl(ToolbarRegistryIdentifier, this, [StdIdentifier]);
|
|
38
196
|
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The editor's own chrome wordings, as `[key, fallback]` pairs.
|
|
3
|
+
*
|
|
4
|
+
* ## Why they are a table and not forty literals
|
|
5
|
+
*
|
|
6
|
+
* "Copy", "Delete", "Card view" are the SAME word on a dozen toolbars — the
|
|
7
|
+
* bookmark's, the image's, the embed's, the linked doc's — and a literal per
|
|
8
|
+
* call site is a wording a host has to translate a dozen times and can get
|
|
9
|
+
* twelve different answers for. One pair per word, imported where it is
|
|
10
|
+
* rendered, is what makes the manifest's promise ("every key the library can
|
|
11
|
+
* ask for") describe a list a human can actually word.
|
|
12
|
+
*
|
|
13
|
+
* ## The tuple shape is load-bearing
|
|
14
|
+
*
|
|
15
|
+
* `translateKey(std, ...COPY)` spreads into `(std, key, fallback)`, so a call
|
|
16
|
+
* site names the wording once and cannot pair the wrong fallback with the right
|
|
17
|
+
* key. It is also what
|
|
18
|
+
* `packages/affine/all/src/__tests__/translations/manifest.unit.spec.ts` reads:
|
|
19
|
+
* the two adjacent literals below are the pair its drift check confirms the
|
|
20
|
+
* manifest against, which is why the wordings live in literals here rather than
|
|
21
|
+
* being derived from anything.
|
|
22
|
+
*
|
|
23
|
+
* Chrome, so every one of them ships an English default: a standalone
|
|
24
|
+
* playground with no `TranslationProvider` registered must read exactly as it
|
|
25
|
+
* did before these keys existed.
|
|
26
|
+
*/
|
|
27
|
+
/** A wording the library can ask the host for: its key, and its English default. */
|
|
28
|
+
export type ChromeWording = readonly [key: string, fallback: string];
|
|
29
|
+
/**
|
|
30
|
+
* The transient messages the editor puts on screen after a gesture.
|
|
31
|
+
*
|
|
32
|
+
* They were the last English strings left in a fully translated host (#182):
|
|
33
|
+
* silent while nobody injected a `NotificationProvider`, and English in the
|
|
34
|
+
* middle of a French UI the moment somebody did.
|
|
35
|
+
*/
|
|
36
|
+
export declare const TOAST_COPIED_TO_CLIPBOARD: ChromeWording;
|
|
37
|
+
export declare const TOAST_LINKED_DOC_CREATED: ChromeWording;
|
|
38
|
+
export declare const TOAST_NOTE_REMOVED_FROM_PAGE: ChromeWording;
|
|
39
|
+
export declare const TOAST_FRAME_INSERTED_INTO_PAGE: ChromeWording;
|
|
40
|
+
export declare const TOAST_NO_LINK_FOUND: ChromeWording;
|
|
41
|
+
export declare const TOOLBAR_BRING_TO_FRONT: ChromeWording;
|
|
42
|
+
export declare const TOOLBAR_SEND_TO_BACK: ChromeWording;
|
|
43
|
+
export declare const TOOLBAR_COPY: ChromeWording;
|
|
44
|
+
export declare const TOOLBAR_DUPLICATE: ChromeWording;
|
|
45
|
+
export declare const TOOLBAR_DELETE: ChromeWording;
|
|
46
|
+
export declare const TOOLBAR_LOCK: ChromeWording;
|
|
47
|
+
export declare const TOOLBAR_MORE: ChromeWording;
|
|
48
|
+
export declare const TOOLBAR_LINK: ChromeWording;
|
|
49
|
+
export declare const TOOLBAR_CREATE_LINKED_DOC: ChromeWording;
|
|
50
|
+
export declare const TOOLBAR_DRAW_CONNECTOR: ChromeWording;
|
|
51
|
+
/**
|
|
52
|
+
* The four wordings of the view switcher — the control that decides whether a
|
|
53
|
+
* link is drawn as words, as a card or as the document itself.
|
|
54
|
+
*
|
|
55
|
+
* One set for every block that offers it (bookmark, attachment, embed, linked
|
|
56
|
+
* doc, synced doc, iframe, the inline link and the inline reference): they are
|
|
57
|
+
* one control with one vocabulary, and a host that had to word "Card view"
|
|
58
|
+
* eight times would end up with eight wordings of it.
|
|
59
|
+
*/
|
|
60
|
+
export declare const TOOLBAR_SWITCH_VIEW: ChromeWording;
|
|
61
|
+
export declare const TOOLBAR_INLINE_VIEW: ChromeWording;
|
|
62
|
+
export declare const TOOLBAR_CARD_VIEW: ChromeWording;
|
|
63
|
+
export declare const TOOLBAR_EMBED_VIEW: ChromeWording;
|
|
64
|
+
/**
|
|
65
|
+
* The four states a linked-doc card can be in with nothing to show: deleted,
|
|
66
|
+
* unreadable, empty, and — for the SYNCED card, which frames a page rather
|
|
67
|
+
* than a doc — empty in its own words.
|
|
68
|
+
*
|
|
69
|
+
* All four and not only the two the recette caught (#183): they are one
|
|
70
|
+
* sentence rendered by one ternary, and translating half of it would leave a
|
|
71
|
+
* card that changes language when the document it points at goes missing.
|
|
72
|
+
*/
|
|
73
|
+
export declare const LINKED_DOC_DELETED: ChromeWording;
|
|
74
|
+
export declare const LINKED_DOC_FAILED: ChromeWording;
|
|
75
|
+
export declare const LINKED_DOC_EMPTY_PREVIEW: ChromeWording;
|
|
76
|
+
export declare const SYNCED_DOC_EMPTY_PREVIEW: ChromeWording;
|
|
77
|
+
/**
|
|
78
|
+
* The resize toggle, which is the one entry EVERY framework board carries —
|
|
79
|
+
* Wardley, BPMN, C4, EDGY, Cynefin, Estuarine and the two DDD boards all
|
|
80
|
+
* register the same always-on button (`docs/adr/0009`: a stored board must stay
|
|
81
|
+
* usable with its framework switched off).
|
|
82
|
+
*
|
|
83
|
+
* Declared here rather than once per framework because it is not a framework's
|
|
84
|
+
* own word: it names a behaviour of the generic frame primitive, and eight
|
|
85
|
+
* copies of it in eight manifests would be eight keys for one tooltip.
|
|
86
|
+
*/
|
|
87
|
+
export declare const BOARD_RESIZE_TOGGLE: ChromeWording;
|
|
88
|
+
/**
|
|
89
|
+
* The legend button, in the two wordings the boards actually use: the notation
|
|
90
|
+
* boards say "notation", Wardley says "components".
|
|
91
|
+
*
|
|
92
|
+
* Two keys and not one interpolated sentence, for the reason the interchange
|
|
93
|
+
* counts already ran on — the seam has no interpolation, so the smallest honest
|
|
94
|
+
* unit is the whole sentence.
|
|
95
|
+
*/
|
|
96
|
+
export declare const BOARD_LEGEND_NOTATION: ChromeWording;
|
|
97
|
+
export declare const BOARD_LEGEND_COMPONENTS: ChromeWording;
|
|
98
|
+
/**
|
|
99
|
+
* Every wording declared above, in declaration order.
|
|
100
|
+
*
|
|
101
|
+
* The manifest (`@labre/affine/translations`) walks this instead of restating
|
|
102
|
+
* the pairs, so a wording added here reaches a host's catalogue with no second
|
|
103
|
+
* edit — the same "declared data, not restated data" rule the roles, the rules
|
|
104
|
+
* and the commands already follow.
|
|
105
|
+
*/
|
|
106
|
+
export declare const CHROME_WORDINGS: readonly ChromeWording[];
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The editor's own chrome wordings, as `[key, fallback]` pairs.
|
|
3
|
+
*
|
|
4
|
+
* ## Why they are a table and not forty literals
|
|
5
|
+
*
|
|
6
|
+
* "Copy", "Delete", "Card view" are the SAME word on a dozen toolbars — the
|
|
7
|
+
* bookmark's, the image's, the embed's, the linked doc's — and a literal per
|
|
8
|
+
* call site is a wording a host has to translate a dozen times and can get
|
|
9
|
+
* twelve different answers for. One pair per word, imported where it is
|
|
10
|
+
* rendered, is what makes the manifest's promise ("every key the library can
|
|
11
|
+
* ask for") describe a list a human can actually word.
|
|
12
|
+
*
|
|
13
|
+
* ## The tuple shape is load-bearing
|
|
14
|
+
*
|
|
15
|
+
* `translateKey(std, ...COPY)` spreads into `(std, key, fallback)`, so a call
|
|
16
|
+
* site names the wording once and cannot pair the wrong fallback with the right
|
|
17
|
+
* key. It is also what
|
|
18
|
+
* `packages/affine/all/src/__tests__/translations/manifest.unit.spec.ts` reads:
|
|
19
|
+
* the two adjacent literals below are the pair its drift check confirms the
|
|
20
|
+
* manifest against, which is why the wordings live in literals here rather than
|
|
21
|
+
* being derived from anything.
|
|
22
|
+
*
|
|
23
|
+
* Chrome, so every one of them ships an English default: a standalone
|
|
24
|
+
* playground with no `TranslationProvider` registered must read exactly as it
|
|
25
|
+
* did before these keys existed.
|
|
26
|
+
*/
|
|
27
|
+
/* ── Toasts ───────────────────────────────────────────────────────────── */
|
|
28
|
+
/**
|
|
29
|
+
* The transient messages the editor puts on screen after a gesture.
|
|
30
|
+
*
|
|
31
|
+
* They were the last English strings left in a fully translated host (#182):
|
|
32
|
+
* silent while nobody injected a `NotificationProvider`, and English in the
|
|
33
|
+
* middle of a French UI the moment somebody did.
|
|
34
|
+
*/
|
|
35
|
+
export const TOAST_COPIED_TO_CLIPBOARD = [
|
|
36
|
+
'com.labre.toast.copied-to-clipboard',
|
|
37
|
+
'Copied to clipboard',
|
|
38
|
+
];
|
|
39
|
+
export const TOAST_LINKED_DOC_CREATED = [
|
|
40
|
+
'com.labre.toast.linked-doc-created',
|
|
41
|
+
'Linked doc created',
|
|
42
|
+
];
|
|
43
|
+
export const TOAST_NOTE_REMOVED_FROM_PAGE = [
|
|
44
|
+
'com.labre.toast.note-removed-from-page-mode',
|
|
45
|
+
'Note removed from Page Mode',
|
|
46
|
+
];
|
|
47
|
+
export const TOAST_FRAME_INSERTED_INTO_PAGE = [
|
|
48
|
+
'com.labre.toast.frame-inserted-into-page',
|
|
49
|
+
'Frame inserted into Page.',
|
|
50
|
+
];
|
|
51
|
+
export const TOAST_NO_LINK_FOUND = [
|
|
52
|
+
'com.labre.toast.no-link-found',
|
|
53
|
+
'No link found',
|
|
54
|
+
];
|
|
55
|
+
/* ── Toolbars and menus ───────────────────────────────────────────────── */
|
|
56
|
+
export const TOOLBAR_BRING_TO_FRONT = [
|
|
57
|
+
'com.labre.toolbar.bring-to-front',
|
|
58
|
+
'Bring to Front',
|
|
59
|
+
];
|
|
60
|
+
export const TOOLBAR_SEND_TO_BACK = [
|
|
61
|
+
'com.labre.toolbar.send-to-back',
|
|
62
|
+
'Send to Back',
|
|
63
|
+
];
|
|
64
|
+
export const TOOLBAR_COPY = ['com.labre.toolbar.copy', 'Copy'];
|
|
65
|
+
export const TOOLBAR_DUPLICATE = [
|
|
66
|
+
'com.labre.toolbar.duplicate',
|
|
67
|
+
'Duplicate',
|
|
68
|
+
];
|
|
69
|
+
export const TOOLBAR_DELETE = [
|
|
70
|
+
'com.labre.toolbar.delete',
|
|
71
|
+
'Delete',
|
|
72
|
+
];
|
|
73
|
+
export const TOOLBAR_LOCK = ['com.labre.toolbar.lock', 'Lock'];
|
|
74
|
+
export const TOOLBAR_MORE = ['com.labre.toolbar.more', 'More'];
|
|
75
|
+
export const TOOLBAR_LINK = ['com.labre.toolbar.link', 'Link'];
|
|
76
|
+
export const TOOLBAR_CREATE_LINKED_DOC = [
|
|
77
|
+
'com.labre.toolbar.create-linked-doc',
|
|
78
|
+
'Create linked doc',
|
|
79
|
+
];
|
|
80
|
+
export const TOOLBAR_DRAW_CONNECTOR = [
|
|
81
|
+
'com.labre.toolbar.draw-connector',
|
|
82
|
+
'Draw connector',
|
|
83
|
+
];
|
|
84
|
+
/**
|
|
85
|
+
* The four wordings of the view switcher — the control that decides whether a
|
|
86
|
+
* link is drawn as words, as a card or as the document itself.
|
|
87
|
+
*
|
|
88
|
+
* One set for every block that offers it (bookmark, attachment, embed, linked
|
|
89
|
+
* doc, synced doc, iframe, the inline link and the inline reference): they are
|
|
90
|
+
* one control with one vocabulary, and a host that had to word "Card view"
|
|
91
|
+
* eight times would end up with eight wordings of it.
|
|
92
|
+
*/
|
|
93
|
+
export const TOOLBAR_SWITCH_VIEW = [
|
|
94
|
+
'com.labre.toolbar.switch-view',
|
|
95
|
+
'Switch view',
|
|
96
|
+
];
|
|
97
|
+
export const TOOLBAR_INLINE_VIEW = [
|
|
98
|
+
'com.labre.toolbar.inline-view',
|
|
99
|
+
'Inline view',
|
|
100
|
+
];
|
|
101
|
+
export const TOOLBAR_CARD_VIEW = [
|
|
102
|
+
'com.labre.toolbar.card-view',
|
|
103
|
+
'Card view',
|
|
104
|
+
];
|
|
105
|
+
export const TOOLBAR_EMBED_VIEW = [
|
|
106
|
+
'com.labre.toolbar.embed-view',
|
|
107
|
+
'Embed view',
|
|
108
|
+
];
|
|
109
|
+
/* ── What a linked-doc card says instead of a preview ─────────────────── */
|
|
110
|
+
/**
|
|
111
|
+
* The four states a linked-doc card can be in with nothing to show: deleted,
|
|
112
|
+
* unreadable, empty, and — for the SYNCED card, which frames a page rather
|
|
113
|
+
* than a doc — empty in its own words.
|
|
114
|
+
*
|
|
115
|
+
* All four and not only the two the recette caught (#183): they are one
|
|
116
|
+
* sentence rendered by one ternary, and translating half of it would leave a
|
|
117
|
+
* card that changes language when the document it points at goes missing.
|
|
118
|
+
*/
|
|
119
|
+
export const LINKED_DOC_DELETED = [
|
|
120
|
+
'com.labre.embed.linked-doc.deleted',
|
|
121
|
+
'This linked doc is deleted.',
|
|
122
|
+
];
|
|
123
|
+
export const LINKED_DOC_FAILED = [
|
|
124
|
+
'com.labre.embed.linked-doc.failed',
|
|
125
|
+
'This linked doc failed to load.',
|
|
126
|
+
];
|
|
127
|
+
export const LINKED_DOC_EMPTY_PREVIEW = [
|
|
128
|
+
'com.labre.embed.linked-doc.empty-preview',
|
|
129
|
+
'Preview of the doc will be displayed here.',
|
|
130
|
+
];
|
|
131
|
+
export const SYNCED_DOC_EMPTY_PREVIEW = [
|
|
132
|
+
'com.labre.embed.synced-doc.empty-preview',
|
|
133
|
+
'Preview of the page will be displayed here.',
|
|
134
|
+
];
|
|
135
|
+
/* ── The board toolbars every framework shares ────────────────────────── */
|
|
136
|
+
/**
|
|
137
|
+
* The resize toggle, which is the one entry EVERY framework board carries —
|
|
138
|
+
* Wardley, BPMN, C4, EDGY, Cynefin, Estuarine and the two DDD boards all
|
|
139
|
+
* register the same always-on button (`docs/adr/0009`: a stored board must stay
|
|
140
|
+
* usable with its framework switched off).
|
|
141
|
+
*
|
|
142
|
+
* Declared here rather than once per framework because it is not a framework's
|
|
143
|
+
* own word: it names a behaviour of the generic frame primitive, and eight
|
|
144
|
+
* copies of it in eight manifests would be eight keys for one tooltip.
|
|
145
|
+
*/
|
|
146
|
+
export const BOARD_RESIZE_TOGGLE = [
|
|
147
|
+
'com.labre.board.toolbar.resize-toggle',
|
|
148
|
+
'Enable / lock resizing',
|
|
149
|
+
];
|
|
150
|
+
/**
|
|
151
|
+
* The legend button, in the two wordings the boards actually use: the notation
|
|
152
|
+
* boards say "notation", Wardley says "components".
|
|
153
|
+
*
|
|
154
|
+
* Two keys and not one interpolated sentence, for the reason the interchange
|
|
155
|
+
* counts already ran on — the seam has no interpolation, so the smallest honest
|
|
156
|
+
* unit is the whole sentence.
|
|
157
|
+
*/
|
|
158
|
+
export const BOARD_LEGEND_NOTATION = [
|
|
159
|
+
'com.labre.board.toolbar.legend',
|
|
160
|
+
'Generate the legend (notation present)',
|
|
161
|
+
];
|
|
162
|
+
export const BOARD_LEGEND_COMPONENTS = [
|
|
163
|
+
'com.labre.board.toolbar.legend.components',
|
|
164
|
+
'Generate the legend (components present)',
|
|
165
|
+
];
|
|
166
|
+
/**
|
|
167
|
+
* Every wording declared above, in declaration order.
|
|
168
|
+
*
|
|
169
|
+
* The manifest (`@labre/affine/translations`) walks this instead of restating
|
|
170
|
+
* the pairs, so a wording added here reaches a host's catalogue with no second
|
|
171
|
+
* edit — the same "declared data, not restated data" rule the roles, the rules
|
|
172
|
+
* and the commands already follow.
|
|
173
|
+
*/
|
|
174
|
+
export const CHROME_WORDINGS = [
|
|
175
|
+
TOAST_COPIED_TO_CLIPBOARD,
|
|
176
|
+
TOAST_LINKED_DOC_CREATED,
|
|
177
|
+
TOAST_NOTE_REMOVED_FROM_PAGE,
|
|
178
|
+
TOAST_FRAME_INSERTED_INTO_PAGE,
|
|
179
|
+
TOAST_NO_LINK_FOUND,
|
|
180
|
+
TOOLBAR_BRING_TO_FRONT,
|
|
181
|
+
TOOLBAR_SEND_TO_BACK,
|
|
182
|
+
TOOLBAR_COPY,
|
|
183
|
+
TOOLBAR_DUPLICATE,
|
|
184
|
+
TOOLBAR_DELETE,
|
|
185
|
+
TOOLBAR_LOCK,
|
|
186
|
+
TOOLBAR_MORE,
|
|
187
|
+
TOOLBAR_LINK,
|
|
188
|
+
TOOLBAR_CREATE_LINKED_DOC,
|
|
189
|
+
TOOLBAR_DRAW_CONNECTOR,
|
|
190
|
+
TOOLBAR_SWITCH_VIEW,
|
|
191
|
+
TOOLBAR_INLINE_VIEW,
|
|
192
|
+
TOOLBAR_CARD_VIEW,
|
|
193
|
+
TOOLBAR_EMBED_VIEW,
|
|
194
|
+
LINKED_DOC_DELETED,
|
|
195
|
+
LINKED_DOC_FAILED,
|
|
196
|
+
LINKED_DOC_EMPTY_PREVIEW,
|
|
197
|
+
SYNCED_DOC_EMPTY_PREVIEW,
|
|
198
|
+
BOARD_RESIZE_TOGGLE,
|
|
199
|
+
BOARD_LEGEND_NOTATION,
|
|
200
|
+
BOARD_LEGEND_COMPONENTS,
|
|
201
|
+
];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BlockStdScope } from '../../../std/index.js';
|
|
2
2
|
import type { ExtensionType } from '../../../store/index.js';
|
|
3
|
+
export * from './chrome.js';
|
|
3
4
|
/**
|
|
4
5
|
* The library holds no prose: every human-readable string it produces —
|
|
5
6
|
* shortcut labels, role names, validation messages — is an i18n KEY
|
|
@@ -95,7 +95,9 @@ export function buildUniverseRegistry(packs) {
|
|
|
95
95
|
const drafts = new Map();
|
|
96
96
|
const frameworks = [];
|
|
97
97
|
let rank = 0;
|
|
98
|
-
const issue = (severity, code, message, id) => issues.push(id === undefined
|
|
98
|
+
const issue = (severity, code, message, id) => issues.push(id === undefined
|
|
99
|
+
? { severity, code, message }
|
|
100
|
+
: { severity, code, id, message });
|
|
99
101
|
for (const pack of packs) {
|
|
100
102
|
if (pack?.formatVersion !== 1) {
|
|
101
103
|
// The WHOLE pack is dropped: a format we do not understand may mean
|
|
@@ -126,7 +128,7 @@ export function buildUniverseRegistry(packs) {
|
|
|
126
128
|
const merged = [...drafts.values()]
|
|
127
129
|
.map(draft => finishDraft(draft))
|
|
128
130
|
.sort((a, b) => (a.order ?? 0) - (b.order ?? 0) ||
|
|
129
|
-
|
|
131
|
+
drafts.get(a.id).rank - drafts.get(b.id).rank ||
|
|
130
132
|
a.id.localeCompare(b.id));
|
|
131
133
|
// Keyed by plain `string`, not by `QualifiedId`: a lookup comes from a
|
|
132
134
|
// DOCUMENT, which may carry any id at all, and the template-literal type is a
|
|
@@ -172,7 +174,7 @@ function mergeTagDef(drafts, def, pack, issue, rank) {
|
|
|
172
174
|
const incomingOpen = def.values === 'open';
|
|
173
175
|
const existingOpen = existing.values === 'open';
|
|
174
176
|
if (incomingOpen !== existingOpen) {
|
|
175
|
-
issue('error', 'duplicate-conflict', `Tag "${def.id}": pack "${pack.packId}" declares ${incomingOpen ?
|
|
177
|
+
issue('error', 'duplicate-conflict', `Tag "${def.id}": pack "${pack.packId}" declares ${incomingOpen ? 'an open value list' : 'a closed value list'} but the opposite was declared first and stands.`, def.id);
|
|
176
178
|
}
|
|
177
179
|
else if (existing.values !== 'open') {
|
|
178
180
|
// Additive: values union by value id, last cosmetic wins.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CodeBlockSchemaExtension, DatabaseBlockSchemaExtension, ImageBlockSchemaExtension, ListBlockSchemaExtension, NoteBlockSchemaExtension, ParagraphBlockSchemaExtension, RootBlockSchemaExtension, } from '../../affine-model/index.js';
|
|
2
2
|
import { Container } from '../../global/di/index.js';
|
|
3
3
|
import { TextSelection } from '../../std/index.js';
|
|
4
|
-
import { Text
|
|
4
|
+
import { Text } from '../../store/index.js';
|
|
5
5
|
import { TestWorkspace } from '../../store/test/index.js';
|
|
6
6
|
import { createTestHost } from './create-test-host.js';
|
|
7
7
|
const DEFAULT_EXTENSIONS = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FrameBlockModel, GroupElementModel } from '../../affine-model/index.js';
|
|
2
|
-
import { deserializeXYWH, getQuadBoundWithRotation
|
|
2
|
+
import { deserializeXYWH, getQuadBoundWithRotation } from '../../global/gfx/index.js';
|
|
3
3
|
export function getSelectedRect(selected) {
|
|
4
4
|
if (selected.length === 0) {
|
|
5
5
|
return new DOMRect();
|
|
@@ -11,12 +11,46 @@ declare global {
|
|
|
11
11
|
showOpenFilePicker?: (options?: OpenFilePickerOptions) => Promise<FileSystemFileHandle[]>;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* One filter a file dialog offers: what to call it, and the MIME types it
|
|
16
|
+
* accepts with the extensions that go with each.
|
|
17
|
+
*
|
|
18
|
+
* The table below is the CLOSED list of filters this library ships. It is not
|
|
19
|
+
* the only source of one: an interchange format declares its own extensions and
|
|
20
|
+
* mime (`docs/adr/0012`), and a picker built from a registry entry cannot be a
|
|
21
|
+
* row in a hand-maintained table — the whole point of the registry is that a
|
|
22
|
+
* framework adds a format without a second file agreeing to it. So the shape is
|
|
23
|
+
* named and {@link openSingleFileWithSpec} takes it directly; `FileTypes` keeps
|
|
24
|
+
* naming the filters that are the editor's own.
|
|
25
|
+
*/
|
|
26
|
+
export interface FilePickerSpec {
|
|
27
|
+
description: string;
|
|
28
|
+
accept: Record<string, string[]>;
|
|
29
|
+
}
|
|
14
30
|
/**
|
|
15
31
|
* See https://web.dev/patterns/files/open-one-or-multiple-files/
|
|
32
|
+
*
|
|
33
|
+
* There is no `'Bpmn'` here any more, and no row for it above. A BPMN document
|
|
34
|
+
* is not the editor's own kind of file: it is one INTERCHANGE FORMAT among the
|
|
35
|
+
* several a framework declares (`docs/adr/0012`), and its filter is built from
|
|
36
|
+
* that declaration by {@link openSingleFileWithSpec}. Keeping a second copy in
|
|
37
|
+
* this table would be a copy nobody reads and everybody has to keep in step —
|
|
38
|
+
* the format's `extensions` and `mime` are the one statement of what a `.bpmn`
|
|
39
|
+
* file is called.
|
|
16
40
|
*/
|
|
17
41
|
type AcceptTypes = 'Any' | 'Images' | 'Videos' | 'Audios' | 'Markdown' | 'Html' | 'Zip' | 'MindMap';
|
|
18
42
|
export declare function openFilesWith(acceptType?: AcceptTypes, multiple?: boolean): Promise<File[] | null>;
|
|
19
43
|
export declare function openSingleFileWith(acceptType?: AcceptTypes): Promise<File | null>;
|
|
44
|
+
/**
|
|
45
|
+
* One file, filtered by a spec the caller built rather than by a name in
|
|
46
|
+
* {@link FileTypes}.
|
|
47
|
+
*
|
|
48
|
+
* What {@link openSingleFileWith} is for the editor's own dialogs, this is for
|
|
49
|
+
* anything whose filter is DECLARED somewhere else — today the interchange
|
|
50
|
+
* registry, whose formats each carry their extensions and their mime and are
|
|
51
|
+
* added by a framework, not by editing the table above.
|
|
52
|
+
*/
|
|
53
|
+
export declare function openSingleFileWithSpec(spec: FilePickerSpec): Promise<File | null>;
|
|
20
54
|
export declare function getImageFilesFromLocal(): Promise<File[]>;
|
|
21
55
|
export declare function downloadBlob(blob: Blob, name: string): void;
|
|
22
56
|
/**
|