@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
|
@@ -35,12 +35,14 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
35
35
|
import { selectBlock } from '../affine-block-note/index.js';
|
|
36
36
|
import { CaptionedBlockComponent } from '../affine-components/caption/index.js';
|
|
37
37
|
import { createLitPortal } from '../affine-components/portal/index.js';
|
|
38
|
+
import { translateKey } from '../affine-shared/services/index.js';
|
|
38
39
|
import { BlockSelection } from '../std/index.js';
|
|
39
40
|
import { effect } from '@preact/signals-core';
|
|
40
41
|
import katex from 'katex';
|
|
41
42
|
import { html, render } from 'lit';
|
|
42
43
|
import { query } from 'lit/decorators.js';
|
|
43
44
|
import { latexBlockStyles } from './styles.js';
|
|
45
|
+
import { LATEX_EMPTY_PLACEHOLDER, LATEX_ERROR_PLACEHOLDER, } from './translations.js';
|
|
44
46
|
let LatexBlockComponent = (() => {
|
|
45
47
|
let _classSuper = CaptionedBlockComponent;
|
|
46
48
|
let __katexContainer_decorators;
|
|
@@ -78,7 +80,9 @@ let LatexBlockComponent = (() => {
|
|
|
78
80
|
// @ts-expect-error lit hack won't fix
|
|
79
81
|
delete katexContainer['_$litPart$'];
|
|
80
82
|
if (latex.length === 0) {
|
|
81
|
-
render(html `<span class="latex-block-empty-placeholder"
|
|
83
|
+
render(html `<span class="latex-block-empty-placeholder"
|
|
84
|
+
>${translateKey(this.std, ...LATEX_EMPTY_PLACEHOLDER)}</span
|
|
85
|
+
>`, katexContainer);
|
|
82
86
|
}
|
|
83
87
|
else {
|
|
84
88
|
try {
|
|
@@ -91,7 +95,7 @@ let LatexBlockComponent = (() => {
|
|
|
91
95
|
// @ts-expect-error lit hack won't fix
|
|
92
96
|
delete katexContainer['_$litPart$'];
|
|
93
97
|
render(html `<span class="latex-block-error-placeholder"
|
|
94
|
-
|
|
98
|
+
>${translateKey(this.std, ...LATEX_ERROR_PLACEHOLDER)}</span
|
|
95
99
|
>`, katexContainer);
|
|
96
100
|
}
|
|
97
101
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ChromeWording } from '../affine-shared/services/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* This package's own wordings, declared beside the code that renders them —
|
|
4
|
+
* the slash-menu's two equation items and the katex placeholder/error labels.
|
|
5
|
+
*/
|
|
6
|
+
export declare const LATEX_SLASH_INLINE_NAME: ChromeWording;
|
|
7
|
+
export declare const LATEX_SLASH_INLINE_DESCRIPTION: ChromeWording;
|
|
8
|
+
/**
|
|
9
|
+
* The inline item's tooltip caption says the exact same word as its name —
|
|
10
|
+
* reused rather than declared twice.
|
|
11
|
+
*/
|
|
12
|
+
export declare const LATEX_SLASH_INLINE_CAPTION: ChromeWording;
|
|
13
|
+
export declare const LATEX_SLASH_BLOCK_NAME: ChromeWording;
|
|
14
|
+
export declare const LATEX_SLASH_BLOCK_DESCRIPTION: ChromeWording;
|
|
15
|
+
/** The block item's tooltip caption says the same word as its name too. */
|
|
16
|
+
export declare const LATEX_SLASH_BLOCK_CAPTION: ChromeWording;
|
|
17
|
+
export declare const LATEX_TOOLTIP_INTRO: ChromeWording;
|
|
18
|
+
export declare const LATEX_TOOLTIP_BLOCK_INTRO: ChromeWording;
|
|
19
|
+
/**
|
|
20
|
+
* `./latex-block.ts`'s own placeholders: the empty block, and a block whose
|
|
21
|
+
* LaTeX source failed to render. `LATEX_EMPTY_PLACEHOLDER`'s fallback is the
|
|
22
|
+
* SAME word as the slash-menu item's own name (`LATEX_SLASH_BLOCK_NAME`), but
|
|
23
|
+
* it is a different surface (rendered inside the katex container, not the
|
|
24
|
+
* slash menu), so it keeps its own key rather than aliasing.
|
|
25
|
+
*/
|
|
26
|
+
export declare const LATEX_EMPTY_PLACEHOLDER: ChromeWording;
|
|
27
|
+
export declare const LATEX_ERROR_PLACEHOLDER: ChromeWording;
|
|
28
|
+
/**
|
|
29
|
+
* Every wording declared above, in declaration order — walked by
|
|
30
|
+
* `PACKAGE_WORDINGS` in `packages/affine/all/src/translations.ts`. The two
|
|
31
|
+
* caption aliases (`LATEX_SLASH_INLINE_CAPTION` / `_BLOCK_CAPTION`) are not
|
|
32
|
+
* listed again, same rule the note/slash-menu packages' own chrome aliases
|
|
33
|
+
* already follow.
|
|
34
|
+
*/
|
|
35
|
+
export declare const LATEX_WORDINGS: readonly ChromeWording[];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { EQUATION_EMPTY_LABEL, EQUATION_ERROR_LABEL, } from '../affine-shared/services/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* This package's own wordings, declared beside the code that renders them —
|
|
4
|
+
* the slash-menu's two equation items and the katex placeholder/error labels.
|
|
5
|
+
*/
|
|
6
|
+
export const LATEX_SLASH_INLINE_NAME = [
|
|
7
|
+
'com.labre.latex.slash-menu.inline.name',
|
|
8
|
+
'Inline equation',
|
|
9
|
+
];
|
|
10
|
+
export const LATEX_SLASH_INLINE_DESCRIPTION = [
|
|
11
|
+
'com.labre.latex.slash-menu.inline.description',
|
|
12
|
+
'Create a inline equation.',
|
|
13
|
+
];
|
|
14
|
+
/**
|
|
15
|
+
* The inline item's tooltip caption says the exact same word as its name —
|
|
16
|
+
* reused rather than declared twice.
|
|
17
|
+
*/
|
|
18
|
+
export const LATEX_SLASH_INLINE_CAPTION = LATEX_SLASH_INLINE_NAME;
|
|
19
|
+
export const LATEX_SLASH_BLOCK_NAME = [
|
|
20
|
+
'com.labre.latex.slash-menu.block.name',
|
|
21
|
+
'Equation',
|
|
22
|
+
];
|
|
23
|
+
export const LATEX_SLASH_BLOCK_DESCRIPTION = [
|
|
24
|
+
'com.labre.latex.slash-menu.block.description',
|
|
25
|
+
'Create a equation block.',
|
|
26
|
+
];
|
|
27
|
+
/** The block item's tooltip caption says the same word as its name too. */
|
|
28
|
+
export const LATEX_SLASH_BLOCK_CAPTION = LATEX_SLASH_BLOCK_NAME;
|
|
29
|
+
export const LATEX_TOOLTIP_INTRO = [
|
|
30
|
+
'com.labre.latex.slash-menu.inline.tooltip-intro',
|
|
31
|
+
'Energy. Mass. Light. In a single equation,',
|
|
32
|
+
];
|
|
33
|
+
export const LATEX_TOOLTIP_BLOCK_INTRO = [
|
|
34
|
+
'com.labre.latex.slash-menu.block.tooltip-intro',
|
|
35
|
+
'Create a equation via LaTeX.',
|
|
36
|
+
];
|
|
37
|
+
/**
|
|
38
|
+
* `./latex-block.ts`'s own placeholders: the empty block, and a block whose
|
|
39
|
+
* LaTeX source failed to render. `LATEX_EMPTY_PLACEHOLDER`'s fallback is the
|
|
40
|
+
* SAME word as the slash-menu item's own name (`LATEX_SLASH_BLOCK_NAME`), but
|
|
41
|
+
* it is a different surface (rendered inside the katex container, not the
|
|
42
|
+
* slash menu), so it keeps its own key rather than aliasing.
|
|
43
|
+
*/
|
|
44
|
+
export const LATEX_EMPTY_PLACEHOLDER = EQUATION_EMPTY_LABEL;
|
|
45
|
+
export const LATEX_ERROR_PLACEHOLDER = EQUATION_ERROR_LABEL;
|
|
46
|
+
/**
|
|
47
|
+
* Every wording declared above, in declaration order — walked by
|
|
48
|
+
* `PACKAGE_WORDINGS` in `packages/affine/all/src/translations.ts`. The two
|
|
49
|
+
* caption aliases (`LATEX_SLASH_INLINE_CAPTION` / `_BLOCK_CAPTION`) are not
|
|
50
|
+
* listed again, same rule the note/slash-menu packages' own chrome aliases
|
|
51
|
+
* already follow.
|
|
52
|
+
*/
|
|
53
|
+
export const LATEX_WORDINGS = [
|
|
54
|
+
LATEX_SLASH_INLINE_NAME,
|
|
55
|
+
LATEX_SLASH_INLINE_DESCRIPTION,
|
|
56
|
+
LATEX_SLASH_BLOCK_NAME,
|
|
57
|
+
LATEX_SLASH_BLOCK_DESCRIPTION,
|
|
58
|
+
LATEX_TOOLTIP_INTRO,
|
|
59
|
+
LATEX_TOOLTIP_BLOCK_INTRO,
|
|
60
|
+
];
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { LineWidth, type StrokeStyle } from '../../affine-model/index.js';
|
|
2
|
+
import type { BlockStdScope } from '../../std/index.js';
|
|
2
3
|
import { ShadowlessElement } from '../../std/index.js';
|
|
3
4
|
export declare class EdgelessNoteBorderDropdownMenu extends ShadowlessElement {
|
|
4
5
|
render(): import("lit-html").TemplateResult<1>;
|
|
5
6
|
accessor lineStyle: StrokeStyle;
|
|
6
7
|
accessor lineSize: LineWidth;
|
|
8
|
+
/**
|
|
9
|
+
* Optional: this component is registered but currently has no renderer in
|
|
10
|
+
* this repo that instantiates it, so there is no call site to thread `std`
|
|
11
|
+
* from yet. When one appears, passing `.std=${ctx.std}` translates the
|
|
12
|
+
* label; without it, the English fallback keeps showing, same as before
|
|
13
|
+
* this wording existed.
|
|
14
|
+
*/
|
|
15
|
+
accessor std: BlockStdScope | undefined;
|
|
7
16
|
}
|
|
8
17
|
declare global {
|
|
9
18
|
interface HTMLElementTagNameMap {
|
|
@@ -34,10 +34,12 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
34
34
|
};
|
|
35
35
|
import { EditorChevronDown } from '../../affine-components/toolbar/index.js';
|
|
36
36
|
import { LineWidth } from '../../affine-model/index.js';
|
|
37
|
+
import { translateKey } from '../../affine-shared/services/index.js';
|
|
37
38
|
import { LineStyleIcon } from '@blocksuite/icons/lit';
|
|
38
39
|
import { ShadowlessElement } from '../../std/index.js';
|
|
39
40
|
import { html } from 'lit';
|
|
40
41
|
import { property } from 'lit/decorators.js';
|
|
42
|
+
import { NOTE_BORDER_STYLE_LABEL } from '../translations.js';
|
|
41
43
|
let EdgelessNoteBorderDropdownMenu = (() => {
|
|
42
44
|
let _classSuper = ShadowlessElement;
|
|
43
45
|
let _lineStyle_decorators;
|
|
@@ -46,24 +48,29 @@ let EdgelessNoteBorderDropdownMenu = (() => {
|
|
|
46
48
|
let _lineSize_decorators;
|
|
47
49
|
let _lineSize_initializers = [];
|
|
48
50
|
let _lineSize_extraInitializers = [];
|
|
51
|
+
let _std_decorators;
|
|
52
|
+
let _std_initializers = [];
|
|
53
|
+
let _std_extraInitializers = [];
|
|
49
54
|
return class EdgelessNoteBorderDropdownMenu extends _classSuper {
|
|
50
55
|
static {
|
|
51
56
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
52
57
|
_lineStyle_decorators = [property({ attribute: false })];
|
|
53
58
|
_lineSize_decorators = [property({ attribute: false })];
|
|
59
|
+
_std_decorators = [property({ attribute: false })];
|
|
54
60
|
__esDecorate(this, null, _lineStyle_decorators, { kind: "accessor", name: "lineStyle", static: false, private: false, access: { has: obj => "lineStyle" in obj, get: obj => obj.lineStyle, set: (obj, value) => { obj.lineStyle = value; } }, metadata: _metadata }, _lineStyle_initializers, _lineStyle_extraInitializers);
|
|
55
61
|
__esDecorate(this, null, _lineSize_decorators, { kind: "accessor", name: "lineSize", static: false, private: false, access: { has: obj => "lineSize" in obj, get: obj => obj.lineSize, set: (obj, value) => { obj.lineSize = value; } }, metadata: _metadata }, _lineSize_initializers, _lineSize_extraInitializers);
|
|
62
|
+
__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);
|
|
56
63
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
57
64
|
}
|
|
58
65
|
render() {
|
|
59
|
-
const { lineSize, lineStyle } = this;
|
|
66
|
+
const { lineSize, lineStyle, std } = this;
|
|
67
|
+
const label = std
|
|
68
|
+
? translateKey(std, ...NOTE_BORDER_STYLE_LABEL)
|
|
69
|
+
: NOTE_BORDER_STYLE_LABEL[1];
|
|
60
70
|
return html `
|
|
61
71
|
<editor-menu-button
|
|
62
72
|
.button=${html `
|
|
63
|
-
<editor-icon-button
|
|
64
|
-
aria-label="Border style"
|
|
65
|
-
.tooltip="${'Border style'}"
|
|
66
|
-
>
|
|
73
|
+
<editor-icon-button aria-label=${label} .tooltip="${label}">
|
|
67
74
|
${LineStyleIcon()} ${EditorChevronDown}
|
|
68
75
|
</editor-icon-button>
|
|
69
76
|
`}
|
|
@@ -81,9 +88,19 @@ let EdgelessNoteBorderDropdownMenu = (() => {
|
|
|
81
88
|
#lineSize_accessor_storage = (__runInitializers(this, _lineStyle_extraInitializers), __runInitializers(this, _lineSize_initializers, LineWidth.Two));
|
|
82
89
|
get lineSize() { return this.#lineSize_accessor_storage; }
|
|
83
90
|
set lineSize(value) { this.#lineSize_accessor_storage = value; }
|
|
91
|
+
#std_accessor_storage = (__runInitializers(this, _lineSize_extraInitializers), __runInitializers(this, _std_initializers, undefined));
|
|
92
|
+
/**
|
|
93
|
+
* Optional: this component is registered but currently has no renderer in
|
|
94
|
+
* this repo that instantiates it, so there is no call site to thread `std`
|
|
95
|
+
* from yet. When one appears, passing `.std=${ctx.std}` translates the
|
|
96
|
+
* label; without it, the English fallback keeps showing, same as before
|
|
97
|
+
* this wording existed.
|
|
98
|
+
*/
|
|
99
|
+
get std() { return this.#std_accessor_storage; }
|
|
100
|
+
set std(value) { this.#std_accessor_storage = value; }
|
|
84
101
|
constructor() {
|
|
85
102
|
super(...arguments);
|
|
86
|
-
__runInitializers(this,
|
|
103
|
+
__runInitializers(this, _std_extraInitializers);
|
|
87
104
|
}
|
|
88
105
|
};
|
|
89
106
|
})();
|
package/dist/_pkgs/affine-block-note/components/edgeless-note-display-mode-dropdown-menu.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { NoteDisplayMode } from '../../affine-model/index.js';
|
|
2
|
+
import type { BlockStdScope } from '../../std/index.js';
|
|
2
3
|
import { ShadowlessElement } from '../../std/index.js';
|
|
3
4
|
export declare class EdgelessNoteDisplayModeDropdownMenu extends ShadowlessElement {
|
|
4
|
-
get mode(): "
|
|
5
|
+
get mode(): "Both" | "Page" | "Edgeless";
|
|
5
6
|
select(detail: NoteDisplayMode): void;
|
|
6
7
|
render(): import("lit-html").TemplateResult<1>;
|
|
7
8
|
accessor displayMode: NoteDisplayMode;
|
|
9
|
+
/** Threaded from the surface toolbar's `content(ctx)` (`../configs/toolbar.ts`). */
|
|
10
|
+
accessor std: BlockStdScope;
|
|
8
11
|
}
|
|
9
12
|
declare global {
|
|
10
13
|
interface HTMLElementTagNameMap {
|
|
@@ -34,24 +34,36 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
34
34
|
};
|
|
35
35
|
import { EditorChevronDown } from '../../affine-components/toolbar/index.js';
|
|
36
36
|
import { NoteDisplayMode } from '../../affine-model/index.js';
|
|
37
|
+
import { translateKey } from '../../affine-shared/services/index.js';
|
|
37
38
|
import { ShadowlessElement } from '../../std/index.js';
|
|
38
39
|
import { html } from 'lit';
|
|
39
40
|
import { property } from 'lit/decorators.js';
|
|
41
|
+
import { NOTE_DISPLAY_MODE_BOTH, NOTE_DISPLAY_MODE_EDGELESS, NOTE_DISPLAY_MODE_LABEL, NOTE_DISPLAY_MODE_PAGE, NOTE_DISPLAY_MODE_SHOW_IN, } from '../translations.js';
|
|
40
42
|
const DisplayModeMap = {
|
|
41
43
|
[NoteDisplayMode.DocAndEdgeless]: 'Both',
|
|
42
44
|
[NoteDisplayMode.EdgelessOnly]: 'Edgeless',
|
|
43
45
|
[NoteDisplayMode.DocOnly]: 'Page',
|
|
44
46
|
};
|
|
47
|
+
const DisplayModeWording = {
|
|
48
|
+
[NoteDisplayMode.DocAndEdgeless]: NOTE_DISPLAY_MODE_BOTH,
|
|
49
|
+
[NoteDisplayMode.EdgelessOnly]: NOTE_DISPLAY_MODE_EDGELESS,
|
|
50
|
+
[NoteDisplayMode.DocOnly]: NOTE_DISPLAY_MODE_PAGE,
|
|
51
|
+
};
|
|
45
52
|
let EdgelessNoteDisplayModeDropdownMenu = (() => {
|
|
46
53
|
let _classSuper = ShadowlessElement;
|
|
47
54
|
let _displayMode_decorators;
|
|
48
55
|
let _displayMode_initializers = [];
|
|
49
56
|
let _displayMode_extraInitializers = [];
|
|
57
|
+
let _std_decorators;
|
|
58
|
+
let _std_initializers = [];
|
|
59
|
+
let _std_extraInitializers = [];
|
|
50
60
|
return class EdgelessNoteDisplayModeDropdownMenu extends _classSuper {
|
|
51
61
|
static {
|
|
52
62
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
53
63
|
_displayMode_decorators = [property({ attribute: false })];
|
|
64
|
+
_std_decorators = [property({ attribute: false })];
|
|
54
65
|
__esDecorate(this, null, _displayMode_decorators, { kind: "accessor", name: "displayMode", static: false, private: false, access: { has: obj => "displayMode" in obj, get: obj => obj.displayMode, set: (obj, value) => { obj.displayMode = value; } }, metadata: _metadata }, _displayMode_initializers, _displayMode_extraInitializers);
|
|
66
|
+
__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);
|
|
55
67
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
56
68
|
}
|
|
57
69
|
get mode() {
|
|
@@ -61,24 +73,28 @@ let EdgelessNoteDisplayModeDropdownMenu = (() => {
|
|
|
61
73
|
this.dispatchEvent(new CustomEvent('select', { detail }));
|
|
62
74
|
}
|
|
63
75
|
render() {
|
|
64
|
-
const { displayMode,
|
|
76
|
+
const { displayMode, std } = this;
|
|
77
|
+
const modeLabel = translateKey(std, ...DisplayModeWording[displayMode]);
|
|
65
78
|
return html `
|
|
66
|
-
<span class="display-mode-button-label"
|
|
79
|
+
<span class="display-mode-button-label"
|
|
80
|
+
>${translateKey(std, ...NOTE_DISPLAY_MODE_SHOW_IN)}</span
|
|
81
|
+
>
|
|
67
82
|
<editor-menu-button
|
|
68
83
|
.contentPadding=${'8px'}
|
|
69
84
|
.button=${html `
|
|
70
85
|
<editor-icon-button
|
|
71
|
-
aria-label
|
|
72
|
-
.tooltip="${
|
|
86
|
+
aria-label=${translateKey(std, ...NOTE_DISPLAY_MODE_LABEL)}
|
|
87
|
+
.tooltip="${translateKey(std, ...NOTE_DISPLAY_MODE_LABEL)}"
|
|
73
88
|
.justify="${'space-between'}"
|
|
74
89
|
.labelHeight="${'20px'}"
|
|
75
90
|
>
|
|
76
|
-
<span class="label">${
|
|
91
|
+
<span class="label">${modeLabel}</span>
|
|
77
92
|
${EditorChevronDown}
|
|
78
93
|
</editor-icon-button>
|
|
79
94
|
`}
|
|
80
95
|
>
|
|
81
96
|
<note-display-mode-panel
|
|
97
|
+
.std=${std}
|
|
82
98
|
.displayMode=${displayMode}
|
|
83
99
|
.onSelect=${(newMode) => this.select(newMode)}
|
|
84
100
|
>
|
|
@@ -89,9 +105,13 @@ let EdgelessNoteDisplayModeDropdownMenu = (() => {
|
|
|
89
105
|
#displayMode_accessor_storage = __runInitializers(this, _displayMode_initializers, void 0);
|
|
90
106
|
get displayMode() { return this.#displayMode_accessor_storage; }
|
|
91
107
|
set displayMode(value) { this.#displayMode_accessor_storage = value; }
|
|
108
|
+
#std_accessor_storage = (__runInitializers(this, _displayMode_extraInitializers), __runInitializers(this, _std_initializers, void 0));
|
|
109
|
+
/** Threaded from the surface toolbar's `content(ctx)` (`../configs/toolbar.ts`). */
|
|
110
|
+
get std() { return this.#std_accessor_storage; }
|
|
111
|
+
set std(value) { this.#std_accessor_storage = value; }
|
|
92
112
|
constructor() {
|
|
93
113
|
super(...arguments);
|
|
94
|
-
__runInitializers(this,
|
|
114
|
+
__runInitializers(this, _std_extraInitializers);
|
|
95
115
|
}
|
|
96
116
|
};
|
|
97
117
|
})();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ColorScheme, NoteShadow } from '../../affine-model/index.js';
|
|
2
|
+
import type { BlockStdScope } from '../../std/index.js';
|
|
2
3
|
import { LitElement, type PropertyValues } from 'lit';
|
|
3
4
|
export declare class EdgelessNoteShadowMenu extends LitElement {
|
|
4
5
|
static styles: import("lit").CSSResult;
|
|
@@ -8,6 +9,8 @@ export declare class EdgelessNoteShadowMenu extends LitElement {
|
|
|
8
9
|
accessor background: string;
|
|
9
10
|
accessor theme: ColorScheme;
|
|
10
11
|
accessor value: NoteShadow;
|
|
12
|
+
/** Threaded from `edgeless-note-style-panel.ts`, which already has `std`. */
|
|
13
|
+
accessor std: BlockStdScope;
|
|
11
14
|
}
|
|
12
15
|
declare global {
|
|
13
16
|
interface HTMLElementTagNameMap {
|
|
@@ -33,11 +33,13 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
35
|
import { ColorScheme, NoteShadow } from '../../affine-model/index.js';
|
|
36
|
+
import { translateKey, } from '../../affine-shared/services/index.js';
|
|
36
37
|
import { unsafeCSSVarV2 } from '../../affine-shared/theme/index.js';
|
|
37
38
|
import { css, html, LitElement } from 'lit';
|
|
38
39
|
import { property } from 'lit/decorators.js';
|
|
39
40
|
import { repeat } from 'lit/directives/repeat.js';
|
|
40
41
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
42
|
+
import { NOTE_SHADOW_BOX, NOTE_SHADOW_FILM, NOTE_SHADOW_FLOATING, NOTE_SHADOW_NONE, NOTE_SHADOW_PAPER, NOTE_SHADOW_STICKER, } from '../translations.js';
|
|
41
43
|
import { NoteNoShadowIcon, NoteShadowSampleIcon } from './icons.js';
|
|
42
44
|
const SHADOWS = [
|
|
43
45
|
{
|
|
@@ -45,7 +47,7 @@ const SHADOWS = [
|
|
|
45
47
|
light: {},
|
|
46
48
|
dark: {},
|
|
47
49
|
style: {},
|
|
48
|
-
|
|
50
|
+
tooltipWording: NOTE_SHADOW_NONE,
|
|
49
51
|
},
|
|
50
52
|
{
|
|
51
53
|
type: NoteShadow.Box,
|
|
@@ -60,7 +62,7 @@ const SHADOWS = [
|
|
|
60
62
|
style: {
|
|
61
63
|
boxShadow: '0px 0.109px 2.621px var(--note-box-shadow-color-1), 0px 0px 0.874px var(--note-box-shadow-color-2)',
|
|
62
64
|
},
|
|
63
|
-
|
|
65
|
+
tooltipWording: NOTE_SHADOW_BOX,
|
|
64
66
|
},
|
|
65
67
|
{
|
|
66
68
|
type: NoteShadow.Sticker,
|
|
@@ -75,7 +77,7 @@ const SHADOWS = [
|
|
|
75
77
|
style: {
|
|
76
78
|
boxShadow: '0px 5.243px 5.68px var(--note-sticker-shadow-color-1), 0px 5.68px 3.932px var(--note-sticker-shadow-color-2)',
|
|
77
79
|
},
|
|
78
|
-
|
|
80
|
+
tooltipWording: NOTE_SHADOW_STICKER,
|
|
79
81
|
},
|
|
80
82
|
{
|
|
81
83
|
type: NoteShadow.Paper,
|
|
@@ -91,7 +93,7 @@ const SHADOWS = [
|
|
|
91
93
|
border: '2px solid var(--note-paper-shadow-color-2)',
|
|
92
94
|
boxShadow: '0px 0.655px 1.311px var(--note-paper-shadow-color-1)',
|
|
93
95
|
},
|
|
94
|
-
|
|
96
|
+
tooltipWording: NOTE_SHADOW_PAPER,
|
|
95
97
|
},
|
|
96
98
|
{
|
|
97
99
|
type: NoteShadow.Float,
|
|
@@ -106,7 +108,7 @@ const SHADOWS = [
|
|
|
106
108
|
style: {
|
|
107
109
|
boxShadow: '0px 2.84px 6.554px var(--note-float-shadow-color-1), 0px 0px 0.218px var(--note-float-shadow-color-2)',
|
|
108
110
|
},
|
|
109
|
-
|
|
111
|
+
tooltipWording: NOTE_SHADOW_FLOATING,
|
|
110
112
|
},
|
|
111
113
|
{
|
|
112
114
|
type: NoteShadow.Film,
|
|
@@ -122,7 +124,7 @@ const SHADOWS = [
|
|
|
122
124
|
border: '1px solid var(--note-film-shadow-color-1)',
|
|
123
125
|
boxShadow: '2px 2px 0px var(--note-film-shadow-color-2)',
|
|
124
126
|
},
|
|
125
|
-
|
|
127
|
+
tooltipWording: NOTE_SHADOW_FILM,
|
|
126
128
|
},
|
|
127
129
|
];
|
|
128
130
|
let EdgelessNoteShadowMenu = (() => {
|
|
@@ -136,15 +138,20 @@ let EdgelessNoteShadowMenu = (() => {
|
|
|
136
138
|
let _value_decorators;
|
|
137
139
|
let _value_initializers = [];
|
|
138
140
|
let _value_extraInitializers = [];
|
|
141
|
+
let _std_decorators;
|
|
142
|
+
let _std_initializers = [];
|
|
143
|
+
let _std_extraInitializers = [];
|
|
139
144
|
return class EdgelessNoteShadowMenu extends _classSuper {
|
|
140
145
|
static {
|
|
141
146
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
142
147
|
_background_decorators = [property({ attribute: false })];
|
|
143
148
|
_theme_decorators = [property({ attribute: false })];
|
|
144
149
|
_value_decorators = [property({ attribute: false })];
|
|
150
|
+
_std_decorators = [property({ attribute: false })];
|
|
145
151
|
__esDecorate(this, null, _background_decorators, { kind: "accessor", name: "background", static: false, private: false, access: { has: obj => "background" in obj, get: obj => obj.background, set: (obj, value) => { obj.background = value; } }, metadata: _metadata }, _background_initializers, _background_extraInitializers);
|
|
146
152
|
__esDecorate(this, null, _theme_decorators, { kind: "accessor", name: "theme", static: false, private: false, access: { has: obj => "theme" in obj, get: obj => obj.theme, set: (obj, value) => { obj.theme = value; } }, metadata: _metadata }, _theme_initializers, _theme_extraInitializers);
|
|
147
153
|
__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);
|
|
154
|
+
__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);
|
|
148
155
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
149
156
|
}
|
|
150
157
|
static { this.styles = css `
|
|
@@ -197,9 +204,9 @@ let EdgelessNoteShadowMenu = (() => {
|
|
|
197
204
|
}
|
|
198
205
|
}
|
|
199
206
|
render() {
|
|
200
|
-
const { value, theme } = this;
|
|
207
|
+
const { value, theme, std } = this;
|
|
201
208
|
const isDark = theme === ColorScheme.Dark;
|
|
202
|
-
return repeat(SHADOWS, shadow => shadow.type, ({ type,
|
|
209
|
+
return repeat(SHADOWS, shadow => shadow.type, ({ type, tooltipWording, style, light, dark }, index) => html `<div
|
|
203
210
|
class="item"
|
|
204
211
|
?data-selected="${value === type}"
|
|
205
212
|
@click=${() => this.select(type)}
|
|
@@ -207,7 +214,7 @@ let EdgelessNoteShadowMenu = (() => {
|
|
|
207
214
|
<editor-icon-button
|
|
208
215
|
class="item-icon"
|
|
209
216
|
data-testid="${type.replace('--', '')}"
|
|
210
|
-
.tooltip=${
|
|
217
|
+
.tooltip=${translateKey(std, ...tooltipWording)}
|
|
211
218
|
.tipPosition="${'bottom'}"
|
|
212
219
|
.iconContainerPadding=${0}
|
|
213
220
|
.hover=${false}
|
|
@@ -229,9 +236,13 @@ let EdgelessNoteShadowMenu = (() => {
|
|
|
229
236
|
#value_accessor_storage = (__runInitializers(this, _theme_extraInitializers), __runInitializers(this, _value_initializers, void 0));
|
|
230
237
|
get value() { return this.#value_accessor_storage; }
|
|
231
238
|
set value(value) { this.#value_accessor_storage = value; }
|
|
239
|
+
#std_accessor_storage = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _std_initializers, void 0));
|
|
240
|
+
/** Threaded from `edgeless-note-style-panel.ts`, which already has `std`. */
|
|
241
|
+
get std() { return this.#std_accessor_storage; }
|
|
242
|
+
set std(value) { this.#std_accessor_storage = value; }
|
|
232
243
|
constructor() {
|
|
233
244
|
super(...arguments);
|
|
234
|
-
__runInitializers(this,
|
|
245
|
+
__runInitializers(this, _std_extraInitializers);
|
|
235
246
|
}
|
|
236
247
|
};
|
|
237
248
|
})();
|
|
@@ -35,7 +35,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
35
35
|
import { EdgelessCRUDIdentifier } from '../../affine-block-surface/index.js';
|
|
36
36
|
import { packColorsWith, preprocessColor, } from '../../affine-components/color-picker/index.js';
|
|
37
37
|
import { DefaultTheme, NoteBlockModel, resolveColor, } from '../../affine-model/index.js';
|
|
38
|
-
import { ThemeProvider } from '../../affine-shared/services/index.js';
|
|
38
|
+
import { ThemeProvider, translateKey } from '../../affine-shared/services/index.js';
|
|
39
39
|
import { unsafeCSSVarV2 } from '../../affine-shared/theme/index.js';
|
|
40
40
|
import { getMostCommonResolvedValue, stopPropagation, } from '../../affine-shared/utils/index.js';
|
|
41
41
|
import { SignalWatcher, WithDisposable } from '../../global/lit/index.js';
|
|
@@ -44,6 +44,7 @@ import { BlockStdScope, PropTypes, requiredProperties } from '../../std/index.js
|
|
|
44
44
|
import { css, html, LitElement } from 'lit';
|
|
45
45
|
import { property, query, state } from 'lit/decorators.js';
|
|
46
46
|
import { choose } from 'lit/directives/choose.js';
|
|
47
|
+
import { NOTE_STYLE_BACK, NOTE_STYLE_BORDER_SECTION, NOTE_STYLE_CORNER_RADIUS, NOTE_STYLE_CUSTOM_COLOR, NOTE_STYLE_FILL_COLOR, NOTE_STYLE_PANEL_LABEL, NOTE_STYLE_SHADOW_SECTION, } from '../translations.js';
|
|
47
48
|
let EdgelessNoteStylePanel = (() => {
|
|
48
49
|
let _classDecorators = [requiredProperties({
|
|
49
50
|
notes: PropTypes.arrayOf(model => model instanceof NoteBlockModel),
|
|
@@ -321,11 +322,14 @@ let EdgelessNoteStylePanel = (() => {
|
|
|
321
322
|
_renderStylePanel() {
|
|
322
323
|
return html `<div class="edgeless-note-style-panel">
|
|
323
324
|
<div class="edgeless-note-style-section">
|
|
324
|
-
<div class="edgeless-note-style-section-title">
|
|
325
|
+
<div class="edgeless-note-style-section-title">
|
|
326
|
+
${translateKey(this.std, ...NOTE_STYLE_FILL_COLOR)}
|
|
327
|
+
</div>
|
|
325
328
|
<edgeless-color-panel
|
|
326
329
|
role="listbox"
|
|
327
330
|
.value=${this._background}
|
|
328
331
|
.theme=${this._theme}
|
|
332
|
+
.std=${this.std}
|
|
329
333
|
.palettes=${DefaultTheme.NoteBackgroundColorPalettes}
|
|
330
334
|
.hasTransparent=${false}
|
|
331
335
|
.columns=${DefaultTheme.NoteBackgroundColorPalettes.length + 1}
|
|
@@ -338,8 +342,11 @@ let EdgelessNoteStylePanel = (() => {
|
|
|
338
342
|
</edgeless-color-panel>
|
|
339
343
|
</div>
|
|
340
344
|
<div class="edgeless-note-style-section">
|
|
341
|
-
<div class="edgeless-note-style-section-title">
|
|
345
|
+
<div class="edgeless-note-style-section-title">
|
|
346
|
+
${translateKey(this.std, ...NOTE_STYLE_SHADOW_SECTION)}
|
|
347
|
+
</div>
|
|
342
348
|
<edgeless-note-shadow-menu
|
|
349
|
+
.std=${this.std}
|
|
343
350
|
.background=${this._background}
|
|
344
351
|
.theme=${this._theme}
|
|
345
352
|
.value=${this._shadow}
|
|
@@ -350,7 +357,9 @@ let EdgelessNoteStylePanel = (() => {
|
|
|
350
357
|
class="edgeless-note-style-section"
|
|
351
358
|
data-testid="affine-note-border-style-panel"
|
|
352
359
|
>
|
|
353
|
-
<div class="edgeless-note-style-section-title">
|
|
360
|
+
<div class="edgeless-note-style-section-title">
|
|
361
|
+
${translateKey(this.std, ...NOTE_STYLE_BORDER_SECTION)}
|
|
362
|
+
</div>
|
|
354
363
|
<edgeless-line-styles-panel
|
|
355
364
|
.lineSize=${this._borderSize}
|
|
356
365
|
.lineStyle=${this._borderStyle}
|
|
@@ -361,7 +370,9 @@ let EdgelessNoteStylePanel = (() => {
|
|
|
361
370
|
class="edgeless-note-style-section"
|
|
362
371
|
data-testid="affine-note-corner-radius-panel"
|
|
363
372
|
>
|
|
364
|
-
<div class="edgeless-note-style-section-title">
|
|
373
|
+
<div class="edgeless-note-style-section-title">
|
|
374
|
+
${translateKey(this.std, ...NOTE_STYLE_CORNER_RADIUS)}
|
|
375
|
+
</div>
|
|
365
376
|
<div class="edgeless-note-corner-radius-panel">
|
|
366
377
|
<affine-slider
|
|
367
378
|
.value=${this._borderRadius}
|
|
@@ -398,13 +409,13 @@ let EdgelessNoteStylePanel = (() => {
|
|
|
398
409
|
return html `<div class="edgeless-note-style-custom-color-panel">
|
|
399
410
|
<div class="edgeless-note-style-section-title">
|
|
400
411
|
<editor-icon-button
|
|
401
|
-
aria-label
|
|
412
|
+
aria-label=${translateKey(this.std, ...NOTE_STYLE_BACK)}
|
|
402
413
|
.iconSize=${'16px'}
|
|
403
414
|
@click=${this._switchToStyleTab}
|
|
404
415
|
>
|
|
405
416
|
${ArrowLeftSmallIcon()}
|
|
406
417
|
</editor-icon-button>
|
|
407
|
-
|
|
418
|
+
${translateKey(this.std, ...NOTE_STYLE_CUSTOM_COLOR)}
|
|
408
419
|
</div>
|
|
409
420
|
<edgeless-color-picker
|
|
410
421
|
class="edgeless-note-custom-color-picker"
|
|
@@ -425,7 +436,10 @@ let EdgelessNoteStylePanel = (() => {
|
|
|
425
436
|
<editor-menu-button
|
|
426
437
|
.contentPadding=${'8px'}
|
|
427
438
|
.button=${html `
|
|
428
|
-
<editor-icon-button
|
|
439
|
+
<editor-icon-button
|
|
440
|
+
aria-label=${translateKey(this.std, ...NOTE_STYLE_PANEL_LABEL)}
|
|
441
|
+
.tooltip=${translateKey(this.std, ...NOTE_STYLE_PANEL_LABEL)}
|
|
442
|
+
>
|
|
429
443
|
${PaletteIcon()}
|
|
430
444
|
</editor-icon-button>
|
|
431
445
|
`}
|
|
@@ -6,6 +6,7 @@ import { HeadingsIcon } from '@blocksuite/icons/lit';
|
|
|
6
6
|
import { BlockSelection } from '../../std/index.js';
|
|
7
7
|
import { updateBlockType } from '../commands/index.js';
|
|
8
8
|
import { tooltips } from './tooltips.js';
|
|
9
|
+
import { NOTE_OTHER_HEADINGS, NOTE_SLASH_ITEM_NAME_WORDINGS, } from '../translations.js';
|
|
9
10
|
let basicIndex = 0;
|
|
10
11
|
const noteSlashMenuConfig = {
|
|
11
12
|
items: [
|
|
@@ -14,6 +15,7 @@ const noteSlashMenuConfig = {
|
|
|
14
15
|
.map(config => createConversionItem(config, `0_Basic@${basicIndex++}`)),
|
|
15
16
|
{
|
|
16
17
|
name: 'Other Headings',
|
|
18
|
+
nameWording: NOTE_OTHER_HEADINGS,
|
|
17
19
|
icon: HeadingsIcon(),
|
|
18
20
|
group: `0_Basic@${basicIndex++}`,
|
|
19
21
|
subMenu: textConversionConfigs
|
|
@@ -38,12 +40,22 @@ const noteSlashMenuConfig = {
|
|
|
38
40
|
.map((config, index) => createTextFormatItem(config, `2_Style@${index++}`)),
|
|
39
41
|
],
|
|
40
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* `TextConversionConfig.name` / `TextFormatConfig.name` are borrowed from
|
|
45
|
+
* `@labre/affine-rich-text` / `@labre/affine-inline-preset` — both outside
|
|
46
|
+
* this lot's packages, so their English literal is out of scope to key. The
|
|
47
|
+
* NAME each produces, though, is one this package already has a wording for
|
|
48
|
+
* (the shared block-type names, or this file's own format names), looked up
|
|
49
|
+
* by the borrowed string in `NOTE_SLASH_ITEM_NAME_WORDINGS`.
|
|
50
|
+
*/
|
|
41
51
|
function createConversionItem(config, group) {
|
|
42
52
|
const { name, description, icon, flavour, type } = config;
|
|
43
53
|
return {
|
|
44
54
|
name,
|
|
55
|
+
nameWording: config.nameWording ?? NOTE_SLASH_ITEM_NAME_WORDINGS[name],
|
|
45
56
|
group,
|
|
46
57
|
description,
|
|
58
|
+
descriptionWording: config.descriptionWording,
|
|
47
59
|
icon,
|
|
48
60
|
tooltip: tooltips[name],
|
|
49
61
|
when: ({ model }) => model.store.schema.flavourSchemaMap.has(flavour),
|
|
@@ -59,6 +71,7 @@ function createTextFormatItem(config, group) {
|
|
|
59
71
|
const { name, icon, id, action } = config;
|
|
60
72
|
return {
|
|
61
73
|
name,
|
|
74
|
+
nameWording: config.nameWording ?? NOTE_SLASH_ITEM_NAME_WORDINGS[name],
|
|
62
75
|
icon,
|
|
63
76
|
group,
|
|
64
77
|
tooltip: tooltips[name],
|