@formicoidea/labre-core 0.31.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_pkgs/affine-block-attachment/attachment-block.js +1 -1
- package/dist/_pkgs/affine-block-callout/callout-block.d.ts +6 -0
- package/dist/_pkgs/affine-block-callout/callout-block.js +26 -4
- package/dist/_pkgs/affine-block-callout/callout-keymap.js +59 -19
- package/dist/_pkgs/affine-block-callout/commands/callout-to-paragraph.d.ts +20 -0
- package/dist/_pkgs/affine-block-callout/commands/callout-to-paragraph.js +60 -0
- package/dist/_pkgs/affine-block-callout/commands/split-callout.d.ts +17 -0
- package/dist/_pkgs/affine-block-callout/commands/split-callout.js +42 -0
- package/dist/_pkgs/affine-block-callout/configs/slash-menu.js +9 -6
- package/dist/_pkgs/affine-block-callout/emoji-margin.d.ts +9 -0
- package/dist/_pkgs/affine-block-callout/emoji-margin.js +36 -0
- package/dist/_pkgs/affine-block-callout/emoji-menu.d.ts +5 -1
- package/dist/_pkgs/affine-block-callout/emoji-menu.js +5 -0
- package/dist/_pkgs/affine-block-code/code-block-inline.js +1 -1
- package/dist/_pkgs/affine-block-code/code-block.d.ts +14 -0
- package/dist/_pkgs/affine-block-code/code-block.js +44 -6
- package/dist/_pkgs/affine-block-code/code-toolbar/components/code-toolbar.d.ts +2 -0
- package/dist/_pkgs/affine-block-code/code-toolbar/components/code-toolbar.js +23 -14
- package/dist/_pkgs/affine-block-code/code-toolbar/components/more-menu.d.ts +16 -0
- package/dist/_pkgs/affine-block-code/code-toolbar/components/more-menu.js +93 -0
- package/dist/_pkgs/affine-block-code/code-toolbar/config.js +54 -5
- package/dist/_pkgs/affine-block-code/code-toolbar/index.js +1 -1
- package/dist/_pkgs/affine-block-code/effects.d.ts +2 -0
- package/dist/_pkgs/affine-block-code/effects.js +2 -0
- package/dist/_pkgs/affine-block-code/highlight/affine-code-unit.js +6 -1
- package/dist/_pkgs/affine-block-code/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-code/index.js +1 -0
- package/dist/_pkgs/affine-block-code/line-numbers.d.ts +25 -0
- package/dist/_pkgs/affine-block-code/line-numbers.js +27 -0
- package/dist/_pkgs/affine-block-code/styles.js +31 -0
- package/dist/_pkgs/affine-block-data-view/data-view-block.js +1 -0
- package/dist/_pkgs/affine-block-database/components/title/index.js +4 -1
- package/dist/_pkgs/affine-block-database/configs/slash-menu.js +28 -1
- package/dist/_pkgs/affine-block-database/data-source.js +1 -2
- package/dist/_pkgs/affine-block-database/database-block.js +13 -0
- package/dist/_pkgs/affine-block-database/external-data-source.js +1 -1
- package/dist/_pkgs/affine-block-database/properties/paste-url.d.ts +24 -0
- package/dist/_pkgs/affine-block-database/properties/paste-url.js +98 -0
- package/dist/_pkgs/affine-block-database/properties/rich-text/cell-renderer.js +9 -19
- package/dist/_pkgs/affine-block-database/properties/title/text.js +20 -25
- package/dist/_pkgs/affine-block-database/views/index.js +1 -0
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-text-block.js +11 -1
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.d.ts +3 -0
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.js +48 -1
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/font-size.d.ts +17 -0
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/font-size.js +24 -0
- package/dist/_pkgs/affine-block-embed/embed-figma-block/embed-figma-service.js +1 -1
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +2 -2
- package/dist/_pkgs/affine-block-embed-doc/common/doc-trashed.d.ts +9 -0
- package/dist/_pkgs/affine-block-embed-doc/common/doc-trashed.js +10 -0
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/toolbar.js +1 -1
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-linked-doc-block.js +8 -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/configs/toolbar.js +1 -1
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-synced-doc-block.d.ts +4 -0
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-synced-doc-block.js +23 -4
- package/dist/_pkgs/affine-block-frame/frame-manager.d.ts +13 -0
- package/dist/_pkgs/affine-block-frame/frame-manager.js +34 -2
- package/dist/_pkgs/affine-block-frame/frame-tool.js +1 -1
- package/dist/_pkgs/affine-block-image/components/page-image-block.js +1 -1
- package/dist/_pkgs/affine-block-image/image-edgeless-block.js +1 -1
- package/dist/_pkgs/affine-block-latex/styles.js +6 -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/move-block.js +1 -1
- package/dist/_pkgs/affine-block-note/note-edgeless-block.d.ts +9 -0
- package/dist/_pkgs/affine-block-note/note-edgeless-block.js +29 -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/commands/pivot-commands.d.ts +37 -0
- package/dist/_pkgs/affine-block-root/commands/pivot-commands.js +168 -0
- package/dist/_pkgs/affine-block-root/commands/reading-commands.d.ts +23 -0
- package/dist/_pkgs/affine-block-root/commands/reading-commands.js +107 -0
- package/dist/_pkgs/affine-block-root/commands/tag-commands.d.ts +47 -0
- package/dist/_pkgs/affine-block-root/commands/tag-commands.js +159 -0
- package/dist/_pkgs/affine-block-root/configs/toolbar.d.ts +1 -0
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.js +10 -3
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/render-linked-doc.js +1 -1
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.js +27 -2
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +11 -2
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-service.js +14 -0
- package/dist/_pkgs/affine-block-root/edgeless/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-root/edgeless/index.js +1 -0
- package/dist/_pkgs/affine-block-root/edgeless/reserved-keys.d.ts +21 -0
- package/dist/_pkgs/affine-block-root/edgeless/reserved-keys.js +34 -0
- package/dist/_pkgs/affine-block-root/edgeless/utils/clipboard-utils.js +1 -1
- package/dist/_pkgs/affine-block-root/edgeless/utils/clone-utils.d.ts +7 -1
- package/dist/_pkgs/affine-block-root/edgeless/utils/clone-utils.js +11 -2
- package/dist/_pkgs/affine-block-root/index.d.ts +4 -1
- package/dist/_pkgs/affine-block-root/index.js +4 -1
- package/dist/_pkgs/affine-block-root/keyboard/commands.d.ts +2 -0
- package/dist/_pkgs/affine-block-root/keyboard/commands.js +147 -0
- package/dist/_pkgs/affine-block-root/view.js +13 -4
- 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/commands/reassociate-connectors.js +0 -1
- package/dist/_pkgs/affine-block-surface/effects.js +6 -0
- package/dist/_pkgs/affine-block-surface/element-model/index.d.ts +21 -3
- package/dist/_pkgs/affine-block-surface/element-model/index.js +14 -2
- package/dist/_pkgs/affine-block-surface/extensions/audit.d.ts +107 -0
- package/dist/_pkgs/affine-block-surface/extensions/audit.js +489 -0
- package/dist/_pkgs/affine-block-surface/extensions/crud-extension.d.ts +14 -0
- package/dist/_pkgs/affine-block-surface/extensions/crud-extension.js +37 -5
- package/dist/_pkgs/affine-block-surface/extensions/editor-anchored-panel.d.ts +133 -0
- package/dist/_pkgs/affine-block-surface/extensions/editor-anchored-panel.js +327 -0
- 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 +17 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.js +17 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.d.ts +172 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +393 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +306 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange.js +64 -0
- package/dist/_pkgs/affine-block-surface/extensions/map-quality-widget.d.ts +146 -0
- package/dist/_pkgs/affine-block-surface/extensions/map-quality-widget.js +528 -0
- package/dist/_pkgs/affine-block-surface/extensions/map-quality.d.ts +109 -0
- package/dist/_pkgs/affine-block-surface/extensions/map-quality.js +84 -0
- 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-toolbar.d.ts +15 -0
- package/dist/_pkgs/affine-block-surface/extensions/reading-toolbar.js +158 -0
- package/dist/_pkgs/affine-block-surface/extensions/reading-widget.d.ts +145 -0
- package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +588 -0
- package/dist/_pkgs/affine-block-surface/extensions/reading.d.ts +494 -0
- package/dist/_pkgs/affine-block-surface/extensions/reading.js +767 -0
- package/dist/_pkgs/affine-block-surface/extensions/spotlight.d.ts +45 -0
- package/dist/_pkgs/affine-block-surface/extensions/spotlight.js +177 -0
- 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/tags-toolbar.d.ts +10 -0
- package/dist/_pkgs/affine-block-surface/extensions/tags-toolbar.js +295 -0
- package/dist/_pkgs/affine-block-surface/extensions/validation-toolbar.d.ts +27 -0
- package/dist/_pkgs/affine-block-surface/extensions/validation-toolbar.js +361 -0
- package/dist/_pkgs/affine-block-surface/extensions/validation.d.ts +2129 -0
- package/dist/_pkgs/affine-block-surface/extensions/validation.js +4620 -0
- package/dist/_pkgs/affine-block-surface/extensions/violation-detail-widget.d.ts +330 -0
- package/dist/_pkgs/affine-block-surface/extensions/violation-detail-widget.js +1004 -0
- package/dist/_pkgs/affine-block-surface/extensions/violation-timeline.d.ts +80 -0
- package/dist/_pkgs/affine-block-surface/extensions/violation-timeline.js +123 -0
- package/dist/_pkgs/affine-block-surface/framework-background/def.d.ts +610 -0
- package/dist/_pkgs/affine-block-surface/framework-background/def.js +206 -0
- package/dist/_pkgs/affine-block-surface/framework-background/facts.d.ts +188 -0
- package/dist/_pkgs/affine-block-surface/framework-background/facts.js +284 -0
- package/dist/_pkgs/affine-block-surface/framework-background/index.d.ts +5 -0
- package/dist/_pkgs/affine-block-surface/framework-background/index.js +5 -0
- package/dist/_pkgs/affine-block-surface/framework-background/interaction.d.ts +12 -0
- package/dist/_pkgs/affine-block-surface/framework-background/interaction.js +24 -0
- package/dist/_pkgs/affine-block-surface/framework-background/labels.d.ts +99 -0
- package/dist/_pkgs/affine-block-surface/framework-background/labels.js +193 -0
- package/dist/_pkgs/affine-block-surface/framework-background/renderer.d.ts +8 -0
- package/dist/_pkgs/affine-block-surface/framework-background/renderer.js +399 -0
- 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/canvas-renderer.d.ts +69 -3
- package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.js +333 -44
- package/dist/_pkgs/affine-block-surface/renderer/dom-renderer.js +18 -2
- package/dist/_pkgs/affine-block-surface/renderer/overlay.js +1 -1
- package/dist/_pkgs/affine-block-surface/tool/default-tool.js +8 -0
- package/dist/_pkgs/affine-block-surface/utils/font.js +9 -3
- package/dist/_pkgs/affine-block-surface/view.d.ts +17 -0
- package/dist/_pkgs/affine-block-surface/view.js +57 -2
- 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-block-table/selection-controller.d.ts +6 -0
- package/dist/_pkgs/affine-block-table/selection-controller.js +24 -1
- package/dist/_pkgs/affine-block-table/table-block.js +8 -2
- package/dist/_pkgs/affine-block-table/table-cell.js +5 -6
- package/dist/_pkgs/affine-block-table/table-keymap.d.ts +18 -0
- package/dist/_pkgs/affine-block-table/table-keymap.js +41 -0
- package/dist/_pkgs/affine-block-table/utils.d.ts +7 -0
- package/dist/_pkgs/affine-block-table/utils.js +12 -0
- package/dist/_pkgs/affine-block-table/view.js +2 -0
- package/dist/_pkgs/affine-components/caption/captioned-block-component.js +2 -1
- package/dist/_pkgs/affine-components/context-menu/button.d.ts +7 -0
- package/dist/_pkgs/affine-components/context-menu/button.js +7 -2
- package/dist/_pkgs/affine-components/context-menu/input.d.ts +4 -0
- package/dist/_pkgs/affine-components/context-menu/input.js +12 -0
- package/dist/_pkgs/affine-components/context-menu/menu-all.d.ts +2 -0
- package/dist/_pkgs/affine-components/context-menu/menu-renderer.js +8 -1
- package/dist/_pkgs/affine-components/context-menu/sub-menu.js +3 -0
- 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/icon-picker/affine-icon-picker-panel.d.ts +28 -0
- package/dist/_pkgs/affine-components/icon-picker/affine-icon-picker-panel.js +231 -0
- package/dist/_pkgs/affine-components/icon-picker/emoji-data.d.ts +40 -0
- package/dist/_pkgs/affine-components/icon-picker/emoji-data.js +99 -0
- package/dist/_pkgs/affine-components/icon-picker/emoji-picker-panel.d.ts +32 -0
- package/dist/_pkgs/affine-components/icon-picker/emoji-picker-panel.js +276 -0
- package/dist/_pkgs/affine-components/icon-picker/icon-data.d.ts +34 -0
- package/dist/_pkgs/affine-components/icon-picker/icon-data.js +83 -0
- package/dist/_pkgs/affine-components/icon-picker/icon-picker.d.ts +39 -0
- package/dist/_pkgs/affine-components/icon-picker/icon-picker.js +233 -0
- package/dist/_pkgs/affine-components/icon-picker/index.d.ts +8 -0
- package/dist/_pkgs/affine-components/icon-picker/index.js +15 -0
- package/dist/_pkgs/affine-components/icon-picker/recent-store.d.ts +8 -0
- package/dist/_pkgs/affine-components/icon-picker/recent-store.js +41 -0
- package/dist/_pkgs/affine-components/icon-picker/styles.d.ts +5 -0
- package/dist/_pkgs/affine-components/icon-picker/styles.js +166 -0
- package/dist/_pkgs/affine-components/icon-picker/types.d.ts +22 -0
- package/dist/_pkgs/affine-components/icon-picker/types.js +10 -0
- package/dist/_pkgs/affine-components/icons/text.js +426 -426
- package/dist/_pkgs/affine-components/open-doc-dropdown-menu/dropdown-menu.d.ts +1 -0
- package/dist/_pkgs/affine-components/peek/peekable.js +1 -1
- package/dist/_pkgs/affine-components/portal/portal.d.ts +1 -1
- 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 +2 -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/toolbar/toolbar.js +11 -10
- package/dist/_pkgs/affine-foundation/view.js +11 -2
- 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/index.d.ts +1 -0
- package/dist/_pkgs/affine-gfx-brush/index.js +1 -0
- package/dist/_pkgs/affine-gfx-brush/renderer/dom/brush.d.ts +1 -0
- package/dist/_pkgs/affine-gfx-brush/renderer/dom/brush.js +11 -0
- package/dist/_pkgs/affine-gfx-brush/renderer/dom/highlighter.d.ts +1 -0
- package/dist/_pkgs/affine-gfx-brush/renderer/dom/highlighter.js +11 -0
- package/dist/_pkgs/affine-gfx-brush/renderer/dom/index.d.ts +2 -0
- package/dist/_pkgs/affine-gfx-brush/renderer/dom/index.js +2 -0
- package/dist/_pkgs/affine-gfx-brush/renderer/dom/shared.d.ts +14 -0
- package/dist/_pkgs/affine-gfx-brush/renderer/dom/shared.js +54 -0
- package/dist/_pkgs/affine-gfx-brush/renderer/index.d.ts +1 -0
- package/dist/_pkgs/affine-gfx-brush/renderer/index.js +4 -0
- package/dist/_pkgs/affine-gfx-brush/toolbar/components/pen/pen-tool-button.js +1 -1
- package/dist/_pkgs/affine-gfx-brush/view.d.ts +14 -0
- package/dist/_pkgs/affine-gfx-brush/view.js +29 -3
- package/dist/_pkgs/affine-gfx-connector/connector-manager.js +39 -16
- package/dist/_pkgs/affine-gfx-connector/connector-tool.d.ts +26 -1
- package/dist/_pkgs/affine-gfx-connector/connector-tool.js +12 -3
- package/dist/_pkgs/affine-gfx-connector/connector-watcher.js +1 -4
- package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.d.ts +123 -0
- package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.js +282 -0
- package/dist/_pkgs/affine-gfx-connector/direction/direction-widget.d.ts +65 -0
- package/dist/_pkgs/affine-gfx-connector/direction/direction-widget.js +395 -0
- package/dist/_pkgs/affine-gfx-connector/direction/index.d.ts +4 -0
- package/dist/_pkgs/affine-gfx-connector/direction/index.js +4 -0
- package/dist/_pkgs/affine-gfx-connector/direction/invert-direction.d.ts +72 -0
- package/dist/_pkgs/affine-gfx-connector/direction/invert-direction.js +185 -0
- package/dist/_pkgs/affine-gfx-connector/direction/typed-edge.d.ts +69 -0
- package/dist/_pkgs/affine-gfx-connector/direction/typed-edge.js +66 -0
- package/dist/_pkgs/affine-gfx-connector/effects.d.ts +2 -0
- package/dist/_pkgs/affine-gfx-connector/effects.js +2 -0
- package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.js +78 -41
- 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/index.d.ts +1 -0
- package/dist/_pkgs/affine-gfx-connector/index.js +1 -0
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.d.ts +50 -0
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +68 -2
- package/dist/_pkgs/affine-gfx-connector/view.js +16 -0
- package/dist/_pkgs/affine-gfx-group/command/group-api.js +150 -62
- package/dist/_pkgs/affine-gfx-group/text/edgeless-group-title-editor.js +4 -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-pointer/tools/pan-tool.d.ts +16 -0
- package/dist/_pkgs/affine-gfx-pointer/tools/pan-tool.js +102 -32
- package/dist/_pkgs/affine-gfx-shape/commands.d.ts +2 -0
- package/dist/_pkgs/affine-gfx-shape/commands.js +33 -0
- 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-renderer/shape-dom/index.js +48 -19
- package/dist/_pkgs/affine-gfx-shape/element-view.js +19 -12
- package/dist/_pkgs/affine-gfx-shape/index.d.ts +1 -1
- package/dist/_pkgs/affine-gfx-shape/index.js +1 -1
- 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.d.ts +26 -0
- package/dist/_pkgs/affine-gfx-shape/text/edgeless-shape-text-editor.js +124 -15
- package/dist/_pkgs/affine-gfx-shape/view.js +3 -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-template/toolbar/template-tool-button.d.ts +2 -0
- package/dist/_pkgs/affine-gfx-template/toolbar/template-tool-button.js +18 -1
- package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.js +9 -5
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +1 -1
- package/dist/_pkgs/affine-inline-latex/command.js +46 -26
- package/dist/_pkgs/affine-inline-latex/latex-node/latex-node.d.ts +10 -0
- package/dist/_pkgs/affine-inline-latex/latex-node/latex-node.js +23 -0
- package/dist/_pkgs/affine-inline-link/command.js +1 -1
- package/dist/_pkgs/affine-inline-link/link-node/affine-link.js +4 -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 +29 -1
- 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/reference-node.js +1 -1
- package/dist/_pkgs/affine-model/blocks/code/code-model.d.ts +1 -0
- package/dist/_pkgs/affine-model/blocks/code/code-model.js +1 -0
- 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 +74 -17
- package/dist/_pkgs/affine-model/elements/bpmn/pool.js +55 -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 +25 -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/edgy/board.d.ts +32 -0
- package/dist/_pkgs/affine-model/elements/edgy/board.js +112 -0
- package/dist/_pkgs/affine-model/elements/edgy/facets.d.ts +12 -0
- package/dist/_pkgs/affine-model/elements/edgy/facets.js +25 -1
- package/dist/_pkgs/affine-model/elements/edgy/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/edgy/index.js +1 -0
- 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 +42 -0
- package/dist/_pkgs/affine-model/elements/framework-background/background.js +42 -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 +14 -1
- package/dist/_pkgs/affine-model/elements/index.js +4 -0
- package/dist/_pkgs/affine-model/elements/mindmap/mindmap.js +8 -3
- package/dist/_pkgs/affine-model/elements/mindmap/style.d.ts +10 -0
- package/dist/_pkgs/affine-model/elements/mindmap/style.js +8 -0
- package/dist/_pkgs/affine-model/elements/shape/api/polygon.js +2 -8
- package/dist/_pkgs/affine-model/elements/wardley/wardley.d.ts +21 -29
- package/dist/_pkgs/affine-model/elements/wardley/wardley.js +41 -48
- 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.d.ts +6 -1
- package/dist/_pkgs/affine-shared/adapters/markdown/delta-converter.js +161 -3
- package/dist/_pkgs/affine-shared/adapters/markdown/markdown.js +5 -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/types/delta-converter.d.ts +1 -0
- package/dist/_pkgs/affine-shared/adapters/utils/color.d.ts +24 -0
- package/dist/_pkgs/affine-shared/adapters/utils/color.js +283 -0
- package/dist/_pkgs/affine-shared/adapters/utils/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/adapters/utils/index.js +1 -0
- package/dist/_pkgs/affine-shared/commands/block-crud/get-selected-blocks.js +10 -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 +311 -0
- package/dist/_pkgs/affine-shared/services/audit-service.js +228 -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 +7 -0
- package/dist/_pkgs/affine-shared/services/edit-props-store.js +11 -0
- package/dist/_pkgs/affine-shared/services/embed-iframe/embed-iframe-config.js +1 -1
- package/dist/_pkgs/affine-shared/services/font-loader/font-loader-service.d.ts +26 -1
- package/dist/_pkgs/affine-shared/services/font-loader/font-loader-service.js +124 -7
- package/dist/_pkgs/affine-shared/services/index.d.ts +7 -0
- package/dist/_pkgs/affine-shared/services/index.js +7 -0
- package/dist/_pkgs/affine-shared/services/pivot-materiality-publisher.d.ts +129 -0
- package/dist/_pkgs/affine-shared/services/pivot-materiality-publisher.js +312 -0
- package/dist/_pkgs/affine-shared/services/pivot-properties-service.d.ts +217 -0
- package/dist/_pkgs/affine-shared/services/pivot-properties-service.js +114 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/code-block.d.ts +1 -1
- package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +255 -1
- package/dist/_pkgs/affine-shared/services/telemetry-service/telemetry-service.d.ts +2 -2
- package/dist/_pkgs/affine-shared/services/telemetry-service/types.d.ts +6 -1
- package/dist/_pkgs/affine-shared/services/toolbar-service/action.d.ts +10 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/index.js +1 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/layout.d.ts +134 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/layout.js +146 -0
- 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/index.d.ts +68 -0
- package/dist/_pkgs/affine-shared/services/translation-service/index.js +39 -0
- package/dist/_pkgs/affine-shared/services/universe-tag-defs-service.d.ts +155 -0
- package/dist/_pkgs/affine-shared/services/universe-tag-defs-service.js +256 -0
- package/dist/_pkgs/affine-shared/test-utils/affine-template.js +1 -1
- package/dist/_pkgs/affine-shared/utils/dom/point-to-range.d.ts +4 -0
- package/dist/_pkgs/affine-shared/utils/dom/point-to-range.js +58 -2
- package/dist/_pkgs/affine-shared/utils/dom/viewport.d.ts +60 -0
- package/dist/_pkgs/affine-shared/utils/dom/viewport.js +58 -0
- 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/print-to-pdf.d.ts +21 -0
- package/dist/_pkgs/affine-shared/utils/print-to-pdf.js +166 -32
- package/dist/_pkgs/affine-shared/utils/zod-schema.d.ts +7 -0
- package/dist/_pkgs/affine-shared/utils/zod-schema.js +25 -1
- package/dist/_pkgs/affine-widget-drag-handle/utils.js +1 -1
- package/dist/_pkgs/affine-widget-drag-handle/watchers/edgeless-watcher.d.ts +19 -10
- package/dist/_pkgs/affine-widget-drag-handle/watchers/edgeless-watcher.js +122 -23
- package/dist/_pkgs/affine-widget-drag-handle/watchers/pointer-event-watcher.d.ts +2 -0
- package/dist/_pkgs/affine-widget-drag-handle/watchers/pointer-event-watcher.js +25 -4
- 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-selected-rect/auto-complete-panel.js +10 -5
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/edgeless-auto-complete.d.ts +15 -1
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/edgeless-auto-complete.js +37 -32
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/edgeless-element-link.js +5 -4
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/edgeless-selected-rect.js +19 -9
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/utils.d.ts +16 -2
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/utils.js +19 -2
- 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 +46 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/catalogue-groups.js +66 -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 +5 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/index.js +5 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.d.ts +57 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.js +140 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +9 -0
- package/dist/_pkgs/affine-widget-frame-title/edgeless-frame-title-editor.js +4 -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 +2 -15
- package/dist/_pkgs/affine-widget-linked-doc/transformers/markdown.d.ts +10 -1
- package/dist/_pkgs/affine-widget-linked-doc/transformers/markdown.js +133 -6
- package/dist/_pkgs/affine-widget-linked-doc/transformers/utils.d.ts +10 -0
- package/dist/_pkgs/affine-widget-linked-doc/transformers/utils.js +120 -3
- package/dist/_pkgs/affine-widget-linked-doc/utils.d.ts +12 -0
- package/dist/_pkgs/affine-widget-linked-doc/utils.js +33 -0
- 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-remote-selection/edgeless/index.js +6 -4
- package/dist/_pkgs/affine-widget-slash-menu/slash-menu-popover.js +8 -4
- package/dist/_pkgs/affine-widget-slash-menu/utils.d.ts +9 -0
- package/dist/_pkgs/affine-widget-slash-menu/utils.js +24 -0
- package/dist/_pkgs/affine-widget-toolbar/toolbar.d.ts +6 -0
- package/dist/_pkgs/affine-widget-toolbar/toolbar.js +40 -8
- package/dist/_pkgs/affine-widget-toolbar/utils.d.ts +146 -3
- package/dist/_pkgs/affine-widget-toolbar/utils.js +744 -58
- package/dist/_pkgs/data-view/core/common/property-menu.js +3 -16
- package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.d.ts +4 -0
- package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.js +28 -1
- package/dist/_pkgs/data-view/core/data-view.d.ts +3 -1
- package/dist/_pkgs/data-view/core/data-view.js +25 -3
- package/dist/_pkgs/data-view/core/detail/field.js +2 -2
- package/dist/_pkgs/data-view/core/detail/selection.d.ts +4 -2
- package/dist/_pkgs/data-view/core/detail/selection.js +23 -7
- package/dist/_pkgs/data-view/core/effect.js +2 -0
- package/dist/_pkgs/data-view/core/filter/eval.js +36 -23
- package/dist/_pkgs/data-view/core/filter/filter-fn/matcher.d.ts +7 -0
- package/dist/_pkgs/data-view/core/filter/filter-fn/matcher.js +12 -0
- package/dist/_pkgs/data-view/core/group-by/compare-date-keys.d.ts +11 -0
- package/dist/_pkgs/data-view/core/group-by/compare-date-keys.js +55 -0
- package/dist/_pkgs/data-view/core/group-by/define.d.ts +6 -0
- package/dist/_pkgs/data-view/core/group-by/define.js +114 -0
- package/dist/_pkgs/data-view/core/group-by/matcher.d.ts +7 -0
- package/dist/_pkgs/data-view/core/group-by/matcher.js +13 -0
- package/dist/_pkgs/data-view/core/group-by/renderer/boolean-group.js +11 -11
- package/dist/_pkgs/data-view/core/group-by/renderer/date-group.d.ts +9 -0
- package/dist/_pkgs/data-view/core/group-by/renderer/date-group.js +97 -0
- package/dist/_pkgs/data-view/core/group-by/setting.js +86 -7
- package/dist/_pkgs/data-view/core/group-by/trait.d.ts +34 -0
- package/dist/_pkgs/data-view/core/group-by/trait.js +106 -10
- package/dist/_pkgs/data-view/core/utils/menu-title.js +17 -17
- package/dist/_pkgs/data-view/property-presets/multi-select/cell-renderer.js +3 -1
- package/dist/_pkgs/data-view/property-presets/number/define.js +2 -1
- package/dist/_pkgs/data-view/property-presets/select/cell-renderer.js +3 -1
- package/dist/_pkgs/data-view/view-presets/calendar/calendar-view-manager.d.ts +70 -0
- package/dist/_pkgs/data-view/view-presets/calendar/calendar-view-manager.js +449 -0
- package/dist/_pkgs/data-view/view-presets/calendar/define.d.ts +10 -0
- package/dist/_pkgs/data-view/view-presets/calendar/define.js +27 -0
- package/dist/_pkgs/data-view/view-presets/calendar/effect.d.ts +1 -0
- package/dist/_pkgs/data-view/view-presets/calendar/effect.js +4 -0
- package/dist/_pkgs/data-view/view-presets/calendar/index.d.ts +6 -0
- package/dist/_pkgs/data-view/view-presets/calendar/index.js +6 -0
- package/dist/_pkgs/data-view/view-presets/calendar/layout.d.ts +37 -0
- package/dist/_pkgs/data-view/view-presets/calendar/layout.js +138 -0
- package/dist/_pkgs/data-view/view-presets/calendar/pc/actions.d.ts +7 -0
- package/dist/_pkgs/data-view/view-presets/calendar/pc/actions.js +64 -0
- package/dist/_pkgs/data-view/view-presets/calendar/pc/dnd.d.ts +32 -0
- package/dist/_pkgs/data-view/view-presets/calendar/pc/dnd.js +159 -0
- package/dist/_pkgs/data-view/view-presets/calendar/pc/effect.d.ts +1 -0
- package/dist/_pkgs/data-view/view-presets/calendar/pc/effect.js +7 -0
- package/dist/_pkgs/data-view/view-presets/calendar/pc/hit-test.d.ts +1 -0
- package/dist/_pkgs/data-view/view-presets/calendar/pc/hit-test.js +28 -0
- package/dist/_pkgs/data-view/view-presets/calendar/pc/styles.d.ts +1 -0
- package/dist/_pkgs/data-view/view-presets/calendar/pc/styles.js +707 -0
- package/dist/_pkgs/data-view/view-presets/calendar/pc/view.d.ts +89 -0
- package/dist/_pkgs/data-view/view-presets/calendar/pc/view.js +849 -0
- package/dist/_pkgs/data-view/view-presets/calendar/renderer.d.ts +2 -0
- package/dist/_pkgs/data-view/view-presets/calendar/renderer.js +8 -0
- package/dist/_pkgs/data-view/view-presets/calendar/source.d.ts +8 -0
- package/dist/_pkgs/data-view/view-presets/calendar/source.js +3 -0
- package/dist/_pkgs/data-view/view-presets/calendar/types.d.ts +79 -0
- package/dist/_pkgs/data-view/view-presets/calendar/types.js +1 -0
- package/dist/_pkgs/data-view/view-presets/convert.js +28 -0
- package/dist/_pkgs/data-view/view-presets/effect.js +2 -0
- package/dist/_pkgs/data-view/view-presets/index.d.ts +2 -0
- package/dist/_pkgs/data-view/view-presets/index.js +3 -0
- package/dist/_pkgs/data-view/view-presets/kanban/kanban-view-manager.js +3 -1
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/cell.js +2 -2
- package/dist/_pkgs/data-view/view-presets/table/collapsed-state.d.ts +18 -0
- package/dist/_pkgs/data-view/view-presets/table/collapsed-state.js +36 -0
- package/dist/_pkgs/data-view/view-presets/table/mobile/cell.js +2 -2
- package/dist/_pkgs/data-view/view-presets/table/mobile/group.d.ts +11 -0
- package/dist/_pkgs/data-view/view-presets/table/mobile/group.js +89 -4
- package/dist/_pkgs/data-view/view-presets/table/pc/cell.d.ts +3 -0
- package/dist/_pkgs/data-view/view-presets/table/pc/cell.js +11 -2
- package/dist/_pkgs/data-view/view-presets/table/pc/controller/hotkeys.d.ts +1 -0
- package/dist/_pkgs/data-view/view-presets/table/pc/controller/hotkeys.js +39 -33
- package/dist/_pkgs/data-view/view-presets/table/pc/group.d.ts +10 -0
- package/dist/_pkgs/data-view/view-presets/table/pc/group.js +86 -5
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/hotkeys.d.ts +1 -0
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/hotkeys.js +39 -33
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/group-title.js +18 -18
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/row/cell.d.ts +3 -0
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/row/cell.js +8 -0
- package/dist/_pkgs/data-view/view-presets/table/table-view-manager.js +3 -1
- package/dist/_pkgs/data-view/view-presets/table/utils.d.ts +3 -0
- package/dist/_pkgs/data-view/view-presets/table/utils.js +16 -1
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-options.js +3 -1
- package/dist/_pkgs/global/gfx/curve.js +4 -3
- package/dist/_pkgs/std/clipboard/clipboard.js +13 -3
- package/dist/_pkgs/std/clipboard/utils.d.ts +5 -0
- package/dist/_pkgs/std/clipboard/utils.js +10 -0
- package/dist/_pkgs/std/event/dispatcher.js +27 -1
- package/dist/_pkgs/std/event/keymap.js +16 -6
- package/dist/_pkgs/std/extension/command-registry.d.ts +475 -0
- package/dist/_pkgs/std/extension/command-registry.js +431 -0
- package/dist/_pkgs/std/extension/dnd/index.d.ts +1 -1
- package/dist/_pkgs/std/extension/index.d.ts +2 -0
- package/dist/_pkgs/std/extension/index.js +2 -0
- package/dist/_pkgs/std/extension/shortcut.js +2 -1
- package/dist/_pkgs/std/extension/translation-manifest.d.ts +49 -0
- package/dist/_pkgs/std/extension/translation-manifest.js +71 -0
- package/dist/_pkgs/std/gfx/grid.js +1 -1
- package/dist/_pkgs/std/gfx/index.d.ts +7 -3
- package/dist/_pkgs/std/gfx/index.js +6 -2
- package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.js +6 -1
- package/dist/_pkgs/std/gfx/interactivity/manager.d.ts +8 -0
- package/dist/_pkgs/std/gfx/interactivity/manager.js +18 -0
- package/dist/_pkgs/std/gfx/layer.d.ts +1 -1
- package/dist/_pkgs/std/gfx/layer.js +1 -2
- package/dist/_pkgs/std/gfx/model/surface/decorators/field.js +9 -0
- package/dist/_pkgs/std/gfx/model/surface/decorators/index.d.ts +2 -2
- package/dist/_pkgs/std/gfx/model/surface/decorators/index.js +2 -2
- package/dist/_pkgs/std/gfx/model/surface/decorators/local.d.ts +14 -0
- package/dist/_pkgs/std/gfx/model/surface/decorators/local.js +22 -0
- package/dist/_pkgs/std/gfx/model/surface/decorators/observer.d.ts +2 -0
- package/dist/_pkgs/std/gfx/model/surface/decorators/observer.js +40 -1
- package/dist/_pkgs/std/gfx/model/surface/element-model.d.ts +442 -0
- package/dist/_pkgs/std/gfx/model/surface/element-model.js +510 -25
- package/dist/_pkgs/std/gfx/model/surface/pivot.d.ts +48 -0
- package/dist/_pkgs/std/gfx/model/surface/pivot.js +34 -0
- package/dist/_pkgs/std/gfx/model/surface/role.d.ts +153 -0
- package/dist/_pkgs/std/gfx/model/surface/role.js +117 -0
- package/dist/_pkgs/std/gfx/model/surface/surface-model.d.ts +70 -0
- package/dist/_pkgs/std/gfx/model/surface/surface-model.js +305 -17
- package/dist/_pkgs/std/gfx/model/surface/tags.d.ts +77 -0
- package/dist/_pkgs/std/gfx/model/surface/tags.js +246 -0
- package/dist/_pkgs/std/gfx/perf.d.ts +10 -0
- package/dist/_pkgs/std/gfx/perf.js +30 -0
- package/dist/_pkgs/std/gfx/selection.js +1 -1
- package/dist/_pkgs/std/gfx/tool/tool-controller.d.ts +13 -0
- package/dist/_pkgs/std/gfx/tool/tool-controller.js +26 -0
- package/dist/_pkgs/std/gfx/viewport.d.ts +12 -0
- package/dist/_pkgs/std/gfx/viewport.js +20 -2
- 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/inline/services/event.d.ts +2 -0
- package/dist/_pkgs/std/inline/services/event.js +96 -21
- package/dist/_pkgs/std/utils/layer.js +2 -6
- package/dist/_pkgs/std/utils/tree.d.ts +14 -0
- package/dist/_pkgs/std/utils/tree.js +59 -8
- package/dist/_pkgs/std/view/element/gfx-block-component.js +23 -13
- package/dist/_pkgs/store/extension/workspace/workspace-meta.d.ts +10 -0
- package/dist/_pkgs/store/model/block/flat-sync-controller.js +2 -12
- package/dist/_pkgs/store/model/store/crud.js +10 -4
- package/dist/_pkgs/store/reactive/flat-native-y/index.d.ts +1 -1
- package/dist/_pkgs/store/reactive/flat-native-y/index.js +24 -2
- package/dist/commands.d.ts +58 -0
- package/dist/commands.js +66 -0
- package/dist/extensions/command-telemetry.d.ts +21 -0
- package/dist/extensions/command-telemetry.js +89 -0
- package/dist/extensions/command-usage.d.ts +23 -0
- package/dist/extensions/command-usage.js +37 -0
- package/dist/extensions/store.d.ts +9 -4
- package/dist/extensions/store.js +27 -24
- package/dist/extensions/view.d.ts +9 -4
- package/dist/extensions/view.js +35 -8
- package/dist/flags.d.ts +98 -21
- package/dist/flags.js +103 -22
- package/dist/frameworks.d.ts +45 -0
- package/dist/frameworks.js +186 -0
- package/dist/schemas.d.ts +8 -5
- package/dist/schemas.js +28 -32
- package/dist/shortcuts.d.ts +16 -16
- package/dist/shortcuts.js +8 -36
- package/dist/translations.d.ts +56 -0
- package/dist/translations.js +200 -0
- package/package.json +16 -4
- package/dist/_pkgs/affine-block-root/keyboard/shortcuts.d.ts +0 -8
- package/dist/_pkgs/affine-block-root/keyboard/shortcuts.js +0 -48
- package/dist/_pkgs/affine-gfx-shape/shortcuts.d.ts +0 -6
- package/dist/_pkgs/affine-gfx-shape/shortcuts.js +0 -28
- package/dist/_pkgs/data-view/core/utils/cache.d.ts +0 -5
- package/dist/_pkgs/data-view/core/utils/cache.js +0 -28
|
@@ -1,22 +1,7 @@
|
|
|
1
1
|
import { menu } from '../../../affine-components/context-menu/index.js';
|
|
2
|
-
import { IS_MOBILE } from '../../../global/env/index.js';
|
|
3
2
|
import { html } from 'lit/static-html.js';
|
|
4
3
|
import { renderUniLit } from '../utils/uni-component/index.js';
|
|
5
4
|
export const inputConfig = (property) => {
|
|
6
|
-
if (IS_MOBILE) {
|
|
7
|
-
return menu.input({
|
|
8
|
-
prefix: html `
|
|
9
|
-
<div class="affine-database-column-type-menu-icon">
|
|
10
|
-
${renderUniLit(property.icon)}
|
|
11
|
-
</div>
|
|
12
|
-
`,
|
|
13
|
-
initialValue: property.name$.value,
|
|
14
|
-
placeholder: 'Property name',
|
|
15
|
-
onChange: text => {
|
|
16
|
-
property.nameSet(text);
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
5
|
return menu.input({
|
|
21
6
|
prefix: html `
|
|
22
7
|
<div class="affine-database-column-type-menu-icon">
|
|
@@ -25,7 +10,9 @@ export const inputConfig = (property) => {
|
|
|
25
10
|
`,
|
|
26
11
|
initialValue: property.name$.value,
|
|
27
12
|
placeholder: 'Property name',
|
|
28
|
-
|
|
13
|
+
// Persist on blur so the typed name survives the menu being dismissed by
|
|
14
|
+
// a click outside, which never fires the completion path.
|
|
15
|
+
onBlur: text => {
|
|
29
16
|
property.nameSet(text);
|
|
30
17
|
},
|
|
31
18
|
});
|
|
@@ -9,7 +9,9 @@ export type TagManagerOptions = {
|
|
|
9
9
|
options: ReadonlySignal<SelectTag[]>;
|
|
10
10
|
onOptionsChange: (options: SelectTag[]) => void;
|
|
11
11
|
onComplete?: () => void;
|
|
12
|
+
initialDraftText?: string;
|
|
12
13
|
};
|
|
14
|
+
export declare function consumeTagDraftFromTableCellHost(fromElement: Element): string | undefined;
|
|
13
15
|
declare const MultiTagSelect_base: typeof ShadowlessElement & import("../../../../global/utils/types.js").Constructor<import("../../../../global/lit/with-disposable.js").DisposableClass>;
|
|
14
16
|
export declare class MultiTagSelect extends MultiTagSelect_base {
|
|
15
17
|
private readonly _clickItemOption;
|
|
@@ -23,6 +25,7 @@ export declare class MultiTagSelect extends MultiTagSelect_base {
|
|
|
23
25
|
private renderTag;
|
|
24
26
|
private renderTags;
|
|
25
27
|
private setSelectedOption;
|
|
28
|
+
connectedCallback(): void;
|
|
26
29
|
protected firstUpdated(): void;
|
|
27
30
|
render(): import("lit-html").TemplateResult;
|
|
28
31
|
private readonly _selectInput;
|
|
@@ -33,6 +36,7 @@ export declare class MultiTagSelect extends MultiTagSelect_base {
|
|
|
33
36
|
accessor options: ReadonlySignal<SelectTag[]>;
|
|
34
37
|
private readonly selectedIndex$;
|
|
35
38
|
accessor value: ReadonlySignal<string[]>;
|
|
39
|
+
accessor initialDraftText: string | undefined;
|
|
36
40
|
}
|
|
37
41
|
declare global {
|
|
38
42
|
interface HTMLElementTagNameMap {
|
|
@@ -58,6 +58,12 @@ import { verticalListSortingStrategy } from '../../utils/wc-dnd/sort/strategies/
|
|
|
58
58
|
import { arrayMove } from '../../utils/wc-dnd/utils/array-move.js';
|
|
59
59
|
import { getTagColor, selectOptionColors } from './colors.js';
|
|
60
60
|
import { selectedStyle, selectOptionContentStyle, selectOptionDragHandlerStyle, selectOptionIconStyle, selectOptionNewIconStyle, selectOptionsContainerStyle, selectOptionsTipsStyle, selectOptionStyle, tagContainerStyle, tagDeleteIconStyle, tagSelectContainerStyle, tagSelectInputContainerStyle, tagSelectInputStyle, tagTextStyle, } from './styles-css.js';
|
|
61
|
+
// Parent elements that can hand over a tag draft typed in the table.
|
|
62
|
+
const TABLE_CELL_HOST_SELECTOR = 'dv-table-view-cell-container, affine-database-virtual-cell-container';
|
|
63
|
+
export function consumeTagDraftFromTableCellHost(fromElement) {
|
|
64
|
+
const host = fromElement.closest(TABLE_CELL_HOST_SELECTOR);
|
|
65
|
+
return host?.consumeTagDraft?.();
|
|
66
|
+
}
|
|
61
67
|
class TagManager {
|
|
62
68
|
get isSingleMode() {
|
|
63
69
|
return this.ops.mode === 'single';
|
|
@@ -179,6 +185,9 @@ let MultiTagSelect = (() => {
|
|
|
179
185
|
let _value_decorators;
|
|
180
186
|
let _value_initializers = [];
|
|
181
187
|
let _value_extraInitializers = [];
|
|
188
|
+
let _initialDraftText_decorators;
|
|
189
|
+
let _initialDraftText_initializers = [];
|
|
190
|
+
let _initialDraftText_extraInitializers = [];
|
|
182
191
|
return class MultiTagSelect extends _classSuper {
|
|
183
192
|
static {
|
|
184
193
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
@@ -188,12 +197,14 @@ let MultiTagSelect = (() => {
|
|
|
188
197
|
_onOptionsChange_decorators = [property({ attribute: false })];
|
|
189
198
|
_options_decorators = [property({ attribute: false })];
|
|
190
199
|
_value_decorators = [property({ attribute: false })];
|
|
200
|
+
_initialDraftText_decorators = [property({ attribute: false })];
|
|
191
201
|
__esDecorate(this, null, _mode_decorators, { kind: "accessor", name: "mode", static: false, private: false, access: { has: obj => "mode" in obj, get: obj => obj.mode, set: (obj, value) => { obj.mode = value; } }, metadata: _metadata }, _mode_initializers, _mode_extraInitializers);
|
|
192
202
|
__esDecorate(this, null, _onChange_decorators, { kind: "accessor", name: "onChange", static: false, private: false, access: { has: obj => "onChange" in obj, get: obj => obj.onChange, set: (obj, value) => { obj.onChange = value; } }, metadata: _metadata }, _onChange_initializers, _onChange_extraInitializers);
|
|
193
203
|
__esDecorate(this, null, _onComplete_decorators, { kind: "accessor", name: "onComplete", static: false, private: false, access: { has: obj => "onComplete" in obj, get: obj => obj.onComplete, set: (obj, value) => { obj.onComplete = value; } }, metadata: _metadata }, _onComplete_initializers, _onComplete_extraInitializers);
|
|
194
204
|
__esDecorate(this, null, _onOptionsChange_decorators, { kind: "accessor", name: "onOptionsChange", static: false, private: false, access: { has: obj => "onOptionsChange" in obj, get: obj => obj.onOptionsChange, set: (obj, value) => { obj.onOptionsChange = value; } }, metadata: _metadata }, _onOptionsChange_initializers, _onOptionsChange_extraInitializers);
|
|
195
205
|
__esDecorate(this, null, _options_decorators, { kind: "accessor", name: "options", static: false, private: false, access: { has: obj => "options" in obj, get: obj => obj.options, set: (obj, value) => { obj.options = value; } }, metadata: _metadata }, _options_initializers, _options_extraInitializers);
|
|
196
206
|
__esDecorate(this, null, _value_decorators, { kind: "accessor", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
207
|
+
__esDecorate(this, null, _initialDraftText_decorators, { kind: "accessor", name: "initialDraftText", static: false, private: false, access: { has: obj => "initialDraftText" in obj, get: obj => obj.initialDraftText, set: (obj, value) => { obj.initialDraftText = value; } }, metadata: _metadata }, _initialDraftText_initializers, _initialDraftText_extraInitializers);
|
|
197
208
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
198
209
|
}
|
|
199
210
|
get text() {
|
|
@@ -292,6 +303,14 @@ let MultiTagSelect = (() => {
|
|
|
292
303
|
setSelectedOption(index) {
|
|
293
304
|
this.selectedIndex$.value = rangeWrap(index, 0, this.tagManager.filteredOptions$.value.length);
|
|
294
305
|
}
|
|
306
|
+
connectedCallback() {
|
|
307
|
+
super.connectedCallback();
|
|
308
|
+
const draft = this.initialDraftText;
|
|
309
|
+
if (draft != null && draft !== '') {
|
|
310
|
+
this.tagManager.text$.value = draft;
|
|
311
|
+
this.initialDraftText = undefined;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
295
314
|
firstUpdated() {
|
|
296
315
|
const disposables = this.disposables;
|
|
297
316
|
this.classList.add(tagSelectContainerStyle);
|
|
@@ -330,6 +349,9 @@ let MultiTagSelect = (() => {
|
|
|
330
349
|
#value_accessor_storage;
|
|
331
350
|
get value() { return this.#value_accessor_storage; }
|
|
332
351
|
set value(value) { this.#value_accessor_storage = value; }
|
|
352
|
+
#initialDraftText_accessor_storage;
|
|
353
|
+
get initialDraftText() { return this.#initialDraftText_accessor_storage; }
|
|
354
|
+
set initialDraftText(value) { this.#initialDraftText_accessor_storage = value; }
|
|
333
355
|
constructor() {
|
|
334
356
|
super(...arguments);
|
|
335
357
|
this._clickItemOption = (e, id) => {
|
|
@@ -452,13 +474,17 @@ let MultiTagSelect = (() => {
|
|
|
452
474
|
this.#options_accessor_storage = (__runInitializers(this, _onOptionsChange_extraInitializers), __runInitializers(this, _options_initializers, void 0));
|
|
453
475
|
this.selectedIndex$ = (__runInitializers(this, _options_extraInitializers), signal(0));
|
|
454
476
|
this.#value_accessor_storage = __runInitializers(this, _value_initializers, void 0);
|
|
455
|
-
__runInitializers(this, _value_extraInitializers);
|
|
477
|
+
this.#initialDraftText_accessor_storage = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _initialDraftText_initializers, void 0));
|
|
478
|
+
__runInitializers(this, _initialDraftText_extraInitializers);
|
|
456
479
|
}
|
|
457
480
|
};
|
|
458
481
|
})();
|
|
459
482
|
export { MultiTagSelect };
|
|
460
483
|
const popMobileTagSelect = (target, ops) => {
|
|
461
484
|
const tagManager = new TagManager(ops);
|
|
485
|
+
if (ops.initialDraftText) {
|
|
486
|
+
tagManager.text$.value = ops.initialDraftText;
|
|
487
|
+
}
|
|
462
488
|
const onInput = (e) => {
|
|
463
489
|
tagManager.text$.value = e.target.value;
|
|
464
490
|
};
|
|
@@ -550,6 +576,7 @@ export const popTagSelect = (target, ops) => {
|
|
|
550
576
|
component.onChange = ops.onChange;
|
|
551
577
|
component.options = ops.options;
|
|
552
578
|
component.onOptionsChange = ops.onOptionsChange;
|
|
579
|
+
component.initialDraftText = ops.initialDraftText;
|
|
553
580
|
component.onComplete = () => {
|
|
554
581
|
ops.onComplete?.();
|
|
555
582
|
remove();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DatabaseAllEvents, EventTraceFn } from '../../affine-shared/services/index.js';
|
|
2
2
|
import type { DisposableMember } from '../../global/disposable/index.js';
|
|
3
|
-
import { type Clipboard, type EventName, ShadowlessElement, type UIEventHandler } from '../../std/index.js';
|
|
3
|
+
import { type Clipboard, type DndController, type EventName, ShadowlessElement, type UIEventHandler } from '../../std/index.js';
|
|
4
4
|
import { type ReadonlySignal } from '@preact/signals-core';
|
|
5
5
|
import type { DataSource } from './data-source/index.js';
|
|
6
6
|
import type { DataViewSelection } from './types.js';
|
|
@@ -9,6 +9,7 @@ import type { SingleView } from './view-manager/single-view.js';
|
|
|
9
9
|
import type { DataViewWidget } from './widget/index.js';
|
|
10
10
|
export type DataViewRendererConfig = {
|
|
11
11
|
clipboard: Clipboard;
|
|
12
|
+
dnd?: DndController;
|
|
12
13
|
onDrag?: (evt: MouseEvent, id: string) => () => void;
|
|
13
14
|
notification: {
|
|
14
15
|
toast: (message: string) => void;
|
|
@@ -33,6 +34,7 @@ export declare class DataViewRootUILogic {
|
|
|
33
34
|
private get dataSource();
|
|
34
35
|
private get viewManager();
|
|
35
36
|
private createDataViewUILogic;
|
|
37
|
+
private readonly _viewsCache;
|
|
36
38
|
private readonly views$;
|
|
37
39
|
private readonly viewsMap$;
|
|
38
40
|
private readonly _uiRef;
|
|
@@ -43,7 +43,6 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
|
43
43
|
import { ref } from 'lit/directives/ref.js';
|
|
44
44
|
import { html } from 'lit/static-html.js';
|
|
45
45
|
import { dataViewCommonStyle } from './common/css-variable.js';
|
|
46
|
-
import { cacheComputed } from './utils/cache.js';
|
|
47
46
|
import { renderUniLit } from './utils/uni-component/index.js';
|
|
48
47
|
export class DataViewRootUILogic {
|
|
49
48
|
get dataSource() {
|
|
@@ -70,9 +69,32 @@ export class DataViewRootUILogic {
|
|
|
70
69
|
}
|
|
71
70
|
constructor(config) {
|
|
72
71
|
this.config = config;
|
|
73
|
-
this.
|
|
72
|
+
this._viewsCache = new Map();
|
|
73
|
+
this.views$ = computed(() => {
|
|
74
|
+
const viewDataList = this.dataSource.viewDataList$.value;
|
|
75
|
+
const validIds = new Set(viewDataList.map(viewData => viewData.id));
|
|
76
|
+
for (const cachedId of this._viewsCache.keys()) {
|
|
77
|
+
if (!validIds.has(cachedId)) {
|
|
78
|
+
this._viewsCache.delete(cachedId);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return viewDataList.map(viewData => {
|
|
82
|
+
const cached = this._viewsCache.get(viewData.id);
|
|
83
|
+
// The id survives a layout change, the mode does not: a view switched
|
|
84
|
+
// from table to kanban needs a fresh UI logic.
|
|
85
|
+
if (cached && cached.mode === viewData.mode) {
|
|
86
|
+
return cached.logic;
|
|
87
|
+
}
|
|
88
|
+
const logic = this.createDataViewUILogic(viewData.id);
|
|
89
|
+
this._viewsCache.set(viewData.id, {
|
|
90
|
+
mode: viewData.mode,
|
|
91
|
+
logic,
|
|
92
|
+
});
|
|
93
|
+
return logic;
|
|
94
|
+
});
|
|
95
|
+
});
|
|
74
96
|
this.viewsMap$ = computed(() => {
|
|
75
|
-
return Object.fromEntries(this.views$.
|
|
97
|
+
return Object.fromEntries(this.views$.value.map(logic => [logic.view.id, logic]));
|
|
76
98
|
});
|
|
77
99
|
this._uiRef = signal();
|
|
78
100
|
this.currentViewId$ = computed(() => {
|
|
@@ -119,9 +119,9 @@ let RecordField = (() => {
|
|
|
119
119
|
border: 1px solid transparent;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
.field-content
|
|
122
|
+
.field-content affine-database-number-cell .number {
|
|
123
123
|
text-align: left;
|
|
124
|
-
justify-content: start;
|
|
124
|
+
justify-content: flex-start;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
.field-content:hover {
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import type { KanbanCardSelection } from '../../view-presets/index.js';
|
|
2
2
|
import type { KanbanCard } from '../../view-presets/kanban/pc/card.js';
|
|
3
|
-
import type { RecordDetail } from './detail.js';
|
|
4
3
|
import { RecordField } from './field.js';
|
|
5
4
|
type DetailViewSelection = {
|
|
6
5
|
propertyId: string;
|
|
7
6
|
isEditing: boolean;
|
|
8
7
|
};
|
|
8
|
+
type DetailSelectionHost = {
|
|
9
|
+
querySelector: (selector: string) => unknown;
|
|
10
|
+
};
|
|
9
11
|
export declare class DetailSelection {
|
|
10
12
|
private readonly viewEle;
|
|
11
13
|
_selection?: DetailViewSelection;
|
|
12
14
|
onSelect: (selection?: DetailViewSelection) => void;
|
|
13
15
|
get selection(): DetailViewSelection | undefined;
|
|
14
16
|
set selection(selection: DetailViewSelection | undefined);
|
|
15
|
-
constructor(viewEle:
|
|
17
|
+
constructor(viewEle: DetailSelectionHost);
|
|
16
18
|
blur(selection: DetailViewSelection): void;
|
|
17
19
|
deleteProperty(): void;
|
|
18
20
|
focus(selection: DetailViewSelection): void;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { KanbanCell } from '../../view-presets/kanban/pc/cell.js';
|
|
2
2
|
import { RecordField } from './field.js';
|
|
3
|
+
const isSameDetailSelection = (current, next) => {
|
|
4
|
+
if (!current && !next) {
|
|
5
|
+
return true;
|
|
6
|
+
}
|
|
7
|
+
if (!current || !next) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
return (current.propertyId === next.propertyId &&
|
|
11
|
+
current.isEditing === next.isEditing);
|
|
12
|
+
};
|
|
3
13
|
export class DetailSelection {
|
|
4
14
|
get selection() {
|
|
5
15
|
return this._selection;
|
|
@@ -29,12 +39,19 @@ export class DetailSelection {
|
|
|
29
39
|
constructor(viewEle) {
|
|
30
40
|
this.viewEle = viewEle;
|
|
31
41
|
this.onSelect = (selection) => {
|
|
42
|
+
if (isSameDetailSelection(this._selection, selection)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
32
45
|
const old = this._selection;
|
|
46
|
+
// Publish the new selection before blurring: leaving editing mode runs the
|
|
47
|
+
// cell's exit hook, which may write a value back and re-enter this setter.
|
|
48
|
+
this._selection = selection;
|
|
33
49
|
if (old) {
|
|
34
50
|
this.blur(old);
|
|
35
51
|
}
|
|
36
|
-
|
|
37
|
-
|
|
52
|
+
// The blur above may have moved the selection somewhere else; only focus
|
|
53
|
+
// when it is still the one we were asked for.
|
|
54
|
+
if (selection && isSameDetailSelection(this._selection, selection)) {
|
|
38
55
|
this.focus(selection);
|
|
39
56
|
}
|
|
40
57
|
};
|
|
@@ -94,8 +111,8 @@ export class DetailSelection {
|
|
|
94
111
|
}
|
|
95
112
|
}
|
|
96
113
|
focusFirstCell() {
|
|
97
|
-
const
|
|
98
|
-
|
|
114
|
+
const firstField = this.viewEle.querySelector('affine-data-view-record-field');
|
|
115
|
+
const firstId = firstField?.column.id;
|
|
99
116
|
if (firstId) {
|
|
100
117
|
this.selection = {
|
|
101
118
|
propertyId: firstId,
|
|
@@ -121,8 +138,7 @@ export class DetailSelection {
|
|
|
121
138
|
}
|
|
122
139
|
getSelectCard(selection) {
|
|
123
140
|
const { groupKey, cardId } = selection.cards[0];
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
?.querySelector(`affine-data-view-kanban-card[data-card-id="${cardId}"]`);
|
|
141
|
+
const group = this.viewEle.querySelector(`affine-data-view-kanban-group[data-key="${groupKey}"]`);
|
|
142
|
+
return group?.querySelector(`affine-data-view-kanban-card[data-card-id="${cardId}"]`);
|
|
127
143
|
}
|
|
128
144
|
}
|
|
@@ -7,6 +7,7 @@ import { RecordDetail } from './detail/detail.js';
|
|
|
7
7
|
import { RecordField } from './detail/field.js';
|
|
8
8
|
import { VariableRefView } from './expression/ref/ref-view.js';
|
|
9
9
|
import { BooleanGroupView } from './group-by/renderer/boolean-group.js';
|
|
10
|
+
import { DateGroupView } from './group-by/renderer/date-group.js';
|
|
10
11
|
import { NumberGroupView } from './group-by/renderer/number-group.js';
|
|
11
12
|
import { SelectGroupView } from './group-by/renderer/select-group.js';
|
|
12
13
|
import { StringGroupView } from './group-by/renderer/string-group.js';
|
|
@@ -27,6 +28,7 @@ export function coreEffects() {
|
|
|
27
28
|
customElements.define('data-view-group-setting', GroupSetting);
|
|
28
29
|
customElements.define('affine-multi-tag-select', MultiTagSelect);
|
|
29
30
|
customElements.define('data-view-group-title-boolean-view', BooleanGroupView);
|
|
31
|
+
customElements.define('data-view-group-title-date-view', DateGroupView);
|
|
30
32
|
customElements.define('affine-multi-tag-view', MultiTagView);
|
|
31
33
|
customElements.define('uni-lit', UniLit);
|
|
32
34
|
customElements.define('uni-any-render', UniAnyRender);
|
|
@@ -5,35 +5,48 @@ const evalRef = (ref, row) => {
|
|
|
5
5
|
const evalValue = (value) => {
|
|
6
6
|
return value?.value;
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Runs one filter function against one cell, or answers `undefined` when the
|
|
10
|
+
* function does not apply: a missing or ill-typed argument, or an
|
|
11
|
+
* implementation that threw. `undefined` is not "no match" — it means this
|
|
12
|
+
* candidate could not decide, so another one may.
|
|
13
|
+
*/
|
|
14
|
+
const applyFilter = (func, value, filter) => {
|
|
15
|
+
const args = [];
|
|
16
|
+
for (let i = 0; i < func.args.length; i++) {
|
|
17
|
+
const argValue = evalValue(filter.args[i]);
|
|
18
|
+
const argType = func.args[i];
|
|
19
|
+
if (argValue == null || argType == null) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
if (!argType.valueValidate(argValue)) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
args.push(argValue);
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
return func.impl(value ?? undefined, ...args);
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
console.error(e);
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
8
35
|
export const evalFilter = (filterGroup, row) => {
|
|
9
36
|
const evalF = (filter) => {
|
|
10
37
|
if (filter.type === 'filter') {
|
|
11
38
|
const value = evalRef(filter.left, row);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const argType = func.args[i];
|
|
21
|
-
if (argValue == null || argType == null) {
|
|
22
|
-
return true;
|
|
39
|
+
// A filter is stored by function name alone. Two types can declare the
|
|
40
|
+
// same name, so try every candidate and keep the first one that can
|
|
41
|
+
// actually decide; a filter nothing can apply lets the row through
|
|
42
|
+
// rather than hiding it.
|
|
43
|
+
for (const func of filterMatcher.getFiltersByName(filter.function)) {
|
|
44
|
+
const result = applyFilter(func, value, filter);
|
|
45
|
+
if (result != null) {
|
|
46
|
+
return result;
|
|
23
47
|
}
|
|
24
|
-
if (!argType.valueValidate(argValue)) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
args.push(argValue);
|
|
28
|
-
}
|
|
29
|
-
const impl = func.impl;
|
|
30
|
-
try {
|
|
31
|
-
return impl(value ?? undefined, ...args);
|
|
32
|
-
}
|
|
33
|
-
catch (e) {
|
|
34
|
-
console.error(e);
|
|
35
|
-
return true;
|
|
36
48
|
}
|
|
49
|
+
return true;
|
|
37
50
|
}
|
|
38
51
|
else if (filter.type === 'group') {
|
|
39
52
|
if (filter.op === 'and') {
|
|
@@ -4,4 +4,11 @@ export declare const filterMatcher: {
|
|
|
4
4
|
filterListBySelfType: (selfType: TypeInstance) => FilterConfig[];
|
|
5
5
|
firstMatchedBySelfType: (selfType: TypeInstance) => FilterConfig | undefined;
|
|
6
6
|
getFilterByName: (name?: string) => FilterConfig | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* A stored filter names its function, not the type it was built for, so a
|
|
9
|
+
* name shared by two types (`is` on a string and `is` on a date, say) is
|
|
10
|
+
* ambiguous on read. Every candidate is returned and the caller picks the
|
|
11
|
+
* one whose arguments actually fit the row.
|
|
12
|
+
*/
|
|
13
|
+
getFiltersByName: (name?: string) => FilterConfig[];
|
|
7
14
|
};
|
|
@@ -45,4 +45,16 @@ export const filterMatcher = {
|
|
|
45
45
|
}
|
|
46
46
|
return allFilter.find(v => v.name === name);
|
|
47
47
|
},
|
|
48
|
+
/**
|
|
49
|
+
* A stored filter names its function, not the type it was built for, so a
|
|
50
|
+
* name shared by two types (`is` on a string and `is` on a date, say) is
|
|
51
|
+
* ambiguous on read. Every candidate is returned and the caller picks the
|
|
52
|
+
* one whose arguments actually fit the row.
|
|
53
|
+
*/
|
|
54
|
+
getFiltersByName: (name) => {
|
|
55
|
+
if (!name) {
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
return allFilter.filter(v => v.name === name);
|
|
59
|
+
},
|
|
48
60
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const RELATIVE_ASC: readonly ["last30", "last7", "yesterday", "today", "tomorrow", "next7", "next30"];
|
|
2
|
+
export declare const RELATIVE_DESC: ("last30" | "last7" | "yesterday" | "today" | "tomorrow" | "next7" | "next30")[];
|
|
3
|
+
/**
|
|
4
|
+
* Sorts relative date keys in chronological order
|
|
5
|
+
*/
|
|
6
|
+
export declare function sortRelativeKeys(a: string, b: string, asc: boolean): number;
|
|
7
|
+
/**
|
|
8
|
+
* Sorts numeric date keys (timestamps)
|
|
9
|
+
*/
|
|
10
|
+
export declare function sortNumericKeys(a: string, b: string, asc: boolean): number;
|
|
11
|
+
export declare function compareDateKeys(mode: string | undefined, asc: boolean): (a: string, b: string) => number;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export const RELATIVE_ASC = [
|
|
2
|
+
'last30',
|
|
3
|
+
'last7',
|
|
4
|
+
'yesterday',
|
|
5
|
+
'today',
|
|
6
|
+
'tomorrow',
|
|
7
|
+
'next7',
|
|
8
|
+
'next30',
|
|
9
|
+
];
|
|
10
|
+
export const RELATIVE_DESC = [...RELATIVE_ASC].reverse();
|
|
11
|
+
/**
|
|
12
|
+
* Sorts relative date keys in chronological order
|
|
13
|
+
*/
|
|
14
|
+
export function sortRelativeKeys(a, b, asc) {
|
|
15
|
+
const order = asc ? RELATIVE_ASC : RELATIVE_DESC;
|
|
16
|
+
const idxA = order.indexOf(a);
|
|
17
|
+
const idxB = order.indexOf(b);
|
|
18
|
+
if (idxA !== -1 && idxB !== -1)
|
|
19
|
+
return idxA - idxB;
|
|
20
|
+
if (idxA !== -1)
|
|
21
|
+
return asc ? 1 : -1;
|
|
22
|
+
if (idxB !== -1)
|
|
23
|
+
return asc ? -1 : 1;
|
|
24
|
+
return 0; // Both not found
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Sorts numeric date keys (timestamps)
|
|
28
|
+
*/
|
|
29
|
+
export function sortNumericKeys(a, b, asc) {
|
|
30
|
+
const na = Number(a);
|
|
31
|
+
const nb = Number(b);
|
|
32
|
+
if (Number.isFinite(na) && Number.isFinite(nb)) {
|
|
33
|
+
return asc ? na - nb : nb - na;
|
|
34
|
+
}
|
|
35
|
+
return 0; // Not both numeric
|
|
36
|
+
}
|
|
37
|
+
export function compareDateKeys(mode, asc) {
|
|
38
|
+
return (a, b) => {
|
|
39
|
+
if (mode === 'date-relative') {
|
|
40
|
+
// Try relative key sorting first
|
|
41
|
+
const relativeResult = sortRelativeKeys(a, b, asc);
|
|
42
|
+
if (relativeResult !== 0)
|
|
43
|
+
return relativeResult;
|
|
44
|
+
// Try numeric sorting second
|
|
45
|
+
const numericResult = sortNumericKeys(a, b, asc);
|
|
46
|
+
if (numericResult !== 0)
|
|
47
|
+
return numericResult;
|
|
48
|
+
// Fallback to lexicographic order for mixed cases
|
|
49
|
+
return asc ? a.localeCompare(b) : b.localeCompare(a);
|
|
50
|
+
}
|
|
51
|
+
// Standard numeric/lexicographic comparison for other date modes
|
|
52
|
+
return (sortNumericKeys(a, b, asc) ||
|
|
53
|
+
(asc ? a.localeCompare(b) : b.localeCompare(a)));
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -5,4 +5,10 @@ export declare const ungroups: {
|
|
|
5
5
|
key: string;
|
|
6
6
|
value: null;
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* The grains a date property offers, in the order the picker shows them. The
|
|
10
|
+
* first one is what `matcher.match` returns for a date property that has no
|
|
11
|
+
* grain stored yet.
|
|
12
|
+
*/
|
|
13
|
+
export declare const dateGroupByConfigs: GroupByConfig[];
|
|
8
14
|
export declare const groupByMatchers: GroupByConfig[];
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import hash from '@emotion/hash';
|
|
2
|
+
import { addDays, differenceInCalendarDays, format as fmt, isToday, isTomorrow, isYesterday, startOfDay, startOfMonth, startOfWeek, startOfYear, } from 'date-fns';
|
|
2
3
|
import { t } from '../logical/type-presets.js';
|
|
3
4
|
import { createUniComponentFromWebComponent } from '../utils/uni-component/uni-component.js';
|
|
4
5
|
import { BooleanGroupView } from './renderer/boolean-group.js';
|
|
6
|
+
import { DateGroupView } from './renderer/date-group.js';
|
|
5
7
|
import { NumberGroupView } from './renderer/number-group.js';
|
|
6
8
|
import { SelectGroupView } from './renderer/select-group.js';
|
|
7
9
|
import { StringGroupView } from './renderer/string-group.js';
|
|
@@ -12,6 +14,117 @@ export const ungroups = {
|
|
|
12
14
|
key: 'Ungroups',
|
|
13
15
|
value: null,
|
|
14
16
|
};
|
|
17
|
+
const WEEK_OPTS_MON = { weekStartsOn: 1 };
|
|
18
|
+
const WEEK_OPTS_SUN = { weekStartsOn: 0 };
|
|
19
|
+
const rangeLabel = (a, b) => `${fmt(a, 'MMM d yyyy')} – ${fmt(b, 'MMM d yyyy')}`;
|
|
20
|
+
/**
|
|
21
|
+
* A date property can be read at several grains — relative to today, by day,
|
|
22
|
+
* by week, by month, by year. Each grain is its own group-by config, named so
|
|
23
|
+
* that a stored `groupBy.name` can pick the grain back up on reload.
|
|
24
|
+
*/
|
|
25
|
+
const buildDateCfg = (name, grouper, groupName) => createGroupByConfig({
|
|
26
|
+
name,
|
|
27
|
+
matchType: t.date.instance(),
|
|
28
|
+
groupName: (_t, v) => groupName(v),
|
|
29
|
+
defaultKeys: _t => [ungroups],
|
|
30
|
+
valuesGroup: (v, _t) => grouper(v),
|
|
31
|
+
addToGroup: (group, _old) => group,
|
|
32
|
+
view: createUniComponentFromWebComponent(DateGroupView),
|
|
33
|
+
});
|
|
34
|
+
const dateRelativeCfg = buildDateCfg('date-relative', v => {
|
|
35
|
+
if (v == null)
|
|
36
|
+
return [ungroups];
|
|
37
|
+
const day = startOfDay(new Date(v));
|
|
38
|
+
const daysDiff = differenceInCalendarDays(day, startOfDay(new Date()));
|
|
39
|
+
if (isToday(day))
|
|
40
|
+
return [{ key: 'today', value: +day }];
|
|
41
|
+
if (isTomorrow(day))
|
|
42
|
+
return [{ key: 'tomorrow', value: +day }];
|
|
43
|
+
if (isYesterday(day))
|
|
44
|
+
return [{ key: 'yesterday', value: +day }];
|
|
45
|
+
if (daysDiff > 0) {
|
|
46
|
+
if (daysDiff <= 7)
|
|
47
|
+
return [{ key: 'next7', value: +day }];
|
|
48
|
+
if (daysDiff <= 30)
|
|
49
|
+
return [{ key: 'next30', value: +day }];
|
|
50
|
+
const month = startOfMonth(day);
|
|
51
|
+
return [{ key: `${+month}`, value: +month }];
|
|
52
|
+
}
|
|
53
|
+
const daysAgo = -daysDiff;
|
|
54
|
+
if (daysAgo <= 7)
|
|
55
|
+
return [{ key: 'last7', value: +day }];
|
|
56
|
+
if (daysAgo <= 30)
|
|
57
|
+
return [{ key: 'last30', value: +day }];
|
|
58
|
+
const month = startOfMonth(day);
|
|
59
|
+
return [{ key: `${+month}`, value: +month }];
|
|
60
|
+
}, v => {
|
|
61
|
+
if (v == null)
|
|
62
|
+
return '';
|
|
63
|
+
const day = startOfDay(new Date(v));
|
|
64
|
+
const daysDiff = differenceInCalendarDays(day, startOfDay(new Date()));
|
|
65
|
+
if (isToday(day))
|
|
66
|
+
return 'Today';
|
|
67
|
+
if (isTomorrow(day))
|
|
68
|
+
return 'Tomorrow';
|
|
69
|
+
if (isYesterday(day))
|
|
70
|
+
return 'Yesterday';
|
|
71
|
+
if (daysDiff > 0) {
|
|
72
|
+
if (daysDiff <= 7)
|
|
73
|
+
return 'Next 7 days';
|
|
74
|
+
if (daysDiff <= 30)
|
|
75
|
+
return 'Next 30 days';
|
|
76
|
+
return fmt(new Date(v), 'MMM yyyy');
|
|
77
|
+
}
|
|
78
|
+
const daysAgo = -daysDiff;
|
|
79
|
+
if (daysAgo <= 7)
|
|
80
|
+
return 'Last 7 days';
|
|
81
|
+
if (daysAgo <= 30)
|
|
82
|
+
return 'Last 30 days';
|
|
83
|
+
return fmt(new Date(v), 'MMM yyyy');
|
|
84
|
+
});
|
|
85
|
+
const dateDayCfg = buildDateCfg('date-day', v => {
|
|
86
|
+
if (v == null)
|
|
87
|
+
return [ungroups];
|
|
88
|
+
const day = startOfDay(new Date(v));
|
|
89
|
+
return [{ key: `${+day}`, value: +day }];
|
|
90
|
+
}, v => (v ? fmt(new Date(v), 'MMM d yyyy') : ''));
|
|
91
|
+
const dateWeekSunCfg = buildDateCfg('date-week-sun', v => {
|
|
92
|
+
if (v == null)
|
|
93
|
+
return [ungroups];
|
|
94
|
+
const week = startOfWeek(new Date(v), WEEK_OPTS_SUN);
|
|
95
|
+
return [{ key: `${+week}`, value: +week }];
|
|
96
|
+
}, v => (v ? rangeLabel(new Date(v), addDays(new Date(v), 6)) : ''));
|
|
97
|
+
const dateWeekMonCfg = buildDateCfg('date-week-mon', v => {
|
|
98
|
+
if (v == null)
|
|
99
|
+
return [ungroups];
|
|
100
|
+
const week = startOfWeek(new Date(v), WEEK_OPTS_MON);
|
|
101
|
+
return [{ key: `${+week}`, value: +week }];
|
|
102
|
+
}, v => (v ? rangeLabel(new Date(v), addDays(new Date(v), 6)) : ''));
|
|
103
|
+
const dateMonthCfg = buildDateCfg('date-month', v => {
|
|
104
|
+
if (v == null)
|
|
105
|
+
return [ungroups];
|
|
106
|
+
const month = startOfMonth(new Date(v));
|
|
107
|
+
return [{ key: `${+month}`, value: +month }];
|
|
108
|
+
}, v => (v ? fmt(new Date(v), 'MMM yyyy') : ''));
|
|
109
|
+
const dateYearCfg = buildDateCfg('date-year', v => {
|
|
110
|
+
if (v == null)
|
|
111
|
+
return [ungroups];
|
|
112
|
+
const year = startOfYear(new Date(v));
|
|
113
|
+
return [{ key: `${+year}`, value: +year }];
|
|
114
|
+
}, v => (v ? fmt(new Date(v), 'yyyy') : ''));
|
|
115
|
+
/**
|
|
116
|
+
* The grains a date property offers, in the order the picker shows them. The
|
|
117
|
+
* first one is what `matcher.match` returns for a date property that has no
|
|
118
|
+
* grain stored yet.
|
|
119
|
+
*/
|
|
120
|
+
export const dateGroupByConfigs = [
|
|
121
|
+
dateRelativeCfg,
|
|
122
|
+
dateDayCfg,
|
|
123
|
+
dateWeekSunCfg,
|
|
124
|
+
dateWeekMonCfg,
|
|
125
|
+
dateMonthCfg,
|
|
126
|
+
dateYearCfg,
|
|
127
|
+
];
|
|
15
128
|
export const groupByMatchers = [
|
|
16
129
|
createGroupByConfig({
|
|
17
130
|
name: 'select',
|
|
@@ -172,4 +285,5 @@ export const groupByMatchers = [
|
|
|
172
285
|
addToGroup: v => v,
|
|
173
286
|
view: createUniComponentFromWebComponent(BooleanGroupView),
|
|
174
287
|
}),
|
|
288
|
+
...dateGroupByConfigs,
|
|
175
289
|
];
|
|
@@ -2,6 +2,13 @@ import type { DataSource } from '../data-source/base.js';
|
|
|
2
2
|
import { Matcher_ } from '../logical/matcher.js';
|
|
3
3
|
import type { GroupByConfig } from './types.js';
|
|
4
4
|
export declare const createGroupByMatcher: (list: GroupByConfig[]) => Matcher_<GroupByConfig, import("../index.js").TypeInstance>;
|
|
5
|
+
/**
|
|
6
|
+
* Resolve a group-by config by the name a stored `groupBy` carries. A property
|
|
7
|
+
* type can offer several configs — a date reads as relative, by day, by week,
|
|
8
|
+
* by month or by year — and only the stored name says which one the reader
|
|
9
|
+
* chose; matching on the type alone would silently snap back to the default.
|
|
10
|
+
*/
|
|
11
|
+
export declare const findGroupByConfigByName: (dataSource: DataSource, name: string) => GroupByConfig | undefined;
|
|
5
12
|
export declare class GroupByService {
|
|
6
13
|
private readonly dataSource;
|
|
7
14
|
constructor(dataSource: DataSource);
|