@formicoidea/labre-core 0.32.0 → 0.34.1
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 +3 -3
- package/dist/_pkgs/affine-block-attachment/configs/toolbar.d.ts +2 -2
- package/dist/_pkgs/affine-block-attachment/configs/toolbar.js +9 -7
- package/dist/_pkgs/affine-block-bookmark/configs/toolbar.js +12 -12
- package/dist/_pkgs/affine-block-callout/callout-block.js +1 -1
- package/dist/_pkgs/affine-block-code/code-block-inline.js +1 -1
- package/dist/_pkgs/affine-block-code/code-block.js +2 -2
- package/dist/_pkgs/affine-block-code/code-toolbar/config.js +9 -1
- package/dist/_pkgs/affine-block-code/code-toolbar/index.js +1 -1
- package/dist/_pkgs/affine-block-database/data-source.js +1 -2
- package/dist/_pkgs/affine-block-database/database-block.js +2 -2
- package/dist/_pkgs/affine-block-database/external-data-source.js +1 -1
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-text-block.js +1 -1
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.js +1 -1
- package/dist/_pkgs/affine-block-embed/common/render-linked-doc.js +3 -3
- package/dist/_pkgs/affine-block-embed/configs/toolbar.js +11 -11
- package/dist/_pkgs/affine-block-embed/embed-figma-block/embed-figma-service.js +1 -1
- package/dist/_pkgs/affine-block-embed/embed-html-block/configs/toolbar.js +5 -5
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.d.ts +7 -7
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +14 -14
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +2 -2
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/toolbar.js +10 -10
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-linked-doc-block.js +4 -4
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/utils.js +1 -1
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/components/embed-synced-doc-card.js +5 -4
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/configs/toolbar.js +10 -10
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-synced-doc-block.js +1 -1
- package/dist/_pkgs/affine-block-frame/frame-manager.js +3 -1
- package/dist/_pkgs/affine-block-frame/frame-tool.js +1 -1
- package/dist/_pkgs/affine-block-frame/frame-toolbar.js +2 -2
- package/dist/_pkgs/affine-block-image/components/page-image-block.js +1 -1
- package/dist/_pkgs/affine-block-image/configs/toolbar.js +4 -4
- package/dist/_pkgs/affine-block-image/image-edgeless-block.js +1 -1
- package/dist/_pkgs/affine-block-list/utils/forward-delete.js +1 -1
- package/dist/_pkgs/affine-block-note/commands/select-block.js +1 -1
- package/dist/_pkgs/affine-block-note/commands/select-blocks-between.js +1 -1
- package/dist/_pkgs/affine-block-note/configs/toolbar.js +2 -2
- package/dist/_pkgs/affine-block-note/move-block.js +1 -1
- package/dist/_pkgs/affine-block-paragraph/utils/forward-delete.js +2 -2
- package/dist/_pkgs/affine-block-paragraph/utils/merge-with-prev.js +1 -1
- package/dist/_pkgs/affine-block-root/configs/toolbar.d.ts +6 -4
- package/dist/_pkgs/affine-block-root/configs/toolbar.js +6 -6
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/misc.d.ts +10 -10
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/misc.js +4 -4
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.d.ts +7 -7
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.js +9 -9
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.js +1 -1
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +3 -1
- package/dist/_pkgs/affine-block-root/edgeless/utils/clipboard-utils.js +1 -1
- package/dist/_pkgs/affine-block-surface/adapters/markdown/element-adapter/type.js +1 -1
- package/dist/_pkgs/affine-block-surface/adapters/plain-text/element-adapter/type.js +1 -1
- package/dist/_pkgs/affine-block-surface/element-model/index.d.ts +18 -3
- package/dist/_pkgs/affine-block-surface/element-model/index.js +12 -2
- package/dist/_pkgs/affine-block-surface/extensions/audit.js +23 -6
- package/dist/_pkgs/affine-block-surface/extensions/crud-extension.js +10 -5
- package/dist/_pkgs/affine-block-surface/extensions/editor-anchored-panel.js +2 -1
- package/dist/_pkgs/affine-block-surface/extensions/element-renderer.js +1 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +1 -1
- package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +4 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.js +4 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.d.ts +172 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +404 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +323 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange.js +64 -0
- package/dist/_pkgs/affine-block-surface/extensions/map-quality-widget.js +61 -61
- package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.d.ts +248 -0
- package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.js +248 -0
- package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +78 -80
- package/dist/_pkgs/affine-block-surface/extensions/reading.js +2 -2
- package/dist/_pkgs/affine-block-surface/extensions/spotlight.d.ts +21 -0
- package/dist/_pkgs/affine-block-surface/extensions/spotlight.js +17 -3
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +107 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +958 -0
- package/dist/_pkgs/affine-block-surface/extensions/validation.d.ts +809 -20
- package/dist/_pkgs/affine-block-surface/extensions/validation.js +1661 -50
- package/dist/_pkgs/affine-block-surface/extensions/violation-detail-widget.d.ts +50 -6
- package/dist/_pkgs/affine-block-surface/extensions/violation-detail-widget.js +129 -32
- package/dist/_pkgs/affine-block-surface/framework-background/def.d.ts +289 -0
- package/dist/_pkgs/affine-block-surface/framework-background/def.js +126 -1
- package/dist/_pkgs/affine-block-surface/framework-background/labels.d.ts +42 -2
- package/dist/_pkgs/affine-block-surface/framework-background/labels.js +80 -4
- package/dist/_pkgs/affine-block-surface/framework-background/renderer.js +172 -11
- package/dist/_pkgs/affine-block-surface/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/index.js +1 -0
- package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.d.ts +17 -0
- package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.js +66 -0
- package/dist/_pkgs/affine-block-surface/renderer/overlay.js +1 -1
- package/dist/_pkgs/affine-block-surface/view.js +5 -0
- package/dist/_pkgs/affine-block-surface-ref/configs/toolbar.js +4 -4
- package/dist/_pkgs/affine-block-surface-ref/portal/note.js +2 -2
- package/dist/_pkgs/affine-block-table/commands.js +1 -1
- package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.js +1 -1
- package/dist/_pkgs/affine-components/embed-card-modal/embed-card-edit-modal.js +1 -1
- package/dist/_pkgs/affine-components/filterable-list/styles.js +1 -1
- package/dist/_pkgs/affine-components/highlight-dropdown-menu/highlight-duotone-icon.js +8 -8
- package/dist/_pkgs/affine-components/highlight-dropdown-menu/text-duotone-icon.js +11 -11
- package/dist/_pkgs/affine-components/icons/text.js +426 -426
- package/dist/_pkgs/affine-components/open-doc-dropdown-menu/dropdown-menu.d.ts +2 -0
- package/dist/_pkgs/affine-components/peek/peekable.js +1 -1
- package/dist/_pkgs/affine-components/resource/resource.js +2 -0
- package/dist/_pkgs/affine-components/toolbar/index.d.ts +1 -0
- package/dist/_pkgs/affine-components/toolbar/index.js +1 -0
- package/dist/_pkgs/affine-components/toolbar/menu-button.js +1 -1
- package/dist/_pkgs/affine-components/toolbar/picker-menu.d.ts +55 -0
- package/dist/_pkgs/affine-components/toolbar/picker-menu.js +47 -0
- package/dist/_pkgs/affine-components/view-dropdown-menu/dropdown-menu.js +27 -14
- package/dist/_pkgs/affine-fragment-frame-panel/body/frame-panel-body.js +2 -2
- package/dist/_pkgs/affine-fragment-frame-panel/header/frame-panel-header.js +2 -2
- package/dist/_pkgs/affine-fragment-frame-panel/header/frames-setting-menu.js +1 -1
- package/dist/_pkgs/affine-fragment-outline/mobile-outline-panel.js +1 -1
- package/dist/_pkgs/affine-gfx-brush/toolbar/components/pen/pen-tool-button.js +1 -1
- package/dist/_pkgs/affine-gfx-connector/connector-manager.js +7 -10
- package/dist/_pkgs/affine-gfx-connector/connector-tool.d.ts +19 -1
- package/dist/_pkgs/affine-gfx-connector/connector-tool.js +10 -2
- package/dist/_pkgs/affine-gfx-connector/connector-watcher.js +1 -4
- package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.js +2 -1
- package/dist/_pkgs/affine-gfx-connector/direction/invert-direction.js +1 -3
- package/dist/_pkgs/affine-gfx-connector/element-renderer/index.js +1 -1
- package/dist/_pkgs/affine-gfx-connector/element-renderer/utils.js +1 -1
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/adapter/markdown/index.js +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/adapter/utils.js +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/templates/index.js +583 -4
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-menu.js +23 -23
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-tool-button.js +5 -1
- package/dist/_pkgs/affine-gfx-mindmap/view/utils.js +1 -1
- package/dist/_pkgs/affine-gfx-note/overlay/overlay.js +1 -1
- package/dist/_pkgs/affine-gfx-note/toolbar/note-senior-button.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/consts.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/draggable/shape-draggable.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/element-renderer/shape/polygon.js +17 -9
- package/dist/_pkgs/affine-gfx-shape/element-renderer/shape/utils.js +8 -3
- package/dist/_pkgs/affine-gfx-shape/element-view.js +19 -12
- package/dist/_pkgs/affine-gfx-shape/overlay/polygon-drawing-overlay.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/overlay/polygon-vertex-editing-overlay.js +12 -7
- package/dist/_pkgs/affine-gfx-shape/overlay/shape-overlay.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/polygon-tool.js +4 -2
- package/dist/_pkgs/affine-gfx-shape/shape-tool.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/text/edgeless-shape-text-editor.js +1 -3
- package/dist/_pkgs/affine-gfx-template/builtin/other.js +66 -17
- package/dist/_pkgs/affine-gfx-template/toolbar/overlay-scrollbar.js +1 -1
- package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.js +1 -1
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +1 -1
- package/dist/_pkgs/affine-inline-link/command.js +1 -1
- package/dist/_pkgs/affine-inline-link/link-node/configs/toolbar.d.ts +4 -4
- package/dist/_pkgs/affine-inline-link/link-node/configs/toolbar.js +6 -6
- package/dist/_pkgs/affine-inline-preset/command/format-block.js +1 -1
- package/dist/_pkgs/affine-inline-preset/command/format-native.js +2 -2
- package/dist/_pkgs/affine-inline-preset/command/format-text.js +1 -1
- package/dist/_pkgs/affine-inline-preset/inline-spec.js +1 -1
- package/dist/_pkgs/affine-inline-reference/reference-node/configs/toolbar.d.ts +4 -4
- package/dist/_pkgs/affine-inline-reference/reference-node/configs/toolbar.js +6 -6
- package/dist/_pkgs/affine-inline-reference/reference-node/reference-node.js +1 -1
- package/dist/_pkgs/affine-model/elements/bpmn/node.d.ts +40 -7
- package/dist/_pkgs/affine-model/elements/bpmn/node.js +4 -2
- package/dist/_pkgs/affine-model/elements/bpmn/pool.d.ts +135 -17
- package/dist/_pkgs/affine-model/elements/bpmn/pool.js +148 -26
- package/dist/_pkgs/affine-model/elements/c4/board.d.ts +88 -0
- package/dist/_pkgs/affine-model/elements/c4/board.js +128 -0
- package/dist/_pkgs/affine-model/elements/c4/boundary.d.ts +63 -0
- package/dist/_pkgs/affine-model/elements/c4/boundary.js +134 -0
- package/dist/_pkgs/affine-model/elements/c4/index.d.ts +3 -0
- package/dist/_pkgs/affine-model/elements/c4/index.js +3 -0
- package/dist/_pkgs/affine-model/elements/c4/node.d.ts +97 -0
- package/dist/_pkgs/affine-model/elements/c4/node.js +130 -0
- package/dist/_pkgs/affine-model/elements/connector/connector.js +1 -1
- package/dist/_pkgs/affine-model/elements/context-map/context-map.d.ts +27 -0
- package/dist/_pkgs/affine-model/elements/context-map/context-map.js +94 -0
- package/dist/_pkgs/affine-model/elements/context-map/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/context-map/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/core-domain/core-domain.d.ts +34 -17
- package/dist/_pkgs/affine-model/elements/core-domain/core-domain.js +28 -26
- package/dist/_pkgs/affine-model/elements/cynefin/cynefin.d.ts +7 -2
- package/dist/_pkgs/affine-model/elements/cynefin/cynefin.js +9 -4
- package/dist/_pkgs/affine-model/elements/edgy/board.d.ts +7 -2
- package/dist/_pkgs/affine-model/elements/edgy/board.js +9 -4
- package/dist/_pkgs/affine-model/elements/edgy/facets.d.ts +20 -3
- package/dist/_pkgs/affine-model/elements/edgy/facets.js +13 -4
- package/dist/_pkgs/affine-model/elements/estuarine/estuarine.d.ts +7 -2
- package/dist/_pkgs/affine-model/elements/estuarine/estuarine.js +9 -4
- package/dist/_pkgs/affine-model/elements/event-storming/event-storming.d.ts +36 -0
- package/dist/_pkgs/affine-model/elements/event-storming/event-storming.js +103 -0
- package/dist/_pkgs/affine-model/elements/event-storming/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/event-storming/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/framework-background/background.d.ts +7 -2
- package/dist/_pkgs/affine-model/elements/framework-background/background.js +9 -4
- package/dist/_pkgs/affine-model/elements/framework-background/hit-test.d.ts +48 -0
- package/dist/_pkgs/affine-model/elements/framework-background/hit-test.js +55 -0
- package/dist/_pkgs/affine-model/elements/framework-background/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/framework-background/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/index.d.ts +11 -0
- package/dist/_pkgs/affine-model/elements/index.js +3 -0
- package/dist/_pkgs/affine-model/elements/shape/api/polygon.js +2 -8
- package/dist/_pkgs/affine-shared/adapters/html/block-adapter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/markdown/block-adapter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/markdown/delta-converter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/notion-html/block-adapter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/notion-html/delta-converter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/plain-text/block-adapter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/plain-text/delta-converter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/utils/color.js +5 -2
- package/dist/_pkgs/affine-shared/commands/model-crud/draft-selected-models.js +1 -1
- package/dist/_pkgs/affine-shared/commands/selection/focus-block-end.js +1 -1
- package/dist/_pkgs/affine-shared/commands/selection/focus-block-start.js +1 -1
- package/dist/_pkgs/affine-shared/consts/index.d.ts +10 -0
- package/dist/_pkgs/affine-shared/consts/index.js +10 -0
- package/dist/_pkgs/affine-shared/services/artefact-catalogue-service.d.ts +55 -0
- package/dist/_pkgs/affine-shared/services/artefact-catalogue-service.js +35 -0
- package/dist/_pkgs/affine-shared/services/audit-service.d.ts +11 -0
- package/dist/_pkgs/affine-shared/services/command-usage-service.d.ts +31 -0
- package/dist/_pkgs/affine-shared/services/command-usage-service.js +109 -0
- package/dist/_pkgs/affine-shared/services/comment-service/block-comment-manager.js +1 -1
- package/dist/_pkgs/affine-shared/services/doc-display-meta-service.js +1 -1
- package/dist/_pkgs/affine-shared/services/edit-props-store.d.ts +11 -0
- package/dist/_pkgs/affine-shared/services/edit-props-store.js +15 -0
- package/dist/_pkgs/affine-shared/services/embed-iframe/embed-iframe-config.js +1 -1
- package/dist/_pkgs/affine-shared/services/index.d.ts +2 -0
- package/dist/_pkgs/affine-shared/services/index.js +2 -0
- package/dist/_pkgs/affine-shared/services/pivot-materiality-publisher.js +2 -1
- package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +73 -1
- package/dist/_pkgs/affine-shared/services/toolbar-service/action.d.ts +32 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/action.js +16 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/flags.d.ts +10 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/flags.js +32 -1
- package/dist/_pkgs/affine-shared/services/toolbar-service/registry.d.ts +44 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/registry.js +161 -3
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +106 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +201 -0
- package/dist/_pkgs/affine-shared/services/translation-service/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/services/translation-service/index.js +1 -0
- package/dist/_pkgs/affine-shared/services/universe-tag-defs-service.js +5 -3
- package/dist/_pkgs/affine-shared/test-utils/affine-template.js +1 -1
- package/dist/_pkgs/affine-shared/utils/edgeless.js +1 -1
- package/dist/_pkgs/affine-shared/utils/file/filesys.d.ts +34 -0
- package/dist/_pkgs/affine-shared/utils/file/filesys.js +48 -7
- package/dist/_pkgs/affine-shared/utils/zod-schema.js +1 -3
- package/dist/_pkgs/affine-widget-drag-handle/utils.js +1 -1
- package/dist/_pkgs/affine-widget-edgeless-auto-connect/index.js +1 -1
- package/dist/_pkgs/affine-widget-edgeless-dragging-area/edgeless-dragging-area-rect.js +1 -1
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-default.d.ts +14 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-default.js +40 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.d.ts +158 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +572 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/catalogue-groups.d.ts +41 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/catalogue-groups.js +49 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/chord-format.d.ts +13 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/chord-format.js +50 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/edgeless-toolbar.d.ts +6 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/edgeless-toolbar.js +15 -5
- package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.d.ts +2 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.js +2 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/extension/index.d.ts +7 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/index.d.ts +4 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/index.js +4 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.d.ts +19 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.js +51 -10
- package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +9 -0
- package/dist/_pkgs/affine-widget-keyboard-toolbar/config.js +2 -1
- package/dist/_pkgs/affine-widget-keyboard-toolbar/icons.js +98 -98
- package/dist/_pkgs/affine-widget-keyboard-toolbar/keyboard-tool-panel.js +1 -1
- package/dist/_pkgs/affine-widget-linked-doc/import-doc/import-doc.js +1 -1
- package/dist/_pkgs/affine-widget-linked-doc/linked-doc-popover.js +1 -1
- package/dist/_pkgs/affine-widget-page-dragging-area/index.js +1 -1
- package/dist/_pkgs/affine-widget-remote-selection/doc/doc-remote-selection.js +1 -1
- package/dist/_pkgs/affine-widget-slash-menu/config.js +2 -1
- package/dist/_pkgs/affine-widget-toolbar/toolbar.js +11 -2
- package/dist/_pkgs/affine-widget-toolbar/utils.d.ts +19 -2
- package/dist/_pkgs/affine-widget-toolbar/utils.js +28 -9
- package/dist/_pkgs/data-view/core/group-by/renderer/boolean-group.js +11 -11
- package/dist/_pkgs/data-view/core/utils/menu-title.js +17 -17
- package/dist/_pkgs/data-view/view-presets/calendar/pc/actions.js +8 -12
- package/dist/_pkgs/data-view/view-presets/calendar/pc/view.js +52 -40
- package/dist/_pkgs/data-view/view-presets/table/mobile/group.js +3 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/group.js +3 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/group-title.js +18 -18
- package/dist/_pkgs/std/clipboard/utils.js +4 -1
- package/dist/_pkgs/std/extension/command-registry.d.ts +195 -5
- package/dist/_pkgs/std/extension/command-registry.js +218 -4
- package/dist/_pkgs/std/extension/shortcut.js +2 -1
- package/dist/_pkgs/std/extension/translation-manifest.d.ts +46 -1
- package/dist/_pkgs/std/extension/translation-manifest.js +58 -0
- package/dist/_pkgs/std/gfx/grid.js +1 -1
- package/dist/_pkgs/std/gfx/highlight.d.ts +84 -0
- package/dist/_pkgs/std/gfx/highlight.js +112 -0
- package/dist/_pkgs/std/gfx/index.d.ts +2 -1
- package/dist/_pkgs/std/gfx/index.js +1 -0
- package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.js +17 -3
- package/dist/_pkgs/std/gfx/model/surface/element-model.d.ts +160 -0
- package/dist/_pkgs/std/gfx/model/surface/element-model.js +75 -1
- package/dist/_pkgs/std/gfx/model/surface/role.js +5 -3
- package/dist/_pkgs/std/gfx/model/surface/surface-model.js +2 -1
- package/dist/_pkgs/std/gfx/selection.js +1 -1
- package/dist/_pkgs/std/gfx/viewport.js +1 -1
- package/dist/_pkgs/std/inline/extensions/inline-manager.js +1 -1
- package/dist/_pkgs/std/inline/extensions/markdown-matcher.js +1 -1
- package/dist/_pkgs/std/scope/std-scope.d.ts +2 -1
- package/dist/_pkgs/std/scope/std-scope.js +2 -0
- package/dist/_pkgs/std/utils/gfx.js +2 -0
- package/dist/_pkgs/store/model/store/crud.js +4 -1
- package/dist/commands.js +1 -1
- package/dist/extensions/command-usage.d.ts +23 -0
- package/dist/extensions/command-usage.js +37 -0
- package/dist/extensions/view.js +12 -0
- package/dist/frameworks.js +32 -0
- package/dist/shortcuts.d.ts +20 -6
- package/dist/shortcuts.js +7 -9
- package/dist/translations.js +98 -3
- package/package.json +13 -1
|
@@ -38,8 +38,8 @@ import { Peekable } from '../affine-components/peek/index.js';
|
|
|
38
38
|
import { ResourceController, } from '../affine-components/resource/index.js';
|
|
39
39
|
import { toast } from '../affine-components/toast/index.js';
|
|
40
40
|
import { AttachmentBlockStyles, } from '../affine-model/index.js';
|
|
41
|
-
import { BlockCommentManager, CitationProvider, DocModeProvider, FileSizeLimitProvider, TelemetryProvider, } from '../affine-shared/services/index.js';
|
|
42
|
-
import { formatSize, openSingleFileWith
|
|
41
|
+
import { BlockCommentManager, CitationProvider, DocModeProvider, FileSizeLimitProvider, TelemetryProvider, TOAST_COPIED_TO_CLIPBOARD, translateKey, } from '../affine-shared/services/index.js';
|
|
42
|
+
import { formatSize, openSingleFileWith } from '../affine-shared/utils/index.js';
|
|
43
43
|
import { AttachmentIcon, ResetIcon, UpgradeIcon, WarningIcon, } from '@blocksuite/icons/lit';
|
|
44
44
|
import { BlockSelection } from '../std/index.js';
|
|
45
45
|
import { nanoid, Slice } from '../store/index.js';
|
|
@@ -83,7 +83,7 @@ let AttachmentBlockComponent = (() => {
|
|
|
83
83
|
this.copy = () => {
|
|
84
84
|
const slice = Slice.fromModels(this.store, [this.model]);
|
|
85
85
|
this.std.clipboard.copySlice(slice).catch(console.error);
|
|
86
|
-
toast(this.host,
|
|
86
|
+
toast(this.host, translateKey(this.std, ...TOAST_COPIED_TO_CLIPBOARD));
|
|
87
87
|
};
|
|
88
88
|
this.download = () => {
|
|
89
89
|
downloadAttachmentBlob(this);
|
|
@@ -3,11 +3,11 @@ export declare const attachmentViewDropdownMenu: {
|
|
|
3
3
|
readonly id: "b.conversions";
|
|
4
4
|
readonly actions: [{
|
|
5
5
|
readonly id: "card";
|
|
6
|
-
readonly
|
|
6
|
+
readonly labelWording: import("../../affine-shared/services/index.js").ChromeWording;
|
|
7
7
|
readonly run: (ctx: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|
|
8
8
|
}, {
|
|
9
9
|
readonly id: "embed";
|
|
10
|
-
readonly
|
|
10
|
+
readonly labelWording: import("../../affine-shared/services/index.js").ChromeWording;
|
|
11
11
|
readonly disabled: (ctx: import("../../affine-shared/services/index.js").ToolbarContext) => boolean;
|
|
12
12
|
readonly run: (ctx: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|
|
13
13
|
}];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLitPortal } from '../../affine-components/portal/index.js';
|
|
2
2
|
import { AttachmentBlockModel, defaultAttachmentProps, } from '../../affine-model/index.js';
|
|
3
3
|
import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, } from '../../affine-shared/consts/index.js';
|
|
4
|
-
import { ActionPlacement, blockCommentToolbarButton, ToolbarModuleExtension, } from '../../affine-shared/services/index.js';
|
|
4
|
+
import { ActionPlacement, blockCommentToolbarButton, TOOLBAR_CARD_VIEW, TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, TOOLBAR_EMBED_VIEW, toolbarActionLabel, ToolbarModuleExtension, } from '../../affine-shared/services/index.js';
|
|
5
5
|
import { getBlockProps } from '../../affine-shared/utils/index.js';
|
|
6
6
|
import { Bound } from '../../global/gfx/index.js';
|
|
7
7
|
import { CaptionIcon, CopyIcon, DeleteIcon, DownloadIcon, DuplicateIcon, EditIcon, ReplaceIcon, ResetIcon, } from '@blocksuite/icons/lit';
|
|
@@ -22,7 +22,7 @@ export const attachmentViewDropdownMenu = {
|
|
|
22
22
|
actions: [
|
|
23
23
|
{
|
|
24
24
|
id: 'card',
|
|
25
|
-
|
|
25
|
+
labelWording: TOOLBAR_CARD_VIEW,
|
|
26
26
|
run(ctx) {
|
|
27
27
|
const model = ctx.getCurrentModelByType(AttachmentBlockModel);
|
|
28
28
|
if (!model)
|
|
@@ -42,7 +42,7 @@ export const attachmentViewDropdownMenu = {
|
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
id: 'embed',
|
|
45
|
-
|
|
45
|
+
labelWording: TOOLBAR_EMBED_VIEW,
|
|
46
46
|
disabled: ctx => {
|
|
47
47
|
const block = ctx.getCurrentBlockByType(AttachmentBlockComponent);
|
|
48
48
|
return block ? !block.embedded() : true;
|
|
@@ -92,7 +92,9 @@ export const attachmentViewDropdownMenu = {
|
|
|
92
92
|
const viewType$ = computed(() => {
|
|
93
93
|
const [cardAction, embedAction] = actions.value;
|
|
94
94
|
const embed = model.props.embed$.value ?? false;
|
|
95
|
-
|
|
95
|
+
// Through the seam, like the entries themselves: the dropdown compares
|
|
96
|
+
// this word with the label of each entry to mark the current one.
|
|
97
|
+
return toolbarActionLabel(ctx.std, embed ? embedAction : cardAction);
|
|
96
98
|
});
|
|
97
99
|
const onToggle = (e) => {
|
|
98
100
|
e.stopPropagation();
|
|
@@ -207,7 +209,7 @@ const builtinToolbarConfig = {
|
|
|
207
209
|
actions: [
|
|
208
210
|
{
|
|
209
211
|
id: 'copy',
|
|
210
|
-
|
|
212
|
+
labelWording: TOOLBAR_COPY,
|
|
211
213
|
icon: CopyIcon(),
|
|
212
214
|
run(ctx) {
|
|
213
215
|
// TODO(@fundon): unify `clone` method
|
|
@@ -217,7 +219,7 @@ const builtinToolbarConfig = {
|
|
|
217
219
|
},
|
|
218
220
|
{
|
|
219
221
|
id: 'duplicate',
|
|
220
|
-
|
|
222
|
+
labelWording: TOOLBAR_DUPLICATE,
|
|
221
223
|
icon: DuplicateIcon(),
|
|
222
224
|
run(ctx) {
|
|
223
225
|
const model = ctx.getCurrentModelByType(AttachmentBlockModel);
|
|
@@ -252,7 +254,7 @@ const builtinToolbarConfig = {
|
|
|
252
254
|
{
|
|
253
255
|
placement: ActionPlacement.More,
|
|
254
256
|
id: 'c.delete',
|
|
255
|
-
|
|
257
|
+
labelWording: TOOLBAR_DELETE,
|
|
256
258
|
icon: DeleteIcon(),
|
|
257
259
|
variant: 'destructive',
|
|
258
260
|
run(ctx) {
|
|
@@ -3,7 +3,7 @@ import { reassociateConnectorsCommand } from '../../affine-block-surface/index.j
|
|
|
3
3
|
import { toast } from '../../affine-components/toast/index.js';
|
|
4
4
|
import { BookmarkBlockModel, BookmarkStyles, } from '../../affine-model/index.js';
|
|
5
5
|
import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, } from '../../affine-shared/consts/index.js';
|
|
6
|
-
import { ActionPlacement, blockCommentToolbarButton, EmbedIframeService, EmbedOptionProvider, ToolbarModuleExtension, } from '../../affine-shared/services/index.js';
|
|
6
|
+
import { ActionPlacement, blockCommentToolbarButton, EmbedIframeService, EmbedOptionProvider, TOAST_COPIED_TO_CLIPBOARD, TOOLBAR_CARD_VIEW, TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, TOOLBAR_EMBED_VIEW, TOOLBAR_INLINE_VIEW, toolbarActionLabel, ToolbarModuleExtension, translateKey, } from '../../affine-shared/services/index.js';
|
|
7
7
|
import { getBlockProps } from '../../affine-shared/utils/index.js';
|
|
8
8
|
import { Bound } from '../../global/gfx/index.js';
|
|
9
9
|
import { CaptionIcon, CopyIcon, DeleteIcon, DuplicateIcon, ResetIcon, } from '@blocksuite/icons/lit';
|
|
@@ -59,7 +59,7 @@ const builtinToolbarConfig = {
|
|
|
59
59
|
actions: [
|
|
60
60
|
{
|
|
61
61
|
id: 'inline',
|
|
62
|
-
|
|
62
|
+
labelWording: TOOLBAR_INLINE_VIEW,
|
|
63
63
|
run(ctx) {
|
|
64
64
|
const model = ctx.getCurrentModelByType(BookmarkBlockModel);
|
|
65
65
|
if (!model)
|
|
@@ -86,12 +86,12 @@ const builtinToolbarConfig = {
|
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
id: 'card',
|
|
89
|
-
|
|
89
|
+
labelWording: TOOLBAR_CARD_VIEW,
|
|
90
90
|
disabled: true,
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
id: 'embed',
|
|
94
|
-
|
|
94
|
+
labelWording: TOOLBAR_EMBED_VIEW,
|
|
95
95
|
disabled(ctx) {
|
|
96
96
|
const model = ctx.getCurrentModelByType(BookmarkBlockModel);
|
|
97
97
|
if (!model)
|
|
@@ -153,7 +153,7 @@ const builtinToolbarConfig = {
|
|
|
153
153
|
if (!model)
|
|
154
154
|
return null;
|
|
155
155
|
const actions = this.actions.map(action => ({ ...action }));
|
|
156
|
-
const viewType$ = signal(actions[1]
|
|
156
|
+
const viewType$ = signal(toolbarActionLabel(ctx.std, actions[1]));
|
|
157
157
|
const onToggle = createOnToggleFn(ctx, 'OpenedViewSelector', 'switch view');
|
|
158
158
|
return html `${keyed(model, html `<affine-view-dropdown-menu
|
|
159
159
|
@toggle=${onToggle}
|
|
@@ -210,7 +210,7 @@ const builtinToolbarConfig = {
|
|
|
210
210
|
actions: [
|
|
211
211
|
{
|
|
212
212
|
id: 'copy',
|
|
213
|
-
|
|
213
|
+
labelWording: TOOLBAR_COPY,
|
|
214
214
|
icon: CopyIcon(),
|
|
215
215
|
run(ctx) {
|
|
216
216
|
const model = ctx.getCurrentModelByType(BookmarkBlockModel);
|
|
@@ -219,13 +219,13 @@ const builtinToolbarConfig = {
|
|
|
219
219
|
const slice = Slice.fromModels(ctx.store, [model]);
|
|
220
220
|
ctx.clipboard
|
|
221
221
|
.copySlice(slice)
|
|
222
|
-
.then(() => toast(ctx.host,
|
|
222
|
+
.then(() => toast(ctx.host, translateKey(ctx.std, ...TOAST_COPIED_TO_CLIPBOARD)))
|
|
223
223
|
.catch(console.error);
|
|
224
224
|
},
|
|
225
225
|
},
|
|
226
226
|
{
|
|
227
227
|
id: 'duplicate',
|
|
228
|
-
|
|
228
|
+
labelWording: TOOLBAR_DUPLICATE,
|
|
229
229
|
icon: DuplicateIcon(),
|
|
230
230
|
run(ctx) {
|
|
231
231
|
const model = ctx.getCurrentModelByType(BookmarkBlockModel);
|
|
@@ -252,7 +252,7 @@ const builtinToolbarConfig = {
|
|
|
252
252
|
{
|
|
253
253
|
placement: ActionPlacement.More,
|
|
254
254
|
id: 'c.delete',
|
|
255
|
-
|
|
255
|
+
labelWording: TOOLBAR_DELETE,
|
|
256
256
|
icon: DeleteIcon(),
|
|
257
257
|
variant: 'destructive',
|
|
258
258
|
run(ctx) {
|
|
@@ -275,12 +275,12 @@ const builtinSurfaceToolbarConfig = {
|
|
|
275
275
|
actions: [
|
|
276
276
|
{
|
|
277
277
|
id: 'card',
|
|
278
|
-
|
|
278
|
+
labelWording: TOOLBAR_CARD_VIEW,
|
|
279
279
|
disabled: true,
|
|
280
280
|
},
|
|
281
281
|
{
|
|
282
282
|
id: 'embed',
|
|
283
|
-
|
|
283
|
+
labelWording: TOOLBAR_EMBED_VIEW,
|
|
284
284
|
run(ctx) {
|
|
285
285
|
const model = ctx.getCurrentModelByType(BookmarkBlockModel);
|
|
286
286
|
if (!model)
|
|
@@ -352,7 +352,7 @@ const builtinSurfaceToolbarConfig = {
|
|
|
352
352
|
if (!model)
|
|
353
353
|
return null;
|
|
354
354
|
const actions = this.actions.map(action => ({ ...action }));
|
|
355
|
-
const viewType$ = signal(
|
|
355
|
+
const viewType$ = signal(translateKey(ctx.std, ...TOOLBAR_CARD_VIEW));
|
|
356
356
|
const onToggle = createOnToggleFn(ctx, 'OpenedViewSelector', 'switch view');
|
|
357
357
|
return html `${keyed(model, html `<affine-view-dropdown-menu
|
|
358
358
|
@toggle=${onToggle}
|
|
@@ -38,7 +38,7 @@ import { DefaultInlineManagerExtension } from '../affine-inline-preset/index.js'
|
|
|
38
38
|
import {} from '../affine-model/index.js';
|
|
39
39
|
import { focusTextModel } from '../affine-rich-text/index.js';
|
|
40
40
|
import { EDGELESS_TOP_CONTENTEDITABLE_SELECTOR } from '../affine-shared/consts/index.js';
|
|
41
|
-
import { DocModeProvider, ThemeProvider
|
|
41
|
+
import { DocModeProvider, ThemeProvider } from '../affine-shared/services/index.js';
|
|
42
42
|
import { unsafeCSSVarV2 } from '../affine-shared/theme/index.js';
|
|
43
43
|
import { flip, offset } from '@floating-ui/dom';
|
|
44
44
|
import { css, html } from 'lit';
|
|
@@ -2,7 +2,7 @@ import { CommentInlineSpecExtension } from '../affine-inline-comment/index.js';
|
|
|
2
2
|
import { LatexInlineSpecExtension } from '../affine-inline-latex/index.js';
|
|
3
3
|
import { LinkInlineSpecExtension } from '../affine-inline-link/index.js';
|
|
4
4
|
import { BackgroundInlineSpecExtension, BoldInlineSpecExtension, CodeInlineSpecExtension, ColorInlineSpecExtension, ItalicInlineSpecExtension, StrikeInlineSpecExtension, UnderlineInlineSpecExtension, } from '../affine-inline-preset/index.js';
|
|
5
|
-
import { InlineManagerExtension, InlineSpecExtension
|
|
5
|
+
import { InlineManagerExtension, InlineSpecExtension } from '../std/inline/index.js';
|
|
6
6
|
import { html } from 'lit';
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
export const CodeBlockUnitSpecExtension = InlineSpecExtension({
|
|
@@ -35,7 +35,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
35
35
|
import { CaptionedBlockComponent } from '../affine-components/caption/index.js';
|
|
36
36
|
import { focusTextModel } from '../affine-rich-text/index.js';
|
|
37
37
|
import { BRACKET_PAIRS, EDGELESS_TOP_CONTENTEDITABLE_SELECTOR, } from '../affine-shared/consts/index.js';
|
|
38
|
-
import { BlockCommentManager, DocModeProvider, EditorSettingProvider, NotificationProvider, } from '../affine-shared/services/index.js';
|
|
38
|
+
import { BlockCommentManager, DocModeProvider, EditorSettingProvider, NotificationProvider, TOAST_COPIED_TO_CLIPBOARD, translateKey, } from '../affine-shared/services/index.js';
|
|
39
39
|
import { getViewportElement } from '../affine-shared/utils/index.js';
|
|
40
40
|
import { IS_MAC, IS_MOBILE } from '../global/env/index.js';
|
|
41
41
|
import { noop } from '../global/utils/index.js';
|
|
@@ -386,7 +386,7 @@ let CodeBlockComponent = (() => {
|
|
|
386
386
|
this.std.clipboard
|
|
387
387
|
.copySlice(slice)
|
|
388
388
|
.then(() => {
|
|
389
|
-
this.notificationService?.toast(
|
|
389
|
+
this.notificationService?.toast(translateKey(this.std, ...TOAST_COPIED_TO_CLIPBOARD));
|
|
390
390
|
})
|
|
391
391
|
.catch(e => {
|
|
392
392
|
this.notificationService?.toast('Copied failed, something went wrong');
|
|
@@ -88,7 +88,9 @@ export const PRIMARY_GROUPS = [
|
|
|
88
88
|
blockComponent.setCollapsed(collapsed);
|
|
89
89
|
const std = blockComponent.std;
|
|
90
90
|
const mode = std.getOptional(DocModeProvider)?.getEditorMode() ?? 'page';
|
|
91
|
-
std
|
|
91
|
+
std
|
|
92
|
+
.getOptional(TelemetryProvider)
|
|
93
|
+
?.track('codeBlockToggleCollapse', {
|
|
92
94
|
page: mode,
|
|
93
95
|
segment: 'code block',
|
|
94
96
|
module: 'code toolbar container',
|
|
@@ -261,6 +263,11 @@ export const clipboardGroup = {
|
|
|
261
263
|
items: [
|
|
262
264
|
{
|
|
263
265
|
type: 'duplicate',
|
|
266
|
+
// NOT a `ToolbarAction`: the code block's "⋮" is a `MenuItemGroup`,
|
|
267
|
+
// rendered by `renderGroups` over a context that is generic and carries
|
|
268
|
+
// no `std`, so the wording seam cannot reach it. Left English with the
|
|
269
|
+
// rest of that menu's vocabulary rather than keying two of its five
|
|
270
|
+
// entries — see the changeset.
|
|
264
271
|
label: 'Duplicate',
|
|
265
272
|
icon: DuplicateIcon,
|
|
266
273
|
when: ({ doc }) => !doc.readonly,
|
|
@@ -292,6 +299,7 @@ export const deleteGroup = {
|
|
|
292
299
|
items: [
|
|
293
300
|
{
|
|
294
301
|
type: 'delete',
|
|
302
|
+
// See the note on `duplicate` above.
|
|
295
303
|
label: 'Delete',
|
|
296
304
|
icon: DeleteIcon,
|
|
297
305
|
when: ({ doc }) => !doc.readonly,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HoverController } from '../../affine-components/hover/index.js';
|
|
2
2
|
import { cloneGroups, getMoreMenuConfig, } from '../../affine-components/toolbar/index.js';
|
|
3
|
-
import { BlockSelection, TextSelection, WidgetComponent
|
|
3
|
+
import { BlockSelection, TextSelection, WidgetComponent } from '../../std/index.js';
|
|
4
4
|
import { limitShift, shift, size } from '@floating-ui/dom';
|
|
5
5
|
import { html } from 'lit';
|
|
6
6
|
import { MORE_GROUPS, PRIMARY_GROUPS } from './config.js';
|
|
@@ -116,8 +116,7 @@ export class DatabaseBlockDataSource extends ExternalDataSourceBase {
|
|
|
116
116
|
return [...fixedPropertiesSet, ...properties];
|
|
117
117
|
}
|
|
118
118
|
getPropertyMetas() {
|
|
119
|
-
return DatabaseBlockDataSource.propertiesList
|
|
120
|
-
.value;
|
|
119
|
+
return DatabaseBlockDataSource.propertiesList.value;
|
|
121
120
|
}
|
|
122
121
|
getCellValue(rowId, propertyId) {
|
|
123
122
|
if (this.isSpacialProperty(propertyId)) {
|
|
@@ -4,7 +4,7 @@ import { DropIndicator } from '../affine-components/drop-indicator/index.js';
|
|
|
4
4
|
import { PeekViewProvider } from '../affine-components/peek/index.js';
|
|
5
5
|
import { toast } from '../affine-components/toast/index.js';
|
|
6
6
|
import { EDGELESS_TOP_CONTENTEDITABLE_SELECTOR } from '../affine-shared/consts/index.js';
|
|
7
|
-
import { BlockCommentManager, CommentProviderIdentifier, DocModeProvider, NotificationProvider, TelemetryProvider, } from '../affine-shared/services/index.js';
|
|
7
|
+
import { BlockCommentManager, CommentProviderIdentifier, DocModeProvider, NotificationProvider, TelemetryProvider, TOAST_COPIED_TO_CLIPBOARD, translateKey, } from '../affine-shared/services/index.js';
|
|
8
8
|
import { getDropResult } from '../affine-widget-drag-handle/index.js';
|
|
9
9
|
import { createRecordDetail, createUniComponentFromWebComponent, DataViewRootUILogic, defineUniComponent, ExternalGroupByConfigProvider, renderUniLit, uniMap, } from '../data-view/index.js';
|
|
10
10
|
import { CalendarExternalSourceProvider } from '../data-view/view-presets/index.js';
|
|
@@ -62,7 +62,7 @@ export class DatabaseBlockComponent extends CaptionedBlockComponent {
|
|
|
62
62
|
this.std.clipboard
|
|
63
63
|
.copySlice(slice)
|
|
64
64
|
.then(() => {
|
|
65
|
-
toast(this.host,
|
|
65
|
+
toast(this.host, translateKey(this.std, ...TOAST_COPIED_TO_CLIPBOARD));
|
|
66
66
|
})
|
|
67
67
|
.catch(console.error);
|
|
68
68
|
},
|
|
@@ -3,7 +3,7 @@ import { DataSourceBase, ViewManagerBase, } from '../data-view/index.js';
|
|
|
3
3
|
import { DisposableGroup } from '../global/disposable/index.js';
|
|
4
4
|
import { IS_MOBILE } from '../global/env/index.js';
|
|
5
5
|
import { BlockSuiteError, ErrorCode } from '../global/exceptions/index.js';
|
|
6
|
-
import { computed, signal
|
|
6
|
+
import { computed, signal } from '@preact/signals-core';
|
|
7
7
|
import { deleteView, duplicateView, moveViewTo, updateView, } from './utils/block-utils.js';
|
|
8
8
|
import { databaseBlockViewConverts, databaseBlockViewMap, databaseBlockViews, } from './views/index.js';
|
|
9
9
|
/**
|
|
@@ -39,7 +39,7 @@ import { focusTextModel } from '../affine-rich-text/index.js';
|
|
|
39
39
|
import { ThemeProvider } from '../affine-shared/services/index.js';
|
|
40
40
|
import { handleNativeRangeAtPoint, matchModels, } from '../affine-shared/utils/index.js';
|
|
41
41
|
import { Bound, clamp } from '../global/gfx/index.js';
|
|
42
|
-
import { BlockSelection, GfxBlockComponent, TextSelection
|
|
42
|
+
import { BlockSelection, GfxBlockComponent, TextSelection } from '../std/index.js';
|
|
43
43
|
import { GfxViewInteractionExtension } from '../std/gfx/index.js';
|
|
44
44
|
import { computed } from '@preact/signals-core';
|
|
45
45
|
import { css, html } from 'lit';
|
|
@@ -7,7 +7,7 @@ import { Bound } from '../../global/gfx/index.js';
|
|
|
7
7
|
import { BlockFlavourIdentifier } from '../../std/index.js';
|
|
8
8
|
import { signal } from '@preact/signals-core';
|
|
9
9
|
import { html } from 'lit';
|
|
10
|
-
import { boundForScale, scaleFromSize, sizeFromScale
|
|
10
|
+
import { boundForScale, scaleFromSize, sizeFromScale } from './font-size.js';
|
|
11
11
|
const FONT_SIZE_LIST = [
|
|
12
12
|
{ value: 16 },
|
|
13
13
|
{ value: 24 },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getSurfaceBlock } from '../../affine-block-surface/index.js';
|
|
2
2
|
import { ListBlockModel, NoteBlockModel, NoteDisplayMode, ParagraphBlockModel, } from '../../affine-model/index.js';
|
|
3
|
-
import { NotificationProvider } from '../../affine-shared/services/index.js';
|
|
3
|
+
import { NotificationProvider, TOAST_LINKED_DOC_CREATED, TOOLBAR_CREATE_LINKED_DOC, translateKey, } from '../../affine-shared/services/index.js';
|
|
4
4
|
import { matchModels } from '../../affine-shared/utils/index.js';
|
|
5
5
|
import { Slice, Text, } from '../../store/index.js';
|
|
6
6
|
// Throttle delay for block updates to reduce unnecessary re-renders
|
|
@@ -90,7 +90,7 @@ export function promptDocTitle(std, autofill) {
|
|
|
90
90
|
if (!notification)
|
|
91
91
|
return Promise.resolve(undefined);
|
|
92
92
|
return notification.prompt({
|
|
93
|
-
title:
|
|
93
|
+
title: translateKey(std, ...TOOLBAR_CREATE_LINKED_DOC),
|
|
94
94
|
message: 'Enter a title for the new doc.',
|
|
95
95
|
placeholder: 'Untitled',
|
|
96
96
|
autofill,
|
|
@@ -100,7 +100,7 @@ export function promptDocTitle(std, autofill) {
|
|
|
100
100
|
}
|
|
101
101
|
export function notifyDocCreated(std) {
|
|
102
102
|
std.getOptional(NotificationProvider)?.notifyWithUndoAction({
|
|
103
|
-
title:
|
|
103
|
+
title: translateKey(std, ...TOAST_LINKED_DOC_CREATED),
|
|
104
104
|
message: 'You can click undo to recovery block content',
|
|
105
105
|
accent: 'info',
|
|
106
106
|
duration: 10 * 1000,
|
|
@@ -2,7 +2,7 @@ import { reassociateConnectorsCommand } from '../../affine-block-surface/index.j
|
|
|
2
2
|
import { toast } from '../../affine-components/toast/index.js';
|
|
3
3
|
import { BookmarkStyles, EmbedGithubModel, EmbedGithubStyles, isExternalEmbedModel, } from '../../affine-model/index.js';
|
|
4
4
|
import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, } from '../../affine-shared/consts/index.js';
|
|
5
|
-
import { ActionPlacement, blockCommentToolbarButton, EmbedOptionProvider, ToolbarModuleExtension, } from '../../affine-shared/services/index.js';
|
|
5
|
+
import { ActionPlacement, blockCommentToolbarButton, EmbedOptionProvider, TOAST_COPIED_TO_CLIPBOARD, TOOLBAR_CARD_VIEW, TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, TOOLBAR_EMBED_VIEW, TOOLBAR_INLINE_VIEW, ToolbarModuleExtension, translateKey, } from '../../affine-shared/services/index.js';
|
|
6
6
|
import { getBlockProps } from '../../affine-shared/utils/index.js';
|
|
7
7
|
import { Bound } from '../../global/gfx/index.js';
|
|
8
8
|
import { CaptionIcon, CopyIcon, DeleteIcon, DuplicateIcon, ResetIcon, } from '@blocksuite/icons/lit';
|
|
@@ -46,7 +46,7 @@ function createBuiltinToolbarConfigForExternal(klass) {
|
|
|
46
46
|
actions: [
|
|
47
47
|
{
|
|
48
48
|
id: 'inline',
|
|
49
|
-
|
|
49
|
+
labelWording: TOOLBAR_INLINE_VIEW,
|
|
50
50
|
run(ctx) {
|
|
51
51
|
const model = ctx.getCurrentModel();
|
|
52
52
|
if (!model || !isExternalEmbedModel(model))
|
|
@@ -73,7 +73,7 @@ function createBuiltinToolbarConfigForExternal(klass) {
|
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
id: 'card',
|
|
76
|
-
|
|
76
|
+
labelWording: TOOLBAR_CARD_VIEW,
|
|
77
77
|
disabled(ctx) {
|
|
78
78
|
const model = ctx.getCurrentModel();
|
|
79
79
|
if (!model || !isExternalEmbedModel(model))
|
|
@@ -122,7 +122,7 @@ function createBuiltinToolbarConfigForExternal(klass) {
|
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
id: 'embed',
|
|
125
|
-
|
|
125
|
+
labelWording: TOOLBAR_EMBED_VIEW,
|
|
126
126
|
disabled(ctx) {
|
|
127
127
|
const model = ctx.getCurrentModel();
|
|
128
128
|
if (!model || !isExternalEmbedModel(model))
|
|
@@ -184,7 +184,7 @@ function createBuiltinToolbarConfigForExternal(klass) {
|
|
|
184
184
|
const viewType = ctx.std.get(EmbedOptionProvider).getEmbedBlockOptions(url)
|
|
185
185
|
?.viewType ?? 'card';
|
|
186
186
|
const actions = this.actions.map(action => ({ ...action }));
|
|
187
|
-
const viewType$ = signal(
|
|
187
|
+
const viewType$ = signal(translateKey(ctx.std, ...(viewType === 'card' ? TOOLBAR_CARD_VIEW : TOOLBAR_EMBED_VIEW)));
|
|
188
188
|
const onToggle = createOnToggleFn(ctx, 'OpenedViewSelector', 'switch view');
|
|
189
189
|
return html `${keyed(model, html `<affine-view-dropdown-menu
|
|
190
190
|
@toggle=${onToggle}
|
|
@@ -256,7 +256,7 @@ function createBuiltinToolbarConfigForExternal(klass) {
|
|
|
256
256
|
actions: [
|
|
257
257
|
{
|
|
258
258
|
id: 'copy',
|
|
259
|
-
|
|
259
|
+
labelWording: TOOLBAR_COPY,
|
|
260
260
|
icon: CopyIcon(),
|
|
261
261
|
run(ctx) {
|
|
262
262
|
const model = ctx.getCurrentBlockByType(klass)?.model;
|
|
@@ -265,13 +265,13 @@ function createBuiltinToolbarConfigForExternal(klass) {
|
|
|
265
265
|
const slice = Slice.fromModels(ctx.store, [model]);
|
|
266
266
|
ctx.clipboard
|
|
267
267
|
.copySlice(slice)
|
|
268
|
-
.then(() => toast(ctx.host,
|
|
268
|
+
.then(() => toast(ctx.host, translateKey(ctx.std, ...TOAST_COPIED_TO_CLIPBOARD)))
|
|
269
269
|
.catch(console.error);
|
|
270
270
|
},
|
|
271
271
|
},
|
|
272
272
|
{
|
|
273
273
|
id: 'duplicate',
|
|
274
|
-
|
|
274
|
+
labelWording: TOOLBAR_DUPLICATE,
|
|
275
275
|
icon: DuplicateIcon(),
|
|
276
276
|
run(ctx) {
|
|
277
277
|
const model = ctx.getCurrentBlockByType(klass)?.model;
|
|
@@ -298,7 +298,7 @@ function createBuiltinToolbarConfigForExternal(klass) {
|
|
|
298
298
|
{
|
|
299
299
|
placement: ActionPlacement.More,
|
|
300
300
|
id: 'c.delete',
|
|
301
|
-
|
|
301
|
+
labelWording: TOOLBAR_DELETE,
|
|
302
302
|
icon: DeleteIcon(),
|
|
303
303
|
variant: 'destructive',
|
|
304
304
|
run(ctx) {
|
|
@@ -323,7 +323,7 @@ const createBuiltinSurfaceToolbarConfigForExternal = (klass) => {
|
|
|
323
323
|
actions: [
|
|
324
324
|
{
|
|
325
325
|
id: 'card',
|
|
326
|
-
|
|
326
|
+
labelWording: TOOLBAR_CARD_VIEW,
|
|
327
327
|
run(ctx) {
|
|
328
328
|
const model = ctx.getCurrentBlockByType(klass)?.model;
|
|
329
329
|
if (!model || !isExternalEmbedModel(model))
|
|
@@ -352,7 +352,7 @@ const createBuiltinSurfaceToolbarConfigForExternal = (klass) => {
|
|
|
352
352
|
},
|
|
353
353
|
{
|
|
354
354
|
id: 'embed',
|
|
355
|
-
|
|
355
|
+
labelWording: TOOLBAR_EMBED_VIEW,
|
|
356
356
|
disabled: true,
|
|
357
357
|
},
|
|
358
358
|
],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EmbedFigmaBlockSchema, EmbedFigmaStyles
|
|
1
|
+
import { EmbedFigmaBlockSchema, EmbedFigmaStyles } from '../../affine-model/index.js';
|
|
2
2
|
import { EmbedOptionConfig } from '../../affine-shared/services/index.js';
|
|
3
3
|
import { figmaUrlRegex } from './embed-figma-model.js';
|
|
4
4
|
export const EmbedFigmaBlockOptionConfig = EmbedOptionConfig({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toast } from '../../../affine-components/toast/index.js';
|
|
2
2
|
import { EmbedHtmlModel } from '../../../affine-model/index.js';
|
|
3
|
-
import { ActionPlacement, ToolbarModuleExtension, } from '../../../affine-shared/services/index.js';
|
|
3
|
+
import { ActionPlacement, TOAST_COPIED_TO_CLIPBOARD, TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, ToolbarModuleExtension, translateKey, } from '../../../affine-shared/services/index.js';
|
|
4
4
|
import { getBlockProps } from '../../../affine-shared/utils/index.js';
|
|
5
5
|
import { CaptionIcon, CopyIcon, DeleteIcon, DuplicateIcon, ExpandFullIcon, } from '@blocksuite/icons/lit';
|
|
6
6
|
import { BlockFlavourIdentifier } from '../../../std/index.js';
|
|
@@ -89,7 +89,7 @@ const builtinToolbarConfig = {
|
|
|
89
89
|
actions: [
|
|
90
90
|
{
|
|
91
91
|
id: 'copy',
|
|
92
|
-
|
|
92
|
+
labelWording: TOOLBAR_COPY,
|
|
93
93
|
icon: CopyIcon(),
|
|
94
94
|
run(ctx) {
|
|
95
95
|
const model = ctx.getCurrentModelByType(EmbedHtmlModel);
|
|
@@ -98,13 +98,13 @@ const builtinToolbarConfig = {
|
|
|
98
98
|
const slice = Slice.fromModels(ctx.store, [model]);
|
|
99
99
|
ctx.clipboard
|
|
100
100
|
.copySlice(slice)
|
|
101
|
-
.then(() => toast(ctx.host,
|
|
101
|
+
.then(() => toast(ctx.host, translateKey(ctx.std, ...TOAST_COPIED_TO_CLIPBOARD)))
|
|
102
102
|
.catch(console.error);
|
|
103
103
|
},
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
106
|
id: 'duplicate',
|
|
107
|
-
|
|
107
|
+
labelWording: TOOLBAR_DUPLICATE,
|
|
108
108
|
icon: DuplicateIcon(),
|
|
109
109
|
run(ctx) {
|
|
110
110
|
const model = ctx.getCurrentModelByType(EmbedHtmlModel);
|
|
@@ -121,7 +121,7 @@ const builtinToolbarConfig = {
|
|
|
121
121
|
{
|
|
122
122
|
placement: ActionPlacement.More,
|
|
123
123
|
id: 'c.delete',
|
|
124
|
-
|
|
124
|
+
labelWording: TOOLBAR_DELETE,
|
|
125
125
|
icon: DeleteIcon(),
|
|
126
126
|
variant: 'destructive',
|
|
127
127
|
run(ctx) {
|
|
@@ -6,12 +6,12 @@ export declare const builtinToolbarConfig: {
|
|
|
6
6
|
when: (ctx: ToolbarContext) => boolean;
|
|
7
7
|
actions: ({
|
|
8
8
|
id: string;
|
|
9
|
-
|
|
9
|
+
labelWording: import("../../../affine-shared/services/index.js").ChromeWording;
|
|
10
10
|
run(ctx: ToolbarContext): void;
|
|
11
11
|
disabled?: undefined;
|
|
12
12
|
} | {
|
|
13
13
|
id: string;
|
|
14
|
-
|
|
14
|
+
labelWording: import("../../../affine-shared/services/index.js").ChromeWording;
|
|
15
15
|
disabled: true;
|
|
16
16
|
run?: undefined;
|
|
17
17
|
})[];
|
|
@@ -26,12 +26,12 @@ export declare const builtinToolbarConfig: {
|
|
|
26
26
|
readonly id: "a.clipboard";
|
|
27
27
|
readonly actions: [{
|
|
28
28
|
readonly id: "copy";
|
|
29
|
-
readonly
|
|
29
|
+
readonly labelWording: import("../../../affine-shared/services/index.js").ChromeWording;
|
|
30
30
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
31
31
|
readonly run: (ctx: ToolbarContext) => void;
|
|
32
32
|
}, {
|
|
33
33
|
readonly id: "duplicate";
|
|
34
|
-
readonly
|
|
34
|
+
readonly labelWording: import("../../../affine-shared/services/index.js").ChromeWording;
|
|
35
35
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
36
36
|
readonly run: (ctx: ToolbarContext) => void;
|
|
37
37
|
}];
|
|
@@ -44,7 +44,7 @@ export declare const builtinToolbarConfig: {
|
|
|
44
44
|
}, {
|
|
45
45
|
readonly placement: ActionPlacement.More;
|
|
46
46
|
readonly id: "c.delete";
|
|
47
|
-
readonly
|
|
47
|
+
readonly labelWording: import("../../../affine-shared/services/index.js").ChromeWording;
|
|
48
48
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
49
49
|
readonly variant: "destructive";
|
|
50
50
|
readonly run: (ctx: ToolbarContext) => void;
|
|
@@ -56,12 +56,12 @@ export declare const builtinSurfaceToolbarConfig: {
|
|
|
56
56
|
when: (ctx: ToolbarContext) => boolean;
|
|
57
57
|
actions: ({
|
|
58
58
|
id: string;
|
|
59
|
-
|
|
59
|
+
labelWording: import("../../../affine-shared/services/index.js").ChromeWording;
|
|
60
60
|
run(ctx: ToolbarContext): void;
|
|
61
61
|
disabled?: undefined;
|
|
62
62
|
} | {
|
|
63
63
|
id: string;
|
|
64
|
-
|
|
64
|
+
labelWording: import("../../../affine-shared/services/index.js").ChromeWording;
|
|
65
65
|
disabled: true;
|
|
66
66
|
run?: undefined;
|
|
67
67
|
})[];
|