@formicoidea/labre-core 0.40.0 → 0.41.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/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/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 +2 -2
- 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-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/embed-iframe-block.js +3 -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 +12 -6
- 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-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/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/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/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.js +15 -6
- 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/translations.d.ts +61 -0
- package/dist/_pkgs/affine-block-root/translations.js +172 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +3 -1
- package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.js +1 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +31 -12
- package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +40 -8
- package/dist/_pkgs/affine-block-surface/extensions/interchange.js +27 -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.js +3 -2
- 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-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 +6 -0
- package/dist/_pkgs/affine-components/color-picker/button.js +15 -1
- 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/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 +2 -0
- package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.js +34 -5
- 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 +19 -4
- 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 +141 -0
- package/dist/_pkgs/affine-components/translations.js +478 -0
- 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/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 +4 -2
- package/dist/_pkgs/affine-gfx-brush/toolbar/configs/highlighter.js +4 -2
- 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/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/text/edgeless-connector-label-editor.js +3 -2
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.d.ts +4 -1
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +24 -10
- 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/translations.d.ts +32 -0
- package/dist/_pkgs/affine-gfx-connector/translations.js +79 -0
- 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/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 +24 -0
- package/dist/_pkgs/affine-gfx-group/translations.js +33 -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/toolbar/config.d.ts +2 -0
- package/dist/_pkgs/affine-gfx-shape/toolbar/config.js +29 -8
- 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 +15 -5
- 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/edgeless-text-editor.js +3 -2
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.d.ts +1 -1
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +22 -9
- package/dist/_pkgs/affine-gfx-text/toolbar/text-menu.js +1 -0
- package/dist/_pkgs/affine-gfx-text/translations.d.ts +31 -0
- package/dist/_pkgs/affine-gfx-text/translations.js +64 -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/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-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/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/translation-service/chrome.d.ts +362 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +955 -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-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.js +2 -2
- 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/edgeless-toolbar.js +2 -1
- 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 +31 -8
- 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-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/std/extension/translation-manifest.d.ts +7 -0
- 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/translations.js +144 -5
- package/package.json +1 -1
|
@@ -37,7 +37,7 @@ import { insertLinkByQuickSearchCommand } from '../../affine-block-bookmark/inde
|
|
|
37
37
|
import { addImages } from '../../affine-block-image/index.js';
|
|
38
38
|
import { DefaultTool } from '../../affine-block-surface/index.js';
|
|
39
39
|
import { MAX_IMAGE_WIDTH } from '../../affine-model/index.js';
|
|
40
|
-
import { TelemetryProvider } from '../../affine-shared/services/index.js';
|
|
40
|
+
import { TelemetryProvider, translateKey } from '../../affine-shared/services/index.js';
|
|
41
41
|
import { getImageFilesFromLocal, openSingleFileWith, } from '../../affine-shared/utils/index.js';
|
|
42
42
|
import { EdgelessToolbarToolMixin } from '../../affine-widget-edgeless-toolbar/index.js';
|
|
43
43
|
import { AttachmentIcon, ImageIcon, LinkIcon } from '@blocksuite/icons/lit';
|
|
@@ -47,6 +47,7 @@ import { property, state } from 'lit/decorators.js';
|
|
|
47
47
|
import { repeat } from 'lit/directives/repeat.js';
|
|
48
48
|
import { NoteTool } from '../note-tool.js';
|
|
49
49
|
import { NOTE_MENU_ITEMS } from './note-menu-config.js';
|
|
50
|
+
import { GFX_NOTE_MENU_FILE, GFX_NOTE_MENU_IMAGE, GFX_NOTE_MENU_LINK, } from '../translations.js';
|
|
50
51
|
let EdgelessNoteMenu = (() => {
|
|
51
52
|
let _classSuper = EdgelessToolbarToolMixin(LitElement);
|
|
52
53
|
let __imageLoading_decorators;
|
|
@@ -160,7 +161,7 @@ let EdgelessNoteMenu = (() => {
|
|
|
160
161
|
<div class="button-group-container">
|
|
161
162
|
<edgeless-tool-icon-button
|
|
162
163
|
.activeMode=${'background'}
|
|
163
|
-
.tooltip=${
|
|
164
|
+
.tooltip=${translateKey(this.edgeless.std, ...GFX_NOTE_MENU_IMAGE)}
|
|
164
165
|
@click=${this._addImages}
|
|
165
166
|
.disabled=${this._imageLoading}
|
|
166
167
|
>
|
|
@@ -170,7 +171,7 @@ let EdgelessNoteMenu = (() => {
|
|
|
170
171
|
<edgeless-tool-icon-button
|
|
171
172
|
.activeMode=${'background'}
|
|
172
173
|
.tooltip=${html `<affine-tooltip-content-with-shortcut
|
|
173
|
-
data-tip="${
|
|
174
|
+
data-tip="${translateKey(this.edgeless.std, ...GFX_NOTE_MENU_LINK)}"
|
|
174
175
|
data-shortcut="${'@'}"
|
|
175
176
|
></affine-tooltip-content-with-shortcut>`}
|
|
176
177
|
@click=${() => {
|
|
@@ -182,7 +183,7 @@ let EdgelessNoteMenu = (() => {
|
|
|
182
183
|
|
|
183
184
|
<edgeless-tool-icon-button
|
|
184
185
|
.activeMode=${'background'}
|
|
185
|
-
.tooltip=${
|
|
186
|
+
.tooltip=${translateKey(this.edgeless.std, ...GFX_NOTE_MENU_FILE)}
|
|
186
187
|
@click=${async () => {
|
|
187
188
|
const file = await openSingleFileWith();
|
|
188
189
|
if (!file)
|
|
@@ -208,20 +209,23 @@ let EdgelessNoteMenu = (() => {
|
|
|
208
209
|
|
|
209
210
|
<!-- add to note -->
|
|
210
211
|
<div class="button-group-container">
|
|
211
|
-
${repeat(NOTE_MENU_ITEMS, item => item.childFlavour, item =>
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
212
|
+
${repeat(NOTE_MENU_ITEMS, item => item.childFlavour, item => {
|
|
213
|
+
const tip = translateKey(this.edgeless.std, ...item.tooltipWording);
|
|
214
|
+
return html `
|
|
215
|
+
<edgeless-tool-icon-button
|
|
216
|
+
.active=${childType === item.childType}
|
|
217
|
+
.activeMode=${'background'}
|
|
218
|
+
.tooltip=${tip}
|
|
219
|
+
@click=${() => this.onChange({
|
|
220
|
+
childFlavour: item.childFlavour,
|
|
221
|
+
childType: item.childType,
|
|
222
|
+
tip,
|
|
223
|
+
})}
|
|
224
|
+
>
|
|
225
|
+
${item.icon}
|
|
226
|
+
</edgeless-tool-icon-button>
|
|
227
|
+
`;
|
|
220
228
|
})}
|
|
221
|
-
>
|
|
222
|
-
${item.icon}
|
|
223
|
-
</edgeless-tool-icon-button>
|
|
224
|
-
`)}
|
|
225
229
|
</div>
|
|
226
230
|
</div>
|
|
227
231
|
</edgeless-slide-menu>
|
|
@@ -33,13 +33,14 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
35
|
import { Heading1Icon, LinkIcon, TextIcon, } from '../../affine-components/icons/index.js';
|
|
36
|
-
import { EditPropsStore, ThemeProvider } from '../../affine-shared/services/index.js';
|
|
36
|
+
import { EditPropsStore, ThemeProvider, translateKey, } from '../../affine-shared/services/index.js';
|
|
37
37
|
import { EdgelessToolbarToolMixin } from '../../affine-widget-edgeless-toolbar/index.js';
|
|
38
38
|
import { SignalWatcher } from '../../global/lit/index.js';
|
|
39
39
|
import { computed } from '@preact/signals-core';
|
|
40
40
|
import { css, html, LitElement } from 'lit';
|
|
41
41
|
import { state } from 'lit/decorators.js';
|
|
42
42
|
import { NoteTool } from '../note-tool.js';
|
|
43
|
+
import { GFX_NOTE_TOOL_LABEL } from '../translations.js';
|
|
43
44
|
import { toShapeNotToAdapt } from './icon.js';
|
|
44
45
|
let EdgelessNoteSeniorButton = (() => {
|
|
45
46
|
let _classSuper = EdgelessToolbarToolMixin(SignalWatcher(LitElement));
|
|
@@ -205,7 +206,7 @@ let EdgelessNoteSeniorButton = (() => {
|
|
|
205
206
|
.tooltip=${this.popper
|
|
206
207
|
? ''
|
|
207
208
|
: html `<affine-tooltip-content-with-shortcut
|
|
208
|
-
data-tip="${
|
|
209
|
+
data-tip="${translateKey(this.edgeless.std, ...GFX_NOTE_TOOL_LABEL)}"
|
|
209
210
|
data-shortcut="${'N'}"
|
|
210
211
|
></affine-tooltip-content-with-shortcut>`}
|
|
211
212
|
.tooltipOffset=${5}
|
|
@@ -32,12 +32,14 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
32
32
|
}
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
|
+
import { translateKey } from '../../affine-shared/services/index.js';
|
|
35
36
|
import { createPopper, QuickToolMixin, } from '../../affine-widget-edgeless-toolbar/index.js';
|
|
36
37
|
import { PageIcon } from '@blocksuite/icons/lit';
|
|
37
38
|
import { effect } from '@preact/signals-core';
|
|
38
39
|
import { css, html, LitElement } from 'lit';
|
|
39
40
|
import { state } from 'lit/decorators.js';
|
|
40
41
|
import { NoteTool } from '../note-tool.js';
|
|
42
|
+
import { GFX_NOTE_TOOL_LABEL } from '../translations.js';
|
|
41
43
|
let EdgelessNoteToolButton = (() => {
|
|
42
44
|
let _classSuper = QuickToolMixin(LitElement);
|
|
43
45
|
let _childFlavour_decorators;
|
|
@@ -121,7 +123,7 @@ let EdgelessNoteToolButton = (() => {
|
|
|
121
123
|
.tooltip=${this._noteMenu
|
|
122
124
|
? ''
|
|
123
125
|
: html `<affine-tooltip-content-with-shortcut
|
|
124
|
-
data-tip="${
|
|
126
|
+
data-tip="${translateKey(this.edgeless.std, ...GFX_NOTE_TOOL_LABEL)}"
|
|
125
127
|
data-shortcut="${'N'}"
|
|
126
128
|
></affine-tooltip-content-with-shortcut>`}
|
|
127
129
|
.tooltipOffset=${17}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { SeniorToolExtension } from '../../affine-widget-edgeless-toolbar/index.js';
|
|
2
2
|
import { html } from 'lit';
|
|
3
|
+
import { GFX_NOTE_TOOL_LABEL } from '../translations.js';
|
|
3
4
|
export const noteSeniorTool = SeniorToolExtension('note', ({ block }) => {
|
|
4
5
|
return {
|
|
5
|
-
name:
|
|
6
|
+
name: GFX_NOTE_TOOL_LABEL[1],
|
|
7
|
+
labelKey: GFX_NOTE_TOOL_LABEL[0],
|
|
6
8
|
content: html `<edgeless-note-senior-button
|
|
7
9
|
.edgeless=${block}
|
|
8
10
|
></edgeless-note-senior-button>`,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ChromeWording, NOTE_SHADOW_BOX, NOTE_SHADOW_FILM, NOTE_SHADOW_NONE, NOTE_SHADOW_PAPER, NOTE_SHADOW_STICKER, TOOLBAR_LINK } from '../affine-shared/services/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* This package's own wordings, declared beside the code that renders them —
|
|
4
|
+
* the edgeless "add note" senior tool and its shadow/display-mode panels.
|
|
5
|
+
* Words this package shares with `blocks/note` (the shadow options, other
|
|
6
|
+
* than the typo below) live in `chrome.ts` and are re-exported here.
|
|
7
|
+
*/
|
|
8
|
+
export { NOTE_SHADOW_BOX, NOTE_SHADOW_FILM, NOTE_SHADOW_NONE, NOTE_SHADOW_PAPER, NOTE_SHADOW_STICKER, TOOLBAR_LINK as GFX_NOTE_MENU_LINK, };
|
|
9
|
+
/**
|
|
10
|
+
* `./components/note-shadow-panel.ts`'s own copy of the "floating" shadow —
|
|
11
|
+
* spelt "Floation" there, a pre-existing typo distinct from `blocks/note`'s
|
|
12
|
+
* "Floating shadow". The fallback must stay the literal on screen, so it
|
|
13
|
+
* keeps its own key rather than reusing `blocks/note`'s `NOTE_SHADOW_FLOATING`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const GFX_NOTE_SHADOW_FLOATION: ChromeWording;
|
|
16
|
+
export declare const GFX_NOTE_DISPLAY_MODE_BOTH: ChromeWording;
|
|
17
|
+
export declare const GFX_NOTE_DISPLAY_MODE_PAGE_ONLY: ChromeWording;
|
|
18
|
+
export declare const GFX_NOTE_DISPLAY_MODE_EDGELESS_ONLY: ChromeWording;
|
|
19
|
+
export declare const GFX_NOTE_MENU_IMAGE: ChromeWording;
|
|
20
|
+
export declare const GFX_NOTE_MENU_FILE: ChromeWording;
|
|
21
|
+
export declare const GFX_NOTE_TOOL_LABEL: ChromeWording;
|
|
22
|
+
/**
|
|
23
|
+
* Every wording DECLARED IN THIS FILE (not re-exported from `chrome.ts`), in
|
|
24
|
+
* declaration order — walked by `PACKAGE_WORDINGS` in
|
|
25
|
+
* `packages/affine/all/src/translations.ts`.
|
|
26
|
+
*/
|
|
27
|
+
export declare const GFX_NOTE_WORDINGS: readonly ChromeWording[];
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { IMAGE_LABEL, NOTE_SHADOW_BOX, NOTE_SHADOW_FILM, NOTE_SHADOW_NONE, NOTE_SHADOW_PAPER, NOTE_SHADOW_STICKER, TOOL_NAME_NOTE, TOOLBAR_LINK, } from '../affine-shared/services/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* This package's own wordings, declared beside the code that renders them —
|
|
4
|
+
* the edgeless "add note" senior tool and its shadow/display-mode panels.
|
|
5
|
+
* Words this package shares with `blocks/note` (the shadow options, other
|
|
6
|
+
* than the typo below) live in `chrome.ts` and are re-exported here.
|
|
7
|
+
*/
|
|
8
|
+
export { NOTE_SHADOW_BOX, NOTE_SHADOW_FILM, NOTE_SHADOW_NONE, NOTE_SHADOW_PAPER, NOTE_SHADOW_STICKER, TOOLBAR_LINK as GFX_NOTE_MENU_LINK, };
|
|
9
|
+
/**
|
|
10
|
+
* `./components/note-shadow-panel.ts`'s own copy of the "floating" shadow —
|
|
11
|
+
* spelt "Floation" there, a pre-existing typo distinct from `blocks/note`'s
|
|
12
|
+
* "Floating shadow". The fallback must stay the literal on screen, so it
|
|
13
|
+
* keeps its own key rather than reusing `blocks/note`'s `NOTE_SHADOW_FLOATING`.
|
|
14
|
+
*/
|
|
15
|
+
export const GFX_NOTE_SHADOW_FLOATION = [
|
|
16
|
+
'com.labre.note.shadow.floation',
|
|
17
|
+
'Floation shadow',
|
|
18
|
+
];
|
|
19
|
+
/* ── `./components/note-display-mode-panel.ts` ────────────────────────────
|
|
20
|
+
* A different wording from `blocks/note`'s own display-mode dropdown (which
|
|
21
|
+
* says "Both" / "Edgeless" / "Page"): this panel's labels read "In Both" /
|
|
22
|
+
* "In Document Only" / "In Canvas Only", so they get their own keys.
|
|
23
|
+
*/
|
|
24
|
+
export const GFX_NOTE_DISPLAY_MODE_BOTH = [
|
|
25
|
+
'com.labre.gfx-note.display-mode.in-both',
|
|
26
|
+
'In Both',
|
|
27
|
+
];
|
|
28
|
+
export const GFX_NOTE_DISPLAY_MODE_PAGE_ONLY = [
|
|
29
|
+
'com.labre.gfx-note.display-mode.in-page-only',
|
|
30
|
+
'In Document Only',
|
|
31
|
+
];
|
|
32
|
+
export const GFX_NOTE_DISPLAY_MODE_EDGELESS_ONLY = [
|
|
33
|
+
'com.labre.gfx-note.display-mode.in-edgeless-only',
|
|
34
|
+
'In Canvas Only',
|
|
35
|
+
];
|
|
36
|
+
/* ── `./toolbar/note-menu.ts` — the "add to note" quick-tool row ────────── */
|
|
37
|
+
export const GFX_NOTE_MENU_IMAGE = IMAGE_LABEL;
|
|
38
|
+
export const GFX_NOTE_MENU_FILE = [
|
|
39
|
+
'com.labre.gfx-note.menu.file',
|
|
40
|
+
'File',
|
|
41
|
+
];
|
|
42
|
+
/* ── The note senior tool's own name ───────────────────────────────────────
|
|
43
|
+
* Said in three places (the senior-tool row's tooltip via `labelKey`, the
|
|
44
|
+
* senior button's own shortcut tooltip, and the quick-tool button's shortcut
|
|
45
|
+
* tooltip) — one wording for all three.
|
|
46
|
+
*/
|
|
47
|
+
export const GFX_NOTE_TOOL_LABEL = TOOL_NAME_NOTE;
|
|
48
|
+
/**
|
|
49
|
+
* Every wording DECLARED IN THIS FILE (not re-exported from `chrome.ts`), in
|
|
50
|
+
* declaration order — walked by `PACKAGE_WORDINGS` in
|
|
51
|
+
* `packages/affine/all/src/translations.ts`.
|
|
52
|
+
*/
|
|
53
|
+
export const GFX_NOTE_WORDINGS = [
|
|
54
|
+
GFX_NOTE_SHADOW_FLOATION,
|
|
55
|
+
GFX_NOTE_DISPLAY_MODE_BOTH,
|
|
56
|
+
GFX_NOTE_DISPLAY_MODE_PAGE_ONLY,
|
|
57
|
+
GFX_NOTE_DISPLAY_MODE_EDGELESS_ONLY,
|
|
58
|
+
GFX_NOTE_MENU_FILE,
|
|
59
|
+
];
|
|
@@ -33,12 +33,14 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
35
|
import { DefaultTool } from '../../affine-block-surface/index.js';
|
|
36
|
+
import { translateKey } from '../../affine-shared/services/index.js';
|
|
36
37
|
import { QuickToolMixin } from '../../affine-widget-edgeless-toolbar/index.js';
|
|
37
38
|
import { HandIcon, SelectIcon } from '@blocksuite/icons/lit';
|
|
38
39
|
import { effect } from '@preact/signals-core';
|
|
39
40
|
import { css, html, LitElement } from 'lit';
|
|
40
41
|
import { query } from 'lit/decorators.js';
|
|
41
42
|
import { PanTool } from '../tools/index.js';
|
|
43
|
+
import { POINTER_TOOLTIP_HAND, POINTER_TOOLTIP_SELECT } from '../translations.js';
|
|
42
44
|
let EdgelessDefaultToolButton = (() => {
|
|
43
45
|
let _classSuper = QuickToolMixin(LitElement);
|
|
44
46
|
let _currentIcon_decorators;
|
|
@@ -112,8 +114,14 @@ let EdgelessDefaultToolButton = (() => {
|
|
|
112
114
|
const type = this.edgelessTool?.toolType?.toolName;
|
|
113
115
|
const { active } = this;
|
|
114
116
|
const tipInfo = type === 'pan'
|
|
115
|
-
? {
|
|
116
|
-
|
|
117
|
+
? {
|
|
118
|
+
tip: translateKey(this.edgeless.std, ...POINTER_TOOLTIP_HAND),
|
|
119
|
+
shortcut: 'H',
|
|
120
|
+
}
|
|
121
|
+
: {
|
|
122
|
+
tip: translateKey(this.edgeless.std, ...POINTER_TOOLTIP_SELECT),
|
|
123
|
+
shortcut: 'V',
|
|
124
|
+
};
|
|
117
125
|
return html `
|
|
118
126
|
<edgeless-tool-icon-button
|
|
119
127
|
class="edgeless-default-button ${type}"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChromeWording } from '../affine-shared/services/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* This package's own wordings, joined into `PACKAGE_WORDINGS` in
|
|
4
|
+
* `@labre/affine/translations` — see that file and
|
|
5
|
+
* `packages/affine/shared/src/services/translation-service/README.md`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const POINTER_TOOLTIP_HAND: ChromeWording;
|
|
8
|
+
export declare const POINTER_TOOLTIP_SELECT: ChromeWording;
|
|
9
|
+
export declare const POINTER_WORDINGS: readonly ChromeWording[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This package's own wordings, joined into `PACKAGE_WORDINGS` in
|
|
3
|
+
* `@labre/affine/translations` — see that file and
|
|
4
|
+
* `packages/affine/shared/src/services/translation-service/README.md`.
|
|
5
|
+
*/
|
|
6
|
+
export const POINTER_TOOLTIP_HAND = [
|
|
7
|
+
'com.labre.pointer.tooltip.hand',
|
|
8
|
+
'Hand',
|
|
9
|
+
];
|
|
10
|
+
export const POINTER_TOOLTIP_SELECT = [
|
|
11
|
+
'com.labre.pointer.tooltip.select',
|
|
12
|
+
'Select',
|
|
13
|
+
];
|
|
14
|
+
export const POINTER_WORDINGS = [
|
|
15
|
+
POINTER_TOOLTIP_HAND,
|
|
16
|
+
POINTER_TOOLTIP_SELECT,
|
|
17
|
+
];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ShapeStyle } from '../../affine-model/index.js';
|
|
2
|
+
import type { BlockStdScope } from '../../std/index.js';
|
|
2
3
|
import { LitElement } from 'lit';
|
|
3
4
|
import { Subject } from 'rxjs';
|
|
4
5
|
import type { ShapeTool } from '../shape-tool.js';
|
|
@@ -10,6 +11,9 @@ export declare class EdgelessShapePanel extends LitElement {
|
|
|
10
11
|
private _onSelect;
|
|
11
12
|
disconnectedCallback(): void;
|
|
12
13
|
render(): unknown;
|
|
14
|
+
/** Set by a caller that has one — optional so this panel still renders (in
|
|
15
|
+
* English) when created with none, as it is today. */
|
|
16
|
+
accessor std: BlockStdScope | undefined;
|
|
13
17
|
accessor selectedShape: ShapeTool['activatedOption']['shapeName'] | null | undefined;
|
|
14
18
|
accessor shapeStyle: ShapeStyle;
|
|
15
19
|
}
|
|
@@ -33,6 +33,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
35
|
import { ShapeStyle } from '../../affine-model/index.js';
|
|
36
|
+
import { translateKey } from '../../affine-shared/services/index.js';
|
|
36
37
|
import { css, html, LitElement } from 'lit';
|
|
37
38
|
import { property } from 'lit/decorators.js';
|
|
38
39
|
import { repeat } from 'lit/directives/repeat.js';
|
|
@@ -40,6 +41,9 @@ import { Subject } from 'rxjs';
|
|
|
40
41
|
import { ShapeComponentConfig } from '../toolbar/shape-menu-config.js';
|
|
41
42
|
let EdgelessShapePanel = (() => {
|
|
42
43
|
let _classSuper = LitElement;
|
|
44
|
+
let _std_decorators;
|
|
45
|
+
let _std_initializers = [];
|
|
46
|
+
let _std_extraInitializers = [];
|
|
43
47
|
let _selectedShape_decorators;
|
|
44
48
|
let _selectedShape_initializers = [];
|
|
45
49
|
let _selectedShape_extraInitializers = [];
|
|
@@ -49,8 +53,10 @@ let EdgelessShapePanel = (() => {
|
|
|
49
53
|
return class EdgelessShapePanel extends _classSuper {
|
|
50
54
|
static {
|
|
51
55
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
56
|
+
_std_decorators = [property({ attribute: false })];
|
|
52
57
|
_selectedShape_decorators = [property({ attribute: false })];
|
|
53
58
|
_shapeStyle_decorators = [property({ attribute: false })];
|
|
59
|
+
__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);
|
|
54
60
|
__esDecorate(this, null, _selectedShape_decorators, { kind: "accessor", name: "selectedShape", static: false, private: false, access: { has: obj => "selectedShape" in obj, get: obj => obj.selectedShape, set: (obj, value) => { obj.selectedShape = value; } }, metadata: _metadata }, _selectedShape_initializers, _selectedShape_extraInitializers);
|
|
55
61
|
__esDecorate(this, null, _shapeStyle_decorators, { kind: "accessor", name: "shapeStyle", static: false, private: false, access: { has: obj => "shapeStyle" in obj, get: obj => obj.shapeStyle, set: (obj, value) => { obj.shapeStyle = value; } }, metadata: _metadata }, _shapeStyle_initializers, _shapeStyle_extraInitializers);
|
|
56
62
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
@@ -72,9 +78,11 @@ let EdgelessShapePanel = (() => {
|
|
|
72
78
|
super.disconnectedCallback();
|
|
73
79
|
}
|
|
74
80
|
render() {
|
|
75
|
-
return repeat(ShapeComponentConfig, item => item.name, ({ name, generalIcon, scribbledIcon, tooltip, disabled }) => html `<edgeless-tool-icon-button
|
|
81
|
+
return repeat(ShapeComponentConfig, item => item.name, ({ name, generalIcon, scribbledIcon, tooltip, tooltipWording, disabled, }) => html `<edgeless-tool-icon-button
|
|
76
82
|
.disabled=${disabled}
|
|
77
|
-
.tooltip=${
|
|
83
|
+
.tooltip=${this.std
|
|
84
|
+
? translateKey(this.std, ...tooltipWording)
|
|
85
|
+
: tooltip}
|
|
78
86
|
.active=${this.selectedShape === name}
|
|
79
87
|
.activeMode=${'background'}
|
|
80
88
|
.iconSize=${'20px'}
|
|
@@ -89,6 +97,11 @@ let EdgelessShapePanel = (() => {
|
|
|
89
97
|
: scribbledIcon}
|
|
90
98
|
</edgeless-tool-icon-button>`);
|
|
91
99
|
}
|
|
100
|
+
#std_accessor_storage;
|
|
101
|
+
/** Set by a caller that has one — optional so this panel still renders (in
|
|
102
|
+
* English) when created with none, as it is today. */
|
|
103
|
+
get std() { return this.#std_accessor_storage; }
|
|
104
|
+
set std(value) { this.#std_accessor_storage = value; }
|
|
92
105
|
#selectedShape_accessor_storage;
|
|
93
106
|
get selectedShape() { return this.#selectedShape_accessor_storage; }
|
|
94
107
|
set selectedShape(value) { this.#selectedShape_accessor_storage = value; }
|
|
@@ -100,7 +113,8 @@ let EdgelessShapePanel = (() => {
|
|
|
100
113
|
this.slots = {
|
|
101
114
|
select: new Subject(),
|
|
102
115
|
};
|
|
103
|
-
this.#
|
|
116
|
+
this.#std_accessor_storage = __runInitializers(this, _std_initializers, undefined);
|
|
117
|
+
this.#selectedShape_accessor_storage = (__runInitializers(this, _std_extraInitializers), __runInitializers(this, _selectedShape_initializers, undefined));
|
|
104
118
|
this.#shapeStyle_accessor_storage = (__runInitializers(this, _selectedShape_extraInitializers), __runInitializers(this, _shapeStyle_initializers, ShapeStyle.Scribbled));
|
|
105
119
|
__runInitializers(this, _shapeStyle_extraInitializers);
|
|
106
120
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ShapeStyle } from '../../affine-model/index.js';
|
|
2
|
+
import type { BlockStdScope } from '../../std/index.js';
|
|
2
3
|
import { LitElement } from 'lit';
|
|
3
4
|
export declare class EdgelessShapeStylePanel extends LitElement {
|
|
4
5
|
static styles: import("lit").CSSResult;
|
|
@@ -6,4 +7,7 @@ export declare class EdgelessShapeStylePanel extends LitElement {
|
|
|
6
7
|
render(): unknown;
|
|
7
8
|
accessor onSelect: undefined | ((value: ShapeStyle) => void);
|
|
8
9
|
accessor value: ShapeStyle;
|
|
10
|
+
/** Set by a caller that has one — optional so this panel still renders (in
|
|
11
|
+
* English) when created with none, as it is today. */
|
|
12
|
+
accessor std: BlockStdScope | undefined;
|
|
9
13
|
}
|
|
@@ -33,6 +33,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
35
|
import { ShapeStyle } from '../../affine-model/index.js';
|
|
36
|
+
import { STYLE_GENERAL, STYLE_SCRIBBLED, translateKey, } from '../../affine-shared/services/index.js';
|
|
36
37
|
import { StyleGeneralIcon, StyleScribbleIcon } from '@blocksuite/icons/lit';
|
|
37
38
|
import { css, html, LitElement } from 'lit';
|
|
38
39
|
import { property } from 'lit/decorators.js';
|
|
@@ -41,10 +42,12 @@ const SHAPE_STYLE_LIST = [
|
|
|
41
42
|
{
|
|
42
43
|
value: ShapeStyle.General,
|
|
43
44
|
icon: StyleGeneralIcon(),
|
|
45
|
+
wording: STYLE_GENERAL,
|
|
44
46
|
},
|
|
45
47
|
{
|
|
46
48
|
value: ShapeStyle.Scribbled,
|
|
47
49
|
icon: StyleScribbleIcon(),
|
|
50
|
+
wording: STYLE_SCRIBBLED,
|
|
48
51
|
},
|
|
49
52
|
];
|
|
50
53
|
let EdgelessShapeStylePanel = (() => {
|
|
@@ -55,13 +58,18 @@ let EdgelessShapeStylePanel = (() => {
|
|
|
55
58
|
let _value_decorators;
|
|
56
59
|
let _value_initializers = [];
|
|
57
60
|
let _value_extraInitializers = [];
|
|
61
|
+
let _std_decorators;
|
|
62
|
+
let _std_initializers = [];
|
|
63
|
+
let _std_extraInitializers = [];
|
|
58
64
|
return class EdgelessShapeStylePanel extends _classSuper {
|
|
59
65
|
static {
|
|
60
66
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
61
67
|
_onSelect_decorators = [property({ attribute: false })];
|
|
62
68
|
_value_decorators = [property({ attribute: false })];
|
|
69
|
+
_std_decorators = [property({ attribute: false })];
|
|
63
70
|
__esDecorate(this, null, _onSelect_decorators, { kind: "accessor", name: "onSelect", static: false, private: false, access: { has: obj => "onSelect" in obj, get: obj => obj.onSelect, set: (obj, value) => { obj.onSelect = value; } }, metadata: _metadata }, _onSelect_initializers, _onSelect_extraInitializers);
|
|
64
71
|
__esDecorate(this, null, _value_decorators, { kind: "accessor", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
72
|
+
__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);
|
|
65
73
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
66
74
|
}
|
|
67
75
|
static { this.styles = css `
|
|
@@ -79,17 +87,22 @@ let EdgelessShapeStylePanel = (() => {
|
|
|
79
87
|
}
|
|
80
88
|
}
|
|
81
89
|
render() {
|
|
82
|
-
return repeat(SHAPE_STYLE_LIST, item => item.value, ({ value, icon }) =>
|
|
90
|
+
return repeat(SHAPE_STYLE_LIST, item => item.value, ({ value, icon, wording }) => {
|
|
91
|
+
const label = this.std
|
|
92
|
+
? translateKey(this.std, ...wording)
|
|
93
|
+
: wording[1];
|
|
94
|
+
return html `<edgeless-tool-icon-button
|
|
83
95
|
.tipPosition=${'top'}
|
|
84
96
|
.activeMode=${'background'}
|
|
85
|
-
aria-label=${
|
|
86
|
-
.tooltip=${
|
|
97
|
+
aria-label=${label}
|
|
98
|
+
.tooltip=${label}
|
|
87
99
|
.active=${this.value === value}
|
|
88
100
|
.iconSize=${'20px'}
|
|
89
101
|
@click=${() => this._onSelect(value)}
|
|
90
102
|
>
|
|
91
103
|
${icon}
|
|
92
|
-
</edgeless-tool-icon-button
|
|
104
|
+
</edgeless-tool-icon-button>`;
|
|
105
|
+
});
|
|
93
106
|
}
|
|
94
107
|
#onSelect_accessor_storage = __runInitializers(this, _onSelect_initializers, undefined);
|
|
95
108
|
get onSelect() { return this.#onSelect_accessor_storage; }
|
|
@@ -97,9 +110,14 @@ let EdgelessShapeStylePanel = (() => {
|
|
|
97
110
|
#value_accessor_storage = (__runInitializers(this, _onSelect_extraInitializers), __runInitializers(this, _value_initializers, void 0));
|
|
98
111
|
get value() { return this.#value_accessor_storage; }
|
|
99
112
|
set value(value) { this.#value_accessor_storage = value; }
|
|
113
|
+
#std_accessor_storage = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _std_initializers, undefined));
|
|
114
|
+
/** Set by a caller that has one — optional so this panel still renders (in
|
|
115
|
+
* English) when created with none, as it is today. */
|
|
116
|
+
get std() { return this.#std_accessor_storage; }
|
|
117
|
+
set std(value) { this.#std_accessor_storage = value; }
|
|
100
118
|
constructor() {
|
|
101
119
|
super(...arguments);
|
|
102
|
-
__runInitializers(this,
|
|
120
|
+
__runInitializers(this, _std_extraInitializers);
|
|
103
121
|
}
|
|
104
122
|
};
|
|
105
123
|
})();
|
|
@@ -8,7 +8,6 @@ export declare class EdgelessShapeMenu extends EdgelessShapeMenu_base {
|
|
|
8
8
|
accessor edgeless: BlockComponent;
|
|
9
9
|
private readonly _props$;
|
|
10
10
|
private readonly _setFillColor;
|
|
11
|
-
private readonly _setShapeStyle;
|
|
12
11
|
private readonly _theme$;
|
|
13
12
|
connectedCallback(): void;
|
|
14
13
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -34,13 +34,12 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
34
34
|
};
|
|
35
35
|
import { DefaultTheme, isTransparent, ShapeStyle, ShapeType, } from '../../affine-model/index.js';
|
|
36
36
|
import { EditPropsStore, FeatureFlagService, ThemeProvider, } from '../../affine-shared/services/index.js';
|
|
37
|
+
import { translateKey } from '../../affine-shared/services/index.js';
|
|
37
38
|
import { SignalWatcher, WithDisposable } from '../../global/lit/index.js';
|
|
38
|
-
import { StyleGeneralIcon, StyleScribbleIcon } from '@blocksuite/icons/lit';
|
|
39
39
|
import { GfxControllerIdentifier, } from '../../std/gfx/index.js';
|
|
40
40
|
import { computed, effect, signal } from '@preact/signals-core';
|
|
41
41
|
import { css, html, LitElement } from 'lit';
|
|
42
42
|
import { property } from 'lit/decorators.js';
|
|
43
|
-
import { when } from 'lit/directives/when.js';
|
|
44
43
|
import { PolygonTool } from '../polygon-tool.js';
|
|
45
44
|
import { ShapeTool } from '../shape-tool.js';
|
|
46
45
|
import { ShapeComponentConfig } from '../toolbar/index.js';
|
|
@@ -70,15 +69,13 @@ let EdgelessShapeMenu = (() => {
|
|
|
70
69
|
display: flex;
|
|
71
70
|
align-items: center;
|
|
72
71
|
}
|
|
73
|
-
.shape-type-container
|
|
74
|
-
.shape-style-container {
|
|
72
|
+
.shape-type-container {
|
|
75
73
|
display: flex;
|
|
76
74
|
align-items: center;
|
|
77
75
|
justify-content: center;
|
|
78
76
|
gap: 14px;
|
|
79
77
|
}
|
|
80
|
-
.shape-type-container svg
|
|
81
|
-
.shape-style-container svg {
|
|
78
|
+
.shape-type-container svg {
|
|
82
79
|
fill: var(--affine-icon-color);
|
|
83
80
|
stroke: none;
|
|
84
81
|
}
|
|
@@ -112,40 +109,11 @@ let EdgelessShapeMenu = (() => {
|
|
|
112
109
|
return html `
|
|
113
110
|
<edgeless-slide-menu>
|
|
114
111
|
<div class="menu-content">
|
|
115
|
-
${
|
|
116
|
-
// TODO(@fundon): add a flag
|
|
117
|
-
when(false, () => html `
|
|
118
|
-
<div class="shape-style-container">
|
|
119
|
-
<edgeless-tool-icon-button
|
|
120
|
-
.tooltip=${'General'}
|
|
121
|
-
.active=${shapeStyle === ShapeStyle.General}
|
|
122
|
-
.activeMode=${'background'}
|
|
123
|
-
.iconSize=${'20px'}
|
|
124
|
-
@click=${() => {
|
|
125
|
-
this._setShapeStyle(ShapeStyle.General);
|
|
126
|
-
}}
|
|
127
|
-
>
|
|
128
|
-
${StyleGeneralIcon()}
|
|
129
|
-
</edgeless-tool-icon-button>
|
|
130
|
-
<edgeless-tool-icon-button
|
|
131
|
-
.tooltip=${'Scribbled'}
|
|
132
|
-
.active=${shapeStyle === ShapeStyle.Scribbled}
|
|
133
|
-
.activeMode=${'background'}
|
|
134
|
-
.iconSize=${'20px'}
|
|
135
|
-
@click=${() => {
|
|
136
|
-
this._setShapeStyle(ShapeStyle.Scribbled);
|
|
137
|
-
}}
|
|
138
|
-
>
|
|
139
|
-
${StyleScribbleIcon()}
|
|
140
|
-
</edgeless-tool-icon-button>
|
|
141
|
-
</div>
|
|
142
|
-
<menu-divider .vertical=${true}></menu-divider>
|
|
143
|
-
`)}
|
|
144
112
|
<div class="shape-type-container">
|
|
145
|
-
${ShapeComponentConfig.map(({ name, generalIcon, scribbledIcon,
|
|
113
|
+
${ShapeComponentConfig.map(({ name, generalIcon, scribbledIcon, tooltipWording }) => {
|
|
146
114
|
return html `
|
|
147
115
|
<edgeless-tool-icon-button
|
|
148
|
-
.tooltip=${
|
|
116
|
+
.tooltip=${translateKey(this.edgeless.std, ...tooltipWording)}
|
|
149
117
|
.active=${shapeName === name}
|
|
150
118
|
.activeMode=${'background'}
|
|
151
119
|
.iconSize=${'20px'}
|
|
@@ -167,6 +135,7 @@ let EdgelessShapeMenu = (() => {
|
|
|
167
135
|
.hasTransparent=${!this.edgeless.store
|
|
168
136
|
.get(FeatureFlagService)
|
|
169
137
|
.getFlag('enable_color_picker')}
|
|
138
|
+
.std=${this.edgeless.std}
|
|
170
139
|
@select=${(e) => this._setFillColor(e.detail)}
|
|
171
140
|
></edgeless-color-panel>
|
|
172
141
|
</div>
|
|
@@ -207,15 +176,6 @@ let EdgelessShapeMenu = (() => {
|
|
|
207
176
|
});
|
|
208
177
|
this.onChange(shapeName);
|
|
209
178
|
};
|
|
210
|
-
this._setShapeStyle = (shapeStyle) => {
|
|
211
|
-
const { shapeName } = this._props$.value;
|
|
212
|
-
this.edgeless.std
|
|
213
|
-
.get(EditPropsStore)
|
|
214
|
-
.recordLastProps(`shape:${shapeName}`, {
|
|
215
|
-
shapeStyle,
|
|
216
|
-
});
|
|
217
|
-
this.onChange(shapeName);
|
|
218
|
-
};
|
|
219
179
|
this._theme$ = computed(() => {
|
|
220
180
|
return this.edgeless.std.get(ThemeProvider).theme$.value;
|
|
221
181
|
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ShapeType } from '../../affine-model/index.js';
|
|
2
|
+
import { translateKey } from '../../affine-shared/services/index.js';
|
|
2
3
|
import { EdgelessToolbarToolMixin } from '../../affine-widget-edgeless-toolbar/index.js';
|
|
3
4
|
import { SignalWatcher } from '../../global/lit/index.js';
|
|
4
5
|
import { css, html, LitElement } from 'lit';
|
|
6
|
+
import { SHAPE_TOOL_NAME } from '../translations.js';
|
|
5
7
|
import { PolygonTool } from '../polygon-tool.js';
|
|
6
8
|
import { ShapeTool } from '../shape-tool.js';
|
|
7
9
|
export class EdgelessShapeToolButton extends EdgelessToolbarToolMixin(SignalWatcher(LitElement)) {
|
|
@@ -74,7 +76,7 @@ export class EdgelessShapeToolButton extends EdgelessToolbarToolMixin(SignalWatc
|
|
|
74
76
|
.tooltip=${this.popper
|
|
75
77
|
? ''
|
|
76
78
|
: html `<affine-tooltip-content-with-shortcut
|
|
77
|
-
data-tip="${
|
|
79
|
+
data-tip="${translateKey(this.edgeless.std, ...SHAPE_TOOL_NAME)}"
|
|
78
80
|
data-shortcut="${'S'}"
|
|
79
81
|
></affine-tooltip-content-with-shortcut>`}
|
|
80
82
|
.tooltipOffset=${5}
|
|
@@ -16,12 +16,14 @@ export declare const shapeToolbarConfig: {
|
|
|
16
16
|
}, {
|
|
17
17
|
readonly id: "f.text";
|
|
18
18
|
readonly tooltip: "Add text";
|
|
19
|
+
readonly tooltipWording: import("../../affine-shared/services/index.js").ChromeWording;
|
|
19
20
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
20
21
|
readonly when: (ctx: import("../../affine-shared/services/index.js").ToolbarContext) => boolean;
|
|
21
22
|
readonly run: (ctx: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|
|
22
23
|
}, {
|
|
23
24
|
readonly id: "f1.edit-vertices";
|
|
24
25
|
readonly tooltip: "Edit vertices";
|
|
26
|
+
readonly tooltipWording: import("../../affine-shared/services/index.js").ChromeWording;
|
|
25
27
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
26
28
|
readonly when: (ctx: import("../../affine-shared/services/index.js").ToolbarContext) => boolean;
|
|
27
29
|
readonly run: (ctx: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|