@formicoidea/labre-core 0.39.3 → 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/emoji-margin.js +19 -11
- 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.d.ts +16 -0
- package/dist/_pkgs/affine-block-note/configs/tooltips.js +150 -90
- 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/styles.js +30 -83
- 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/turbo/paragraph-layout-handler.js +1 -0
- package/dist/_pkgs/affine-block-paragraph/turbo/paragraph-painter.worker.d.ts +2 -0
- package/dist/_pkgs/affine-block-paragraph/turbo/paragraph-painter.worker.js +6 -1
- 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/framework-background/def.d.ts +4 -1
- package/dist/_pkgs/affine-block-surface/framework-background/def.js +6 -2
- 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 +101 -56
- 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/markdown.d.ts +3 -0
- package/dist/_pkgs/affine-inline-preset/markdown.js +19 -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/consts/heading.d.ts +29 -0
- package/dist/_pkgs/affine-shared/consts/heading.js +70 -0
- package/dist/_pkgs/affine-shared/consts/index.d.ts +2 -0
- package/dist/_pkgs/affine-shared/consts/index.js +2 -0
- package/dist/_pkgs/affine-shared/consts/notation.d.ts +67 -0
- package/dist/_pkgs/affine-shared/consts/notation.js +65 -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
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { type ChromeWording, NOTE_SHADOW_BOX, NOTE_SHADOW_FILM, NOTE_SHADOW_NONE, NOTE_SHADOW_PAPER, NOTE_SHADOW_STICKER, TOOLBAR_MOVE_DOWN, TOOLBAR_MOVE_UP } from '../affine-shared/services/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* This package's own wordings, declared beside the code that renders them —
|
|
4
|
+
* the note block's edgeless style panel, its slash-menu tooltip captions,
|
|
5
|
+
* and the surface toolbar's notifications. Words this package shares with
|
|
6
|
+
* ANOTHER of this lot's packages (the block-type names, the shadow options,
|
|
7
|
+
* the two move verbs, and — L7 dedupe — the bold/italic/underline/
|
|
8
|
+
* strikethrough formats, the border-style label, the fill-colour label and
|
|
9
|
+
* the display-mode words) live in `chrome.ts` instead and are re-exported or
|
|
10
|
+
* reused here; see the doc comment on each.
|
|
11
|
+
*/
|
|
12
|
+
export declare const NOTE_TOOLTIP_HEADING_1: ChromeWording;
|
|
13
|
+
export declare const NOTE_TOOLTIP_HEADING_2: ChromeWording;
|
|
14
|
+
export declare const NOTE_TOOLTIP_HEADING_3: ChromeWording;
|
|
15
|
+
export declare const NOTE_TOOLTIP_HEADING_4: ChromeWording;
|
|
16
|
+
export declare const NOTE_TOOLTIP_HEADING_5: ChromeWording;
|
|
17
|
+
export declare const NOTE_TOOLTIP_HEADING_6: ChromeWording;
|
|
18
|
+
export declare const NOTE_TOOLTIP_BOLD_TEXT: ChromeWording;
|
|
19
|
+
/** An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_ITALIC}, one key. */
|
|
20
|
+
export declare const NOTE_TOOLTIP_ITALIC: ChromeWording;
|
|
21
|
+
/** An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_UNDERLINE}, one key. */
|
|
22
|
+
export declare const NOTE_TOOLTIP_UNDERLINE: ChromeWording;
|
|
23
|
+
/** An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_STRIKETHROUGH}, one key. */
|
|
24
|
+
export declare const NOTE_TOOLTIP_STRIKETHROUGH: ChromeWording;
|
|
25
|
+
/** An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_BOLD}, one key. */
|
|
26
|
+
export declare const NOTE_SLASH_FORMAT_BOLD: ChromeWording;
|
|
27
|
+
/** An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_ITALIC}, one key. */
|
|
28
|
+
export declare const NOTE_SLASH_FORMAT_ITALIC: ChromeWording;
|
|
29
|
+
/** An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_UNDERLINE}, one key. */
|
|
30
|
+
export declare const NOTE_SLASH_FORMAT_UNDERLINE: ChromeWording;
|
|
31
|
+
/** An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_STRIKETHROUGH}, one key. */
|
|
32
|
+
export declare const NOTE_SLASH_FORMAT_STRIKETHROUGH: ChromeWording;
|
|
33
|
+
export declare const NOTE_OTHER_HEADINGS: ChromeWording;
|
|
34
|
+
/**
|
|
35
|
+
* `name` -> wording, for every conversion/format item this package's slash
|
|
36
|
+
* menu can offer. Reuses `BLOCK_NAME_*` (this lot's shared block-type names)
|
|
37
|
+
* where the borrowed `name` matches one, and this file's own format-name
|
|
38
|
+
* wordings otherwise.
|
|
39
|
+
*/
|
|
40
|
+
export declare const NOTE_SLASH_ITEM_NAME_WORDINGS: Readonly<Record<string, ChromeWording>>;
|
|
41
|
+
export { TOOLBAR_MOVE_DOWN as NOTE_MOVE_DOWN, TOOLBAR_MOVE_UP as NOTE_MOVE_UP };
|
|
42
|
+
export { NOTE_SHADOW_BOX, NOTE_SHADOW_FILM, NOTE_SHADOW_NONE, NOTE_SHADOW_PAPER, NOTE_SHADOW_STICKER, };
|
|
43
|
+
export declare const NOTE_SHADOW_FLOATING: ChromeWording;
|
|
44
|
+
/** An alias (L7 dedupe): the same word as {@link FILL_COLOR_LABEL}, one key. */
|
|
45
|
+
export declare const NOTE_STYLE_FILL_COLOR: ChromeWording;
|
|
46
|
+
export declare const NOTE_STYLE_SHADOW_SECTION: ChromeWording;
|
|
47
|
+
export declare const NOTE_STYLE_BORDER_SECTION: ChromeWording;
|
|
48
|
+
export declare const NOTE_STYLE_CORNER_RADIUS: ChromeWording;
|
|
49
|
+
export declare const NOTE_STYLE_BACK: ChromeWording;
|
|
50
|
+
export declare const NOTE_STYLE_CUSTOM_COLOR: ChromeWording;
|
|
51
|
+
export declare const NOTE_STYLE_PANEL_LABEL: ChromeWording;
|
|
52
|
+
/**
|
|
53
|
+
* An alias (L7 dedupe): the same word as {@link BOARD_BORDER_STYLE_LABEL},
|
|
54
|
+
* one key.
|
|
55
|
+
*/
|
|
56
|
+
export declare const NOTE_BORDER_STYLE_LABEL: ChromeWording;
|
|
57
|
+
/** An alias (L7 dedupe): the same word as {@link DISPLAY_MODE_SHOW_IN}, one key. */
|
|
58
|
+
export declare const NOTE_DISPLAY_MODE_SHOW_IN: ChromeWording;
|
|
59
|
+
export declare const NOTE_DISPLAY_MODE_LABEL: ChromeWording;
|
|
60
|
+
export declare const NOTE_DISPLAY_MODE_TOOLTIP: ChromeWording;
|
|
61
|
+
/** An alias (L7 dedupe): the same word as {@link DISPLAY_MODE_BOTH}, one key. */
|
|
62
|
+
export declare const NOTE_DISPLAY_MODE_BOTH: ChromeWording;
|
|
63
|
+
/** An alias (L7 dedupe): the same word as {@link DISPLAY_MODE_EDGELESS}, one key. */
|
|
64
|
+
export declare const NOTE_DISPLAY_MODE_EDGELESS: ChromeWording;
|
|
65
|
+
/** An alias (L7 dedupe): the same word as {@link DISPLAY_MODE_PAGE}, one key. */
|
|
66
|
+
export declare const NOTE_DISPLAY_MODE_PAGE: ChromeWording;
|
|
67
|
+
export declare const NOTE_TOAST_DISPLAYED_IN_PAGE_MODE: ChromeWording;
|
|
68
|
+
export declare const NOTE_TOAST_REMOVED_FROM_PAGE_BODY: ChromeWording;
|
|
69
|
+
export declare const NOTE_TOAST_ADDED_TO_PAGE_BODY: ChromeWording;
|
|
70
|
+
export declare const NOTE_TOAST_VIEW_IN_TOC: ChromeWording;
|
|
71
|
+
export declare const NOTE_TOOLBAR_DISPLAY_IN_PAGE: ChromeWording;
|
|
72
|
+
export declare const NOTE_TOOLBAR_DISPLAYED_IN_PAGE: ChromeWording;
|
|
73
|
+
export declare const NOTE_TOOLBAR_REMOVE_FROM_PAGE_TOOLTIP: ChromeWording;
|
|
74
|
+
export declare const NOTE_TOOLBAR_SLICER: ChromeWording;
|
|
75
|
+
export declare const NOTE_TOOLBAR_CUTTING_MODE: ChromeWording;
|
|
76
|
+
export declare const NOTE_TOOLBAR_SIZE: ChromeWording;
|
|
77
|
+
export declare const NOTE_TOOLBAR_AUTO_HEIGHT: ChromeWording;
|
|
78
|
+
export declare const NOTE_TOOLBAR_CUSTOMIZED_HEIGHT: ChromeWording;
|
|
79
|
+
/**
|
|
80
|
+
* Every wording DECLARED IN THIS FILE (not re-exported from `chrome.ts`), in
|
|
81
|
+
* declaration order — walked by `PACKAGE_WORDINGS` in
|
|
82
|
+
* `packages/affine/all/src/translations.ts`. The chrome re-exports
|
|
83
|
+
* (`NOTE_MOVE_UP`/`_DOWN`, `NOTE_SHADOW_*` other than `_FLOATING`, and — L7
|
|
84
|
+
* dedupe — `NOTE_TOOLTIP_ITALIC`/`_UNDERLINE`/`_STRIKETHROUGH`,
|
|
85
|
+
* `NOTE_SLASH_FORMAT_BOLD`/`_ITALIC`/`_UNDERLINE`/`_STRIKETHROUGH`,
|
|
86
|
+
* `NOTE_STYLE_FILL_COLOR`, `NOTE_BORDER_STYLE_LABEL`,
|
|
87
|
+
* `NOTE_DISPLAY_MODE_SHOW_IN`/`_BOTH`/`_EDGELESS`/`_PAGE`) are not listed
|
|
88
|
+
* again here, same rule `SLASH_MENU_WORDINGS` already follows for its own
|
|
89
|
+
* chrome aliases.
|
|
90
|
+
*/
|
|
91
|
+
export declare const NOTE_WORDINGS: readonly ChromeWording[];
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { BLOCK_NAME_BULLETED_LIST, BLOCK_NAME_CODE_BLOCK, BLOCK_NAME_DIVIDER, BLOCK_NAME_HEADING_1, BLOCK_NAME_HEADING_2, BLOCK_NAME_HEADING_3, BLOCK_NAME_HEADING_4, BLOCK_NAME_HEADING_5, BLOCK_NAME_HEADING_6, BLOCK_NAME_NUMBERED_LIST, BLOCK_NAME_QUOTE, BLOCK_NAME_TEXT, BLOCK_NAME_TODO_LIST, BOARD_BORDER_STYLE_LABEL, DISPLAY_MODE_BOTH, DISPLAY_MODE_EDGELESS, DISPLAY_MODE_PAGE, DISPLAY_MODE_SHOW_IN, FILL_COLOR_LABEL, NOTE_SHADOW_BOX, NOTE_SHADOW_FILM, NOTE_SHADOW_NONE, NOTE_SHADOW_PAPER, NOTE_SHADOW_STICKER, TEXT_FORMAT_BOLD, TEXT_FORMAT_ITALIC, TEXT_FORMAT_STRIKETHROUGH, TEXT_FORMAT_UNDERLINE, TOOLBAR_MOVE_DOWN, TOOLBAR_MOVE_UP, } from '../affine-shared/services/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* This package's own wordings, declared beside the code that renders them —
|
|
4
|
+
* the note block's edgeless style panel, its slash-menu tooltip captions,
|
|
5
|
+
* and the surface toolbar's notifications. Words this package shares with
|
|
6
|
+
* ANOTHER of this lot's packages (the block-type names, the shadow options,
|
|
7
|
+
* the two move verbs, and — L7 dedupe — the bold/italic/underline/
|
|
8
|
+
* strikethrough formats, the border-style label, the fill-colour label and
|
|
9
|
+
* the display-mode words) live in `chrome.ts` instead and are re-exported or
|
|
10
|
+
* reused here; see the doc comment on each.
|
|
11
|
+
*/
|
|
12
|
+
/* ── Slash-menu tooltip captions (`./configs/tooltips.ts`) ────────────────
|
|
13
|
+
* The heading captions say "Heading #N" — with the hash — which is NOT the
|
|
14
|
+
* same literal as the block-type name "Heading N" used elsewhere (the
|
|
15
|
+
* paragraph placeholder, the gfx/note menu), so they keep their own keys
|
|
16
|
+
* rather than reusing `BLOCK_NAME_HEADING_N`.
|
|
17
|
+
*/
|
|
18
|
+
export const NOTE_TOOLTIP_HEADING_1 = [
|
|
19
|
+
'com.labre.note.tooltip.heading-1',
|
|
20
|
+
'Heading #1',
|
|
21
|
+
];
|
|
22
|
+
export const NOTE_TOOLTIP_HEADING_2 = [
|
|
23
|
+
'com.labre.note.tooltip.heading-2',
|
|
24
|
+
'Heading #2',
|
|
25
|
+
];
|
|
26
|
+
export const NOTE_TOOLTIP_HEADING_3 = [
|
|
27
|
+
'com.labre.note.tooltip.heading-3',
|
|
28
|
+
'Heading #3',
|
|
29
|
+
];
|
|
30
|
+
export const NOTE_TOOLTIP_HEADING_4 = [
|
|
31
|
+
'com.labre.note.tooltip.heading-4',
|
|
32
|
+
'Heading #4',
|
|
33
|
+
];
|
|
34
|
+
export const NOTE_TOOLTIP_HEADING_5 = [
|
|
35
|
+
'com.labre.note.tooltip.heading-5',
|
|
36
|
+
'Heading #5',
|
|
37
|
+
];
|
|
38
|
+
export const NOTE_TOOLTIP_HEADING_6 = [
|
|
39
|
+
'com.labre.note.tooltip.heading-6',
|
|
40
|
+
'Heading #6',
|
|
41
|
+
];
|
|
42
|
+
export const NOTE_TOOLTIP_BOLD_TEXT = [
|
|
43
|
+
'com.labre.note.tooltip.bold-text',
|
|
44
|
+
'Bold Text',
|
|
45
|
+
];
|
|
46
|
+
/** An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_ITALIC}, one key. */
|
|
47
|
+
export const NOTE_TOOLTIP_ITALIC = TEXT_FORMAT_ITALIC;
|
|
48
|
+
/** An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_UNDERLINE}, one key. */
|
|
49
|
+
export const NOTE_TOOLTIP_UNDERLINE = TEXT_FORMAT_UNDERLINE;
|
|
50
|
+
/** An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_STRIKETHROUGH}, one key. */
|
|
51
|
+
export const NOTE_TOOLTIP_STRIKETHROUGH = TEXT_FORMAT_STRIKETHROUGH;
|
|
52
|
+
/* ── Slash-menu items rendered by THIS package (`./configs/slash-menu.ts`) ─
|
|
53
|
+
* `createConversionItem` / `createTextFormatItem` borrow their `name` from
|
|
54
|
+
* `textConversionConfigs` / `textFormatConfigs` (`@labre/affine-rich-text` /
|
|
55
|
+
* `@labre/affine-inline-preset`, both outside this lot) — the literal itself
|
|
56
|
+
* is out of scope, but the NAME each produces is one this package already has
|
|
57
|
+
* a wording for (the block-type names shared in `chrome.ts`, or the format
|
|
58
|
+
* names below), so the item still resolves through the seam by looking the
|
|
59
|
+
* borrowed name up in `NOTE_SLASH_ITEM_NAME_WORDINGS`.
|
|
60
|
+
*/
|
|
61
|
+
/** An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_BOLD}, one key. */
|
|
62
|
+
export const NOTE_SLASH_FORMAT_BOLD = TEXT_FORMAT_BOLD;
|
|
63
|
+
/** An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_ITALIC}, one key. */
|
|
64
|
+
export const NOTE_SLASH_FORMAT_ITALIC = TEXT_FORMAT_ITALIC;
|
|
65
|
+
/** An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_UNDERLINE}, one key. */
|
|
66
|
+
export const NOTE_SLASH_FORMAT_UNDERLINE = TEXT_FORMAT_UNDERLINE;
|
|
67
|
+
/** An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_STRIKETHROUGH}, one key. */
|
|
68
|
+
export const NOTE_SLASH_FORMAT_STRIKETHROUGH = TEXT_FORMAT_STRIKETHROUGH;
|
|
69
|
+
export const NOTE_OTHER_HEADINGS = [
|
|
70
|
+
'com.labre.note.slash-menu.other-headings',
|
|
71
|
+
'Other Headings',
|
|
72
|
+
];
|
|
73
|
+
/**
|
|
74
|
+
* `name` -> wording, for every conversion/format item this package's slash
|
|
75
|
+
* menu can offer. Reuses `BLOCK_NAME_*` (this lot's shared block-type names)
|
|
76
|
+
* where the borrowed `name` matches one, and this file's own format-name
|
|
77
|
+
* wordings otherwise.
|
|
78
|
+
*/
|
|
79
|
+
export const NOTE_SLASH_ITEM_NAME_WORDINGS = {
|
|
80
|
+
Text: BLOCK_NAME_TEXT,
|
|
81
|
+
'Heading 1': BLOCK_NAME_HEADING_1,
|
|
82
|
+
'Heading 2': BLOCK_NAME_HEADING_2,
|
|
83
|
+
'Heading 3': BLOCK_NAME_HEADING_3,
|
|
84
|
+
'Heading 4': BLOCK_NAME_HEADING_4,
|
|
85
|
+
'Heading 5': BLOCK_NAME_HEADING_5,
|
|
86
|
+
'Heading 6': BLOCK_NAME_HEADING_6,
|
|
87
|
+
'Code Block': BLOCK_NAME_CODE_BLOCK,
|
|
88
|
+
Quote: BLOCK_NAME_QUOTE,
|
|
89
|
+
Divider: BLOCK_NAME_DIVIDER,
|
|
90
|
+
'Bulleted List': BLOCK_NAME_BULLETED_LIST,
|
|
91
|
+
'Numbered List': BLOCK_NAME_NUMBERED_LIST,
|
|
92
|
+
'To-do List': BLOCK_NAME_TODO_LIST,
|
|
93
|
+
Bold: NOTE_SLASH_FORMAT_BOLD,
|
|
94
|
+
Italic: NOTE_SLASH_FORMAT_ITALIC,
|
|
95
|
+
Underline: NOTE_SLASH_FORMAT_UNDERLINE,
|
|
96
|
+
Strikethrough: NOTE_SLASH_FORMAT_STRIKETHROUGH,
|
|
97
|
+
};
|
|
98
|
+
/* ── Move up / down (`./move-block.ts`) ────────────────────────────────── */
|
|
99
|
+
export { TOOLBAR_MOVE_DOWN as NOTE_MOVE_DOWN, TOOLBAR_MOVE_UP as NOTE_MOVE_UP };
|
|
100
|
+
/* ── Note shadow menu (`./components/edgeless-note-shadow-menu.ts`) ─────── */
|
|
101
|
+
export { NOTE_SHADOW_BOX, NOTE_SHADOW_FILM, NOTE_SHADOW_NONE, NOTE_SHADOW_PAPER, NOTE_SHADOW_STICKER, };
|
|
102
|
+
export const NOTE_SHADOW_FLOATING = [
|
|
103
|
+
'com.labre.note.shadow.floating',
|
|
104
|
+
'Floating shadow',
|
|
105
|
+
];
|
|
106
|
+
/* ── Note style panel (`./components/edgeless-note-style-panel.ts`) ─────── */
|
|
107
|
+
/** An alias (L7 dedupe): the same word as {@link FILL_COLOR_LABEL}, one key. */
|
|
108
|
+
export const NOTE_STYLE_FILL_COLOR = FILL_COLOR_LABEL;
|
|
109
|
+
export const NOTE_STYLE_SHADOW_SECTION = [
|
|
110
|
+
'com.labre.note.style.shadow',
|
|
111
|
+
'Shadow',
|
|
112
|
+
];
|
|
113
|
+
export const NOTE_STYLE_BORDER_SECTION = [
|
|
114
|
+
'com.labre.note.style.border',
|
|
115
|
+
'Border',
|
|
116
|
+
];
|
|
117
|
+
export const NOTE_STYLE_CORNER_RADIUS = [
|
|
118
|
+
'com.labre.note.style.corner-radius',
|
|
119
|
+
'Corner Radius',
|
|
120
|
+
];
|
|
121
|
+
export const NOTE_STYLE_BACK = [
|
|
122
|
+
'com.labre.note.style.back',
|
|
123
|
+
'Back',
|
|
124
|
+
];
|
|
125
|
+
export const NOTE_STYLE_CUSTOM_COLOR = [
|
|
126
|
+
'com.labre.note.style.custom-color',
|
|
127
|
+
'Custom color',
|
|
128
|
+
];
|
|
129
|
+
export const NOTE_STYLE_PANEL_LABEL = [
|
|
130
|
+
'com.labre.note.style.panel-label',
|
|
131
|
+
'Note Style',
|
|
132
|
+
];
|
|
133
|
+
/* ── Border dropdown (`./components/edgeless-note-border-dropdown-menu.ts`) */
|
|
134
|
+
/**
|
|
135
|
+
* An alias (L7 dedupe): the same word as {@link BOARD_BORDER_STYLE_LABEL},
|
|
136
|
+
* one key.
|
|
137
|
+
*/
|
|
138
|
+
export const NOTE_BORDER_STYLE_LABEL = BOARD_BORDER_STYLE_LABEL;
|
|
139
|
+
/* ── Display-mode dropdown (`./components/edgeless-note-display-mode-dropdown-menu.ts`) */
|
|
140
|
+
/** An alias (L7 dedupe): the same word as {@link DISPLAY_MODE_SHOW_IN}, one key. */
|
|
141
|
+
export const NOTE_DISPLAY_MODE_SHOW_IN = DISPLAY_MODE_SHOW_IN;
|
|
142
|
+
export const NOTE_DISPLAY_MODE_LABEL = [
|
|
143
|
+
'com.labre.note.display-mode.mode-label',
|
|
144
|
+
'Mode',
|
|
145
|
+
];
|
|
146
|
+
export const NOTE_DISPLAY_MODE_TOOLTIP = [
|
|
147
|
+
'com.labre.note.display-mode.tooltip',
|
|
148
|
+
'Display mode',
|
|
149
|
+
];
|
|
150
|
+
/** An alias (L7 dedupe): the same word as {@link DISPLAY_MODE_BOTH}, one key. */
|
|
151
|
+
export const NOTE_DISPLAY_MODE_BOTH = DISPLAY_MODE_BOTH;
|
|
152
|
+
/** An alias (L7 dedupe): the same word as {@link DISPLAY_MODE_EDGELESS}, one key. */
|
|
153
|
+
export const NOTE_DISPLAY_MODE_EDGELESS = DISPLAY_MODE_EDGELESS;
|
|
154
|
+
/** An alias (L7 dedupe): the same word as {@link DISPLAY_MODE_PAGE}, one key. */
|
|
155
|
+
export const NOTE_DISPLAY_MODE_PAGE = DISPLAY_MODE_PAGE;
|
|
156
|
+
/* ── Surface toolbar (`./configs/toolbar.ts`) ─────────────────────────────
|
|
157
|
+
* The two "note is on the page" toasts. The removed-from-page title reuses
|
|
158
|
+
* `TOAST_NOTE_REMOVED_FROM_PAGE` (already in `chrome.ts`); its opposite gets
|
|
159
|
+
* its own key here. Each toast's BODY bakes in the trailing "Find it in the
|
|
160
|
+
* TOC…" sentence rather than composing it at the call site — one full
|
|
161
|
+
* sentence per key, never a fragment plus a suffix.
|
|
162
|
+
*/
|
|
163
|
+
export const NOTE_TOAST_DISPLAYED_IN_PAGE_MODE = [
|
|
164
|
+
'com.labre.note.toast.displayed-in-page-mode',
|
|
165
|
+
'Note displayed in Document Mode',
|
|
166
|
+
];
|
|
167
|
+
export const NOTE_TOAST_REMOVED_FROM_PAGE_BODY = [
|
|
168
|
+
'com.labre.note.toast.removed-from-page.body',
|
|
169
|
+
'Content removed from your document. Find it in the TOC for quick navigation.',
|
|
170
|
+
];
|
|
171
|
+
export const NOTE_TOAST_ADDED_TO_PAGE_BODY = [
|
|
172
|
+
'com.labre.note.toast.added-to-page.body',
|
|
173
|
+
'Content added to your document. Find it in the TOC for quick navigation.',
|
|
174
|
+
];
|
|
175
|
+
export const NOTE_TOAST_VIEW_IN_TOC = [
|
|
176
|
+
'com.labre.note.toast.view-in-toc',
|
|
177
|
+
'View in Toc',
|
|
178
|
+
];
|
|
179
|
+
export const NOTE_TOOLBAR_DISPLAY_IN_PAGE = [
|
|
180
|
+
'com.labre.note.toolbar.display-in-page',
|
|
181
|
+
'Display in Document',
|
|
182
|
+
];
|
|
183
|
+
export const NOTE_TOOLBAR_DISPLAYED_IN_PAGE = [
|
|
184
|
+
'com.labre.note.toolbar.displayed-in-page',
|
|
185
|
+
'Displayed in Document',
|
|
186
|
+
];
|
|
187
|
+
export const NOTE_TOOLBAR_REMOVE_FROM_PAGE_TOOLTIP = [
|
|
188
|
+
'com.labre.note.toolbar.remove-from-page-tooltip',
|
|
189
|
+
'This note is part of Document Mode. Click to remove it from the document.',
|
|
190
|
+
];
|
|
191
|
+
export const NOTE_TOOLBAR_SLICER = [
|
|
192
|
+
'com.labre.note.toolbar.slicer',
|
|
193
|
+
'Slicer',
|
|
194
|
+
];
|
|
195
|
+
export const NOTE_TOOLBAR_CUTTING_MODE = [
|
|
196
|
+
'com.labre.note.toolbar.cutting-mode',
|
|
197
|
+
'Cutting mode',
|
|
198
|
+
];
|
|
199
|
+
export const NOTE_TOOLBAR_SIZE = [
|
|
200
|
+
'com.labre.note.toolbar.size',
|
|
201
|
+
'Size',
|
|
202
|
+
];
|
|
203
|
+
export const NOTE_TOOLBAR_AUTO_HEIGHT = [
|
|
204
|
+
'com.labre.note.toolbar.auto-height',
|
|
205
|
+
'Auto height',
|
|
206
|
+
];
|
|
207
|
+
export const NOTE_TOOLBAR_CUSTOMIZED_HEIGHT = [
|
|
208
|
+
'com.labre.note.toolbar.customized-height',
|
|
209
|
+
'Customized height',
|
|
210
|
+
];
|
|
211
|
+
/**
|
|
212
|
+
* Every wording DECLARED IN THIS FILE (not re-exported from `chrome.ts`), in
|
|
213
|
+
* declaration order — walked by `PACKAGE_WORDINGS` in
|
|
214
|
+
* `packages/affine/all/src/translations.ts`. The chrome re-exports
|
|
215
|
+
* (`NOTE_MOVE_UP`/`_DOWN`, `NOTE_SHADOW_*` other than `_FLOATING`, and — L7
|
|
216
|
+
* dedupe — `NOTE_TOOLTIP_ITALIC`/`_UNDERLINE`/`_STRIKETHROUGH`,
|
|
217
|
+
* `NOTE_SLASH_FORMAT_BOLD`/`_ITALIC`/`_UNDERLINE`/`_STRIKETHROUGH`,
|
|
218
|
+
* `NOTE_STYLE_FILL_COLOR`, `NOTE_BORDER_STYLE_LABEL`,
|
|
219
|
+
* `NOTE_DISPLAY_MODE_SHOW_IN`/`_BOTH`/`_EDGELESS`/`_PAGE`) are not listed
|
|
220
|
+
* again here, same rule `SLASH_MENU_WORDINGS` already follows for its own
|
|
221
|
+
* chrome aliases.
|
|
222
|
+
*/
|
|
223
|
+
export const NOTE_WORDINGS = [
|
|
224
|
+
NOTE_TOOLTIP_HEADING_1,
|
|
225
|
+
NOTE_TOOLTIP_HEADING_2,
|
|
226
|
+
NOTE_TOOLTIP_HEADING_3,
|
|
227
|
+
NOTE_TOOLTIP_HEADING_4,
|
|
228
|
+
NOTE_TOOLTIP_HEADING_5,
|
|
229
|
+
NOTE_TOOLTIP_HEADING_6,
|
|
230
|
+
NOTE_TOOLTIP_BOLD_TEXT,
|
|
231
|
+
NOTE_OTHER_HEADINGS,
|
|
232
|
+
NOTE_SHADOW_FLOATING,
|
|
233
|
+
NOTE_STYLE_SHADOW_SECTION,
|
|
234
|
+
NOTE_STYLE_BORDER_SECTION,
|
|
235
|
+
NOTE_STYLE_CORNER_RADIUS,
|
|
236
|
+
NOTE_STYLE_BACK,
|
|
237
|
+
NOTE_STYLE_CUSTOM_COLOR,
|
|
238
|
+
NOTE_STYLE_PANEL_LABEL,
|
|
239
|
+
NOTE_DISPLAY_MODE_LABEL,
|
|
240
|
+
NOTE_DISPLAY_MODE_TOOLTIP,
|
|
241
|
+
NOTE_TOAST_DISPLAYED_IN_PAGE_MODE,
|
|
242
|
+
NOTE_TOAST_REMOVED_FROM_PAGE_BODY,
|
|
243
|
+
NOTE_TOAST_ADDED_TO_PAGE_BODY,
|
|
244
|
+
NOTE_TOAST_VIEW_IN_TOC,
|
|
245
|
+
NOTE_TOOLBAR_DISPLAY_IN_PAGE,
|
|
246
|
+
NOTE_TOOLBAR_DISPLAYED_IN_PAGE,
|
|
247
|
+
NOTE_TOOLBAR_REMOVE_FROM_PAGE_TOOLTIP,
|
|
248
|
+
NOTE_TOOLBAR_SLICER,
|
|
249
|
+
NOTE_TOOLBAR_CUTTING_MODE,
|
|
250
|
+
NOTE_TOOLBAR_SIZE,
|
|
251
|
+
NOTE_TOOLBAR_AUTO_HEIGHT,
|
|
252
|
+
NOTE_TOOLBAR_CUSTOMIZED_HEIGHT,
|
|
253
|
+
];
|
|
@@ -36,7 +36,7 @@ import { CaptionedBlockComponent } from '../affine-components/caption/index.js';
|
|
|
36
36
|
import { TOGGLE_BUTTON_PARENT_CLASS } from '../affine-components/toggle-button/index.js';
|
|
37
37
|
import { DefaultInlineManagerExtension } from '../affine-inline-preset/index.js';
|
|
38
38
|
import { BLOCK_CHILDREN_CONTAINER_PADDING_LEFT, EDGELESS_TOP_CONTENTEDITABLE_SELECTOR, } from '../affine-shared/consts/index.js';
|
|
39
|
-
import { BlockCommentManager, CitationProvider, DocModeProvider, } from '../affine-shared/services/index.js';
|
|
39
|
+
import { BlockCommentManager, CitationProvider, DocModeProvider, translateKey, } from '../affine-shared/services/index.js';
|
|
40
40
|
import { calculateCollapsedSiblings, getNearestHeadingBefore, getViewportElement, } from '../affine-shared/utils/index.js';
|
|
41
41
|
import { TextSelection } from '../std/index.js';
|
|
42
42
|
import { getInlineRangeProvider, } from '../std/inline/index.js';
|
|
@@ -48,6 +48,7 @@ import { styleMap } from 'lit/directives/style-map.js';
|
|
|
48
48
|
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
49
49
|
import { ParagraphBlockConfigExtension } from './paragraph-block-config.js';
|
|
50
50
|
import { paragraphBlockStyles } from './styles.js';
|
|
51
|
+
import { PARAGRAPH_PLACEHOLDER_WORDINGS } from './translations.js';
|
|
51
52
|
let ParagraphBlockComponent = (() => {
|
|
52
53
|
let _classSuper = CaptionedBlockComponent;
|
|
53
54
|
let __richTextElement_decorators;
|
|
@@ -95,9 +96,13 @@ let ParagraphBlockComponent = (() => {
|
|
|
95
96
|
}
|
|
96
97
|
static { this.styles = paragraphBlockStyles; }
|
|
97
98
|
get _placeholder() {
|
|
98
|
-
|
|
99
|
+
const raw = this.std
|
|
99
100
|
.get(ParagraphBlockConfigExtension.identifier)
|
|
100
101
|
?.getPlaceholder(this.model);
|
|
102
|
+
if (!raw)
|
|
103
|
+
return raw;
|
|
104
|
+
const wording = PARAGRAPH_PLACEHOLDER_WORDINGS[raw];
|
|
105
|
+
return wording ? translateKey(this.std, ...wording) : raw;
|
|
101
106
|
}
|
|
102
107
|
_setReadonlyCollapsed(collapsed) {
|
|
103
108
|
this._readonlyCollapsed.value = collapsed;
|
|
@@ -1,5 +1,32 @@
|
|
|
1
|
+
import { HEADING_LEVELS, HEADING_SCALE } from '../affine-shared/consts/index.js';
|
|
1
2
|
import { unsafeCSSVarV2 } from '../affine-shared/theme/index.js';
|
|
2
|
-
import { css } from 'lit';
|
|
3
|
+
import { css, unsafeCSS } from 'lit';
|
|
4
|
+
/** Inline code is set this much smaller than the text around it. */
|
|
5
|
+
const INLINE_CODE_SHRINK_PX = 3;
|
|
6
|
+
/**
|
|
7
|
+
* H1…H6, generated from `HEADING_SCALE` so every size, line box and margin has
|
|
8
|
+
* one source. Inline code in a heading stays `INLINE_CODE_SHRINK_PX` below the
|
|
9
|
+
* heading's size; H6, the level closest to body text, keeps the body's code
|
|
10
|
+
* padding (with its 2px bottom).
|
|
11
|
+
*/
|
|
12
|
+
const headingStyles = unsafeCSS(HEADING_LEVELS.map(level => {
|
|
13
|
+
const { fontSize, fontWeight, letterSpacing, lineHeightExtra, marginTop } = HEADING_SCALE[level];
|
|
14
|
+
return `
|
|
15
|
+
.${level} {
|
|
16
|
+
font-size: ${fontSize}px;
|
|
17
|
+
font-weight: ${fontWeight};
|
|
18
|
+
letter-spacing: ${letterSpacing}em;
|
|
19
|
+
line-height: calc(1em + ${lineHeightExtra}px);
|
|
20
|
+
margin-top: ${marginTop}px;
|
|
21
|
+
margin-bottom: 10px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.${level} code {
|
|
25
|
+
font-size: ${fontSize - INLINE_CODE_SHRINK_PX}px;
|
|
26
|
+
padding: ${level === 'h6' ? '0px 4px 2px' : '0px 4px'};
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
}).join(''));
|
|
3
30
|
export const paragraphBlockStyles = css `
|
|
4
31
|
affine-paragraph {
|
|
5
32
|
box-sizing: border-box;
|
|
@@ -21,91 +48,11 @@ export const paragraphBlockStyles = css `
|
|
|
21
48
|
}
|
|
22
49
|
|
|
23
50
|
affine-paragraph code {
|
|
24
|
-
font-size: calc(var(--affine-font-base) -
|
|
51
|
+
font-size: calc(var(--affine-font-base) - ${INLINE_CODE_SHRINK_PX}px);
|
|
25
52
|
padding: 0px 4px 2px;
|
|
26
53
|
}
|
|
27
54
|
|
|
28
|
-
|
|
29
|
-
font-size: var(--affine-font-h-1);
|
|
30
|
-
font-weight: 700;
|
|
31
|
-
letter-spacing: -0.02em;
|
|
32
|
-
line-height: calc(1em + 8px);
|
|
33
|
-
margin-top: 18px;
|
|
34
|
-
margin-bottom: 10px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.h1 code {
|
|
38
|
-
font-size: calc(var(--affine-font-base) + 10px);
|
|
39
|
-
padding: 0px 4px;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.h2 {
|
|
43
|
-
font-size: var(--affine-font-h-2);
|
|
44
|
-
font-weight: 600;
|
|
45
|
-
letter-spacing: -0.02em;
|
|
46
|
-
line-height: calc(1em + 10px);
|
|
47
|
-
margin-top: 14px;
|
|
48
|
-
margin-bottom: 10px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.h2 code {
|
|
52
|
-
font-size: calc(var(--affine-font-base) + 8px);
|
|
53
|
-
padding: 0px 4px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.h3 {
|
|
57
|
-
font-size: var(--affine-font-h-3);
|
|
58
|
-
font-weight: 600;
|
|
59
|
-
letter-spacing: -0.02em;
|
|
60
|
-
line-height: calc(1em + 8px);
|
|
61
|
-
margin-top: 12px;
|
|
62
|
-
margin-bottom: 10px;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.h3 code {
|
|
66
|
-
font-size: calc(var(--affine-font-base) + 6px);
|
|
67
|
-
padding: 0px 4px;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.h4 {
|
|
71
|
-
font-size: var(--affine-font-h-4);
|
|
72
|
-
font-weight: 600;
|
|
73
|
-
letter-spacing: -0.015em;
|
|
74
|
-
line-height: calc(1em + 8px);
|
|
75
|
-
margin-top: 12px;
|
|
76
|
-
margin-bottom: 10px;
|
|
77
|
-
}
|
|
78
|
-
.h4 code {
|
|
79
|
-
font-size: calc(var(--affine-font-base) + 4px);
|
|
80
|
-
padding: 0px 4px;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.h5 {
|
|
84
|
-
font-size: var(--affine-font-h-5);
|
|
85
|
-
font-weight: 600;
|
|
86
|
-
letter-spacing: -0.015em;
|
|
87
|
-
line-height: calc(1em + 8px);
|
|
88
|
-
margin-top: 12px;
|
|
89
|
-
margin-bottom: 10px;
|
|
90
|
-
}
|
|
91
|
-
.h5 code {
|
|
92
|
-
font-size: calc(var(--affine-font-base) + 2px);
|
|
93
|
-
padding: 0px 4px;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.h6 {
|
|
97
|
-
font-size: var(--affine-font-h-6);
|
|
98
|
-
font-weight: 600;
|
|
99
|
-
letter-spacing: -0.015em;
|
|
100
|
-
line-height: calc(1em + 8px);
|
|
101
|
-
margin-top: 12px;
|
|
102
|
-
margin-bottom: 10px;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.h6 code {
|
|
106
|
-
font-size: var(--affine-font-base);
|
|
107
|
-
padding: 0px 4px 2px;
|
|
108
|
-
}
|
|
55
|
+
${headingStyles}
|
|
109
56
|
|
|
110
57
|
.quote {
|
|
111
58
|
line-height: 26px;
|
|
@@ -0,0 +1,31 @@
|
|
|
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 empty-paragraph placeholder (`./view.ts`). The heading placeholders
|
|
5
|
+
* ("Heading 1".."Heading 6") say the exact same words as the gfx/note menu's
|
|
6
|
+
* own block-type names, so they are re-exported from `chrome.ts` rather than
|
|
7
|
+
* declared again.
|
|
8
|
+
*/
|
|
9
|
+
export declare const PARAGRAPH_PLACEHOLDER_H1: ChromeWording;
|
|
10
|
+
export declare const PARAGRAPH_PLACEHOLDER_H2: ChromeWording;
|
|
11
|
+
export declare const PARAGRAPH_PLACEHOLDER_H3: ChromeWording;
|
|
12
|
+
export declare const PARAGRAPH_PLACEHOLDER_H4: ChromeWording;
|
|
13
|
+
export declare const PARAGRAPH_PLACEHOLDER_H5: ChromeWording;
|
|
14
|
+
export declare const PARAGRAPH_PLACEHOLDER_H6: ChromeWording;
|
|
15
|
+
export declare const PARAGRAPH_PLACEHOLDER_TEXT: ChromeWording;
|
|
16
|
+
/**
|
|
17
|
+
* `./paragraph-block.ts` renders whatever `getPlaceholder(model)` returns —
|
|
18
|
+
* a public extension option (`ParagraphBlockConfigExtension`), so its
|
|
19
|
+
* signature stays untouched rather than widened to take `std`. Its DEFAULT
|
|
20
|
+
* implementation still returns the plain English literal (`./view.ts`'s
|
|
21
|
+
* `placeholders` map); this table lets the render site look that literal up
|
|
22
|
+
* and resolve it through the seam, while a host-supplied `getPlaceholder`
|
|
23
|
+
* that returns anything else keeps reading exactly as it did before.
|
|
24
|
+
*/
|
|
25
|
+
export declare const PARAGRAPH_PLACEHOLDER_WORDINGS: Readonly<Record<string, ChromeWording>>;
|
|
26
|
+
/**
|
|
27
|
+
* Every wording DECLARED IN THIS FILE (not re-exported from `chrome.ts`), in
|
|
28
|
+
* declaration order — walked by `PACKAGE_WORDINGS` in
|
|
29
|
+
* `packages/affine/all/src/translations.ts`.
|
|
30
|
+
*/
|
|
31
|
+
export declare const PARAGRAPH_WORDINGS: readonly ChromeWording[];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BLOCK_NAME_HEADING_1, BLOCK_NAME_HEADING_2, BLOCK_NAME_HEADING_3, BLOCK_NAME_HEADING_4, BLOCK_NAME_HEADING_5, BLOCK_NAME_HEADING_6, } from '../affine-shared/services/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* This package's own wordings, declared beside the code that renders them —
|
|
4
|
+
* the empty-paragraph placeholder (`./view.ts`). The heading placeholders
|
|
5
|
+
* ("Heading 1".."Heading 6") say the exact same words as the gfx/note menu's
|
|
6
|
+
* own block-type names, so they are re-exported from `chrome.ts` rather than
|
|
7
|
+
* declared again.
|
|
8
|
+
*/
|
|
9
|
+
export const PARAGRAPH_PLACEHOLDER_H1 = BLOCK_NAME_HEADING_1;
|
|
10
|
+
export const PARAGRAPH_PLACEHOLDER_H2 = BLOCK_NAME_HEADING_2;
|
|
11
|
+
export const PARAGRAPH_PLACEHOLDER_H3 = BLOCK_NAME_HEADING_3;
|
|
12
|
+
export const PARAGRAPH_PLACEHOLDER_H4 = BLOCK_NAME_HEADING_4;
|
|
13
|
+
export const PARAGRAPH_PLACEHOLDER_H5 = BLOCK_NAME_HEADING_5;
|
|
14
|
+
export const PARAGRAPH_PLACEHOLDER_H6 = BLOCK_NAME_HEADING_6;
|
|
15
|
+
export const PARAGRAPH_PLACEHOLDER_TEXT = [
|
|
16
|
+
'com.labre.paragraph.placeholder.text',
|
|
17
|
+
"Type '/' for commands",
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* `./paragraph-block.ts` renders whatever `getPlaceholder(model)` returns —
|
|
21
|
+
* a public extension option (`ParagraphBlockConfigExtension`), so its
|
|
22
|
+
* signature stays untouched rather than widened to take `std`. Its DEFAULT
|
|
23
|
+
* implementation still returns the plain English literal (`./view.ts`'s
|
|
24
|
+
* `placeholders` map); this table lets the render site look that literal up
|
|
25
|
+
* and resolve it through the seam, while a host-supplied `getPlaceholder`
|
|
26
|
+
* that returns anything else keeps reading exactly as it did before.
|
|
27
|
+
*/
|
|
28
|
+
export const PARAGRAPH_PLACEHOLDER_WORDINGS = {
|
|
29
|
+
"Type '/' for commands": PARAGRAPH_PLACEHOLDER_TEXT,
|
|
30
|
+
'Heading 1': PARAGRAPH_PLACEHOLDER_H1,
|
|
31
|
+
'Heading 2': PARAGRAPH_PLACEHOLDER_H2,
|
|
32
|
+
'Heading 3': PARAGRAPH_PLACEHOLDER_H3,
|
|
33
|
+
'Heading 4': PARAGRAPH_PLACEHOLDER_H4,
|
|
34
|
+
'Heading 5': PARAGRAPH_PLACEHOLDER_H5,
|
|
35
|
+
'Heading 6': PARAGRAPH_PLACEHOLDER_H6,
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Every wording DECLARED IN THIS FILE (not re-exported from `chrome.ts`), in
|
|
39
|
+
* declaration order — walked by `PACKAGE_WORDINGS` in
|
|
40
|
+
* `packages/affine/all/src/translations.ts`.
|
|
41
|
+
*/
|
|
42
|
+
export const PARAGRAPH_WORDINGS = [
|
|
43
|
+
PARAGRAPH_PLACEHOLDER_TEXT,
|
|
44
|
+
];
|
|
@@ -19,6 +19,7 @@ export class ParagraphLayoutHandlerExtension extends BlockLayoutHandlerExtension
|
|
|
19
19
|
const { zoom, viewScale } = viewportRecord;
|
|
20
20
|
const paragraph = {
|
|
21
21
|
type: 'affine:paragraph',
|
|
22
|
+
paragraphType: model.props.type,
|
|
22
23
|
sentences: [],
|
|
23
24
|
blockId: model.id,
|
|
24
25
|
rect: { x: 0, y: 0, w: 0, h: 0 },
|
|
@@ -6,6 +6,8 @@ interface SentenceLayout {
|
|
|
6
6
|
}
|
|
7
7
|
export interface ParagraphLayout extends BlockLayout {
|
|
8
8
|
type: 'affine:paragraph';
|
|
9
|
+
/** The paragraph block's own `props.type`: `text`, `quote`, `h1`…`h6`. */
|
|
10
|
+
paragraphType: string;
|
|
9
11
|
sentences: SentenceLayout[];
|
|
10
12
|
}
|
|
11
13
|
export declare const ParagraphLayoutPainterExtension: import("../../store/index.js").ExtensionType;
|
|
@@ -39,12 +39,17 @@ class ParagraphLayoutPainter {
|
|
|
39
39
|
console.warn('Expected paragraph layout but received different format:', layout);
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
+
// Headings are not painted (TODO: fine-tune the baseline for heading
|
|
43
|
+
// sizes). Skipped on the block TYPE, not on the font size: H6 is set at
|
|
44
|
+
// the body's 15px (`HEADING_SCALE`), so a size test would paint it as text.
|
|
45
|
+
if (layout.paragraphType.startsWith('h'))
|
|
46
|
+
return;
|
|
42
47
|
const renderedPositions = new Set();
|
|
43
48
|
layout.sentences.forEach(sentence => {
|
|
44
49
|
const fontSize = sentence.fontSize;
|
|
45
50
|
const baselineY = getBaseline(fontSize);
|
|
46
51
|
if (fontSize !== 15)
|
|
47
|
-
return; //
|
|
52
|
+
return; // the baseline is tuned for body text only
|
|
48
53
|
ctx.font = `${fontSize}px Inter`;
|
|
49
54
|
ctx.strokeStyle = 'yellow';
|
|
50
55
|
sentence.rects.forEach(textRect => {
|
|
@@ -7,8 +7,13 @@ import { effects } from './effects.js';
|
|
|
7
7
|
import { ParagraphMarkdownExtension } from './markdown.js';
|
|
8
8
|
import { ParagraphBlockConfigExtension } from './paragraph-block-config.js';
|
|
9
9
|
import { ParagraphKeymapExtension, ParagraphTextKeymapExtension, } from './paragraph-keymap.js';
|
|
10
|
+
import { PARAGRAPH_PLACEHOLDER_TEXT } from './translations.js';
|
|
11
|
+
// `text` reads its English literal from the wording declared in
|
|
12
|
+
// `./translations.ts` (a property access, not a restated literal) so this map
|
|
13
|
+
// stays the single source of truth `paragraph-block.ts` resolves through the
|
|
14
|
+
// seam, rather than drifting from it.
|
|
10
15
|
const placeholders = {
|
|
11
|
-
text:
|
|
16
|
+
text: PARAGRAPH_PLACEHOLDER_TEXT[1],
|
|
12
17
|
h1: 'Heading 1',
|
|
13
18
|
h2: 'Heading 2',
|
|
14
19
|
h3: 'Heading 3',
|
|
@@ -3,7 +3,7 @@ export declare const builtinToolbarConfig: {
|
|
|
3
3
|
readonly actions: [{
|
|
4
4
|
readonly id: "a.conversions";
|
|
5
5
|
readonly when: ({ chain }: import("../../affine-shared/services/index.js").ToolbarContext) => boolean;
|
|
6
|
-
readonly generate: ({ chain }: import("../../affine-shared/services/index.js").ToolbarContext) => {
|
|
6
|
+
readonly generate: ({ chain, std }: import("../../affine-shared/services/index.js").ToolbarContext) => {
|
|
7
7
|
content: import("lit-html").TemplateResult<1>;
|
|
8
8
|
} | null;
|
|
9
9
|
}, {
|
|
@@ -24,12 +24,14 @@ export declare const builtinToolbarConfig: {
|
|
|
24
24
|
}, {
|
|
25
25
|
readonly id: "e.convert-to-database";
|
|
26
26
|
readonly tooltip: "Create Table";
|
|
27
|
+
readonly tooltipWording: import("../../affine-shared/services/index.js").ChromeWording;
|
|
27
28
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
28
29
|
readonly when: ({ chain }: import("../../affine-shared/services/index.js").ToolbarContext) => boolean;
|
|
29
30
|
readonly run: ({ host }: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|
|
30
31
|
}, {
|
|
31
32
|
readonly id: "f.convert-to-linked-doc";
|
|
32
33
|
readonly tooltip: "Create Linked Doc";
|
|
34
|
+
readonly tooltipWording: import("../../affine-shared/services/index.js").ChromeWording;
|
|
33
35
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
34
36
|
readonly when: ({ chain, std }: import("../../affine-shared/services/index.js").ToolbarContext) => boolean;
|
|
35
37
|
readonly run: ({ chain, store, selection, std, track }: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|