@formicoidea/labre-core 0.43.1 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_pkgs/affine-block-attachment/utils.js +4 -0
- package/dist/_pkgs/affine-block-bookmark/configs/toolbar.js +17 -4
- package/dist/_pkgs/affine-block-callout/commands/turn-callout-into.d.ts +43 -0
- package/dist/_pkgs/affine-block-callout/commands/turn-callout-into.js +109 -0
- package/dist/_pkgs/affine-block-callout/commands/turn-into-callout.d.ts +29 -0
- package/dist/_pkgs/affine-block-callout/commands/turn-into-callout.js +81 -0
- package/dist/_pkgs/affine-block-callout/configs/slash-menu.js +6 -4
- package/dist/_pkgs/affine-block-callout/configs/toolbar.d.ts +65 -0
- package/dist/_pkgs/affine-block-callout/configs/toolbar.js +178 -0
- package/dist/_pkgs/affine-block-callout/configs/turn-into.d.ts +8 -0
- package/dist/_pkgs/affine-block-callout/configs/turn-into.js +19 -0
- package/dist/_pkgs/affine-block-callout/translations.d.ts +4 -2
- package/dist/_pkgs/affine-block-callout/translations.js +4 -2
- package/dist/_pkgs/affine-block-callout/view.js +10 -1
- package/dist/_pkgs/affine-block-code/code-block-service.d.ts +13 -0
- package/dist/_pkgs/affine-block-code/code-block-service.js +26 -0
- package/dist/_pkgs/affine-block-code/code-block.d.ts +6 -0
- package/dist/_pkgs/affine-block-code/code-block.js +11 -2
- package/dist/_pkgs/affine-block-code/code-toolbar/components/lang-button.js +31 -8
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.d.ts +11 -0
- package/dist/_pkgs/affine-block-edgeless-text/svg-painter.d.ts +20 -0
- package/dist/_pkgs/affine-block-edgeless-text/svg-painter.js +76 -0
- package/dist/_pkgs/affine-block-edgeless-text/view.js +2 -0
- package/dist/_pkgs/affine-block-embed/configs/toolbar.js +11 -2
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +11 -2
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-edgeless-linked-doc-block.js +3 -1
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/configs/toolbar.js +7 -2
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-edgeless-synced-doc-block.js +3 -1
- package/dist/_pkgs/affine-block-frame/commands.d.ts +27 -0
- package/dist/_pkgs/affine-block-frame/commands.js +49 -0
- package/dist/_pkgs/affine-block-frame/frame-manager.d.ts +16 -6
- package/dist/_pkgs/affine-block-frame/frame-manager.js +58 -22
- package/dist/_pkgs/affine-block-frame/frame-order.d.ts +43 -0
- package/dist/_pkgs/affine-block-frame/frame-order.js +93 -0
- package/dist/_pkgs/affine-block-frame/frame-tool.js +3 -1
- package/dist/_pkgs/affine-block-frame/index.d.ts +2 -0
- package/dist/_pkgs/affine-block-frame/index.js +2 -0
- package/dist/_pkgs/affine-block-frame/present/frame-order-menu.d.ts +10 -2
- package/dist/_pkgs/affine-block-frame/present/frame-order-menu.js +32 -18
- package/dist/_pkgs/affine-block-frame/view.js +6 -0
- package/dist/_pkgs/affine-block-image/utils.js +4 -1
- package/dist/_pkgs/affine-block-latex/adapters/markdown/preprocessor.d.ts +8 -0
- package/dist/_pkgs/affine-block-latex/adapters/markdown/preprocessor.js +9 -5
- package/dist/_pkgs/affine-block-note/configs/toolbar.d.ts +19 -0
- package/dist/_pkgs/affine-block-note/configs/toolbar.js +38 -23
- package/dist/_pkgs/affine-block-note/translations.d.ts +2 -1
- package/dist/_pkgs/affine-block-note/translations.js +14 -6
- package/dist/_pkgs/affine-block-root/configs/toolbar.js +48 -3
- package/dist/_pkgs/affine-block-root/edgeless/clipboard/clipboard.js +2 -1
- package/dist/_pkgs/affine-block-root/edgeless/clipboard/command.js +161 -83
- package/dist/_pkgs/affine-block-root/edgeless/clipboard/paste-order.d.ts +21 -0
- package/dist/_pkgs/affine-block-root/edgeless/clipboard/paste-order.js +85 -0
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.d.ts +6 -0
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +18 -1
- package/dist/_pkgs/affine-block-root/edgeless/utils/clone-utils.d.ts +9 -0
- package/dist/_pkgs/affine-block-root/edgeless/utils/clone-utils.js +28 -0
- package/dist/_pkgs/affine-block-root/keyboard/commands.js +9 -6
- package/dist/_pkgs/affine-block-root/preview/edgeless-root-preview-block.js +15 -2
- package/dist/_pkgs/affine-block-root/translations.d.ts +7 -2
- package/dist/_pkgs/affine-block-root/translations.js +10 -13
- package/dist/_pkgs/affine-block-surface/adapters/markdown/element-adapter/type.d.ts +1 -1
- package/dist/_pkgs/affine-block-surface/element-model/index.d.ts +1 -1
- package/dist/_pkgs/affine-block-surface/element-model/index.js +1 -1
- package/dist/_pkgs/affine-block-surface/extensions/audit.js +13 -61
- package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/commands.d.ts +2 -0
- package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/commands.js +71 -0
- package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/index.js +1 -0
- package/dist/_pkgs/affine-block-surface/extensions/clipboard-config.js +4 -0
- package/dist/_pkgs/affine-block-surface/extensions/crud-extension.js +4 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.d.ts +12 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +27 -7
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.d.ts +2 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.js +22 -3
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.d.ts +6 -3
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.js +4 -2
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/parts.d.ts +63 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/parts.js +67 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.d.ts +62 -5
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +98 -18
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.d.ts +14 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.js +82 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.d.ts +2 -2
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.js +112 -10
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/translations.d.ts +13 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/translations.js +33 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.js +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/reading-widget.d.ts +13 -6
- package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +26 -10
- package/dist/_pkgs/affine-block-surface/extensions/reading.d.ts +82 -6
- package/dist/_pkgs/affine-block-surface/extensions/reading.js +99 -21
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/actions.d.ts +91 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/actions.js +285 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/commands.d.ts +80 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/commands.js +355 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/index.d.ts +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/index.js +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/tree.d.ts +137 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/tree.js +323 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +112 -4
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +86 -15
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/actions.d.ts +76 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/actions.js +299 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/active-layer.d.ts +20 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/active-layer.js +34 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/commands.d.ts +67 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/commands.js +172 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/creation.d.ts +40 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/creation.js +69 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/index.d.ts +5 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/index.js +5 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/translations.d.ts +10 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/translations.js +14 -0
- package/dist/_pkgs/affine-block-surface/framework-background/facts.d.ts +55 -2
- package/dist/_pkgs/affine-block-surface/framework-background/facts.js +63 -1
- package/dist/_pkgs/affine-block-surface/framework-background/stacking.d.ts +16 -8
- package/dist/_pkgs/affine-block-surface/framework-background/stacking.js +26 -14
- package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.js +17 -3
- package/dist/_pkgs/affine-block-surface/renderer/dom-renderer.d.ts +3 -1
- package/dist/_pkgs/affine-block-surface/renderer/dom-renderer.js +22 -2
- package/dist/_pkgs/affine-block-surface/renderer/paint-predicate.d.ts +30 -0
- package/dist/_pkgs/affine-block-surface/renderer/paint-predicate.js +29 -0
- package/dist/_pkgs/affine-block-surface/surface-block.js +6 -0
- package/dist/_pkgs/affine-block-surface/surface-model.js +5 -0
- package/dist/_pkgs/affine-block-surface/surface-transformer.js +5 -0
- package/dist/_pkgs/affine-block-surface/tool/default-tool.js +28 -5
- package/dist/_pkgs/affine-block-surface/view.js +23 -1
- package/dist/_pkgs/affine-block-surface-ref/surface-ref-block.js +12 -2
- package/dist/_pkgs/affine-components/context-menu/button.js +14 -0
- package/dist/_pkgs/affine-components/filterable-list/index.js +30 -9
- package/dist/_pkgs/affine-components/icons/index.d.ts +0 -1
- package/dist/_pkgs/affine-components/icons/index.js +0 -1
- package/dist/_pkgs/affine-components/icons/text.d.ts +1 -0
- package/dist/_pkgs/affine-components/icons/text.js +11 -0
- package/dist/_pkgs/affine-components/portal/portal.d.ts +1 -1
- package/dist/_pkgs/affine-foundation/view.d.ts +8 -8
- package/dist/_pkgs/affine-fragment-adapter-panel/adapter-panel.d.ts +2 -2
- package/dist/_pkgs/affine-fragment-frame-panel/body/frame-panel-body.d.ts +34 -2
- package/dist/_pkgs/affine-fragment-frame-panel/body/frame-panel-body.js +194 -81
- package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card.d.ts +7 -4
- package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card.js +9 -24
- package/dist/_pkgs/affine-fragment-frame-panel/header/frame-panel-header.d.ts +1 -1
- package/dist/_pkgs/affine-fragment-frame-panel/header/frame-panel-header.js +8 -27
- package/dist/_pkgs/affine-fragment-frame-panel/index.d.ts +2 -0
- package/dist/_pkgs/affine-fragment-frame-panel/index.js +2 -0
- package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.js +3 -1
- package/dist/_pkgs/affine-gfx-connector/element-renderer/index.js +21 -4
- package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.js +3 -2
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +1 -1
- package/dist/_pkgs/affine-gfx-group/command/group-api.js +52 -1
- package/dist/_pkgs/affine-gfx-shape/element-renderer/shape/index.js +21 -3
- package/dist/_pkgs/affine-gfx-shape/text/edgeless-shape-text-editor.js +2 -0
- package/dist/_pkgs/affine-gfx-shape/toolbar/config.js +1 -1
- package/dist/_pkgs/affine-gfx-template/services/template-middlewares.d.ts +9 -0
- package/dist/_pkgs/affine-gfx-template/services/template-middlewares.js +23 -1
- package/dist/_pkgs/affine-gfx-template/services/template.js +2 -1
- package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.js +2 -1
- package/dist/_pkgs/affine-gfx-text/element-renderer/index.js +20 -3
- package/dist/_pkgs/affine-gfx-text/element-renderer/utils.d.ts +67 -1
- package/dist/_pkgs/affine-gfx-text/element-renderer/utils.js +101 -0
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.d.ts +11 -0
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +53 -2
- package/dist/_pkgs/affine-gfx-text/toolbar/config.d.ts +11 -0
- package/dist/_pkgs/affine-gfx-text/toolbar/config.js +1 -1
- package/dist/_pkgs/affine-inline-preset/adapters/html/html-inline.d.ts +3 -0
- package/dist/_pkgs/affine-inline-preset/adapters/html/html-inline.js +31 -0
- package/dist/_pkgs/affine-inline-preset/adapters/html/inline-delta.d.ts +4 -0
- package/dist/_pkgs/affine-inline-preset/adapters/html/inline-delta.js +14 -0
- package/dist/_pkgs/affine-inline-preset/command/config.js +21 -3
- package/dist/_pkgs/affine-inline-preset/command/index.d.ts +1 -1
- package/dist/_pkgs/affine-inline-preset/command/index.js +1 -1
- package/dist/_pkgs/affine-inline-preset/command/text-style.d.ts +2 -1
- package/dist/_pkgs/affine-inline-preset/command/text-style.js +1 -0
- package/dist/_pkgs/affine-inline-preset/default-inline-manager.js +2 -1
- package/dist/_pkgs/affine-inline-preset/inline-spec.d.ts +4 -0
- package/dist/_pkgs/affine-inline-preset/inline-spec.js +14 -0
- package/dist/_pkgs/affine-inline-preset/translations.d.ts +2 -2
- package/dist/_pkgs/affine-inline-preset/translations.js +2 -2
- package/dist/_pkgs/affine-model/blocks/attachment/attachment-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/bookmark/bookmark-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/edgeless-text/edgeless-text-model.d.ts +1 -1
- package/dist/_pkgs/affine-model/blocks/edgeless-text/edgeless-text-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/embed/iframe/iframe-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/frame/frame-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/image/image-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/latex/latex-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/note/note-model.js +2 -0
- package/dist/_pkgs/affine-model/consts/text.d.ts +26 -0
- package/dist/_pkgs/affine-model/consts/text.js +25 -0
- package/dist/_pkgs/affine-model/elements/shape/shape.d.ts +6 -1
- package/dist/_pkgs/affine-model/elements/shape/shape.js +14 -1
- package/dist/_pkgs/affine-model/elements/text/text.d.ts +6 -1
- package/dist/_pkgs/affine-model/elements/text/text.js +13 -1
- package/dist/_pkgs/affine-model/utils/helper.js +2 -0
- package/dist/_pkgs/affine-model/utils/types.d.ts +2 -2
- package/dist/_pkgs/affine-rich-text/conversion.d.ts +25 -0
- package/dist/_pkgs/affine-rich-text/conversion.js +9 -0
- package/dist/_pkgs/affine-rich-text/index.d.ts +1 -1
- package/dist/_pkgs/affine-rich-text/index.js +1 -1
- package/dist/_pkgs/affine-shared/commands/model-crud/replace-selected-text-with-blocks.d.ts +1 -1
- package/dist/_pkgs/affine-shared/services/canvas-grid.d.ts +63 -0
- package/dist/_pkgs/affine-shared/services/canvas-grid.js +109 -0
- package/dist/_pkgs/affine-shared/services/canvas-local-visibility.d.ts +64 -0
- package/dist/_pkgs/affine-shared/services/canvas-local-visibility.js +192 -0
- package/dist/_pkgs/affine-shared/services/edit-props-store.d.ts +31 -4
- package/dist/_pkgs/affine-shared/services/edit-props-store.js +34 -0
- package/dist/_pkgs/affine-shared/services/editor-setting-service.d.ts +3 -0
- package/dist/_pkgs/affine-shared/services/editor-setting-service.js +7 -0
- package/dist/_pkgs/affine-shared/services/feature-flag-service.d.ts +4 -0
- package/dist/_pkgs/affine-shared/services/font-loader/config.d.ts +2 -2
- package/dist/_pkgs/affine-shared/services/font-loader/font-loader-service.d.ts +3 -3
- package/dist/_pkgs/affine-shared/services/index.d.ts +4 -1
- package/dist/_pkgs/affine-shared/services/index.js +4 -1
- package/dist/_pkgs/affine-shared/services/link-preview-service/link-preview-storage.d.ts +4 -4
- package/dist/_pkgs/affine-shared/services/outline-panel-service.d.ts +31 -0
- package/dist/_pkgs/affine-shared/services/outline-panel-service.js +17 -0
- package/dist/_pkgs/affine-shared/services/selection-pane-service.d.ts +44 -0
- package/dist/_pkgs/affine-shared/services/selection-pane-service.js +28 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +69 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/telemetry-service.d.ts +2 -2
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +16 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +28 -0
- package/dist/_pkgs/affine-shared/styles/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/styles/index.js +1 -0
- package/dist/_pkgs/affine-shared/styles/panel-header.d.ts +31 -0
- package/dist/_pkgs/affine-shared/styles/panel-header.js +61 -0
- package/dist/_pkgs/affine-shared/styles/text.js +7 -7
- package/dist/_pkgs/affine-shared/types/index.d.ts +6 -0
- package/dist/_pkgs/affine-shared/utils/canvas-export-colors.d.ts +26 -0
- package/dist/_pkgs/affine-shared/utils/canvas-export-colors.js +127 -0
- package/dist/_pkgs/affine-shared/utils/file/filesys.d.ts +8 -11
- package/dist/_pkgs/affine-shared/utils/file/filesys.js +8 -11
- package/dist/_pkgs/affine-shared/utils/index.d.ts +3 -0
- package/dist/_pkgs/affine-shared/utils/index.js +3 -0
- package/dist/_pkgs/affine-shared/utils/label-mode.d.ts +47 -0
- package/dist/_pkgs/affine-shared/utils/label-mode.js +55 -0
- package/dist/_pkgs/affine-shared/utils/model/merge-to-code-model.js +7 -1
- package/dist/_pkgs/affine-shared/utils/model/transform-model.js +5 -0
- package/dist/_pkgs/affine-shared/utils/panel-reorder-drag.d.ts +85 -0
- package/dist/_pkgs/affine-shared/utils/panel-reorder-drag.js +162 -0
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/utils.js +10 -3
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +25 -49
- package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.d.ts +4 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.js +4 -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/selection-pane/drop.d.ts +62 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/drop.js +94 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/labels.d.ts +17 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/labels.js +95 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-default.d.ts +10 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-default.js +31 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-tool.d.ts +26 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-tool.js +82 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-widget.d.ts +186 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-widget.js +1417 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.d.ts +52 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.js +161 -1
- package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +10 -0
- package/dist/_pkgs/affine-widget-note-slicer/note-slicer.js +7 -3
- package/dist/_pkgs/std/gfx/controller.d.ts +13 -0
- package/dist/_pkgs/std/gfx/controller.js +22 -2
- package/dist/_pkgs/std/gfx/grid.d.ts +31 -2
- package/dist/_pkgs/std/gfx/index.d.ts +3 -1
- package/dist/_pkgs/std/gfx/index.js +3 -1
- package/dist/_pkgs/std/gfx/interactivity/manager.js +7 -0
- package/dist/_pkgs/std/gfx/layer.js +73 -5
- package/dist/_pkgs/std/gfx/local-visibility.d.ts +88 -0
- package/dist/_pkgs/std/gfx/local-visibility.js +217 -0
- package/dist/_pkgs/std/gfx/model/gfx-block-model.d.ts +13 -0
- package/dist/_pkgs/std/gfx/model/surface/element-model.d.ts +34 -0
- package/dist/_pkgs/std/gfx/model/surface/element-model.js +65 -1
- package/dist/_pkgs/std/gfx/model/surface/surface-model.d.ts +27 -0
- package/dist/_pkgs/std/gfx/model/surface/surface-model.js +43 -0
- package/dist/_pkgs/std/gfx/model/surface/user-layers.d.ts +68 -0
- package/dist/_pkgs/std/gfx/model/surface/user-layers.js +127 -0
- package/dist/_pkgs/std/scope/std-scope.d.ts +1 -1
- package/dist/_pkgs/std/utils/layer.d.ts +10 -0
- package/dist/_pkgs/std/utils/layer.js +64 -13
- package/dist/_pkgs/std/view/element/gfx-block-component.js +10 -2
- package/dist/commands.js +6 -1
- package/dist/host-panels.d.ts +90 -0
- package/dist/host-panels.js +111 -0
- package/dist/translations.js +10 -6
- package/package.json +13 -2
- package/dist/_pkgs/affine-components/icons/file-icons-rc.d.ts +0 -1
- package/dist/_pkgs/affine-components/icons/file-icons-rc.js +0 -130
- package/dist/_pkgs/affine-fragment-frame-panel/utils/drag.d.ts +0 -27
- package/dist/_pkgs/affine-fragment-frame-panel/utils/drag.js +0 -96
- package/dist/_pkgs/affine-shared/services/sidebar-service.d.ts +0 -8
- package/dist/_pkgs/affine-shared/services/sidebar-service.js +0 -7
- package/dist/_pkgs/affine-shared/test-utils/affine-template.d.ts +0 -6
- package/dist/_pkgs/affine-shared/test-utils/affine-template.js +0 -258
- package/dist/_pkgs/affine-shared/test-utils/affine-test-utils.d.ts +0 -8
- package/dist/_pkgs/affine-shared/test-utils/affine-test-utils.js +0 -81
- package/dist/_pkgs/affine-shared/test-utils/create-test-host.d.ts +0 -23
- package/dist/_pkgs/affine-shared/test-utils/create-test-host.js +0 -187
- package/dist/_pkgs/affine-shared/test-utils/index.d.ts +0 -3
- package/dist/_pkgs/affine-shared/test-utils/index.js +0 -3
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { menu, popMenu, popupTargetFromElement, } from '../../../affine-components/context-menu/index.js';
|
|
1
2
|
import { FrameworkBackgroundElementModel } from '../../../affine-model/index.js';
|
|
2
|
-
import {
|
|
3
|
-
import { BlockFlavourIdentifier } from '../../../std/index.js';
|
|
3
|
+
import { ActionPlacement, ToolbarModuleExtension, toolbarModuleKey, translateKey, } from '../../../affine-shared/services/index.js';
|
|
4
|
+
import { BlockFlavourIdentifier, getRegisteredCommands, runCommand, } from '../../../std/index.js';
|
|
5
|
+
import { signal } from '@preact/signals-core';
|
|
4
6
|
import { html } from 'lit';
|
|
7
|
+
import { DEFAULT_BOARD_SVG_EXPORT_OPTIONS, } from './parts.js';
|
|
8
|
+
import { EXPORT_SVG_CONFIRM, EXPORT_SVG_OPTION_FRAMEWORK, EXPORT_SVG_OPTION_SHAPES, EXPORT_SVG_OPTION_TEXTS, } from './translations.js';
|
|
5
9
|
/**
|
|
6
10
|
* A sheet with an arrow leaving it: the board, on its way out of the editor.
|
|
7
11
|
*
|
|
@@ -27,15 +31,113 @@ const ExportSvgIcon = html `<svg
|
|
|
27
31
|
const EXPORT_SVG_COMMAND_ID = 'export.svg';
|
|
28
32
|
const EXPORT_SVG_LABEL_KEY = 'com.labre.command.export.svg';
|
|
29
33
|
const EXPORT_SVG_LABEL_FALLBACK = 'Export SVG';
|
|
34
|
+
// `z.z-` and not `z.`: a framework's own export (`z.export-owm`,
|
|
35
|
+
// `z.export-xml`, `z.export-mermaid`) is the format that says what the board
|
|
36
|
+
// MEANS, and it reads first. The picture reads last, under everything, which
|
|
37
|
+
// is also where a reader looks for it.
|
|
38
|
+
const EXPORT_SVG_ACTION_ID = 'z.z-export-svg';
|
|
39
|
+
/** The same `source` the row's own entries report (`commandMoreAction`). */
|
|
40
|
+
const INVOCATION = {
|
|
41
|
+
surface: 'contextual-toolbar',
|
|
42
|
+
source: 'toolbar:general',
|
|
43
|
+
};
|
|
44
|
+
const findCommand = (std) => getRegisteredCommands(std).find(command => command.id === EXPORT_SVG_COMMAND_ID);
|
|
45
|
+
/**
|
|
46
|
+
* The reader's last choice, per editor and for the session only: it is a
|
|
47
|
+
* habit of the person exporting, not a property of the document, so it is
|
|
48
|
+
* neither stored in the document nor in the browser. Per editor rather than
|
|
49
|
+
* per module so two editors on one page do not answer for each other.
|
|
50
|
+
*/
|
|
51
|
+
const lastChoice = new WeakMap();
|
|
52
|
+
const SWITCHES = [
|
|
53
|
+
['framework', EXPORT_SVG_OPTION_FRAMEWORK],
|
|
54
|
+
['shapes', EXPORT_SVG_OPTION_SHAPES],
|
|
55
|
+
['texts', EXPORT_SVG_OPTION_TEXTS],
|
|
56
|
+
];
|
|
57
|
+
/**
|
|
58
|
+
* The options menu: three switches and Export, anchored on the "⋮" whose menu
|
|
59
|
+
* it replaces. Built from the library's menu primitives (`menu.toggleSwitch`,
|
|
60
|
+
* as the HTML embed's settings do) rather than a modal of its own.
|
|
61
|
+
*
|
|
62
|
+
* The choice lives in a signal read through `menu.dynamic`, so a row redrawn
|
|
63
|
+
* after a flip says the CURRENT value: `toggleSwitch` hands its row click the
|
|
64
|
+
* `on` it was built with, and a static `on` would undo a flip when the reader
|
|
65
|
+
* then clicked the row's words.
|
|
66
|
+
*/
|
|
67
|
+
function openExportSvgOptions(std, command, item) {
|
|
68
|
+
const more = item.closest('editor-menu-button');
|
|
69
|
+
more?.hide();
|
|
70
|
+
const choice = signal({
|
|
71
|
+
...(lastChoice.get(std) ?? DEFAULT_BOARD_SVG_EXPORT_OPTIONS),
|
|
72
|
+
});
|
|
73
|
+
popMenu(popupTargetFromElement(more ?? item), {
|
|
74
|
+
options: {
|
|
75
|
+
items: [
|
|
76
|
+
menu.group({
|
|
77
|
+
items: [
|
|
78
|
+
menu.dynamic(() => SWITCHES.map(([part, wording]) => menu.toggleSwitch({
|
|
79
|
+
name: translateKey(std, ...wording),
|
|
80
|
+
on: choice.value[part],
|
|
81
|
+
onChange: on => {
|
|
82
|
+
choice.value = { ...choice.peek(), [part]: on };
|
|
83
|
+
},
|
|
84
|
+
testId: `export-svg-option-${part}`,
|
|
85
|
+
}))),
|
|
86
|
+
],
|
|
87
|
+
}),
|
|
88
|
+
menu.group({
|
|
89
|
+
items: [
|
|
90
|
+
menu.action({
|
|
91
|
+
name: translateKey(std, ...EXPORT_SVG_CONFIRM),
|
|
92
|
+
prefix: ExportSvgIcon,
|
|
93
|
+
testId: 'export-svg-confirm',
|
|
94
|
+
select: () => {
|
|
95
|
+
const options = { ...choice.peek() };
|
|
96
|
+
lastChoice.set(std, options);
|
|
97
|
+
runCommand(std, command, INVOCATION, options);
|
|
98
|
+
},
|
|
99
|
+
}),
|
|
100
|
+
],
|
|
101
|
+
}),
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The "⋮" entry. It invokes the registered command like `commandMoreAction`
|
|
108
|
+
* does — one behaviour, one availability rule, one usage record per export —
|
|
109
|
+
* but asks for the options first, so it draws its own line: a menu line's
|
|
110
|
+
* `run` is handed no element to anchor a popup on.
|
|
111
|
+
*/
|
|
112
|
+
const exportSvgMoreAction = {
|
|
113
|
+
id: EXPORT_SVG_ACTION_ID,
|
|
114
|
+
placement: ActionPlacement.More,
|
|
115
|
+
when: (ctx) => {
|
|
116
|
+
const command = findCommand(ctx.std);
|
|
117
|
+
return command !== undefined && (command.when?.(ctx.std) ?? true);
|
|
118
|
+
},
|
|
119
|
+
content: (ctx) => {
|
|
120
|
+
const label = translateKey(ctx.std, EXPORT_SVG_LABEL_KEY, EXPORT_SVG_LABEL_FALLBACK);
|
|
121
|
+
return html `
|
|
122
|
+
<editor-menu-action
|
|
123
|
+
data-testid="z-export-svg"
|
|
124
|
+
data-toolbar-action-id=${EXPORT_SVG_ACTION_ID}
|
|
125
|
+
aria-label=${label}
|
|
126
|
+
@click=${(event) => {
|
|
127
|
+
const command = findCommand(ctx.std);
|
|
128
|
+
if (!command)
|
|
129
|
+
return;
|
|
130
|
+
openExportSvgOptions(ctx.std, command, event.currentTarget);
|
|
131
|
+
}}
|
|
132
|
+
>
|
|
133
|
+
${ExportSvgIcon}
|
|
134
|
+
<span class="label">${label}</span>
|
|
135
|
+
</editor-menu-action>
|
|
136
|
+
`;
|
|
137
|
+
},
|
|
138
|
+
};
|
|
30
139
|
export const exportSvgToolbarConfig = {
|
|
31
|
-
actions: [
|
|
32
|
-
commandMoreAction(
|
|
33
|
-
// `z.z-` and not `z.`: a framework's own export (`z.export-owm`,
|
|
34
|
-
// `z.export-xml`, `z.export-mermaid`) is the format that says what the
|
|
35
|
-
// board MEANS, and it reads first. The picture reads last, under
|
|
36
|
-
// everything, which is also where a reader looks for it.
|
|
37
|
-
'z.z-export-svg', EXPORT_SVG_COMMAND_ID, EXPORT_SVG_LABEL_KEY, EXPORT_SVG_LABEL_FALLBACK, ExportSvgIcon),
|
|
38
|
-
],
|
|
140
|
+
actions: [exportSvgMoreAction],
|
|
39
141
|
// The module says "a board is selected"; the command's own `when` says the
|
|
40
142
|
// same thing from the registry side, and the two are deliberately both there
|
|
41
143
|
// — the entry is drawn from the module and the behaviour is guarded by the
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChromeWording } from '../../../affine-shared/services/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The words of the "Export SVG" options menu (ADR 0025, amendment of
|
|
4
|
+
* 2026-10-04), one switch per part of the picture, and the one sentence said
|
|
5
|
+
* when the switches leave nothing to draw. The command's own label and
|
|
6
|
+
* description are declared on its descriptor.
|
|
7
|
+
*/
|
|
8
|
+
export declare const EXPORT_SVG_OPTION_FRAMEWORK: ChromeWording;
|
|
9
|
+
export declare const EXPORT_SVG_OPTION_SHAPES: ChromeWording;
|
|
10
|
+
export declare const EXPORT_SVG_OPTION_TEXTS: ChromeWording;
|
|
11
|
+
export declare const EXPORT_SVG_CONFIRM: ChromeWording;
|
|
12
|
+
export declare const EXPORT_SVG_NOTHING_TO_EXPORT: ChromeWording;
|
|
13
|
+
export declare const EXPORT_SVG_WORDINGS: readonly ChromeWording[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words of the "Export SVG" options menu (ADR 0025, amendment of
|
|
3
|
+
* 2026-10-04), one switch per part of the picture, and the one sentence said
|
|
4
|
+
* when the switches leave nothing to draw. The command's own label and
|
|
5
|
+
* description are declared on its descriptor.
|
|
6
|
+
*/
|
|
7
|
+
export const EXPORT_SVG_OPTION_FRAMEWORK = [
|
|
8
|
+
'com.labre.export.svg.option.framework',
|
|
9
|
+
'Framework elements',
|
|
10
|
+
];
|
|
11
|
+
export const EXPORT_SVG_OPTION_SHAPES = [
|
|
12
|
+
'com.labre.export.svg.option.shapes',
|
|
13
|
+
'Other shapes and strokes',
|
|
14
|
+
];
|
|
15
|
+
export const EXPORT_SVG_OPTION_TEXTS = [
|
|
16
|
+
'com.labre.export.svg.option.texts',
|
|
17
|
+
'Other texts',
|
|
18
|
+
];
|
|
19
|
+
export const EXPORT_SVG_CONFIRM = [
|
|
20
|
+
'com.labre.export.svg.confirm',
|
|
21
|
+
'Export',
|
|
22
|
+
];
|
|
23
|
+
export const EXPORT_SVG_NOTHING_TO_EXPORT = [
|
|
24
|
+
'com.labre.export.svg.nothing',
|
|
25
|
+
'Nothing to export: the options leave nothing of this board to draw.',
|
|
26
|
+
];
|
|
27
|
+
export const EXPORT_SVG_WORDINGS = [
|
|
28
|
+
EXPORT_SVG_OPTION_FRAMEWORK,
|
|
29
|
+
EXPORT_SVG_OPTION_SHAPES,
|
|
30
|
+
EXPORT_SVG_OPTION_TEXTS,
|
|
31
|
+
EXPORT_SVG_CONFIRM,
|
|
32
|
+
EXPORT_SVG_NOTHING_TO_EXPORT,
|
|
33
|
+
];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './audit.js';
|
|
2
|
+
export * from './canvas-grid/index.js';
|
|
2
3
|
export * from './clipboard-config.js';
|
|
3
4
|
export * from './crud-extension.js';
|
|
4
5
|
export * from './dom-element-renderer.js';
|
|
@@ -20,11 +21,13 @@ export * from './reading.js';
|
|
|
20
21
|
export * from './reading-toolbar.js';
|
|
21
22
|
export * from './reading-widget.js';
|
|
22
23
|
export * from './record-action.js';
|
|
24
|
+
export * from './selection-pane/index.js';
|
|
23
25
|
export * from './spotlight.js';
|
|
24
26
|
export * from './surface-middleware.js';
|
|
25
27
|
export * from './svg-sketch.js';
|
|
26
28
|
export * from './svg-sketch-translations.js';
|
|
27
29
|
export * from './tags-toolbar.js';
|
|
30
|
+
export * from './user-layers/index.js';
|
|
28
31
|
export * from './validation.js';
|
|
29
32
|
export * from './validation-toolbar.js';
|
|
30
33
|
export * from './violation-detail-widget.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './audit.js';
|
|
2
|
+
export * from './canvas-grid/index.js';
|
|
2
3
|
export * from './clipboard-config.js';
|
|
3
4
|
export * from './crud-extension.js';
|
|
4
5
|
export * from './dom-element-renderer.js';
|
|
@@ -20,11 +21,13 @@ export * from './reading.js';
|
|
|
20
21
|
export * from './reading-toolbar.js';
|
|
21
22
|
export * from './reading-widget.js';
|
|
22
23
|
export * from './record-action.js';
|
|
24
|
+
export * from './selection-pane/index.js';
|
|
23
25
|
export * from './spotlight.js';
|
|
24
26
|
export * from './surface-middleware.js';
|
|
25
27
|
export * from './svg-sketch.js';
|
|
26
28
|
export * from './svg-sketch-translations.js';
|
|
27
29
|
export * from './tags-toolbar.js';
|
|
30
|
+
export * from './user-layers/index.js';
|
|
28
31
|
export * from './validation.js';
|
|
29
32
|
export * from './validation-toolbar.js';
|
|
30
33
|
export * from './violation-detail-widget.js';
|
|
@@ -130,13 +130,20 @@ export declare class ReadingProposalWidget extends EditorAnchoredPanel {
|
|
|
130
130
|
*/
|
|
131
131
|
private _renderValueFlow;
|
|
132
132
|
/**
|
|
133
|
-
*
|
|
133
|
+
* The zone of the frame the subject sits in — Wardley's evolution phase, a
|
|
134
|
+
* Core Domain Chart's quadrant, a BPMN lane — under the framework's own
|
|
135
|
+
* heading (`frame.label`), or the engine's default for a profile that names
|
|
136
|
+
* none (`readingFrameWording`).
|
|
134
137
|
*
|
|
135
|
-
* Absent ENTIRELY — not "no
|
|
136
|
-
* frame. The empty state below is about
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
138
|
+
* Absent ENTIRELY — not "no zone to read" — for a framework that declares no
|
|
139
|
+
* frame. The empty state below is about an artefact that could have been on
|
|
140
|
+
* a frame and is not, in the framework's own words (`frame.none`) or the
|
|
141
|
+
* default ones.
|
|
142
|
+
*
|
|
143
|
+
* The zone is named the way the board names it: the user's words when they
|
|
144
|
+
* wrote some (a renamed quadrant, a lane's name), the vocabulary otherwise,
|
|
145
|
+
* and "Unnamed" for a zone the board paints but never writes on — never the
|
|
146
|
+
* zone's id, which is not a word anyone drew.
|
|
140
147
|
*/
|
|
141
148
|
private _renderPhase;
|
|
142
149
|
private _renderNaming;
|
|
@@ -40,7 +40,7 @@ import { css, html, nothing } from 'lit';
|
|
|
40
40
|
import { state } from 'lit/decorators.js';
|
|
41
41
|
import { literal, unsafeStatic } from 'lit/static-html.js';
|
|
42
42
|
import { EditorAnchoredPanel, editorAnchoredPanelStyles, } from './editor-anchored-panel.js';
|
|
43
|
-
import { PivotRecordPickerProvider, ReadingManager, readingRelationDefs, readRecord, readValueFlows, } from './reading.js';
|
|
43
|
+
import { PivotRecordPickerProvider, ReadingManager, readingFrameWording, readingRelationDefs, readRecord, readValueFlows, } from './reading.js';
|
|
44
44
|
export const READING_PROPOSAL_WIDGET = 'affine-reading-proposal-widget';
|
|
45
45
|
/** The two commands the confirmations drive. Spelled once. */
|
|
46
46
|
const TAG_SET_ID = 'tag.set';
|
|
@@ -514,21 +514,37 @@ let ReadingProposalWidget = (() => {
|
|
|
514
514
|
</div>`)}`);
|
|
515
515
|
}
|
|
516
516
|
/**
|
|
517
|
-
*
|
|
517
|
+
* The zone of the frame the subject sits in — Wardley's evolution phase, a
|
|
518
|
+
* Core Domain Chart's quadrant, a BPMN lane — under the framework's own
|
|
519
|
+
* heading (`frame.label`), or the engine's default for a profile that names
|
|
520
|
+
* none (`readingFrameWording`).
|
|
518
521
|
*
|
|
519
|
-
* Absent ENTIRELY — not "no
|
|
520
|
-
* frame. The empty state below is about
|
|
521
|
-
*
|
|
522
|
-
*
|
|
523
|
-
*
|
|
522
|
+
* Absent ENTIRELY — not "no zone to read" — for a framework that declares no
|
|
523
|
+
* frame. The empty state below is about an artefact that could have been on
|
|
524
|
+
* a frame and is not, in the framework's own words (`frame.none`) or the
|
|
525
|
+
* default ones.
|
|
526
|
+
*
|
|
527
|
+
* The zone is named the way the board names it: the user's words when they
|
|
528
|
+
* wrote some (a renamed quadrant, a lane's name), the vocabulary otherwise,
|
|
529
|
+
* and "Unnamed" for a zone the board paints but never writes on — never the
|
|
530
|
+
* zone's id, which is not a word anyone drew.
|
|
524
531
|
*/
|
|
525
532
|
_renderPhase(reading, profile) {
|
|
526
533
|
if (!profile.frame)
|
|
527
534
|
return nothing;
|
|
535
|
+
const { label, none } = readingFrameWording(profile.frame);
|
|
528
536
|
const { phase } = reading;
|
|
529
|
-
|
|
537
|
+
const words = !phase
|
|
538
|
+
? ''
|
|
539
|
+
: phase.name !== undefined
|
|
540
|
+
? phase.name.trim()
|
|
541
|
+
: phase.labelKey !== undefined
|
|
542
|
+
? translateKey(this.std, phase.labelKey, phase.labelFallback ?? phase.labelKey)
|
|
543
|
+
: (phase.labelFallback ?? '');
|
|
544
|
+
return this._field('reading-phase', translateKey(this.std, label.labelKey, label.labelFallback), phase
|
|
530
545
|
? html `<div class="reading-value" data-zone-id=${phase.zoneId}>
|
|
531
|
-
${
|
|
546
|
+
${words ||
|
|
547
|
+
translateKey(this.std, 'com.labre.reading.zone.unnamed', 'Unnamed')}
|
|
532
548
|
</div>
|
|
533
549
|
${phase.inTransitionBand
|
|
534
550
|
? html `<div class="reading-note" data-testid="reading-phase-band">
|
|
@@ -537,7 +553,7 @@ let ReadingProposalWidget = (() => {
|
|
|
537
553
|
</div>`
|
|
538
554
|
: nothing}`
|
|
539
555
|
: html `<div class="reading-empty" data-testid="reading-phase-none">
|
|
540
|
-
${translateKey(this.std,
|
|
556
|
+
${translateKey(this.std, none.labelKey, none.labelFallback)}
|
|
541
557
|
</div>`);
|
|
542
558
|
}
|
|
543
559
|
_renderNaming(reading) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TagDef } from '../../affine-shared/services/index.js';
|
|
1
|
+
import { type ChromeWording, type TagDef } from '../../affine-shared/services/index.js';
|
|
2
2
|
import { LifeCycleWatcher, type BlockStdScope, type FrameworkId } from '../../std/index.js';
|
|
3
3
|
import type { RoleDefs, RoleId } from '../../std/gfx/index.js';
|
|
4
4
|
import { GfxPrimitiveElementModel } from '../../std/gfx/index.js';
|
|
@@ -92,6 +92,14 @@ export interface ReadingRelationSideLabel {
|
|
|
92
92
|
/** The framework's own English wording, for a host that ships no catalogue. */
|
|
93
93
|
labelFallback: string;
|
|
94
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* One wording a framework declares for the frame field of the panel: key plus
|
|
97
|
+
* its own English, so a host with no catalogue still reads a real phrase.
|
|
98
|
+
*/
|
|
99
|
+
export interface ReadingFrameWording {
|
|
100
|
+
labelKey: string;
|
|
101
|
+
labelFallback: string;
|
|
102
|
+
}
|
|
95
103
|
/**
|
|
96
104
|
* The typed edge a reading walks, and the two words the framework reads it
|
|
97
105
|
* with.
|
|
@@ -185,13 +193,41 @@ export interface ReadingProfile {
|
|
|
185
193
|
* reads them in, so the first is the question the artefact answers first.
|
|
186
194
|
*/
|
|
187
195
|
alsoRelations?: readonly ReadingRelationDef[];
|
|
188
|
-
/**
|
|
196
|
+
/**
|
|
197
|
+
* The frame the subject's ZONE is read from — Wardley's evolution phase, a
|
|
198
|
+
* Core Domain Chart's quadrant, a BPMN pool's lane.
|
|
199
|
+
*/
|
|
189
200
|
frame?: {
|
|
190
201
|
backgroundRole: RoleId;
|
|
191
202
|
/** The declaration itself, carried as data exactly like `roles` is. */
|
|
192
203
|
background: FrameworkBackgroundDef;
|
|
193
|
-
/**
|
|
194
|
-
|
|
204
|
+
/**
|
|
205
|
+
* The plot axis the zones are laid ALONG, for a frame read in one
|
|
206
|
+
* dimension: Wardley's phases are columns of the evolution axis, so only
|
|
207
|
+
* the `x` position matters and a component in the top or bottom margin of
|
|
208
|
+
* the plot still has a phase.
|
|
209
|
+
*
|
|
210
|
+
* Absent, the frame is read in TWO dimensions: the subject is in the zone
|
|
211
|
+
* whose rectangle holds its centre — a quadrant, a lane — and nowhere when
|
|
212
|
+
* none does. A 2D frame has no transition band.
|
|
213
|
+
*/
|
|
214
|
+
axis?: 'x' | 'y';
|
|
215
|
+
/**
|
|
216
|
+
* The panel's heading for the field — "Evolution phase", "Zone", "Lane".
|
|
217
|
+
* The framework's own word, like a relation's sides: the panel used to
|
|
218
|
+
* hard-code Wardley's, which a chart or a pool would have worn too.
|
|
219
|
+
*
|
|
220
|
+
* Optional because a 0.43 profile has no such field and a minor release
|
|
221
|
+
* never breaks a host: absent, the panel reads
|
|
222
|
+
* {@link READING_FRAME_DEFAULT_WORDING}, which is what 0.43 showed for
|
|
223
|
+
* every frame (`readingFrameWording`).
|
|
224
|
+
*/
|
|
225
|
+
label?: ReadingFrameWording;
|
|
226
|
+
/**
|
|
227
|
+
* What the field says when the subject sits in no zone of any frame.
|
|
228
|
+
* Optional for the reason {@link label} is, with the same default.
|
|
229
|
+
*/
|
|
230
|
+
none?: ReadingFrameWording;
|
|
195
231
|
};
|
|
196
232
|
/**
|
|
197
233
|
* Which properties of the PIVOT RECORD the reading may compare itself
|
|
@@ -207,6 +243,21 @@ export interface ReadingProfile {
|
|
|
207
243
|
phase?: string;
|
|
208
244
|
};
|
|
209
245
|
}
|
|
246
|
+
/** The default frame wording, as the rows the key manifest walks. */
|
|
247
|
+
export declare const READING_FRAME_WORDINGS: readonly ChromeWording[];
|
|
248
|
+
/** The default frame wording, as a profile's `frame.label` / `frame.none`. */
|
|
249
|
+
export declare const READING_FRAME_DEFAULT_WORDING: Readonly<{
|
|
250
|
+
label: ReadingFrameWording;
|
|
251
|
+
none: ReadingFrameWording;
|
|
252
|
+
}>;
|
|
253
|
+
/**
|
|
254
|
+
* The two wordings the panel reads a frame with: the framework's own where it
|
|
255
|
+
* declares them, {@link READING_FRAME_DEFAULT_WORDING} where it does not.
|
|
256
|
+
*/
|
|
257
|
+
export declare function readingFrameWording(frame: NonNullable<ReadingProfile['frame']>): {
|
|
258
|
+
label: ReadingFrameWording;
|
|
259
|
+
none: ReadingFrameWording;
|
|
260
|
+
};
|
|
210
261
|
/** Where the other end of a typed edge sits, relative to the subject. */
|
|
211
262
|
export type ReadingRelationSide = 'consumer' | 'supplier';
|
|
212
263
|
/**
|
|
@@ -271,12 +322,24 @@ export interface ReadingRelation {
|
|
|
271
322
|
*/
|
|
272
323
|
contradictsGeometry: boolean;
|
|
273
324
|
}
|
|
274
|
-
/**
|
|
325
|
+
/**
|
|
326
|
+
* The zone of the frame the subject sits in: a phase along an axis, or a
|
|
327
|
+
* region of the plane (see `ReadingProfile.frame.axis`).
|
|
328
|
+
*/
|
|
275
329
|
export interface ReadingPhase {
|
|
276
|
-
/** The
|
|
330
|
+
/** The zone id, e.g. `product`, or `lane:<id>` for an instance zone. */
|
|
277
331
|
zoneId: string;
|
|
332
|
+
/** The declared zone's vocabulary, absent on a zone the board never names. */
|
|
278
333
|
labelKey?: string;
|
|
279
334
|
labelFallback?: string;
|
|
335
|
+
/**
|
|
336
|
+
* The words the USER wrote for this zone, which is what the board paints in
|
|
337
|
+
* place of the vocabulary: a renamed zone label stored on the frame (the
|
|
338
|
+
* declaration's `label.prop`), or a lane's name. Wins over
|
|
339
|
+
* {@link labelKey} exactly as it does on the canvas (`backgroundLabelText`),
|
|
340
|
+
* so the panel and the board never name one zone two ways.
|
|
341
|
+
*/
|
|
342
|
+
name?: string;
|
|
280
343
|
/**
|
|
281
344
|
* The subject sits in the band around a zone transition — Wardley's zone of
|
|
282
345
|
* punctuated equilibrium, declared by the background as
|
|
@@ -331,6 +394,19 @@ export interface ElementReading {
|
|
|
331
394
|
/** `undefined` with no nature, no convention for it, or no name to judge. */
|
|
332
395
|
naming: ReadingNaming | undefined;
|
|
333
396
|
}
|
|
397
|
+
/**
|
|
398
|
+
* The subject's NAME.
|
|
399
|
+
*
|
|
400
|
+
* Its own text first, then — because a framework artefact on this canvas is a
|
|
401
|
+
* composite — the text of the sibling carrying the profile's label role. That
|
|
402
|
+
* is the same fact `tags-toolbar.ts` works around from the other direction: one
|
|
403
|
+
* click selects the group, the role lives on the circle, and the name lives on
|
|
404
|
+
* a free text beside it.
|
|
405
|
+
*
|
|
406
|
+
* Exported for the selection pane, which names its rows the same way (ADR 0031
|
|
407
|
+
* §12): one rule for "what is this element called", not two.
|
|
408
|
+
*/
|
|
409
|
+
export declare function readName(element: GfxPrimitiveElementModel, profile: Pick<ReadingProfile, 'labelRole' | 'roles'>): string;
|
|
334
410
|
/** What the reading needs to know that is not in the document. */
|
|
335
411
|
export interface ReadingOptions {
|
|
336
412
|
/**
|
|
@@ -8,7 +8,49 @@ import { effect, signal } from '@preact/signals-core';
|
|
|
8
8
|
// reading is a one-way read of pure declaration data that must never pull a
|
|
9
9
|
// canvas in.
|
|
10
10
|
import { backgroundPlot, } from '../framework-background/def.js';
|
|
11
|
-
import { backgroundTransitionBands, containingFrame, } from '../framework-background/facts.js';
|
|
11
|
+
import { backgroundPlotRatios, backgroundTransitionBands, backgroundZoneAt, backgroundZones, containingFrame, } from '../framework-background/facts.js';
|
|
12
|
+
/**
|
|
13
|
+
* The frame wording of a profile that declares none — the heading and the
|
|
14
|
+
* empty state 0.43 showed for every frame, before a framework could name its
|
|
15
|
+
* own.
|
|
16
|
+
*
|
|
17
|
+
* Owned by the ENGINE rather than by Wardley, whose words they also are,
|
|
18
|
+
* because a host profile written against 0.43 reads with them too: declared in
|
|
19
|
+
* a framework bundle, they would vanish from a host that does not install it.
|
|
20
|
+
* Wardley's profile declares no wording and inherits these.
|
|
21
|
+
*
|
|
22
|
+
* Spelled as `[key, English]` rows, the form the key manifest walks and its
|
|
23
|
+
* drift check pairs with this declaration, then read as a profile's wording.
|
|
24
|
+
*/
|
|
25
|
+
const READING_FRAME_DEFAULT_LABEL = [
|
|
26
|
+
'com.labre.reading.field.phase',
|
|
27
|
+
'Evolution phase',
|
|
28
|
+
];
|
|
29
|
+
const READING_FRAME_DEFAULT_NONE = [
|
|
30
|
+
'com.labre.reading.phase.none',
|
|
31
|
+
'Not on a framework background — no phase to read.',
|
|
32
|
+
];
|
|
33
|
+
/** The default frame wording, as the rows the key manifest walks. */
|
|
34
|
+
export const READING_FRAME_WORDINGS = [
|
|
35
|
+
READING_FRAME_DEFAULT_LABEL,
|
|
36
|
+
READING_FRAME_DEFAULT_NONE,
|
|
37
|
+
];
|
|
38
|
+
const asFrameWording = ([labelKey, labelFallback,]) => ({ labelKey, labelFallback });
|
|
39
|
+
/** The default frame wording, as a profile's `frame.label` / `frame.none`. */
|
|
40
|
+
export const READING_FRAME_DEFAULT_WORDING = {
|
|
41
|
+
label: asFrameWording(READING_FRAME_DEFAULT_LABEL),
|
|
42
|
+
none: asFrameWording(READING_FRAME_DEFAULT_NONE),
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* The two wordings the panel reads a frame with: the framework's own where it
|
|
46
|
+
* declares them, {@link READING_FRAME_DEFAULT_WORDING} where it does not.
|
|
47
|
+
*/
|
|
48
|
+
export function readingFrameWording(frame) {
|
|
49
|
+
return {
|
|
50
|
+
label: frame.label ?? READING_FRAME_DEFAULT_WORDING.label,
|
|
51
|
+
none: frame.none ?? READING_FRAME_DEFAULT_WORDING.none,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
12
54
|
/**
|
|
13
55
|
* Every relation table a profile declares, in reading order.
|
|
14
56
|
*
|
|
@@ -102,8 +144,11 @@ function groupMembers(element) {
|
|
|
102
144
|
* is the same fact `tags-toolbar.ts` works around from the other direction: one
|
|
103
145
|
* click selects the group, the role lives on the circle, and the name lives on
|
|
104
146
|
* a free text beside it.
|
|
147
|
+
*
|
|
148
|
+
* Exported for the selection pane, which names its rows the same way (ADR 0031
|
|
149
|
+
* §12): one rule for "what is this element called", not two.
|
|
105
150
|
*/
|
|
106
|
-
function readName(element, profile) {
|
|
151
|
+
export function readName(element, profile) {
|
|
107
152
|
const own = ownText(element);
|
|
108
153
|
if (own)
|
|
109
154
|
return own;
|
|
@@ -168,13 +213,37 @@ function frameOf(element, elements, profile) {
|
|
|
168
213
|
roleIsA(candidate.role, frame.backgroundRole, profile.roles)), candidate => candidate.elementBound);
|
|
169
214
|
}
|
|
170
215
|
/**
|
|
171
|
-
*
|
|
216
|
+
* How a zone is named, as the BOARD names it: the user's own words first — a
|
|
217
|
+
* renamed label stored on the frame, a lane's name — then the vocabulary.
|
|
172
218
|
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
|
|
177
|
-
|
|
219
|
+
* The same precedence `backgroundLabelText` paints with, minus the translation:
|
|
220
|
+
* the reading carries the key and the panel resolves it, so the record and the
|
|
221
|
+
* drift comparison keep working on the vocabulary.
|
|
222
|
+
*/
|
|
223
|
+
function zoneWording(zone, model) {
|
|
224
|
+
const label = zone.label;
|
|
225
|
+
const stored = label?.prop !== undefined ? model[label.prop] : undefined;
|
|
226
|
+
const name = stored !== undefined && stored !== null ? String(stored) : zone.name;
|
|
227
|
+
return {
|
|
228
|
+
...(label?.labelKey !== undefined ? { labelKey: label.labelKey } : {}),
|
|
229
|
+
...(label?.fallback !== undefined ? { labelFallback: label.fallback } : {}),
|
|
230
|
+
...(name !== undefined ? { name } : {}),
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* The zone, read from the position and the zones the frame INSTANCE has
|
|
235
|
+
* ({@link backgroundZones}: the framework's in the instance's variant, then the
|
|
236
|
+
* instance's own).
|
|
237
|
+
*
|
|
238
|
+
* Along an axis (Wardley), two facts, both taken from the declaration and never
|
|
239
|
+
* from a number in this file: which zone the subject's centre falls in, and
|
|
240
|
+
* whether it is inside the band around a transition. The second is the "zone of
|
|
241
|
+
* punctuated equilibrium" — the frontier is a region, not a coordinate — and a
|
|
242
|
+
* component sitting in one is a different statement from a component sitting in
|
|
243
|
+
* a phase.
|
|
244
|
+
*
|
|
245
|
+
* In the plane (no `axis`: a Core Domain Chart, a BPMN pool), the zone whose
|
|
246
|
+
* rectangle holds the centre, through the helper the audit uses, and no band.
|
|
178
247
|
*/
|
|
179
248
|
function readPhase(element, elements, profile) {
|
|
180
249
|
const frame = profile.frame;
|
|
@@ -185,11 +254,25 @@ function readPhase(element, elements, profile) {
|
|
|
185
254
|
return undefined;
|
|
186
255
|
const def = frame.background;
|
|
187
256
|
const bound = background.elementBound;
|
|
257
|
+
const model = background;
|
|
258
|
+
const zones = backgroundZones(def, model);
|
|
259
|
+
const axis = frame.axis;
|
|
260
|
+
if (axis === undefined) {
|
|
261
|
+
const at = backgroundPlotRatios(def, bound, element.elementBound);
|
|
262
|
+
const zone = at === null ? undefined : backgroundZoneAt(zones, at);
|
|
263
|
+
if (!zone)
|
|
264
|
+
return undefined;
|
|
265
|
+
return {
|
|
266
|
+
zoneId: zone.id,
|
|
267
|
+
...zoneWording(zone, model),
|
|
268
|
+
inTransitionBand: false,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
188
271
|
const plot = backgroundPlot(def, bound.w, bound.h);
|
|
189
272
|
const [cx, cy] = centreOf(element.elementBound);
|
|
190
|
-
const along =
|
|
191
|
-
const origin =
|
|
192
|
-
const span =
|
|
273
|
+
const along = axis === 'x' ? cx : cy;
|
|
274
|
+
const origin = axis === 'x' ? bound.x + plot.x0 : bound.y + plot.y0;
|
|
275
|
+
const span = axis === 'x' ? plot.width : plot.height;
|
|
193
276
|
if (!(span > 0))
|
|
194
277
|
return undefined;
|
|
195
278
|
const ratio = (along - origin) / span;
|
|
@@ -198,25 +281,20 @@ function readPhase(element, elements, profile) {
|
|
|
198
281
|
// phase it is visibly not in.
|
|
199
282
|
if (ratio < 0 || ratio > 1)
|
|
200
283
|
return undefined;
|
|
201
|
-
const zone =
|
|
202
|
-
const start =
|
|
203
|
-
const size =
|
|
284
|
+
const zone = zones.find(({ rect }) => {
|
|
285
|
+
const start = axis === 'x' ? rect.x : rect.y;
|
|
286
|
+
const size = axis === 'x' ? rect.w : rect.h;
|
|
204
287
|
// Half-open, so a component exactly on a divider reads as the phase it is
|
|
205
288
|
// entering — the same side the band below reports as the frontier.
|
|
206
289
|
return ratio >= start && (ratio < start + size || start + size >= 1);
|
|
207
290
|
});
|
|
208
291
|
if (!zone)
|
|
209
292
|
return undefined;
|
|
210
|
-
const bands = backgroundTransitionBands(def, bound)[
|
|
293
|
+
const bands = backgroundTransitionBands(def, bound)[axis];
|
|
211
294
|
const band = bands.find(({ min, max }) => along >= min && along <= max);
|
|
212
295
|
return {
|
|
213
296
|
zoneId: zone.id,
|
|
214
|
-
...(zone
|
|
215
|
-
? { labelKey: zone.label.labelKey }
|
|
216
|
-
: {}),
|
|
217
|
-
...(zone.label?.fallback !== undefined
|
|
218
|
-
? { labelFallback: zone.label.fallback }
|
|
219
|
-
: {}),
|
|
297
|
+
...zoneWording(zone, model),
|
|
220
298
|
inTransitionBand: band !== undefined,
|
|
221
299
|
...(band !== undefined ? { bandId: band.id } : {}),
|
|
222
300
|
};
|