@formicoidea/labre-core 0.42.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_pkgs/affine-block-attachment/utils.js +4 -0
- package/dist/_pkgs/affine-block-bookmark/configs/toolbar.js +17 -4
- package/dist/_pkgs/affine-block-callout/commands/turn-into-callout.d.ts +29 -0
- package/dist/_pkgs/affine-block-callout/commands/turn-into-callout.js +81 -0
- package/dist/_pkgs/affine-block-callout/configs/slash-menu.js +6 -4
- package/dist/_pkgs/affine-block-callout/configs/turn-into.d.ts +8 -0
- package/dist/_pkgs/affine-block-callout/configs/turn-into.js +19 -0
- package/dist/_pkgs/affine-block-callout/translations.d.ts +4 -2
- package/dist/_pkgs/affine-block-callout/translations.js +4 -2
- package/dist/_pkgs/affine-block-callout/view.js +3 -0
- package/dist/_pkgs/affine-block-code/code-block-service.d.ts +13 -0
- package/dist/_pkgs/affine-block-code/code-block-service.js +26 -0
- package/dist/_pkgs/affine-block-code/code-block.d.ts +6 -0
- package/dist/_pkgs/affine-block-code/code-block.js +11 -2
- package/dist/_pkgs/affine-block-code/code-toolbar/components/lang-button.js +31 -8
- package/dist/_pkgs/affine-block-data-view/configs/tooltips.js +1 -1
- package/dist/_pkgs/affine-block-database/configs/tooltips.js +1 -1
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-text-block.js +4 -2
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.d.ts +11 -0
- package/dist/_pkgs/affine-block-edgeless-text/svg-painter.d.ts +20 -0
- package/dist/_pkgs/affine-block-edgeless-text/svg-painter.js +76 -0
- package/dist/_pkgs/affine-block-edgeless-text/view.js +2 -0
- package/dist/_pkgs/affine-block-embed/common/iframe-sandbox.d.ts +39 -0
- package/dist/_pkgs/affine-block-embed/common/iframe-sandbox.js +39 -0
- package/dist/_pkgs/affine-block-embed/configs/toolbar.js +11 -2
- package/dist/_pkgs/affine-block-embed/embed-figma-block/embed-figma-block.js +2 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-error-card.d.ts +14 -1
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-error-card.js +21 -2
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +11 -2
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.d.ts +0 -2
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.js +2 -5
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.d.ts +1 -1
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +14 -6
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/types.d.ts +16 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/types.js +17 -1
- package/dist/_pkgs/affine-block-embed/embed-loom-block/embed-loom-block.js +2 -0
- package/dist/_pkgs/affine-block-embed/embed-youtube-block/embed-youtube-block.js +2 -0
- package/dist/_pkgs/affine-block-embed/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-embed/index.js +1 -0
- package/dist/_pkgs/affine-block-embed/translations.d.ts +8 -0
- package/dist/_pkgs/affine-block-embed/translations.js +28 -0
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-edgeless-linked-doc-block.js +3 -1
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-linked-doc-block.js +4 -2
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/configs/toolbar.js +7 -2
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-edgeless-synced-doc-block.js +3 -1
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-synced-doc-block.js +2 -2
- package/dist/_pkgs/affine-block-frame/frame-manager.d.ts +5 -0
- package/dist/_pkgs/affine-block-frame/frame-manager.js +53 -19
- package/dist/_pkgs/affine-block-frame/frame-tool.js +3 -1
- package/dist/_pkgs/affine-block-image/utils.js +4 -1
- package/dist/_pkgs/affine-block-latex/adapters/markdown/preprocessor.d.ts +8 -0
- package/dist/_pkgs/affine-block-latex/adapters/markdown/preprocessor.js +9 -5
- package/dist/_pkgs/affine-block-list/utils/get-list-icon.js +3 -1
- package/dist/_pkgs/affine-block-note/configs/tooltips.js +1 -1
- package/dist/_pkgs/affine-block-note/translations.d.ts +0 -1
- package/dist/_pkgs/affine-block-note/translations.js +0 -5
- package/dist/_pkgs/affine-block-root/adapters/html.js +2 -2
- package/dist/_pkgs/affine-block-root/commands/copy-link-commands.d.ts +2 -0
- package/dist/_pkgs/affine-block-root/commands/copy-link-commands.js +155 -0
- package/dist/_pkgs/affine-block-root/configs/toolbar.js +17 -1
- package/dist/_pkgs/affine-block-root/edgeless/clipboard/clipboard.js +2 -1
- package/dist/_pkgs/affine-block-root/edgeless/clipboard/command.js +161 -83
- package/dist/_pkgs/affine-block-root/edgeless/clipboard/paste-order.d.ts +21 -0
- package/dist/_pkgs/affine-block-root/edgeless/clipboard/paste-order.js +85 -0
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.d.ts +6 -0
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +18 -1
- package/dist/_pkgs/affine-block-root/edgeless/utils/clone-utils.d.ts +9 -0
- package/dist/_pkgs/affine-block-root/edgeless/utils/clone-utils.js +28 -0
- package/dist/_pkgs/affine-block-root/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-root/index.js +1 -0
- package/dist/_pkgs/affine-block-root/keyboard/commands.js +9 -6
- package/dist/_pkgs/affine-block-root/preview/edgeless-root-preview-block.js +15 -2
- package/dist/_pkgs/affine-block-root/view.js +2 -0
- package/dist/_pkgs/affine-block-surface/adapters/markdown/element-adapter/type.d.ts +1 -1
- package/dist/_pkgs/affine-block-surface/element-model/index.d.ts +1 -1
- package/dist/_pkgs/affine-block-surface/element-model/index.js +1 -1
- package/dist/_pkgs/affine-block-surface/extensions/audit.js +13 -61
- package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/commands.d.ts +2 -0
- package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/commands.js +71 -0
- package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/index.js +1 -0
- package/dist/_pkgs/affine-block-surface/extensions/clipboard-config.js +4 -0
- package/dist/_pkgs/affine-block-surface/extensions/crud-extension.js +4 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.d.ts +12 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +27 -7
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.d.ts +2 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.js +22 -3
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.d.ts +6 -3
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.js +4 -2
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/parts.d.ts +63 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/parts.js +67 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.d.ts +62 -5
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +98 -18
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.d.ts +14 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.js +82 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.d.ts +2 -2
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.js +112 -10
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/translations.d.ts +13 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/translations.js +33 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.js +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +13 -1
- package/dist/_pkgs/affine-block-surface/extensions/legend.d.ts +8 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend.js +59 -3
- package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.js +4 -0
- package/dist/_pkgs/affine-block-surface/extensions/reading-widget.d.ts +13 -6
- package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +26 -10
- package/dist/_pkgs/affine-block-surface/extensions/reading.d.ts +82 -6
- package/dist/_pkgs/affine-block-surface/extensions/reading.js +99 -21
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/actions.d.ts +80 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/actions.js +248 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/commands.d.ts +82 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/commands.js +342 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/index.d.ts +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/index.js +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/tree.d.ts +137 -0
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/tree.js +323 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.d.ts +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.js +23 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +112 -4
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +98 -19
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/actions.d.ts +76 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/actions.js +299 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/active-layer.d.ts +20 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/active-layer.js +34 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/commands.d.ts +67 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/commands.js +172 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/creation.d.ts +40 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/creation.js +69 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/index.d.ts +5 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/index.js +5 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/translations.d.ts +10 -0
- package/dist/_pkgs/affine-block-surface/extensions/user-layers/translations.js +14 -0
- package/dist/_pkgs/affine-block-surface/framework-background/background-view.js +1 -1
- package/dist/_pkgs/affine-block-surface/framework-background/facts.d.ts +55 -2
- package/dist/_pkgs/affine-block-surface/framework-background/facts.js +63 -1
- package/dist/_pkgs/affine-block-surface/framework-background/fit.d.ts +36 -0
- package/dist/_pkgs/affine-block-surface/framework-background/fit.js +30 -0
- package/dist/_pkgs/affine-block-surface/framework-background/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/framework-background/index.js +1 -0
- package/dist/_pkgs/affine-block-surface/framework-background/stacking.d.ts +16 -8
- package/dist/_pkgs/affine-block-surface/framework-background/stacking.js +26 -14
- package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.js +17 -3
- package/dist/_pkgs/affine-block-surface/renderer/dom-renderer.d.ts +3 -1
- package/dist/_pkgs/affine-block-surface/renderer/dom-renderer.js +22 -2
- package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.js +2 -7
- package/dist/_pkgs/affine-block-surface/renderer/paint-predicate.d.ts +30 -0
- package/dist/_pkgs/affine-block-surface/renderer/paint-predicate.js +29 -0
- package/dist/_pkgs/affine-block-surface/surface-block.js +6 -0
- package/dist/_pkgs/affine-block-surface/surface-model.js +5 -0
- package/dist/_pkgs/affine-block-surface/surface-transformer.js +5 -0
- package/dist/_pkgs/affine-block-surface/tool/default-tool.js +28 -5
- package/dist/_pkgs/affine-block-surface/view.js +23 -1
- package/dist/_pkgs/affine-block-surface-ref/configs/tooltips.js +2 -2
- package/dist/_pkgs/affine-block-surface-ref/surface-ref-block.js +12 -2
- package/dist/_pkgs/affine-components/color-picker/palette-carousel.js +5 -0
- package/dist/_pkgs/affine-components/color-picker/styles.js +1 -1
- package/dist/_pkgs/affine-components/context-menu/button.js +17 -1
- package/dist/_pkgs/affine-components/filterable-list/index.js +30 -9
- package/dist/_pkgs/affine-components/icons/ai.js +3 -3
- package/dist/_pkgs/affine-components/icons/index.d.ts +0 -1
- package/dist/_pkgs/affine-components/icons/index.js +0 -1
- package/dist/_pkgs/affine-components/icons/list.js +7 -1
- package/dist/_pkgs/affine-components/icons/text.d.ts +1 -0
- package/dist/_pkgs/affine-components/icons/text.js +11 -0
- package/dist/_pkgs/affine-components/size-dropdown-menu/dropdown-menu.js +6 -1
- package/dist/_pkgs/affine-components/toolbar/index.d.ts +1 -1
- package/dist/_pkgs/affine-components/toolbar/index.js +1 -1
- package/dist/_pkgs/affine-components/toolbar/menu-button.d.ts +7 -0
- package/dist/_pkgs/affine-components/toolbar/menu-button.js +30 -0
- package/dist/_pkgs/affine-components/toolbar/picker-menu.d.ts +16 -1
- package/dist/_pkgs/affine-components/toolbar/picker-menu.js +2 -2
- package/dist/_pkgs/affine-components/toolbar/toolbar.d.ts +1 -0
- package/dist/_pkgs/affine-components/toolbar/toolbar.js +67 -0
- package/dist/_pkgs/affine-fragment-adapter-panel/adapter-panel.d.ts +2 -2
- package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card-title-editor.js +1 -1
- package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card.js +3 -3
- package/dist/_pkgs/affine-fragment-frame-panel/header/frame-panel-header.d.ts +1 -1
- package/dist/_pkgs/affine-fragment-frame-panel/header/frame-panel-header.js +8 -27
- package/dist/_pkgs/affine-fragment-frame-panel/index.d.ts +1 -0
- package/dist/_pkgs/affine-fragment-frame-panel/index.js +1 -0
- package/dist/_pkgs/affine-gfx-brush/toolbar/components/eraser/icons.js +1 -1
- package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.d.ts +11 -2
- package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.js +11 -2
- package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.js +3 -1
- package/dist/_pkgs/affine-gfx-connector/element-renderer/index.js +21 -4
- package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.js +6 -4
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +24 -8
- package/dist/_pkgs/affine-gfx-connector/translations.d.ts +3 -0
- package/dist/_pkgs/affine-gfx-connector/translations.js +23 -0
- package/dist/_pkgs/affine-gfx-group/command/group-api.js +52 -1
- package/dist/_pkgs/affine-gfx-mindmap/indicator-overlay/index.js +6 -2
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/config.js +4 -2
- package/dist/_pkgs/affine-gfx-mindmap/translations.d.ts +6 -0
- package/dist/_pkgs/affine-gfx-mindmap/translations.js +10 -0
- package/dist/_pkgs/affine-gfx-shape/element-renderer/shape/index.js +21 -3
- package/dist/_pkgs/affine-gfx-shape/text/edgeless-shape-text-editor.js +2 -0
- package/dist/_pkgs/affine-gfx-shape/toolbar/config.js +5 -3
- package/dist/_pkgs/affine-gfx-shape/translations.d.ts +7 -0
- package/dist/_pkgs/affine-gfx-shape/translations.js +11 -0
- package/dist/_pkgs/affine-gfx-template/builtin/other.js +13 -7
- package/dist/_pkgs/affine-gfx-template/services/template-middlewares.d.ts +9 -0
- package/dist/_pkgs/affine-gfx-template/services/template-middlewares.js +23 -1
- package/dist/_pkgs/affine-gfx-template/services/template.js +2 -1
- package/dist/_pkgs/affine-gfx-template/toolbar/template-loading.js +1 -1
- package/dist/_pkgs/affine-gfx-template/translations.d.ts +5 -0
- package/dist/_pkgs/affine-gfx-template/translations.js +38 -0
- package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.js +5 -3
- package/dist/_pkgs/affine-gfx-text/element-renderer/index.js +20 -3
- package/dist/_pkgs/affine-gfx-text/element-renderer/utils.d.ts +67 -1
- package/dist/_pkgs/affine-gfx-text/element-renderer/utils.js +101 -0
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.d.ts +11 -0
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +56 -3
- package/dist/_pkgs/affine-gfx-text/toolbar/config.d.ts +11 -0
- package/dist/_pkgs/affine-gfx-text/toolbar/config.js +1 -1
- package/dist/_pkgs/affine-gfx-text/translations.d.ts +8 -0
- package/dist/_pkgs/affine-gfx-text/translations.js +12 -0
- package/dist/_pkgs/affine-inline-latex/latex-node/latex-editor-menu.js +2 -1
- package/dist/_pkgs/affine-inline-preset/adapters/html/html-inline.d.ts +3 -0
- package/dist/_pkgs/affine-inline-preset/adapters/html/html-inline.js +31 -0
- package/dist/_pkgs/affine-inline-preset/adapters/html/inline-delta.d.ts +4 -0
- package/dist/_pkgs/affine-inline-preset/adapters/html/inline-delta.js +14 -0
- package/dist/_pkgs/affine-inline-preset/command/config.js +21 -3
- package/dist/_pkgs/affine-inline-preset/command/index.d.ts +1 -1
- package/dist/_pkgs/affine-inline-preset/command/index.js +1 -1
- package/dist/_pkgs/affine-inline-preset/command/text-style.d.ts +2 -1
- package/dist/_pkgs/affine-inline-preset/command/text-style.js +1 -0
- package/dist/_pkgs/affine-inline-preset/default-inline-manager.js +2 -1
- package/dist/_pkgs/affine-inline-preset/inline-spec.d.ts +4 -0
- package/dist/_pkgs/affine-inline-preset/inline-spec.js +14 -0
- package/dist/_pkgs/affine-inline-preset/translations.d.ts +2 -2
- package/dist/_pkgs/affine-inline-preset/translations.js +2 -2
- package/dist/_pkgs/affine-model/blocks/attachment/attachment-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/bookmark/bookmark-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/edgeless-text/edgeless-text-model.d.ts +1 -1
- package/dist/_pkgs/affine-model/blocks/edgeless-text/edgeless-text-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/embed/iframe/iframe-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/frame/frame-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/image/image-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/latex/latex-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/note/note-model.js +2 -0
- package/dist/_pkgs/affine-model/consts/text.d.ts +41 -2
- package/dist/_pkgs/affine-model/consts/text.js +50 -1
- package/dist/_pkgs/affine-model/elements/shape/shape.d.ts +6 -1
- package/dist/_pkgs/affine-model/elements/shape/shape.js +14 -1
- package/dist/_pkgs/affine-model/elements/text/text.d.ts +6 -1
- package/dist/_pkgs/affine-model/elements/text/text.js +13 -1
- package/dist/_pkgs/affine-model/utils/helper.js +2 -0
- package/dist/_pkgs/affine-rich-text/conversion.d.ts +25 -0
- package/dist/_pkgs/affine-rich-text/conversion.js +9 -0
- package/dist/_pkgs/affine-rich-text/index.d.ts +1 -1
- package/dist/_pkgs/affine-rich-text/index.js +1 -1
- package/dist/_pkgs/affine-shared/commands/model-crud/replace-selected-text-with-blocks.d.ts +1 -1
- package/dist/_pkgs/affine-shared/services/canvas-grid.d.ts +63 -0
- package/dist/_pkgs/affine-shared/services/canvas-grid.js +109 -0
- package/dist/_pkgs/affine-shared/services/canvas-local-visibility.d.ts +64 -0
- package/dist/_pkgs/affine-shared/services/canvas-local-visibility.js +192 -0
- package/dist/_pkgs/affine-shared/services/edit-props-store.d.ts +27 -0
- package/dist/_pkgs/affine-shared/services/edit-props-store.js +34 -0
- package/dist/_pkgs/affine-shared/services/editor-setting-service.d.ts +3 -0
- package/dist/_pkgs/affine-shared/services/editor-setting-service.js +7 -0
- package/dist/_pkgs/affine-shared/services/feature-flag-service.d.ts +4 -0
- package/dist/_pkgs/affine-shared/services/font-loader/config.d.ts +13 -2
- package/dist/_pkgs/affine-shared/services/font-loader/config.js +43 -54
- package/dist/_pkgs/affine-shared/services/index.d.ts +3 -0
- package/dist/_pkgs/affine-shared/services/index.js +3 -0
- package/dist/_pkgs/affine-shared/services/selection-pane-service.d.ts +44 -0
- package/dist/_pkgs/affine-shared/services/selection-pane-service.js +28 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +69 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/telemetry-service.d.ts +2 -2
- package/dist/_pkgs/affine-shared/services/theme-service.d.ts +19 -0
- package/dist/_pkgs/affine-shared/services/theme-service.js +24 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +25 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +90 -0
- package/dist/_pkgs/affine-shared/styles/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/styles/index.js +1 -0
- package/dist/_pkgs/affine-shared/styles/panel-header.d.ts +31 -0
- package/dist/_pkgs/affine-shared/styles/panel-header.js +61 -0
- package/dist/_pkgs/affine-shared/styles/text.js +7 -7
- package/dist/_pkgs/affine-shared/types/index.d.ts +6 -0
- package/dist/_pkgs/affine-shared/utils/canvas-export-colors.d.ts +26 -0
- package/dist/_pkgs/affine-shared/utils/canvas-export-colors.js +127 -0
- package/dist/_pkgs/affine-shared/utils/file/filesys.d.ts +8 -11
- package/dist/_pkgs/affine-shared/utils/file/filesys.js +8 -11
- package/dist/_pkgs/affine-shared/utils/index.d.ts +2 -0
- package/dist/_pkgs/affine-shared/utils/index.js +2 -0
- package/dist/_pkgs/affine-shared/utils/label-mode.d.ts +47 -0
- package/dist/_pkgs/affine-shared/utils/label-mode.js +55 -0
- package/dist/_pkgs/affine-shared/utils/model/merge-to-code-model.js +7 -1
- package/dist/_pkgs/affine-shared/utils/model/transform-model.js +5 -0
- package/dist/_pkgs/affine-widget-edgeless-dragging-area/edgeless-dragging-area-rect.js +2 -2
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/utils.js +15 -4
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +25 -49
- package/dist/_pkgs/affine-widget-edgeless-toolbar/config/types.d.ts +15 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.d.ts +1 -1
- package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.js +7 -2
- package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.d.ts +4 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.js +4 -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/panel/font-family-panel.d.ts +18 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-family-panel.js +52 -6
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/drop.d.ts +61 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/drop.js +91 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/labels.d.ts +17 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/labels.js +95 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-default.d.ts +10 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-default.js +31 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-tool.d.ts +26 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-tool.js +82 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-widget.d.ts +170 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-widget.js +1381 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.d.ts +58 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.js +171 -1
- package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +10 -0
- package/dist/_pkgs/affine-widget-frame-title/edgeless-frame-title-editor.js +2 -1
- package/dist/_pkgs/affine-widget-note-slicer/note-slicer.js +7 -3
- package/dist/_pkgs/affine-widget-slash-menu/translations.d.ts +16 -0
- package/dist/_pkgs/affine-widget-slash-menu/translations.js +23 -1
- package/dist/_pkgs/affine-widget-toolbar/utils.js +57 -14
- package/dist/_pkgs/data-view/core/detail/field.js +2 -1
- package/dist/_pkgs/data-view/core/filter/literal/define.js +3 -1
- package/dist/_pkgs/data-view/core/group-by/renderer/boolean-group.js +1 -1
- package/dist/_pkgs/data-view/property-presets/checkbox/cell-renderer.js +8 -2
- package/dist/_pkgs/data-view/view-presets/kanban/pc/cell.js +1 -1
- package/dist/_pkgs/data-view/view-presets/kanban/pc/controller/drag.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/controller/drag.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/controller/selection.js +1 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/header/vertical-indicator.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/row/row-select-checkbox.js +3 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/drag.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/selection.js +1 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/header/vertical-indicator.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/row/row-header.js +3 -1
- package/dist/_pkgs/std/gfx/controller.d.ts +13 -0
- package/dist/_pkgs/std/gfx/controller.js +22 -2
- package/dist/_pkgs/std/gfx/grid.d.ts +31 -2
- package/dist/_pkgs/std/gfx/index.d.ts +3 -1
- package/dist/_pkgs/std/gfx/index.js +3 -1
- package/dist/_pkgs/std/gfx/interactivity/manager.js +7 -0
- package/dist/_pkgs/std/gfx/layer.js +73 -5
- package/dist/_pkgs/std/gfx/local-visibility.d.ts +88 -0
- package/dist/_pkgs/std/gfx/local-visibility.js +217 -0
- package/dist/_pkgs/std/gfx/model/gfx-block-model.d.ts +13 -0
- package/dist/_pkgs/std/gfx/model/surface/element-model.d.ts +34 -0
- package/dist/_pkgs/std/gfx/model/surface/element-model.js +65 -1
- package/dist/_pkgs/std/gfx/model/surface/role.d.ts +10 -5
- package/dist/_pkgs/std/gfx/model/surface/surface-model.d.ts +27 -0
- package/dist/_pkgs/std/gfx/model/surface/surface-model.js +43 -0
- package/dist/_pkgs/std/gfx/model/surface/user-layers.d.ts +68 -0
- package/dist/_pkgs/std/gfx/model/surface/user-layers.js +127 -0
- package/dist/_pkgs/std/utils/layer.d.ts +10 -0
- package/dist/_pkgs/std/utils/layer.js +64 -13
- package/dist/_pkgs/std/view/element/gfx-block-component.js +10 -2
- package/dist/commands.js +6 -2
- package/dist/translations.js +15 -6
- package/package.json +13 -2
- package/dist/_pkgs/affine-components/icons/file-icons-rc.d.ts +0 -1
- package/dist/_pkgs/affine-components/icons/file-icons-rc.js +0 -130
- package/dist/_pkgs/affine-shared/test-utils/affine-template.d.ts +0 -6
- package/dist/_pkgs/affine-shared/test-utils/affine-template.js +0 -258
- package/dist/_pkgs/affine-shared/test-utils/affine-test-utils.d.ts +0 -8
- package/dist/_pkgs/affine-shared/test-utils/affine-test-utils.js +0 -81
- package/dist/_pkgs/affine-shared/test-utils/create-test-host.d.ts +0 -23
- package/dist/_pkgs/affine-shared/test-utils/create-test-host.js +0 -187
- package/dist/_pkgs/affine-shared/test-utils/index.d.ts +0 -3
- package/dist/_pkgs/affine-shared/test-utils/index.js +0 -3
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { SelectionPaneModel, selectionPaneCommands, } from '../../affine-block-surface/index.js';
|
|
2
|
+
import { SelectionPaneProvider, translateKey, } from '../../affine-shared/services/index.js';
|
|
3
|
+
import { menu } from '../../affine-components/context-menu/index.js';
|
|
4
|
+
import { SignalWatcher } from '../../global/lit/index.js';
|
|
5
|
+
import { runCommand } from '../../std/index.js';
|
|
6
|
+
import { LayerIcon } from '@blocksuite/icons/lit';
|
|
7
|
+
import { css, html, LitElement } from 'lit';
|
|
8
|
+
import { QuickToolExtension } from '../extension/index.js';
|
|
9
|
+
import { QuickToolMixin } from '../mixins/index.js';
|
|
10
|
+
import { SELECTION_PANE_TITLE } from '../translations.js';
|
|
11
|
+
export const SELECTION_PANE_TOOL_BUTTON = 'edgeless-selection-pane-tool-button';
|
|
12
|
+
/**
|
|
13
|
+
* The button and its "more tools" entry both run `canvas.selectionPane.toggle`
|
|
14
|
+
* rather than calling the seam, so `SelectionPaneOpened` is emitted in ONE
|
|
15
|
+
* place whichever surface opened the pane.
|
|
16
|
+
*/
|
|
17
|
+
function toggleSelectionPane(std) {
|
|
18
|
+
const toggle = selectionPaneCommands.find(command => command.id === 'canvas.selectionPane.toggle');
|
|
19
|
+
if (!toggle)
|
|
20
|
+
return;
|
|
21
|
+
runCommand(std, toggle, {
|
|
22
|
+
surface: 'contextual-toolbar',
|
|
23
|
+
source: 'toolbar:general',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The edgeless toolbar's entry to the selection pane: a quick tool, placed and
|
|
28
|
+
* styled like the undo and frame ones. An action, not a tool mode, so `type`
|
|
29
|
+
* is empty; it reads as active while the library's own pane is open.
|
|
30
|
+
*/
|
|
31
|
+
export class EdgelessSelectionPaneToolButton extends QuickToolMixin(SignalWatcher(LitElement)) {
|
|
32
|
+
constructor() {
|
|
33
|
+
super(...arguments);
|
|
34
|
+
this.type = [];
|
|
35
|
+
}
|
|
36
|
+
static { this.styles = css `
|
|
37
|
+
.selection-pane-icon,
|
|
38
|
+
.selection-pane-icon > svg {
|
|
39
|
+
width: 24px;
|
|
40
|
+
height: 24px;
|
|
41
|
+
}
|
|
42
|
+
`; }
|
|
43
|
+
_onClick() {
|
|
44
|
+
toggleSelectionPane(this.edgeless.std);
|
|
45
|
+
}
|
|
46
|
+
render() {
|
|
47
|
+
const { std } = this.edgeless;
|
|
48
|
+
const open = std.getOptional(SelectionPaneModel)?.open$.value ?? false;
|
|
49
|
+
return html `<edgeless-tool-icon-button
|
|
50
|
+
.iconContainerPadding="${6}"
|
|
51
|
+
.tooltip="${translateKey(std, ...SELECTION_PANE_TITLE)}"
|
|
52
|
+
.tooltipOffset=${17}
|
|
53
|
+
.active=${open}
|
|
54
|
+
class="edgeless-selection-pane-tool-button"
|
|
55
|
+
data-testid="selection-pane-tool-button"
|
|
56
|
+
@click=${this._onClick}
|
|
57
|
+
>
|
|
58
|
+
<span class="selection-pane-icon">${LayerIcon()}</span>
|
|
59
|
+
</edgeless-tool-icon-button>`;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Shown only while `SelectionPaneProvider` answers: `SelectionPaneExtension(null)`
|
|
64
|
+
* removes the button with the pane, because a control that opens nothing is a
|
|
65
|
+
* lie. Not hidden on a read-only document — the pane is how a reader finds
|
|
66
|
+
* what is on it.
|
|
67
|
+
*
|
|
68
|
+
* The `menu` entry is what the toolbar moves into its "more tools" menu when a
|
|
69
|
+
* narrow editor leaves no room for the button; a quick tool without one is
|
|
70
|
+
* dropped there, which is how the pane once went missing below ~800 px.
|
|
71
|
+
*/
|
|
72
|
+
export const selectionPaneQuickTool = QuickToolExtension('selection-pane', ({ block }) => ({
|
|
73
|
+
content: html `<edgeless-selection-pane-tool-button
|
|
74
|
+
.edgeless=${block}
|
|
75
|
+
></edgeless-selection-pane-tool-button>`,
|
|
76
|
+
menu: menu.action({
|
|
77
|
+
name: translateKey(block.std, ...SELECTION_PANE_TITLE),
|
|
78
|
+
prefix: LayerIcon(),
|
|
79
|
+
select: () => toggleSelectionPane(block.std),
|
|
80
|
+
}),
|
|
81
|
+
enable: !!block.std.getOptional(SelectionPaneProvider),
|
|
82
|
+
}));
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { type RootBlockModel } from '../../affine-model/index.js';
|
|
2
|
+
import { WidgetComponent } from '../../std/index.js';
|
|
3
|
+
import { nothing } from 'lit';
|
|
4
|
+
export declare const EDGELESS_SELECTION_PANE_WIDGET = "edgeless-selection-pane-widget";
|
|
5
|
+
/**
|
|
6
|
+
* The **selection pane** (ADR 0031, stage 2): the canvas elements by z-order,
|
|
7
|
+
* top first, the library's own panel behind `SelectionPaneProvider`.
|
|
8
|
+
*
|
|
9
|
+
* ## Docked like the artefact catalogue
|
|
10
|
+
*
|
|
11
|
+
* A full-height column down the left edge of the editor, inside it — the
|
|
12
|
+
* geometry, layer, zero-width host and wheel capture are the catalogue's, for
|
|
13
|
+
* the catalogue's reasons (see `artefact-catalogue-widget.ts`). What differs
|
|
14
|
+
* is the dismissal: the pane is a place you WORK from, its selection mirrors
|
|
15
|
+
* the canvas both ways, so a click on the canvas does not put it away. × and
|
|
16
|
+
* Escape (with the pointer or focus in the pane) do.
|
|
17
|
+
*
|
|
18
|
+
* ## Rows
|
|
19
|
+
*
|
|
20
|
+
* Drawn from `selectionPaneTree(std)` — the same headless tree a host pane
|
|
21
|
+
* would draw — and labelled at render time ({@link selectionPaneRowLabel}).
|
|
22
|
+
* A group or a mindmap is a collapsible row; collapse is this panel's state,
|
|
23
|
+
* never stored. Hover highlights the element on the canvas, click selects it
|
|
24
|
+
* (shift / ctrl / cmd adds or removes it, like on the canvas), the padlock
|
|
25
|
+
* locks that row alone, a double-click renames a group or a frame (a frame is
|
|
26
|
+
* a row at its place in the stack, ADR 0031 amendments), and a drag moves a row
|
|
27
|
+
* among its siblings. Every write goes through `runCommand`, so the read-only
|
|
28
|
+
* refusal and the undo step live in one place.
|
|
29
|
+
*/
|
|
30
|
+
export declare class EdgelessSelectionPaneWidget extends WidgetComponent<RootBlockModel> {
|
|
31
|
+
static styles: import("lit").CSSResult;
|
|
32
|
+
private accessor _open;
|
|
33
|
+
/** Group rows the user folded. UI state, never stored. */
|
|
34
|
+
private accessor _collapsed;
|
|
35
|
+
/** The frame the list is narrowed to, or `null`. */
|
|
36
|
+
private accessor _filter;
|
|
37
|
+
/** The group row being renamed, or `null`. */
|
|
38
|
+
private accessor _renaming;
|
|
39
|
+
/** Where the dragged row would land. */
|
|
40
|
+
private accessor _drop;
|
|
41
|
+
/** Where the dragged row's ghost is drawn, in the panel's own box. */
|
|
42
|
+
private accessor _ghost;
|
|
43
|
+
/** Bumped when the canvas selection changes, so the rows repaint. */
|
|
44
|
+
private accessor _selectionRevision;
|
|
45
|
+
private _drag;
|
|
46
|
+
/** The rows of the last render, top first: what a drag hit-tests. */
|
|
47
|
+
private _visibleRows;
|
|
48
|
+
/** The sibling lists before the filter: what a drop is computed in. */
|
|
49
|
+
private _lists;
|
|
50
|
+
/** A drag ends with a click on the row it started on; that click is not one. */
|
|
51
|
+
private _swallowNextClick;
|
|
52
|
+
get paneOpen(): boolean;
|
|
53
|
+
private get _gfx();
|
|
54
|
+
private _setOpen;
|
|
55
|
+
/** Show the pane. Called through `SelectionPaneProvider` only. */
|
|
56
|
+
openPanel(): void;
|
|
57
|
+
/** Put the pane away. Writes nothing but its own state. */
|
|
58
|
+
readonly closePanel: () => void;
|
|
59
|
+
private readonly _swallow;
|
|
60
|
+
private readonly _onHostKeydown;
|
|
61
|
+
/** Same capture as the catalogue: a wheel over the pane scrolls the pane. */
|
|
62
|
+
private readonly _onHostWheel;
|
|
63
|
+
private _wire;
|
|
64
|
+
connectedCallback(): void;
|
|
65
|
+
firstUpdated(): void;
|
|
66
|
+
disconnectedCallback(): void;
|
|
67
|
+
private _highlight;
|
|
68
|
+
private _clearHighlight;
|
|
69
|
+
private _select;
|
|
70
|
+
private _run;
|
|
71
|
+
/**
|
|
72
|
+
* The visible rows of `nodes` (the tree as filtered), with `full` the tree
|
|
73
|
+
* before the filter: what tells a layer emptied by the filter from an empty
|
|
74
|
+
* one.
|
|
75
|
+
*/
|
|
76
|
+
private _rows;
|
|
77
|
+
private _toggleCollapsed;
|
|
78
|
+
private _onRowClick;
|
|
79
|
+
private _onRowDblClick;
|
|
80
|
+
/** A layer's name — the default layer's seed while it has no record. */
|
|
81
|
+
private _layerName;
|
|
82
|
+
private _onLockClick;
|
|
83
|
+
/**
|
|
84
|
+
* Hide this row for this viewer, or show it again. Not refused on a
|
|
85
|
+
* read-only document: nothing reaches the document (ADR 0031 §8).
|
|
86
|
+
*/
|
|
87
|
+
private _onEyeClick;
|
|
88
|
+
/**
|
|
89
|
+
* The row's menu: the actions that write to the DOCUMENT for every viewer,
|
|
90
|
+
* kept off the row's quick toggles so they are never one stray click away.
|
|
91
|
+
* "Hide for everyone" is painted with the theme warning tokens (ADR 0031,
|
|
92
|
+
* resolved at acceptance). A read-only document offers none of them, so the
|
|
93
|
+
* menu does not open there.
|
|
94
|
+
*/
|
|
95
|
+
private _openRowMenu;
|
|
96
|
+
/**
|
|
97
|
+
* "Hide for everyone" (or "Show for everyone"), in a row's or a layer's
|
|
98
|
+
* menu alike: painted with the warning tokens, and written on the element
|
|
99
|
+
* or on the layer's record (`hidden: true`) depending on the row.
|
|
100
|
+
*/
|
|
101
|
+
private _hideForEveryoneItem;
|
|
102
|
+
/**
|
|
103
|
+
* A layer's menu (ADR 0031 stage 7): "Hide for everyone" — `hidden: true`
|
|
104
|
+
* on the record, painted with the warning tokens like the element entry —
|
|
105
|
+
* and "Delete layer", which takes the members with it in one undo step.
|
|
106
|
+
* The default layer cannot be deleted, so its menu has no such entry.
|
|
107
|
+
*/
|
|
108
|
+
private _openLayerMenu;
|
|
109
|
+
private _onRowContextMenu;
|
|
110
|
+
private _commitRename;
|
|
111
|
+
private readonly _onRenameKeydown;
|
|
112
|
+
private _onRowPointerDown;
|
|
113
|
+
/**
|
|
114
|
+
* Which model stands for a row in the dragged row's own stack — the stack
|
|
115
|
+
* `canvas.element.reorder` restacks it in, the models sharing its raw
|
|
116
|
+
* `group` — or `undefined` for a row outside it. A frame's members paint
|
|
117
|
+
* together right above the frame, so for a loose element they stand for
|
|
118
|
+
* their frame. `null` when the dragged row cannot be restacked at all (a
|
|
119
|
+
* mindmap node moves with its mindmap).
|
|
120
|
+
*/
|
|
121
|
+
private _stackOf;
|
|
122
|
+
/** Where a release at `(clientX, clientY)` would land the dragged row. */
|
|
123
|
+
private _dropAt;
|
|
124
|
+
private _moveGhost;
|
|
125
|
+
private readonly _onDocumentPointerMove;
|
|
126
|
+
/** A canvas row picked up is selected, as the frame panel selects a card. */
|
|
127
|
+
private _pickUp;
|
|
128
|
+
private readonly _onDocumentPointerUp;
|
|
129
|
+
/**
|
|
130
|
+
* One write per gesture, through the command: `layer` for a drop into a
|
|
131
|
+
* layer, one `index` for a slot. The command writes nothing when the slot
|
|
132
|
+
* is where the row already is, and a refused drop never reaches it.
|
|
133
|
+
*/
|
|
134
|
+
private _commitDrop;
|
|
135
|
+
private _endDrag;
|
|
136
|
+
private _renderGhost;
|
|
137
|
+
private _renderDropIndicator;
|
|
138
|
+
private _filterName;
|
|
139
|
+
private _filterWording;
|
|
140
|
+
private readonly _openFilterMenu;
|
|
141
|
+
/**
|
|
142
|
+
* A user layer's row (ADR 0031 §2): its name, renamed in place with a
|
|
143
|
+
* double-click; a click makes it the active layer; collapsible like a
|
|
144
|
+
* group (UI state, never stored); dragged among the layers to reorder, and
|
|
145
|
+
* the drop target of a canvas row dragged onto it. The default layer's row
|
|
146
|
+
* is drawn the same before it has a record (ADR 0031 amendments): its
|
|
147
|
+
* rename or "hide for everyone" is what records it.
|
|
148
|
+
*/
|
|
149
|
+
private _renderLayerRow;
|
|
150
|
+
/** A row's name, or the field that renames it in place. */
|
|
151
|
+
private _renderName;
|
|
152
|
+
/** A row's eye: hide it, or the whole layer, for this viewer only. */
|
|
153
|
+
private _renderEye;
|
|
154
|
+
private _renderRow;
|
|
155
|
+
updated(): void;
|
|
156
|
+
/**
|
|
157
|
+
* One header action, in the frame panel's icon button
|
|
158
|
+
* (`header/frame-panel-header.ts`): a 20px glyph in `edgeless-tool-icon-button`,
|
|
159
|
+
* secondary until hovered, its tooltip above it, a wash while active.
|
|
160
|
+
*/
|
|
161
|
+
private _renderHeadButton;
|
|
162
|
+
/**
|
|
163
|
+
* "New layer": create it, then open its name for editing — the frame
|
|
164
|
+
* panel's inline title editor, as a double-click does — so the creation is
|
|
165
|
+
* unmistakable even under a filter (ADR 0031, amendments).
|
|
166
|
+
*/
|
|
167
|
+
private readonly _createLayer;
|
|
168
|
+
render(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
169
|
+
}
|
|
170
|
+
export declare const edgelessSelectionPaneWidget: import("../../store/index.js").ExtensionType;
|