@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
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { reassociateConnectorsCommand } from '../../../affine-block-surface/index.js';
|
|
2
2
|
import { toast } from '../../../affine-components/toast/index.js';
|
|
3
|
-
import { BookmarkStyles, EmbedIframeBlockModel
|
|
3
|
+
import { BookmarkStyles, EmbedIframeBlockModel } from '../../../affine-model/index.js';
|
|
4
4
|
import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, } from '../../../affine-shared/consts/index.js';
|
|
5
|
-
import { ActionPlacement, ToolbarModuleExtension, } from '../../../affine-shared/services/index.js';
|
|
5
|
+
import { ActionPlacement, 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';
|
|
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, LinkedPageIcon, OpenInNewIcon, ResetIcon, } from '@blocksuite/icons/lit';
|
|
9
9
|
import { BlockFlavourIdentifier, BlockSelection } from '../../../std/index.js';
|
|
10
|
-
import { Slice, Text, toDraftModel
|
|
10
|
+
import { Slice, Text, toDraftModel } from '../../../store/index.js';
|
|
11
11
|
import { computed, signal } from '@preact/signals-core';
|
|
12
12
|
import { html } from 'lit';
|
|
13
13
|
import { keyed } from 'lit/directives/keyed.js';
|
|
@@ -64,7 +64,7 @@ export const builtinToolbarConfig = {
|
|
|
64
64
|
actions: [
|
|
65
65
|
{
|
|
66
66
|
id: 'inline',
|
|
67
|
-
|
|
67
|
+
labelWording: TOOLBAR_INLINE_VIEW,
|
|
68
68
|
run(ctx) {
|
|
69
69
|
const model = ctx.getCurrentModelByType(EmbedIframeBlockModel);
|
|
70
70
|
if (!model)
|
|
@@ -93,7 +93,7 @@ export const builtinToolbarConfig = {
|
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
id: 'card',
|
|
96
|
-
|
|
96
|
+
labelWording: TOOLBAR_CARD_VIEW,
|
|
97
97
|
run(ctx) {
|
|
98
98
|
const model = ctx.getCurrentModelByType(EmbedIframeBlockModel);
|
|
99
99
|
if (!model)
|
|
@@ -121,7 +121,7 @@ export const builtinToolbarConfig = {
|
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
id: 'embed',
|
|
124
|
-
|
|
124
|
+
labelWording: TOOLBAR_EMBED_VIEW,
|
|
125
125
|
disabled: true,
|
|
126
126
|
},
|
|
127
127
|
],
|
|
@@ -143,7 +143,7 @@ export const builtinToolbarConfig = {
|
|
|
143
143
|
.actions=${actions}
|
|
144
144
|
.context=${ctx}
|
|
145
145
|
.toggle=${toggle}
|
|
146
|
-
.viewType$=${signal(actions[2]
|
|
146
|
+
.viewType$=${signal(toolbarActionLabel(ctx.std, actions[2]))}
|
|
147
147
|
></affine-view-dropdown-menu>`)}`;
|
|
148
148
|
},
|
|
149
149
|
},
|
|
@@ -190,7 +190,7 @@ export const builtinToolbarConfig = {
|
|
|
190
190
|
actions: [
|
|
191
191
|
{
|
|
192
192
|
id: 'copy',
|
|
193
|
-
|
|
193
|
+
labelWording: TOOLBAR_COPY,
|
|
194
194
|
icon: CopyIcon(),
|
|
195
195
|
run(ctx) {
|
|
196
196
|
const model = ctx.getCurrentModelByType(EmbedIframeBlockModel);
|
|
@@ -199,7 +199,7 @@ export const builtinToolbarConfig = {
|
|
|
199
199
|
const slice = Slice.fromModels(ctx.store, [model]);
|
|
200
200
|
ctx.clipboard
|
|
201
201
|
.copySlice(slice)
|
|
202
|
-
.then(() => toast(ctx.host,
|
|
202
|
+
.then(() => toast(ctx.host, translateKey(ctx.std, ...TOAST_COPIED_TO_CLIPBOARD)))
|
|
203
203
|
.catch(console.error);
|
|
204
204
|
ctx.track('CopiedLink', {
|
|
205
205
|
...trackBaseProps,
|
|
@@ -209,7 +209,7 @@ export const builtinToolbarConfig = {
|
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
211
|
id: 'duplicate',
|
|
212
|
-
|
|
212
|
+
labelWording: TOOLBAR_DUPLICATE,
|
|
213
213
|
icon: DuplicateIcon(),
|
|
214
214
|
run(ctx) {
|
|
215
215
|
const model = ctx.getCurrentModelByType(EmbedIframeBlockModel);
|
|
@@ -248,7 +248,7 @@ export const builtinToolbarConfig = {
|
|
|
248
248
|
{
|
|
249
249
|
placement: ActionPlacement.More,
|
|
250
250
|
id: 'c.delete',
|
|
251
|
-
|
|
251
|
+
labelWording: TOOLBAR_DELETE,
|
|
252
252
|
icon: DeleteIcon(),
|
|
253
253
|
variant: 'destructive',
|
|
254
254
|
run(ctx) {
|
|
@@ -272,7 +272,7 @@ export const builtinSurfaceToolbarConfig = {
|
|
|
272
272
|
actions: [
|
|
273
273
|
{
|
|
274
274
|
id: 'card',
|
|
275
|
-
|
|
275
|
+
labelWording: TOOLBAR_CARD_VIEW,
|
|
276
276
|
run(ctx) {
|
|
277
277
|
const model = ctx.getCurrentModelByType(EmbedIframeBlockModel);
|
|
278
278
|
if (!model)
|
|
@@ -301,7 +301,7 @@ export const builtinSurfaceToolbarConfig = {
|
|
|
301
301
|
},
|
|
302
302
|
{
|
|
303
303
|
id: 'embed',
|
|
304
|
-
|
|
304
|
+
labelWording: TOOLBAR_EMBED_VIEW,
|
|
305
305
|
disabled: true,
|
|
306
306
|
},
|
|
307
307
|
],
|
|
@@ -322,7 +322,7 @@ export const builtinSurfaceToolbarConfig = {
|
|
|
322
322
|
@toggle=${onToggle}
|
|
323
323
|
.actions=${actions}
|
|
324
324
|
.context=${ctx}
|
|
325
|
-
.viewType$=${signal(actions[1]
|
|
325
|
+
.viewType$=${signal(toolbarActionLabel(ctx.std, actions[1]))}
|
|
326
326
|
></affine-view-dropdown-menu>`)}`;
|
|
327
327
|
},
|
|
328
328
|
},
|
|
@@ -35,7 +35,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
35
35
|
import { SurfaceBlockModel } from '../../affine-block-surface/index.js';
|
|
36
36
|
import { CaptionedBlockComponent, SelectedStyle, } from '../../affine-components/caption/index.js';
|
|
37
37
|
import { createLitPortal } from '../../affine-components/portal/index.js';
|
|
38
|
-
import { EmbedIframeService, LinkPreviewServiceIdentifier, NotificationProvider, } from '../../affine-shared/services/index.js';
|
|
38
|
+
import { EmbedIframeService, LinkPreviewServiceIdentifier, NotificationProvider, TOAST_NO_LINK_FOUND, translateKey, } from '../../affine-shared/services/index.js';
|
|
39
39
|
import { matchModels } from '../../affine-shared/utils/index.js';
|
|
40
40
|
import { BlockSuiteError, ErrorCode } from '../../global/exceptions/index.js';
|
|
41
41
|
import { BlockSelection } from '../../std/index.js';
|
|
@@ -222,7 +222,7 @@ let EmbedIframeBlockComponent = (() => {
|
|
|
222
222
|
const link = this.model.props.url;
|
|
223
223
|
if (!link) {
|
|
224
224
|
this.notificationService?.notify({
|
|
225
|
-
title:
|
|
225
|
+
title: translateKey(this.std, ...TOAST_NO_LINK_FOUND),
|
|
226
226
|
message: 'Please set a link to the block',
|
|
227
227
|
accent: 'warning',
|
|
228
228
|
onClose: function () { },
|
|
@@ -2,8 +2,8 @@ import { toast } from '../../../affine-components/toast/index.js';
|
|
|
2
2
|
import { EditorChevronDown } from '../../../affine-components/toolbar/index.js';
|
|
3
3
|
import { EmbedLinkedDocModel, EmbedLinkedDocStyles, } from '../../../affine-model/index.js';
|
|
4
4
|
import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, } from '../../../affine-shared/consts/index.js';
|
|
5
|
-
import { ActionPlacement, blockCommentToolbarButton, DocDisplayMetaProvider, EditorSettingProvider, ToolbarModuleExtension, } from '../../../affine-shared/services/index.js';
|
|
6
|
-
import { getBlockProps, referenceToNode
|
|
5
|
+
import { ActionPlacement, blockCommentToolbarButton, DocDisplayMetaProvider, EditorSettingProvider, 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
|
+
import { getBlockProps, referenceToNode } from '../../../affine-shared/utils/index.js';
|
|
7
7
|
import { Bound } from '../../../global/gfx/index.js';
|
|
8
8
|
import { CaptionIcon, CopyIcon, DeleteIcon, DuplicateIcon, ExpandFullIcon, OpenInNewIcon, } from '@blocksuite/icons/lit';
|
|
9
9
|
import { BlockFlavourIdentifier, isGfxBlockComponent } from '../../../std/index.js';
|
|
@@ -112,7 +112,7 @@ const conversionsActionGroup = {
|
|
|
112
112
|
actions: [
|
|
113
113
|
{
|
|
114
114
|
id: 'inline',
|
|
115
|
-
|
|
115
|
+
labelWording: TOOLBAR_INLINE_VIEW,
|
|
116
116
|
run(ctx) {
|
|
117
117
|
const block = ctx.getCurrentBlockByType(EmbedLinkedDocBlockComponent);
|
|
118
118
|
block?.convertToInline();
|
|
@@ -129,12 +129,12 @@ const conversionsActionGroup = {
|
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
id: 'card',
|
|
132
|
-
|
|
132
|
+
labelWording: TOOLBAR_CARD_VIEW,
|
|
133
133
|
disabled: true,
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
136
|
id: 'embed',
|
|
137
|
-
|
|
137
|
+
labelWording: TOOLBAR_EMBED_VIEW,
|
|
138
138
|
disabled(ctx) {
|
|
139
139
|
const block = ctx.getCurrentBlockByType(EmbedLinkedDocBlockComponent);
|
|
140
140
|
if (!block)
|
|
@@ -170,7 +170,7 @@ const conversionsActionGroup = {
|
|
|
170
170
|
if (!model)
|
|
171
171
|
return null;
|
|
172
172
|
const actions = this.actions.map(action => ({ ...action }));
|
|
173
|
-
const viewType$ = signal(
|
|
173
|
+
const viewType$ = signal(translateKey(ctx.std, ...TOOLBAR_CARD_VIEW));
|
|
174
174
|
const onToggle = createOnToggleFn(ctx, 'OpenedViewSelector', 'switch view');
|
|
175
175
|
return html `${keyed(model, html `<affine-view-dropdown-menu
|
|
176
176
|
@toggle=${onToggle}
|
|
@@ -231,7 +231,7 @@ const builtinToolbarConfig = {
|
|
|
231
231
|
actions: [
|
|
232
232
|
{
|
|
233
233
|
id: 'copy',
|
|
234
|
-
|
|
234
|
+
labelWording: TOOLBAR_COPY,
|
|
235
235
|
icon: CopyIcon(),
|
|
236
236
|
run(ctx) {
|
|
237
237
|
const model = ctx.getCurrentModelByType(EmbedLinkedDocModel);
|
|
@@ -240,13 +240,13 @@ const builtinToolbarConfig = {
|
|
|
240
240
|
const slice = Slice.fromModels(ctx.store, [model]);
|
|
241
241
|
ctx.clipboard
|
|
242
242
|
.copySlice(slice)
|
|
243
|
-
.then(() => toast(ctx.host,
|
|
243
|
+
.then(() => toast(ctx.host, translateKey(ctx.std, ...TOAST_COPIED_TO_CLIPBOARD)))
|
|
244
244
|
.catch(console.error);
|
|
245
245
|
},
|
|
246
246
|
},
|
|
247
247
|
{
|
|
248
248
|
id: 'duplicate',
|
|
249
|
-
|
|
249
|
+
labelWording: TOOLBAR_DUPLICATE,
|
|
250
250
|
icon: DuplicateIcon(),
|
|
251
251
|
run(ctx) {
|
|
252
252
|
const model = ctx.getCurrentModelByType(EmbedLinkedDocModel);
|
|
@@ -263,7 +263,7 @@ const builtinToolbarConfig = {
|
|
|
263
263
|
{
|
|
264
264
|
placement: ActionPlacement.More,
|
|
265
265
|
id: 'c.delete',
|
|
266
|
-
|
|
266
|
+
labelWording: TOOLBAR_DELETE,
|
|
267
267
|
icon: DeleteIcon(),
|
|
268
268
|
variant: 'destructive',
|
|
269
269
|
run(ctx) {
|
|
@@ -38,7 +38,7 @@ import { LoadingIcon } from '../../affine-components/icons/index.js';
|
|
|
38
38
|
import { isPeekable, Peekable } from '../../affine-components/peek/index.js';
|
|
39
39
|
import { RefNodeSlotsProvider } from '../../affine-inline-reference/index.js';
|
|
40
40
|
import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, REFERENCE_NODE, } from '../../affine-shared/consts/index.js';
|
|
41
|
-
import { CitationProvider, DocDisplayMetaProvider, DocModeProvider, OpenDocExtensionIdentifier, ThemeProvider, whenLinkedDocContentReady, } from '../../affine-shared/services/index.js';
|
|
41
|
+
import { CitationProvider, DocDisplayMetaProvider, DocModeProvider, LINKED_DOC_DELETED, LINKED_DOC_EMPTY_PREVIEW, LINKED_DOC_FAILED, OpenDocExtensionIdentifier, ThemeProvider, translateKey, whenLinkedDocContentReady, } from '../../affine-shared/services/index.js';
|
|
42
42
|
import { cloneReferenceInfo, cloneReferenceInfoWithoutAliases, isNewTabTrigger, isNewViewTrigger, matchModels, referenceToNode, } from '../../affine-shared/utils/index.js';
|
|
43
43
|
import { Bound } from '../../global/gfx/index.js';
|
|
44
44
|
import { ResetIcon } from '@blocksuite/icons/lit';
|
|
@@ -468,13 +468,13 @@ let EmbedLinkedDocBlockComponent = (() => {
|
|
|
468
468
|
const description = this.model.props.description$;
|
|
469
469
|
const showDefaultNoteContent = isError || isLoading || isDeleted || isEmpty;
|
|
470
470
|
const defaultNoteContent = isError
|
|
471
|
-
?
|
|
471
|
+
? translateKey(this.std, ...LINKED_DOC_FAILED)
|
|
472
472
|
: isLoading
|
|
473
473
|
? ''
|
|
474
474
|
: isDeleted
|
|
475
|
-
?
|
|
475
|
+
? translateKey(this.std, ...LINKED_DOC_DELETED)
|
|
476
476
|
: isEmpty
|
|
477
|
-
?
|
|
477
|
+
? translateKey(this.std, ...LINKED_DOC_EMPTY_PREVIEW)
|
|
478
478
|
: '';
|
|
479
479
|
const dateText = this._cardStyle === 'cube'
|
|
480
480
|
? this._docUpdatedAt.toLocaleTimeString()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EmbedEdgelessIcon, EmbedPageIcon, } from '../../affine-components/icons/index.js';
|
|
2
|
-
import { ColorScheme
|
|
2
|
+
import { ColorScheme } from '../../affine-model/index.js';
|
|
3
3
|
import { DarkSyncedDocErrorBanner, LightSyncedDocErrorBanner, } from '../embed-synced-doc-block/styles.js';
|
|
4
4
|
import { DarkLinkedEdgelessDeletedLargeBanner, DarkLinkedEdgelessDeletedSmallBanner, DarkLinkedEdgelessEmptyLargeBanner, DarkLinkedEdgelessEmptySmallBanner, DarkLinkedPageDeletedLargeBanner, DarkLinkedPageDeletedSmallBanner, DarkLinkedPageEmptyLargeBanner, DarkLinkedPageEmptySmallBanner, LightLinkedEdgelessDeletedLargeBanner, LightLinkedEdgelessDeletedSmallBanner, LightLinkedEdgelessEmptyLargeBanner, LightLinkedEdgelessEmptySmallBanner, LightLinkedPageDeletedLargeBanner, LightLinkedPageDeletedSmallBanner, LightLinkedPageEmptyLargeBanner, LightLinkedPageEmptySmallBanner, LinkedDocDeletedIcon, } from './styles.js';
|
|
5
5
|
export function getEmbedLinkedDocIcons(theme, editorMode, style) {
|
package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/components/embed-synced-doc-card.js
CHANGED
|
@@ -34,7 +34,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
34
34
|
};
|
|
35
35
|
import { RENDER_CARD_THROTTLE_MS } from '../../../affine-block-embed/index.js';
|
|
36
36
|
import { LoadingIcon } from '../../../affine-components/icons/index.js';
|
|
37
|
-
import { ThemeProvider, whenLinkedDocContentReady, } from '../../../affine-shared/services/index.js';
|
|
37
|
+
import { LINKED_DOC_DELETED, LINKED_DOC_FAILED, SYNCED_DOC_EMPTY_PREVIEW, ThemeProvider, translateKey, whenLinkedDocContentReady, } from '../../../affine-shared/services/index.js';
|
|
38
38
|
import { WithDisposable } from '../../../global/lit/index.js';
|
|
39
39
|
import { ResetIcon } from '@blocksuite/icons/lit';
|
|
40
40
|
import { BlockSelection, isGfxBlockComponent, ShadowlessElement, } from '../../../std/index.js';
|
|
@@ -184,14 +184,15 @@ let EmbedSyncedDocCard = (() => {
|
|
|
184
184
|
: this.block.icon$.value;
|
|
185
185
|
const title = isLoading ? 'Loading...' : this.block.title$;
|
|
186
186
|
const showDefaultNoteContent = isLoading || error || isDeleted || isEmpty;
|
|
187
|
+
const std = this.block.std;
|
|
187
188
|
const defaultNoteContent = error
|
|
188
|
-
?
|
|
189
|
+
? translateKey(std, ...LINKED_DOC_FAILED)
|
|
189
190
|
: isLoading
|
|
190
191
|
? ''
|
|
191
192
|
: isDeleted
|
|
192
|
-
?
|
|
193
|
+
? translateKey(std, ...LINKED_DOC_DELETED)
|
|
193
194
|
: isEmpty
|
|
194
|
-
?
|
|
195
|
+
? translateKey(std, ...SYNCED_DOC_EMPTY_PREVIEW)
|
|
195
196
|
: '';
|
|
196
197
|
const dateText = this.block.docUpdatedAt.toLocaleString();
|
|
197
198
|
const showDefaultBanner = isLoading || error || isDeleted || isEmpty;
|
|
@@ -3,12 +3,12 @@ import { EditorChevronDown } from '../../../affine-components/toolbar/index.js';
|
|
|
3
3
|
import { DEFAULT_NOTE_HEIGHT, DEFAULT_NOTE_WIDTH, EmbedSyncedDocModel, NoteBlockModel, NoteDisplayMode, } from '../../../affine-model/index.js';
|
|
4
4
|
import { draftSelectedModelsCommand, duplicateSelectedModelsCommand, } from '../../../affine-shared/commands/index.js';
|
|
5
5
|
import { REFERENCE_NODE } from '../../../affine-shared/consts/index.js';
|
|
6
|
-
import { ActionPlacement, blockCommentToolbarButton, EditorSettingProvider, ToolbarModuleExtension, } from '../../../affine-shared/services/index.js';
|
|
6
|
+
import { ActionPlacement, blockCommentToolbarButton, EditorSettingProvider, 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';
|
|
7
7
|
import { getBlockProps, matchModels } from '../../../affine-shared/utils/index.js';
|
|
8
8
|
import { Bound } from '../../../global/gfx/index.js';
|
|
9
9
|
import { CaptionIcon, CopyIcon, DeleteIcon, DuplicateIcon, ExpandFullIcon, InsertIntoPageIcon, OpenInNewIcon, } from '@blocksuite/icons/lit';
|
|
10
10
|
import { BlockFlavourIdentifier, isGfxBlockComponent } from '../../../std/index.js';
|
|
11
|
-
import { Slice, Text
|
|
11
|
+
import { Slice, Text } from '../../../store/index.js';
|
|
12
12
|
import { computed, signal } from '@preact/signals-core';
|
|
13
13
|
import { html } from 'lit';
|
|
14
14
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
@@ -82,7 +82,7 @@ const conversionsActionGroup = {
|
|
|
82
82
|
actions: [
|
|
83
83
|
{
|
|
84
84
|
id: 'inline',
|
|
85
|
-
|
|
85
|
+
labelWording: TOOLBAR_INLINE_VIEW,
|
|
86
86
|
run(ctx) {
|
|
87
87
|
const block = ctx.getCurrentBlockByType(EmbedSyncedDocBlockComponent);
|
|
88
88
|
block?.convertToInline();
|
|
@@ -99,7 +99,7 @@ const conversionsActionGroup = {
|
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
id: 'card',
|
|
102
|
-
|
|
102
|
+
labelWording: TOOLBAR_CARD_VIEW,
|
|
103
103
|
run(ctx) {
|
|
104
104
|
const block = ctx.getCurrentBlockByType(EmbedSyncedDocBlockComponent);
|
|
105
105
|
if (isGfxBlockComponent(block)) {
|
|
@@ -116,7 +116,7 @@ const conversionsActionGroup = {
|
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
id: 'embed',
|
|
119
|
-
|
|
119
|
+
labelWording: TOOLBAR_EMBED_VIEW,
|
|
120
120
|
disabled: true,
|
|
121
121
|
},
|
|
122
122
|
],
|
|
@@ -125,7 +125,7 @@ const conversionsActionGroup = {
|
|
|
125
125
|
if (!model)
|
|
126
126
|
return null;
|
|
127
127
|
const actions = this.actions.map(action => ({ ...action }));
|
|
128
|
-
const viewType$ = signal(
|
|
128
|
+
const viewType$ = signal(translateKey(ctx.std, ...TOOLBAR_EMBED_VIEW));
|
|
129
129
|
const onToggle = createOnToggleFn(ctx, 'OpenedViewSelector', 'switch view');
|
|
130
130
|
return html `${keyed(model, html `<affine-view-dropdown-menu
|
|
131
131
|
@toggle=${onToggle}
|
|
@@ -163,7 +163,7 @@ const builtinToolbarConfig = {
|
|
|
163
163
|
actions: [
|
|
164
164
|
{
|
|
165
165
|
id: 'copy',
|
|
166
|
-
|
|
166
|
+
labelWording: TOOLBAR_COPY,
|
|
167
167
|
icon: CopyIcon(),
|
|
168
168
|
run(ctx) {
|
|
169
169
|
const model = ctx.getCurrentModelByType(EmbedSyncedDocModel);
|
|
@@ -172,13 +172,13 @@ const builtinToolbarConfig = {
|
|
|
172
172
|
const slice = Slice.fromModels(ctx.store, [model]);
|
|
173
173
|
ctx.clipboard
|
|
174
174
|
.copySlice(slice)
|
|
175
|
-
.then(() => toast(ctx.host,
|
|
175
|
+
.then(() => toast(ctx.host, translateKey(ctx.std, ...TOAST_COPIED_TO_CLIPBOARD)))
|
|
176
176
|
.catch(console.error);
|
|
177
177
|
},
|
|
178
178
|
},
|
|
179
179
|
{
|
|
180
180
|
id: 'duplicate',
|
|
181
|
-
|
|
181
|
+
labelWording: TOOLBAR_DUPLICATE,
|
|
182
182
|
icon: DuplicateIcon(),
|
|
183
183
|
run(ctx) {
|
|
184
184
|
const model = ctx.getCurrentModelByType(EmbedSyncedDocModel);
|
|
@@ -195,7 +195,7 @@ const builtinToolbarConfig = {
|
|
|
195
195
|
{
|
|
196
196
|
placement: ActionPlacement.More,
|
|
197
197
|
id: 'c.delete',
|
|
198
|
-
|
|
198
|
+
labelWording: TOOLBAR_DELETE,
|
|
199
199
|
icon: DeleteIcon(),
|
|
200
200
|
variant: 'destructive',
|
|
201
201
|
run(ctx) {
|
|
@@ -32,7 +32,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
32
32
|
}
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
|
-
import { EmbedBlockComponent, isEmptyDoc
|
|
35
|
+
import { EmbedBlockComponent, isEmptyDoc } from '../../affine-block-embed/index.js';
|
|
36
36
|
import { Peekable } from '../../affine-components/peek/index.js';
|
|
37
37
|
import { ViewExtensionManagerIdentifier } from '../../affine-ext-loader/index.js';
|
|
38
38
|
import { RefNodeSlotsProvider, } from '../../affine-inline-reference/index.js';
|
|
@@ -190,7 +190,9 @@ export class EdgelessFrameManager extends GfxExtension {
|
|
|
190
190
|
// Only add elements that aren't already grouped and have a valid
|
|
191
191
|
// frame, and never let the frame swallow a backdrop that encloses
|
|
192
192
|
// it (e.g. a Wardley map background the frame was drawn on top of).
|
|
193
|
-
if (!element.group &&
|
|
193
|
+
if (!element.group &&
|
|
194
|
+
frame &&
|
|
195
|
+
!this._enclosesFrame(element, frame)) {
|
|
194
196
|
this._adoptNewlyCreatedElement(frame, element);
|
|
195
197
|
}
|
|
196
198
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefaultTool, OverlayIdentifier
|
|
1
|
+
import { DefaultTool, OverlayIdentifier } from '../affine-block-surface/index.js';
|
|
2
2
|
import { EditPropsStore, TelemetryProvider, } from '../affine-shared/services/index.js';
|
|
3
3
|
import { Bound, Vec } from '../global/gfx/index.js';
|
|
4
4
|
import { BaseTool, getTopElements } from '../std/gfx/index.js';
|
|
@@ -2,7 +2,7 @@ import { EdgelessCRUDIdentifier } from '../affine-block-surface/index.js';
|
|
|
2
2
|
import { packColor, } from '../affine-components/color-picker/index.js';
|
|
3
3
|
import { toast } from '../affine-components/toast/index.js';
|
|
4
4
|
import { DEFAULT_NOTE_HEIGHT, DefaultTheme, FrameBlockModel, FrameBlockSchema, NoteBlockModel, NoteBlockSchema, NoteDisplayMode, resolveColor, SurfaceRefBlockSchema, } from '../affine-model/index.js';
|
|
5
|
-
import { NotificationProvider, ToolbarModuleExtension, } from '../affine-shared/services/index.js';
|
|
5
|
+
import { NotificationProvider, TOAST_FRAME_INSERTED_INTO_PAGE, ToolbarModuleExtension, translateKey, } from '../affine-shared/services/index.js';
|
|
6
6
|
import { getMostCommonResolvedValue, matchModels, } from '../affine-shared/utils/index.js';
|
|
7
7
|
import { mountFrameTitleEditor } from '../affine-widget-frame-title/index.js';
|
|
8
8
|
import { Bound } from '../global/gfx/index.js';
|
|
@@ -46,7 +46,7 @@ const builtinSurfaceToolbarConfig = {
|
|
|
46
46
|
const notification = ctx.std.getOptional(NotificationProvider);
|
|
47
47
|
if (notification) {
|
|
48
48
|
notification.notifyWithUndoAction({
|
|
49
|
-
title:
|
|
49
|
+
title: translateKey(ctx.std, ...TOAST_FRAME_INSERTED_INTO_PAGE),
|
|
50
50
|
message: 'Frame has been inserted into doc',
|
|
51
51
|
accent: 'success',
|
|
52
52
|
});
|
|
@@ -36,7 +36,7 @@ import { focusBlockEnd, focusBlockStart, getNextBlockCommand, getPrevBlockComman
|
|
|
36
36
|
import { ImageSelection } from '../../affine-shared/selection/index.js';
|
|
37
37
|
import { unsafeCSSVarV2 } from '../../affine-shared/theme/index.js';
|
|
38
38
|
import { SignalWatcher, WithDisposable } from '../../global/lit/index.js';
|
|
39
|
-
import { BlockSelection, ShadowlessElement, TextSelection
|
|
39
|
+
import { BlockSelection, ShadowlessElement, TextSelection } from '../../std/index.js';
|
|
40
40
|
import { computed } from '@preact/signals-core';
|
|
41
41
|
import { css, html } from 'lit';
|
|
42
42
|
import { property, query } from 'lit/decorators.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImageBlockModel } from '../../affine-model/index.js';
|
|
2
|
-
import { ActionPlacement, blockCommentToolbarButton, ToolbarModuleExtension, } from '../../affine-shared/services/index.js';
|
|
2
|
+
import { ActionPlacement, blockCommentToolbarButton, TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, ToolbarModuleExtension, } from '../../affine-shared/services/index.js';
|
|
3
3
|
import { BookmarkIcon, CaptionIcon, CopyIcon, DeleteIcon, DownloadIcon, DuplicateIcon, } from '@blocksuite/icons/lit';
|
|
4
4
|
import { BlockFlavourIdentifier } from '../../std/index.js';
|
|
5
5
|
import { ImageBlockComponent } from '../image-block.js';
|
|
@@ -43,7 +43,7 @@ const builtinToolbarConfig = {
|
|
|
43
43
|
actions: [
|
|
44
44
|
{
|
|
45
45
|
id: 'a.copy',
|
|
46
|
-
|
|
46
|
+
labelWording: TOOLBAR_COPY,
|
|
47
47
|
icon: CopyIcon(),
|
|
48
48
|
run(ctx) {
|
|
49
49
|
const block = ctx.getCurrentBlockByType(ImageBlockComponent);
|
|
@@ -52,7 +52,7 @@ const builtinToolbarConfig = {
|
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
id: 'b.duplicate',
|
|
55
|
-
|
|
55
|
+
labelWording: TOOLBAR_DUPLICATE,
|
|
56
56
|
icon: DuplicateIcon(),
|
|
57
57
|
run(ctx) {
|
|
58
58
|
const block = ctx.getCurrentBlockByType(ImageBlockComponent);
|
|
@@ -88,7 +88,7 @@ const builtinToolbarConfig = {
|
|
|
88
88
|
{
|
|
89
89
|
placement: ActionPlacement.More,
|
|
90
90
|
id: 'c.delete',
|
|
91
|
-
|
|
91
|
+
labelWording: TOOLBAR_DELETE,
|
|
92
92
|
icon: DeleteIcon(),
|
|
93
93
|
variant: 'destructive',
|
|
94
94
|
run(ctx) {
|
|
@@ -35,7 +35,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
35
35
|
import { LoadingIcon } from '../affine-components/icons/index.js';
|
|
36
36
|
import { Peekable } from '../affine-components/peek/index.js';
|
|
37
37
|
import { ResourceController } from '../affine-components/resource/index.js';
|
|
38
|
-
import { ImageBlockSchema
|
|
38
|
+
import { ImageBlockSchema } from '../affine-model/index.js';
|
|
39
39
|
import { cssVarV2, unsafeCSSVarV2 } from '../affine-shared/theme/index.js';
|
|
40
40
|
import { formatSize } from '../affine-shared/utils/index.js';
|
|
41
41
|
import { BrokenImageIcon, ImageIcon } from '@blocksuite/icons/lit';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ListBlockModel } from '../../affine-model/index.js';
|
|
2
|
-
import { getNextContentBlock, matchModels
|
|
2
|
+
import { getNextContentBlock, matchModels } from '../../affine-shared/utils/index.js';
|
|
3
3
|
import { TextSelection } from '../../std/index.js';
|
|
4
4
|
// When deleting at line end of a list block,
|
|
5
5
|
// check current block's children and siblings
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EdgelessLegacySlotIdentifier } from '../../affine-block-surface/index.js';
|
|
2
2
|
import { NoteBlockModel, NoteDisplayMode } from '../../affine-model/index.js';
|
|
3
|
-
import { NotificationProvider, SidebarExtensionIdentifier, ToolbarModuleExtension, } from '../../affine-shared/services/index.js';
|
|
3
|
+
import { NotificationProvider, SidebarExtensionIdentifier, TOAST_NOTE_REMOVED_FROM_PAGE, ToolbarModuleExtension, translateKey, } from '../../affine-shared/services/index.js';
|
|
4
4
|
import { Bound } from '../../global/gfx/index.js';
|
|
5
5
|
import { AutoHeightIcon, CustomizedHeightIcon, InsertIntoPageIcon, ScissorsIcon, } from '@blocksuite/icons/lit';
|
|
6
6
|
import { BlockFlavourIdentifier } from '../../std/index.js';
|
|
@@ -244,7 +244,7 @@ function setDisplayMode(ctx, model, newMode) {
|
|
|
244
244
|
}
|
|
245
245
|
const data = newMode === NoteDisplayMode.EdgelessOnly
|
|
246
246
|
? {
|
|
247
|
-
title:
|
|
247
|
+
title: translateKey(ctx.std, ...TOAST_NOTE_REMOVED_FROM_PAGE),
|
|
248
248
|
message: 'Content removed from your page.',
|
|
249
249
|
}
|
|
250
250
|
: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AttachmentBlockModel, BookmarkBlockModel, CalloutBlockModel, CodeBlockModel, DatabaseBlockModel, DividerBlockModel, ImageBlockModel, ListBlockModel, ParagraphBlockModel, } from '../../affine-model/index.js';
|
|
2
2
|
import { EMBED_BLOCK_MODEL_LIST } from '../../affine-shared/consts/index.js';
|
|
3
|
-
import { getNextContentBlock, matchModels
|
|
4
|
-
import { BlockSelection, TextSelection
|
|
3
|
+
import { getNextContentBlock, matchModels } from '../../affine-shared/utils/index.js';
|
|
4
|
+
import { BlockSelection, TextSelection } from '../../std/index.js';
|
|
5
5
|
export function forwardDelete(std) {
|
|
6
6
|
const { store, host } = std;
|
|
7
7
|
const text = std.selection.find(TextSelection);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AttachmentBlockModel, BookmarkBlockModel, CalloutBlockModel, CodeBlockModel, DatabaseBlockModel, DividerBlockModel, EdgelessTextBlockModel, ImageBlockModel, ListBlockModel, NoteBlockModel, ParagraphBlockModel, } from '../../affine-model/index.js';
|
|
2
|
-
import { asyncSetInlineRange, focusTextModel
|
|
2
|
+
import { asyncSetInlineRange, focusTextModel } from '../../affine-rich-text/index.js';
|
|
3
3
|
import { EMBED_BLOCK_MODEL_LIST } from '../../affine-shared/consts/index.js';
|
|
4
4
|
import { focusTitle, getDocTitleInlineEditor, getPrevContentBlock, matchModels, } from '../../affine-shared/utils/index.js';
|
|
5
5
|
import { BlockSelection } from '../../std/index.js';
|
|
@@ -45,7 +45,9 @@ export declare const builtinToolbarConfig: {
|
|
|
45
45
|
readonly score?: number;
|
|
46
46
|
readonly when?: ((cx: import("../../affine-shared/services/index.js").ToolbarContext) => boolean) | boolean;
|
|
47
47
|
readonly priority?: number;
|
|
48
|
+
readonly labelWording?: import("../../affine-shared/services/index.js").ChromeWording;
|
|
48
49
|
readonly showLabel?: boolean;
|
|
50
|
+
readonly tooltipWording?: import("../../affine-shared/services/index.js").ChromeWording;
|
|
49
51
|
readonly run?: (cx: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|
|
50
52
|
readonly id: "g.comment";
|
|
51
53
|
}, {
|
|
@@ -53,12 +55,12 @@ export declare const builtinToolbarConfig: {
|
|
|
53
55
|
readonly id: "a.clipboard";
|
|
54
56
|
readonly actions: [{
|
|
55
57
|
readonly id: "copy";
|
|
56
|
-
readonly
|
|
58
|
+
readonly labelWording: import("../../affine-shared/services/index.js").ChromeWording;
|
|
57
59
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
58
|
-
readonly run: ({ chain, host }: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|
|
60
|
+
readonly run: ({ chain, host, std }: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|
|
59
61
|
}, {
|
|
60
62
|
readonly id: "duplicate";
|
|
61
|
-
readonly
|
|
63
|
+
readonly labelWording: import("../../affine-shared/services/index.js").ChromeWording;
|
|
62
64
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
63
65
|
readonly run: ({ chain, store, selection }: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|
|
64
66
|
}];
|
|
@@ -68,7 +70,7 @@ export declare const builtinToolbarConfig: {
|
|
|
68
70
|
readonly id: "c.delete";
|
|
69
71
|
readonly actions: [{
|
|
70
72
|
readonly id: "delete";
|
|
71
|
-
readonly
|
|
73
|
+
readonly labelWording: import("../../affine-shared/services/index.js").ChromeWording;
|
|
72
74
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
73
75
|
readonly variant: "destructive";
|
|
74
76
|
readonly run: ({ chain }: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|
|
@@ -7,7 +7,7 @@ import { deleteTextCommand, formatBlockCommand, formatNativeCommand, formatTextC
|
|
|
7
7
|
import { EmbedLinkedDocBlockSchema, EmbedSyncedDocBlockSchema, } from '../../affine-model/index.js';
|
|
8
8
|
import { textConversionConfigs } from '../../affine-rich-text/index.js';
|
|
9
9
|
import { copySelectedModelsCommand, deleteSelectedModelsCommand, draftSelectedModelsCommand, duplicateSelectedModelsCommand, getBlockSelectionsCommand, getImageSelectionsCommand, getSelectedBlocksCommand, getSelectedModelsCommand, getTextSelectionCommand, } from '../../affine-shared/commands/index.js';
|
|
10
|
-
import { ActionPlacement, blockCommentToolbarButton, } from '../../affine-shared/services/index.js';
|
|
10
|
+
import { ActionPlacement, blockCommentToolbarButton, TOAST_COPIED_TO_CLIPBOARD, TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, translateKey, } from '../../affine-shared/services/index.js';
|
|
11
11
|
import { tableViewMeta } from '../../data-view/view-presets/index.js';
|
|
12
12
|
import { CopyIcon, DatabaseTableViewIcon, DeleteIcon, DuplicateIcon, LinkedPageIcon, } from '@blocksuite/icons/lit';
|
|
13
13
|
import { BlockSelection, BlockViewIdentifier, } from '../../std/index.js';
|
|
@@ -220,9 +220,9 @@ export const builtinToolbarConfig = {
|
|
|
220
220
|
actions: [
|
|
221
221
|
{
|
|
222
222
|
id: 'copy',
|
|
223
|
-
|
|
223
|
+
labelWording: TOOLBAR_COPY,
|
|
224
224
|
icon: CopyIcon(),
|
|
225
|
-
run({ chain, host }) {
|
|
225
|
+
run({ chain, host, std }) {
|
|
226
226
|
const [ok] = chain
|
|
227
227
|
.pipe(getSelectedModelsCommand)
|
|
228
228
|
.pipe(draftSelectedModelsCommand)
|
|
@@ -230,12 +230,12 @@ export const builtinToolbarConfig = {
|
|
|
230
230
|
.run();
|
|
231
231
|
if (!ok)
|
|
232
232
|
return;
|
|
233
|
-
toast(host,
|
|
233
|
+
toast(host, translateKey(std, ...TOAST_COPIED_TO_CLIPBOARD));
|
|
234
234
|
},
|
|
235
235
|
},
|
|
236
236
|
{
|
|
237
237
|
id: 'duplicate',
|
|
238
|
-
|
|
238
|
+
labelWording: TOOLBAR_DUPLICATE,
|
|
239
239
|
icon: DuplicateIcon(),
|
|
240
240
|
run({ chain, store, selection }) {
|
|
241
241
|
store.captureSync();
|
|
@@ -272,7 +272,7 @@ export const builtinToolbarConfig = {
|
|
|
272
272
|
actions: [
|
|
273
273
|
{
|
|
274
274
|
id: 'delete',
|
|
275
|
-
|
|
275
|
+
labelWording: TOOLBAR_DELETE,
|
|
276
276
|
icon: DeleteIcon(),
|
|
277
277
|
variant: 'destructive',
|
|
278
278
|
run({ chain }) {
|