@formicoidea/labre-core 0.41.0 → 0.43.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +384 -0
- package/dist/_pkgs/affine-block-bookmark/bookmark-block.js +2 -2
- package/dist/_pkgs/affine-block-data-view/configs/tooltips.js +1 -1
- package/dist/_pkgs/affine-block-database/configs/tooltips.js +1 -1
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-text-block.js +4 -2
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.js +7 -1
- package/dist/_pkgs/affine-block-embed/common/iframe-sandbox.d.ts +39 -0
- package/dist/_pkgs/affine-block-embed/common/iframe-sandbox.js +39 -0
- package/dist/_pkgs/affine-block-embed/embed-figma-block/embed-figma-block.js +4 -1
- package/dist/_pkgs/affine-block-embed/embed-github-block/embed-github-block.js +2 -1
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-error-card.d.ts +14 -1
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-error-card.js +21 -2
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.js +2 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.d.ts +2 -1
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +41 -11
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/types.d.ts +16 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/types.js +17 -1
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/utils.d.ts +8 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/utils.js +19 -0
- package/dist/_pkgs/affine-block-embed/embed-loom-block/embed-loom-block.js +4 -1
- package/dist/_pkgs/affine-block-embed/embed-youtube-block/embed-youtube-block.js +4 -1
- package/dist/_pkgs/affine-block-embed/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-embed/index.js +1 -0
- package/dist/_pkgs/affine-block-embed/translations.d.ts +8 -0
- package/dist/_pkgs/affine-block-embed/translations.js +28 -0
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-linked-doc-block.js +4 -2
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-synced-doc-block.js +2 -2
- package/dist/_pkgs/affine-block-frame/frame-manager.js +6 -3
- package/dist/_pkgs/affine-block-frame/frame-tool.js +1 -1
- package/dist/_pkgs/affine-block-frame/frame-toolbar.js +6 -1
- package/dist/_pkgs/affine-block-list/list-keymap.js +7 -0
- package/dist/_pkgs/affine-block-list/utils/get-list-icon.js +3 -1
- package/dist/_pkgs/affine-block-note/configs/tooltips.js +1 -1
- package/dist/_pkgs/affine-block-note/note-keymap.js +7 -1
- package/dist/_pkgs/affine-block-paragraph/paragraph-keymap.js +7 -1
- package/dist/_pkgs/affine-block-root/adapters/html.js +2 -2
- package/dist/_pkgs/affine-block-root/commands/copy-link-commands.d.ts +2 -0
- package/dist/_pkgs/affine-block-root/commands/copy-link-commands.js +155 -0
- package/dist/_pkgs/affine-block-root/commands/pivot-commands.js +1 -8
- package/dist/_pkgs/affine-block-root/commands/tag-commands.js +1 -8
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.d.ts +9 -0
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.js +51 -0
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.d.ts +22 -0
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +46 -0
- package/dist/_pkgs/affine-block-root/edgeless/utils/pinch-zoom.d.ts +21 -0
- package/dist/_pkgs/affine-block-root/edgeless/utils/pinch-zoom.js +24 -0
- package/dist/_pkgs/affine-block-root/edgeless/utils/query.js +8 -0
- package/dist/_pkgs/affine-block-root/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-root/index.js +1 -0
- package/dist/_pkgs/affine-block-root/keyboard/keymap.js +1 -16
- package/dist/_pkgs/affine-block-root/view.js +2 -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/export-svg/command.d.ts +23 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.js +89 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.d.ts +7 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.js +5 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.d.ts +41 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +70 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.d.ts +49 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.js +257 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/tagged-path.d.ts +16 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/tagged-path.js +24 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.d.ts +24 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.js +66 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +4 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.js +4 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.d.ts +66 -4
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +253 -11
- package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +18 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend-toolbar.d.ts +81 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend-toolbar.js +81 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend.d.ts +144 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend.js +495 -0
- package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.js +4 -0
- package/dist/_pkgs/affine-block-surface/extensions/reading-widget.d.ts +17 -3
- package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +35 -13
- package/dist/_pkgs/affine-block-surface/extensions/reading.d.ts +61 -1
- package/dist/_pkgs/affine-block-surface/extensions/reading.js +85 -39
- package/dist/_pkgs/affine-block-surface/extensions/record-action.d.ts +66 -0
- package/dist/_pkgs/affine-block-surface/extensions/record-action.js +145 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.d.ts +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.js +23 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +1 -1
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +12 -4
- package/dist/_pkgs/affine-block-surface/extensions/validation.d.ts +253 -28
- package/dist/_pkgs/affine-block-surface/extensions/validation.js +489 -41
- package/dist/_pkgs/affine-block-surface/framework-background/background-view.d.ts +115 -0
- package/dist/_pkgs/affine-block-surface/framework-background/background-view.js +185 -0
- package/dist/_pkgs/affine-block-surface/framework-background/fit.d.ts +36 -0
- package/dist/_pkgs/affine-block-surface/framework-background/fit.js +30 -0
- package/dist/_pkgs/affine-block-surface/framework-background/index.d.ts +2 -0
- package/dist/_pkgs/affine-block-surface/framework-background/index.js +2 -0
- package/dist/_pkgs/affine-block-surface/framework-background/labels.d.ts +16 -1
- package/dist/_pkgs/affine-block-surface/framework-background/labels.js +31 -21
- package/dist/_pkgs/affine-block-surface/framework-background/renderer.js +29 -5
- package/dist/_pkgs/affine-block-surface/framework-background/stacking.d.ts +6 -4
- package/dist/_pkgs/affine-block-surface/framework-background/stacking.js +56 -8
- package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.d.ts +12 -0
- package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.js +15 -0
- package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.js +2 -7
- package/dist/_pkgs/affine-block-surface/view.js +8 -1
- package/dist/_pkgs/affine-block-surface-ref/configs/slash-menu.js +1 -1
- package/dist/_pkgs/affine-block-surface-ref/configs/tooltips.js +2 -2
- package/dist/_pkgs/affine-components/color-picker/button.d.ts +56 -1
- package/dist/_pkgs/affine-components/color-picker/button.js +168 -23
- package/dist/_pkgs/affine-components/color-picker/framework-palette.d.ts +106 -0
- package/dist/_pkgs/affine-components/color-picker/framework-palette.js +177 -0
- package/dist/_pkgs/affine-components/color-picker/index.d.ts +2 -0
- package/dist/_pkgs/affine-components/color-picker/index.js +2 -0
- package/dist/_pkgs/affine-components/color-picker/palette-carousel.d.ts +85 -0
- package/dist/_pkgs/affine-components/color-picker/palette-carousel.js +445 -0
- package/dist/_pkgs/affine-components/color-picker/styles.js +1 -1
- package/dist/_pkgs/affine-components/context-menu/button.js +3 -1
- package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.d.ts +31 -1
- package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.js +189 -63
- package/dist/_pkgs/affine-components/icons/ai.js +3 -3
- package/dist/_pkgs/affine-components/icons/list.js +7 -1
- package/dist/_pkgs/affine-components/resource/resource.js +29 -16
- package/dist/_pkgs/affine-components/size-dropdown-menu/dropdown-menu.js +6 -1
- package/dist/_pkgs/affine-components/toolbar/index.d.ts +1 -1
- package/dist/_pkgs/affine-components/toolbar/index.js +1 -1
- package/dist/_pkgs/affine-components/toolbar/menu-button.d.ts +7 -0
- package/dist/_pkgs/affine-components/toolbar/menu-button.js +30 -0
- package/dist/_pkgs/affine-components/toolbar/picker-menu.d.ts +16 -1
- package/dist/_pkgs/affine-components/toolbar/picker-menu.js +2 -2
- package/dist/_pkgs/affine-components/toolbar/toolbar.d.ts +1 -0
- package/dist/_pkgs/affine-components/toolbar/toolbar.js +67 -0
- package/dist/_pkgs/affine-components/translations.d.ts +8 -0
- package/dist/_pkgs/affine-components/translations.js +17 -0
- package/dist/_pkgs/affine-foundation/view.js +2 -1
- package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card-title-editor.js +1 -1
- package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card.js +1 -1
- package/dist/_pkgs/affine-gfx-brush/element-renderer.js +2 -2
- package/dist/_pkgs/affine-gfx-brush/toolbar/components/eraser/icons.js +1 -1
- package/dist/_pkgs/affine-gfx-brush/toolbar/configs/brush.js +6 -1
- package/dist/_pkgs/affine-gfx-brush/toolbar/configs/highlighter.js +6 -1
- package/dist/_pkgs/affine-gfx-connector/connector-manager.d.ts +9 -1
- package/dist/_pkgs/affine-gfx-connector/connector-manager.js +61 -0
- package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.d.ts +11 -2
- package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.js +11 -2
- package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.d.ts +7 -1
- package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.js +87 -17
- package/dist/_pkgs/affine-gfx-connector/element-renderer/index.js +78 -17
- package/dist/_pkgs/affine-gfx-connector/element-renderer/utils.d.ts +24 -2
- package/dist/_pkgs/affine-gfx-connector/element-renderer/utils.js +31 -8
- package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.d.ts +124 -3
- package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.js +219 -56
- package/dist/_pkgs/affine-gfx-connector/text/text.d.ts +13 -4
- package/dist/_pkgs/affine-gfx-connector/text/text.js +13 -44
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.d.ts +56 -0
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +94 -10
- package/dist/_pkgs/affine-gfx-connector/toolbar/hollow-endpoint-icons.d.ts +8 -0
- package/dist/_pkgs/affine-gfx-connector/toolbar/hollow-endpoint-icons.js +118 -0
- package/dist/_pkgs/affine-gfx-connector/translations.d.ts +3 -0
- package/dist/_pkgs/affine-gfx-connector/translations.js +23 -0
- package/dist/_pkgs/affine-gfx-connector/view/view.d.ts +37 -1
- package/dist/_pkgs/affine-gfx-connector/view/view.js +97 -8
- package/dist/_pkgs/affine-gfx-group/command/group-api.js +1 -1
- package/dist/_pkgs/affine-gfx-group/store.js +0 -2
- package/dist/_pkgs/affine-gfx-group/translations.d.ts +9 -10
- package/dist/_pkgs/affine-gfx-group/translations.js +9 -13
- package/dist/_pkgs/affine-gfx-mindmap/indicator-overlay/index.js +6 -2
- package/dist/_pkgs/affine-gfx-mindmap/templates/index.js +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/basket-elements.js +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/config.js +4 -2
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/utils/import-mindmap.js +2 -2
- package/dist/_pkgs/affine-gfx-mindmap/translations.d.ts +7 -1
- package/dist/_pkgs/affine-gfx-mindmap/translations.js +11 -1
- package/dist/_pkgs/affine-gfx-shape/element-renderer/highlighter.js +2 -2
- package/dist/_pkgs/affine-gfx-shape/overlay/polygon-drawing-overlay.d.ts +6 -0
- package/dist/_pkgs/affine-gfx-shape/overlay/polygon-drawing-overlay.js +30 -1
- package/dist/_pkgs/affine-gfx-shape/polygon-tool.d.ts +20 -1
- package/dist/_pkgs/affine-gfx-shape/polygon-tool.js +9 -1
- package/dist/_pkgs/affine-gfx-shape/toolbar/config.js +10 -3
- package/dist/_pkgs/affine-gfx-shape/toolbar/palette-color-action.js +11 -1
- package/dist/_pkgs/affine-gfx-shape/translations.d.ts +7 -0
- package/dist/_pkgs/affine-gfx-shape/translations.js +11 -0
- package/dist/_pkgs/affine-gfx-template/builtin/other.js +14 -8
- package/dist/_pkgs/affine-gfx-template/snapshot-from-action.js +32 -119
- package/dist/_pkgs/affine-gfx-template/toolbar/template-loading.js +1 -1
- package/dist/_pkgs/affine-gfx-template/toolbar/template-type.d.ts +1 -1
- package/dist/_pkgs/affine-gfx-template/translations.d.ts +5 -0
- package/dist/_pkgs/affine-gfx-template/translations.js +38 -0
- package/dist/_pkgs/affine-gfx-text/dblclick-add-edgeless-text.d.ts +13 -1
- package/dist/_pkgs/affine-gfx-text/dblclick-add-edgeless-text.js +19 -4
- package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.d.ts +41 -0
- package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.js +60 -4
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.d.ts +8 -1
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +14 -2
- package/dist/_pkgs/affine-gfx-text/translations.d.ts +9 -0
- package/dist/_pkgs/affine-gfx-text/translations.js +14 -1
- package/dist/_pkgs/affine-inline-latex/latex-node/latex-editor-menu.js +2 -1
- package/dist/_pkgs/affine-inline-preset/markdown.js +5 -1
- package/dist/_pkgs/affine-model/consts/connector.d.ts +28 -2
- package/dist/_pkgs/affine-model/consts/connector.js +26 -0
- package/dist/_pkgs/affine-model/consts/text.d.ts +15 -2
- package/dist/_pkgs/affine-model/consts/text.js +25 -1
- package/dist/_pkgs/affine-model/elements/bpmn/pool.js +1 -1
- package/dist/_pkgs/affine-model/elements/brush/brush.js +1 -1
- package/dist/_pkgs/affine-model/elements/c4/board.js +1 -1
- package/dist/_pkgs/affine-model/elements/c4/boundary.js +1 -1
- package/dist/_pkgs/affine-model/elements/connector/connector.d.ts +135 -0
- package/dist/_pkgs/affine-model/elements/connector/connector.js +246 -5
- package/dist/_pkgs/affine-model/elements/connector/end-label.d.ts +83 -0
- package/dist/_pkgs/affine-model/elements/connector/end-label.js +119 -0
- package/dist/_pkgs/affine-model/elements/connector/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/connector/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/context-map/context-map.js +1 -1
- package/dist/_pkgs/affine-model/elements/core-domain/core-domain.d.ts +28 -0
- package/dist/_pkgs/affine-model/elements/core-domain/core-domain.js +129 -2
- package/dist/_pkgs/affine-model/elements/cynefin/cynefin.d.ts +8 -0
- package/dist/_pkgs/affine-model/elements/cynefin/cynefin.js +45 -2
- package/dist/_pkgs/affine-model/elements/edgy/board.js +1 -1
- package/dist/_pkgs/affine-model/elements/edgy/facets.js +1 -1
- package/dist/_pkgs/affine-model/elements/estuarine/estuarine.d.ts +6 -0
- package/dist/_pkgs/affine-model/elements/estuarine/estuarine.js +36 -2
- package/dist/_pkgs/affine-model/elements/event-storming/event-storming.d.ts +18 -7
- package/dist/_pkgs/affine-model/elements/event-storming/event-storming.js +23 -8
- package/dist/_pkgs/affine-model/elements/framework-background/background.d.ts +16 -0
- package/dist/_pkgs/affine-model/elements/framework-background/background.js +18 -0
- package/dist/_pkgs/affine-model/elements/highlighter/highlighter.js +1 -1
- package/dist/_pkgs/affine-model/elements/index.d.ts +8 -0
- package/dist/_pkgs/affine-model/elements/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/shape/shape.js +1 -1
- package/dist/_pkgs/affine-model/elements/text/text.js +1 -1
- package/dist/_pkgs/affine-model/elements/uml/band.d.ts +39 -0
- package/dist/_pkgs/affine-model/elements/uml/band.js +31 -0
- package/dist/_pkgs/affine-model/elements/uml/diagram.d.ts +158 -0
- package/dist/_pkgs/affine-model/elements/uml/diagram.js +229 -0
- package/dist/_pkgs/affine-model/elements/uml/fragment.d.ts +161 -0
- package/dist/_pkgs/affine-model/elements/uml/fragment.js +205 -0
- package/dist/_pkgs/affine-model/elements/uml/index.d.ts +8 -0
- package/dist/_pkgs/affine-model/elements/uml/index.js +8 -0
- package/dist/_pkgs/affine-model/elements/uml/lifeline.d.ts +77 -0
- package/dist/_pkgs/affine-model/elements/uml/lifeline.js +89 -0
- package/dist/_pkgs/affine-model/elements/uml/node.d.ts +142 -0
- package/dist/_pkgs/affine-model/elements/uml/node.js +190 -0
- package/dist/_pkgs/affine-model/elements/uml/partition.d.ts +106 -0
- package/dist/_pkgs/affine-model/elements/uml/partition.js +172 -0
- package/dist/_pkgs/affine-model/elements/uml/region.d.ts +75 -0
- package/dist/_pkgs/affine-model/elements/uml/region.js +150 -0
- package/dist/_pkgs/affine-model/elements/uml/subject.d.ts +37 -0
- package/dist/_pkgs/affine-model/elements/uml/subject.js +108 -0
- package/dist/_pkgs/affine-model/elements/wardley/wardley.js +1 -1
- package/dist/_pkgs/affine-shared/services/embed-iframe/embed-iframe-config.d.ts +1 -0
- package/dist/_pkgs/affine-shared/services/font-loader/config.d.ts +18 -0
- package/dist/_pkgs/affine-shared/services/font-loader/config.js +82 -50
- package/dist/_pkgs/affine-shared/services/pivot-materiality-publisher.js +1 -9
- package/dist/_pkgs/affine-shared/services/telemetry-service/document-damage-watcher.d.ts +53 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/document-damage-watcher.js +95 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/index.js +1 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +26 -1
- package/dist/_pkgs/affine-shared/services/telemetry-service/telemetry-service.d.ts +2 -2
- package/dist/_pkgs/affine-shared/services/theme-service.d.ts +19 -0
- package/dist/_pkgs/affine-shared/services/theme-service.js +24 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/command-action.d.ts +34 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/command-action.js +63 -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/translation-service/chrome.d.ts +97 -7
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +178 -7
- 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/motion.d.ts +14 -0
- package/dist/_pkgs/affine-shared/styles/motion.js +38 -0
- package/dist/_pkgs/affine-shared/utils/event.d.ts +10 -0
- package/dist/_pkgs/affine-shared/utils/event.js +20 -0
- package/dist/_pkgs/affine-shared/utils/file/filesys.d.ts +16 -0
- package/dist/_pkgs/affine-shared/utils/file/filesys.js +25 -0
- package/dist/_pkgs/affine-shared/utils/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/utils/index.js +1 -0
- package/dist/_pkgs/affine-shared/utils/link-preview-refresh.d.ts +12 -0
- package/dist/_pkgs/affine-shared/utils/link-preview-refresh.js +13 -0
- package/dist/_pkgs/affine-widget-edgeless-dragging-area/edgeless-dragging-area-rect.js +2 -2
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/utils.js +5 -1
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.d.ts +12 -4
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +27 -4
- package/dist/_pkgs/affine-widget-edgeless-toolbar/config/types.d.ts +15 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.d.ts +1 -1
- package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.js +7 -2
- package/dist/_pkgs/affine-widget-edgeless-toolbar/create-popper.js +13 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/index.d.ts +2 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/index.js +2 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.d.ts +80 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.js +270 -81
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/senior-menu-selection.d.ts +15 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/senior-menu-selection.js +15 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-family-panel.d.ts +18 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-family-panel.js +52 -6
- package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-weight-and-style-panel.js +8 -1
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-ghost-overlay.d.ts +42 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-ghost-overlay.js +100 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-placement-tool.d.ts +100 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-placement-tool.js +274 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/index.d.ts +3 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/index.js +3 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/translate-created.d.ts +25 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/translate-created.js +67 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.d.ts +6 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.js +10 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +5 -0
- package/dist/_pkgs/affine-widget-frame-title/edgeless-frame-title-editor.js +2 -1
- package/dist/_pkgs/affine-widget-slash-menu/translations.d.ts +16 -0
- package/dist/_pkgs/affine-widget-slash-menu/translations.js +23 -1
- package/dist/_pkgs/affine-widget-toolbar/utils.js +57 -14
- package/dist/_pkgs/data-view/core/detail/field.js +2 -1
- package/dist/_pkgs/data-view/core/filter/literal/define.js +3 -1
- package/dist/_pkgs/data-view/core/group-by/renderer/boolean-group.js +1 -1
- package/dist/_pkgs/data-view/property-presets/checkbox/cell-renderer.js +8 -2
- package/dist/_pkgs/data-view/view-presets/kanban/pc/cell.js +1 -1
- package/dist/_pkgs/data-view/view-presets/kanban/pc/controller/drag.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/controller/drag.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/controller/selection.js +1 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/header/vertical-indicator.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/row/row-select-checkbox.js +3 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/drag.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/selection.js +1 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/header/vertical-indicator.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/row/row-header.js +3 -1
- package/dist/_pkgs/global/gfx/xywh.js +7 -0
- package/dist/_pkgs/std/extension/command-registry.d.ts +158 -1
- package/dist/_pkgs/std/extension/command-registry.js +22 -0
- package/dist/_pkgs/std/gfx/index.d.ts +1 -1
- package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.d.ts +12 -0
- package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.js +20 -1
- package/dist/_pkgs/std/gfx/interactivity/manager.d.ts +10 -0
- package/dist/_pkgs/std/gfx/interactivity/manager.js +12 -0
- package/dist/_pkgs/std/gfx/model/surface/element-model.js +12 -7
- package/dist/_pkgs/std/gfx/model/surface/role.d.ts +10 -5
- package/dist/_pkgs/std/gfx/model/surface/surface-model.d.ts +56 -0
- package/dist/_pkgs/std/gfx/model/surface/surface-model.js +84 -3
- package/dist/_pkgs/std/gfx/view/view.d.ts +11 -2
- package/dist/_pkgs/std/gfx/view/view.js +16 -2
- package/dist/commands.d.ts +6 -0
- package/dist/commands.js +10 -2
- package/dist/frameworks.d.ts +9 -0
- package/dist/frameworks.js +19 -0
- package/dist/translations.js +21 -0
- package/package.json +13 -4
- package/dist/_pkgs/affine-gfx-group/group-watcher.d.ts +0 -1
- package/dist/_pkgs/affine-gfx-group/group-watcher.js +0 -20
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { BOARD_LEGEND_NOTATION, TelemetryProvider, } from '../../affine-shared/services/index.js';
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { createBoardLegend } from './legend.js';
|
|
4
|
+
/**
|
|
5
|
+
* Contextual-toolbar glyph — "generate the legend of what is on this board".
|
|
6
|
+
* One icon because it is one gesture; the Core Domain chart has drawn this exact
|
|
7
|
+
* box-and-rows since its legend button shipped and the others borrowed it.
|
|
8
|
+
*
|
|
9
|
+
* `html` rather than `svg`: a toolbar action's `icon` is rendered as a
|
|
10
|
+
* standalone template, unlike the senior-button glyphs that are interpolated
|
|
11
|
+
* into an outer `<svg>`.
|
|
12
|
+
*/
|
|
13
|
+
export const legendIcon = html `<svg
|
|
14
|
+
width="24"
|
|
15
|
+
height="24"
|
|
16
|
+
viewBox="0 0 24 24"
|
|
17
|
+
fill="none"
|
|
18
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
19
|
+
>
|
|
20
|
+
<rect
|
|
21
|
+
x="3"
|
|
22
|
+
y="4"
|
|
23
|
+
width="18"
|
|
24
|
+
height="16"
|
|
25
|
+
rx="2"
|
|
26
|
+
stroke="currentColor"
|
|
27
|
+
stroke-width="1.6"
|
|
28
|
+
/>
|
|
29
|
+
<circle cx="7" cy="9" r="1.6" fill="currentColor" />
|
|
30
|
+
<circle cx="7" cy="14" r="1.6" fill="currentColor" />
|
|
31
|
+
<path d="M11 9 H18 M11 14 H18" stroke="currentColor" stroke-width="1.4" />
|
|
32
|
+
</svg>`;
|
|
33
|
+
/**
|
|
34
|
+
* The ONE `FrameworkLegendCreated` emission, with the wire values every
|
|
35
|
+
* framework's own button has been sending.
|
|
36
|
+
*
|
|
37
|
+
* `framework` is the HISTORICAL PostHog value (`FrameworkDescriptor.
|
|
38
|
+
* telemetryKey`): `context-map`, not `ddd-context-map`. It is a parameter and
|
|
39
|
+
* not derived from anything, because the two spellings differ for three of the
|
|
40
|
+
* eight frameworks and a prefix rule would quietly rename a metric.
|
|
41
|
+
*/
|
|
42
|
+
export function trackLegendCreated(std, framework, module) {
|
|
43
|
+
std.getOptional(TelemetryProvider)?.track('FrameworkLegendCreated', {
|
|
44
|
+
framework,
|
|
45
|
+
element: 'legend',
|
|
46
|
+
page: 'whiteboard editor',
|
|
47
|
+
segment: 'element toolbar',
|
|
48
|
+
module,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The shared legend entry of a board's contextual toolbar.
|
|
53
|
+
*
|
|
54
|
+
* Registered by each framework in its OWN flag-gated module
|
|
55
|
+
* (`custom:affine:surface:<board>`), merged with `validationToolbarConfig`'s
|
|
56
|
+
* actions: a flavour may carry exactly one toolbar module, and generating a
|
|
57
|
+
* legend is tooling a flag may take away. What the gesture already WROTE is
|
|
58
|
+
* document content and keeps being painted with the flag off — the box is made
|
|
59
|
+
* of plain shapes, text and the framework's own always-on renderers.
|
|
60
|
+
*/
|
|
61
|
+
export function legendToolbarAction({ id = 'b.legend', Model, owner, framework, module = `${framework} toolbar`, tooltipWording = BOARD_LEGEND_NOTATION, icon = legendIcon, }) {
|
|
62
|
+
const boardOf = (ctx) => ctx.getSurfaceModelsByType(Model)[0];
|
|
63
|
+
return {
|
|
64
|
+
id,
|
|
65
|
+
tooltipWording,
|
|
66
|
+
icon,
|
|
67
|
+
run(ctx) {
|
|
68
|
+
if (ctx.std.store.readonly)
|
|
69
|
+
return;
|
|
70
|
+
// The FIRST selected board and no other: a legend is placed relative to
|
|
71
|
+
// one board, and two of them would put two boxes on top of whatever sits
|
|
72
|
+
// in that corner.
|
|
73
|
+
const board = boardOf(ctx);
|
|
74
|
+
if (!board)
|
|
75
|
+
return;
|
|
76
|
+
createBoardLegend(ctx.std, board, owner);
|
|
77
|
+
trackLegendCreated(ctx.std, framework, module);
|
|
78
|
+
},
|
|
79
|
+
when: (ctx) => boardOf(ctx) !== undefined,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { Bound } from '../../global/gfx/index.js';
|
|
2
|
+
import { type BlockStdScope, type CommandLegendExtra, type CommandLegendRow, type CommandOwner } from '../../std/index.js';
|
|
3
|
+
import { type GfxController, type RoleId } from '../../std/gfx/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* The legend PLATFORM: one engine, one box, for every framework that documents
|
|
6
|
+
* itself.
|
|
7
|
+
*
|
|
8
|
+
* Two things it deliberately does not do, and they are the whole design:
|
|
9
|
+
*
|
|
10
|
+
* - **detection is by ROLE, never by `instanceof` or by fill colour.** A role is
|
|
11
|
+
* the semantic identity of an artefact (`framework/std`'s `role.ts`); a shape
|
|
12
|
+
* type is not, and a colour is a restyle away from lying. Reading roles also
|
|
13
|
+
* means a legend and a validation rule agree on what is on the board, because
|
|
14
|
+
* they read the same field;
|
|
15
|
+
* - **a framework writes no legend code.** {@link legendFromCommands} derives
|
|
16
|
+
* the whole thing from the commands it already declares — their order, their
|
|
17
|
+
* category, the role each stamps and the swatch each subscribes
|
|
18
|
+
* (`CommandDescriptor.legend`). Scanning the perimeter, resolving
|
|
19
|
+
* specialisations, dropping empty sections, placing and grouping the box all
|
|
20
|
+
* happen here, once.
|
|
21
|
+
*
|
|
22
|
+
* It lives in the surface block rather than with any framework bundle for the
|
|
23
|
+
* reason `validation.ts` next door does: BPMN and Wardley must not take a
|
|
24
|
+
* dependency on a DDD bundle to draw their own legend.
|
|
25
|
+
*
|
|
26
|
+
* See `docs/adr/0026`.
|
|
27
|
+
*/
|
|
28
|
+
type Surface = NonNullable<GfxController['surface']>;
|
|
29
|
+
/** A {@link CommandLegendRow} with the label the engine resolved for it. */
|
|
30
|
+
export interface LegendRow extends CommandLegendRow {
|
|
31
|
+
label: string;
|
|
32
|
+
}
|
|
33
|
+
export interface LegendSection {
|
|
34
|
+
title?: string;
|
|
35
|
+
rows: LegendRow[];
|
|
36
|
+
}
|
|
37
|
+
/** How the box is laid out, for a legend whose swatches are not 16-unit chips. */
|
|
38
|
+
export interface LegendLayout {
|
|
39
|
+
width?: number;
|
|
40
|
+
/** Row pitch; the swatch is drawn centred in it. Defaults to 28. */
|
|
41
|
+
rowHeight?: number;
|
|
42
|
+
/** Swatch box, defaults to a 16 × 16 chip. */
|
|
43
|
+
swatchWidth?: number;
|
|
44
|
+
swatchHeight?: number;
|
|
45
|
+
}
|
|
46
|
+
/** A block of the box that is not a row. See {@link CommandLegendBox.extras}. */
|
|
47
|
+
export type LegendExtra = CommandLegendExtra;
|
|
48
|
+
/**
|
|
49
|
+
* The ink and the type a notation writes its labels in: this box's rows, and
|
|
50
|
+
* the words the DDD prefabs set beside a dot or a marker.
|
|
51
|
+
*
|
|
52
|
+
* Declared HERE and re-exported by `@labre/affine-gfx-ddd-shared`, rather than
|
|
53
|
+
* the other way round, because that bundle depends on this one and a legend
|
|
54
|
+
* must not depend on a DDD bundle to be drawn.
|
|
55
|
+
*/
|
|
56
|
+
export declare const LABEL_COLOR: string;
|
|
57
|
+
export declare const LABEL_FONT = "blocksuite:surface:Inter";
|
|
58
|
+
export declare const LABEL_FONT_SIZE = 14;
|
|
59
|
+
/**
|
|
60
|
+
* The role the legend's GROUP carries — the one thing on a generated legend
|
|
61
|
+
* that says what it is.
|
|
62
|
+
*
|
|
63
|
+
* Its glyphs deliberately carry none (see {@link addShape}), which is what
|
|
64
|
+
* keeps a legend out of the scan and out of every validation rule. But "made of
|
|
65
|
+
* nothing in particular" is unreadable to anything that has to tell a legend
|
|
66
|
+
* from a drawing, and something does: the `.bpmn` export counts what it left
|
|
67
|
+
* behind inside a pool, and a legend's fourteen glyphs would be reported as
|
|
68
|
+
* fourteen losses. The wrapper says so instead, once, structurally — no title
|
|
69
|
+
* to match on, no framework name, no geometry.
|
|
70
|
+
*
|
|
71
|
+
* `core:` because it belongs to no framework: no `RoleDefs` declares it, so
|
|
72
|
+
* `roleIsA` matches it against nothing, no rule evaluates it and no legend row
|
|
73
|
+
* lights because of it. Nothing is backfilled, as ever — a legend drawn before
|
|
74
|
+
* this shipped carries no role and is not recognised.
|
|
75
|
+
*/
|
|
76
|
+
export declare const LEGEND_ROLE = "core:legend";
|
|
77
|
+
/**
|
|
78
|
+
* How big the box {@link addLegend} would draw for these sections is — without
|
|
79
|
+
* drawing it. The engine needs the height to drop the box bottom-left of a
|
|
80
|
+
* board, and measuring is the only honest way to get it: the box grows with the
|
|
81
|
+
* number of sub-titles, rows and extras, which is exactly what the detection
|
|
82
|
+
* pass decides.
|
|
83
|
+
*/
|
|
84
|
+
export declare function measureLegend(sections: readonly LegendSection[], layout?: LegendLayout, extras?: readonly LegendExtra[]): {
|
|
85
|
+
width: number;
|
|
86
|
+
height: number;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* A boxed legend: a bordered container with a bold title and bold section
|
|
90
|
+
* sub-titles, each row a swatch + label, then whatever `extras` add below.
|
|
91
|
+
* Returns the grouped id.
|
|
92
|
+
*/
|
|
93
|
+
export declare function addLegend(surface: Surface, std: BlockStdScope, x: number, y: number, opts: {
|
|
94
|
+
title: string;
|
|
95
|
+
sections: LegendSection[];
|
|
96
|
+
extras?: readonly LegendExtra[];
|
|
97
|
+
} & LegendLayout): string;
|
|
98
|
+
/**
|
|
99
|
+
* Every role carried by an element inside `bound`.
|
|
100
|
+
*
|
|
101
|
+
* Neutral elements (no role) contribute nothing, which is the whole
|
|
102
|
+
* compatibility promise: a board drawn before the vocabularies existed produces
|
|
103
|
+
* an empty set and therefore a legend with no rows, exactly like an empty board.
|
|
104
|
+
* It is also why a legend never lists itself: nothing it draws carries a role.
|
|
105
|
+
*/
|
|
106
|
+
export declare function rolesInBound(gfx: GfxController, bound: Bound): Set<RoleId>;
|
|
107
|
+
/**
|
|
108
|
+
* The legend of a board, derived from the commands of the framework that owns
|
|
109
|
+
* it: every subscribed row whose role is present (directly or through a
|
|
110
|
+
* specialisation, unless the entry asks for {@link CommandLegendEntry.exact}),
|
|
111
|
+
* in command order, grouped under the section each declares — or under its
|
|
112
|
+
* command's category — with empty sections dropped.
|
|
113
|
+
*
|
|
114
|
+
* The SUB-TITLES come out in the order the framework first declares them,
|
|
115
|
+
* walking every command whether its row lights or not: a legend is a key to a
|
|
116
|
+
* notation, so the same framework reads in the same order on every board, and
|
|
117
|
+
* only the rows change.
|
|
118
|
+
*
|
|
119
|
+
* Rows are de-duplicated BY ROLE, first declaration winning: two commands draw
|
|
120
|
+
* a Wardley area (a rectangle and a polygon) and the notation has one "Area".
|
|
121
|
+
*
|
|
122
|
+
* When nothing is recognised the result is an EMPTY array, and the caller still
|
|
123
|
+
* draws the box: a legend of a board with nothing on it lists nothing, rather
|
|
124
|
+
* than inventing the full notation the user has not used.
|
|
125
|
+
*/
|
|
126
|
+
export declare function legendFromCommands(std: BlockStdScope, owner: CommandOwner, present: ReadonlySet<RoleId>): LegendSection[];
|
|
127
|
+
/**
|
|
128
|
+
* Build the legend of what is drawn inside `board` and drop it bottom-left of
|
|
129
|
+
* it, grouped and selected. THE gesture the shared toolbar button runs.
|
|
130
|
+
*
|
|
131
|
+
* REPLACES the board's own legend if it already has one, rather than stacking a
|
|
132
|
+
* second box on the first (issue #391): the placement is derived from the board
|
|
133
|
+
* alone, so every press landed at the same pixel and the copies were invisible
|
|
134
|
+
* — one box to the eye, N groups and N × ~15 elements in the document. The
|
|
135
|
+
* second press is therefore a REFRESH, which is what a user who has just added
|
|
136
|
+
* three artefacts is asking for; the cost is that hand retouching of the box is
|
|
137
|
+
* lost, and one undo brings it back (see {@link legendsOn} and ADR 0026).
|
|
138
|
+
*
|
|
139
|
+
* Returns the group id, or `undefined` when there is no surface to draw on.
|
|
140
|
+
*/
|
|
141
|
+
export declare function createBoardLegend(std: BlockStdScope, board: {
|
|
142
|
+
xywh: string;
|
|
143
|
+
}, owner: CommandOwner): string | undefined;
|
|
144
|
+
export {};
|