@formicoidea/labre-core 0.42.0 → 0.45.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-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/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 +3 -0
- 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-data-view/configs/tooltips.js +1 -1
- package/dist/_pkgs/affine-block-database/configs/tooltips.js +1 -1
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-text-block.js +4 -2
- 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/common/iframe-sandbox.d.ts +39 -0
- package/dist/_pkgs/affine-block-embed/common/iframe-sandbox.js +39 -0
- package/dist/_pkgs/affine-block-embed/configs/toolbar.js +11 -2
- package/dist/_pkgs/affine-block-embed/embed-figma-block/embed-figma-block.js +2 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-error-card.d.ts +14 -1
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-error-card.js +21 -2
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +11 -2
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.d.ts +0 -2
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.js +2 -5
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.d.ts +1 -1
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +14 -6
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/types.d.ts +16 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/types.js +17 -1
- package/dist/_pkgs/affine-block-embed/embed-loom-block/embed-loom-block.js +2 -0
- package/dist/_pkgs/affine-block-embed/embed-youtube-block/embed-youtube-block.js +2 -0
- package/dist/_pkgs/affine-block-embed/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-embed/index.js +1 -0
- package/dist/_pkgs/affine-block-embed/translations.d.ts +8 -0
- package/dist/_pkgs/affine-block-embed/translations.js +28 -0
- 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-linked-doc-block/embed-linked-doc-block.js +4 -2
- 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-embed-doc/embed-synced-doc-block/embed-synced-doc-block.js +2 -2
- package/dist/_pkgs/affine-block-frame/frame-manager.d.ts +5 -0
- package/dist/_pkgs/affine-block-frame/frame-manager.js +53 -19
- package/dist/_pkgs/affine-block-frame/frame-tool.js +3 -1
- 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-list/utils/get-list-icon.js +3 -1
- package/dist/_pkgs/affine-block-note/configs/tooltips.js +1 -1
- package/dist/_pkgs/affine-block-note/translations.d.ts +0 -1
- package/dist/_pkgs/affine-block-note/translations.js +0 -5
- package/dist/_pkgs/affine-block-root/adapters/html.js +2 -2
- package/dist/_pkgs/affine-block-root/commands/copy-link-commands.d.ts +2 -0
- package/dist/_pkgs/affine-block-root/commands/copy-link-commands.js +155 -0
- package/dist/_pkgs/affine-block-root/configs/toolbar.js +17 -1
- 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/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-root/index.js +1 -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/view.js +2 -0
- 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/interchange-import.js +13 -1
- package/dist/_pkgs/affine-block-surface/extensions/legend.d.ts +8 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend.js +59 -3
- package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.js +4 -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 +80 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/actions.js +248 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/commands.d.ts +82 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/commands.js +342 -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-translations.d.ts +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.js +23 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +112 -4
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +98 -19
- 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/background-view.js +1 -1
- 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/fit.d.ts +36 -0
- package/dist/_pkgs/affine-block-surface/framework-background/fit.js +30 -0
- package/dist/_pkgs/affine-block-surface/framework-background/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/framework-background/index.js +1 -0
- package/dist/_pkgs/affine-block-surface/framework-background/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/element-highlight-overlay.js +2 -7
- 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/configs/tooltips.js +2 -2
- package/dist/_pkgs/affine-block-surface-ref/surface-ref-block.js +12 -2
- package/dist/_pkgs/affine-components/color-picker/palette-carousel.js +5 -0
- package/dist/_pkgs/affine-components/color-picker/styles.js +1 -1
- package/dist/_pkgs/affine-components/context-menu/button.js +17 -1
- package/dist/_pkgs/affine-components/filterable-list/index.js +30 -9
- package/dist/_pkgs/affine-components/icons/ai.js +3 -3
- 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/list.js +7 -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/size-dropdown-menu/dropdown-menu.js +6 -1
- package/dist/_pkgs/affine-components/toolbar/index.d.ts +1 -1
- package/dist/_pkgs/affine-components/toolbar/index.js +1 -1
- package/dist/_pkgs/affine-components/toolbar/menu-button.d.ts +7 -0
- package/dist/_pkgs/affine-components/toolbar/menu-button.js +30 -0
- package/dist/_pkgs/affine-components/toolbar/picker-menu.d.ts +16 -1
- package/dist/_pkgs/affine-components/toolbar/picker-menu.js +2 -2
- package/dist/_pkgs/affine-components/toolbar/toolbar.d.ts +1 -0
- package/dist/_pkgs/affine-components/toolbar/toolbar.js +67 -0
- package/dist/_pkgs/affine-fragment-adapter-panel/adapter-panel.d.ts +2 -2
- package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card-title-editor.js +1 -1
- package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card.js +3 -3
- 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 +1 -0
- package/dist/_pkgs/affine-fragment-frame-panel/index.js +1 -0
- package/dist/_pkgs/affine-gfx-brush/toolbar/components/eraser/icons.js +1 -1
- package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.d.ts +11 -2
- package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.js +11 -2
- 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 +6 -4
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +24 -8
- package/dist/_pkgs/affine-gfx-connector/translations.d.ts +3 -0
- package/dist/_pkgs/affine-gfx-connector/translations.js +23 -0
- package/dist/_pkgs/affine-gfx-group/command/group-api.js +52 -1
- package/dist/_pkgs/affine-gfx-mindmap/indicator-overlay/index.js +6 -2
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/config.js +4 -2
- package/dist/_pkgs/affine-gfx-mindmap/translations.d.ts +6 -0
- package/dist/_pkgs/affine-gfx-mindmap/translations.js +10 -0
- 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 +5 -3
- package/dist/_pkgs/affine-gfx-shape/translations.d.ts +7 -0
- package/dist/_pkgs/affine-gfx-shape/translations.js +11 -0
- package/dist/_pkgs/affine-gfx-template/builtin/other.js +13 -7
- 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-template/toolbar/template-loading.js +1 -1
- package/dist/_pkgs/affine-gfx-template/translations.d.ts +5 -0
- package/dist/_pkgs/affine-gfx-template/translations.js +38 -0
- package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.js +5 -3
- 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 +56 -3
- 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-gfx-text/translations.d.ts +8 -0
- package/dist/_pkgs/affine-gfx-text/translations.js +12 -0
- package/dist/_pkgs/affine-inline-latex/latex-node/latex-editor-menu.js +2 -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 +41 -2
- package/dist/_pkgs/affine-model/consts/text.js +50 -1
- 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-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 +27 -0
- 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 +13 -2
- package/dist/_pkgs/affine-shared/services/font-loader/config.js +43 -54
- package/dist/_pkgs/affine-shared/services/index.d.ts +3 -0
- package/dist/_pkgs/affine-shared/services/index.js +3 -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/theme-service.d.ts +19 -0
- package/dist/_pkgs/affine-shared/services/theme-service.js +24 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +25 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +90 -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 +2 -0
- package/dist/_pkgs/affine-shared/utils/index.js +2 -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-widget-edgeless-dragging-area/edgeless-dragging-area-rect.js +2 -2
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/utils.js +15 -4
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +25 -49
- package/dist/_pkgs/affine-widget-edgeless-toolbar/config/types.d.ts +15 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.d.ts +1 -1
- package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.js +7 -2
- 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/panel/font-family-panel.d.ts +18 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-family-panel.js +52 -6
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/drop.d.ts +61 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/drop.js +91 -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 +170 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-widget.js +1381 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.d.ts +58 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.js +171 -1
- package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +10 -0
- package/dist/_pkgs/affine-widget-frame-title/edgeless-frame-title-editor.js +2 -1
- package/dist/_pkgs/affine-widget-note-slicer/note-slicer.js +7 -3
- package/dist/_pkgs/affine-widget-slash-menu/translations.d.ts +16 -0
- package/dist/_pkgs/affine-widget-slash-menu/translations.js +23 -1
- package/dist/_pkgs/affine-widget-toolbar/utils.js +57 -14
- package/dist/_pkgs/data-view/core/detail/field.js +2 -1
- package/dist/_pkgs/data-view/core/filter/literal/define.js +3 -1
- package/dist/_pkgs/data-view/core/group-by/renderer/boolean-group.js +1 -1
- package/dist/_pkgs/data-view/property-presets/checkbox/cell-renderer.js +8 -2
- package/dist/_pkgs/data-view/view-presets/kanban/pc/cell.js +1 -1
- package/dist/_pkgs/data-view/view-presets/kanban/pc/controller/drag.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/controller/drag.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/controller/selection.js +1 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/header/vertical-indicator.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/row/row-select-checkbox.js +3 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/drag.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/selection.js +1 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/header/vertical-indicator.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/row/row-header.js +3 -1
- 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/role.d.ts +10 -5
- 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/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 -2
- package/dist/translations.js +15 -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-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,5 +1,5 @@
|
|
|
1
1
|
import { ElementRendererExtension, } from '../../affine-block-surface/index.js';
|
|
2
|
-
import { getFontString, getLineHeight, getTextWidth, isRTL, wrapTextDeltas, } from '../../affine-gfx-text/index.js';
|
|
2
|
+
import { alphabeticBaselineOffset, getFontString, getLineHeight, getTextWidth, isRTL, paintTextDecoration, wrapTextDeltas, } from '../../affine-gfx-text/index.js';
|
|
3
3
|
import { ConnectorMode, DefaultTheme, } from '../../affine-model/index.js';
|
|
4
4
|
import { getBezierParameters, } from '../../global/gfx/index.js';
|
|
5
5
|
import { deltaInsertsToChunks } from '../../std/inline/index.js';
|
|
@@ -170,7 +170,7 @@ function renderEndpoint(model, location, ctx, rc, end, style, stroke) {
|
|
|
170
170
|
* which pair of fields the function reached into.
|
|
171
171
|
*/
|
|
172
172
|
function renderLabel(label, ctx, matrix, renderer) {
|
|
173
|
-
const { text, xywh, style: { color, fontSize, fontWeight, fontStyle, fontFamily, textAlign }, constraints: { hasMaxWidth, maxWidth }, } = label;
|
|
173
|
+
const { text, xywh, style: { color, fontSize, fontWeight, fontStyle, fontFamily, textAlign, textDecoration, }, constraints: { hasMaxWidth, maxWidth }, } = label;
|
|
174
174
|
const font = getFontString({
|
|
175
175
|
fontStyle,
|
|
176
176
|
fontWeight,
|
|
@@ -193,7 +193,8 @@ function renderLabel(label, ctx, matrix, renderer) {
|
|
|
193
193
|
ctx.font = font;
|
|
194
194
|
ctx.textAlign = textAlign;
|
|
195
195
|
ctx.textBaseline = 'middle';
|
|
196
|
-
|
|
196
|
+
const fill = renderer.getColorValue(color, DefaultTheme.black, true);
|
|
197
|
+
ctx.fillStyle = fill;
|
|
197
198
|
let textMaxWidth = textAlign === 'center' ? 0 : getMaxTextWidth(lines, font);
|
|
198
199
|
if (hasMaxWidth && maxWidth > 0) {
|
|
199
200
|
textMaxWidth = Math.min(textMaxWidth, textMaxWidth);
|
|
@@ -219,7 +220,23 @@ function renderLabel(label, ctx, matrix, renderer) {
|
|
|
219
220
|
: rtl
|
|
220
221
|
? 0.5
|
|
221
222
|
: -0.5);
|
|
222
|
-
|
|
223
|
+
const lineY = index * lineHeight - textHeight + cy;
|
|
224
|
+
ctx.fillText(str, x + cx, lineY);
|
|
225
|
+
if (textDecoration) {
|
|
226
|
+
// Painted on the `middle` baseline; the line hangs off the alphabetic
|
|
227
|
+
// one, measured below it.
|
|
228
|
+
paintTextDecoration(ctx, {
|
|
229
|
+
decoration: textDecoration,
|
|
230
|
+
lineText: str,
|
|
231
|
+
font,
|
|
232
|
+
x: x + cx,
|
|
233
|
+
baselineY: lineY + alphabeticBaselineOffset(font, 'middle'),
|
|
234
|
+
fontFamily,
|
|
235
|
+
fontSize,
|
|
236
|
+
fontWeight,
|
|
237
|
+
color: fill,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
223
240
|
if (shouldTemporarilyAttach) {
|
|
224
241
|
ctx.canvas.remove();
|
|
225
242
|
}
|
|
@@ -33,7 +33,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
35
|
import { DefaultTool, EdgelessCRUDIdentifier, } from '../../affine-block-surface/index.js';
|
|
36
|
-
import { getLineHeight } from '../../affine-gfx-text/index.js';
|
|
36
|
+
import { getLineHeight, textDecorationLine } from '../../affine-gfx-text/index.js';
|
|
37
37
|
import { connectorEndLabelBox, } from '../../affine-model/index.js';
|
|
38
38
|
import { ThemeProvider, translateKey } from '../../affine-shared/services/index.js';
|
|
39
39
|
import { almostEqual } from '../../affine-shared/utils/index.js';
|
|
@@ -245,10 +245,11 @@ let EdgelessConnectorLabelEditor = (() => {
|
|
|
245
245
|
transform-origin: center;
|
|
246
246
|
z-index: 10;
|
|
247
247
|
padding: ${VERTICAL_PADDING}px ${HORIZONTAL_PADDING}px;
|
|
248
|
-
border: ${BORDER_WIDTH}px solid var(--affine-primary-color
|
|
248
|
+
border: ${BORDER_WIDTH}px solid var(--affine-primary-color);
|
|
249
249
|
background: var(--affine-background-primary-color, #fff);
|
|
250
250
|
border-radius: 2px;
|
|
251
|
-
box-shadow: 0px 0px 0px 2px
|
|
251
|
+
box-shadow: 0px 0px 0px 2px
|
|
252
|
+
color-mix(in srgb, var(--affine-primary-color) 30%, transparent);
|
|
252
253
|
box-sizing: border-box;
|
|
253
254
|
overflow: visible;
|
|
254
255
|
|
|
@@ -422,7 +423,7 @@ let EdgelessConnectorLabelEditor = (() => {
|
|
|
422
423
|
}
|
|
423
424
|
render() {
|
|
424
425
|
const { connector } = this;
|
|
425
|
-
const { labelStyle: { fontFamily, fontSize, fontStyle, fontWeight, textAlign, color: labelColor, }, labelConstraints: { hasMaxWidth, maxWidth }, } = connector;
|
|
426
|
+
const { labelStyle: { fontFamily, fontSize, fontStyle, fontWeight, textAlign, textDecoration, color: labelColor, }, labelConstraints: { hasMaxWidth, maxWidth }, } = connector;
|
|
426
427
|
const lineHeight = getLineHeight(fontFamily, fontSize, fontWeight);
|
|
427
428
|
const { translateX, translateY, zoom } = this.gfx.viewport;
|
|
428
429
|
const [x, y] = Vec.mul(this._labelCenter, zoom);
|
|
@@ -446,6 +447,7 @@ let EdgelessConnectorLabelEditor = (() => {
|
|
|
446
447
|
fontStyle,
|
|
447
448
|
fontWeight,
|
|
448
449
|
textAlign,
|
|
450
|
+
textDecorationLine: textDecorationLine(textDecoration),
|
|
449
451
|
lineHeight: `${lineHeight}px`,
|
|
450
452
|
maxWidth: hasMaxWidth
|
|
451
453
|
? `${maxWidth + BORDER_WIDTH * 2 + HORIZONTAL_PADDING * 2}px`
|
|
@@ -2,7 +2,7 @@ import { EdgelessCRUDIdentifier } from '../../affine-block-surface/index.js';
|
|
|
2
2
|
import { frameworkPaletteGroups, packColor, } from '../../affine-components/color-picker/index.js';
|
|
3
3
|
import { createTextActions, normalizeTextBound } from '../../affine-gfx-text/index.js';
|
|
4
4
|
import { ConnectorElementModel, ConnectorMode, DEFAULT_FRONT_ENDPOINT_STYLE, DEFAULT_REAR_ENDPOINT_STYLE, DefaultTheme, LineWidth, PointStyle, resolveColor, StrokeStyle, } from '../../affine-model/index.js';
|
|
5
|
-
import { CONNECTOR_SOURCE_LABEL, CONNECTOR_TARGET_LABEL, ToolbarModuleExtension, translateKey, } from '../../affine-shared/services/index.js';
|
|
5
|
+
import { CONNECTOR_SOURCE_LABEL, CONNECTOR_TARGET_LABEL, MENU_ARIA_STYLE, ToolbarModuleExtension, translateKey, } from '../../affine-shared/services/index.js';
|
|
6
6
|
import { getMostCommonResolvedValue, getMostCommonValue, } from '../../affine-shared/utils/index.js';
|
|
7
7
|
import { getRootBlock, LINE_STYLE_LIST, renderMenu, } from '../../affine-widget-edgeless-toolbar/index.js';
|
|
8
8
|
import { Bound } from '../../global/gfx/index.js';
|
|
@@ -15,7 +15,7 @@ import { INVERT_EDGE_DIRECTION, invertEdgeDirection, } from '../direction/invert
|
|
|
15
15
|
import { asTypedEdge, edgeIsBound, roleVocabularies, } from '../direction/typed-edge.js';
|
|
16
16
|
import { mountConnectorLabelEditor } from '../text/index.js';
|
|
17
17
|
import { EndPointDiamondHollowIcon, EndPointTriangleHollowIcon, StartPointDiamondHollowIcon, StartPointTriangleHollowIcon, } from './hollow-endpoint-icons.js';
|
|
18
|
-
import { CONNECTOR_ADD_TEXT, CONNECTOR_LABEL_END_POINT_STYLE, CONNECTOR_LABEL_SHAPE, CONNECTOR_LABEL_START_POINT_STYLE, CONNECTOR_LABEL_STROKE_STYLE, CONNECTOR_LABEL_STYLE, CONNECTOR_MODE_WORDING, CONNECTOR_TOOLTIP_CONNECTOR_SHAPE, CONNECTOR_TOOLTIP_FLIP_DIRECTION, } from '../translations.js';
|
|
18
|
+
import { CONNECTOR_ADD_TEXT, CONNECTOR_END_POINT_STYLE_MENU_ARIA, CONNECTOR_LABEL_END_POINT_STYLE, CONNECTOR_LABEL_SHAPE, CONNECTOR_LABEL_START_POINT_STYLE, CONNECTOR_LABEL_STROKE_STYLE, CONNECTOR_LABEL_STYLE, CONNECTOR_MODE_WORDING, CONNECTOR_SHAPE_MENU_ARIA, CONNECTOR_START_POINT_STYLE_MENU_ARIA, CONNECTOR_TOOLTIP_CONNECTOR_SHAPE, CONNECTOR_TOOLTIP_FLIP_DIRECTION, } from '../translations.js';
|
|
19
19
|
/**
|
|
20
20
|
* Every `PointStyle` must appear in BOTH lists.
|
|
21
21
|
*
|
|
@@ -204,10 +204,16 @@ export const connectorToolbarConfig = {
|
|
|
204
204
|
updateModelsWith(ctx, models, field, value);
|
|
205
205
|
};
|
|
206
206
|
return renderMenu({
|
|
207
|
-
label
|
|
207
|
+
// `label` stays the ENGLISH literal and `labelWording` carries the
|
|
208
|
+
// key: `renderMenu` resolves it, and the menu shell's accessible
|
|
209
|
+
// name no longer has to be sewn onto a translated word (#390).
|
|
210
|
+
label: CONNECTOR_LABEL_STYLE[1],
|
|
211
|
+
labelWording: CONNECTOR_LABEL_STYLE,
|
|
212
|
+
menuAriaWording: MENU_ARIA_STYLE,
|
|
208
213
|
items: LINE_STYLE_LIST,
|
|
209
214
|
currentValue: rough,
|
|
210
215
|
onPick,
|
|
216
|
+
std: ctx.std,
|
|
211
217
|
});
|
|
212
218
|
},
|
|
213
219
|
},
|
|
@@ -226,10 +232,13 @@ export const connectorToolbarConfig = {
|
|
|
226
232
|
updateModelsWith(ctx, models, field, value);
|
|
227
233
|
};
|
|
228
234
|
return renderMenu({
|
|
229
|
-
label:
|
|
235
|
+
label: CONNECTOR_LABEL_START_POINT_STYLE[1],
|
|
236
|
+
labelWording: CONNECTOR_LABEL_START_POINT_STYLE,
|
|
237
|
+
menuAriaWording: CONNECTOR_START_POINT_STYLE_MENU_ARIA,
|
|
230
238
|
items: FRONT_ENDPOINT_STYLE_LIST,
|
|
231
239
|
currentValue: pointStyle,
|
|
232
240
|
onPick,
|
|
241
|
+
std: ctx.std,
|
|
233
242
|
});
|
|
234
243
|
},
|
|
235
244
|
},
|
|
@@ -293,10 +302,13 @@ export const connectorToolbarConfig = {
|
|
|
293
302
|
updateModelsWith(ctx, models, field, value);
|
|
294
303
|
};
|
|
295
304
|
return renderMenu({
|
|
296
|
-
label:
|
|
305
|
+
label: CONNECTOR_LABEL_END_POINT_STYLE[1],
|
|
306
|
+
labelWording: CONNECTOR_LABEL_END_POINT_STYLE,
|
|
307
|
+
menuAriaWording: CONNECTOR_END_POINT_STYLE_MENU_ARIA,
|
|
297
308
|
items: REAR_ENDPOINT_STYLE_LIST,
|
|
298
309
|
currentValue: pointStyle,
|
|
299
310
|
onPick,
|
|
311
|
+
std: ctx.std,
|
|
300
312
|
});
|
|
301
313
|
},
|
|
302
314
|
},
|
|
@@ -361,11 +373,15 @@ export const connectorToolbarConfig = {
|
|
|
361
373
|
key: translateKey(ctx.std, ...CONNECTOR_MODE_WORDING[item.value]),
|
|
362
374
|
}));
|
|
363
375
|
return renderMenu({
|
|
364
|
-
label:
|
|
365
|
-
|
|
376
|
+
label: CONNECTOR_LABEL_SHAPE[1],
|
|
377
|
+
labelWording: CONNECTOR_LABEL_SHAPE,
|
|
378
|
+
menuAriaWording: CONNECTOR_SHAPE_MENU_ARIA,
|
|
379
|
+
tooltip: CONNECTOR_TOOLTIP_CONNECTOR_SHAPE[1],
|
|
380
|
+
tooltipWording: CONNECTOR_TOOLTIP_CONNECTOR_SHAPE,
|
|
366
381
|
items,
|
|
367
382
|
currentValue: mode,
|
|
368
383
|
onPick,
|
|
384
|
+
std: ctx.std,
|
|
369
385
|
});
|
|
370
386
|
},
|
|
371
387
|
},
|
|
@@ -434,7 +450,7 @@ export const connectorToolbarConfig = {
|
|
|
434
450
|
return;
|
|
435
451
|
const labelStyle = { ...model.labelStyle, ...props };
|
|
436
452
|
// No need to adjust element bounds
|
|
437
|
-
if (props['textAlign']) {
|
|
453
|
+
if (props['textAlign'] || props['textDecoration']) {
|
|
438
454
|
ctx.std
|
|
439
455
|
.get(EdgelessCRUDIdentifier)
|
|
440
456
|
.updateElement(model.id, { labelStyle });
|
|
@@ -20,9 +20,12 @@ export declare const CONNECTOR_LABEL_CONNECTOR: ChromeWording;
|
|
|
20
20
|
export declare const CONNECTOR_LABEL_STROKE_STYLE: ChromeWording;
|
|
21
21
|
export declare const CONNECTOR_LABEL_STYLE: ChromeWording;
|
|
22
22
|
export declare const CONNECTOR_LABEL_START_POINT_STYLE: ChromeWording;
|
|
23
|
+
export declare const CONNECTOR_START_POINT_STYLE_MENU_ARIA: ChromeWording;
|
|
23
24
|
export declare const CONNECTOR_TOOLTIP_FLIP_DIRECTION: ChromeWording;
|
|
24
25
|
export declare const CONNECTOR_LABEL_END_POINT_STYLE: ChromeWording;
|
|
26
|
+
export declare const CONNECTOR_END_POINT_STYLE_MENU_ARIA: ChromeWording;
|
|
25
27
|
export declare const CONNECTOR_LABEL_SHAPE: ChromeWording;
|
|
28
|
+
export declare const CONNECTOR_SHAPE_MENU_ARIA: ChromeWording;
|
|
26
29
|
export declare const CONNECTOR_TOOLTIP_CONNECTOR_SHAPE: ChromeWording;
|
|
27
30
|
/**
|
|
28
31
|
* "Add text" — the contextual-toolbar action AND the label editor's own
|
|
@@ -44,6 +44,18 @@ export const CONNECTOR_LABEL_START_POINT_STYLE = [
|
|
|
44
44
|
'com.labre.connector.toolbar.start-point-style',
|
|
45
45
|
'Start point style',
|
|
46
46
|
];
|
|
47
|
+
/* ── The menu shells' accessible names (#390) ─────────────────────────────
|
|
48
|
+
*
|
|
49
|
+
* Each `aria-label` is its own wording rather than `` `${label}-menu` ``: the
|
|
50
|
+
* four labels above go through the seam, so the composition read "style de
|
|
51
|
+
* point de départ-menu" on a French host. Fallbacks are the exact identifiers
|
|
52
|
+
* the composition produced in English. The plain "Style" menu reuses the
|
|
53
|
+
* shared `MENU_ARIA_STYLE` — three toolbars draw that same menu.
|
|
54
|
+
*/
|
|
55
|
+
export const CONNECTOR_START_POINT_STYLE_MENU_ARIA = [
|
|
56
|
+
'com.labre.connector.toolbar.start-point-style-menu',
|
|
57
|
+
'start point style-menu',
|
|
58
|
+
];
|
|
47
59
|
export const CONNECTOR_TOOLTIP_FLIP_DIRECTION = [
|
|
48
60
|
'com.labre.connector.toolbar.flip-direction',
|
|
49
61
|
'Flip direction',
|
|
@@ -52,10 +64,18 @@ export const CONNECTOR_LABEL_END_POINT_STYLE = [
|
|
|
52
64
|
'com.labre.connector.toolbar.end-point-style',
|
|
53
65
|
'End point style',
|
|
54
66
|
];
|
|
67
|
+
export const CONNECTOR_END_POINT_STYLE_MENU_ARIA = [
|
|
68
|
+
'com.labre.connector.toolbar.end-point-style-menu',
|
|
69
|
+
'end point style-menu',
|
|
70
|
+
];
|
|
55
71
|
export const CONNECTOR_LABEL_SHAPE = [
|
|
56
72
|
'com.labre.connector.toolbar.shape',
|
|
57
73
|
'Shape',
|
|
58
74
|
];
|
|
75
|
+
export const CONNECTOR_SHAPE_MENU_ARIA = [
|
|
76
|
+
'com.labre.connector.toolbar.shape-menu',
|
|
77
|
+
'shape-menu',
|
|
78
|
+
];
|
|
59
79
|
export const CONNECTOR_TOOLTIP_CONNECTOR_SHAPE = [
|
|
60
80
|
'com.labre.connector.toolbar.connector-shape',
|
|
61
81
|
'Connector shape',
|
|
@@ -72,8 +92,11 @@ export const CONNECTOR_WORDINGS = [
|
|
|
72
92
|
CONNECTOR_LABEL_CONNECTOR,
|
|
73
93
|
CONNECTOR_LABEL_STROKE_STYLE,
|
|
74
94
|
CONNECTOR_LABEL_START_POINT_STYLE,
|
|
95
|
+
CONNECTOR_START_POINT_STYLE_MENU_ARIA,
|
|
75
96
|
CONNECTOR_TOOLTIP_FLIP_DIRECTION,
|
|
76
97
|
CONNECTOR_LABEL_END_POINT_STYLE,
|
|
98
|
+
CONNECTOR_END_POINT_STYLE_MENU_ARIA,
|
|
77
99
|
CONNECTOR_LABEL_SHAPE,
|
|
100
|
+
CONNECTOR_SHAPE_MENU_ARIA,
|
|
78
101
|
CONNECTOR_TOOLTIP_CONNECTOR_SHAPE,
|
|
79
102
|
];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EdgelessCRUDIdentifier } from '../../affine-block-surface/index.js';
|
|
2
2
|
import { MindmapElementModel, } from '../../affine-model/index.js';
|
|
3
3
|
import { translateKey } from '../../affine-shared/services/index.js';
|
|
4
|
-
import { batchAddChildren, batchRemoveChildren, generateKeyBetween, generateNKeysBetween, GfxControllerIdentifier, measureOperation, } from '../../std/gfx/index.js';
|
|
4
|
+
import { batchAddChildren, batchRemoveChildren, generateKeyBetween, generateNKeysBetween, GfxControllerIdentifier, GfxPrimitiveElementModel, measureOperation, } from '../../std/gfx/index.js';
|
|
5
5
|
import { GROUP_SEED_NAME } from '../translations.js';
|
|
6
6
|
/**
|
|
7
7
|
* Every element that sits at the root of the board, in painting order.
|
|
@@ -65,12 +65,60 @@ const buildUngroupIndexes = (orderedElements, afterIndex, beforeIndex, fallbackA
|
|
|
65
65
|
tryGenerateOneByOne(null, null) ??
|
|
66
66
|
[]);
|
|
67
67
|
};
|
|
68
|
+
/**
|
|
69
|
+
* The layer a new group is stored in (ADR 0031 §5): the effective layer of
|
|
70
|
+
* its HIGHEST member, so grouping never sinks what was on top. `'@default'`
|
|
71
|
+
* is passed explicitly — the creation middleware then writes no key, rather
|
|
72
|
+
* than reading "absent" as "the viewer's active layer". Nothing at all while
|
|
73
|
+
* the surface has no user layer.
|
|
74
|
+
*/
|
|
75
|
+
function groupLayerProps(gfx, elements) {
|
|
76
|
+
const userLayers = gfx.surface?.userLayers;
|
|
77
|
+
if (!userLayers?.ranks)
|
|
78
|
+
return {};
|
|
79
|
+
const models = elements
|
|
80
|
+
.map(el => (typeof el === 'string' ? gfx.getElementById(el) : el))
|
|
81
|
+
.filter((model) => !!model && 'index' in model)
|
|
82
|
+
.sort((a, b) => gfx.layer.compare(a, b));
|
|
83
|
+
const highest = models.at(-1);
|
|
84
|
+
return highest ? { layer: userLayers.effectiveLayerOf(highest) } : {};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Ungrouping a top-level group hands its layer to each released child, in
|
|
88
|
+
* the ungroup's own transaction (ADR 0031 §5): a member's own `layer` was
|
|
89
|
+
* ignored while it was inside, and may be stale.
|
|
90
|
+
*/
|
|
91
|
+
function releaseChildrenToGroupLayer(gfx, group, children) {
|
|
92
|
+
const userLayers = gfx.surface?.userLayers;
|
|
93
|
+
if (!userLayers?.ranks)
|
|
94
|
+
return;
|
|
95
|
+
const layer = group.layer;
|
|
96
|
+
for (const child of children) {
|
|
97
|
+
const own = child instanceof GfxPrimitiveElementModel
|
|
98
|
+
? child.layer
|
|
99
|
+
: child.props.layer;
|
|
100
|
+
if (own === layer)
|
|
101
|
+
continue;
|
|
102
|
+
if (layer === undefined) {
|
|
103
|
+
if (child instanceof GfxPrimitiveElementModel) {
|
|
104
|
+
child.clearField('layer');
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
delete child.props.layer;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
gfx.updateElement(child, { layer });
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
68
115
|
export const createGroupCommand = (ctx, next) => {
|
|
69
116
|
const { std, elements } = ctx;
|
|
70
117
|
const gfx = std.get(GfxControllerIdentifier);
|
|
71
118
|
const crud = std.get(EdgelessCRUDIdentifier);
|
|
72
119
|
const groups = gfx.layer.canvasElements.filter(el => el.type === 'group');
|
|
73
120
|
const groupId = crud.addElement('group', {
|
|
121
|
+
...groupLayerProps(gfx, elements),
|
|
74
122
|
children: elements.reduce((pre, el) => {
|
|
75
123
|
const id = typeof el === 'string' ? el : el.id;
|
|
76
124
|
pre[id] = true;
|
|
@@ -175,6 +223,9 @@ export const ungroupCommand = (ctx, next) => {
|
|
|
175
223
|
if (parent !== null) {
|
|
176
224
|
batchAddChildren(parent, orderedElements);
|
|
177
225
|
}
|
|
226
|
+
else {
|
|
227
|
+
releaseChildrenToGroupLayer(gfx, group, orderedElements);
|
|
228
|
+
}
|
|
178
229
|
});
|
|
179
230
|
selection.set({
|
|
180
231
|
editing: false,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Overlay } from '../../affine-block-surface/index.js';
|
|
2
2
|
import { PathGenerator } from '../../affine-gfx-connector/index.js';
|
|
3
3
|
import { ConnectorMode, LayoutType, } from '../../affine-model/index.js';
|
|
4
|
-
import { ThemeProvider } from '../../affine-shared/services/index.js';
|
|
4
|
+
import { CHROME_ACCENT_CSS_VARIABLE, ThemeProvider, } from '../../affine-shared/services/index.js';
|
|
5
5
|
import { isVecZero, PointLocation, toRadian, Vec, } from '../../global/gfx/index.js';
|
|
6
6
|
import last from 'lodash-es/last.js';
|
|
7
7
|
import { NODE_HORIZONTAL_SPACING, NODE_VERTICAL_SPACING } from '../view/layout.js';
|
|
@@ -101,7 +101,11 @@ export class MindMapIndicatorOverlay extends Overlay {
|
|
|
101
101
|
}
|
|
102
102
|
const targetPos = this.targetBound;
|
|
103
103
|
const points = this._generatePath();
|
|
104
|
-
|
|
104
|
+
// The accent read from the theme, not a literal: a canvas context cannot
|
|
105
|
+
// take a `var(…)`, so the token is resolved here (DESIGN.md, The Borrowed
|
|
106
|
+
// Blue Rule). The hex used to sit here as a `getColorValue` fallback that
|
|
107
|
+
// could never fire — the variable name always resolves.
|
|
108
|
+
const color = this.themeService.getCssVariableColor(CHROME_ACCENT_CSS_VARIABLE);
|
|
105
109
|
ctx.strokeStyle = color;
|
|
106
110
|
ctx.fillStyle = color;
|
|
107
111
|
ctx.lineWidth = 3;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { hasGrouped } from '../../affine-gfx-shape/index.js';
|
|
2
2
|
import { LayoutType, MindmapElementModel, MindmapStyle, ShapeElementModel, } from '../../affine-model/index.js';
|
|
3
|
-
import { STYLE_MENU_LABEL, ToolbarModuleExtension, } from '../../affine-shared/services/index.js';
|
|
3
|
+
import { MENU_ARIA_STYLE, STYLE_MENU_LABEL, ToolbarModuleExtension, } from '../../affine-shared/services/index.js';
|
|
4
4
|
import { getMostCommonValue } from '../../affine-shared/utils/index.js';
|
|
5
5
|
import { renderMenu, } from '../../affine-widget-edgeless-toolbar/index.js';
|
|
6
|
-
import { MINDMAP_LAYOUT_LABEL, MINDMAP_LAYOUT_LEFT, MINDMAP_LAYOUT_RADIAL, MINDMAP_LAYOUT_RIGHT, } from '../translations.js';
|
|
6
|
+
import { MINDMAP_LAYOUT_LABEL, MINDMAP_LAYOUT_MENU_ARIA, MINDMAP_LAYOUT_LEFT, MINDMAP_LAYOUT_RADIAL, MINDMAP_LAYOUT_RIGHT, } from '../translations.js';
|
|
7
7
|
import { RadiantIcon, RightLayoutIcon, StyleIcon } from '@blocksuite/icons/lit';
|
|
8
8
|
import { BlockFlavourIdentifier } from '../../std/index.js';
|
|
9
9
|
import { MindmapStyleFour, MindmapStyleOne, MindmapStyleThree, MindmapStyleTwo, } from '../view/index.js';
|
|
@@ -58,6 +58,7 @@ export const createMindmapStyleActionMenu = (ctx, models) => {
|
|
|
58
58
|
return renderMenu({
|
|
59
59
|
label: 'Style',
|
|
60
60
|
labelWording: STYLE_MENU_LABEL,
|
|
61
|
+
menuAriaWording: MENU_ARIA_STYLE,
|
|
61
62
|
icon: StyleIcon(),
|
|
62
63
|
items: MINDMAP_STYLE_LIST,
|
|
63
64
|
currentValue: style,
|
|
@@ -77,6 +78,7 @@ export const createMindmapLayoutActionMenu = (ctx, models) => {
|
|
|
77
78
|
return renderMenu({
|
|
78
79
|
label: 'Layout',
|
|
79
80
|
labelWording: MINDMAP_LAYOUT_LABEL,
|
|
81
|
+
menuAriaWording: MINDMAP_LAYOUT_MENU_ARIA,
|
|
80
82
|
items: MINDMAP_LAYOUT_LIST,
|
|
81
83
|
currentValue: layoutType,
|
|
82
84
|
onPick,
|
|
@@ -57,6 +57,12 @@ export declare const MINDMAP_TEMPLATE_NAME_STYLE_2: ChromeWording;
|
|
|
57
57
|
export declare const MINDMAP_TEMPLATE_NAME_STYLE_3: ChromeWording;
|
|
58
58
|
export declare const MINDMAP_TEMPLATE_NAME_STYLE_4: ChromeWording;
|
|
59
59
|
export declare const MINDMAP_LAYOUT_LABEL: ChromeWording;
|
|
60
|
+
/**
|
|
61
|
+
* The accessible name of the layout menu SHELL (#390) — its own wording, not
|
|
62
|
+
* `` `${MINDMAP_LAYOUT_LABEL}-menu` ``, which read "disposition-menu" in
|
|
63
|
+
* French. The fallback is the exact identifier that composition produced.
|
|
64
|
+
*/
|
|
65
|
+
export declare const MINDMAP_LAYOUT_MENU_ARIA: ChromeWording;
|
|
60
66
|
/**
|
|
61
67
|
* The three layout directions — a different concept from `gfx/text`'s own
|
|
62
68
|
* "Left" / "Right" text alignment (`TEXT_ALIGN_LEFT`/`RIGHT`), so kept as
|
|
@@ -102,6 +102,15 @@ export const MINDMAP_LAYOUT_LABEL = [
|
|
|
102
102
|
'com.labre.mindmap.toolbar.layout',
|
|
103
103
|
'Layout',
|
|
104
104
|
];
|
|
105
|
+
/**
|
|
106
|
+
* The accessible name of the layout menu SHELL (#390) — its own wording, not
|
|
107
|
+
* `` `${MINDMAP_LAYOUT_LABEL}-menu` ``, which read "disposition-menu" in
|
|
108
|
+
* French. The fallback is the exact identifier that composition produced.
|
|
109
|
+
*/
|
|
110
|
+
export const MINDMAP_LAYOUT_MENU_ARIA = [
|
|
111
|
+
'com.labre.mindmap.toolbar.layout-menu',
|
|
112
|
+
'layout-menu',
|
|
113
|
+
];
|
|
105
114
|
/**
|
|
106
115
|
* The three layout directions — a different concept from `gfx/text`'s own
|
|
107
116
|
* "Left" / "Right" text alignment (`TEXT_ALIGN_LEFT`/`RIGHT`), so kept as
|
|
@@ -159,6 +168,7 @@ export const MINDMAP_CHROME_WORDINGS = [
|
|
|
159
168
|
MINDMAP_TEMPLATE_NAME_STYLE_3,
|
|
160
169
|
MINDMAP_TEMPLATE_NAME_STYLE_4,
|
|
161
170
|
MINDMAP_LAYOUT_LABEL,
|
|
171
|
+
MINDMAP_LAYOUT_MENU_ARIA,
|
|
162
172
|
MINDMAP_LAYOUT_LEFT,
|
|
163
173
|
MINDMAP_LAYOUT_RADIAL,
|
|
164
174
|
MINDMAP_LAYOUT_RIGHT,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementRendererExtension, } from '../../../affine-block-surface/index.js';
|
|
2
|
-
import { getFontMetrics, getFontString, getLineWidth, isRTL, measureTextInDOM, wrapTextDeltas, } from '../../../affine-gfx-text/index.js';
|
|
2
|
+
import { getFontMetrics, getFontString, getLineWidth, isRTL, measureTextInDOM, paintTextDecoration, wrapTextDeltas, } from '../../../affine-gfx-text/index.js';
|
|
3
3
|
import { DefaultTheme, TextAlign } from '../../../affine-model/index.js';
|
|
4
4
|
import { Bound } from '../../../global/gfx/index.js';
|
|
5
5
|
import { deltaInsertsToChunks } from '../../../std/inline/index.js';
|
|
@@ -33,6 +33,8 @@ function renderText(model, ctx, { color }) {
|
|
|
33
33
|
const { x, y, text, fontFamily, fontWeight, textAlign, w, h, textVerticalAlign, padding, } = model;
|
|
34
34
|
if (!text)
|
|
35
35
|
return;
|
|
36
|
+
// A local preview shape has no stored decoration.
|
|
37
|
+
const textDecoration = 'textDecoration' in model ? model.textDecoration : undefined;
|
|
36
38
|
// Contained mode shrinks the layout font size so the text fits the bounds.
|
|
37
39
|
const fontSize = effectiveShapeFontSize(model);
|
|
38
40
|
const [verticalPadding, horPadding] = padding;
|
|
@@ -69,9 +71,25 @@ function renderText(model, ctx, { color }) {
|
|
|
69
71
|
if (ctx.canvas.dir !== (rtl ? 'rtl' : 'ltr')) {
|
|
70
72
|
ctx.canvas.setAttribute('dir', rtl ? 'rtl' : 'ltr');
|
|
71
73
|
}
|
|
72
|
-
ctx.fillText(str,
|
|
73
74
|
// 0.5 is the dom editor padding to make the text align with the DOM text
|
|
74
|
-
horOffset + 0.5
|
|
75
|
+
const textX = horOffset + 0.5;
|
|
76
|
+
const baselineY = lineIndex * lineHeight + vertOffset;
|
|
77
|
+
ctx.fillText(str, textX, baselineY);
|
|
78
|
+
if (textDecoration) {
|
|
79
|
+
// Already on the alphabetic baseline, at the size Contained mode
|
|
80
|
+
// shrank the text to.
|
|
81
|
+
paintTextDecoration(ctx, {
|
|
82
|
+
decoration: textDecoration,
|
|
83
|
+
lineText: str,
|
|
84
|
+
font,
|
|
85
|
+
x: textX,
|
|
86
|
+
baselineY,
|
|
87
|
+
fontFamily,
|
|
88
|
+
fontSize,
|
|
89
|
+
fontWeight,
|
|
90
|
+
color,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
75
93
|
maxLineWidth = Math.max(maxLineWidth, getLineWidth(str, font));
|
|
76
94
|
if (shouldTemporarilyAttach) {
|
|
77
95
|
ctx.canvas.remove();
|
|
@@ -33,6 +33,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
35
|
import { DefaultTool, EdgelessCRUDIdentifier, TextUtils, } from '../../affine-block-surface/index.js';
|
|
36
|
+
import { textDecorationLine } from '../../affine-gfx-text/index.js';
|
|
36
37
|
import { MindmapElementModel, ShapeElementModel, TextFitMode, TextResizing, } from '../../affine-model/index.js';
|
|
37
38
|
import { ThemeProvider } from '../../affine-shared/services/index.js';
|
|
38
39
|
import { getSelectedRect, overlayScale, toOverlayCoord, } from '../../affine-shared/utils/index.js';
|
|
@@ -427,6 +428,7 @@ let EdgelessShapeTextEditor = (() => {
|
|
|
427
428
|
color,
|
|
428
429
|
padding: `${verticalPadding}px ${horiPadding}px`,
|
|
429
430
|
textAlign: this.element.textAlign,
|
|
431
|
+
textDecorationLine: textDecorationLine(this.element.textDecoration),
|
|
430
432
|
display: 'grid',
|
|
431
433
|
gridTemplateColumns: '100%',
|
|
432
434
|
alignItems: this.element.textVerticalAlign === 'center'
|
|
@@ -2,7 +2,7 @@ import { EdgelessCRUDIdentifier } from '../../affine-block-surface/index.js';
|
|
|
2
2
|
import { frameworkPaletteGroups, packColor, } from '../../affine-components/color-picker/index.js';
|
|
3
3
|
import { createTextActions } from '../../affine-gfx-text/index.js';
|
|
4
4
|
import { DefaultTheme, FontFamily, getShapeName, getShapeRadius, getShapeType, isTransparent, LineWidth, MindmapElementModel, resolveColor, ShapeElementModel, ShapeStyle, ShapeType, StrokeStyle, TextFitMode, } from '../../affine-model/index.js';
|
|
5
|
-
import { STYLE_MENU_LABEL, ToolbarModuleExtension, translateKey, } from '../../affine-shared/services/index.js';
|
|
5
|
+
import { MENU_ARIA_STYLE, STYLE_MENU_LABEL, ToolbarModuleExtension, translateKey, } from '../../affine-shared/services/index.js';
|
|
6
6
|
import { getMostCommonValue } from '../../affine-shared/utils/index.js';
|
|
7
7
|
import { getRootBlock, LINE_STYLE_LIST, renderMenu, } from '../../affine-widget-edgeless-toolbar/index.js';
|
|
8
8
|
import { Bound } from '../../global/gfx/index.js';
|
|
@@ -15,7 +15,7 @@ import { ShapeElementView } from '../element-view.js';
|
|
|
15
15
|
import { applyTextFitMode, nextTextFitMode } from '../text-fit.js';
|
|
16
16
|
import { mountShapeTextEditor } from '../text/edgeless-shape-text-editor.js';
|
|
17
17
|
import { ShapeComponentConfig } from './shape-menu-config.js';
|
|
18
|
-
import { SHAPE_ADD_TEXT_TOOLTIP, SHAPE_EDIT_VERTICES_TOOLTIP, SHAPE_SWITCH_TYPE_LABEL, SHAPE_TEXT_FIT_ARIA, SHAPE_TEXT_FIT_CONTAINED, SHAPE_TEXT_FIT_GROW, SHAPE_TEXT_FIT_OVERFLOW, SHAPE_TEXT_FIT_TOOLTIP, } from '../translations.js';
|
|
18
|
+
import { SHAPE_ADD_TEXT_TOOLTIP, SHAPE_EDIT_VERTICES_TOOLTIP, SHAPE_SWITCH_TYPE_LABEL, SHAPE_SWITCH_TYPE_MENU_ARIA, SHAPE_TEXT_FIT_ARIA, SHAPE_TEXT_FIT_CONTAINED, SHAPE_TEXT_FIT_GROW, SHAPE_TEXT_FIT_OVERFLOW, SHAPE_TEXT_FIT_TOOLTIP, } from '../translations.js';
|
|
19
19
|
/** Icon + wording per text fit mode for the cycling toolbar button. */
|
|
20
20
|
const TEXT_FIT_UI = {
|
|
21
21
|
[TextFitMode.Grow]: { icon: AutoHeightIcon(), wording: SHAPE_TEXT_FIT_GROW },
|
|
@@ -60,6 +60,7 @@ export const shapeToolbarConfig = {
|
|
|
60
60
|
icon: ShapeIcon(),
|
|
61
61
|
label: 'Switch shape type',
|
|
62
62
|
labelWording: SHAPE_SWITCH_TYPE_LABEL,
|
|
63
|
+
menuAriaWording: SHAPE_SWITCH_TYPE_MENU_ARIA,
|
|
63
64
|
items: ShapeComponentConfig.map(item => ({
|
|
64
65
|
key: item.tooltip,
|
|
65
66
|
keyWording: item.tooltipWording,
|
|
@@ -96,6 +97,7 @@ export const shapeToolbarConfig = {
|
|
|
96
97
|
return renderMenu({
|
|
97
98
|
label: 'Style',
|
|
98
99
|
labelWording: STYLE_MENU_LABEL,
|
|
100
|
+
menuAriaWording: MENU_ARIA_STYLE,
|
|
99
101
|
items: LINE_STYLE_LIST,
|
|
100
102
|
currentValue: shapeStyle === ShapeStyle.Scribbled,
|
|
101
103
|
onPick,
|
|
@@ -292,7 +294,7 @@ export const shapeToolbarConfig = {
|
|
|
292
294
|
// id: `g.text`
|
|
293
295
|
...createTextActions(ShapeElementModel, 'shape', (ctx, model, props) => {
|
|
294
296
|
// No need to adjust element bounds
|
|
295
|
-
if (props['textAlign']) {
|
|
297
|
+
if (props['textAlign'] || props['textDecoration']) {
|
|
296
298
|
ctx.std.get(EdgelessCRUDIdentifier).updateElement(model.id, props);
|
|
297
299
|
return;
|
|
298
300
|
}
|
|
@@ -21,6 +21,13 @@ export declare const SHAPE_TEXT_FIT_OVERFLOW: ChromeWording;
|
|
|
21
21
|
export declare const SHAPE_TEXT_FIT_ARIA: ChromeWording;
|
|
22
22
|
export declare const SHAPE_TEXT_FIT_TOOLTIP: ChromeWording;
|
|
23
23
|
export declare const SHAPE_SWITCH_TYPE_LABEL: ChromeWording;
|
|
24
|
+
/**
|
|
25
|
+
* The accessible name of the shape-type menu SHELL (#390) — its own wording,
|
|
26
|
+
* not `` `${SHAPE_SWITCH_TYPE_LABEL}-menu` ``, which is what produced
|
|
27
|
+
* "changer le type de forme-menu" on a French host. The fallback is the exact
|
|
28
|
+
* identifier that composition produced in English.
|
|
29
|
+
*/
|
|
30
|
+
export declare const SHAPE_SWITCH_TYPE_MENU_ARIA: ChromeWording;
|
|
24
31
|
export declare const SHAPE_ADD_TEXT_TOOLTIP: ChromeWording;
|
|
25
32
|
export declare const SHAPE_EDIT_VERTICES_TOOLTIP: ChromeWording;
|
|
26
33
|
export declare const SHAPE_NAME_SQUARE: ChromeWording;
|
|
@@ -41,6 +41,16 @@ export const SHAPE_SWITCH_TYPE_LABEL = [
|
|
|
41
41
|
'com.labre.shape.toolbar.switch-type',
|
|
42
42
|
'Switch shape type',
|
|
43
43
|
];
|
|
44
|
+
/**
|
|
45
|
+
* The accessible name of the shape-type menu SHELL (#390) — its own wording,
|
|
46
|
+
* not `` `${SHAPE_SWITCH_TYPE_LABEL}-menu` ``, which is what produced
|
|
47
|
+
* "changer le type de forme-menu" on a French host. The fallback is the exact
|
|
48
|
+
* identifier that composition produced in English.
|
|
49
|
+
*/
|
|
50
|
+
export const SHAPE_SWITCH_TYPE_MENU_ARIA = [
|
|
51
|
+
'com.labre.shape.toolbar.switch-type-menu',
|
|
52
|
+
'switch shape type-menu',
|
|
53
|
+
];
|
|
44
54
|
export const SHAPE_ADD_TEXT_TOOLTIP = ADD_TEXT_TOOLTIP;
|
|
45
55
|
export const SHAPE_EDIT_VERTICES_TOOLTIP = [
|
|
46
56
|
'com.labre.shape.toolbar.edit-vertices',
|
|
@@ -83,6 +93,7 @@ export const SHAPE_WORDINGS = [
|
|
|
83
93
|
SHAPE_TEXT_FIT_ARIA,
|
|
84
94
|
SHAPE_TEXT_FIT_TOOLTIP,
|
|
85
95
|
SHAPE_SWITCH_TYPE_LABEL,
|
|
96
|
+
SHAPE_SWITCH_TYPE_MENU_ARIA,
|
|
86
97
|
SHAPE_EDIT_VERTICES_TOOLTIP,
|
|
87
98
|
SHAPE_NAME_SQUARE,
|
|
88
99
|
SHAPE_NAME_ELLIPSE,
|
|
@@ -2,7 +2,7 @@ import { ConnectorMode, FontFamily, FontWeight, PointStyle, ShapeStyle, StrokeSt
|
|
|
2
2
|
import { NOTATION_NEUTRALS } from '../../affine-shared/consts/index.js';
|
|
3
3
|
import { fillPlaceholders, translateKey, } from '../../affine-shared/services/index.js';
|
|
4
4
|
import { makeTemplateSnapshot, surfaceText, } from '../make-snapshot.js';
|
|
5
|
-
import { BMC_SEED_CHANNELS, BMC_SEED_COST_STRUCTURE, BMC_SEED_CUSTOMER_RELATIONSHIPS, BMC_SEED_CUSTOMER_SEGMENTS, BMC_SEED_DATE, BMC_SEED_DESIGNED_BY, BMC_SEED_DESIGNED_FOR, BMC_SEED_KEY_ACTIVITIES, BMC_SEED_KEY_PARTNERSHIPS, BMC_SEED_KEY_RESOURCES, BMC_SEED_REVENUE_STREAMS, BMC_SEED_TITLE, BMC_SEED_VALUE_PROPOSITIONS, BMC_SEED_VERSION, FISHBONE_SEED_CATEGORY, FISHBONE_SEED_EFFECT, FISHBONE_SEED_ITEM_1, FISHBONE_SEED_ITEM_2, GANTT_SEED_BUILD, GANTT_SEED_DESIGN, GANTT_SEED_DISCOVERY, GANTT_SEED_LAUNCH, GANTT_SEED_WEEK, KANBAN_SEED_CARD, KANBAN_SEED_DOING, KANBAN_SEED_DONE, KANBAN_SEED_TODO, SWOT_SEED_OPPORTUNITIES, SWOT_SEED_STRENGTHS, SWOT_SEED_THREATS, SWOT_SEED_WEAKNESSES, TEMPLATE_PANEL_CATEGORY_OTHER, } from '../translations.js';
|
|
5
|
+
import { BMC_SEED_CHANNELS, BMC_SEED_COST_STRUCTURE, BMC_SEED_CUSTOMER_RELATIONSHIPS, BMC_SEED_CUSTOMER_SEGMENTS, BMC_SEED_DATE, BMC_SEED_DESIGNED_BY, BMC_SEED_DESIGNED_FOR, BMC_SEED_KEY_ACTIVITIES, BMC_SEED_KEY_PARTNERSHIPS, BMC_SEED_KEY_RESOURCES, BMC_SEED_REVENUE_STREAMS, BMC_SEED_TITLE, BMC_SEED_VALUE_PROPOSITIONS, BMC_SEED_VERSION, FISHBONE_SEED_CATEGORY, FISHBONE_SEED_EFFECT, FISHBONE_SEED_ITEM_1, FISHBONE_SEED_ITEM_2, GANTT_SEED_BUILD, GANTT_SEED_DESIGN, GANTT_SEED_DISCOVERY, GANTT_SEED_LAUNCH, GANTT_SEED_WEEK, KANBAN_SEED_CARD, KANBAN_SEED_DOING, KANBAN_SEED_DONE, KANBAN_SEED_TODO, SWOT_SEED_OPPORTUNITIES, SWOT_SEED_STRENGTHS, SWOT_SEED_THREATS, SWOT_SEED_WEAKNESSES, TEMPLATE_NAME_BUSINESS_MODEL_CANVAS, TEMPLATE_NAME_FISHBONE, TEMPLATE_NAME_GANTT_CHART, TEMPLATE_NAME_KANBAN_BOARD, TEMPLATE_NAME_SWOT, TEMPLATE_PANEL_CATEGORY_OTHER, } from '../translations.js';
|
|
6
6
|
/**
|
|
7
7
|
* The generic ("Other") diagrams: built ONLY from general BlockSuite shapes
|
|
8
8
|
* (`shape` rect/polygon, `text`, `connector`) per the composition principle —
|
|
@@ -261,9 +261,15 @@ const previews = {
|
|
|
261
261
|
* at placement (ADR 0023); `content` stays the English build, and `localize`
|
|
262
262
|
* rebuilds the same snapshot with translated seeds.
|
|
263
263
|
*/
|
|
264
|
-
function t(
|
|
264
|
+
function t(nameWording, preview, build) {
|
|
265
|
+
const [nameKey, name] = nameWording;
|
|
265
266
|
return {
|
|
266
267
|
name,
|
|
268
|
+
// `resolveTemplateName` reads this FIRST: nothing here derives from a
|
|
269
|
+
// command, so the tile's own key is the only way a host translates it
|
|
270
|
+
// (#390). `name` stays the stable English identity (drag payload, cache
|
|
271
|
+
// key) and doubles as the fallback.
|
|
272
|
+
nameKey,
|
|
267
273
|
type: 'template',
|
|
268
274
|
preview,
|
|
269
275
|
content: makeTemplateSnapshot(build(), name),
|
|
@@ -274,10 +280,10 @@ export const otherTemplateCategory = {
|
|
|
274
280
|
name: 'Other',
|
|
275
281
|
nameKey: TEMPLATE_PANEL_CATEGORY_OTHER[0],
|
|
276
282
|
templates: [
|
|
277
|
-
t(
|
|
278
|
-
t(
|
|
279
|
-
t(
|
|
280
|
-
t(
|
|
281
|
-
t(
|
|
283
|
+
t(TEMPLATE_NAME_SWOT, previews.swot, swot),
|
|
284
|
+
t(TEMPLATE_NAME_KANBAN_BOARD, previews.kanban, kanban),
|
|
285
|
+
t(TEMPLATE_NAME_BUSINESS_MODEL_CANVAS, previews.bmc, bmc),
|
|
286
|
+
t(TEMPLATE_NAME_FISHBONE, previews.fishbone, fishbone),
|
|
287
|
+
t(TEMPLATE_NAME_GANTT_CHART, previews.gantt, gantt),
|
|
282
288
|
],
|
|
283
289
|
};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { Bound } from '../../global/gfx/index.js';
|
|
2
|
+
import type { BlockStdScope } from '../../std/index.js';
|
|
2
3
|
import type { TemplateJob } from './template.js';
|
|
4
|
+
/**
|
|
5
|
+
* Everything a template inserts lands in the viewer's active layer (ADR 0031
|
|
6
|
+
* §6). The insertion bypasses both stamped paths — its elements are merged
|
|
7
|
+
* straight into the surface's elements map, its blocks go through
|
|
8
|
+
* `store.addBlock` — so the layer is stamped on the snapshot before it is
|
|
9
|
+
* written, with the same rule as every other creation.
|
|
10
|
+
*/
|
|
11
|
+
export declare const createActiveLayerMiddleware: (std: BlockStdScope) => (job: TemplateJob) => void;
|
|
3
12
|
export declare const replaceIdMiddleware: (job: TemplateJob) => void;
|
|
4
13
|
export declare const createInsertPlaceMiddleware: (targetPlace: Bound) => (job: TemplateJob) => void;
|
|
5
14
|
export declare const createStickerMiddleware: (center: {
|