@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
|
@@ -40,13 +40,13 @@ import { SignalWatcher, WithDisposable } from '../../global/lit/index.js';
|
|
|
40
40
|
import { stdContext } from '../../std/index.js';
|
|
41
41
|
import { consume } from '@lit/context';
|
|
42
42
|
import { batch, signal } from '@preact/signals-core';
|
|
43
|
-
import { css, html, LitElement } from 'lit';
|
|
44
|
-
import { property, query } from 'lit/decorators.js';
|
|
43
|
+
import { css, html, LitElement, nothing } from 'lit';
|
|
44
|
+
import { property, query, state } from 'lit/decorators.js';
|
|
45
45
|
import { choose } from 'lit-html/directives/choose.js';
|
|
46
46
|
import { repeat } from 'lit-html/directives/repeat.js';
|
|
47
47
|
import { styleMap } from 'lit-html/directives/style-map.js';
|
|
48
48
|
import { when } from 'lit-html/directives/when.js';
|
|
49
|
-
import { calcCustomButtonStyle, keepColor, packColorsWith, preprocessColor, rgbaToHex8, } from '../color-picker/index.js';
|
|
49
|
+
import { calcCustomButtonStyle, keepColor, packColorsWith, paletteCarouselPage, paletteCarouselStyles, paletteCarouselWheel, preprocessColor, renderPaletteCarousel, rgbaToHex8, } from '../color-picker/index.js';
|
|
50
50
|
import { BORDER_COLOR_LABEL, COLOR_LABEL, FILL_COLOR_LABEL, } from '../translations.js';
|
|
51
51
|
let EdgelessShapeColorPicker = (() => {
|
|
52
52
|
let _classSuper = WithDisposable(SignalWatcher(LitElement));
|
|
@@ -59,6 +59,21 @@ let EdgelessShapeColorPicker = (() => {
|
|
|
59
59
|
let _palettes_decorators;
|
|
60
60
|
let _palettes_initializers = [];
|
|
61
61
|
let _palettes_extraInitializers = [];
|
|
62
|
+
let _paletteGroups_decorators;
|
|
63
|
+
let _paletteGroups_initializers = [];
|
|
64
|
+
let _paletteGroups_extraInitializers = [];
|
|
65
|
+
let _activeGroupKey_decorators;
|
|
66
|
+
let _activeGroupKey_initializers = [];
|
|
67
|
+
let _activeGroupKey_extraInitializers = [];
|
|
68
|
+
let _pickedGroupIndex_decorators;
|
|
69
|
+
let _pickedGroupIndex_initializers = [];
|
|
70
|
+
let _pickedGroupIndex_extraInitializers = [];
|
|
71
|
+
let _paletteListOpen_decorators;
|
|
72
|
+
let _paletteListOpen_initializers = [];
|
|
73
|
+
let _paletteListOpen_extraInitializers = [];
|
|
74
|
+
let _pageDirection_decorators;
|
|
75
|
+
let _pageDirection_initializers = [];
|
|
76
|
+
let _pageDirection_extraInitializers = [];
|
|
62
77
|
let _menuButton_decorators;
|
|
63
78
|
let _menuButton_initializers = [];
|
|
64
79
|
let _menuButton_extraInitializers = [];
|
|
@@ -68,10 +83,20 @@ let EdgelessShapeColorPicker = (() => {
|
|
|
68
83
|
_std_decorators = [consume({ context: stdContext })];
|
|
69
84
|
_payload_decorators = [property({ attribute: false })];
|
|
70
85
|
_palettes_decorators = [property({ attribute: false })];
|
|
86
|
+
_paletteGroups_decorators = [property({ attribute: false })];
|
|
87
|
+
_activeGroupKey_decorators = [property({ attribute: false })];
|
|
88
|
+
_pickedGroupIndex_decorators = [state()];
|
|
89
|
+
_paletteListOpen_decorators = [state()];
|
|
90
|
+
_pageDirection_decorators = [state()];
|
|
71
91
|
_menuButton_decorators = [query('editor-menu-button')];
|
|
72
92
|
__esDecorate(this, null, _std_decorators, { kind: "accessor", name: "std", static: false, private: false, access: { has: obj => "std" in obj, get: obj => obj.std, set: (obj, value) => { obj.std = value; } }, metadata: _metadata }, _std_initializers, _std_extraInitializers);
|
|
73
93
|
__esDecorate(this, null, _payload_decorators, { kind: "accessor", name: "payload", static: false, private: false, access: { has: obj => "payload" in obj, get: obj => obj.payload, set: (obj, value) => { obj.payload = value; } }, metadata: _metadata }, _payload_initializers, _payload_extraInitializers);
|
|
74
94
|
__esDecorate(this, null, _palettes_decorators, { kind: "accessor", name: "palettes", static: false, private: false, access: { has: obj => "palettes" in obj, get: obj => obj.palettes, set: (obj, value) => { obj.palettes = value; } }, metadata: _metadata }, _palettes_initializers, _palettes_extraInitializers);
|
|
95
|
+
__esDecorate(this, null, _paletteGroups_decorators, { kind: "accessor", name: "paletteGroups", static: false, private: false, access: { has: obj => "paletteGroups" in obj, get: obj => obj.paletteGroups, set: (obj, value) => { obj.paletteGroups = value; } }, metadata: _metadata }, _paletteGroups_initializers, _paletteGroups_extraInitializers);
|
|
96
|
+
__esDecorate(this, null, _activeGroupKey_decorators, { kind: "accessor", name: "activeGroupKey", static: false, private: false, access: { has: obj => "activeGroupKey" in obj, get: obj => obj.activeGroupKey, set: (obj, value) => { obj.activeGroupKey = value; } }, metadata: _metadata }, _activeGroupKey_initializers, _activeGroupKey_extraInitializers);
|
|
97
|
+
__esDecorate(this, null, _pickedGroupIndex_decorators, { kind: "accessor", name: "pickedGroupIndex", static: false, private: false, access: { has: obj => "pickedGroupIndex" in obj, get: obj => obj.pickedGroupIndex, set: (obj, value) => { obj.pickedGroupIndex = value; } }, metadata: _metadata }, _pickedGroupIndex_initializers, _pickedGroupIndex_extraInitializers);
|
|
98
|
+
__esDecorate(this, null, _paletteListOpen_decorators, { kind: "accessor", name: "paletteListOpen", static: false, private: false, access: { has: obj => "paletteListOpen" in obj, get: obj => obj.paletteListOpen, set: (obj, value) => { obj.paletteListOpen = value; } }, metadata: _metadata }, _paletteListOpen_initializers, _paletteListOpen_extraInitializers);
|
|
99
|
+
__esDecorate(this, null, _pageDirection_decorators, { kind: "accessor", name: "pageDirection", static: false, private: false, access: { has: obj => "pageDirection" in obj, get: obj => obj.pageDirection, set: (obj, value) => { obj.pageDirection = value; } }, metadata: _metadata }, _pageDirection_initializers, _pageDirection_extraInitializers);
|
|
75
100
|
__esDecorate(this, null, _menuButton_decorators, { kind: "accessor", name: "menuButton", static: false, private: false, access: { has: obj => "menuButton" in obj, get: obj => obj.menuButton, set: (obj, value) => { obj.menuButton = value; } }, metadata: _metadata }, _menuButton_initializers, _menuButton_extraInitializers);
|
|
76
101
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
77
102
|
}
|
|
@@ -95,6 +120,8 @@ let EdgelessShapeColorPicker = (() => {
|
|
|
95
120
|
color: ${unsafeCSSVarV2('text/secondary')};
|
|
96
121
|
font-weight: 400;
|
|
97
122
|
}
|
|
123
|
+
|
|
124
|
+
${paletteCarouselStyles}
|
|
98
125
|
`; }
|
|
99
126
|
#pickFillColor;
|
|
100
127
|
#pickStrokeColor;
|
|
@@ -103,8 +130,41 @@ let EdgelessShapeColorPicker = (() => {
|
|
|
103
130
|
#calcCustomButtonStyle(color, isCustomColor) {
|
|
104
131
|
return calcCustomButtonStyle(color, isCustomColor, this);
|
|
105
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* The page of {@link paletteGroups} on screen — see the twin getter on
|
|
135
|
+
* `edgeless-color-picker-button` for why a click wins over the prop.
|
|
136
|
+
*/
|
|
137
|
+
get groupIndex() {
|
|
138
|
+
if (this.pickedGroupIndex !== undefined)
|
|
139
|
+
return this.pickedGroupIndex;
|
|
140
|
+
const asked = this.paletteGroups.findIndex(group => group.key === this.activeGroupKey);
|
|
141
|
+
return asked < 0 ? 0 : asked;
|
|
142
|
+
}
|
|
143
|
+
/** The page on screen, or the caller's own list when there is no carousel. */
|
|
144
|
+
get activePalettes() {
|
|
145
|
+
if (this.paletteGroups.length < 2)
|
|
146
|
+
return this.palettes;
|
|
147
|
+
return this.paletteGroups[this.groupIndex]?.palettes ?? this.palettes;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* A new selection re-opens on ITS framework — see the twin on
|
|
151
|
+
* `edgeless-color-picker-button`.
|
|
152
|
+
*/
|
|
153
|
+
willUpdate(changed) {
|
|
154
|
+
if (changed.has('activeGroupKey')) {
|
|
155
|
+
this.pickedGroupIndex = undefined;
|
|
156
|
+
this.paletteListOpen = false;
|
|
157
|
+
this.pageDirection = 'settle';
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/** Page, and remember which way it went — see the twin. */
|
|
161
|
+
#page;
|
|
162
|
+
/** Measured against the UNION of the pages, for the reason the twin states. */
|
|
106
163
|
#calcCustomButtonState(color, theme) {
|
|
107
|
-
|
|
164
|
+
const offered = this.paletteGroups.length > 1
|
|
165
|
+
? this.paletteGroups.flatMap(group => group.palettes)
|
|
166
|
+
: this.palettes;
|
|
167
|
+
return !offered
|
|
108
168
|
.map(({ value }) => resolveColor(value, theme))
|
|
109
169
|
.includes(color);
|
|
110
170
|
}
|
|
@@ -126,13 +186,15 @@ let EdgelessShapeColorPicker = (() => {
|
|
|
126
186
|
firstUpdated() {
|
|
127
187
|
this.disposables.addFromEvent(this.menuButton, 'toggle', (e) => {
|
|
128
188
|
const opened = e.detail;
|
|
189
|
+
// A re-opened picker shows its swatches, never the list it was left on.
|
|
190
|
+
this.paletteListOpen = false;
|
|
129
191
|
if (!opened && this.tabType$.peek() === 'custom') {
|
|
130
192
|
this.tabType$.value = 'normal';
|
|
131
193
|
}
|
|
132
194
|
});
|
|
133
195
|
}
|
|
134
196
|
render() {
|
|
135
|
-
const { tabType$: { value: tabType }, colorType$: { value: colorType },
|
|
197
|
+
const { tabType$: { value: tabType }, colorType$: { value: colorType }, activePalettes, fillColorWithoutAlpha, payload: { fillColor, strokeColor, strokeWidth, strokeStyle, originalFillColor, originalStrokeColor, theme, enableCustomColor, }, } = this;
|
|
136
198
|
return html `
|
|
137
199
|
<editor-menu-button
|
|
138
200
|
.contentPadding="${tabType === 'normal' ? '8px' : '0px'}"
|
|
@@ -152,69 +214,96 @@ let EdgelessShapeColorPicker = (() => {
|
|
|
152
214
|
</editor-icon-button>
|
|
153
215
|
`}
|
|
154
216
|
>
|
|
155
|
-
<div
|
|
217
|
+
<div
|
|
218
|
+
class="pickers"
|
|
219
|
+
data-orientation="vertical"
|
|
220
|
+
@wheel=${paletteCarouselWheel({
|
|
221
|
+
groups: this.paletteGroups,
|
|
222
|
+
index: this.groupIndex,
|
|
223
|
+
onPage: this.#page,
|
|
224
|
+
open: this.paletteListOpen,
|
|
225
|
+
})}
|
|
226
|
+
>
|
|
156
227
|
${choose(tabType, [
|
|
157
228
|
[
|
|
158
229
|
'normal',
|
|
159
230
|
() => {
|
|
160
231
|
return html `
|
|
161
|
-
${
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
label: this.std
|
|
173
|
-
? translateKey(this.std, ...BORDER_COLOR_LABEL)
|
|
174
|
-
: BORDER_COLOR_LABEL[1],
|
|
175
|
-
type: 'strokeColor',
|
|
176
|
-
value: strokeColor,
|
|
177
|
-
hollowCircle: true,
|
|
178
|
-
onPick: this.#pickStrokeColor,
|
|
179
|
-
},
|
|
180
|
-
], item => item.type, ({ label, type, value, onPick, hollowCircle }) => html `
|
|
181
|
-
<div class="picker-label">${label}</div>
|
|
182
|
-
<edgeless-color-panel
|
|
183
|
-
aria-label="${label}"
|
|
184
|
-
role="listbox"
|
|
185
|
-
.hasTransparent=${false}
|
|
186
|
-
.hollowCircle=${hollowCircle}
|
|
187
|
-
.value=${value}
|
|
188
|
-
.theme=${theme}
|
|
189
|
-
.palettes=${palettes}
|
|
190
|
-
.std=${this.std}
|
|
191
|
-
@select=${onPick}
|
|
192
|
-
>
|
|
193
|
-
${when(enableCustomColor, () => {
|
|
194
|
-
const isCustomColor = this.#calcCustomButtonState(value, theme);
|
|
195
|
-
const styleInfo = this.#calcCustomButtonStyle(value, isCustomColor);
|
|
196
|
-
return html `
|
|
197
|
-
<edgeless-color-custom-button
|
|
198
|
-
slot="custom"
|
|
199
|
-
style=${styleMap(styleInfo)}
|
|
200
|
-
?active=${isCustomColor}
|
|
201
|
-
@click=${() => this.#switchToCustomWith(type)}
|
|
202
|
-
></edgeless-color-custom-button>
|
|
203
|
-
`;
|
|
232
|
+
${renderPaletteCarousel({
|
|
233
|
+
groups: this.paletteGroups,
|
|
234
|
+
index: this.groupIndex,
|
|
235
|
+
onPage: this.#page,
|
|
236
|
+
onToggle: open => (this.paletteListOpen = open),
|
|
237
|
+
open: this.paletteListOpen,
|
|
238
|
+
direction: this.pageDirection,
|
|
239
|
+
std: this.std,
|
|
240
|
+
theme,
|
|
204
241
|
})}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
242
|
+
${this.paletteListOpen
|
|
243
|
+
? nothing
|
|
244
|
+
: html `${repeat([
|
|
245
|
+
{
|
|
246
|
+
label: this.std
|
|
247
|
+
? translateKey(this.std, ...FILL_COLOR_LABEL)
|
|
248
|
+
: FILL_COLOR_LABEL[1],
|
|
249
|
+
type: 'fillColor',
|
|
250
|
+
value: fillColor,
|
|
251
|
+
hollowCircle: false,
|
|
252
|
+
onPick: this.#pickFillColor,
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
label: this.std
|
|
256
|
+
? translateKey(this.std, ...BORDER_COLOR_LABEL)
|
|
257
|
+
: BORDER_COLOR_LABEL[1],
|
|
258
|
+
type: 'strokeColor',
|
|
259
|
+
value: strokeColor,
|
|
260
|
+
hollowCircle: true,
|
|
261
|
+
onPick: this.#pickStrokeColor,
|
|
262
|
+
},
|
|
263
|
+
], item => item.type, ({ label, type, value, onPick, hollowCircle, }) => html `
|
|
264
|
+
<div class="picker-label">${label}</div>
|
|
265
|
+
${paletteCarouselPage({
|
|
266
|
+
groups: this.paletteGroups,
|
|
267
|
+
index: this.groupIndex,
|
|
268
|
+
direction: this.pageDirection,
|
|
269
|
+
}, html `
|
|
270
|
+
<edgeless-color-panel
|
|
271
|
+
aria-label="${label}"
|
|
272
|
+
role="listbox"
|
|
273
|
+
.hasTransparent=${false}
|
|
274
|
+
.hollowCircle=${hollowCircle}
|
|
275
|
+
.value=${value}
|
|
276
|
+
.theme=${theme}
|
|
277
|
+
.palettes=${activePalettes}
|
|
278
|
+
.std=${this.std}
|
|
279
|
+
@select=${onPick}
|
|
280
|
+
>
|
|
281
|
+
${when(enableCustomColor, () => {
|
|
282
|
+
const isCustomColor = this.#calcCustomButtonState(value, theme);
|
|
283
|
+
const styleInfo = this.#calcCustomButtonStyle(value, isCustomColor);
|
|
284
|
+
return html `
|
|
285
|
+
<edgeless-color-custom-button
|
|
286
|
+
slot="custom"
|
|
287
|
+
style=${styleMap(styleInfo)}
|
|
288
|
+
?active=${isCustomColor}
|
|
289
|
+
@click=${() => this.#switchToCustomWith(type)}
|
|
290
|
+
></edgeless-color-custom-button>
|
|
291
|
+
`;
|
|
292
|
+
})}
|
|
293
|
+
</edgeless-color-panel>
|
|
294
|
+
`)}
|
|
295
|
+
`)}
|
|
296
|
+
<div class="picker-label">
|
|
297
|
+
${this.std
|
|
298
|
+
? translateKey(this.std, ...BOARD_BORDER_STYLE_LABEL)
|
|
299
|
+
: BOARD_BORDER_STYLE_LABEL[1]}
|
|
300
|
+
</div>
|
|
301
|
+
<edgeless-line-styles-panel
|
|
302
|
+
class="picker"
|
|
303
|
+
.lineSize=${strokeWidth}
|
|
304
|
+
.lineStyle=${strokeStyle}
|
|
305
|
+
@select=${this.#pickStrokeStyle}
|
|
306
|
+
></edgeless-line-styles-panel>`}
|
|
218
307
|
`;
|
|
219
308
|
},
|
|
220
309
|
],
|
|
@@ -245,6 +334,33 @@ let EdgelessShapeColorPicker = (() => {
|
|
|
245
334
|
#palettes_accessor_storage;
|
|
246
335
|
get palettes() { return this.#palettes_accessor_storage; }
|
|
247
336
|
set palettes(value) { this.#palettes_accessor_storage = value; }
|
|
337
|
+
#paletteGroups_accessor_storage;
|
|
338
|
+
/**
|
|
339
|
+
* The carousel's pages, base palette first (`docs/adr/0027`). Empty falls
|
|
340
|
+
* back to {@link palettes} and draws no header — the panel as it was.
|
|
341
|
+
*/
|
|
342
|
+
get paletteGroups() { return this.#paletteGroups_accessor_storage; }
|
|
343
|
+
set paletteGroups(value) { this.#paletteGroups_accessor_storage = value; }
|
|
344
|
+
#activeGroupKey_accessor_storage;
|
|
345
|
+
/** The page to open on: the framework of the selected element, usually. */
|
|
346
|
+
get activeGroupKey() { return this.#activeGroupKey_accessor_storage; }
|
|
347
|
+
set activeGroupKey(value) { this.#activeGroupKey_accessor_storage = value; }
|
|
348
|
+
#pickedGroupIndex_accessor_storage;
|
|
349
|
+
/** Component state only, never persisted: which page the user paged TO. */
|
|
350
|
+
get pickedGroupIndex() { return this.#pickedGroupIndex_accessor_storage; }
|
|
351
|
+
set pickedGroupIndex(value) { this.#pickedGroupIndex_accessor_storage = value; }
|
|
352
|
+
#paletteListOpen_accessor_storage;
|
|
353
|
+
/**
|
|
354
|
+
* View state too: whether the header's list of pages is showing IN PLACE of
|
|
355
|
+
* the two grids and the line styles — see the twin on
|
|
356
|
+
* `edgeless-color-picker-button`.
|
|
357
|
+
*/
|
|
358
|
+
get paletteListOpen() { return this.#paletteListOpen_accessor_storage; }
|
|
359
|
+
set paletteListOpen(value) { this.#paletteListOpen_accessor_storage = value; }
|
|
360
|
+
#pageDirection_accessor_storage;
|
|
361
|
+
/** Which way the page arrived — see the twin. Both grids take it together. */
|
|
362
|
+
get pageDirection() { return this.#pageDirection_accessor_storage; }
|
|
363
|
+
set pageDirection(value) { this.#pageDirection_accessor_storage = value; }
|
|
248
364
|
#menuButton_accessor_storage;
|
|
249
365
|
get menuButton() { return this.#menuButton_accessor_storage; }
|
|
250
366
|
set menuButton(value) { this.#menuButton_accessor_storage = value; }
|
|
@@ -297,9 +413,19 @@ let EdgelessShapeColorPicker = (() => {
|
|
|
297
413
|
cancelable: true,
|
|
298
414
|
}));
|
|
299
415
|
};
|
|
416
|
+
/** Page, and remember which way it went — see the twin. */
|
|
417
|
+
this.#page = (index, direction) => {
|
|
418
|
+
this.pickedGroupIndex = index;
|
|
419
|
+
this.pageDirection = direction;
|
|
420
|
+
};
|
|
300
421
|
this.#payload_accessor_storage = __runInitializers(this, _payload_initializers, void 0);
|
|
301
422
|
this.#palettes_accessor_storage = (__runInitializers(this, _payload_extraInitializers), __runInitializers(this, _palettes_initializers, DefaultTheme.Palettes));
|
|
302
|
-
this.#
|
|
423
|
+
this.#paletteGroups_accessor_storage = (__runInitializers(this, _palettes_extraInitializers), __runInitializers(this, _paletteGroups_initializers, []));
|
|
424
|
+
this.#activeGroupKey_accessor_storage = (__runInitializers(this, _paletteGroups_extraInitializers), __runInitializers(this, _activeGroupKey_initializers, undefined));
|
|
425
|
+
this.#pickedGroupIndex_accessor_storage = (__runInitializers(this, _activeGroupKey_extraInitializers), __runInitializers(this, _pickedGroupIndex_initializers, undefined));
|
|
426
|
+
this.#paletteListOpen_accessor_storage = (__runInitializers(this, _pickedGroupIndex_extraInitializers), __runInitializers(this, _paletteListOpen_initializers, false));
|
|
427
|
+
this.#pageDirection_accessor_storage = (__runInitializers(this, _paletteListOpen_extraInitializers), __runInitializers(this, _pageDirection_initializers, 'settle'));
|
|
428
|
+
this.#menuButton_accessor_storage = (__runInitializers(this, _pageDirection_extraInitializers), __runInitializers(this, _menuButton_initializers, void 0));
|
|
303
429
|
__runInitializers(this, _menuButton_extraInitializers);
|
|
304
430
|
}
|
|
305
431
|
};
|
|
@@ -9,11 +9,11 @@ export const AIStarIcon = html `<svg
|
|
|
9
9
|
<g clip-path="url(#clip0_7444_26654)">
|
|
10
10
|
<path
|
|
11
11
|
d="M9.40033 4.57585C9.36627 4.27519 9.11207 4.04792 8.80948 4.04761C8.50689 4.0473 8.25223 4.27405 8.21756 4.57465C7.99211 6.52928 7.40771 7.90373 6.46492 8.84651C5.52213 9.7893 4.14769 10.3737 2.19305 10.5991C1.89246 10.6338 1.66571 10.8885 1.66602 11.1911C1.66633 11.4937 1.8936 11.7479 2.19426 11.7819C4.11659 11.9997 5.52025 12.5838 6.48542 13.5315C7.44696 14.4757 8.04356 15.8498 8.21597 17.7908C8.24327 18.0981 8.50096 18.3337 8.80954 18.3333C9.11813 18.333 9.37528 18.0969 9.40189 17.7894C9.56714 15.8804 10.1632 14.4774 11.1295 13.5111C12.0958 12.5448 13.4988 11.9487 15.4078 11.7835C15.7153 11.7569 15.9514 11.4997 15.9517 11.1911C15.9521 10.8825 15.7165 10.6249 15.4092 10.5976C13.4683 10.4252 12.0941 9.82855 11.15 8.86701C10.2022 7.90184 9.61807 6.49818 9.40033 4.57585Z"
|
|
12
|
-
fill="
|
|
12
|
+
fill="var(--affine-primary-color)"
|
|
13
13
|
/>
|
|
14
14
|
<path
|
|
15
15
|
d="M15.7849 1.87208C15.7717 1.75516 15.6728 1.66678 15.5551 1.66666C15.4375 1.66654 15.3384 1.75472 15.3249 1.87162C15.2373 2.63175 15.01 3.16626 14.6434 3.5329C14.2767 3.89954 13.7422 4.1268 12.9821 4.21448C12.8652 4.22796 12.777 4.327 12.7771 4.44467C12.7772 4.56234 12.8656 4.6612 12.9826 4.67445C13.7301 4.75912 14.276 4.9863 14.6513 5.35485C15.0253 5.72203 15.2573 6.25642 15.3243 7.01121C15.335 7.13075 15.4352 7.22235 15.5552 7.22221C15.6752 7.22208 15.7752 7.13025 15.7855 7.01069C15.8498 6.26831 16.0816 5.72268 16.4574 5.3469C16.8332 4.97111 17.3788 4.73932 18.1212 4.67505C18.2407 4.6647 18.3325 4.5647 18.3327 4.44469C18.3328 4.32469 18.2412 4.22448 18.1217 4.21386C17.3669 4.14681 16.8325 3.9148 16.4653 3.54087C16.0968 3.16552 15.8696 2.61966 15.7849 1.87208Z"
|
|
16
|
-
fill="
|
|
16
|
+
fill="var(--affine-primary-color)"
|
|
17
17
|
/>
|
|
18
18
|
</g>
|
|
19
19
|
<defs>
|
|
@@ -46,7 +46,7 @@ export const AIStopIcon = html `<svg
|
|
|
46
46
|
fill-rule="evenodd"
|
|
47
47
|
clip-rule="evenodd"
|
|
48
48
|
d="M17.0827 10C17.0827 13.912 13.9114 17.0834 9.99935 17.0834C6.08733 17.0834 2.91602 13.912 2.91602 10C2.91602 6.088 6.08733 2.91669 9.99935 2.91669C13.9114 2.91669 17.0827 6.088 17.0827 10ZM18.3327 10C18.3327 14.6024 14.6017 18.3334 9.99935 18.3334C5.39698 18.3334 1.66602 14.6024 1.66602 10C1.66602 5.39765 5.39698 1.66669 9.99935 1.66669C14.6017 1.66669 18.3327 5.39765 18.3327 10ZM8.33268 6.66669C7.41221 6.66669 6.66602 7.41288 6.66602 8.33335V11.6667C6.66602 12.5872 7.41221 13.3334 8.33268 13.3334H11.666C12.5865 13.3334 13.3327 12.5872 13.3327 11.6667V8.33335C13.3327 7.41288 12.5865 6.66669 11.666 6.66669H8.33268Z"
|
|
49
|
-
fill="
|
|
49
|
+
fill="var(--affine-primary-color)"
|
|
50
50
|
/>
|
|
51
51
|
</g>
|
|
52
52
|
<defs>
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chrome accent, reached through its token rather than written as a hex:
|
|
3
|
+
* the six-dot burst is chrome, so it has to follow the host's theme (DESIGN.md,
|
|
4
|
+
* The Borrowed Blue Rule).
|
|
5
|
+
*/
|
|
6
|
+
const ACCENT = 'var(--affine-primary-color)';
|
|
1
7
|
export const playCheckAnimation = async (refElement, { left = 0, size = 20 } = {}) => {
|
|
2
8
|
const sparkingEl = document.createElement('div');
|
|
3
9
|
sparkingEl.classList.add('affine-check-animation');
|
|
@@ -14,7 +20,7 @@ export const playCheckAnimation = async (refElement, { left = 0, size = 20 } = {
|
|
|
14
20
|
refElement.append(sparkingEl);
|
|
15
21
|
await sparkingEl.animate([
|
|
16
22
|
{
|
|
17
|
-
boxShadow:
|
|
23
|
+
boxShadow: `0 -18px 0 -8px ${ACCENT}, 16px -8px 0 -8px ${ACCENT}, 16px 8px 0 -8px ${ACCENT}, 0 18px 0 -8px ${ACCENT}, -16px 8px 0 -8px ${ACCENT}, -16px -8px 0 -8px ${ACCENT}`,
|
|
18
24
|
},
|
|
19
25
|
], { duration: 240, easing: 'ease', fill: 'forwards' }).finished;
|
|
20
26
|
await sparkingEl.animate([
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { translateKey } from '../../affine-shared/services/index.js';
|
|
2
|
-
import { computed, effect, signal, } from '@preact/signals-core';
|
|
2
|
+
import { computed, effect, signal, untracked, } from '@preact/signals-core';
|
|
3
3
|
import { RESOURCE_NOT_FOUND_WORDINGS, RESOURCE_RETRIEVE_FAILED_WORDINGS, } from '../translations.js';
|
|
4
4
|
export class ResourceController {
|
|
5
5
|
constructor(blobId$, kind = 'File',
|
|
@@ -71,30 +71,43 @@ export class ResourceController {
|
|
|
71
71
|
return result;
|
|
72
72
|
}
|
|
73
73
|
updateState(state) {
|
|
74
|
-
|
|
74
|
+
// `peek()`, never `.value`: merging must not subscribe whatever effect
|
|
75
|
+
// happens to be running to `state$`, otherwise the write below re-runs
|
|
76
|
+
// that effect, which writes again — see `subscribe()` and issue #319.
|
|
77
|
+
this.state$.value = { ...this.state$.peek(), ...state };
|
|
75
78
|
}
|
|
76
79
|
// The explicit return type keeps declaration emit off signals-core's
|
|
77
80
|
// `DisposeFn`, whose `[Symbol.dispose]` member tsc cannot serialize.
|
|
78
81
|
subscribe() {
|
|
79
82
|
return effect(() => {
|
|
83
|
+
// Only the blob id is tracked: a new id re-runs the effect, nothing else
|
|
84
|
+
// does. The subscription body stays `untracked` because a host whose
|
|
85
|
+
// `blobState$` replays on subscribe (a `BehaviorSubject`) writes `state$`
|
|
86
|
+
// synchronously from inside this very effect; tracked, that write would
|
|
87
|
+
// re-run the effect, re-subscribe, replay, write again — until
|
|
88
|
+
// signals-core gives up with `Cycle detected` (issue #319).
|
|
80
89
|
const blobId = this.blobId$.value;
|
|
81
90
|
if (!blobId)
|
|
82
91
|
return;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
errorMessage
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
return untracked(() => {
|
|
93
|
+
const blobState$ = this.engine?.blobState$(blobId);
|
|
94
|
+
if (!blobState$)
|
|
95
|
+
return;
|
|
96
|
+
const subscription = blobState$.subscribe(state => {
|
|
97
|
+
let { uploading, downloading, errorMessage } = state;
|
|
98
|
+
if (state.overSize) {
|
|
99
|
+
uploading = false;
|
|
100
|
+
downloading = false;
|
|
101
|
+
}
|
|
102
|
+
else if ((uploading || downloading) && errorMessage) {
|
|
103
|
+
errorMessage = null;
|
|
104
|
+
}
|
|
105
|
+
// A later emission can land while some unrelated effect is being
|
|
106
|
+
// evaluated; it must not become a dependency of that effect either.
|
|
107
|
+
untracked(() => this.updateState({ ...state, uploading, downloading, errorMessage }));
|
|
108
|
+
});
|
|
109
|
+
return () => subscription.unsubscribe();
|
|
96
110
|
});
|
|
97
|
-
return () => subscription.unsubscribe();
|
|
98
111
|
});
|
|
99
112
|
}
|
|
100
113
|
async blob() {
|
|
@@ -218,9 +218,14 @@ let SizeDropdownMenu = (() => {
|
|
|
218
218
|
const { sizes, format, type, icon, resolvedLabel: label, size$: { value: size }, } = this;
|
|
219
219
|
const isCheckType = type === 'check';
|
|
220
220
|
const placeholder = format?.(Math.trunc(size)) ?? Math.trunc(size);
|
|
221
|
+
// `class` is STATIC. It used to be `${label.toLowerCase()}-menu`, which
|
|
222
|
+
// made a CSS class depend on the host's language the day `label` joined
|
|
223
|
+
// the translation seam (#390) — `échelle-menu` in French. Nothing in the
|
|
224
|
+
// repo selects it (checked across the styles and both test suites): it is
|
|
225
|
+
// the stable identifier it was always meant to be.
|
|
221
226
|
return html `
|
|
222
227
|
<editor-menu-button
|
|
223
|
-
class="
|
|
228
|
+
class="size-menu"
|
|
224
229
|
.contentPadding="${'8px'}"
|
|
225
230
|
.button=${html `
|
|
226
231
|
<editor-icon-button
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { EditorChevronDown } from './chevron-down.js';
|
|
2
2
|
export { ToolbarMoreMenuConfigExtension } from './config.js';
|
|
3
3
|
export { EditorIconButton } from './icon-button.js';
|
|
4
|
-
export { EditorMenuAction, EditorMenuButton, EditorMenuContent, } from './menu-button.js';
|
|
4
|
+
export { EDITOR_MENU_TOGGLE, EditorMenuAction, EditorMenuButton, EditorMenuContent, } from './menu-button.js';
|
|
5
5
|
export { MenuContext } from './menu-context.js';
|
|
6
6
|
export { type PickerMenu, type PickerMenuItem, renderCurrentPickerItemWith, renderPickerMenu, renderPickerMenuItems, } from './picker-menu.js';
|
|
7
7
|
export { EditorToolbarSeparator } from './separator.js';
|
|
@@ -6,7 +6,7 @@ import { Tooltip } from './tooltip.js';
|
|
|
6
6
|
export { EditorChevronDown } from './chevron-down.js';
|
|
7
7
|
export { ToolbarMoreMenuConfigExtension } from './config.js';
|
|
8
8
|
export { EditorIconButton } from './icon-button.js';
|
|
9
|
-
export { EditorMenuAction, EditorMenuButton, EditorMenuContent, } from './menu-button.js';
|
|
9
|
+
export { EDITOR_MENU_TOGGLE, EditorMenuAction, EditorMenuButton, EditorMenuContent, } from './menu-button.js';
|
|
10
10
|
export { MenuContext } from './menu-context.js';
|
|
11
11
|
export { renderCurrentPickerItemWith, renderPickerMenu, renderPickerMenuItems, } from './picker-menu.js';
|
|
12
12
|
export { EditorToolbarSeparator } from './separator.js';
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { type ButtonPopperOptions } from '../../affine-shared/utils/index.js';
|
|
2
2
|
import { LitElement, type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
/**
|
|
4
|
+
* A panel in a toolbar opened or closed, announced across shadow boundaries.
|
|
5
|
+
*
|
|
6
|
+
* `detail` is whether it is now open, and the deepest element of
|
|
7
|
+
* `composedPath()` is the button it belongs to.
|
|
8
|
+
*/
|
|
9
|
+
export declare const EDITOR_MENU_TOGGLE = "editor-menu-toggle";
|
|
3
10
|
declare const EditorMenuButton_base: typeof LitElement & import("../../global/utils/types.js").Constructor<import("../../global/lit/with-disposable.js").DisposableClass>;
|
|
4
11
|
export declare class EditorMenuButton extends EditorMenuButton_base {
|
|
5
12
|
static styles: import("lit").CSSResult;
|
|
@@ -37,6 +37,13 @@ import { createButtonPopper, } from '../../affine-shared/utils/index.js';
|
|
|
37
37
|
import { WithDisposable } from '../../global/lit/index.js';
|
|
38
38
|
import { css, html, LitElement, } from 'lit';
|
|
39
39
|
import { property, query } from 'lit/decorators.js';
|
|
40
|
+
/**
|
|
41
|
+
* A panel in a toolbar opened or closed, announced across shadow boundaries.
|
|
42
|
+
*
|
|
43
|
+
* `detail` is whether it is now open, and the deepest element of
|
|
44
|
+
* `composedPath()` is the button it belongs to.
|
|
45
|
+
*/
|
|
46
|
+
export const EDITOR_MENU_TOGGLE = 'editor-menu-toggle';
|
|
40
47
|
let EditorMenuButton = (() => {
|
|
41
48
|
let _classSuper = WithDisposable(LitElement);
|
|
42
49
|
let __content_decorators;
|
|
@@ -97,6 +104,20 @@ let EditorMenuButton = (() => {
|
|
|
97
104
|
else {
|
|
98
105
|
delete this.dataset.open;
|
|
99
106
|
}
|
|
107
|
+
// Said again, out loud, for whoever is holding this button — the row
|
|
108
|
+
// it sits on has to know, and `data-open` alone cannot tell it: a
|
|
109
|
+
// picker keeps its menu button inside its OWN shadow root, where no
|
|
110
|
+
// `querySelector` and no `MutationObserver` of the row's reaches. This
|
|
111
|
+
// one bubbles AND is composed, so it crosses every boundary between
|
|
112
|
+
// here and the row. See `EditorToolbar`, which stops clipping while a
|
|
113
|
+
// panel is open. The `toggle` event above is deliberately left as it
|
|
114
|
+
// is: it does not bubble, and things listen for it by that name.
|
|
115
|
+
this.dispatchEvent(new CustomEvent(EDITOR_MENU_TOGGLE, {
|
|
116
|
+
detail: opened,
|
|
117
|
+
bubbles: true,
|
|
118
|
+
cancelable: false,
|
|
119
|
+
composed: true,
|
|
120
|
+
}));
|
|
100
121
|
},
|
|
101
122
|
mainAxis: 0,
|
|
102
123
|
offsetHeight: 6 * 4,
|
|
@@ -184,6 +205,15 @@ export class EditorMenuContent extends LitElement {
|
|
|
184
205
|
.content-wrapper {
|
|
185
206
|
overscroll-behavior: contain;
|
|
186
207
|
overflow-y: auto;
|
|
208
|
+
/* Spelled out because CSS Overflow computes a visible axis to auto as
|
|
209
|
+
* soon as the other one is not visible: the overflow-y above would
|
|
210
|
+
* silently make this popup scrollable SIDEWAYS too. Anything animated by
|
|
211
|
+
* a positive translateX inside it — the palette carousel's incoming page,
|
|
212
|
+
* see color-picker/palette-carousel.ts — then grows the scrollable
|
|
213
|
+
* region for the length of the animation and flashes a horizontal
|
|
214
|
+
* scrollbar (issue #392). Not clip: combined with overflow-y: auto the
|
|
215
|
+
* spec falls it back to hidden anyway. */
|
|
216
|
+
overflow-x: hidden;
|
|
187
217
|
padding: var(--content-padding, 0 6px);
|
|
188
218
|
}
|
|
189
219
|
|
|
@@ -38,6 +38,21 @@ export type PickerMenu<T> = {
|
|
|
38
38
|
label: string;
|
|
39
39
|
icon?: TemplateResult;
|
|
40
40
|
tooltip?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The accessible name of the MENU shell (`aria-label` on
|
|
43
|
+
* `editor-menu-button`), which the caller supplies whole (#390).
|
|
44
|
+
*
|
|
45
|
+
* It used to be sewn together here as `` `${label.toLowerCase()}-menu` ``.
|
|
46
|
+
* That was a stable identifier while {@link label} was an English literal;
|
|
47
|
+
* once the caller started handing over a TRANSLATED label it became half a
|
|
48
|
+
* sentence in each language ("changer le type de forme-menu"). A menu's
|
|
49
|
+
* accessible name is its own wording, never a composition — the precedent
|
|
50
|
+
* is `ROOT_ALIGNMENT_MENU_ARIA` in `blocks/root`.
|
|
51
|
+
*
|
|
52
|
+
* Left out, the name is composed from {@link label} as before, so a caller
|
|
53
|
+
* that still passes an English literal is unaffected.
|
|
54
|
+
*/
|
|
55
|
+
menuAria?: string;
|
|
41
56
|
items: PickerMenuItem<T>[];
|
|
42
57
|
currentValue: T;
|
|
43
58
|
onPick: (value: T) => void;
|
|
@@ -51,5 +66,5 @@ export type PickerMenu<T> = {
|
|
|
51
66
|
};
|
|
52
67
|
/** The field of the item that currently matches — its icon, usually. */
|
|
53
68
|
export declare function renderCurrentPickerItemWith<T, F extends keyof PickerMenuItem<T>>(items: PickerMenuItem<T>[], currentValue: T, field: F): PickerMenuItem<T>[F] | undefined;
|
|
54
|
-
export declare function renderPickerMenu<T>({ label, tooltip, icon, items, currentValue, onPick, testId, }: PickerMenu<T>): TemplateResult<1>;
|
|
69
|
+
export declare function renderPickerMenu<T>({ label, tooltip, menuAria, icon, items, currentValue, onPick, testId, }: PickerMenu<T>): TemplateResult<1>;
|
|
55
70
|
export declare function renderPickerMenuItems<T>(items: PickerMenuItem<T>[], currentValue: T, onPick: (value: T) => void, testId?: string): unknown;
|
|
@@ -6,11 +6,11 @@ import { EditorChevronDown } from './chevron-down.js';
|
|
|
6
6
|
export function renderCurrentPickerItemWith(items, currentValue, field) {
|
|
7
7
|
return items.find(({ value }) => value === currentValue)?.[field];
|
|
8
8
|
}
|
|
9
|
-
export function renderPickerMenu({ label, tooltip, icon, items, currentValue, onPick, testId, }) {
|
|
9
|
+
export function renderPickerMenu({ label, tooltip, menuAria, icon, items, currentValue, onPick, testId, }) {
|
|
10
10
|
return html `
|
|
11
11
|
<editor-menu-button
|
|
12
12
|
data-testid=${ifDefined(testId)}
|
|
13
|
-
aria-label="${`${label.toLowerCase()}-menu`}"
|
|
13
|
+
aria-label="${menuAria ?? `${label.toLowerCase()}-menu`}"
|
|
14
14
|
.button=${html `
|
|
15
15
|
<editor-icon-button
|
|
16
16
|
data-testid=${ifDefined(testId ? `${testId}-button` : undefined)}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
declare const EditorToolbar_base: typeof LitElement & import("../../global/utils/types.js").Constructor<import("../../global/lit/with-disposable.js").DisposableClass>;
|
|
3
3
|
export declare class EditorToolbar extends EditorToolbar_base {
|
|
4
|
+
#private;
|
|
4
5
|
static styles: import("lit").CSSResult;
|
|
5
6
|
connectedCallback(): void;
|
|
6
7
|
render(): import("lit-html").TemplateResult<1>;
|