@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toast } from '../../../affine-components/toast/index.js';
|
|
2
|
-
import { ActionPlacement, EmbedIframeService, EmbedOptionProvider, } from '../../../affine-shared/services/index.js';
|
|
2
|
+
import { ActionPlacement, EmbedIframeService, EmbedOptionProvider, TOOLBAR_CARD_VIEW, TOOLBAR_DELETE, TOOLBAR_EMBED_VIEW, TOOLBAR_INLINE_VIEW, toolbarActionLabel, } from '../../../affine-shared/services/index.js';
|
|
3
3
|
import { CopyIcon, DeleteIcon, EditIcon, UnlinkIcon, } from '@blocksuite/icons/lit';
|
|
4
4
|
import { BlockSelection } from '../../../std/index.js';
|
|
5
5
|
import { signal } from '@preact/signals-core';
|
|
@@ -79,12 +79,12 @@ export const builtinInlineLinkToolbarConfig = {
|
|
|
79
79
|
actions: [
|
|
80
80
|
{
|
|
81
81
|
id: 'inline',
|
|
82
|
-
|
|
82
|
+
labelWording: TOOLBAR_INLINE_VIEW,
|
|
83
83
|
disabled: true,
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
id: 'card',
|
|
87
|
-
|
|
87
|
+
labelWording: TOOLBAR_CARD_VIEW,
|
|
88
88
|
run(ctx) {
|
|
89
89
|
const target = ctx.message$.peek()?.element;
|
|
90
90
|
if (!(target instanceof AffineLink))
|
|
@@ -133,7 +133,7 @@ export const builtinInlineLinkToolbarConfig = {
|
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
id: 'embed',
|
|
136
|
-
|
|
136
|
+
labelWording: TOOLBAR_EMBED_VIEW,
|
|
137
137
|
when(ctx) {
|
|
138
138
|
const target = ctx.message$.peek()?.element;
|
|
139
139
|
if (!(target instanceof AffineLink))
|
|
@@ -210,7 +210,7 @@ export const builtinInlineLinkToolbarConfig = {
|
|
|
210
210
|
if (!(target instanceof AffineLink))
|
|
211
211
|
return null;
|
|
212
212
|
const actions = this.actions.map(action => ({ ...action }));
|
|
213
|
-
const viewType$ = signal(actions[0]
|
|
213
|
+
const viewType$ = signal(toolbarActionLabel(ctx.std, actions[0]));
|
|
214
214
|
const onToggle = (e) => {
|
|
215
215
|
const opened = e.detail;
|
|
216
216
|
if (!opened)
|
|
@@ -280,7 +280,7 @@ export const builtinInlineLinkToolbarConfig = {
|
|
|
280
280
|
{
|
|
281
281
|
placement: ActionPlacement.More,
|
|
282
282
|
id: 'c.delete',
|
|
283
|
-
|
|
283
|
+
labelWording: TOOLBAR_DELETE,
|
|
284
284
|
icon: DeleteIcon(),
|
|
285
285
|
variant: 'destructive',
|
|
286
286
|
run(ctx) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getSelectedBlocksCommand } from '../../affine-shared/commands/index.js';
|
|
2
|
-
import { INLINE_ROOT_ATTR
|
|
2
|
+
import { INLINE_ROOT_ATTR } from '../../std/inline/index.js';
|
|
3
3
|
import { FORMAT_BLOCK_SUPPORT_FLAVOURS } from './consts.js';
|
|
4
4
|
// for block selection
|
|
5
5
|
export const formatBlockCommand = (ctx, next) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BLOCK_ID_ATTR
|
|
2
|
-
import { INLINE_ROOT_ATTR
|
|
1
|
+
import { BLOCK_ID_ATTR } from '../../std/index.js';
|
|
2
|
+
import { INLINE_ROOT_ATTR } from '../../std/inline/index.js';
|
|
3
3
|
import { FORMAT_NATIVE_SUPPORT_FLAVOURS } from './consts.js';
|
|
4
4
|
// for native range
|
|
5
5
|
export const formatNativeCommand = (ctx, next) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { clearMarksOnDiscontinuousInput } from '../../affine-rich-text/index.js';
|
|
2
2
|
import { getSelectedBlocksCommand } from '../../affine-shared/commands/index.js';
|
|
3
|
-
import { INLINE_ROOT_ATTR
|
|
3
|
+
import { INLINE_ROOT_ATTR } from '../../std/inline/index.js';
|
|
4
4
|
import { FORMAT_TEXT_SUPPORT_FLAVOURS } from './consts.js';
|
|
5
5
|
// for text selection
|
|
6
6
|
export const formatTextCommand = (ctx, next) => {
|
|
@@ -7,17 +7,17 @@ export declare const builtinInlineReferenceToolbarConfig: {
|
|
|
7
7
|
id: string;
|
|
8
8
|
actions: ({
|
|
9
9
|
id: string;
|
|
10
|
-
|
|
10
|
+
labelWording: import("../../../affine-shared/services/index.js").ChromeWording;
|
|
11
11
|
disabled: true;
|
|
12
12
|
run?: undefined;
|
|
13
13
|
} | {
|
|
14
14
|
id: string;
|
|
15
|
-
|
|
15
|
+
labelWording: import("../../../affine-shared/services/index.js").ChromeWording;
|
|
16
16
|
run(ctx: import("../../../affine-shared/services/index.js").ToolbarContext): void;
|
|
17
17
|
disabled?: undefined;
|
|
18
18
|
} | {
|
|
19
19
|
id: string;
|
|
20
|
-
|
|
20
|
+
labelWording: import("../../../affine-shared/services/index.js").ChromeWording;
|
|
21
21
|
disabled(ctx: import("../../../affine-shared/services/index.js").ToolbarContext): boolean;
|
|
22
22
|
run(ctx: import("../../../affine-shared/services/index.js").ToolbarContext): void;
|
|
23
23
|
})[];
|
|
@@ -26,7 +26,7 @@ export declare const builtinInlineReferenceToolbarConfig: {
|
|
|
26
26
|
}, {
|
|
27
27
|
readonly placement: ActionPlacement.More;
|
|
28
28
|
readonly id: "c.delete";
|
|
29
|
-
readonly
|
|
29
|
+
readonly labelWording: import("../../../affine-shared/services/index.js").ChromeWording;
|
|
30
30
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
31
31
|
readonly variant: "destructive";
|
|
32
32
|
readonly run: (ctx: import("../../../affine-shared/services/index.js").ToolbarContext) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { notifyLinkedDocSwitchedToEmbed } from '../../../affine-components/notification/index.js';
|
|
2
|
-
import { ActionPlacement, DocDisplayMetaProvider, } from '../../../affine-shared/services/index.js';
|
|
2
|
+
import { ActionPlacement, DocDisplayMetaProvider, TOOLBAR_CARD_VIEW, TOOLBAR_DELETE, TOOLBAR_EMBED_VIEW, TOOLBAR_INLINE_VIEW, toolbarActionLabel, } from '../../../affine-shared/services/index.js';
|
|
3
3
|
import { cloneReferenceInfoWithoutAliases, isInsideBlockByFlavour, } from '../../../affine-shared/utils/index.js';
|
|
4
4
|
import { DeleteIcon } from '@blocksuite/icons/lit';
|
|
5
5
|
import { BlockSelection } from '../../../std/index.js';
|
|
@@ -38,12 +38,12 @@ export const builtinInlineReferenceToolbarConfig = {
|
|
|
38
38
|
actions: [
|
|
39
39
|
{
|
|
40
40
|
id: 'inline',
|
|
41
|
-
|
|
41
|
+
labelWording: TOOLBAR_INLINE_VIEW,
|
|
42
42
|
disabled: true,
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
id: 'card',
|
|
46
|
-
|
|
46
|
+
labelWording: TOOLBAR_CARD_VIEW,
|
|
47
47
|
run(ctx) {
|
|
48
48
|
const target = ctx.message$.peek()?.element;
|
|
49
49
|
if (!(target instanceof AffineReference))
|
|
@@ -78,7 +78,7 @@ export const builtinInlineReferenceToolbarConfig = {
|
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
id: 'embed',
|
|
81
|
-
|
|
81
|
+
labelWording: TOOLBAR_EMBED_VIEW,
|
|
82
82
|
disabled(ctx) {
|
|
83
83
|
const target = ctx.message$.peek()?.element;
|
|
84
84
|
if (!(target instanceof AffineReference))
|
|
@@ -140,7 +140,7 @@ export const builtinInlineReferenceToolbarConfig = {
|
|
|
140
140
|
if (!(target instanceof AffineReference))
|
|
141
141
|
return null;
|
|
142
142
|
const actions = this.actions.map(action => ({ ...action }));
|
|
143
|
-
const viewType$ = signal(actions[0]
|
|
143
|
+
const viewType$ = signal(toolbarActionLabel(ctx.std, actions[0]));
|
|
144
144
|
const onToggle = (e) => {
|
|
145
145
|
const opened = e.detail;
|
|
146
146
|
if (!opened)
|
|
@@ -174,7 +174,7 @@ export const builtinInlineReferenceToolbarConfig = {
|
|
|
174
174
|
{
|
|
175
175
|
placement: ActionPlacement.More,
|
|
176
176
|
id: 'c.delete',
|
|
177
|
-
|
|
177
|
+
labelWording: TOOLBAR_DELETE,
|
|
178
178
|
icon: DeleteIcon(),
|
|
179
179
|
variant: 'destructive',
|
|
180
180
|
run(ctx) {
|
|
@@ -34,7 +34,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
34
34
|
};
|
|
35
35
|
import { whenHover } from '../../affine-components/hover/index.js';
|
|
36
36
|
import { Peekable } from '../../affine-components/peek/index.js';
|
|
37
|
-
import { DEFAULT_DOC_NAME, REFERENCE_NODE
|
|
37
|
+
import { DEFAULT_DOC_NAME, REFERENCE_NODE } from '../../affine-shared/consts/index.js';
|
|
38
38
|
import { DocDisplayMetaProvider, ToolbarRegistryIdentifier, } from '../../affine-shared/services/index.js';
|
|
39
39
|
import { affineTextStyles } from '../../affine-shared/styles/index.js';
|
|
40
40
|
import { cloneReferenceInfo, referenceToNode, } from '../../affine-shared/utils/index.js';
|
|
@@ -1,17 +1,50 @@
|
|
|
1
1
|
import { ShapeElementModel } from '../shape/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* The BPMN
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* The BPMN artefacts the pack draws — the **descriptive conformance subclass**
|
|
4
|
+
* of BPMN 2.0. Each maps onto a native shape, decorated by a glyph where the
|
|
5
|
+
* notation asks for one:
|
|
6
|
+
*
|
|
7
|
+
* - events (ellipse) — `startEvent` / `endEvent` plain, plus the message and
|
|
8
|
+
* timer starts and the message and terminate ends;
|
|
9
|
+
* - activities (rect) — `task` plain, plus the user and service tasks, the
|
|
10
|
+
* collapsed sub-process and the call activity;
|
|
11
|
+
* - gateways (diamond) — `gatewayExclusive` (X) and `gatewayParallel` (+);
|
|
12
|
+
* - data & artifacts — `dataObject`, `dataStore` and `textAnnotation`, whose
|
|
13
|
+
* silhouettes (folded page, cylinder, open bracket) are drawn by the glyph
|
|
14
|
+
* over a native rect with its own stroke and fill turned off;
|
|
15
|
+
* - `group` — a dashed rounded rectangle drawn AROUND things.
|
|
16
|
+
*
|
|
17
|
+
* `group` is the odd one and deliberately so. Every other kind is a node the
|
|
18
|
+
* process is made of; a group is a lasso somebody drew round part of it. The
|
|
19
|
+
* spec (BPMN 2.0.2 §10.4) exempts it from every connection and containment
|
|
20
|
+
* constraint there is — it cannot be attached to a sequence or message flow, it
|
|
21
|
+
* is not bounded by the pool or lane it overlaps, and it may straddle several
|
|
22
|
+
* pools at once. Nothing here has to enforce that, because a group is unfilled:
|
|
23
|
+
* it is hit near its border and on its label, so it never steals a click from
|
|
24
|
+
* what it encloses, and what it encloses never becomes its content.
|
|
25
|
+
*
|
|
26
|
+
* ## Compatibility
|
|
27
|
+
*
|
|
28
|
+
* This union is only ever WIDENED, and it is widened with new VALUES of the
|
|
29
|
+
* existing `kind` string field — no new field, no schema change, no migration
|
|
30
|
+
* and no backfill. The precedent is `wardley`'s (`gfx/wardley/src/roles.ts`):
|
|
31
|
+
* a process drawn before today carries one of the four original values, loads
|
|
32
|
+
* unchanged and paints exactly as it always did.
|
|
33
|
+
*
|
|
34
|
+
* The expanded (drilled-in) sub-process is deliberately NOT here: `subProcess`
|
|
35
|
+
* is the COLLAPSED representation only — a task-sized rectangle with the `+`
|
|
36
|
+
* marker. An expanded sub-process is a container with its own flow inside it,
|
|
37
|
+
* which is a containment model this pack does not have yet.
|
|
7
38
|
*/
|
|
8
|
-
export type BpmnNodeKind = 'startEvent' | 'endEvent' | 'task' | 'gatewayExclusive';
|
|
39
|
+
export type BpmnNodeKind = 'startEvent' | 'startEventMessage' | 'startEventTimer' | 'endEvent' | 'endEventMessage' | 'endEventTerminate' | 'task' | 'taskUser' | 'taskService' | 'subProcess' | 'callActivity' | 'gatewayExclusive' | 'gatewayParallel' | 'dataObject' | 'dataStore' | 'textAnnotation' | 'group';
|
|
9
40
|
/**
|
|
10
41
|
* A BPMN flow-object node. Extends {@link ShapeElementModel} (a native shape)
|
|
11
42
|
* so it inherits ALL shape behaviour — editable stroke width / colors, inner
|
|
12
43
|
* text, native resize, the shape context toolbar — for free. `kind`
|
|
13
|
-
* discriminates the
|
|
14
|
-
*
|
|
44
|
+
* discriminates the artefacts and drives the RENDERING alone; what a node
|
|
45
|
+
* MEANS is the `role` stamped on it at creation (`gfx/bpmn/src/roles.ts`).
|
|
46
|
+
* The plain start event, end event and task are undecorated native shapes;
|
|
47
|
+
* every other kind is decorated with a glyph by the renderer.
|
|
15
48
|
*
|
|
16
49
|
* Mirrors {@link EdgyNodeElementModel}.
|
|
17
50
|
*/
|
|
@@ -38,8 +38,10 @@ import { ShapeElementModel } from '../shape/index.js';
|
|
|
38
38
|
* A BPMN flow-object node. Extends {@link ShapeElementModel} (a native shape)
|
|
39
39
|
* so it inherits ALL shape behaviour — editable stroke width / colors, inner
|
|
40
40
|
* text, native resize, the shape context toolbar — for free. `kind`
|
|
41
|
-
* discriminates the
|
|
42
|
-
*
|
|
41
|
+
* discriminates the artefacts and drives the RENDERING alone; what a node
|
|
42
|
+
* MEANS is the `role` stamped on it at creation (`gfx/bpmn/src/roles.ts`).
|
|
43
|
+
* The plain start event, end event and task are undecorated native shapes;
|
|
44
|
+
* every other kind is decorated with a glyph by the renderer.
|
|
43
45
|
*
|
|
44
46
|
* Mirrors {@link EdgyNodeElementModel}.
|
|
45
47
|
*/
|
|
@@ -1,30 +1,148 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import type { SerializedXYWH } from '../../../global/gfx/index.js';
|
|
2
|
+
import type { PointTestOptions } from '../../../std/gfx/index.js';
|
|
3
|
+
import type { FrameworkBackgroundProps } from '../framework-background/index.js';
|
|
4
|
+
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Width of the participant band — the left margin strip the pool name is
|
|
7
|
+
* written up, in model units.
|
|
8
|
+
*
|
|
9
|
+
* Declared HERE, in the model, and re-exported by `@labre/affine-gfx-bpmn`
|
|
10
|
+
* rather than the other way round. The pool's own hit test needs it (a pool is
|
|
11
|
+
* clickable by its title bands as well as its border, the bpmn.io convention),
|
|
12
|
+
* and `affine-model` cannot reach into `affine-block-surface` where the
|
|
13
|
+
* declaration is resolved. One number, owned by the layer that both the
|
|
14
|
+
* declaration and the hit test can read.
|
|
15
|
+
*/
|
|
16
|
+
export declare const POOL_BAND_WIDTH = 28;
|
|
17
|
+
/**
|
|
18
|
+
* Width of a lane's own title band — the strip immediately inside the
|
|
19
|
+
* participant band, with the lane name turned on its side.
|
|
20
|
+
*
|
|
21
|
+
* Four units narrower than {@link POOL_BAND_WIDTH}, and for the same reason the
|
|
22
|
+
* lane font is two points smaller: the two strips sit side by side, so the
|
|
23
|
+
* subordinate one has to say so. Identical widths read as a single 56-unit
|
|
24
|
+
* gutter rather than as a participant containing lanes, which is exactly the
|
|
25
|
+
* relationship the picture has to carry.
|
|
26
|
+
*
|
|
27
|
+
* NO fill, divider only — what bpmn.io, Camunda and Visio all draw.
|
|
28
|
+
*/
|
|
29
|
+
export declare const POOL_LANE_BAND_WIDTH = 24;
|
|
30
|
+
/**
|
|
31
|
+
* One LANE (couloir) of a pool: a horizontal band the participant's own work is
|
|
32
|
+
* divided into — "Sales", "Back office", "Automated".
|
|
33
|
+
*
|
|
34
|
+
* The shape of a {@link BackgroundInstanceZoneItem} in
|
|
35
|
+
* `@labre/affine-block-surface`, and deliberately the same three fields: the
|
|
36
|
+
* primitive paints an instance partition from that structure, the audit reports
|
|
37
|
+
* it from that structure, and a lane that had a shape of its own would be a
|
|
38
|
+
* fourth place the two have to agree.
|
|
39
|
+
*
|
|
40
|
+
* `size` is a relative WEIGHT, not a height in model units: lanes share the
|
|
41
|
+
* plot in proportion to their sizes, so a pool dragged taller redistributes the
|
|
42
|
+
* extra space instead of leaving a gap under the last band. `2` reads as "twice
|
|
43
|
+
* the other one", which is the only thing a lane's height ever means.
|
|
44
|
+
*/
|
|
45
|
+
export interface BpmnLane {
|
|
46
|
+
/** Stable id, generated at creation. Never the name: a lane can be renamed. */
|
|
47
|
+
id: string;
|
|
48
|
+
/** The lane name, written horizontally in its top-left corner. */
|
|
49
|
+
name?: string;
|
|
50
|
+
/** Relative weight — see above. Must be a finite number greater than zero. */
|
|
51
|
+
size: number;
|
|
52
|
+
}
|
|
53
|
+
export type BpmnPoolProps = FrameworkBackgroundProps & {
|
|
6
54
|
/** The participant name shown in the left band — edited inline on dblclick. */
|
|
7
55
|
name?: string;
|
|
8
|
-
/**
|
|
9
|
-
|
|
56
|
+
/** The pool's own partition into lanes. Absent until the first one is added. */
|
|
57
|
+
lanes?: BpmnLane[];
|
|
10
58
|
};
|
|
11
59
|
/**
|
|
12
60
|
* A BPMN "pool": a participant container drawn as a rounded-rect frame with a
|
|
13
|
-
* vertical name band on the left. It is a background
|
|
14
|
-
*
|
|
15
|
-
*
|
|
61
|
+
* vertical name band on the left. It is a framework background like every other
|
|
62
|
+
* one in the library — the user drops flow-object nodes on top of it, and a
|
|
63
|
+
* connector never snaps to it.
|
|
64
|
+
*
|
|
65
|
+
* The geometry of a passive canvas comes from
|
|
66
|
+
* {@link FrameworkBackgroundElementModel}: this class used to restate all five
|
|
67
|
+
* of those overrides verbatim, which is exactly the kind of copy that drifts.
|
|
68
|
+
* The persisted type is still `bpmnPool`, and the first four fields below are
|
|
69
|
+
* the four it has always written, in the same order, with the same defaults.
|
|
16
70
|
*
|
|
17
|
-
*
|
|
71
|
+
* What it LOOKS like is declared, not coded: see `BPMN_POOL_BACKGROUND` in
|
|
72
|
+
* `@labre/affine-gfx-bpmn`.
|
|
18
73
|
*/
|
|
19
|
-
export declare class BpmnPoolElementModel extends
|
|
74
|
+
export declare class BpmnPoolElementModel extends FrameworkBackgroundElementModel<BpmnPoolProps> {
|
|
20
75
|
get type(): string;
|
|
21
|
-
get connectable(): boolean;
|
|
22
|
-
containsBound(bounds: Bound): boolean;
|
|
23
|
-
getLineIntersections(start: IVec, end: IVec): import("../../../global/gfx/index.js").PointLocation[] | null;
|
|
24
|
-
getNearestPoint(point: IVec): IVec;
|
|
25
|
-
includesPoint(x: number, y: number): boolean;
|
|
26
76
|
accessor name: string;
|
|
27
77
|
accessor resizeEnabled: boolean;
|
|
28
78
|
accessor rotate: number;
|
|
29
79
|
accessor xywh: SerializedXYWH;
|
|
80
|
+
/**
|
|
81
|
+
* The pool's own partition into lanes, in top-to-bottom order.
|
|
82
|
+
*
|
|
83
|
+
* The FIFTH field, and the only one that is optional. It mirrors
|
|
84
|
+
* `validationExceptions` on the base element model exactly, for the same three
|
|
85
|
+
* reasons:
|
|
86
|
+
*
|
|
87
|
+
* - **`undefined`, not `[]`.** `@field()`'s `init` writes nothing for an
|
|
88
|
+
* `undefined` default, so a pool that has no lane stays byte-identical to
|
|
89
|
+
* one created before this field existed: optional field, no schema version
|
|
90
|
+
* bump, no migration, and every document already on disk opens and paints
|
|
91
|
+
* exactly as it did (pinned by `pool-background.unit.spec.ts`, whose
|
|
92
|
+
* fixture carries no `lanes` key). Removing the last lane goes back through
|
|
93
|
+
* `clearField`, which deletes the KEY rather than leaving a phantom one.
|
|
94
|
+
* - **Flat JSON on purpose.** Element serialization is one level deep, and a
|
|
95
|
+
* value a Yjs update can encode is the contract `_assignElementProp`
|
|
96
|
+
* enforces. A nested `Y.Map` is what `tags` needs and this does not (see
|
|
97
|
+
* `docs/adr/0007`): a lane list is one atomic choice about how a single
|
|
98
|
+
* participant's own band is cut, authored by whoever is drawing the
|
|
99
|
+
* process — not an accumulating multi-key set different people qualify
|
|
100
|
+
* concurrently. The trade is stated so it is reviewed, not discovered:
|
|
101
|
+
* two peers reordering the lanes at the same moment resolve
|
|
102
|
+
* last-write-wins, one whole list winning over the other.
|
|
103
|
+
* - **Declared HERE and not on the base class.** A lane is a subdivision of a
|
|
104
|
+
* pool and of nothing else, and the accessor is what carries the value
|
|
105
|
+
* through a copy, a paste or a template insertion, so a duplicated pool
|
|
106
|
+
* arrives with its lanes.
|
|
107
|
+
*
|
|
108
|
+
* What it MEANS is declared, not coded: `BPMN_POOL_BACKGROUND.instanceZones`
|
|
109
|
+
* in `@labre/affine-gfx-bpmn` names this prop, and the framework-background
|
|
110
|
+
* primitive paints the dividers and the names from it.
|
|
111
|
+
*/
|
|
112
|
+
accessor lanes: BpmnLane[] | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* A pool is picked by its BORDER — and by its TITLE BANDS, which is the one
|
|
115
|
+
* carve-out the recette kept (issue #194).
|
|
116
|
+
*
|
|
117
|
+
* That is the bpmn.io convention, and it is the convention because the bands
|
|
118
|
+
* are the only part of a pool that is the pool rather than the process drawn
|
|
119
|
+
* on it: the participant strip on the left carries the participant's name,
|
|
120
|
+
* the lane strip beside it carries the lane names, and nothing is ever
|
|
121
|
+
* dropped on either. The flow area is where the work goes, so a click there
|
|
122
|
+
* belongs to whatever is under the pointer.
|
|
123
|
+
*
|
|
124
|
+
* ## Where the geometry comes from
|
|
125
|
+
*
|
|
126
|
+
* The two strips run the FULL height of the pool: the participant band is the
|
|
127
|
+
* whole left margin, and the lane bands partition that same height between
|
|
128
|
+
* them with no gap — so their union is one vertical strip
|
|
129
|
+
* `POOL_LANE_BAND_WIDTH` wide, whatever the lanes' individual weights are.
|
|
130
|
+
* Which means this test needs no lane arithmetic at all, only the two widths
|
|
131
|
+
* (declared above, and read from here by the framework declaration) and the
|
|
132
|
+
* answer to "does this pool have a usable lane".
|
|
133
|
+
*
|
|
134
|
+
* The zoom-grown rename targets — the touch-sized boxes a double-click aims
|
|
135
|
+
* at — are the VIEW's business and stay in `pool-hit.ts`; what is painted is
|
|
136
|
+
* what is selectable, which is the promise this test has to keep.
|
|
137
|
+
*/
|
|
138
|
+
includesPoint(x: number, y: number, options?: PointTestOptions): boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Whether at least one lane is drawn — the only thing the hit test needs to
|
|
141
|
+
* know about the partition.
|
|
142
|
+
*
|
|
143
|
+
* Mirrors what `backgroundInstanceZones` keeps (a string id, a finite size
|
|
144
|
+
* greater than zero): a malformed row is dropped there and paints no band, so
|
|
145
|
+
* it must not make a band clickable here either.
|
|
146
|
+
*/
|
|
147
|
+
private get hasUsableLane();
|
|
30
148
|
}
|
|
@@ -32,18 +32,51 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
32
32
|
}
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
|
-
import {
|
|
36
|
-
import { field
|
|
35
|
+
import { rotatePoint } from '../../../global/gfx/index.js';
|
|
36
|
+
import { field } from '../../../std/gfx/index.js';
|
|
37
|
+
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
38
|
+
/**
|
|
39
|
+
* Width of the participant band — the left margin strip the pool name is
|
|
40
|
+
* written up, in model units.
|
|
41
|
+
*
|
|
42
|
+
* Declared HERE, in the model, and re-exported by `@labre/affine-gfx-bpmn`
|
|
43
|
+
* rather than the other way round. The pool's own hit test needs it (a pool is
|
|
44
|
+
* clickable by its title bands as well as its border, the bpmn.io convention),
|
|
45
|
+
* and `affine-model` cannot reach into `affine-block-surface` where the
|
|
46
|
+
* declaration is resolved. One number, owned by the layer that both the
|
|
47
|
+
* declaration and the hit test can read.
|
|
48
|
+
*/
|
|
49
|
+
export const POOL_BAND_WIDTH = 28;
|
|
50
|
+
/**
|
|
51
|
+
* Width of a lane's own title band — the strip immediately inside the
|
|
52
|
+
* participant band, with the lane name turned on its side.
|
|
53
|
+
*
|
|
54
|
+
* Four units narrower than {@link POOL_BAND_WIDTH}, and for the same reason the
|
|
55
|
+
* lane font is two points smaller: the two strips sit side by side, so the
|
|
56
|
+
* subordinate one has to say so. Identical widths read as a single 56-unit
|
|
57
|
+
* gutter rather than as a participant containing lanes, which is exactly the
|
|
58
|
+
* relationship the picture has to carry.
|
|
59
|
+
*
|
|
60
|
+
* NO fill, divider only — what bpmn.io, Camunda and Visio all draw.
|
|
61
|
+
*/
|
|
62
|
+
export const POOL_LANE_BAND_WIDTH = 24;
|
|
37
63
|
/**
|
|
38
64
|
* A BPMN "pool": a participant container drawn as a rounded-rect frame with a
|
|
39
|
-
* vertical name band on the left. It is a background
|
|
40
|
-
*
|
|
41
|
-
*
|
|
65
|
+
* vertical name band on the left. It is a framework background like every other
|
|
66
|
+
* one in the library — the user drops flow-object nodes on top of it, and a
|
|
67
|
+
* connector never snaps to it.
|
|
68
|
+
*
|
|
69
|
+
* The geometry of a passive canvas comes from
|
|
70
|
+
* {@link FrameworkBackgroundElementModel}: this class used to restate all five
|
|
71
|
+
* of those overrides verbatim, which is exactly the kind of copy that drifts.
|
|
72
|
+
* The persisted type is still `bpmnPool`, and the first four fields below are
|
|
73
|
+
* the four it has always written, in the same order, with the same defaults.
|
|
42
74
|
*
|
|
43
|
-
*
|
|
75
|
+
* What it LOOKS like is declared, not coded: see `BPMN_POOL_BACKGROUND` in
|
|
76
|
+
* `@labre/affine-gfx-bpmn`.
|
|
44
77
|
*/
|
|
45
78
|
let BpmnPoolElementModel = (() => {
|
|
46
|
-
let _classSuper =
|
|
79
|
+
let _classSuper = FrameworkBackgroundElementModel;
|
|
47
80
|
let _name_decorators;
|
|
48
81
|
let _name_initializers = [];
|
|
49
82
|
let _name_extraInitializers = [];
|
|
@@ -56,6 +89,9 @@ let BpmnPoolElementModel = (() => {
|
|
|
56
89
|
let _xywh_decorators;
|
|
57
90
|
let _xywh_initializers = [];
|
|
58
91
|
let _xywh_extraInitializers = [];
|
|
92
|
+
let _lanes_decorators;
|
|
93
|
+
let _lanes_initializers = [];
|
|
94
|
+
let _lanes_extraInitializers = [];
|
|
59
95
|
return class BpmnPoolElementModel extends _classSuper {
|
|
60
96
|
static {
|
|
61
97
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
@@ -63,33 +99,17 @@ let BpmnPoolElementModel = (() => {
|
|
|
63
99
|
_resizeEnabled_decorators = [field(true)];
|
|
64
100
|
_rotate_decorators = [field(0)];
|
|
65
101
|
_xywh_decorators = [field()];
|
|
102
|
+
_lanes_decorators = [field()];
|
|
66
103
|
__esDecorate(this, null, _name_decorators, { kind: "accessor", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
|
|
67
104
|
__esDecorate(this, null, _resizeEnabled_decorators, { kind: "accessor", name: "resizeEnabled", static: false, private: false, access: { has: obj => "resizeEnabled" in obj, get: obj => obj.resizeEnabled, set: (obj, value) => { obj.resizeEnabled = value; } }, metadata: _metadata }, _resizeEnabled_initializers, _resizeEnabled_extraInitializers);
|
|
68
105
|
__esDecorate(this, null, _rotate_decorators, { kind: "accessor", name: "rotate", static: false, private: false, access: { has: obj => "rotate" in obj, get: obj => obj.rotate, set: (obj, value) => { obj.rotate = value; } }, metadata: _metadata }, _rotate_initializers, _rotate_extraInitializers);
|
|
69
106
|
__esDecorate(this, null, _xywh_decorators, { kind: "accessor", name: "xywh", static: false, private: false, access: { has: obj => "xywh" in obj, get: obj => obj.xywh, set: (obj, value) => { obj.xywh = value; } }, metadata: _metadata }, _xywh_initializers, _xywh_extraInitializers);
|
|
107
|
+
__esDecorate(this, null, _lanes_decorators, { kind: "accessor", name: "lanes", static: false, private: false, access: { has: obj => "lanes" in obj, get: obj => obj.lanes, set: (obj, value) => { obj.lanes = value; } }, metadata: _metadata }, _lanes_initializers, _lanes_extraInitializers);
|
|
70
108
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
71
109
|
}
|
|
72
110
|
get type() {
|
|
73
111
|
return 'bpmnPool';
|
|
74
112
|
}
|
|
75
|
-
get connectable() {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
containsBound(bounds) {
|
|
79
|
-
const points = getPointsFromBoundWithRotation(this);
|
|
80
|
-
return points.some(point => bounds.containsPoint(point));
|
|
81
|
-
}
|
|
82
|
-
getLineIntersections(start, end) {
|
|
83
|
-
const points = getPointsFromBoundWithRotation(this);
|
|
84
|
-
return linePolygonIntersects(start, end, points);
|
|
85
|
-
}
|
|
86
|
-
getNearestPoint(point) {
|
|
87
|
-
return polygonNearestPoint(Bound.deserialize(this.xywh).points, point);
|
|
88
|
-
}
|
|
89
|
-
includesPoint(x, y) {
|
|
90
|
-
const points = getPointsFromBoundWithRotation(this);
|
|
91
|
-
return pointInPolygon([x, y], points);
|
|
92
|
-
}
|
|
93
113
|
#name_accessor_storage = __runInitializers(this, _name_initializers, 'Pool');
|
|
94
114
|
get name() { return this.#name_accessor_storage; }
|
|
95
115
|
set name(value) { this.#name_accessor_storage = value; }
|
|
@@ -102,9 +122,111 @@ let BpmnPoolElementModel = (() => {
|
|
|
102
122
|
#xywh_accessor_storage = (__runInitializers(this, _rotate_extraInitializers), __runInitializers(this, _xywh_initializers, '[0,0,560,200]'));
|
|
103
123
|
get xywh() { return this.#xywh_accessor_storage; }
|
|
104
124
|
set xywh(value) { this.#xywh_accessor_storage = value; }
|
|
125
|
+
#lanes_accessor_storage = (__runInitializers(this, _xywh_extraInitializers), __runInitializers(this, _lanes_initializers, undefined));
|
|
126
|
+
/**
|
|
127
|
+
* The pool's own partition into lanes, in top-to-bottom order.
|
|
128
|
+
*
|
|
129
|
+
* The FIFTH field, and the only one that is optional. It mirrors
|
|
130
|
+
* `validationExceptions` on the base element model exactly, for the same three
|
|
131
|
+
* reasons:
|
|
132
|
+
*
|
|
133
|
+
* - **`undefined`, not `[]`.** `@field()`'s `init` writes nothing for an
|
|
134
|
+
* `undefined` default, so a pool that has no lane stays byte-identical to
|
|
135
|
+
* one created before this field existed: optional field, no schema version
|
|
136
|
+
* bump, no migration, and every document already on disk opens and paints
|
|
137
|
+
* exactly as it did (pinned by `pool-background.unit.spec.ts`, whose
|
|
138
|
+
* fixture carries no `lanes` key). Removing the last lane goes back through
|
|
139
|
+
* `clearField`, which deletes the KEY rather than leaving a phantom one.
|
|
140
|
+
* - **Flat JSON on purpose.** Element serialization is one level deep, and a
|
|
141
|
+
* value a Yjs update can encode is the contract `_assignElementProp`
|
|
142
|
+
* enforces. A nested `Y.Map` is what `tags` needs and this does not (see
|
|
143
|
+
* `docs/adr/0007`): a lane list is one atomic choice about how a single
|
|
144
|
+
* participant's own band is cut, authored by whoever is drawing the
|
|
145
|
+
* process — not an accumulating multi-key set different people qualify
|
|
146
|
+
* concurrently. The trade is stated so it is reviewed, not discovered:
|
|
147
|
+
* two peers reordering the lanes at the same moment resolve
|
|
148
|
+
* last-write-wins, one whole list winning over the other.
|
|
149
|
+
* - **Declared HERE and not on the base class.** A lane is a subdivision of a
|
|
150
|
+
* pool and of nothing else, and the accessor is what carries the value
|
|
151
|
+
* through a copy, a paste or a template insertion, so a duplicated pool
|
|
152
|
+
* arrives with its lanes.
|
|
153
|
+
*
|
|
154
|
+
* What it MEANS is declared, not coded: `BPMN_POOL_BACKGROUND.instanceZones`
|
|
155
|
+
* in `@labre/affine-gfx-bpmn` names this prop, and the framework-background
|
|
156
|
+
* primitive paints the dividers and the names from it.
|
|
157
|
+
*/
|
|
158
|
+
get lanes() { return this.#lanes_accessor_storage; }
|
|
159
|
+
set lanes(value) { this.#lanes_accessor_storage = value; }
|
|
160
|
+
/**
|
|
161
|
+
* A pool is picked by its BORDER — and by its TITLE BANDS, which is the one
|
|
162
|
+
* carve-out the recette kept (issue #194).
|
|
163
|
+
*
|
|
164
|
+
* That is the bpmn.io convention, and it is the convention because the bands
|
|
165
|
+
* are the only part of a pool that is the pool rather than the process drawn
|
|
166
|
+
* on it: the participant strip on the left carries the participant's name,
|
|
167
|
+
* the lane strip beside it carries the lane names, and nothing is ever
|
|
168
|
+
* dropped on either. The flow area is where the work goes, so a click there
|
|
169
|
+
* belongs to whatever is under the pointer.
|
|
170
|
+
*
|
|
171
|
+
* ## Where the geometry comes from
|
|
172
|
+
*
|
|
173
|
+
* The two strips run the FULL height of the pool: the participant band is the
|
|
174
|
+
* whole left margin, and the lane bands partition that same height between
|
|
175
|
+
* them with no gap — so their union is one vertical strip
|
|
176
|
+
* `POOL_LANE_BAND_WIDTH` wide, whatever the lanes' individual weights are.
|
|
177
|
+
* Which means this test needs no lane arithmetic at all, only the two widths
|
|
178
|
+
* (declared above, and read from here by the framework declaration) and the
|
|
179
|
+
* answer to "does this pool have a usable lane".
|
|
180
|
+
*
|
|
181
|
+
* The zoom-grown rename targets — the touch-sized boxes a double-click aims
|
|
182
|
+
* at — are the VIEW's business and stay in `pool-hit.ts`; what is painted is
|
|
183
|
+
* what is selectable, which is the promise this test has to keep.
|
|
184
|
+
*/
|
|
185
|
+
includesPoint(x, y, options) {
|
|
186
|
+
if (super.includesPoint(x, y, options))
|
|
187
|
+
return true;
|
|
188
|
+
const [ex, ey, w, h] = this.deserializedXYWH;
|
|
189
|
+
// Element-local coordinates, undoing the element rotation about its centre
|
|
190
|
+
// — the bands are axis-aligned inside the pool, not on the canvas.
|
|
191
|
+
let lx = x - ex;
|
|
192
|
+
let ly = y - ey;
|
|
193
|
+
const rotate = this.rotate ?? 0;
|
|
194
|
+
if (rotate) {
|
|
195
|
+
const [ux, uy] = rotatePoint([x, y], [ex + w / 2, ey + h / 2], -rotate);
|
|
196
|
+
lx = ux - ex;
|
|
197
|
+
ly = uy - ey;
|
|
198
|
+
}
|
|
199
|
+
if (ly < 0 || ly > h || lx < 0)
|
|
200
|
+
return false;
|
|
201
|
+
// Clamped to a pool narrower than its own margin — the degenerate case the
|
|
202
|
+
// renderer clamps too.
|
|
203
|
+
const band = Math.min(POOL_BAND_WIDTH, w);
|
|
204
|
+
const lanes = this.hasUsableLane
|
|
205
|
+
? Math.min(POOL_LANE_BAND_WIDTH, w - band)
|
|
206
|
+
: 0;
|
|
207
|
+
return lx <= band + Math.max(lanes, 0);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Whether at least one lane is drawn — the only thing the hit test needs to
|
|
211
|
+
* know about the partition.
|
|
212
|
+
*
|
|
213
|
+
* Mirrors what `backgroundInstanceZones` keeps (a string id, a finite size
|
|
214
|
+
* greater than zero): a malformed row is dropped there and paints no band, so
|
|
215
|
+
* it must not make a band clickable here either.
|
|
216
|
+
*/
|
|
217
|
+
get hasUsableLane() {
|
|
218
|
+
const lanes = this.lanes;
|
|
219
|
+
if (!Array.isArray(lanes))
|
|
220
|
+
return false;
|
|
221
|
+
return lanes.some(lane => typeof lane?.id === 'string' &&
|
|
222
|
+
lane.id !== '' &&
|
|
223
|
+
typeof lane.size === 'number' &&
|
|
224
|
+
Number.isFinite(lane.size) &&
|
|
225
|
+
lane.size > 0);
|
|
226
|
+
}
|
|
105
227
|
constructor() {
|
|
106
228
|
super(...arguments);
|
|
107
|
-
__runInitializers(this,
|
|
229
|
+
__runInitializers(this, _lanes_extraInitializers);
|
|
108
230
|
}
|
|
109
231
|
};
|
|
110
232
|
})();
|