@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
|
@@ -20,9 +20,11 @@ export declare class OpenDocDropdownMenu extends OpenDocDropdownMenu_base {
|
|
|
20
20
|
priority?: number;
|
|
21
21
|
} & {
|
|
22
22
|
label?: string;
|
|
23
|
+
labelWording?: import("../../affine-shared/services/index.js").ChromeWording;
|
|
23
24
|
showLabel?: boolean;
|
|
24
25
|
icon?: import("lit-html").TemplateResult;
|
|
25
26
|
tooltip?: string | import("lit-html").TemplateResult;
|
|
27
|
+
tooltipWording?: import("../../affine-shared/services/index.js").ChromeWording;
|
|
26
28
|
variant?: "destructive";
|
|
27
29
|
disabled?: ((cx: ToolbarContext) => boolean) | boolean;
|
|
28
30
|
content?: ((cx: ToolbarContext) => import("lit-html").TemplateResult | null) | (import("lit-html").TemplateResult | null);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NoteBlockModel } from '../../affine-model/index.js';
|
|
2
2
|
import { DocModeProvider } from '../../affine-shared/services/index.js';
|
|
3
3
|
import { isInsideEdgelessEditor, matchModels, } from '../../affine-shared/utils/index.js';
|
|
4
|
-
import { GfxBlockElementModel, GfxControllerIdentifier
|
|
4
|
+
import { GfxBlockElementModel, GfxControllerIdentifier } from '../../std/gfx/index.js';
|
|
5
5
|
import { PeekableController } from './controller.js';
|
|
6
6
|
const symbol = Symbol('peekable');
|
|
7
7
|
export const isPeekable = (e) => {
|
|
@@ -63,6 +63,8 @@ export class ResourceController {
|
|
|
63
63
|
updateState(state) {
|
|
64
64
|
this.state$.value = { ...this.state$.value, ...state };
|
|
65
65
|
}
|
|
66
|
+
// The explicit return type keeps declaration emit off signals-core's
|
|
67
|
+
// `DisposeFn`, whose `[Symbol.dispose]` member tsc cannot serialize.
|
|
66
68
|
subscribe() {
|
|
67
69
|
return effect(() => {
|
|
68
70
|
const blobId = this.blobId$.value;
|
|
@@ -3,6 +3,7 @@ export { ToolbarMoreMenuConfigExtension } from './config.js';
|
|
|
3
3
|
export { EditorIconButton } from './icon-button.js';
|
|
4
4
|
export { EditorMenuAction, EditorMenuButton, EditorMenuContent, } from './menu-button.js';
|
|
5
5
|
export { MenuContext } from './menu-context.js';
|
|
6
|
+
export { type PickerMenu, type PickerMenuItem, renderCurrentPickerItemWith, renderPickerMenu, renderPickerMenuItems, } from './picker-menu.js';
|
|
6
7
|
export { EditorToolbarSeparator } from './separator.js';
|
|
7
8
|
export { darkToolbarStyles, lightToolbarStyles } from './styles.js';
|
|
8
9
|
export { EditorToolbar } from './toolbar.js';
|
|
@@ -8,6 +8,7 @@ export { ToolbarMoreMenuConfigExtension } from './config.js';
|
|
|
8
8
|
export { EditorIconButton } from './icon-button.js';
|
|
9
9
|
export { EditorMenuAction, EditorMenuButton, EditorMenuContent, } from './menu-button.js';
|
|
10
10
|
export { MenuContext } from './menu-context.js';
|
|
11
|
+
export { renderCurrentPickerItemWith, renderPickerMenu, renderPickerMenuItems, } from './picker-menu.js';
|
|
11
12
|
export { EditorToolbarSeparator } from './separator.js';
|
|
12
13
|
export { darkToolbarStyles, lightToolbarStyles } from './styles.js';
|
|
13
14
|
export { EditorToolbar } from './toolbar.js';
|
|
@@ -32,7 +32,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
32
32
|
}
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
|
-
import { panelBaseStyle, scrollbarStyle
|
|
35
|
+
import { panelBaseStyle, scrollbarStyle } from '../../affine-shared/styles/index.js';
|
|
36
36
|
import { createButtonPopper, } from '../../affine-shared/utils/index.js';
|
|
37
37
|
import { WithDisposable } from '../../global/lit/index.js';
|
|
38
38
|
import { css, html, LitElement, } from 'lit';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* The **one-of-many picker** every toolbar in this editor uses: a chevron
|
|
4
|
+
* button that opens a row of icons, one of which is lit because it is what the
|
|
5
|
+
* selection currently is.
|
|
6
|
+
*
|
|
7
|
+
* "Switch shape type" is the one everybody knows; the framework morph dropdown
|
|
8
|
+
* is the same object. It lives HERE, in the shared component package, and not
|
|
9
|
+
* where it was first written (`@labre/affine-widget-edgeless-toolbar`) for a
|
|
10
|
+
* dependency reason that is not going away: that widget package depends on
|
|
11
|
+
* `@labre/affine-block-surface`, so nothing in the surface package — which is
|
|
12
|
+
* where the generic, framework-parameterized toolbar modules live — can import
|
|
13
|
+
* from it without closing a cycle. This package is below both, which is why the
|
|
14
|
+
* toolbar's buttons, its menu shells and its chevron already live here.
|
|
15
|
+
*
|
|
16
|
+
* The edgeless-toolbar copy is deliberately untouched by the change that added
|
|
17
|
+
* this file: it is what the shape toolbar and its neighbours already call, and
|
|
18
|
+
* collapsing the two is a follow-up whose blast radius is every shape entry in
|
|
19
|
+
* the editor rather than one new dropdown. Until then the two are the same
|
|
20
|
+
* markup twice — knowingly, and named here so the follow-up is findable.
|
|
21
|
+
*
|
|
22
|
+
* ## Names
|
|
23
|
+
*
|
|
24
|
+
* `PickerMenu` / `PickerMenuItem` rather than `Menu` / `MenuItem`: this package
|
|
25
|
+
* already exports a `MenuItem`, and it is a different thing entirely (a line in
|
|
26
|
+
* the "⋮" overflow menu, with a label and an action). Two types called
|
|
27
|
+
* `MenuItem` in one entry point is a trap, not a convenience.
|
|
28
|
+
*/
|
|
29
|
+
/** One option: what it is worth, what it looks like, what it is called. */
|
|
30
|
+
export type PickerMenuItem<T> = {
|
|
31
|
+
/** Tooltip and accessible name. */
|
|
32
|
+
key?: string;
|
|
33
|
+
value: T;
|
|
34
|
+
icon?: TemplateResult;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
};
|
|
37
|
+
export type PickerMenu<T> = {
|
|
38
|
+
label: string;
|
|
39
|
+
icon?: TemplateResult;
|
|
40
|
+
tooltip?: string;
|
|
41
|
+
items: PickerMenuItem<T>[];
|
|
42
|
+
currentValue: T;
|
|
43
|
+
onPick: (value: T) => void;
|
|
44
|
+
/**
|
|
45
|
+
* `data-testid` for the host element and, suffixed with `-option`, for each
|
|
46
|
+
* line. Optional: the shape toolbar's picker has never needed one, and a
|
|
47
|
+
* framework module that wants to be reachable from an integration spec says
|
|
48
|
+
* so rather than making every caller carry an attribute it does not use.
|
|
49
|
+
*/
|
|
50
|
+
testId?: string;
|
|
51
|
+
};
|
|
52
|
+
/** The field of the item that currently matches — its icon, usually. */
|
|
53
|
+
export declare function renderCurrentPickerItemWith<T, F extends keyof PickerMenuItem<T>>(items: PickerMenuItem<T>[], currentValue: T, field: F): PickerMenuItem<T>[F] | undefined;
|
|
54
|
+
export declare function renderPickerMenu<T>({ label, tooltip, icon, items, currentValue, onPick, testId, }: PickerMenu<T>): TemplateResult<1>;
|
|
55
|
+
export declare function renderPickerMenuItems<T>(items: PickerMenuItem<T>[], currentValue: T, onPick: (value: T) => void, testId?: string): unknown;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
3
|
+
import { repeat } from 'lit/directives/repeat.js';
|
|
4
|
+
import { EditorChevronDown } from './chevron-down.js';
|
|
5
|
+
/** The field of the item that currently matches — its icon, usually. */
|
|
6
|
+
export function renderCurrentPickerItemWith(items, currentValue, field) {
|
|
7
|
+
return items.find(({ value }) => value === currentValue)?.[field];
|
|
8
|
+
}
|
|
9
|
+
export function renderPickerMenu({ label, tooltip, icon, items, currentValue, onPick, testId, }) {
|
|
10
|
+
return html `
|
|
11
|
+
<editor-menu-button
|
|
12
|
+
data-testid=${ifDefined(testId)}
|
|
13
|
+
aria-label="${`${label.toLowerCase()}-menu`}"
|
|
14
|
+
.button=${html `
|
|
15
|
+
<editor-icon-button
|
|
16
|
+
data-testid=${ifDefined(testId ? `${testId}-button` : undefined)}
|
|
17
|
+
aria-label="${label}"
|
|
18
|
+
.tooltip="${tooltip ?? label}"
|
|
19
|
+
>
|
|
20
|
+
${icon ?? renderCurrentPickerItemWith(items, currentValue, 'icon')}
|
|
21
|
+
${EditorChevronDown}
|
|
22
|
+
</editor-icon-button>
|
|
23
|
+
`}
|
|
24
|
+
>
|
|
25
|
+
${renderPickerMenuItems(items, currentValue, onPick, testId)}
|
|
26
|
+
</editor-menu-button>
|
|
27
|
+
`;
|
|
28
|
+
}
|
|
29
|
+
export function renderPickerMenuItems(items, currentValue, onPick, testId) {
|
|
30
|
+
// Keyed by `value`: the option list is rebuilt on every selection change, and
|
|
31
|
+
// an unkeyed repeat would recycle one kind's button into another's rather
|
|
32
|
+
// than moving it — which is what makes an icon and its tooltip disagree.
|
|
33
|
+
return repeat(items, item => item.value, ({ key, value, icon, disabled }) => html `
|
|
34
|
+
<editor-icon-button
|
|
35
|
+
data-testid=${ifDefined(testId ? `${testId}-option` : undefined)}
|
|
36
|
+
data-value=${ifDefined(typeof value === 'string' ? value : undefined)}
|
|
37
|
+
aria-label="${ifDefined(key)}"
|
|
38
|
+
.disabled=${ifDefined(disabled)}
|
|
39
|
+
.tooltip="${ifDefined(key)}"
|
|
40
|
+
.active="${currentValue === value}"
|
|
41
|
+
.activeMode="${'background'}"
|
|
42
|
+
@click=${() => onPick(value)}
|
|
43
|
+
>
|
|
44
|
+
${icon}
|
|
45
|
+
</editor-icon-button>
|
|
46
|
+
`);
|
|
47
|
+
}
|
|
@@ -32,7 +32,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
32
32
|
}
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
|
-
import { ToolbarContext, } from '../../affine-shared/services/index.js';
|
|
35
|
+
import { TOOLBAR_SWITCH_VIEW, toolbarActionLabel, ToolbarContext, translateKey, } from '../../affine-shared/services/index.js';
|
|
36
36
|
import { SignalWatcher } from '../../global/lit/index.js';
|
|
37
37
|
import { PropTypes, requiredProperties } from '../../std/index.js';
|
|
38
38
|
import { LitElement } from 'lit';
|
|
@@ -86,13 +86,20 @@ let ViewDropdownMenu = (() => {
|
|
|
86
86
|
set viewType$(value) { this.#viewType$_accessor_storage = value; }
|
|
87
87
|
render() {
|
|
88
88
|
const { actions, context, viewType$: { value: viewType }, } = this;
|
|
89
|
+
// These entries never went through `combine` — the group that owns them
|
|
90
|
+
// brings its own template and hands them over raw — so the i18n seam is
|
|
91
|
+
// applied here, with the same key the row would have used. `viewType` is
|
|
92
|
+
// resolved by the caller through the very same wordings, which is what
|
|
93
|
+
// keeps the "currently selected" comparison below a comparison of words.
|
|
94
|
+
const wordOf = (action) => toolbarActionLabel(context.std, action);
|
|
95
|
+
const switchView = translateKey(context.std, ...TOOLBAR_SWITCH_VIEW);
|
|
89
96
|
return html `
|
|
90
97
|
<editor-menu-button
|
|
91
98
|
.contentPadding="${'8px'}"
|
|
92
99
|
.button=${html `
|
|
93
100
|
<editor-icon-button
|
|
94
|
-
aria-label
|
|
95
|
-
.tooltip="${
|
|
101
|
+
aria-label=${switchView}
|
|
102
|
+
.tooltip="${switchView}"
|
|
96
103
|
.justify="${'space-between'}"
|
|
97
104
|
.labelHeight="${'20px'}"
|
|
98
105
|
.iconContainerWidth="${'110px'}"
|
|
@@ -107,17 +114,23 @@ let ViewDropdownMenu = (() => {
|
|
|
107
114
|
if (typeof action.when === 'function')
|
|
108
115
|
return action.when(context);
|
|
109
116
|
return action.when ?? true;
|
|
110
|
-
}), action => action.id,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
}), action => action.id, action => {
|
|
118
|
+
const { id, disabled, run } = action;
|
|
119
|
+
const label = wordOf(action);
|
|
120
|
+
return html `
|
|
121
|
+
<editor-menu-action
|
|
122
|
+
aria-label="${ifDefined(label)}"
|
|
123
|
+
data-testid="${`link-to-${id}`}"
|
|
124
|
+
?data-selected="${label === viewType}"
|
|
125
|
+
?disabled="${ifDefined(typeof disabled === 'function'
|
|
126
|
+
? disabled(context)
|
|
127
|
+
: disabled)}"
|
|
128
|
+
@click=${() => run?.(context)}
|
|
129
|
+
>
|
|
130
|
+
${label}
|
|
131
|
+
</editor-menu-action>
|
|
132
|
+
`;
|
|
133
|
+
})}
|
|
121
134
|
</div>
|
|
122
135
|
</editor-menu-button>
|
|
123
136
|
`;
|
|
@@ -33,12 +33,12 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
35
|
import { EdgelessFrameManager } from '../../affine-block-frame/index.js';
|
|
36
|
-
import { DocModeProvider, EditPropsStore
|
|
36
|
+
import { DocModeProvider, EditPropsStore } from '../../affine-shared/services/index.js';
|
|
37
37
|
import { DisposableGroup } from '../../global/disposable/index.js';
|
|
38
38
|
import { Bound } from '../../global/gfx/index.js';
|
|
39
39
|
import { SignalWatcher, WithDisposable } from '../../global/lit/index.js';
|
|
40
40
|
import { ShadowlessElement } from '../../std/index.js';
|
|
41
|
-
import { generateKeyBetweenV2, GfxControllerIdentifier
|
|
41
|
+
import { generateKeyBetweenV2, GfxControllerIdentifier } from '../../std/gfx/index.js';
|
|
42
42
|
import { css, html, nothing } from 'lit';
|
|
43
43
|
import { property, query, state } from 'lit/decorators.js';
|
|
44
44
|
import { keyed } from 'lit/directives/keyed.js';
|
|
@@ -32,9 +32,9 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
32
32
|
}
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
|
-
import { PresentTool
|
|
35
|
+
import { PresentTool } from '../../affine-block-frame/index.js';
|
|
36
36
|
import { EdgelessLegacySlotIdentifier } from '../../affine-block-surface/index.js';
|
|
37
|
-
import { DocModeProvider, EditPropsStore
|
|
37
|
+
import { DocModeProvider, EditPropsStore } from '../../affine-shared/services/index.js';
|
|
38
38
|
import { createButtonPopper } from '../../affine-shared/utils/index.js';
|
|
39
39
|
import { DisposableGroup } from '../../global/disposable/index.js';
|
|
40
40
|
import { WithDisposable } from '../../global/lit/index.js';
|
|
@@ -33,7 +33,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
35
|
import { EdgelessLegacySlotIdentifier } from '../../affine-block-surface/index.js';
|
|
36
|
-
import { DocModeProvider, EditPropsStore
|
|
36
|
+
import { DocModeProvider, EditPropsStore } from '../../affine-shared/services/index.js';
|
|
37
37
|
import { WithDisposable } from '../../global/lit/index.js';
|
|
38
38
|
import { css, html, LitElement } from 'lit';
|
|
39
39
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -37,7 +37,7 @@ import { DocModeProvider } from '../affine-shared/services/index.js';
|
|
|
37
37
|
import { unsafeCSSVarV2 } from '../affine-shared/theme/index.js';
|
|
38
38
|
import { matchModels } from '../affine-shared/utils/index.js';
|
|
39
39
|
import { SignalWatcher, WithDisposable } from '../global/lit/index.js';
|
|
40
|
-
import { PropTypes, requiredProperties
|
|
40
|
+
import { PropTypes, requiredProperties } from '../std/index.js';
|
|
41
41
|
import { signal } from '@preact/signals-core';
|
|
42
42
|
import { css, html, LitElement, nothing } from 'lit';
|
|
43
43
|
import { property } from 'lit/decorators.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { keepColor } from '../../../../affine-components/color-picker/index.js';
|
|
2
|
-
import { EditPropsStore, ThemeProvider
|
|
2
|
+
import { EditPropsStore, ThemeProvider } from '../../../../affine-shared/services/index.js';
|
|
3
3
|
import { EdgelessToolbarToolMixin } from '../../../../affine-widget-edgeless-toolbar/index.js';
|
|
4
4
|
import { SignalWatcher } from '../../../../global/lit/index.js';
|
|
5
5
|
import { computed, signal } from '@preact/signals-core';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AStarRunner, Overlay } from '../affine-block-surface/index.js';
|
|
2
2
|
import { ConnectorElementModel, ConnectorMode, DEFAULT_POLYGON_VERTICES, GroupElementModel, ShapeElementModel, ShapeType, } from '../affine-model/index.js';
|
|
3
|
-
import { EditPropsStore, ThemeProvider
|
|
3
|
+
import { EditPropsStore, ThemeProvider } from '../affine-shared/services/index.js';
|
|
4
4
|
import { BlockSuiteError } from '../global/exceptions/index.js';
|
|
5
5
|
import { almostEqual, Bound, getBezierCurveBoundingBox, getBezierParameters, getBoundFromPoints, getBoundWithRotation, getPointFromBoundsWithRotation, isOverlap, isVecZero, lineIntersects, PI2, PointLocation, polygonCentroid, sign, toRadian, Vec, } from '../global/gfx/index.js';
|
|
6
6
|
import { assertType } from '../global/utils/index.js';
|
|
@@ -212,11 +212,12 @@ export function getAnchors(ele, includeCenterAnchor = true) {
|
|
|
212
212
|
// getLineIntersections.
|
|
213
213
|
if (ele.centerAnchorOnly) {
|
|
214
214
|
const centerPoint = getPointFromBoundsWithRotation({ ...bound, rotate }, bound.center);
|
|
215
|
-
return [
|
|
215
|
+
return [
|
|
216
|
+
{ point: new PointLocation(centerPoint), coord: [0.5, 0.5] },
|
|
217
|
+
];
|
|
216
218
|
}
|
|
217
219
|
// For polygon shapes, generate anchors at each vertex and edge midpoint
|
|
218
|
-
if (ele instanceof ShapeElementModel &&
|
|
219
|
-
ele.shapeType === ShapeType.Polygon) {
|
|
220
|
+
if (ele instanceof ShapeElementModel && ele.shapeType === ShapeType.Polygon) {
|
|
220
221
|
const verts = ele.vertices ?? DEFAULT_POLYGON_VERTICES;
|
|
221
222
|
for (let i = 0; i < verts.length; i++) {
|
|
222
223
|
const curr = verts[i];
|
|
@@ -240,10 +241,7 @@ export function getAnchors(ele, includeCenterAnchor = true) {
|
|
|
240
241
|
coord: vertCoord,
|
|
241
242
|
});
|
|
242
243
|
// --- Edge midpoint anchor ---
|
|
243
|
-
const midCoord = [
|
|
244
|
-
(curr[0] + next[0]) / 2,
|
|
245
|
-
(curr[1] + next[1]) / 2,
|
|
246
|
-
];
|
|
244
|
+
const midCoord = [(curr[0] + next[0]) / 2, (curr[1] + next[1]) / 2];
|
|
247
245
|
const midAbs = [
|
|
248
246
|
bound.x + midCoord[0] * bound.w,
|
|
249
247
|
bound.y + midCoord[1] * bound.h,
|
|
@@ -1241,8 +1239,7 @@ export class ConnectorPathGenerator extends PathGenerator {
|
|
|
1241
1239
|
_isPointAtShapeCenter(connectable, point) {
|
|
1242
1240
|
const bound = Bound.deserialize(connectable.xywh);
|
|
1243
1241
|
const center = getPointFromBoundsWithRotation({ ...bound, rotate: connectable.rotate }, bound.center);
|
|
1244
|
-
return (almostEqual(point[0], center[0], 1) &&
|
|
1245
|
-
almostEqual(point[1], center[1], 1));
|
|
1242
|
+
return (almostEqual(point[0], center[0], 1) && almostEqual(point[1], center[1], 1));
|
|
1246
1243
|
}
|
|
1247
1244
|
_getConnectionPoint(connector, type) {
|
|
1248
1245
|
const connection = connector[type];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConnectorMode } from '../affine-model/index.js';
|
|
1
|
+
import { type ConnectorElementProps, ConnectorMode } from '../affine-model/index.js';
|
|
2
2
|
import type { IVec } from '../global/gfx/index.js';
|
|
3
3
|
import type { PointerEventState } from '../std/index.js';
|
|
4
4
|
import { BaseTool, type GfxModel } from '../std/gfx/index.js';
|
|
@@ -11,6 +11,24 @@ export type ConnectorToolOptions = {
|
|
|
11
11
|
* the edge then stays neutral and no `role` key is written.
|
|
12
12
|
*/
|
|
13
13
|
role?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The FIVE stroke-and-marker props a framework toolbox arms its flow with
|
|
16
|
+
* (e.g. solid + filled triangle for a BPMN sequence flow) — the ones the
|
|
17
|
+
* stencils actually distinguish each other by. Applied at creation only,
|
|
18
|
+
* where explicit props win over the user's last plain-connector props, and
|
|
19
|
+
* NEVER recorded into `EditPropsStore`: arming a typed flow must not restyle
|
|
20
|
+
* the plain connector tool (BPMN 2.0 p.40 — other connectors must not adopt
|
|
21
|
+
* a flow's line style). Left out for the plain tool, which keeps drawing
|
|
22
|
+
* with the user's own last props.
|
|
23
|
+
*
|
|
24
|
+
* Deliberately NOT the whole look: a connector's other styled props —
|
|
25
|
+
* `rough`, `labelStyle` and the rest — are outside this bag and still come
|
|
26
|
+
* from the user's last plain-connector props, exactly as they did before
|
|
27
|
+
* this option existed. No framework declares them today, so nothing is lost;
|
|
28
|
+
* a framework that needs one must widen this `Pick` rather than reach for
|
|
29
|
+
* the store.
|
|
30
|
+
*/
|
|
31
|
+
style?: Partial<Pick<ConnectorElementProps, 'stroke' | 'strokeStyle' | 'strokeWidth' | 'frontEndpointStyle' | 'rearEndpointStyle'>>;
|
|
14
32
|
};
|
|
15
33
|
export declare class ConnectorTool extends BaseTool<ConnectorToolOptions> {
|
|
16
34
|
static toolName: string;
|
|
@@ -36,6 +36,10 @@ export class ConnectorTool extends BaseTool {
|
|
|
36
36
|
this.doc.captureSync();
|
|
37
37
|
const id = this.gfx.surface.addElement({
|
|
38
38
|
type: CanvasElementType.CONNECTOR,
|
|
39
|
+
// The activation's own style, if any: explicit props win over the
|
|
40
|
+
// user's last plain-connector props in the edit-props middleware, so a
|
|
41
|
+
// framework look never passes through the shared store.
|
|
42
|
+
...this.activatedOption.style,
|
|
39
43
|
mode: this.activatedOption.mode,
|
|
40
44
|
// `undefined` writes nothing: a neutral edge keeps no `role` key.
|
|
41
45
|
role: this.activatedOption.role,
|
|
@@ -160,7 +164,9 @@ export class ConnectorTool extends BaseTool {
|
|
|
160
164
|
}
|
|
161
165
|
// Geometric centroid as a center anchor (gated on the global toggle),
|
|
162
166
|
// mirroring the center anchor offered for other shape types.
|
|
163
|
-
const centerAnchorEnabled = this.std
|
|
167
|
+
const centerAnchorEnabled = this.std
|
|
168
|
+
.getOptional(EditPropsStore)
|
|
169
|
+
?.getStorage('connectorCenterAnchor') ?? true;
|
|
164
170
|
if (centerAnchorEnabled) {
|
|
165
171
|
locations.push(polygonCentroid(verts));
|
|
166
172
|
}
|
|
@@ -171,7 +177,9 @@ export class ConnectorTool extends BaseTool {
|
|
|
171
177
|
this._sourceLocations = [[0.5, 0.5]];
|
|
172
178
|
}
|
|
173
179
|
else {
|
|
174
|
-
const centerAnchorEnabled = this.std
|
|
180
|
+
const centerAnchorEnabled = this.std
|
|
181
|
+
.getOptional(EditPropsStore)
|
|
182
|
+
?.getStorage('connectorCenterAnchor') ?? true;
|
|
175
183
|
this._sourceLocations =
|
|
176
184
|
element instanceof ShapeElementModel &&
|
|
177
185
|
element.shapeType === ShapeType.Triangle
|
|
@@ -39,10 +39,7 @@ function reanchorConnectorsForPolygon(surface, polygonId, elementGetter) {
|
|
|
39
39
|
continue;
|
|
40
40
|
// Convert the stored normalized [0-1] position to absolute model coords.
|
|
41
41
|
const [nx, ny] = connection.position;
|
|
42
|
-
const absPos = [
|
|
43
|
-
bound.x + nx * bound.w,
|
|
44
|
-
bound.y + ny * bound.h,
|
|
45
|
-
];
|
|
42
|
+
const absPos = [bound.x + nx * bound.w, bound.y + ny * bound.h];
|
|
46
43
|
// Find the nearest anchor on the updated polygon boundary.
|
|
47
44
|
let nearestCoord = connection.position;
|
|
48
45
|
let minDist = Infinity;
|
|
@@ -273,7 +273,8 @@ export class EdgeDirectionManager extends InteractivityExtension {
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
const current = this.revealed$.peek();
|
|
276
|
-
if (ids.length === current.length &&
|
|
276
|
+
if (ids.length === current.length &&
|
|
277
|
+
ids.every((id, i) => id === current[i])) {
|
|
277
278
|
return;
|
|
278
279
|
}
|
|
279
280
|
this.revealed$.value = ids;
|
|
@@ -168,9 +168,7 @@ const invertEdgeDirection = {
|
|
|
168
168
|
std.getOptional(TelemetryProvider)?.track('EdgeDirectionInverted', {
|
|
169
169
|
page: 'whiteboard editor',
|
|
170
170
|
...(role !== undefined ? { role } : {}),
|
|
171
|
-
...(role !== undefined
|
|
172
|
-
? { framework: role.split(':')[0] }
|
|
173
|
-
: {}),
|
|
171
|
+
...(role !== undefined ? { framework: role.split(':')[0] } : {}),
|
|
174
172
|
elementCount: edges.length,
|
|
175
173
|
control: invocation.source,
|
|
176
174
|
module: invocation.surface,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ElementRendererExtension, } from '../../affine-block-surface/index.js';
|
|
2
2
|
import { getFontString, getLineHeight, getTextWidth, isRTL, wrapTextDeltas, } from '../../affine-gfx-text/index.js';
|
|
3
3
|
import { ConnectorMode, DefaultTheme, } from '../../affine-model/index.js';
|
|
4
|
-
import { getBezierParameters
|
|
4
|
+
import { getBezierParameters } from '../../global/gfx/index.js';
|
|
5
5
|
import { deltaInsertsToChunks } from '../../std/inline/index.js';
|
|
6
6
|
import { isConnectorWithLabel } from '../connector-manager.js';
|
|
7
7
|
import { DEFAULT_ARROW_SIZE, getArrowOptions, renderArrow, renderCircle, renderDiamond, renderTriangle, } from './utils.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConnectorMode, } from '../../affine-model/index.js';
|
|
2
|
-
import { getBezierParameters, getBezierTangent, Vec
|
|
2
|
+
import { getBezierParameters, getBezierTangent, Vec } from '../../global/gfx/index.js';
|
|
3
3
|
export const DEFAULT_ARROW_SIZE = 15;
|
|
4
4
|
export function getArrowPoints(points, size = 10, mode, bezierParameters, endPoint = 'Rear', radians = Math.PI / 4) {
|
|
5
5
|
const anchorPoint = getPointWithTangent(points, mode, endPoint, bezierParameters);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EdgelessCRUDIdentifier } from '../../affine-block-surface/index.js';
|
|
2
2
|
import { packColor, } from '../../affine-components/color-picker/index.js';
|
|
3
|
-
import { createTextActions, normalizeTextBound
|
|
3
|
+
import { createTextActions, normalizeTextBound } from '../../affine-gfx-text/index.js';
|
|
4
4
|
import { ConnectorElementModel, ConnectorMode, DEFAULT_FRONT_ENDPOINT_STYLE, DEFAULT_REAR_ENDPOINT_STYLE, DefaultTheme, LineWidth, PointStyle, resolveColor, StrokeStyle, } from '../../affine-model/index.js';
|
|
5
5
|
import { ToolbarModuleExtension, } from '../../affine-shared/services/index.js';
|
|
6
6
|
import { getMostCommonResolvedValue, getMostCommonValue, } from '../../affine-shared/utils/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElementToMarkdownAdapterExtension } from '../../../affine-block-surface/index.js';
|
|
2
2
|
import { getShapeText } from '../../../affine-gfx-shape/index.js';
|
|
3
|
-
import { buildMindMapTree
|
|
3
|
+
import { buildMindMapTree } from '../../../affine-model/index.js';
|
|
4
4
|
export const mindmapToMarkdownAdapterMatcher = ElementToMarkdownAdapterExtension({
|
|
5
5
|
name: 'mindmap',
|
|
6
6
|
match: elementModel => elementModel.type === 'mindmap',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getShapeText } from '../../affine-gfx-shape/index.js';
|
|
2
|
-
import { buildMindMapTree
|
|
2
|
+
import { buildMindMapTree } from '../../affine-model/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* traverse the mindMapTree and construct the content string
|
|
5
5
|
* like:
|