@formicoidea/labre-core 0.43.1 → 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-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/configs/toolbar.js +11 -2
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +11 -2
- 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-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-frame/frame-manager.d.ts +5 -0
- package/dist/_pkgs/affine-block-frame/frame-manager.js +48 -17
- 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-note/translations.d.ts +0 -1
- package/dist/_pkgs/affine-block-note/translations.js +0 -5
- 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/keyboard/commands.js +9 -6
- package/dist/_pkgs/affine-block-root/preview/edgeless-root-preview-block.js +15 -2
- 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/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.d.ts +112 -4
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +86 -15
- 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/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/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/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/surface-ref-block.js +12 -2
- package/dist/_pkgs/affine-components/context-menu/button.js +14 -0
- package/dist/_pkgs/affine-components/filterable-list/index.js +30 -9
- 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/text.d.ts +1 -0
- package/dist/_pkgs/affine-components/icons/text.js +11 -0
- package/dist/_pkgs/affine-fragment-adapter-panel/adapter-panel.d.ts +2 -2
- package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card.js +2 -2
- 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-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 +3 -2
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +1 -1
- package/dist/_pkgs/affine-gfx-group/command/group-api.js +52 -1
- 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 +1 -1
- 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-text/edgeless-text-editor.js +2 -1
- 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 +53 -2
- 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-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 +26 -0
- package/dist/_pkgs/affine-model/consts/text.js +25 -0
- 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/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/translation-service/chrome.d.ts +5 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +9 -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-selected-rect/utils.js +10 -3
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +25 -49
- 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/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 +52 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.js +161 -1
- package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +10 -0
- package/dist/_pkgs/affine-widget-note-slicer/note-slicer.js +7 -3
- 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/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 +4 -1
- package/dist/translations.js +10 -6
- package/package.json +9 -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,68 @@
|
|
|
1
|
+
import type { Store } from '../../../../store/index.js';
|
|
2
|
+
import type { GfxModel } from '../model.js';
|
|
3
|
+
import type { SurfaceBlockModel } from './surface-model.js';
|
|
4
|
+
/**
|
|
5
|
+
* The layer every element belongs to while it names none (ADR 0031 §2, §3).
|
|
6
|
+
* A `@` cannot appear in a nanoid, so it never collides with a real layer id;
|
|
7
|
+
* it has no record while the surface has no `layers`, and is written as
|
|
8
|
+
* `undefined` on an element, never as this string.
|
|
9
|
+
*/
|
|
10
|
+
export declare const DEFAULT_LAYER_ID = "@default";
|
|
11
|
+
/** One user layer, stored on the surface under its id (ADR 0031 §2). */
|
|
12
|
+
export type SurfaceLayerRecord = {
|
|
13
|
+
/** Seeded through the translation seam at creation; content from then on. */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Fractional key, bottom → top; the same alphabet as an element's `index`. */
|
|
16
|
+
index: string;
|
|
17
|
+
/** "Hide for everyone" on the whole layer. Absent = visible. */
|
|
18
|
+
hidden?: true;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* What a model names as its own layer: an element's `layer` field, a gfx
|
|
22
|
+
* block's `layer` prop. `undefined` = the default layer.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ownLayerOf(model: unknown): string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The model whose `layer` decides `model`'s (ADR 0031 §5): its outermost
|
|
27
|
+
* group-like ELEMENT ancestor (a group, a mindmap), else `model` itself. A
|
|
28
|
+
* group lives in one layer, stored once on its outermost group, so this is
|
|
29
|
+
* what {@link SurfaceUserLayers.effectiveLayerOf} reads and what a "move to
|
|
30
|
+
* layer" writes on. Frames are blocks and do not count. `groups` walks the
|
|
31
|
+
* model's surface, which throws on a detached model: that one carries itself.
|
|
32
|
+
*/
|
|
33
|
+
export declare function layerCarrierOf(model: GfxModel): GfxModel;
|
|
34
|
+
/**
|
|
35
|
+
* The user layers of one surface, resolved for the comparator (ADR 0031 §4).
|
|
36
|
+
*
|
|
37
|
+
* Two caches, both thrown away by a revision bump rather than kept in step:
|
|
38
|
+
*
|
|
39
|
+
* - the rank of every layer id (its record's `index`), rebuilt when the
|
|
40
|
+
* `layers` prop changes — `null` while the surface has no layer, which is
|
|
41
|
+
* the fast path: `compare` then never asks for an effective layer at all;
|
|
42
|
+
* - each model's EFFECTIVE layer, rebuilt when anything that decides it
|
|
43
|
+
* changes: a `layer` write, a regroup, an element added or removed.
|
|
44
|
+
*
|
|
45
|
+
* The effective layer is the `layer` of the model's outermost group-like
|
|
46
|
+
* ELEMENT ancestor (a group, a mindmap), else its own; a dangling id or none
|
|
47
|
+
* is {@link DEFAULT_LAYER_ID}. Frames are not counted: a frame is a slide,
|
|
48
|
+
* and a background layer under a content layer inside one frame is the point
|
|
49
|
+
* of layers. Nothing here writes: a dangling id is read as the default and
|
|
50
|
+
* left as it is.
|
|
51
|
+
*/
|
|
52
|
+
export declare class SurfaceUserLayers {
|
|
53
|
+
private readonly _surface;
|
|
54
|
+
private _ranks;
|
|
55
|
+
private _revision;
|
|
56
|
+
private readonly _effective;
|
|
57
|
+
constructor(_surface: SurfaceBlockModel);
|
|
58
|
+
/** Every layer id with its rank key, or `null` when there is no layer. */
|
|
59
|
+
get ranks(): ReadonlyMap<string, string> | null;
|
|
60
|
+
/** The `layers` record changed: ranks and effective layers are stale. */
|
|
61
|
+
invalidateRanks(): void;
|
|
62
|
+
/** Something that decides an effective layer changed. */
|
|
63
|
+
invalidateMembership(): void;
|
|
64
|
+
/** The layer `model` stacks and shows with. */
|
|
65
|
+
effectiveLayerOf(model: GfxModel): string;
|
|
66
|
+
}
|
|
67
|
+
export declare function registerSurfaceOfStore(store: Store, surface: SurfaceBlockModel): void;
|
|
68
|
+
export declare function userLayersOf(model: unknown): SurfaceUserLayers | null;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { GfxPrimitiveElementModel } from './element-model.js';
|
|
2
|
+
/**
|
|
3
|
+
* The layer every element belongs to while it names none (ADR 0031 §2, §3).
|
|
4
|
+
* A `@` cannot appear in a nanoid, so it never collides with a real layer id;
|
|
5
|
+
* it has no record while the surface has no `layers`, and is written as
|
|
6
|
+
* `undefined` on an element, never as this string.
|
|
7
|
+
*/
|
|
8
|
+
export const DEFAULT_LAYER_ID = '@default';
|
|
9
|
+
/**
|
|
10
|
+
* What a model names as its own layer: an element's `layer` field, a gfx
|
|
11
|
+
* block's `layer` prop. `undefined` = the default layer.
|
|
12
|
+
*/
|
|
13
|
+
export function ownLayerOf(model) {
|
|
14
|
+
if (model instanceof GfxPrimitiveElementModel)
|
|
15
|
+
return model.layer;
|
|
16
|
+
try {
|
|
17
|
+
const props = model.props;
|
|
18
|
+
return typeof props?.layer === 'string' ? props.layer : undefined;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The model whose `layer` decides `model`'s (ADR 0031 §5): its outermost
|
|
26
|
+
* group-like ELEMENT ancestor (a group, a mindmap), else `model` itself. A
|
|
27
|
+
* group lives in one layer, stored once on its outermost group, so this is
|
|
28
|
+
* what {@link SurfaceUserLayers.effectiveLayerOf} reads and what a "move to
|
|
29
|
+
* layer" writes on. Frames are blocks and do not count. `groups` walks the
|
|
30
|
+
* model's surface, which throws on a detached model: that one carries itself.
|
|
31
|
+
*/
|
|
32
|
+
export function layerCarrierOf(model) {
|
|
33
|
+
let groups = [];
|
|
34
|
+
try {
|
|
35
|
+
groups = model.groups ?? [];
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
groups = [];
|
|
39
|
+
}
|
|
40
|
+
for (let i = groups.length - 1; i >= 0; i--) {
|
|
41
|
+
if (groups[i] instanceof GfxPrimitiveElementModel) {
|
|
42
|
+
return groups[i];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return model;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The user layers of one surface, resolved for the comparator (ADR 0031 §4).
|
|
49
|
+
*
|
|
50
|
+
* Two caches, both thrown away by a revision bump rather than kept in step:
|
|
51
|
+
*
|
|
52
|
+
* - the rank of every layer id (its record's `index`), rebuilt when the
|
|
53
|
+
* `layers` prop changes — `null` while the surface has no layer, which is
|
|
54
|
+
* the fast path: `compare` then never asks for an effective layer at all;
|
|
55
|
+
* - each model's EFFECTIVE layer, rebuilt when anything that decides it
|
|
56
|
+
* changes: a `layer` write, a regroup, an element added or removed.
|
|
57
|
+
*
|
|
58
|
+
* The effective layer is the `layer` of the model's outermost group-like
|
|
59
|
+
* ELEMENT ancestor (a group, a mindmap), else its own; a dangling id or none
|
|
60
|
+
* is {@link DEFAULT_LAYER_ID}. Frames are not counted: a frame is a slide,
|
|
61
|
+
* and a background layer under a content layer inside one frame is the point
|
|
62
|
+
* of layers. Nothing here writes: a dangling id is read as the default and
|
|
63
|
+
* left as it is.
|
|
64
|
+
*/
|
|
65
|
+
export class SurfaceUserLayers {
|
|
66
|
+
constructor(_surface) {
|
|
67
|
+
this._surface = _surface;
|
|
68
|
+
this._ranks = undefined;
|
|
69
|
+
this._revision = 0;
|
|
70
|
+
this._effective = new WeakMap();
|
|
71
|
+
}
|
|
72
|
+
/** Every layer id with its rank key, or `null` when there is no layer. */
|
|
73
|
+
get ranks() {
|
|
74
|
+
if (this._ranks === undefined) {
|
|
75
|
+
const layers = this._surface.props.layers;
|
|
76
|
+
if (!layers || Object.keys(layers).length === 0) {
|
|
77
|
+
this._ranks = null;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
const ranks = new Map();
|
|
81
|
+
for (const [id, record] of Object.entries(layers)) {
|
|
82
|
+
if (record && typeof record.index === 'string') {
|
|
83
|
+
ranks.set(id, record.index);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
this._ranks = ranks.size ? ranks : null;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return this._ranks;
|
|
90
|
+
}
|
|
91
|
+
/** The `layers` record changed: ranks and effective layers are stale. */
|
|
92
|
+
invalidateRanks() {
|
|
93
|
+
this._ranks = undefined;
|
|
94
|
+
this._revision++;
|
|
95
|
+
}
|
|
96
|
+
/** Something that decides an effective layer changed. */
|
|
97
|
+
invalidateMembership() {
|
|
98
|
+
this._revision++;
|
|
99
|
+
}
|
|
100
|
+
/** The layer `model` stacks and shows with. */
|
|
101
|
+
effectiveLayerOf(model) {
|
|
102
|
+
const cached = this._effective.get(model);
|
|
103
|
+
if (cached && cached.revision === this._revision)
|
|
104
|
+
return cached.layer;
|
|
105
|
+
const named = ownLayerOf(layerCarrierOf(model));
|
|
106
|
+
const ranks = this.ranks;
|
|
107
|
+
const layer = named !== undefined && ranks?.has(named) ? named : DEFAULT_LAYER_ID;
|
|
108
|
+
this._effective.set(model, { revision: this._revision, layer });
|
|
109
|
+
return layer;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Which surface a model's layers are read from. An element knows its
|
|
114
|
+
* surface; a gfx block knows its store, and the surface registers itself for
|
|
115
|
+
* its store when it initialises, so the comparator never queries the store.
|
|
116
|
+
*/
|
|
117
|
+
const SURFACE_OF_STORE = new WeakMap();
|
|
118
|
+
export function registerSurfaceOfStore(store, surface) {
|
|
119
|
+
SURFACE_OF_STORE.set(store, surface);
|
|
120
|
+
}
|
|
121
|
+
export function userLayersOf(model) {
|
|
122
|
+
if (model instanceof GfxPrimitiveElementModel) {
|
|
123
|
+
return model.surface?.userLayers ?? null;
|
|
124
|
+
}
|
|
125
|
+
const store = model.store;
|
|
126
|
+
return store ? (SURFACE_OF_STORE.get(store)?.userLayers ?? null) : null;
|
|
127
|
+
}
|
|
@@ -8,6 +8,16 @@ export declare function getLayerEndZIndex(layers: Layer[], layerIndex: number):
|
|
|
8
8
|
export declare function updateLayersZIndex(layers: Layer[], startIdx: number): void;
|
|
9
9
|
export declare function getElementIndex(indexable: GfxModel): string;
|
|
10
10
|
export declare function ungroupIndex(index: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Insert `element` after every element that sorts before it or ties with it.
|
|
13
|
+
*
|
|
14
|
+
* The array is kept sorted by `compare`, so that predicate holds on a prefix
|
|
15
|
+
* and the position is found by bisection. The linear scan it replaces asked
|
|
16
|
+
* `compare` (which walks both elements' group chains) of every element on
|
|
17
|
+
* every insert: a paste of N elements was N² comparisons. Where an index is
|
|
18
|
+
* shared by two unrelated subtrees `compare` is not transitive and both pick
|
|
19
|
+
* a tied position, not always the same one (layer-ordered-insert.unit.spec).
|
|
20
|
+
*/
|
|
11
21
|
export declare function insertToOrderedArray(array: GfxModel[], element: GfxModel): void;
|
|
12
22
|
export declare function removeFromOrderedArray(array: GfxModel[], element: GfxModel): void;
|
|
13
23
|
export declare enum SortOrder {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isGfxGroupCompatibleModel, } from '../gfx/model/base.js';
|
|
2
2
|
import {} from '../gfx/model/gfx-block-model.js';
|
|
3
3
|
import { GfxLocalElementModel } from '../gfx/model/surface/local-element-model.js';
|
|
4
|
+
import { userLayersOf } from '../gfx/model/surface/user-layers.js';
|
|
4
5
|
export function getLayerEndZIndex(layers, layerIndex) {
|
|
5
6
|
const layer = layers[layerIndex];
|
|
6
7
|
return layer ? layer.zIndex + layer.elements.length - 1 : 0;
|
|
@@ -28,13 +29,29 @@ export function getElementIndex(indexable) {
|
|
|
28
29
|
export function ungroupIndex(index) {
|
|
29
30
|
return index.split('-')[0];
|
|
30
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Insert `element` after every element that sorts before it or ties with it.
|
|
34
|
+
*
|
|
35
|
+
* The array is kept sorted by `compare`, so that predicate holds on a prefix
|
|
36
|
+
* and the position is found by bisection. The linear scan it replaces asked
|
|
37
|
+
* `compare` (which walks both elements' group chains) of every element on
|
|
38
|
+
* every insert: a paste of N elements was N² comparisons. Where an index is
|
|
39
|
+
* shared by two unrelated subtrees `compare` is not transitive and both pick
|
|
40
|
+
* a tied position, not always the same one (layer-ordered-insert.unit.spec).
|
|
41
|
+
*/
|
|
31
42
|
export function insertToOrderedArray(array, element) {
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
let low = 0;
|
|
44
|
+
let high = array.length;
|
|
45
|
+
while (low < high) {
|
|
46
|
+
const mid = (low + high) >>> 1;
|
|
47
|
+
if (compare(array[mid], element) === SortOrder.AFTER) {
|
|
48
|
+
high = mid;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
low = mid + 1;
|
|
52
|
+
}
|
|
36
53
|
}
|
|
37
|
-
array.splice(
|
|
54
|
+
array.splice(low, 0, element);
|
|
38
55
|
}
|
|
39
56
|
export function removeFromOrderedArray(array, element) {
|
|
40
57
|
const idx = array.indexOf(element);
|
|
@@ -74,10 +91,40 @@ function compareLocal(a, b) {
|
|
|
74
91
|
if (isALocal && isBLocal && a.creator && a.creator === b.creator) {
|
|
75
92
|
return compareIndex(a.index, b.index);
|
|
76
93
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
94
|
+
const left = isALocal && a.creator ? a.creator : a;
|
|
95
|
+
const right = isBLocal && b.creator ? b.creator : b;
|
|
96
|
+
// ADR 0031 §4: user layer rank first, then everything below unchanged.
|
|
97
|
+
const byLayer = compareUserLayer(left, right);
|
|
98
|
+
if (byLayer !== SortOrder.SAME)
|
|
99
|
+
return byLayer;
|
|
100
|
+
return { a: left, b: right };
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The first step of {@link compare} (ADR 0031 §4): two models in different
|
|
104
|
+
* user layers stack by their layers' `index`; anything else is `SAME`, and
|
|
105
|
+
* today's comparator decides.
|
|
106
|
+
*
|
|
107
|
+
* The fast path is the first `return`: a surface with no `layers` answers
|
|
108
|
+
* `null` ranks after one cached read, so a document without user layers
|
|
109
|
+
* sorts with exactly the code that sorted it before layers existed. A local
|
|
110
|
+
* element without a creator has no layer and keeps today's order — above the
|
|
111
|
+
* content, as overlays always were.
|
|
112
|
+
*/
|
|
113
|
+
function compareUserLayer(a, b) {
|
|
114
|
+
if (a instanceof GfxLocalElementModel || b instanceof GfxLocalElementModel) {
|
|
115
|
+
return SortOrder.SAME;
|
|
116
|
+
}
|
|
117
|
+
const layers = userLayersOf(a);
|
|
118
|
+
const ranks = layers?.ranks;
|
|
119
|
+
if (!layers || !ranks)
|
|
120
|
+
return SortOrder.SAME;
|
|
121
|
+
const aLayer = layers.effectiveLayerOf(a);
|
|
122
|
+
const bLayer = layers.effectiveLayerOf(b);
|
|
123
|
+
if (aLayer === bLayer)
|
|
124
|
+
return SortOrder.SAME;
|
|
125
|
+
// A default layer with no record (the loser of a first-layer race, ADR
|
|
126
|
+
// 0031 open point 6) stacks at the bottom: `''` precedes every key.
|
|
127
|
+
return compareIndex(ranks.get(aLayer) ?? '', ranks.get(bLayer) ?? '');
|
|
81
128
|
}
|
|
82
129
|
/**
|
|
83
130
|
* A comparator function for sorting elements in the surface.
|
|
@@ -91,15 +138,19 @@ export function compare(a, b) {
|
|
|
91
138
|
}
|
|
92
139
|
a = result.a;
|
|
93
140
|
b = result.b;
|
|
94
|
-
|
|
141
|
+
// Each `groups` read walks the group chain through `getGroup`, a scan of
|
|
142
|
+
// every container on the surface: read each side once.
|
|
143
|
+
const aGroups = a.groups;
|
|
144
|
+
const bGroups = b.groups;
|
|
145
|
+
if (isGfxGroupCompatibleModel(a) &&
|
|
146
|
+
bGroups.includes(a)) {
|
|
95
147
|
return SortOrder.BEFORE;
|
|
96
148
|
}
|
|
97
|
-
else if (isGfxGroupCompatibleModel(b) &&
|
|
149
|
+
else if (isGfxGroupCompatibleModel(b) &&
|
|
150
|
+
aGroups.includes(b)) {
|
|
98
151
|
return SortOrder.AFTER;
|
|
99
152
|
}
|
|
100
153
|
else {
|
|
101
|
-
const aGroups = a.groups;
|
|
102
|
-
const bGroups = b.groups;
|
|
103
154
|
let i = 1;
|
|
104
155
|
let aGroup = aGroups.at(-i);
|
|
105
156
|
let bGroup = bGroups.at(-i);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { BlockSuiteError, ErrorCode } from '../../../global/exceptions/index.js';
|
|
3
3
|
import { Bound } from '../../../global/gfx/index.js';
|
|
4
|
-
import { computed, effect, signal } from '@preact/signals-core';
|
|
4
|
+
import { computed, effect, signal, untracked } from '@preact/signals-core';
|
|
5
5
|
import { nothing } from 'lit';
|
|
6
6
|
import { GfxControllerIdentifier } from '../../gfx/identifiers.js';
|
|
7
7
|
import { SurfaceSelection } from '../../selection/index.js';
|
|
@@ -25,7 +25,10 @@ function updateZIndex(element) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
function updateBlockVisibility(view) {
|
|
28
|
-
|
|
28
|
+
// Read inside the effect below, so a local hide or show repaints the block
|
|
29
|
+
// without a transform change (ADR 0031 §8).
|
|
30
|
+
const hiddenLocally = view.gfx.localVisibility.isHidden(view.model);
|
|
31
|
+
if (view.transformState$.value === 'active' && !hiddenLocally) {
|
|
29
32
|
view.style.visibility = 'visible';
|
|
30
33
|
view.style.pointerEvents = 'auto';
|
|
31
34
|
view.classList.remove('block-idle');
|
|
@@ -47,12 +50,17 @@ function handleGfxConnection(instance) {
|
|
|
47
50
|
if (id === instance.model.id && type === 'update') {
|
|
48
51
|
updateTransform(instance);
|
|
49
52
|
updateZIndex(instance);
|
|
53
|
+
// A move to another user layer may hide or show it (ADR 0031 §7).
|
|
54
|
+
untracked(() => updateBlockVisibility(instance));
|
|
50
55
|
}
|
|
51
56
|
}));
|
|
52
57
|
// A reorder changes no property of this block, only the layer it sits in,
|
|
53
58
|
// so the stacking has to be read back from the layer manager.
|
|
54
59
|
instance.disposables.add(instance.gfx.layer.slots.layerUpdated.subscribe(() => {
|
|
55
60
|
updateZIndex(instance);
|
|
61
|
+
// So may a regroup, or a change of the layer list (a layer hidden for
|
|
62
|
+
// everyone is one record write, not a write on this block).
|
|
63
|
+
untracked(() => updateBlockVisibility(instance));
|
|
56
64
|
}));
|
|
57
65
|
instance.disposables.add(effect(() => {
|
|
58
66
|
updateBlockVisibility(instance);
|
package/dist/commands.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { copyLinkCommands, coreCommands, pivotCommands, readingCommands, tagCommands, } from './_pkgs/affine-block-root/index.js';
|
|
2
|
-
import { auditCommands, exportSvgCommands, mapQualityCommands, } from './_pkgs/affine-block-surface/index.js';
|
|
2
|
+
import { auditCommands, canvasGridCommands, exportSvgCommands, mapQualityCommands, selectionPaneCommands, userLayerCommands, } from './_pkgs/affine-block-surface/index.js';
|
|
3
3
|
import { edgeDirectionCommands } from './_pkgs/affine-gfx-connector/index.js';
|
|
4
4
|
import { shapeCommands } from './_pkgs/affine-gfx-shape/index.js';
|
|
5
5
|
import { toCommandManifestEntry, } from './_pkgs/std/index.js';
|
|
@@ -54,6 +54,9 @@ export function getCommands(flags) {
|
|
|
54
54
|
...shapeCommands,
|
|
55
55
|
...mapQualityCommands,
|
|
56
56
|
...exportSvgCommands,
|
|
57
|
+
...selectionPaneCommands,
|
|
58
|
+
...canvasGridCommands,
|
|
59
|
+
...userLayerCommands,
|
|
57
60
|
...edgeDirectionCommands,
|
|
58
61
|
...(isCapabilityEnabled(flags, 'ai-audit') ? auditCommands : []),
|
|
59
62
|
], FRAMEWORK_COMMAND_GROUPS, flags);
|
package/dist/translations.js
CHANGED
|
@@ -4,7 +4,7 @@ import { EMBED_WORDINGS } from './_pkgs/affine-block-embed/translations.js';
|
|
|
4
4
|
import { EMBED_DOC_WORDINGS } from './_pkgs/affine-block-embed-doc/translations.js';
|
|
5
5
|
import { FRAME_CHROME_WORDINGS, FRAME_WORDINGS, } from './_pkgs/affine-block-frame/translations.js';
|
|
6
6
|
import { IMAGE_WORDINGS } from './_pkgs/affine-block-image/translations.js';
|
|
7
|
-
import { EXEMPTION_FALLBACK, PROVENANCE_FALLBACK, SEVERITY_FALLBACK, SVG_SKETCH_WORDINGS, } from './_pkgs/affine-block-surface/index.js';
|
|
7
|
+
import { EXEMPTION_FALLBACK, EXPORT_SVG_WORDINGS, PROVENANCE_FALLBACK, READING_FRAME_WORDINGS, SEVERITY_FALLBACK, SVG_SKETCH_WORDINGS, USER_LAYER_SEED_WORDINGS, } from './_pkgs/affine-block-surface/index.js';
|
|
8
8
|
import { SURFACE_REF_CHROME_WORDINGS, SURFACE_REF_WORDINGS, } from './_pkgs/affine-block-surface-ref/translations.js';
|
|
9
9
|
import { ADAPTER_PANEL_WORDINGS } from './_pkgs/affine-fragment-adapter-panel/translations.js';
|
|
10
10
|
import { DOC_TITLE_WORDINGS } from './_pkgs/affine-fragment-doc-title/translations.js';
|
|
@@ -158,7 +158,11 @@ const CHROME_KEYS = [
|
|
|
158
158
|
['com.labre.reading.field.nature', 'Nature'],
|
|
159
159
|
['com.labre.reading.field.relations', 'Parent-child relations'],
|
|
160
160
|
['com.labre.reading.field.value-flow', 'Value flow'],
|
|
161
|
-
|
|
161
|
+
// `com.labre.reading.field.phase` and `com.labre.reading.phase.none` are the
|
|
162
|
+
// reading engine's DEFAULT frame wording, declared beside it in the surface
|
|
163
|
+
// package (`READING_FRAME_WORDINGS`) and walked from `PACKAGE_WORDINGS`: a
|
|
164
|
+
// profile that names no frame wording — Wardley's, a 0.43 host's — reads
|
|
165
|
+
// with them, whether or not a framework bundle is installed.
|
|
162
166
|
['com.labre.reading.field.naming', 'Naming convention'],
|
|
163
167
|
['com.labre.reading.field.record', 'Record'],
|
|
164
168
|
['com.labre.reading.field.drift', 'Drift'],
|
|
@@ -182,10 +186,7 @@ const CHROME_KEYS = [
|
|
|
182
186
|
['com.labre.reading.value-flow', 'Value flows up from'],
|
|
183
187
|
['com.labre.reading.value-flow.to', 'to'],
|
|
184
188
|
['com.labre.reading.phase.band', 'In the zone of punctuated equilibrium'],
|
|
185
|
-
[
|
|
186
|
-
'com.labre.reading.phase.none',
|
|
187
|
-
'Not on a framework background — no phase to read.',
|
|
188
|
-
],
|
|
189
|
+
['com.labre.reading.zone.unnamed', 'Unnamed'],
|
|
189
190
|
[
|
|
190
191
|
'com.labre.reading.naming.conforms',
|
|
191
192
|
'The name follows the convention of its nature.',
|
|
@@ -303,6 +304,8 @@ const PACKAGE_WORDINGS = [
|
|
|
303
304
|
POINTER_WORDINGS,
|
|
304
305
|
ROOT_CHROME_WORDINGS,
|
|
305
306
|
SVG_SKETCH_WORDINGS,
|
|
307
|
+
EXPORT_SVG_WORDINGS,
|
|
308
|
+
READING_FRAME_WORDINGS,
|
|
306
309
|
STD_WORDINGS,
|
|
307
310
|
ATTACHMENT_WORDINGS,
|
|
308
311
|
BOOKMARK_WORDINGS,
|
|
@@ -331,6 +334,7 @@ const PACKAGE_SEED_WORDINGS = [
|
|
|
331
334
|
SURFACE_REF_WORDINGS,
|
|
332
335
|
TEMPLATE_SEED_WORDINGS,
|
|
333
336
|
ROOT_SEED_WORDINGS,
|
|
337
|
+
USER_LAYER_SEED_WORDINGS,
|
|
334
338
|
];
|
|
335
339
|
/**
|
|
336
340
|
* Every i18n key THIS package can ask the host for, with its English fallback
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formicoidea/labre-core",
|
|
3
3
|
"description": "Labre editor — the full BlockSuite-derived editor as one package.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.45.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"author": "lajola",
|
|
@@ -873,6 +873,14 @@
|
|
|
873
873
|
"./_pkgs/global/utils": {
|
|
874
874
|
"types": "./dist/_pkgs/global/utils/index.d.ts",
|
|
875
875
|
"import": "./dist/_pkgs/global/utils/index.js"
|
|
876
|
+
},
|
|
877
|
+
"./_pkgs/store": {
|
|
878
|
+
"types": "./dist/_pkgs/store/index.d.ts",
|
|
879
|
+
"import": "./dist/_pkgs/store/index.js"
|
|
880
|
+
},
|
|
881
|
+
"./_pkgs/store/index.js": {
|
|
882
|
+
"types": "./dist/_pkgs/store/index.d.ts",
|
|
883
|
+
"import": "./dist/_pkgs/store/index.js"
|
|
876
884
|
}
|
|
877
885
|
},
|
|
878
886
|
"files": [
|
|
@@ -946,7 +954,6 @@
|
|
|
946
954
|
"ts-pattern": "^5.1.0",
|
|
947
955
|
"unified": "^11.0.5",
|
|
948
956
|
"unist-util-visit": "^5.0.0",
|
|
949
|
-
"vitest": "^3.2.3",
|
|
950
957
|
"w3c-keyname": "^2.2.8",
|
|
951
958
|
"y-protocols": "^1.0.6",
|
|
952
959
|
"yjs": "^13.6.21",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getAttachmentFileIconRC(filetype: string): (props: import("react").SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { FileIconAepIcon, FileIconAiIcon, FileIconAviIcon, FileIconCssIcon, FileIconCsvIcon, FileIconDmgIcon, FileIconDocIcon, FileIconDocxIcon, FileIconEpsIcon, FileIconExeIcon, FileIconFigIcon, FileIconGifIcon, FileIconHtmlIcon, FileIconInddIcon, FileIconJavaIcon, FileIconJpegIcon, FileIconJsIcon, FileIconJsonIcon, FileIconMkvIcon, FileIconMp3Icon, FileIconMp4Icon, FileIconMpegIcon, FileIconNoneIcon, FileIconPdfIcon, FileIconPngIcon, FileIconPptIcon, FileIconPptxIcon, FileIconPsdIcon, FileIconRarIcon, FileIconRssIcon, FileIconSqlIcon, FileIconSvgIcon, FileIconTiffIcon, FileIconTxtIcon, FileIconWavIcon, FileIconWebpIcon, FileIconXlsIcon, FileIconXlsxIcon, FileIconXmlIcon, FileIconZipIcon, ImageIcon, } from '@blocksuite/icons/rc';
|
|
2
|
-
export function getAttachmentFileIconRC(filetype) {
|
|
3
|
-
switch (filetype) {
|
|
4
|
-
case 'img':
|
|
5
|
-
return ImageIcon;
|
|
6
|
-
case 'image/jpeg':
|
|
7
|
-
case 'jpg':
|
|
8
|
-
case 'jpeg':
|
|
9
|
-
return FileIconJpegIcon;
|
|
10
|
-
case 'image/png':
|
|
11
|
-
case 'png':
|
|
12
|
-
return FileIconPngIcon;
|
|
13
|
-
case 'image/webp':
|
|
14
|
-
case 'webp':
|
|
15
|
-
return FileIconWebpIcon;
|
|
16
|
-
case 'image/tiff':
|
|
17
|
-
case 'tiff':
|
|
18
|
-
return FileIconTiffIcon;
|
|
19
|
-
case 'image/gif':
|
|
20
|
-
case 'gif':
|
|
21
|
-
return FileIconGifIcon;
|
|
22
|
-
case 'image/svg':
|
|
23
|
-
case 'svg':
|
|
24
|
-
return FileIconSvgIcon;
|
|
25
|
-
case 'image/eps':
|
|
26
|
-
case 'eps':
|
|
27
|
-
return FileIconEpsIcon;
|
|
28
|
-
case 'application/pdf':
|
|
29
|
-
case 'pdf':
|
|
30
|
-
return FileIconPdfIcon;
|
|
31
|
-
case 'application/msword':
|
|
32
|
-
case 'application/x-iwork-pages-sffpages':
|
|
33
|
-
case 'doc':
|
|
34
|
-
return FileIconDocIcon;
|
|
35
|
-
case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
|
|
36
|
-
case 'docx':
|
|
37
|
-
return FileIconDocxIcon;
|
|
38
|
-
case 'text/plain':
|
|
39
|
-
case 'txt':
|
|
40
|
-
return FileIconTxtIcon;
|
|
41
|
-
case 'csv':
|
|
42
|
-
return FileIconCsvIcon;
|
|
43
|
-
case 'application/vnd.ms-excel':
|
|
44
|
-
case 'xls':
|
|
45
|
-
return FileIconXlsIcon;
|
|
46
|
-
case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
|
|
47
|
-
case 'application/x-iwork-numbers-sffnumbers':
|
|
48
|
-
case 'xlsx':
|
|
49
|
-
return FileIconXlsxIcon;
|
|
50
|
-
case 'application/vnd.ms-powerpoint':
|
|
51
|
-
case 'application/x-iwork-keynote-sffkeynote':
|
|
52
|
-
case 'ppt':
|
|
53
|
-
return FileIconPptIcon;
|
|
54
|
-
case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':
|
|
55
|
-
case 'pptx':
|
|
56
|
-
return FileIconPptxIcon;
|
|
57
|
-
case 'application/illustrator':
|
|
58
|
-
case 'fig':
|
|
59
|
-
return FileIconFigIcon;
|
|
60
|
-
case 'application/postscript':
|
|
61
|
-
case 'ai':
|
|
62
|
-
return FileIconAiIcon;
|
|
63
|
-
case 'application/vnd.adobe.photoshop':
|
|
64
|
-
case 'psd':
|
|
65
|
-
return FileIconPsdIcon;
|
|
66
|
-
case 'application/vnd.adobe.indesign':
|
|
67
|
-
case 'indd':
|
|
68
|
-
return FileIconInddIcon;
|
|
69
|
-
case 'application/vnd.adobe.afterfx':
|
|
70
|
-
case 'aep':
|
|
71
|
-
return FileIconAepIcon;
|
|
72
|
-
case 'audio/mpeg':
|
|
73
|
-
case 'audio/mp3':
|
|
74
|
-
case 'mp3':
|
|
75
|
-
return FileIconMp3Icon;
|
|
76
|
-
case 'audio/wav':
|
|
77
|
-
case 'wav':
|
|
78
|
-
return FileIconWavIcon;
|
|
79
|
-
case 'video/mpeg':
|
|
80
|
-
case 'mpeg':
|
|
81
|
-
return FileIconMpegIcon;
|
|
82
|
-
case 'video/mp4':
|
|
83
|
-
case 'mp4':
|
|
84
|
-
return FileIconMp4Icon;
|
|
85
|
-
case 'video/avi':
|
|
86
|
-
case 'avi':
|
|
87
|
-
return FileIconAviIcon;
|
|
88
|
-
case 'video/mkv':
|
|
89
|
-
case 'mkv':
|
|
90
|
-
return FileIconMkvIcon;
|
|
91
|
-
case 'text/html':
|
|
92
|
-
case 'html':
|
|
93
|
-
return FileIconHtmlIcon;
|
|
94
|
-
case 'text/css':
|
|
95
|
-
case 'css':
|
|
96
|
-
return FileIconCssIcon;
|
|
97
|
-
case 'application/rss+xml':
|
|
98
|
-
case 'rss':
|
|
99
|
-
return FileIconRssIcon;
|
|
100
|
-
case 'application/sql':
|
|
101
|
-
case 'sql':
|
|
102
|
-
return FileIconSqlIcon;
|
|
103
|
-
case 'application/javascript':
|
|
104
|
-
case 'js':
|
|
105
|
-
return FileIconJsIcon;
|
|
106
|
-
case 'application/json':
|
|
107
|
-
case 'json':
|
|
108
|
-
return FileIconJsonIcon;
|
|
109
|
-
case 'application/java':
|
|
110
|
-
case 'java':
|
|
111
|
-
return FileIconJavaIcon;
|
|
112
|
-
case 'application/xml':
|
|
113
|
-
case 'xml':
|
|
114
|
-
return FileIconXmlIcon;
|
|
115
|
-
case 'application/x-msdos-program':
|
|
116
|
-
case 'exe':
|
|
117
|
-
return FileIconExeIcon;
|
|
118
|
-
case 'application/x-apple-diskimage':
|
|
119
|
-
case 'dmg':
|
|
120
|
-
return FileIconDmgIcon;
|
|
121
|
-
case 'application/zip':
|
|
122
|
-
case 'zip':
|
|
123
|
-
return FileIconZipIcon;
|
|
124
|
-
case 'application/x-rar-compressed':
|
|
125
|
-
case 'rar':
|
|
126
|
-
return FileIconRarIcon;
|
|
127
|
-
default:
|
|
128
|
-
return FileIconNoneIcon;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type Block, type ExtensionType } from '../../store/index.js';
|
|
2
|
-
export declare function createAffineTemplate(extensions?: ExtensionType[]): {
|
|
3
|
-
affine: (strings: TemplateStringsArray, ...values: any[]) => import("../../std/index.js").EditorHost;
|
|
4
|
-
block: (strings: TemplateStringsArray, ...values: any[]) => Block | null;
|
|
5
|
-
};
|
|
6
|
-
export declare const affine: (strings: TemplateStringsArray, ...values: any[]) => import("../../std/index.js").EditorHost, block: (strings: TemplateStringsArray, ...values: any[]) => Block | null;
|