@formicoidea/labre-core 0.40.0 → 0.42.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/LICENSE +384 -0
- package/dist/_pkgs/affine-block-attachment/attachment-block.js +7 -2
- package/dist/_pkgs/affine-block-attachment/components/rename-model.js +3 -2
- package/dist/_pkgs/affine-block-attachment/configs/slash-menu.js +7 -0
- package/dist/_pkgs/affine-block-attachment/configs/toolbar.js +11 -3
- package/dist/_pkgs/affine-block-attachment/configs/tooltips.js +4 -4
- package/dist/_pkgs/affine-block-attachment/translations.d.ts +49 -0
- package/dist/_pkgs/affine-block-attachment/translations.js +98 -0
- package/dist/_pkgs/affine-block-attachment/utils.js +9 -6
- package/dist/_pkgs/affine-block-bookmark/bookmark-block.js +2 -2
- package/dist/_pkgs/affine-block-bookmark/components/bookmark-card.js +13 -6
- package/dist/_pkgs/affine-block-bookmark/configs/slash-menu.js +6 -1
- package/dist/_pkgs/affine-block-bookmark/configs/toolbar.js +9 -1
- package/dist/_pkgs/affine-block-bookmark/configs/tooltips.js +2 -2
- package/dist/_pkgs/affine-block-bookmark/translations.d.ts +26 -0
- package/dist/_pkgs/affine-block-bookmark/translations.js +55 -0
- package/dist/_pkgs/affine-block-callout/configs/slash-menu.js +4 -0
- package/dist/_pkgs/affine-block-callout/configs/tooltips.js +2 -2
- package/dist/_pkgs/affine-block-callout/translations.d.ts +16 -0
- package/dist/_pkgs/affine-block-callout/translations.js +24 -0
- package/dist/_pkgs/affine-block-code/code-block.js +6 -3
- package/dist/_pkgs/affine-block-code/code-toolbar/components/code-toolbar.js +4 -2
- package/dist/_pkgs/affine-block-code/code-toolbar/components/lang-button.js +3 -2
- package/dist/_pkgs/affine-block-code/code-toolbar/components/preview-button.js +4 -3
- package/dist/_pkgs/affine-block-code/code-toolbar/config.js +116 -72
- package/dist/_pkgs/affine-block-code/translations.d.ts +30 -0
- package/dist/_pkgs/affine-block-code/translations.js +84 -0
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.js +9 -3
- package/dist/_pkgs/affine-block-embed/common/render-linked-doc.js +7 -6
- 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 -1
- package/dist/_pkgs/affine-block-embed/embed-github-block/embed-github-block.js +2 -1
- package/dist/_pkgs/affine-block-embed/embed-html-block/components/fullscreen-toolbar.js +4 -3
- package/dist/_pkgs/affine-block-embed/embed-html-block/configs/toolbar.js +5 -1
- package/dist/_pkgs/affine-block-embed/embed-html-block/configs/tooltips.js +14 -14
- package/dist/_pkgs/affine-block-embed/embed-html-block/embed-html-block.js +7 -1
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-error-card.js +11 -4
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-idle-card.d.ts +2 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-idle-card.js +13 -3
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-link-edit-popup.js +4 -2
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-link-input-base.js +8 -5
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-link-input-popup.js +21 -5
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-loading-card.js +4 -1
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/slash-menu/slash-menu.js +4 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.d.ts +2 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +6 -1
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.d.ts +2 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.js +5 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.d.ts +1 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +33 -9
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/utils.d.ts +8 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/utils.js +19 -0
- package/dist/_pkgs/affine-block-embed/embed-loom-block/embed-loom-block.js +2 -1
- package/dist/_pkgs/affine-block-embed/embed-youtube-block/embed-youtube-block.js +2 -1
- package/dist/_pkgs/affine-block-embed/translations.d.ts +46 -0
- package/dist/_pkgs/affine-block-embed/translations.js +114 -0
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/slash-menu.js +7 -0
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/toolbar.js +29 -12
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/tooltips.js +4 -4
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-linked-doc-block.js +10 -4
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/components/embed-synced-doc-card.js +8 -4
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/configs/toolbar.js +28 -13
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-edgeless-synced-doc-block.js +3 -2
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-synced-doc-block.js +3 -2
- package/dist/_pkgs/affine-block-embed-doc/translations.d.ts +40 -0
- package/dist/_pkgs/affine-block-embed-doc/translations.js +85 -0
- package/dist/_pkgs/affine-block-frame/edgeless-toolbar/frame-dense-menu.js +29 -22
- package/dist/_pkgs/affine-block-frame/edgeless-toolbar/frame-menu.js +5 -1
- package/dist/_pkgs/affine-block-frame/edgeless-toolbar/frame-tool-button.js +2 -1
- package/dist/_pkgs/affine-block-frame/edgeless-toolbar/presentation-toolbar.js +12 -9
- package/dist/_pkgs/affine-block-frame/frame-manager.js +8 -2
- package/dist/_pkgs/affine-block-frame/frame-tool.js +7 -2
- package/dist/_pkgs/affine-block-frame/frame-toolbar.js +18 -7
- package/dist/_pkgs/affine-block-frame/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-frame/index.js +1 -0
- package/dist/_pkgs/affine-block-frame/present/frame-order-button.js +5 -1
- package/dist/_pkgs/affine-block-frame/present/navigator-setting-button.js +16 -6
- package/dist/_pkgs/affine-block-frame/present/present-button.js +3 -1
- package/dist/_pkgs/affine-block-frame/translations.d.ts +64 -0
- package/dist/_pkgs/affine-block-frame/translations.js +131 -0
- package/dist/_pkgs/affine-block-image/components/page-image-block.js +5 -2
- package/dist/_pkgs/affine-block-image/configs/slash-menu.js +4 -0
- package/dist/_pkgs/affine-block-image/configs/toolbar.js +7 -1
- package/dist/_pkgs/affine-block-image/configs/tooltips.js +1 -1
- package/dist/_pkgs/affine-block-image/image-block.js +3 -2
- package/dist/_pkgs/affine-block-image/image-edgeless-block.js +6 -3
- package/dist/_pkgs/affine-block-image/preview-image/page.js +5 -1
- package/dist/_pkgs/affine-block-image/translations.d.ts +35 -0
- package/dist/_pkgs/affine-block-image/translations.js +68 -0
- package/dist/_pkgs/affine-block-image/utils.js +9 -8
- package/dist/_pkgs/affine-block-latex/configs/slash-menu.d.ts +8 -0
- package/dist/_pkgs/affine-block-latex/configs/slash-menu.js +19 -3
- package/dist/_pkgs/affine-block-latex/latex-block.js +6 -2
- package/dist/_pkgs/affine-block-latex/translations.d.ts +35 -0
- package/dist/_pkgs/affine-block-latex/translations.js +60 -0
- package/dist/_pkgs/affine-block-list/list-keymap.js +7 -0
- package/dist/_pkgs/affine-block-note/components/edgeless-note-border-dropdown-menu.d.ts +9 -0
- package/dist/_pkgs/affine-block-note/components/edgeless-note-border-dropdown-menu.js +23 -6
- package/dist/_pkgs/affine-block-note/components/edgeless-note-display-mode-dropdown-menu.d.ts +4 -1
- package/dist/_pkgs/affine-block-note/components/edgeless-note-display-mode-dropdown-menu.js +26 -6
- package/dist/_pkgs/affine-block-note/components/edgeless-note-shadow-menu.d.ts +3 -0
- package/dist/_pkgs/affine-block-note/components/edgeless-note-shadow-menu.js +21 -10
- package/dist/_pkgs/affine-block-note/components/edgeless-note-style-panel.js +22 -8
- package/dist/_pkgs/affine-block-note/configs/slash-menu.js +13 -0
- package/dist/_pkgs/affine-block-note/configs/toolbar.js +26 -19
- package/dist/_pkgs/affine-block-note/configs/tooltips.js +57 -30
- package/dist/_pkgs/affine-block-note/move-block.js +8 -2
- package/dist/_pkgs/affine-block-note/note-keymap.js +7 -1
- package/dist/_pkgs/affine-block-note/translations.d.ts +91 -0
- package/dist/_pkgs/affine-block-note/translations.js +253 -0
- package/dist/_pkgs/affine-block-paragraph/paragraph-block.js +7 -2
- package/dist/_pkgs/affine-block-paragraph/paragraph-keymap.js +7 -1
- package/dist/_pkgs/affine-block-paragraph/translations.d.ts +31 -0
- package/dist/_pkgs/affine-block-paragraph/translations.js +44 -0
- package/dist/_pkgs/affine-block-paragraph/view.js +6 -1
- package/dist/_pkgs/affine-block-root/commands/pivot-commands.js +1 -8
- package/dist/_pkgs/affine-block-root/commands/tag-commands.js +1 -8
- package/dist/_pkgs/affine-block-root/configs/toolbar.d.ts +3 -1
- package/dist/_pkgs/affine-block-root/configs/toolbar.js +6 -3
- package/dist/_pkgs/affine-block-root/edgeless/clipboard/utils.js +1 -1
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/alignment.js +26 -4
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/misc.d.ts +14 -0
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/misc.js +10 -3
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.d.ts +8 -0
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.js +9 -0
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.d.ts +9 -0
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.js +66 -6
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.d.ts +22 -0
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +46 -0
- package/dist/_pkgs/affine-block-root/edgeless/utils/consts.d.ts +0 -1
- package/dist/_pkgs/affine-block-root/edgeless/utils/consts.js +0 -1
- package/dist/_pkgs/affine-block-root/edgeless/utils/pinch-zoom.d.ts +21 -0
- package/dist/_pkgs/affine-block-root/edgeless/utils/pinch-zoom.js +24 -0
- package/dist/_pkgs/affine-block-root/edgeless/utils/query.js +8 -0
- package/dist/_pkgs/affine-block-root/keyboard/keymap.js +1 -16
- package/dist/_pkgs/affine-block-root/translations.d.ts +61 -0
- package/dist/_pkgs/affine-block-root/translations.js +172 -0
- package/dist/_pkgs/affine-block-surface/element-model/index.d.ts +21 -3
- package/dist/_pkgs/affine-block-surface/element-model/index.js +14 -2
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +3 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.d.ts +23 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.js +89 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.d.ts +7 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.js +5 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.d.ts +41 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +70 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.d.ts +49 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.js +257 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/tagged-path.d.ts +16 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/tagged-path.js +24 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.d.ts +24 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.js +66 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +5 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.js +5 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.d.ts +66 -4
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +272 -23
- package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +58 -8
- package/dist/_pkgs/affine-block-surface/extensions/interchange.js +27 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend-toolbar.d.ts +81 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend-toolbar.js +81 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend.d.ts +136 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend.js +439 -0
- package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.d.ts +2 -2
- package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.js +5 -2
- package/dist/_pkgs/affine-block-surface/extensions/reading-widget.d.ts +17 -3
- package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +38 -15
- package/dist/_pkgs/affine-block-surface/extensions/reading.d.ts +61 -1
- package/dist/_pkgs/affine-block-surface/extensions/reading.js +85 -39
- package/dist/_pkgs/affine-block-surface/extensions/record-action.d.ts +66 -0
- package/dist/_pkgs/affine-block-surface/extensions/record-action.js +145 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.d.ts +48 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.js +120 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +36 -23
- package/dist/_pkgs/affine-block-surface/extensions/tags-toolbar.js +5 -5
- package/dist/_pkgs/affine-block-surface/extensions/validation.d.ts +253 -28
- package/dist/_pkgs/affine-block-surface/extensions/validation.js +489 -41
- package/dist/_pkgs/affine-block-surface/framework-background/background-view.d.ts +115 -0
- package/dist/_pkgs/affine-block-surface/framework-background/background-view.js +185 -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/labels.d.ts +16 -1
- package/dist/_pkgs/affine-block-surface/framework-background/labels.js +31 -21
- package/dist/_pkgs/affine-block-surface/framework-background/renderer.js +29 -5
- package/dist/_pkgs/affine-block-surface/framework-background/stacking.d.ts +6 -4
- package/dist/_pkgs/affine-block-surface/framework-background/stacking.js +56 -8
- package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.d.ts +12 -0
- package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.js +15 -0
- package/dist/_pkgs/affine-block-surface/view.js +8 -1
- package/dist/_pkgs/affine-block-surface-ref/components/placeholder.d.ts +2 -1
- package/dist/_pkgs/affine-block-surface-ref/components/placeholder.js +21 -6
- package/dist/_pkgs/affine-block-surface-ref/configs/slash-menu.js +24 -7
- package/dist/_pkgs/affine-block-surface-ref/configs/tooltips.js +2 -2
- package/dist/_pkgs/affine-block-surface-ref/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface-ref/index.js +1 -0
- package/dist/_pkgs/affine-block-surface-ref/surface-ref-block-edgeless.js +1 -0
- package/dist/_pkgs/affine-block-surface-ref/surface-ref-block.js +1 -0
- package/dist/_pkgs/affine-block-surface-ref/translations.d.ts +83 -0
- package/dist/_pkgs/affine-block-surface-ref/translations.js +175 -0
- package/dist/_pkgs/affine-block-surface-ref/utils.d.ts +8 -1
- package/dist/_pkgs/affine-block-surface-ref/utils.js +12 -4
- package/dist/_pkgs/affine-components/caption/block-caption.js +3 -1
- package/dist/_pkgs/affine-components/card-style-dropdown-menu/dropdown-menu.js +4 -3
- package/dist/_pkgs/affine-components/citation/citation.d.ts +2 -0
- package/dist/_pkgs/affine-components/citation/citation.js +19 -3
- package/dist/_pkgs/affine-components/color-picker/button.d.ts +62 -1
- package/dist/_pkgs/affine-components/color-picker/button.js +182 -23
- package/dist/_pkgs/affine-components/color-picker/color-panel.d.ts +8 -0
- package/dist/_pkgs/affine-components/color-picker/color-panel.js +17 -2
- package/dist/_pkgs/affine-components/color-picker/color-picker.d.ts +4 -0
- package/dist/_pkgs/affine-components/color-picker/color-picker.js +27 -3
- package/dist/_pkgs/affine-components/color-picker/framework-palette.d.ts +106 -0
- package/dist/_pkgs/affine-components/color-picker/framework-palette.js +177 -0
- package/dist/_pkgs/affine-components/color-picker/index.d.ts +2 -0
- package/dist/_pkgs/affine-components/color-picker/index.js +2 -0
- package/dist/_pkgs/affine-components/color-picker/palette-carousel.d.ts +85 -0
- package/dist/_pkgs/affine-components/color-picker/palette-carousel.js +440 -0
- package/dist/_pkgs/affine-components/color-picker/types.d.ts +21 -0
- package/dist/_pkgs/affine-components/color-picker/utils.d.ts +28 -2
- package/dist/_pkgs/affine-components/color-picker/utils.js +32 -0
- package/dist/_pkgs/affine-components/context-menu/menu-renderer.d.ts +3 -0
- package/dist/_pkgs/affine-components/context-menu/menu-renderer.js +34 -7
- package/dist/_pkgs/affine-components/edgeless-line-styles-panel/line-styles-panel.d.ts +2 -0
- package/dist/_pkgs/affine-components/edgeless-line-styles-panel/line-styles-panel.js +21 -2
- package/dist/_pkgs/affine-components/edgeless-line-width-panel/line-width-panel.d.ts +2 -0
- package/dist/_pkgs/affine-components/edgeless-line-width-panel/line-width-panel.js +18 -2
- package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.d.ts +33 -1
- package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.js +211 -56
- package/dist/_pkgs/affine-components/embed-card-modal/embed-card-create-modal.js +5 -4
- package/dist/_pkgs/affine-components/embed-card-modal/embed-card-edit-modal.js +11 -9
- package/dist/_pkgs/affine-components/filterable-list/index.d.ts +2 -0
- package/dist/_pkgs/affine-components/filterable-list/index.js +17 -2
- package/dist/_pkgs/affine-components/highlight-dropdown-menu/dropdown-menu.d.ts +3 -0
- package/dist/_pkgs/affine-components/highlight-dropdown-menu/dropdown-menu.js +40 -7
- package/dist/_pkgs/affine-components/icon-button/index.d.ts +1 -1
- package/dist/_pkgs/affine-components/icon-button/index.js +1 -1
- package/dist/_pkgs/affine-components/icon-picker/affine-icon-picker-panel.d.ts +6 -0
- package/dist/_pkgs/affine-components/icon-picker/affine-icon-picker-panel.js +42 -7
- package/dist/_pkgs/affine-components/icon-picker/emoji-picker-panel.d.ts +4 -0
- package/dist/_pkgs/affine-components/icon-picker/emoji-picker-panel.js +35 -5
- package/dist/_pkgs/affine-components/icon-picker/icon-picker.d.ts +2 -0
- package/dist/_pkgs/affine-components/icon-picker/icon-picker.js +22 -5
- package/dist/_pkgs/affine-components/linked-doc-title/doc-title.d.ts +2 -0
- package/dist/_pkgs/affine-components/linked-doc-title/doc-title.js +16 -3
- package/dist/_pkgs/affine-components/notification/linked-doc.js +5 -4
- package/dist/_pkgs/affine-components/open-doc-dropdown-menu/dropdown-menu.js +7 -4
- package/dist/_pkgs/affine-components/resource/resource.d.ts +16 -1
- package/dist/_pkgs/affine-components/resource/resource.js +48 -20
- package/dist/_pkgs/affine-components/resource/status.d.ts +2 -0
- package/dist/_pkgs/affine-components/resource/status.js +27 -12
- package/dist/_pkgs/affine-components/size-dropdown-menu/dropdown-menu.d.ts +4 -1
- package/dist/_pkgs/affine-components/size-dropdown-menu/dropdown-menu.js +23 -4
- package/dist/_pkgs/affine-components/toast/toast.d.ts +1 -1
- package/dist/_pkgs/affine-components/toast/toast.js +1 -1
- package/dist/_pkgs/affine-components/toggle-button/toggle-button.d.ts +3 -0
- package/dist/_pkgs/affine-components/toggle-button/toggle-button.js +18 -3
- package/dist/_pkgs/affine-components/toolbar/icon-button.d.ts +2 -0
- package/dist/_pkgs/affine-components/toolbar/icon-button.js +18 -2
- package/dist/_pkgs/affine-components/toolbar/tooltip.d.ts +3 -3
- package/dist/_pkgs/affine-components/toolbar/tooltip.js +3 -3
- package/dist/_pkgs/affine-components/translations.d.ts +149 -0
- package/dist/_pkgs/affine-components/translations.js +495 -0
- package/dist/_pkgs/affine-foundation/view.js +2 -1
- package/dist/_pkgs/affine-fragment-adapter-panel/adapter-panel.d.ts +3 -0
- package/dist/_pkgs/affine-fragment-adapter-panel/adapter-panel.js +12 -1
- package/dist/_pkgs/affine-fragment-adapter-panel/body/adapter-panel-body.js +4 -3
- package/dist/_pkgs/affine-fragment-adapter-panel/config.d.ts +13 -0
- package/dist/_pkgs/affine-fragment-adapter-panel/config.js +18 -4
- package/dist/_pkgs/affine-fragment-adapter-panel/header/adapter-menu.js +2 -2
- package/dist/_pkgs/affine-fragment-adapter-panel/header/adapter-panel-header.js +2 -2
- package/dist/_pkgs/affine-fragment-adapter-panel/translations.d.ts +24 -0
- package/dist/_pkgs/affine-fragment-adapter-panel/translations.js +37 -0
- package/dist/_pkgs/affine-fragment-doc-title/doc-title.d.ts +1 -0
- package/dist/_pkgs/affine-fragment-doc-title/doc-title.js +9 -1
- package/dist/_pkgs/affine-fragment-doc-title/translations.d.ts +13 -0
- package/dist/_pkgs/affine-fragment-doc-title/translations.js +17 -0
- package/dist/_pkgs/affine-fragment-frame-panel/body/frame-panel-body.js +3 -2
- package/dist/_pkgs/affine-fragment-frame-panel/header/frame-panel-header.js +10 -4
- package/dist/_pkgs/affine-fragment-frame-panel/header/frames-setting-menu.js +18 -6
- package/dist/_pkgs/affine-fragment-frame-panel/translations.d.ts +16 -0
- package/dist/_pkgs/affine-fragment-frame-panel/translations.js +44 -0
- package/dist/_pkgs/affine-fragment-outline/body/outline-notice.js +10 -4
- package/dist/_pkgs/affine-fragment-outline/body/outline-panel-body.js +6 -3
- package/dist/_pkgs/affine-fragment-outline/card/outline-card.js +13 -6
- package/dist/_pkgs/affine-fragment-outline/card/outline-preview.d.ts +1 -0
- package/dist/_pkgs/affine-fragment-outline/card/outline-preview.js +16 -9
- package/dist/_pkgs/affine-fragment-outline/config.d.ts +1 -20
- package/dist/_pkgs/affine-fragment-outline/config.js +8 -23
- package/dist/_pkgs/affine-fragment-outline/header/outline-panel-header.js +10 -3
- package/dist/_pkgs/affine-fragment-outline/header/outline-setting-menu.js +9 -2
- package/dist/_pkgs/affine-fragment-outline/outline-viewer.js +6 -3
- package/dist/_pkgs/affine-fragment-outline/translations.d.ts +54 -0
- package/dist/_pkgs/affine-fragment-outline/translations.js +110 -0
- package/dist/_pkgs/affine-gfx-brush/element-renderer.js +2 -2
- package/dist/_pkgs/affine-gfx-brush/toolbar/components/eraser/eraser-tool-button.js +3 -2
- package/dist/_pkgs/affine-gfx-brush/toolbar/components/pen/consts.d.ts +3 -0
- package/dist/_pkgs/affine-gfx-brush/toolbar/components/pen/consts.js +3 -0
- package/dist/_pkgs/affine-gfx-brush/toolbar/components/pen/pen-menu.js +5 -4
- package/dist/_pkgs/affine-gfx-brush/toolbar/components/pen/pen-tool-button.js +3 -2
- package/dist/_pkgs/affine-gfx-brush/toolbar/configs/brush.js +10 -3
- package/dist/_pkgs/affine-gfx-brush/toolbar/configs/highlighter.js +10 -3
- package/dist/_pkgs/affine-gfx-brush/translations.d.ts +17 -0
- package/dist/_pkgs/affine-gfx-brush/translations.js +30 -0
- package/dist/_pkgs/affine-gfx-connector/connector-manager.d.ts +9 -1
- package/dist/_pkgs/affine-gfx-connector/connector-manager.js +61 -0
- package/dist/_pkgs/affine-gfx-connector/direction/invert-direction.d.ts +8 -1
- package/dist/_pkgs/affine-gfx-connector/direction/invert-direction.js +7 -1
- package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.d.ts +7 -1
- package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.js +87 -17
- package/dist/_pkgs/affine-gfx-connector/element-renderer/index.js +78 -17
- package/dist/_pkgs/affine-gfx-connector/element-renderer/utils.d.ts +24 -2
- package/dist/_pkgs/affine-gfx-connector/element-renderer/utils.js +31 -8
- package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.d.ts +124 -3
- package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.js +219 -56
- package/dist/_pkgs/affine-gfx-connector/text/text.d.ts +13 -4
- package/dist/_pkgs/affine-gfx-connector/text/text.js +13 -44
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.d.ts +60 -1
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +95 -13
- package/dist/_pkgs/affine-gfx-connector/toolbar/connector-dense-menu.js +7 -5
- package/dist/_pkgs/affine-gfx-connector/toolbar/connector-menu.js +8 -6
- package/dist/_pkgs/affine-gfx-connector/toolbar/connector-tool-button.js +4 -3
- package/dist/_pkgs/affine-gfx-connector/toolbar/hollow-endpoint-icons.d.ts +8 -0
- package/dist/_pkgs/affine-gfx-connector/toolbar/hollow-endpoint-icons.js +118 -0
- package/dist/_pkgs/affine-gfx-connector/translations.d.ts +32 -0
- package/dist/_pkgs/affine-gfx-connector/translations.js +79 -0
- package/dist/_pkgs/affine-gfx-connector/view/view.d.ts +37 -1
- package/dist/_pkgs/affine-gfx-connector/view/view.js +97 -8
- package/dist/_pkgs/affine-gfx-group/command/group-api.js +6 -1
- package/dist/_pkgs/affine-gfx-group/index.d.ts +1 -0
- package/dist/_pkgs/affine-gfx-group/index.js +1 -0
- package/dist/_pkgs/affine-gfx-group/store.js +0 -2
- package/dist/_pkgs/affine-gfx-group/toolbar/config.d.ts +6 -2
- package/dist/_pkgs/affine-gfx-group/toolbar/config.js +9 -4
- package/dist/_pkgs/affine-gfx-group/translations.d.ts +23 -0
- package/dist/_pkgs/affine-gfx-group/translations.js +29 -0
- package/dist/_pkgs/affine-gfx-link/toolbar/undo-dense-menu.js +2 -1
- package/dist/_pkgs/affine-gfx-link/toolbar/undo-tool-button.js +2 -1
- package/dist/_pkgs/affine-gfx-mindmap/index.d.ts +1 -0
- package/dist/_pkgs/affine-gfx-mindmap/index.js +1 -0
- package/dist/_pkgs/affine-gfx-mindmap/templates/index.js +628 -577
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/basket-elements.js +7 -3
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/config.js +9 -1
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-importing-placeholder.d.ts +4 -0
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-importing-placeholder.js +70 -7
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-menu.js +8 -5
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-tool-button.js +4 -2
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/senior-tool.js +7 -2
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/utils/import-mindmap.d.ts +2 -1
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/utils/import-mindmap.js +16 -8
- package/dist/_pkgs/affine-gfx-mindmap/translations.d.ts +84 -0
- package/dist/_pkgs/affine-gfx-mindmap/translations.js +171 -0
- package/dist/_pkgs/affine-gfx-note/components/note-display-mode-panel.d.ts +8 -0
- package/dist/_pkgs/affine-gfx-note/components/note-display-mode-panel.js +24 -9
- package/dist/_pkgs/affine-gfx-note/components/note-shadow-panel.d.ts +9 -0
- package/dist/_pkgs/affine-gfx-note/components/note-shadow-panel.js +28 -8
- package/dist/_pkgs/affine-gfx-note/toolbar/note-menu-config.d.ts +2 -1
- package/dist/_pkgs/affine-gfx-note/toolbar/note-menu-config.js +42 -73
- package/dist/_pkgs/affine-gfx-note/toolbar/note-menu.js +21 -17
- package/dist/_pkgs/affine-gfx-note/toolbar/note-senior-button.js +3 -2
- package/dist/_pkgs/affine-gfx-note/toolbar/note-tool-button.js +3 -1
- package/dist/_pkgs/affine-gfx-note/toolbar/senior-tool.js +3 -1
- package/dist/_pkgs/affine-gfx-note/translations.d.ts +27 -0
- package/dist/_pkgs/affine-gfx-note/translations.js +59 -0
- package/dist/_pkgs/affine-gfx-pointer/quick-tool/default-tool-button.js +10 -2
- package/dist/_pkgs/affine-gfx-pointer/translations.d.ts +9 -0
- package/dist/_pkgs/affine-gfx-pointer/translations.js +17 -0
- package/dist/_pkgs/affine-gfx-shape/components/shape-panel.d.ts +4 -0
- package/dist/_pkgs/affine-gfx-shape/components/shape-panel.js +17 -3
- package/dist/_pkgs/affine-gfx-shape/components/shape-style-panel.d.ts +4 -0
- package/dist/_pkgs/affine-gfx-shape/components/shape-style-panel.js +23 -5
- package/dist/_pkgs/affine-gfx-shape/draggable/shape-menu.d.ts +0 -1
- package/dist/_pkgs/affine-gfx-shape/draggable/shape-menu.js +6 -46
- package/dist/_pkgs/affine-gfx-shape/draggable/shape-tool-button.js +3 -1
- package/dist/_pkgs/affine-gfx-shape/element-renderer/highlighter.js +2 -2
- package/dist/_pkgs/affine-gfx-shape/overlay/polygon-drawing-overlay.d.ts +6 -0
- package/dist/_pkgs/affine-gfx-shape/overlay/polygon-drawing-overlay.js +30 -1
- package/dist/_pkgs/affine-gfx-shape/polygon-tool.d.ts +20 -1
- package/dist/_pkgs/affine-gfx-shape/polygon-tool.js +9 -1
- package/dist/_pkgs/affine-gfx-shape/toolbar/config.d.ts +2 -0
- package/dist/_pkgs/affine-gfx-shape/toolbar/config.js +35 -9
- package/dist/_pkgs/affine-gfx-shape/toolbar/palette-color-action.js +11 -1
- package/dist/_pkgs/affine-gfx-shape/toolbar/senior-tool.js +2 -0
- package/dist/_pkgs/affine-gfx-shape/toolbar/shape-menu-config.d.ts +3 -0
- package/dist/_pkgs/affine-gfx-shape/toolbar/shape-menu-config.js +7 -0
- package/dist/_pkgs/affine-gfx-shape/translations.d.ts +37 -0
- package/dist/_pkgs/affine-gfx-shape/translations.js +93 -0
- package/dist/_pkgs/affine-gfx-template/builtin/other.js +70 -42
- package/dist/_pkgs/affine-gfx-template/contribute.js +8 -1
- package/dist/_pkgs/affine-gfx-template/index.d.ts +2 -0
- package/dist/_pkgs/affine-gfx-template/index.js +2 -0
- package/dist/_pkgs/affine-gfx-template/snapshot-from-action.d.ts +6 -1
- package/dist/_pkgs/affine-gfx-template/snapshot-from-action.js +43 -120
- package/dist/_pkgs/affine-gfx-template/toolbar/builtin-templates.d.ts +1 -0
- package/dist/_pkgs/affine-gfx-template/toolbar/builtin-templates.js +12 -0
- package/dist/_pkgs/affine-gfx-template/toolbar/resolve-name.d.ts +25 -0
- package/dist/_pkgs/affine-gfx-template/toolbar/resolve-name.js +36 -0
- package/dist/_pkgs/affine-gfx-template/toolbar/senior-tool.js +3 -1
- package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.d.ts +1 -0
- package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.js +30 -8
- package/dist/_pkgs/affine-gfx-template/toolbar/template-type.d.ts +41 -0
- package/dist/_pkgs/affine-gfx-template/translations.d.ts +71 -0
- package/dist/_pkgs/affine-gfx-template/translations.js +209 -0
- package/dist/_pkgs/affine-gfx-text/dblclick-add-edgeless-text.d.ts +13 -1
- package/dist/_pkgs/affine-gfx-text/dblclick-add-edgeless-text.js +19 -4
- package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.d.ts +41 -0
- package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.js +60 -4
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.d.ts +9 -2
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +33 -10
- package/dist/_pkgs/affine-gfx-text/toolbar/text-menu.js +1 -0
- package/dist/_pkgs/affine-gfx-text/translations.d.ts +32 -0
- package/dist/_pkgs/affine-gfx-text/translations.js +65 -0
- package/dist/_pkgs/affine-inline-footnote/footnote-node/footnote-popup.js +8 -2
- package/dist/_pkgs/affine-inline-latex/latex-node/latex-editor-menu.js +5 -2
- package/dist/_pkgs/affine-inline-latex/latex-node/latex-node.js +7 -2
- package/dist/_pkgs/affine-inline-latex/translations.d.ts +13 -0
- package/dist/_pkgs/affine-inline-latex/translations.js +16 -0
- package/dist/_pkgs/affine-inline-link/link-node/configs/toolbar.d.ts +3 -3
- package/dist/_pkgs/affine-inline-link/link-node/configs/toolbar.js +6 -5
- package/dist/_pkgs/affine-inline-link/link-node/link-popup/link-popup.js +11 -5
- package/dist/_pkgs/affine-inline-link/translations.d.ts +23 -0
- package/dist/_pkgs/affine-inline-link/translations.js +44 -0
- package/dist/_pkgs/affine-inline-mention/affine-mention.js +11 -5
- package/dist/_pkgs/affine-inline-mention/translations.d.ts +16 -0
- package/dist/_pkgs/affine-inline-mention/translations.js +29 -0
- package/dist/_pkgs/affine-inline-preset/command/config.d.ts +3 -0
- package/dist/_pkgs/affine-inline-preset/command/config.js +8 -0
- package/dist/_pkgs/affine-inline-preset/markdown.js +5 -1
- package/dist/_pkgs/affine-inline-preset/translations.d.ts +25 -0
- package/dist/_pkgs/affine-inline-preset/translations.js +28 -0
- package/dist/_pkgs/affine-inline-reference/reference-node/configs/toolbar.js +2 -2
- package/dist/_pkgs/affine-inline-reference/reference-node/reference-node.js +3 -3
- package/dist/_pkgs/affine-inline-reference/reference-node/reference-popup/reference-popup.js +8 -6
- package/dist/_pkgs/affine-inline-reference/translations.d.ts +8 -0
- package/dist/_pkgs/affine-inline-reference/translations.js +13 -0
- package/dist/_pkgs/affine-model/consts/connector.d.ts +28 -2
- package/dist/_pkgs/affine-model/consts/connector.js +26 -0
- package/dist/_pkgs/affine-model/elements/bpmn/pool.js +1 -1
- package/dist/_pkgs/affine-model/elements/brush/brush.js +1 -1
- package/dist/_pkgs/affine-model/elements/c4/board.js +1 -1
- package/dist/_pkgs/affine-model/elements/c4/boundary.js +1 -1
- package/dist/_pkgs/affine-model/elements/connector/connector.d.ts +135 -0
- package/dist/_pkgs/affine-model/elements/connector/connector.js +246 -5
- package/dist/_pkgs/affine-model/elements/connector/end-label.d.ts +83 -0
- package/dist/_pkgs/affine-model/elements/connector/end-label.js +119 -0
- package/dist/_pkgs/affine-model/elements/connector/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/connector/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/context-map/context-map.js +1 -1
- package/dist/_pkgs/affine-model/elements/core-domain/core-domain.d.ts +28 -0
- package/dist/_pkgs/affine-model/elements/core-domain/core-domain.js +129 -2
- package/dist/_pkgs/affine-model/elements/cynefin/cynefin.d.ts +8 -0
- package/dist/_pkgs/affine-model/elements/cynefin/cynefin.js +45 -2
- package/dist/_pkgs/affine-model/elements/edgy/board.js +1 -1
- package/dist/_pkgs/affine-model/elements/edgy/facets.js +1 -1
- package/dist/_pkgs/affine-model/elements/estuarine/estuarine.d.ts +6 -0
- package/dist/_pkgs/affine-model/elements/estuarine/estuarine.js +36 -2
- package/dist/_pkgs/affine-model/elements/event-storming/event-storming.d.ts +18 -7
- package/dist/_pkgs/affine-model/elements/event-storming/event-storming.js +23 -8
- package/dist/_pkgs/affine-model/elements/framework-background/background.d.ts +16 -0
- package/dist/_pkgs/affine-model/elements/framework-background/background.js +18 -0
- package/dist/_pkgs/affine-model/elements/highlighter/highlighter.js +1 -1
- package/dist/_pkgs/affine-model/elements/index.d.ts +8 -0
- package/dist/_pkgs/affine-model/elements/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/shape/shape.js +1 -1
- package/dist/_pkgs/affine-model/elements/text/text.js +1 -1
- package/dist/_pkgs/affine-model/elements/uml/band.d.ts +39 -0
- package/dist/_pkgs/affine-model/elements/uml/band.js +31 -0
- package/dist/_pkgs/affine-model/elements/uml/diagram.d.ts +158 -0
- package/dist/_pkgs/affine-model/elements/uml/diagram.js +229 -0
- package/dist/_pkgs/affine-model/elements/uml/fragment.d.ts +161 -0
- package/dist/_pkgs/affine-model/elements/uml/fragment.js +205 -0
- package/dist/_pkgs/affine-model/elements/uml/index.d.ts +8 -0
- package/dist/_pkgs/affine-model/elements/uml/index.js +8 -0
- package/dist/_pkgs/affine-model/elements/uml/lifeline.d.ts +77 -0
- package/dist/_pkgs/affine-model/elements/uml/lifeline.js +89 -0
- package/dist/_pkgs/affine-model/elements/uml/node.d.ts +142 -0
- package/dist/_pkgs/affine-model/elements/uml/node.js +190 -0
- package/dist/_pkgs/affine-model/elements/uml/partition.d.ts +106 -0
- package/dist/_pkgs/affine-model/elements/uml/partition.js +172 -0
- package/dist/_pkgs/affine-model/elements/uml/region.d.ts +75 -0
- package/dist/_pkgs/affine-model/elements/uml/region.js +150 -0
- package/dist/_pkgs/affine-model/elements/uml/subject.d.ts +37 -0
- package/dist/_pkgs/affine-model/elements/uml/subject.js +108 -0
- package/dist/_pkgs/affine-model/elements/wardley/wardley.js +1 -1
- package/dist/_pkgs/affine-rich-text/conversion.d.ts +13 -0
- package/dist/_pkgs/affine-rich-text/conversion.js +27 -0
- package/dist/_pkgs/affine-shared/adapters/clipboard/clipboard.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/clipboard/utils.d.ts +2 -1
- package/dist/_pkgs/affine-shared/adapters/clipboard/utils.js +6 -3
- package/dist/_pkgs/affine-shared/adapters/markdown/markdown.js +5 -2
- package/dist/_pkgs/affine-shared/adapters/mix-text.js +5 -2
- package/dist/_pkgs/affine-shared/adapters/plain-text/plain-text.js +5 -2
- package/dist/_pkgs/affine-shared/adapters/utils/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/adapters/utils/index.js +1 -0
- package/dist/_pkgs/affine-shared/adapters/utils/wording.d.ts +9 -0
- package/dist/_pkgs/affine-shared/adapters/utils/wording.js +12 -0
- package/dist/_pkgs/affine-shared/services/comment-service/utils.js +2 -0
- package/dist/_pkgs/affine-shared/services/doc-display-meta-service.js +6 -3
- package/dist/_pkgs/affine-shared/services/embed-iframe/embed-iframe-config.d.ts +1 -0
- package/dist/_pkgs/affine-shared/services/font-loader/config.d.ts +7 -0
- package/dist/_pkgs/affine-shared/services/font-loader/config.js +43 -0
- package/dist/_pkgs/affine-shared/services/notification-service.js +18 -1
- package/dist/_pkgs/affine-shared/services/open-doc-config.d.ts +0 -1
- package/dist/_pkgs/affine-shared/services/open-doc-config.js +0 -2
- package/dist/_pkgs/affine-shared/services/pivot-materiality-publisher.js +1 -9
- package/dist/_pkgs/affine-shared/services/telemetry-service/document-damage-watcher.d.ts +53 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/document-damage-watcher.js +95 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/index.js +1 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +26 -1
- package/dist/_pkgs/affine-shared/services/telemetry-service/telemetry-service.d.ts +2 -2
- package/dist/_pkgs/affine-shared/services/toolbar-service/command-action.d.ts +34 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/command-action.js +63 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/index.js +1 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +432 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +1045 -3
- package/dist/_pkgs/affine-shared/services/translation-service/index.d.ts +40 -2
- package/dist/_pkgs/affine-shared/services/translation-service/index.js +44 -3
- package/dist/_pkgs/affine-shared/services/universe-tag-defs-service.d.ts +83 -2
- package/dist/_pkgs/affine-shared/services/universe-tag-defs-service.js +92 -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/motion.d.ts +14 -0
- package/dist/_pkgs/affine-shared/styles/motion.js +38 -0
- package/dist/_pkgs/affine-shared/utils/event.d.ts +10 -0
- package/dist/_pkgs/affine-shared/utils/event.js +20 -0
- package/dist/_pkgs/affine-shared/utils/file/filesys.d.ts +16 -0
- package/dist/_pkgs/affine-shared/utils/file/filesys.js +25 -0
- package/dist/_pkgs/affine-shared/utils/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/utils/index.js +1 -0
- package/dist/_pkgs/affine-shared/utils/link-preview-refresh.d.ts +12 -0
- package/dist/_pkgs/affine-shared/utils/link-preview-refresh.js +13 -0
- package/dist/_pkgs/affine-widget-drag-handle/components/edgeless-preview/preview.d.ts +4 -0
- package/dist/_pkgs/affine-widget-drag-handle/components/edgeless-preview/preview.js +21 -8
- package/dist/_pkgs/affine-widget-drag-handle/helpers/preview-helper.js +1 -0
- package/dist/_pkgs/affine-widget-drag-handle/translations.d.ts +14 -0
- package/dist/_pkgs/affine-widget-drag-handle/translations.js +35 -0
- package/dist/_pkgs/affine-widget-edgeless-auto-connect/index.js +4 -3
- package/dist/_pkgs/affine-widget-edgeless-auto-connect/translations.d.ts +6 -0
- package/dist/_pkgs/affine-widget-edgeless-auto-connect/translations.js +14 -0
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/auto-complete-panel.js +8 -5
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/edgeless-auto-complete.js +3 -2
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/edgeless-element-link.js +3 -1
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/translations.d.ts +17 -0
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/translations.js +30 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/button/tool-icon-button.d.ts +4 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/button/tool-icon-button.js +18 -2
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.d.ts +12 -4
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +29 -6
- package/dist/_pkgs/affine-widget-edgeless-toolbar/config/consts.d.ts +2 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/config/consts.js +3 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/config/types.d.ts +18 -1
- package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.d.ts +8 -3
- package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.js +38 -18
- package/dist/_pkgs/affine-widget-edgeless-toolbar/create-popper.js +13 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/edgeless-toolbar.js +2 -1
- package/dist/_pkgs/affine-widget-edgeless-toolbar/index.d.ts +2 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/index.js +2 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.d.ts +80 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.js +270 -81
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/senior-menu-selection.d.ts +15 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/senior-menu-selection.js +15 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-weight-and-style-panel.d.ts +8 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-weight-and-style-panel.js +38 -8
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-ghost-overlay.d.ts +42 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-ghost-overlay.js +100 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-placement-tool.d.ts +100 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-placement-tool.js +274 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/index.d.ts +3 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/index.js +3 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/translate-created.d.ts +25 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/translate-created.js +67 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.d.ts +15 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.js +20 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +5 -0
- package/dist/_pkgs/affine-widget-edgeless-zoom-toolbar/translations.d.ts +7 -0
- package/dist/_pkgs/affine-widget-edgeless-zoom-toolbar/translations.js +23 -0
- package/dist/_pkgs/affine-widget-edgeless-zoom-toolbar/zoom-bar-toggle-button.js +3 -1
- package/dist/_pkgs/affine-widget-edgeless-zoom-toolbar/zoom-toolbar.js +5 -3
- package/dist/_pkgs/affine-widget-linked-doc/config.js +15 -10
- package/dist/_pkgs/affine-widget-linked-doc/import-doc/import-doc.d.ts +12 -1
- package/dist/_pkgs/affine-widget-linked-doc/import-doc/import-doc.js +27 -18
- package/dist/_pkgs/affine-widget-linked-doc/import-doc/index.d.ts +4 -1
- package/dist/_pkgs/affine-widget-linked-doc/import-doc/index.js +2 -2
- package/dist/_pkgs/affine-widget-linked-doc/linked-doc-popover.js +4 -1
- package/dist/_pkgs/affine-widget-linked-doc/mobile-linked-doc-menu.js +6 -2
- package/dist/_pkgs/affine-widget-linked-doc/transformers/html.js +3 -2
- package/dist/_pkgs/affine-widget-linked-doc/transformers/markdown.js +3 -2
- package/dist/_pkgs/affine-widget-linked-doc/translations.d.ts +53 -0
- package/dist/_pkgs/affine-widget-linked-doc/translations.js +104 -0
- package/dist/_pkgs/affine-widget-remote-selection/edgeless/index.js +4 -1
- package/dist/_pkgs/affine-widget-remote-selection/translations.d.ts +12 -0
- package/dist/_pkgs/affine-widget-remote-selection/translations.js +12 -0
- package/dist/_pkgs/affine-widget-slash-menu/config.js +15 -0
- package/dist/_pkgs/affine-widget-slash-menu/index.d.ts +1 -0
- package/dist/_pkgs/affine-widget-slash-menu/index.js +1 -0
- package/dist/_pkgs/affine-widget-slash-menu/slash-menu-popover.js +30 -15
- package/dist/_pkgs/affine-widget-slash-menu/tooltips/copy.js +1 -1
- package/dist/_pkgs/affine-widget-slash-menu/tooltips/delete.js +2 -2
- package/dist/_pkgs/affine-widget-slash-menu/tooltips/index.js +9 -0
- package/dist/_pkgs/affine-widget-slash-menu/tooltips/move-down.js +2 -2
- package/dist/_pkgs/affine-widget-slash-menu/tooltips/move-up.js +2 -2
- package/dist/_pkgs/affine-widget-slash-menu/tooltips/now.js +3 -3
- package/dist/_pkgs/affine-widget-slash-menu/tooltips/today.js +2 -2
- package/dist/_pkgs/affine-widget-slash-menu/tooltips/tomorrow.js +3 -3
- package/dist/_pkgs/affine-widget-slash-menu/tooltips/yesterday.js +3 -3
- package/dist/_pkgs/affine-widget-slash-menu/translations.d.ts +91 -0
- package/dist/_pkgs/affine-widget-slash-menu/translations.js +175 -0
- package/dist/_pkgs/affine-widget-slash-menu/types.d.ts +18 -0
- package/dist/_pkgs/affine-widget-slash-menu/utils.d.ts +20 -1
- package/dist/_pkgs/affine-widget-slash-menu/utils.js +37 -0
- package/dist/_pkgs/affine-widget-toolbar/translations.d.ts +9 -0
- package/dist/_pkgs/affine-widget-toolbar/translations.js +13 -0
- package/dist/_pkgs/affine-widget-toolbar/utils.js +2 -1
- package/dist/_pkgs/global/gfx/xywh.js +7 -0
- package/dist/_pkgs/std/extension/command-registry.d.ts +158 -1
- package/dist/_pkgs/std/extension/command-registry.js +22 -0
- package/dist/_pkgs/std/extension/translation-manifest.d.ts +7 -0
- package/dist/_pkgs/std/gfx/index.d.ts +1 -1
- package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.d.ts +12 -0
- package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.js +20 -1
- package/dist/_pkgs/std/gfx/interactivity/manager.d.ts +10 -0
- package/dist/_pkgs/std/gfx/interactivity/manager.js +12 -0
- package/dist/_pkgs/std/gfx/model/surface/element-model.js +12 -7
- package/dist/_pkgs/std/gfx/model/surface/surface-model.d.ts +56 -0
- package/dist/_pkgs/std/gfx/model/surface/surface-model.js +84 -3
- package/dist/_pkgs/std/gfx/view/view.d.ts +11 -2
- package/dist/_pkgs/std/gfx/view/view.js +16 -2
- package/dist/_pkgs/std/translations.d.ts +24 -0
- package/dist/_pkgs/std/translations.js +28 -0
- package/dist/_pkgs/std/view/element/block-component.js +24 -7
- package/dist/commands.d.ts +6 -0
- package/dist/commands.js +8 -1
- package/dist/frameworks.d.ts +9 -0
- package/dist/frameworks.js +19 -0
- package/dist/translations.js +160 -5
- package/package.json +9 -4
- package/dist/_pkgs/affine-gfx-group/group-watcher.d.ts +0 -1
- package/dist/_pkgs/affine-gfx-group/group-watcher.js +0 -20
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { ConnectorMode, } from '../../affine-model/index.js';
|
|
2
|
+
import { NOTATION_NEUTRALS } from '../../affine-shared/consts/index.js';
|
|
2
3
|
import { getBezierParameters, getBezierTangent, Vec } from '../../global/gfx/index.js';
|
|
3
4
|
export const DEFAULT_ARROW_SIZE = 15;
|
|
5
|
+
/**
|
|
6
|
+
* The interior of a hollow endpoint head (`TriangleHollow`, `DiamondHollow`).
|
|
7
|
+
*
|
|
8
|
+
* The notation card fill (R33), NOT a theme-resolved token and NOT
|
|
9
|
+
* `transparent`: a UML hollow head reads as a white shape sitting on top of the
|
|
10
|
+
* line it terminates, exactly like the class box it points at — which is itself
|
|
11
|
+
* painted `NOTATION_NEUTRALS.cardFill` in every theme. `transparent` would let
|
|
12
|
+
* the connector's own line show through the head; a theme token would turn the
|
|
13
|
+
* head black-on-black next to a card-white box in a dark host.
|
|
14
|
+
*/
|
|
15
|
+
export const HOLLOW_HEAD_FILL = NOTATION_NEUTRALS.cardFill;
|
|
4
16
|
export function getArrowPoints(points, size = 10, mode, bezierParameters, endPoint = 'Rear', radians = Math.PI / 4) {
|
|
5
17
|
const anchorPoint = getPointWithTangent(points, mode, endPoint, bezierParameters);
|
|
6
18
|
const unit = Vec.mul(anchorPoint.tangent, -1);
|
|
@@ -70,7 +82,12 @@ export function getDiamondPoints(point, size = 10, endPoint = 'Rear') {
|
|
|
70
82
|
points: diamondPoints,
|
|
71
83
|
};
|
|
72
84
|
}
|
|
73
|
-
|
|
85
|
+
/**
|
|
86
|
+
* @param fillColor the interior of a closed head. Defaults to `strokeColor`, so
|
|
87
|
+
* a `Triangle` or a `Diamond` stays the solid head it has always been; the
|
|
88
|
+
* hollow UML heads pass `HOLLOW_HEAD_FILL` instead.
|
|
89
|
+
*/
|
|
90
|
+
export function getArrowOptions(end, model, strokeColor, fillColor = strokeColor) {
|
|
74
91
|
const { seed, mode, rough, roughness, strokeWidth, path } = model;
|
|
75
92
|
return {
|
|
76
93
|
end,
|
|
@@ -80,7 +97,7 @@ export function getArrowOptions(end, model, strokeColor) {
|
|
|
80
97
|
roughness,
|
|
81
98
|
strokeWidth,
|
|
82
99
|
strokeColor,
|
|
83
|
-
fillColor
|
|
100
|
+
fillColor,
|
|
84
101
|
fillStyle: 'solid',
|
|
85
102
|
bezierParameters: getBezierParameters(path),
|
|
86
103
|
};
|
|
@@ -96,8 +113,14 @@ export function getRcOptions(options) {
|
|
|
96
113
|
fillStyle: 'solid',
|
|
97
114
|
};
|
|
98
115
|
}
|
|
99
|
-
|
|
100
|
-
|
|
116
|
+
/**
|
|
117
|
+
* @param color the outline colour.
|
|
118
|
+
* @param fillColor the interior colour. Defaults to `color` — the solid head.
|
|
119
|
+
* A hollow head passes the notation card fill, so the outline stays the
|
|
120
|
+
* connector's colour while the inside reads as empty.
|
|
121
|
+
*/
|
|
122
|
+
export function renderRoundedPolygon(ctx, points, color, strokeWidth, fill = true, fillColor = color) {
|
|
123
|
+
ctx.fillStyle = fillColor;
|
|
101
124
|
ctx.strokeStyle = color;
|
|
102
125
|
ctx.lineWidth = strokeWidth;
|
|
103
126
|
ctx.lineJoin = 'round';
|
|
@@ -132,7 +155,7 @@ export function renderArrow(points, ctx, rc, options) {
|
|
|
132
155
|
}
|
|
133
156
|
}
|
|
134
157
|
export function renderTriangle(points, ctx, rc, options) {
|
|
135
|
-
const { mode, end, bezierParameters, rough, strokeColor, strokeWidth } = options;
|
|
158
|
+
const { mode, end, bezierParameters, rough, fillColor, strokeColor, strokeWidth, } = options;
|
|
136
159
|
const radians = Math.PI / 6;
|
|
137
160
|
const size = DEFAULT_ARROW_SIZE * (strokeWidth / 2);
|
|
138
161
|
const { points: trianglePoints } = getArrowPoints(points, size, mode, bezierParameters, end, radians);
|
|
@@ -144,11 +167,11 @@ export function renderTriangle(points, ctx, rc, options) {
|
|
|
144
167
|
], getRcOptions(options));
|
|
145
168
|
}
|
|
146
169
|
else {
|
|
147
|
-
renderRoundedPolygon(ctx, trianglePoints, strokeColor, strokeWidth);
|
|
170
|
+
renderRoundedPolygon(ctx, trianglePoints, strokeColor, strokeWidth, true, fillColor);
|
|
148
171
|
}
|
|
149
172
|
}
|
|
150
173
|
export function renderDiamond(points, ctx, rc, options) {
|
|
151
|
-
const { mode, end, rough, bezierParameters, strokeColor, strokeWidth } = options;
|
|
174
|
+
const { mode, end, rough, bezierParameters, fillColor, strokeColor, strokeWidth, } = options;
|
|
152
175
|
const anchorPoint = getPointWithTangent(points, mode, end, bezierParameters);
|
|
153
176
|
const size = 10 * (strokeWidth / 2);
|
|
154
177
|
const { points: diamondPoints } = getDiamondPoints(anchorPoint, size, end);
|
|
@@ -161,7 +184,7 @@ export function renderDiamond(points, ctx, rc, options) {
|
|
|
161
184
|
], getRcOptions(options));
|
|
162
185
|
}
|
|
163
186
|
else {
|
|
164
|
-
renderRoundedPolygon(ctx, diamondPoints, strokeColor, strokeWidth);
|
|
187
|
+
renderRoundedPolygon(ctx, diamondPoints, strokeColor, strokeWidth, true, fillColor);
|
|
165
188
|
}
|
|
166
189
|
}
|
|
167
190
|
export function renderCircle(points, ctx, rc, options) {
|
|
@@ -1,17 +1,136 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ConnectorElementModel, type ConnectorLabelEnd } from '../../affine-model/index.js';
|
|
2
2
|
import type { RichText } from '../../affine-rich-text/index.js';
|
|
3
|
-
import { type IVec } from '../../global/gfx/index.js';
|
|
3
|
+
import { type IVec, type XYWH } from '../../global/gfx/index.js';
|
|
4
4
|
import { type BlockComponent, type BlockStdScope, ShadowlessElement } from '../../std/index.js';
|
|
5
|
-
|
|
5
|
+
import * as Y from 'yjs';
|
|
6
|
+
/**
|
|
7
|
+
* Which of a connector's three labels a gesture is about — its centre caption,
|
|
8
|
+
* or one of the two end labels UML writes multiplicities and role names in
|
|
9
|
+
* (`docs/adr/0018` phase 2).
|
|
10
|
+
*
|
|
11
|
+
* Built on the model's own `ConnectorLabelEnd` rather than restating its two
|
|
12
|
+
* members: the ends are the model's vocabulary — they are the names of its two
|
|
13
|
+
* `Connection`s — and only the EDITOR has a third case, because only the editor
|
|
14
|
+
* has to be pointed at one label out of three.
|
|
15
|
+
*/
|
|
16
|
+
export type ConnectorLabelWhich = 'center' | ConnectorLabelEnd;
|
|
17
|
+
/**
|
|
18
|
+
* The model fields each label lives in.
|
|
19
|
+
*
|
|
20
|
+
* Declared once, as data, because THREE places need the same answer — the
|
|
21
|
+
* editor's read, its resize write and its empty-commit delete — and three
|
|
22
|
+
* `which === 'center' ? … : …` chains is how one of them ends up writing the
|
|
23
|
+
* centre label's box under an end label's text.
|
|
24
|
+
*/
|
|
25
|
+
export declare const CONNECTOR_LABEL_FIELDS: {
|
|
26
|
+
readonly center: {
|
|
27
|
+
readonly text: "text";
|
|
28
|
+
readonly xywh: "labelXYWH";
|
|
29
|
+
};
|
|
30
|
+
readonly source: {
|
|
31
|
+
readonly text: "sourceLabel";
|
|
32
|
+
readonly xywh: "sourceLabelXYWH";
|
|
33
|
+
};
|
|
34
|
+
readonly target: {
|
|
35
|
+
readonly text: "targetLabel";
|
|
36
|
+
readonly xywh: "targetLabelXYWH";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
/** {@link CONNECTOR_LABEL_FIELDS}, defaulting to the centre label. */
|
|
40
|
+
export declare function connectorLabelFields(which?: ConnectorLabelWhich): {
|
|
41
|
+
readonly text: "text";
|
|
42
|
+
readonly xywh: "labelXYWH";
|
|
43
|
+
} | {
|
|
44
|
+
readonly text: "sourceLabel";
|
|
45
|
+
readonly xywh: "sourceLabelXYWH";
|
|
46
|
+
} | {
|
|
47
|
+
readonly text: "targetLabel";
|
|
48
|
+
readonly xywh: "targetLabelXYWH";
|
|
49
|
+
};
|
|
50
|
+
/** The `Y.Text` of `which`, or `undefined` when that label does not exist. */
|
|
51
|
+
export declare function connectorLabelText(connector: ConnectorElementModel, which?: ConnectorLabelWhich): Y.Text | undefined;
|
|
52
|
+
/** The box of `which`, or `undefined` when that label does not exist. */
|
|
53
|
+
export declare function connectorLabelXYWH(connector: ConnectorElementModel, which?: ConnectorLabelWhich): XYWH | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* The box an end label of `size` takes on the current path — the one geometry
|
|
56
|
+
* helper the model owns, so the renderer, the editor and the hit test all place
|
|
57
|
+
* an end label in the same spot.
|
|
58
|
+
*/
|
|
59
|
+
export declare function connectorEndLabelBoxFor(connector: ConnectorElementModel, which: ConnectorLabelEnd, size?: {
|
|
60
|
+
w: number;
|
|
61
|
+
h: number;
|
|
62
|
+
}): XYWH;
|
|
63
|
+
/**
|
|
64
|
+
* What to write so that `which` EXISTS, or `null` when it already does.
|
|
65
|
+
*
|
|
66
|
+
* The centre label is seeded where the pointer is, riding the path by an offset
|
|
67
|
+
* distance — it has always been a caption the author places. An end label is
|
|
68
|
+
* seeded at its ENDPOINT and ignores the pointer: the whole value of one is
|
|
69
|
+
* that it follows the end when the node moves (`docs/adr/0018`, "Alternatives
|
|
70
|
+
* rejected"), so where the double-click landed says nothing about where it
|
|
71
|
+
* belongs.
|
|
72
|
+
*/
|
|
73
|
+
export declare function connectorLabelSeedProps(connector: ConnectorElementModel, which?: ConnectorLabelWhich, point?: IVec): Record<string, unknown> | null;
|
|
74
|
+
/**
|
|
75
|
+
* What to write when an editing session ENDS, or `null` when the text is
|
|
76
|
+
* already exactly what the model holds.
|
|
77
|
+
*
|
|
78
|
+
* A label committed empty clears both of its fields, so the connector reads
|
|
79
|
+
* as one that has none (`hasEndLabel` false, nothing painted, nothing
|
|
80
|
+
* exported). The KEYS stay in the Y.Map as `undefined` — the field setter
|
|
81
|
+
* writes what it is given — so only a connector that never carried an end
|
|
82
|
+
* label is byte-identical to a pre-0020 one; `docs/adr/0020`'s "no migration"
|
|
83
|
+
* promise is about that connector, not about this reset.
|
|
84
|
+
*
|
|
85
|
+
* Pure and exported: it is the one rule with three outcomes (delete, trim,
|
|
86
|
+
* nothing) times three labels, and a spec should be able to ask it directly.
|
|
87
|
+
*/
|
|
88
|
+
export declare function connectorLabelCommitProps(raw: string, which?: ConnectorLabelWhich): Record<string, unknown> | null;
|
|
89
|
+
export type MountConnectorLabelEditorOptions = {
|
|
90
|
+
/** Which label to edit. Defaults to the centre one. */
|
|
91
|
+
which?: ConnectorLabelWhich;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Opens the label editor on ONE of a connector's three labels.
|
|
95
|
+
*
|
|
96
|
+
* This function used to exist twice — here and byte-alike in `text.ts`, which
|
|
97
|
+
* was the copy the package barrel re-exported — so the toolbar and the keyboard
|
|
98
|
+
* reached one body and the view's double-click the other. `docs/adr/0018`
|
|
99
|
+
* phase 2 makes the difference visible (a selector only one copy would have
|
|
100
|
+
* carried), so the duplicate is gone and `text.ts` re-exports this one.
|
|
101
|
+
*/
|
|
102
|
+
export declare function mountConnectorLabelEditor(connector: ConnectorElementModel, edgeless: BlockComponent, point?: IVec, options?: MountConnectorLabelEditorOptions): void;
|
|
6
103
|
declare const EdgelessConnectorLabelEditor_base: typeof ShadowlessElement & import("../../global/utils/types.js").Constructor<import("../../global/lit/with-disposable.js").DisposableClass>;
|
|
7
104
|
export declare class EdgelessConnectorLabelEditor extends EdgelessConnectorLabelEditor_base {
|
|
8
105
|
static styles: import("lit").CSSResult;
|
|
9
106
|
get crud(): import("../../affine-block-surface/index.js").EdgelessCRUDExtension;
|
|
10
107
|
get gfx(): import("../../std/gfx/controller.js").GfxController;
|
|
11
108
|
get selection(): import("../../std/gfx/selection.js").GfxSelectionManager;
|
|
109
|
+
/** The two model fields this editor reads and writes. */
|
|
110
|
+
get fields(): {
|
|
111
|
+
readonly text: "text";
|
|
112
|
+
readonly xywh: "labelXYWH";
|
|
113
|
+
} | {
|
|
114
|
+
readonly text: "sourceLabel";
|
|
115
|
+
readonly xywh: "sourceLabelXYWH";
|
|
116
|
+
} | {
|
|
117
|
+
readonly text: "targetLabel";
|
|
118
|
+
readonly xywh: "targetLabelXYWH";
|
|
119
|
+
};
|
|
120
|
+
/** The `Y.Text` this editor is bound to. */
|
|
121
|
+
get yText(): Y.Text | undefined;
|
|
12
122
|
private _isComposition;
|
|
13
123
|
private _keeping;
|
|
124
|
+
private _removing;
|
|
14
125
|
private _resizeObserver;
|
|
126
|
+
/**
|
|
127
|
+
* Where the editor sits, in MODEL coordinates.
|
|
128
|
+
*
|
|
129
|
+
* The centre label rides the path by its offset distance, so its anchor is
|
|
130
|
+
* recomputed from the connector; an end label's box is the anchor, and it is
|
|
131
|
+
* the box that follows the endpoint (see `connectorEndLabelBox`).
|
|
132
|
+
*/
|
|
133
|
+
private get _labelCenter();
|
|
15
134
|
private readonly _updateLabelRect;
|
|
16
135
|
get inlineEditor(): import("../../affine-shared/types/index.js").AffineInlineEditor | null;
|
|
17
136
|
get inlineEditorContainer(): import("../../std/inline/inline-editor.js").InlineRootElement<import("../../affine-shared/types/index.js").AffineTextAttributes> | null | undefined;
|
|
@@ -22,6 +141,8 @@ export declare class EdgelessConnectorLabelEditor extends EdgelessConnectorLabel
|
|
|
22
141
|
render(): import("lit-html").TemplateResult<1>;
|
|
23
142
|
setKeeping(keeping: boolean): void;
|
|
24
143
|
accessor connector: ConnectorElementModel;
|
|
144
|
+
/** Which of the connector's three labels is being edited. */
|
|
145
|
+
accessor which: ConnectorLabelWhich;
|
|
25
146
|
accessor std: BlockStdScope;
|
|
26
147
|
accessor richText: RichText;
|
|
27
148
|
}
|
|
@@ -34,7 +34,8 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
34
34
|
};
|
|
35
35
|
import { DefaultTool, EdgelessCRUDIdentifier, } from '../../affine-block-surface/index.js';
|
|
36
36
|
import { getLineHeight } from '../../affine-gfx-text/index.js';
|
|
37
|
-
import {
|
|
37
|
+
import { connectorEndLabelBox, } from '../../affine-model/index.js';
|
|
38
|
+
import { ThemeProvider, translateKey } from '../../affine-shared/services/index.js';
|
|
38
39
|
import { almostEqual } from '../../affine-shared/utils/index.js';
|
|
39
40
|
import { BlockSuiteError, ErrorCode } from '../../global/exceptions/index.js';
|
|
40
41
|
import { Bound, Vec } from '../../global/gfx/index.js';
|
|
@@ -47,40 +48,159 @@ import { css, html, nothing } from 'lit';
|
|
|
47
48
|
import { property, query } from 'lit/decorators.js';
|
|
48
49
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
49
50
|
import * as Y from 'yjs';
|
|
51
|
+
import { CONNECTOR_ADD_TEXT } from '../translations.js';
|
|
50
52
|
const HORIZONTAL_PADDING = 2;
|
|
51
53
|
const VERTICAL_PADDING = 2;
|
|
52
54
|
const BORDER_WIDTH = 1;
|
|
53
|
-
|
|
55
|
+
/** The box a label is seeded with, before the first character is typed. */
|
|
56
|
+
const DEFAULT_LABEL_SIZE = { w: 16, h: 16 };
|
|
57
|
+
/**
|
|
58
|
+
* The model fields each label lives in.
|
|
59
|
+
*
|
|
60
|
+
* Declared once, as data, because THREE places need the same answer — the
|
|
61
|
+
* editor's read, its resize write and its empty-commit delete — and three
|
|
62
|
+
* `which === 'center' ? … : …` chains is how one of them ends up writing the
|
|
63
|
+
* centre label's box under an end label's text.
|
|
64
|
+
*/
|
|
65
|
+
export const CONNECTOR_LABEL_FIELDS = {
|
|
66
|
+
center: { text: 'text', xywh: 'labelXYWH' },
|
|
67
|
+
source: { text: 'sourceLabel', xywh: 'sourceLabelXYWH' },
|
|
68
|
+
target: { text: 'targetLabel', xywh: 'targetLabelXYWH' },
|
|
69
|
+
};
|
|
70
|
+
/** {@link CONNECTOR_LABEL_FIELDS}, defaulting to the centre label. */
|
|
71
|
+
export function connectorLabelFields(which = 'center') {
|
|
72
|
+
return CONNECTOR_LABEL_FIELDS[which];
|
|
73
|
+
}
|
|
74
|
+
/** The `Y.Text` of `which`, or `undefined` when that label does not exist. */
|
|
75
|
+
export function connectorLabelText(connector, which = 'center') {
|
|
76
|
+
return which === 'center' ? connector.text : connector.endLabelText(which);
|
|
77
|
+
}
|
|
78
|
+
/** The box of `which`, or `undefined` when that label does not exist. */
|
|
79
|
+
export function connectorLabelXYWH(connector, which = 'center') {
|
|
80
|
+
return which === 'center'
|
|
81
|
+
? connector.labelXYWH
|
|
82
|
+
: connector.endLabelXYWH(which);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The box an end label of `size` takes on the current path — the one geometry
|
|
86
|
+
* helper the model owns, so the renderer, the editor and the hit test all place
|
|
87
|
+
* an end label in the same spot.
|
|
88
|
+
*/
|
|
89
|
+
export function connectorEndLabelBoxFor(connector, which, size = DEFAULT_LABEL_SIZE) {
|
|
90
|
+
return connectorEndLabelBox(connector.absolutePath, which, size);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* What to write so that `which` EXISTS, or `null` when it already does.
|
|
94
|
+
*
|
|
95
|
+
* The centre label is seeded where the pointer is, riding the path by an offset
|
|
96
|
+
* distance — it has always been a caption the author places. An end label is
|
|
97
|
+
* seeded at its ENDPOINT and ignores the pointer: the whole value of one is
|
|
98
|
+
* that it follows the end when the node moves (`docs/adr/0018`, "Alternatives
|
|
99
|
+
* rejected"), so where the double-click landed says nothing about where it
|
|
100
|
+
* belongs.
|
|
101
|
+
*/
|
|
102
|
+
export function connectorLabelSeedProps(connector, which = 'center', point) {
|
|
103
|
+
if (connectorLabelText(connector, which))
|
|
104
|
+
return null;
|
|
105
|
+
const fields = connectorLabelFields(which);
|
|
106
|
+
const text = new Y.Text();
|
|
107
|
+
if (which !== 'center') {
|
|
108
|
+
return {
|
|
109
|
+
[fields.text]: text,
|
|
110
|
+
[fields.xywh]: connectorEndLabelBoxFor(connector, which),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
let labelXYWH = connector.labelXYWH ?? [
|
|
114
|
+
0,
|
|
115
|
+
0,
|
|
116
|
+
DEFAULT_LABEL_SIZE.w,
|
|
117
|
+
DEFAULT_LABEL_SIZE.h,
|
|
118
|
+
];
|
|
119
|
+
const labelOffset = { ...connector.labelOffset };
|
|
120
|
+
if (point) {
|
|
121
|
+
const center = connector.getNearestPoint(point);
|
|
122
|
+
const distance = connector.getOffsetDistanceByPoint(center);
|
|
123
|
+
const bounds = Bound.fromXYWH(labelXYWH);
|
|
124
|
+
bounds.center = center;
|
|
125
|
+
labelOffset.distance = distance;
|
|
126
|
+
labelXYWH = bounds.toXYWH();
|
|
127
|
+
}
|
|
128
|
+
return { text, labelXYWH, labelOffset };
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* What to write when an editing session ENDS, or `null` when the text is
|
|
132
|
+
* already exactly what the model holds.
|
|
133
|
+
*
|
|
134
|
+
* A label committed empty clears both of its fields, so the connector reads
|
|
135
|
+
* as one that has none (`hasEndLabel` false, nothing painted, nothing
|
|
136
|
+
* exported). The KEYS stay in the Y.Map as `undefined` — the field setter
|
|
137
|
+
* writes what it is given — so only a connector that never carried an end
|
|
138
|
+
* label is byte-identical to a pre-0020 one; `docs/adr/0020`'s "no migration"
|
|
139
|
+
* promise is about that connector, not about this reset.
|
|
140
|
+
*
|
|
141
|
+
* Pure and exported: it is the one rule with three outcomes (delete, trim,
|
|
142
|
+
* nothing) times three labels, and a spec should be able to ask it directly.
|
|
143
|
+
*/
|
|
144
|
+
export function connectorLabelCommitProps(raw, which = 'center') {
|
|
145
|
+
const fields = connectorLabelFields(which);
|
|
146
|
+
const trimed = raw.trim();
|
|
147
|
+
if (trimed.length === 0) {
|
|
148
|
+
return {
|
|
149
|
+
[fields.text]: undefined,
|
|
150
|
+
[fields.xywh]: undefined,
|
|
151
|
+
// The centre label's placement along the path goes with it; an end label
|
|
152
|
+
// has no offset of its own — its place is its endpoint.
|
|
153
|
+
...(which === 'center' ? { labelOffset: undefined } : null),
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
if (trimed.length < raw.length) {
|
|
157
|
+
// @TODO: trim in Y.Text?
|
|
158
|
+
return { [fields.text]: new Y.Text(trimed) };
|
|
159
|
+
}
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* The box an END label takes after a measurement: a label that already has a
|
|
164
|
+
* box keeps its CENTRE and takes the new size — the author's or the importer's
|
|
165
|
+
* placement survives an edit — and a label that has none yet is seeded beside
|
|
166
|
+
* its endpoint by `connectorEndLabelBox`.
|
|
167
|
+
*/
|
|
168
|
+
function endLabelRect(connector, which, w, h) {
|
|
169
|
+
const current = connectorLabelXYWH(connector, which);
|
|
170
|
+
if (current) {
|
|
171
|
+
const [cx, cy] = Bound.fromXYWH(current).center;
|
|
172
|
+
return [cx - w / 2, cy - h / 2, w, h];
|
|
173
|
+
}
|
|
174
|
+
return connectorEndLabelBoxFor(connector, which, { w, h });
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Opens the label editor on ONE of a connector's three labels.
|
|
178
|
+
*
|
|
179
|
+
* This function used to exist twice — here and byte-alike in `text.ts`, which
|
|
180
|
+
* was the copy the package barrel re-exported — so the toolbar and the keyboard
|
|
181
|
+
* reached one body and the view's double-click the other. `docs/adr/0018`
|
|
182
|
+
* phase 2 makes the difference visible (a selector only one copy would have
|
|
183
|
+
* carried), so the duplicate is gone and `text.ts` re-exports this one.
|
|
184
|
+
*/
|
|
185
|
+
export function mountConnectorLabelEditor(connector, edgeless, point, options) {
|
|
54
186
|
const mountElm = edgeless.querySelector('.edgeless-mount-point');
|
|
55
187
|
if (!mountElm) {
|
|
56
188
|
throw new BlockSuiteError(ErrorCode.ValueNotExists, "edgeless block's mount point does not exist");
|
|
57
189
|
}
|
|
190
|
+
const which = options?.which ?? 'center';
|
|
58
191
|
const gfx = edgeless.std.get(GfxControllerIdentifier);
|
|
59
192
|
gfx.tool.setTool(DefaultTool);
|
|
60
193
|
gfx.selection.set({
|
|
61
194
|
elements: [connector.id],
|
|
62
195
|
editing: true,
|
|
63
196
|
});
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
let labelXYWH = connector.labelXYWH ?? [0, 0, 16, 16];
|
|
68
|
-
if (point) {
|
|
69
|
-
const center = connector.getNearestPoint(point);
|
|
70
|
-
const distance = connector.getOffsetDistanceByPoint(center);
|
|
71
|
-
const bounds = Bound.fromXYWH(labelXYWH);
|
|
72
|
-
bounds.center = center;
|
|
73
|
-
labelOffset.distance = distance;
|
|
74
|
-
labelXYWH = bounds.toXYWH();
|
|
75
|
-
}
|
|
76
|
-
edgeless.std.get(EdgelessCRUDIdentifier).updateElement(connector.id, {
|
|
77
|
-
text,
|
|
78
|
-
labelXYWH,
|
|
79
|
-
labelOffset: { ...labelOffset },
|
|
80
|
-
});
|
|
197
|
+
const seed = connectorLabelSeedProps(connector, which, point);
|
|
198
|
+
if (seed) {
|
|
199
|
+
edgeless.std.get(EdgelessCRUDIdentifier).updateElement(connector.id, seed);
|
|
81
200
|
}
|
|
82
201
|
const editor = new EdgelessConnectorLabelEditor();
|
|
83
202
|
editor.connector = connector;
|
|
203
|
+
editor.which = which;
|
|
84
204
|
mountElm.append(editor);
|
|
85
205
|
editor.updateComplete
|
|
86
206
|
.then(() => {
|
|
@@ -93,6 +213,9 @@ let EdgelessConnectorLabelEditor = (() => {
|
|
|
93
213
|
let _connector_decorators;
|
|
94
214
|
let _connector_initializers = [];
|
|
95
215
|
let _connector_extraInitializers = [];
|
|
216
|
+
let _which_decorators;
|
|
217
|
+
let _which_initializers = [];
|
|
218
|
+
let _which_extraInitializers = [];
|
|
96
219
|
let _std_decorators;
|
|
97
220
|
let _std_initializers = [];
|
|
98
221
|
let _std_extraInitializers = [];
|
|
@@ -103,11 +226,13 @@ let EdgelessConnectorLabelEditor = (() => {
|
|
|
103
226
|
static {
|
|
104
227
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
105
228
|
_connector_decorators = [property({ attribute: false })];
|
|
229
|
+
_which_decorators = [property({ attribute: false })];
|
|
106
230
|
_std_decorators = [consume({
|
|
107
231
|
context: stdContext,
|
|
108
232
|
})];
|
|
109
233
|
_richText_decorators = [query('rich-text')];
|
|
110
234
|
__esDecorate(this, null, _connector_decorators, { kind: "accessor", name: "connector", static: false, private: false, access: { has: obj => "connector" in obj, get: obj => obj.connector, set: (obj, value) => { obj.connector = value; } }, metadata: _metadata }, _connector_initializers, _connector_extraInitializers);
|
|
235
|
+
__esDecorate(this, null, _which_decorators, { kind: "accessor", name: "which", static: false, private: false, access: { has: obj => "which" in obj, get: obj => obj.which, set: (obj, value) => { obj.which = value; } }, metadata: _metadata }, _which_initializers, _which_extraInitializers);
|
|
111
236
|
__esDecorate(this, null, _std_decorators, { kind: "accessor", name: "std", static: false, private: false, access: { has: obj => "std" in obj, get: obj => obj.std, set: (obj, value) => { obj.std = value; } }, metadata: _metadata }, _std_initializers, _std_extraInitializers);
|
|
112
237
|
__esDecorate(this, null, _richText_decorators, { kind: "accessor", name: "richText", static: false, private: false, access: { has: obj => "richText" in obj, get: obj => obj.richText, set: (obj, value) => { obj.richText = value; } }, metadata: _metadata }, _richText_initializers, _richText_extraInitializers);
|
|
113
238
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
@@ -153,6 +278,30 @@ let EdgelessConnectorLabelEditor = (() => {
|
|
|
153
278
|
get selection() {
|
|
154
279
|
return this.gfx.selection;
|
|
155
280
|
}
|
|
281
|
+
/** The two model fields this editor reads and writes. */
|
|
282
|
+
get fields() {
|
|
283
|
+
return connectorLabelFields(this.which);
|
|
284
|
+
}
|
|
285
|
+
/** The `Y.Text` this editor is bound to. */
|
|
286
|
+
get yText() {
|
|
287
|
+
return connectorLabelText(this.connector, this.which);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Where the editor sits, in MODEL coordinates.
|
|
291
|
+
*
|
|
292
|
+
* The centre label rides the path by its offset distance, so its anchor is
|
|
293
|
+
* recomputed from the connector; an end label's box is the anchor, and it is
|
|
294
|
+
* the box that follows the endpoint (see `connectorEndLabelBox`).
|
|
295
|
+
*/
|
|
296
|
+
get _labelCenter() {
|
|
297
|
+
const { connector, which } = this;
|
|
298
|
+
if (which === 'center') {
|
|
299
|
+
return connector.getPointByOffsetDistance(connector.labelOffset.distance);
|
|
300
|
+
}
|
|
301
|
+
const box = connectorLabelXYWH(connector, which) ??
|
|
302
|
+
connectorEndLabelBoxFor(connector, which);
|
|
303
|
+
return Bound.fromXYWH(box).center;
|
|
304
|
+
}
|
|
156
305
|
get inlineEditor() {
|
|
157
306
|
return this.richText.inlineEditor;
|
|
158
307
|
}
|
|
@@ -169,14 +318,15 @@ let EdgelessConnectorLabelEditor = (() => {
|
|
|
169
318
|
this._resizeObserver = null;
|
|
170
319
|
}
|
|
171
320
|
firstUpdated() {
|
|
172
|
-
const { connector, selection, std } = this;
|
|
321
|
+
const { connector, selection, std, which } = this;
|
|
322
|
+
const fields = this.fields;
|
|
173
323
|
const dispatcher = std.event;
|
|
174
324
|
this._resizeObserver = new ResizeObserver(() => {
|
|
175
325
|
this._updateLabelRect();
|
|
176
326
|
this.requestUpdate();
|
|
177
327
|
});
|
|
178
328
|
this._resizeObserver.observe(this.richText);
|
|
179
|
-
this.connector.stash(
|
|
329
|
+
this.connector.stash(fields.xywh);
|
|
180
330
|
this.updateComplete
|
|
181
331
|
.then(() => {
|
|
182
332
|
if (!this.inlineEditor)
|
|
@@ -214,27 +364,19 @@ let EdgelessConnectorLabelEditor = (() => {
|
|
|
214
364
|
this.disposables.add(dispatcher.add('click', () => true));
|
|
215
365
|
this.disposables.add(dispatcher.add('doubleClick', () => true));
|
|
216
366
|
this.disposables.add(() => {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
else if (len < text.length) {
|
|
230
|
-
this.crud.updateElement(connector.id, {
|
|
231
|
-
// @TODO: trim in Y.Text?
|
|
232
|
-
text: new Y.Text(trimed),
|
|
233
|
-
});
|
|
234
|
-
}
|
|
367
|
+
const yText = connectorLabelText(connector, which);
|
|
368
|
+
if (yText) {
|
|
369
|
+
const props = connectorLabelCommitProps(yText.toString(), which);
|
|
370
|
+
if (props)
|
|
371
|
+
this.crud.updateElement(connector.id, props);
|
|
372
|
+
}
|
|
373
|
+
if (which === 'center') {
|
|
374
|
+
connector.labelEditing = false;
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
connector.endLabelEditing = null;
|
|
235
378
|
}
|
|
236
|
-
connector.
|
|
237
|
-
connector.pop('labelXYWH');
|
|
379
|
+
connector.pop(fields.xywh);
|
|
238
380
|
selection.set({
|
|
239
381
|
elements: [],
|
|
240
382
|
editing: false,
|
|
@@ -243,8 +385,13 @@ let EdgelessConnectorLabelEditor = (() => {
|
|
|
243
385
|
if (!this.inlineEditorContainer)
|
|
244
386
|
return;
|
|
245
387
|
this.disposables.addFromEvent(this.inlineEditorContainer, 'blur', () => {
|
|
246
|
-
|
|
388
|
+
// Re-entrant: Chrome fires the focused child's blur SYNCHRONOUSLY
|
|
389
|
+
// inside `remove()`, before the node is detached, and the commit
|
|
390
|
+
// in `disconnectedCallback` moves the focus again. Without the
|
|
391
|
+
// flag the handler removes a node whose removal is in progress.
|
|
392
|
+
if (this._keeping || this._removing)
|
|
247
393
|
return;
|
|
394
|
+
this._removing = true;
|
|
248
395
|
this.remove();
|
|
249
396
|
});
|
|
250
397
|
this.disposables.addFromEvent(this.inlineEditorContainer, 'compositionstart', () => {
|
|
@@ -255,7 +402,16 @@ let EdgelessConnectorLabelEditor = (() => {
|
|
|
255
402
|
this._isComposition = false;
|
|
256
403
|
this.requestUpdate();
|
|
257
404
|
});
|
|
258
|
-
|
|
405
|
+
// The canvas must not paint the label the overlay is showing, and only
|
|
406
|
+
// THAT one: `hasEndLabel` is gated on `endLabelEditing`, `hasLabel()`
|
|
407
|
+
// on `labelEditing`, so editing one end leaves the caption and the
|
|
408
|
+
// other end drawn (`ConnectorElementModel.hasEndLabel`).
|
|
409
|
+
if (which === 'center') {
|
|
410
|
+
connector.labelEditing = true;
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
connector.endLabelEditing = which;
|
|
414
|
+
}
|
|
259
415
|
})
|
|
260
416
|
.catch(console.error);
|
|
261
417
|
}
|
|
@@ -266,17 +422,18 @@ let EdgelessConnectorLabelEditor = (() => {
|
|
|
266
422
|
}
|
|
267
423
|
render() {
|
|
268
424
|
const { connector } = this;
|
|
269
|
-
const {
|
|
425
|
+
const { labelStyle: { fontFamily, fontSize, fontStyle, fontWeight, textAlign, color: labelColor, }, labelConstraints: { hasMaxWidth, maxWidth }, } = connector;
|
|
270
426
|
const lineHeight = getLineHeight(fontFamily, fontSize, fontWeight);
|
|
271
427
|
const { translateX, translateY, zoom } = this.gfx.viewport;
|
|
272
|
-
const [x, y] = Vec.mul(
|
|
428
|
+
const [x, y] = Vec.mul(this._labelCenter, zoom);
|
|
273
429
|
const transformOperation = [
|
|
274
430
|
'translate(-50%, -50%)',
|
|
275
431
|
`translate(${translateX}px, ${translateY}px)`,
|
|
276
432
|
`translate(${x}px, ${y}px)`,
|
|
277
433
|
`scale(${zoom})`,
|
|
278
434
|
];
|
|
279
|
-
const
|
|
435
|
+
const yText = this.yText;
|
|
436
|
+
const isEmpty = !yText?.length && !this._isComposition;
|
|
280
437
|
const color = this.std
|
|
281
438
|
.get(ThemeProvider)
|
|
282
439
|
.generateColorProperty(labelColor, '#000000');
|
|
@@ -298,7 +455,7 @@ let EdgelessConnectorLabelEditor = (() => {
|
|
|
298
455
|
})}
|
|
299
456
|
>
|
|
300
457
|
<rich-text
|
|
301
|
-
.yText=${
|
|
458
|
+
.yText=${yText}
|
|
302
459
|
.enableFormat=${false}
|
|
303
460
|
style=${isEmpty
|
|
304
461
|
? styleMap({
|
|
@@ -312,7 +469,7 @@ let EdgelessConnectorLabelEditor = (() => {
|
|
|
312
469
|
${isEmpty
|
|
313
470
|
? html `
|
|
314
471
|
<span class="edgeless-connector-label-editor-placeholder">
|
|
315
|
-
|
|
472
|
+
${translateKey(this.std, ...CONNECTOR_ADD_TEXT)}
|
|
316
473
|
</span>
|
|
317
474
|
`
|
|
318
475
|
: nothing}
|
|
@@ -325,6 +482,10 @@ let EdgelessConnectorLabelEditor = (() => {
|
|
|
325
482
|
#connector_accessor_storage;
|
|
326
483
|
get connector() { return this.#connector_accessor_storage; }
|
|
327
484
|
set connector(value) { this.#connector_accessor_storage = value; }
|
|
485
|
+
#which_accessor_storage;
|
|
486
|
+
/** Which of the connector's three labels is being edited. */
|
|
487
|
+
get which() { return this.#which_accessor_storage; }
|
|
488
|
+
set which(value) { this.#which_accessor_storage = value; }
|
|
328
489
|
#std_accessor_storage;
|
|
329
490
|
get std() { return this.#std_accessor_storage; }
|
|
330
491
|
set std(value) { this.#std_accessor_storage = value; }
|
|
@@ -335,27 +496,29 @@ let EdgelessConnectorLabelEditor = (() => {
|
|
|
335
496
|
super(...arguments);
|
|
336
497
|
this._isComposition = false;
|
|
337
498
|
this._keeping = false;
|
|
499
|
+
this._removing = false;
|
|
338
500
|
this._resizeObserver = null;
|
|
339
501
|
this._updateLabelRect = () => {
|
|
340
|
-
const { connector, isConnected } = this;
|
|
502
|
+
const { connector, isConnected, which } = this;
|
|
341
503
|
if (!connector || !isConnected)
|
|
342
504
|
return;
|
|
343
505
|
if (!this.inlineEditorContainer)
|
|
344
506
|
return;
|
|
345
507
|
const newWidth = this.inlineEditorContainer.scrollWidth;
|
|
346
508
|
const newHeight = this.inlineEditorContainer.scrollHeight;
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
509
|
+
const labelXYWH = which === 'center'
|
|
510
|
+
? Bound.fromCenter(connector.getPointByOffsetDistance(connector.labelOffset.distance), newWidth, newHeight).toXYWH()
|
|
511
|
+
: endLabelRect(connector, which, newWidth, newHeight);
|
|
512
|
+
const current = connectorLabelXYWH(connector, which);
|
|
513
|
+
if (!current || labelXYWH.some((p, i) => !almostEqual(p, current[i]))) {
|
|
352
514
|
this.crud.updateElement(connector.id, {
|
|
353
|
-
labelXYWH,
|
|
515
|
+
[this.fields.xywh]: labelXYWH,
|
|
354
516
|
});
|
|
355
517
|
}
|
|
356
518
|
};
|
|
357
519
|
this.#connector_accessor_storage = __runInitializers(this, _connector_initializers, void 0);
|
|
358
|
-
this.#
|
|
520
|
+
this.#which_accessor_storage = (__runInitializers(this, _connector_extraInitializers), __runInitializers(this, _which_initializers, 'center'));
|
|
521
|
+
this.#std_accessor_storage = (__runInitializers(this, _which_extraInitializers), __runInitializers(this, _std_initializers, void 0));
|
|
359
522
|
this.#richText_accessor_storage = (__runInitializers(this, _std_extraInitializers), __runInitializers(this, _richText_initializers, void 0));
|
|
360
523
|
__runInitializers(this, _richText_extraInitializers);
|
|
361
524
|
}
|