@formicoidea/labre-core 0.41.0 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +384 -0
- package/dist/_pkgs/affine-block-bookmark/bookmark-block.js +2 -2
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.js +7 -1
- package/dist/_pkgs/affine-block-embed/embed-figma-block/embed-figma-block.js +2 -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/consts.d.ts +2 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.js +5 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.d.ts +1 -0
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +30 -8
- 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 +2 -1
- package/dist/_pkgs/affine-block-embed/embed-youtube-block/embed-youtube-block.js +2 -1
- package/dist/_pkgs/affine-block-frame/frame-manager.js +1 -1
- 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-note/note-keymap.js +7 -1
- package/dist/_pkgs/affine-block-paragraph/paragraph-keymap.js +7 -1
- 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/keyboard/keymap.js +1 -16
- 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 +241 -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 +136 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend.js +439 -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/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/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/framework-background/index.js +1 -0
- package/dist/_pkgs/affine-block-surface/framework-background/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/view.js +8 -1
- package/dist/_pkgs/affine-block-surface-ref/configs/slash-menu.js +1 -1
- 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 +440 -0
- 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/resource/resource.js +29 -16
- 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-gfx-brush/element-renderer.js +2 -2
- 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/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 +216 -54
- 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 +72 -4
- 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/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/templates/index.js +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/basket-elements.js +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/utils/import-mindmap.js +2 -2
- package/dist/_pkgs/affine-gfx-mindmap/translations.d.ts +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/translations.js +1 -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 +6 -1
- package/dist/_pkgs/affine-gfx-shape/toolbar/palette-color-action.js +11 -1
- package/dist/_pkgs/affine-gfx-template/builtin/other.js +1 -1
- package/dist/_pkgs/affine-gfx-template/snapshot-from-action.js +32 -119
- package/dist/_pkgs/affine-gfx-template/toolbar/template-type.d.ts +1 -1
- 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 +57 -2
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.d.ts +8 -1
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +12 -2
- package/dist/_pkgs/affine-gfx-text/translations.d.ts +1 -0
- package/dist/_pkgs/affine-gfx-text/translations.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/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 +7 -0
- package/dist/_pkgs/affine-shared/services/font-loader/config.js +43 -0
- 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/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 +77 -7
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +97 -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-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/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-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/view.js +5 -0
- 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/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 +8 -1
- package/dist/frameworks.d.ts +9 -0
- package/dist/frameworks.js +19 -0
- package/dist/translations.js +16 -0
- package/package.json +9 -4
- package/dist/_pkgs/affine-gfx-group/group-watcher.d.ts +0 -1
- package/dist/_pkgs/affine-gfx-group/group-watcher.js +0 -20
|
@@ -2,12 +2,12 @@ import type { ExtensionType } from '../../../store/index.js';
|
|
|
2
2
|
import type { CitationEvents } from './citation.js';
|
|
3
3
|
import type { CodeBlockEvents } from './code-block.js';
|
|
4
4
|
import type { OutDatabaseAllEvents } from './database.js';
|
|
5
|
-
import type { AuditEvents, BlockLifecycleEvents, FrameworkDiagramEvents, ValidationEvents } from './lifecycle.js';
|
|
5
|
+
import type { AuditEvents, BlockLifecycleEvents, DocumentHealthEvents, FrameworkDiagramEvents, ValidationEvents } from './lifecycle.js';
|
|
6
6
|
import type { LinkToolbarEvents } from './link.js';
|
|
7
7
|
import type { NoteEvents } from './note.js';
|
|
8
8
|
import type { SlashMenuEvents } from './slash-menu.js';
|
|
9
9
|
import type { AttachmentReloadedEvent, AttachmentReloadedEventInToolbar, AttachmentUpgradedEvent, AttachmentUploadedEvent, BlockCreationEvent, DocCreatedEvent, EdgelessToolPickedEvent, ElementCreationEvent, ElementLockEvent, ElementUpdatedEvent, LatexEvent, LinkedDocCreatedEvent, LinkEvent, MindMapCollapseEvent, TelemetryEvent } from './types.js';
|
|
10
|
-
export type TelemetryEventMap = OutDatabaseAllEvents & LinkToolbarEvents & SlashMenuEvents & CodeBlockEvents & NoteEvents & CitationEvents & BlockLifecycleEvents & FrameworkDiagramEvents & ValidationEvents & AuditEvents & {
|
|
10
|
+
export type TelemetryEventMap = OutDatabaseAllEvents & LinkToolbarEvents & SlashMenuEvents & CodeBlockEvents & NoteEvents & CitationEvents & BlockLifecycleEvents & FrameworkDiagramEvents & ValidationEvents & AuditEvents & DocumentHealthEvents & {
|
|
11
11
|
DocCreated: DocCreatedEvent;
|
|
12
12
|
Link: TelemetryEvent;
|
|
13
13
|
LinkedDocCreated: LinkedDocCreatedEvent;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { TemplateResult } from 'lit';
|
|
2
|
+
import { type ToolbarActionGenerator } from './action.js';
|
|
3
|
+
/**
|
|
4
|
+
* A "⋮" entry that INVOKES a registered command instead of restating what it
|
|
5
|
+
* does — the shape `docs/adr/0010` M3 introduced, and the reason an export has
|
|
6
|
+
* one behaviour, one availability rule and one telemetry emission whether it is
|
|
7
|
+
* reached from here, from the catalogue, from the palette, from
|
|
8
|
+
* Settings › Shortcuts or from the agent.
|
|
9
|
+
*
|
|
10
|
+
* Two things the widget imposes: a menu line is drawn from `label` (a tooltip
|
|
11
|
+
* on a line that is already words would be a second copy of them), and
|
|
12
|
+
* `placement: ActionPlacement.More` is what partitions it out of the row in the
|
|
13
|
+
* first place — `renderToolbar` splits on exactly that flag, and the entries it
|
|
14
|
+
* collects come from every module contributing to the element, so a framework
|
|
15
|
+
* can add to the "⋮" without owning it.
|
|
16
|
+
*
|
|
17
|
+
* `generate` rather than a static entry because the i18n seam needs `std`:
|
|
18
|
+
* `translateKey` is what reaches the host's catalogue, and a hard-coded English
|
|
19
|
+
* label would be the one wording a host could not override.
|
|
20
|
+
*
|
|
21
|
+
* ## Why it lives here
|
|
22
|
+
*
|
|
23
|
+
* It was written three times — BPMN's pool row, C4's board row and Wardley's
|
|
24
|
+
* map row — each copy a few words of comment apart from the others, because a
|
|
25
|
+
* framework's toolbar has no layer below it to share with. The generic SVG
|
|
26
|
+
* export (`export.svg`, ADR 0025) is the fourth caller and the first that is
|
|
27
|
+
* not a framework at all, which is what settles the question: the shape belongs
|
|
28
|
+
* to the toolbar service, beside the module registry it plugs into, not to
|
|
29
|
+
* whichever framework happened to need it first.
|
|
30
|
+
*
|
|
31
|
+
* `translateKey` lives in this same package, and `@labre/std` is already a
|
|
32
|
+
* dependency of it, so nothing here closes an import cycle.
|
|
33
|
+
*/
|
|
34
|
+
export declare function commandMoreAction(id: string, commandId: string, labelKey: string, labelFallback: string, icon: TemplateResult): ToolbarActionGenerator;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { getRegisteredCommands, runCommand } from '../../../std/index.js';
|
|
2
|
+
import { translateKey } from '../translation-service/index.js';
|
|
3
|
+
import { ActionPlacement } from './action.js';
|
|
4
|
+
/** The registered command an entry drives, or `undefined` when it is not. */
|
|
5
|
+
const findCommand = (ctx, id) => getRegisteredCommands(ctx.std).find(candidate => candidate.id === id);
|
|
6
|
+
/**
|
|
7
|
+
* A "⋮" entry that INVOKES a registered command instead of restating what it
|
|
8
|
+
* does — the shape `docs/adr/0010` M3 introduced, and the reason an export has
|
|
9
|
+
* one behaviour, one availability rule and one telemetry emission whether it is
|
|
10
|
+
* reached from here, from the catalogue, from the palette, from
|
|
11
|
+
* Settings › Shortcuts or from the agent.
|
|
12
|
+
*
|
|
13
|
+
* Two things the widget imposes: a menu line is drawn from `label` (a tooltip
|
|
14
|
+
* on a line that is already words would be a second copy of them), and
|
|
15
|
+
* `placement: ActionPlacement.More` is what partitions it out of the row in the
|
|
16
|
+
* first place — `renderToolbar` splits on exactly that flag, and the entries it
|
|
17
|
+
* collects come from every module contributing to the element, so a framework
|
|
18
|
+
* can add to the "⋮" without owning it.
|
|
19
|
+
*
|
|
20
|
+
* `generate` rather than a static entry because the i18n seam needs `std`:
|
|
21
|
+
* `translateKey` is what reaches the host's catalogue, and a hard-coded English
|
|
22
|
+
* label would be the one wording a host could not override.
|
|
23
|
+
*
|
|
24
|
+
* ## Why it lives here
|
|
25
|
+
*
|
|
26
|
+
* It was written three times — BPMN's pool row, C4's board row and Wardley's
|
|
27
|
+
* map row — each copy a few words of comment apart from the others, because a
|
|
28
|
+
* framework's toolbar has no layer below it to share with. The generic SVG
|
|
29
|
+
* export (`export.svg`, ADR 0025) is the fourth caller and the first that is
|
|
30
|
+
* not a framework at all, which is what settles the question: the shape belongs
|
|
31
|
+
* to the toolbar service, beside the module registry it plugs into, not to
|
|
32
|
+
* whichever framework happened to need it first.
|
|
33
|
+
*
|
|
34
|
+
* `translateKey` lives in this same package, and `@labre/std` is already a
|
|
35
|
+
* dependency of it, so nothing here closes an import cycle.
|
|
36
|
+
*/
|
|
37
|
+
export function commandMoreAction(id, commandId, labelKey, labelFallback, icon) {
|
|
38
|
+
return {
|
|
39
|
+
id,
|
|
40
|
+
placement: ActionPlacement.More,
|
|
41
|
+
when: (ctx) => {
|
|
42
|
+
const command = findCommand(ctx, commandId);
|
|
43
|
+
return command !== undefined && (command.when?.(ctx.std) ?? true);
|
|
44
|
+
},
|
|
45
|
+
generate: (ctx) => ({
|
|
46
|
+
icon,
|
|
47
|
+
label: translateKey(ctx.std, labelKey, labelFallback),
|
|
48
|
+
run: (runCtx) => {
|
|
49
|
+
const command = findCommand(runCtx, commandId);
|
|
50
|
+
if (!command)
|
|
51
|
+
return;
|
|
52
|
+
// The same `source` the row's own entries report: the "⋮" is a
|
|
53
|
+
// degradation of the row, not a surface of its own, and the
|
|
54
|
+
// `ElementCreationSource` union deliberately names places rather than
|
|
55
|
+
// widths (`docs/adr/0008`).
|
|
56
|
+
runCommand(runCtx.std, command, {
|
|
57
|
+
surface: 'contextual-toolbar',
|
|
58
|
+
source: 'toolbar:general',
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
@@ -93,6 +93,35 @@ export declare const SYNCED_DOC_EMPTY_PREVIEW: ChromeWording;
|
|
|
93
93
|
* copies of it in eight manifests would be eight keys for one tooltip.
|
|
94
94
|
*/
|
|
95
95
|
export declare const BOARD_RESIZE_TOGGLE: ChromeWording;
|
|
96
|
+
/**
|
|
97
|
+
* The orientation toggle a BANDED background carries: the one gesture that
|
|
98
|
+
* turns a frame drawn in columns into the same frame drawn in rows.
|
|
99
|
+
*
|
|
100
|
+
* Declared beside the resize toggle for the same reason and with the same
|
|
101
|
+
* scope: it names a behaviour of the frame primitive — where the name band
|
|
102
|
+
* sits and which way the bands run — rather than anything a notation calls its
|
|
103
|
+
* own. A UML activity partition is the first frame to use it (§15.6.4 draws
|
|
104
|
+
* swimlanes either way and says the choice means nothing); a BPMN pool is the
|
|
105
|
+
* obvious second, and a second key for it would be a second tooltip for one
|
|
106
|
+
* word.
|
|
107
|
+
*/
|
|
108
|
+
export declare const BOARD_ORIENTATION_TOGGLE: ChromeWording;
|
|
109
|
+
/**
|
|
110
|
+
* The gesture that divides a banded background one band further — the button a
|
|
111
|
+
* frame carrying zones offers next to the two above.
|
|
112
|
+
*
|
|
113
|
+
* Declared here with them, and for the third time for the same reason: it names
|
|
114
|
+
* a behaviour of the generic frame primitive (a background whose `instanceZones`
|
|
115
|
+
* are a list the author grows) rather than anything a notation calls its own. A
|
|
116
|
+
* UML combined fragment is the first frame to use it — §17.6.4's second operand
|
|
117
|
+
* is a band added to a box that has one — and a BPMN pool's lane is the obvious
|
|
118
|
+
* second the day it stops reaching this through a command of its own.
|
|
119
|
+
*
|
|
120
|
+
* "Band" and not "operand" or "lane": the word has to be true of every frame
|
|
121
|
+
* that offers the button, and each notation's own noun is already written on
|
|
122
|
+
* the element the button is attached to.
|
|
123
|
+
*/
|
|
124
|
+
export declare const BOARD_ADD_BAND: ChromeWording;
|
|
96
125
|
/**
|
|
97
126
|
* The legend button, in the two wordings the boards actually use: the notation
|
|
98
127
|
* boards say "notation", Wardley says "components".
|
|
@@ -103,6 +132,19 @@ export declare const BOARD_RESIZE_TOGGLE: ChromeWording;
|
|
|
103
132
|
*/
|
|
104
133
|
export declare const BOARD_LEGEND_NOTATION: ChromeWording;
|
|
105
134
|
export declare const BOARD_LEGEND_COMPONENTS: ChromeWording;
|
|
135
|
+
/**
|
|
136
|
+
* The two END labels a connector can carry beside its caption — where UML
|
|
137
|
+
* writes a multiplicity and a role name (`docs/adr/0018` phase 2).
|
|
138
|
+
*
|
|
139
|
+
* Declared here and not in the UML pack for the same reason the resize toggle
|
|
140
|
+
* is: they name a part of the generic CONNECTOR, which every framework draws,
|
|
141
|
+
* and a stored connector keeps its end labels with the UML tooling switched off
|
|
142
|
+
* (`docs/adr/0009`). "Source" and "target" are the connector's own words for
|
|
143
|
+
* its two ends, already the vocabulary of `frontEndpointStyle` /
|
|
144
|
+
* `rearEndpointStyle` and of the direction commands.
|
|
145
|
+
*/
|
|
146
|
+
export declare const CONNECTOR_SOURCE_LABEL: ChromeWording;
|
|
147
|
+
export declare const CONNECTOR_TARGET_LABEL: ChromeWording;
|
|
106
148
|
export declare const NOTE_SHADOW_NONE: ChromeWording;
|
|
107
149
|
export declare const NOTE_SHADOW_BOX: ChromeWording;
|
|
108
150
|
export declare const NOTE_SHADOW_STICKER: ChromeWording;
|
|
@@ -136,14 +178,19 @@ export declare const TEXT_FORMAT_ITALIC: ChromeWording;
|
|
|
136
178
|
export declare const TEXT_FORMAT_UNDERLINE: ChromeWording;
|
|
137
179
|
export declare const TEXT_FORMAT_STRIKETHROUGH: ChromeWording;
|
|
138
180
|
/**
|
|
139
|
-
* The
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* (`widgets/edgeless-toolbar`).
|
|
181
|
+
* The font weights and the one non-default font style a text toolbar offers —
|
|
182
|
+
* said identically by the toolbar's own "current selection" label (`gfx/text`)
|
|
183
|
+
* and by the popup menu that picks them (`widgets/edgeless-toolbar`).
|
|
143
184
|
*/
|
|
144
185
|
export declare const FONT_WEIGHT_LIGHT: ChromeWording;
|
|
145
186
|
export declare const FONT_WEIGHT_REGULAR: ChromeWording;
|
|
146
187
|
export declare const FONT_WEIGHT_SEMIBOLD: ChromeWording;
|
|
188
|
+
/**
|
|
189
|
+
* An alias (L7 dedupe): the heaviest canvas weight is said with the same word
|
|
190
|
+
* as the prose toolbar's {@link TEXT_FORMAT_BOLD}, so it shares its one key —
|
|
191
|
+
* exactly as {@link FONT_STYLE_ITALIC} does below.
|
|
192
|
+
*/
|
|
193
|
+
export declare const FONT_WEIGHT_BOLD: ChromeWording;
|
|
147
194
|
/**
|
|
148
195
|
* An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_ITALIC}, one key.
|
|
149
196
|
*/
|
|
@@ -236,13 +283,36 @@ export declare const BLOCK_TYPE_QUOTE_DESCRIPTION: ChromeWording;
|
|
|
236
283
|
export declare const BLOCK_TYPE_DIVIDER: ChromeWording;
|
|
237
284
|
export declare const BLOCK_TYPE_DIVIDER_DESCRIPTION: ChromeWording;
|
|
238
285
|
/**
|
|
239
|
-
* The
|
|
240
|
-
* (`
|
|
286
|
+
* The automatic legend BOX title the shared engine draws
|
|
287
|
+
* (`createBoardLegend`, `@labre/affine-block-surface`) — "Legend" itself,
|
|
241
288
|
* distinct from the {@link BOARD_LEGEND_NOTATION} / {@link BOARD_LEGEND_COMPONENTS}
|
|
242
289
|
* toolbar BUTTONS that create it. Declared here because it is the same word on
|
|
243
|
-
* every board that has one
|
|
290
|
+
* every board that has one, and a board's own command may override it
|
|
291
|
+
* (`CommandLegendBox.titleWording`).
|
|
244
292
|
*/
|
|
245
293
|
export declare const BOARD_LEGEND_TITLE: ChromeWording;
|
|
294
|
+
/**
|
|
295
|
+
* The group's own seed: the default title a newly created group is stamped
|
|
296
|
+
* with (`Group 2`), written into the document at creation. Resolved at
|
|
297
|
+
* PLACEMENT and never again — a group renamed by its author keeps its name,
|
|
298
|
+
* and a group created before this key existed keeps the plain text it was
|
|
299
|
+
* given.
|
|
300
|
+
*
|
|
301
|
+
* `{{n}}` is the group's 1-based ordinal among the groups already on the doc;
|
|
302
|
+
* see this service's README on why a count carries a param rather than its own
|
|
303
|
+
* key.
|
|
304
|
+
*
|
|
305
|
+
* ## Why it sits here rather than with the group package
|
|
306
|
+
*
|
|
307
|
+
* Two packages group elements and neither may import the other's translations:
|
|
308
|
+
* `@labre/affine-gfx-group`, which owns the gesture, and
|
|
309
|
+
* `@labre/affine-block-surface`, whose legend groups the box it just drew and
|
|
310
|
+
* which `gfx-group` DEPENDS ON. This layer is below both. It is deliberately
|
|
311
|
+
* NOT listed in {@link CHROME_WORDINGS}: the key stays declared by the group
|
|
312
|
+
* package under source `seed` (`GROUP_WORDINGS`), so the manifest is
|
|
313
|
+
* byte-identical to what it was — one key, one source.
|
|
314
|
+
*/
|
|
315
|
+
export declare const GROUP_SEED_NAME: ChromeWording;
|
|
246
316
|
/**
|
|
247
317
|
* "Undo" said by the link package's quick-tool button (dense + full) and by
|
|
248
318
|
* the generic notification's own undo action
|
|
@@ -161,6 +161,41 @@ export const BOARD_RESIZE_TOGGLE = [
|
|
|
161
161
|
'com.labre.board.toolbar.resize-toggle',
|
|
162
162
|
'Enable / lock resizing',
|
|
163
163
|
];
|
|
164
|
+
/**
|
|
165
|
+
* The orientation toggle a BANDED background carries: the one gesture that
|
|
166
|
+
* turns a frame drawn in columns into the same frame drawn in rows.
|
|
167
|
+
*
|
|
168
|
+
* Declared beside the resize toggle for the same reason and with the same
|
|
169
|
+
* scope: it names a behaviour of the frame primitive — where the name band
|
|
170
|
+
* sits and which way the bands run — rather than anything a notation calls its
|
|
171
|
+
* own. A UML activity partition is the first frame to use it (§15.6.4 draws
|
|
172
|
+
* swimlanes either way and says the choice means nothing); a BPMN pool is the
|
|
173
|
+
* obvious second, and a second key for it would be a second tooltip for one
|
|
174
|
+
* word.
|
|
175
|
+
*/
|
|
176
|
+
export const BOARD_ORIENTATION_TOGGLE = [
|
|
177
|
+
'com.labre.board.toolbar.orientation-toggle',
|
|
178
|
+
'Vertical / horizontal bands',
|
|
179
|
+
];
|
|
180
|
+
/**
|
|
181
|
+
* The gesture that divides a banded background one band further — the button a
|
|
182
|
+
* frame carrying zones offers next to the two above.
|
|
183
|
+
*
|
|
184
|
+
* Declared here with them, and for the third time for the same reason: it names
|
|
185
|
+
* a behaviour of the generic frame primitive (a background whose `instanceZones`
|
|
186
|
+
* are a list the author grows) rather than anything a notation calls its own. A
|
|
187
|
+
* UML combined fragment is the first frame to use it — §17.6.4's second operand
|
|
188
|
+
* is a band added to a box that has one — and a BPMN pool's lane is the obvious
|
|
189
|
+
* second the day it stops reaching this through a command of its own.
|
|
190
|
+
*
|
|
191
|
+
* "Band" and not "operand" or "lane": the word has to be true of every frame
|
|
192
|
+
* that offers the button, and each notation's own noun is already written on
|
|
193
|
+
* the element the button is attached to.
|
|
194
|
+
*/
|
|
195
|
+
export const BOARD_ADD_BAND = [
|
|
196
|
+
'com.labre.board.toolbar.add-band',
|
|
197
|
+
'Add a band',
|
|
198
|
+
];
|
|
164
199
|
/**
|
|
165
200
|
* The legend button, in the two wordings the boards actually use: the notation
|
|
166
201
|
* boards say "notation", Wardley says "components".
|
|
@@ -177,6 +212,26 @@ export const BOARD_LEGEND_COMPONENTS = [
|
|
|
177
212
|
'com.labre.board.toolbar.legend.components',
|
|
178
213
|
'Generate the legend (components present)',
|
|
179
214
|
];
|
|
215
|
+
/* ── The connector's own labels ───────────────────────────────────────── */
|
|
216
|
+
/**
|
|
217
|
+
* The two END labels a connector can carry beside its caption — where UML
|
|
218
|
+
* writes a multiplicity and a role name (`docs/adr/0018` phase 2).
|
|
219
|
+
*
|
|
220
|
+
* Declared here and not in the UML pack for the same reason the resize toggle
|
|
221
|
+
* is: they name a part of the generic CONNECTOR, which every framework draws,
|
|
222
|
+
* and a stored connector keeps its end labels with the UML tooling switched off
|
|
223
|
+
* (`docs/adr/0009`). "Source" and "target" are the connector's own words for
|
|
224
|
+
* its two ends, already the vocabulary of `frontEndpointStyle` /
|
|
225
|
+
* `rearEndpointStyle` and of the direction commands.
|
|
226
|
+
*/
|
|
227
|
+
export const CONNECTOR_SOURCE_LABEL = [
|
|
228
|
+
'com.labre.connector.toolbar.source-label',
|
|
229
|
+
'Source label',
|
|
230
|
+
];
|
|
231
|
+
export const CONNECTOR_TARGET_LABEL = [
|
|
232
|
+
'com.labre.connector.toolbar.target-label',
|
|
233
|
+
'Target label',
|
|
234
|
+
];
|
|
180
235
|
/* ── Note shadow styles ────────────────────────────────────────────────
|
|
181
236
|
* The note block's own shadow options, shared verbatim between the surface
|
|
182
237
|
* toolbar's style panel (blocks/note) and the edgeless senior menu's shadow
|
|
@@ -271,10 +326,9 @@ export const TEXT_FORMAT_STRIKETHROUGH = [
|
|
|
271
326
|
];
|
|
272
327
|
/* ── Font weight / style ────────────────────────────────────────────────── */
|
|
273
328
|
/**
|
|
274
|
-
* The
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
* (`widgets/edgeless-toolbar`).
|
|
329
|
+
* The font weights and the one non-default font style a text toolbar offers —
|
|
330
|
+
* said identically by the toolbar's own "current selection" label (`gfx/text`)
|
|
331
|
+
* and by the popup menu that picks them (`widgets/edgeless-toolbar`).
|
|
278
332
|
*/
|
|
279
333
|
export const FONT_WEIGHT_LIGHT = [
|
|
280
334
|
'com.labre.font.weight.light',
|
|
@@ -288,6 +342,12 @@ export const FONT_WEIGHT_SEMIBOLD = [
|
|
|
288
342
|
'com.labre.font.weight.semibold',
|
|
289
343
|
'Semibold',
|
|
290
344
|
];
|
|
345
|
+
/**
|
|
346
|
+
* An alias (L7 dedupe): the heaviest canvas weight is said with the same word
|
|
347
|
+
* as the prose toolbar's {@link TEXT_FORMAT_BOLD}, so it shares its one key —
|
|
348
|
+
* exactly as {@link FONT_STYLE_ITALIC} does below.
|
|
349
|
+
*/
|
|
350
|
+
export const FONT_WEIGHT_BOLD = TEXT_FORMAT_BOLD;
|
|
291
351
|
/**
|
|
292
352
|
* An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_ITALIC}, one key.
|
|
293
353
|
*/
|
|
@@ -472,16 +532,42 @@ export const BLOCK_TYPE_DIVIDER_DESCRIPTION = [
|
|
|
472
532
|
'Visually separate content.',
|
|
473
533
|
];
|
|
474
534
|
/**
|
|
475
|
-
* The
|
|
476
|
-
* (`
|
|
535
|
+
* The automatic legend BOX title the shared engine draws
|
|
536
|
+
* (`createBoardLegend`, `@labre/affine-block-surface`) — "Legend" itself,
|
|
477
537
|
* distinct from the {@link BOARD_LEGEND_NOTATION} / {@link BOARD_LEGEND_COMPONENTS}
|
|
478
538
|
* toolbar BUTTONS that create it. Declared here because it is the same word on
|
|
479
|
-
* every board that has one
|
|
539
|
+
* every board that has one, and a board's own command may override it
|
|
540
|
+
* (`CommandLegendBox.titleWording`).
|
|
480
541
|
*/
|
|
481
542
|
export const BOARD_LEGEND_TITLE = [
|
|
482
543
|
'com.labre.board.legend.title',
|
|
483
544
|
'Legend',
|
|
484
545
|
];
|
|
546
|
+
/**
|
|
547
|
+
* The group's own seed: the default title a newly created group is stamped
|
|
548
|
+
* with (`Group 2`), written into the document at creation. Resolved at
|
|
549
|
+
* PLACEMENT and never again — a group renamed by its author keeps its name,
|
|
550
|
+
* and a group created before this key existed keeps the plain text it was
|
|
551
|
+
* given.
|
|
552
|
+
*
|
|
553
|
+
* `{{n}}` is the group's 1-based ordinal among the groups already on the doc;
|
|
554
|
+
* see this service's README on why a count carries a param rather than its own
|
|
555
|
+
* key.
|
|
556
|
+
*
|
|
557
|
+
* ## Why it sits here rather than with the group package
|
|
558
|
+
*
|
|
559
|
+
* Two packages group elements and neither may import the other's translations:
|
|
560
|
+
* `@labre/affine-gfx-group`, which owns the gesture, and
|
|
561
|
+
* `@labre/affine-block-surface`, whose legend groups the box it just drew and
|
|
562
|
+
* which `gfx-group` DEPENDS ON. This layer is below both. It is deliberately
|
|
563
|
+
* NOT listed in {@link CHROME_WORDINGS}: the key stays declared by the group
|
|
564
|
+
* package under source `seed` (`GROUP_WORDINGS`), so the manifest is
|
|
565
|
+
* byte-identical to what it was — one key, one source.
|
|
566
|
+
*/
|
|
567
|
+
export const GROUP_SEED_NAME = [
|
|
568
|
+
'com.labre.group.seed.name',
|
|
569
|
+
'Group {{n}}',
|
|
570
|
+
];
|
|
485
571
|
/* ── Undo, wherever a quick-tool or a notification offers it ──────────── */
|
|
486
572
|
/**
|
|
487
573
|
* "Undo" said by the link package's quick-tool button (dense + full) and by
|
|
@@ -1024,8 +1110,12 @@ export const CHROME_WORDINGS = [
|
|
|
1024
1110
|
LINKED_DOC_EMPTY_PREVIEW,
|
|
1025
1111
|
SYNCED_DOC_EMPTY_PREVIEW,
|
|
1026
1112
|
BOARD_RESIZE_TOGGLE,
|
|
1113
|
+
BOARD_ORIENTATION_TOGGLE,
|
|
1114
|
+
BOARD_ADD_BAND,
|
|
1027
1115
|
BOARD_LEGEND_NOTATION,
|
|
1028
1116
|
BOARD_LEGEND_COMPONENTS,
|
|
1117
|
+
CONNECTOR_SOURCE_LABEL,
|
|
1118
|
+
CONNECTOR_TARGET_LABEL,
|
|
1029
1119
|
NOTE_SHADOW_NONE,
|
|
1030
1120
|
NOTE_SHADOW_BOX,
|
|
1031
1121
|
NOTE_SHADOW_STICKER,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { fontBaseStyle, fontSMStyle, fontXSStyle } from './font.js';
|
|
2
|
+
export { reducedMotionStyle, SPRING_DURATION_MS, SPRING_EASING, springDuration, springEasing, } from './motion.js';
|
|
2
3
|
export { panelBaseColorsStyle, panelBaseStyle } from './panel.js';
|
|
3
4
|
export { scrollbarStyle } from './scrollbar-style.js';
|
|
4
5
|
export { affineTextStyles } from './text.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { fontBaseStyle, fontSMStyle, fontXSStyle } from './font.js';
|
|
2
|
+
export { reducedMotionStyle, SPRING_DURATION_MS, SPRING_EASING, springDuration, springEasing, } from './motion.js';
|
|
2
3
|
export { panelBaseColorsStyle, panelBaseStyle } from './panel.js';
|
|
3
4
|
export { scrollbarStyle } from './scrollbar-style.js';
|
|
4
5
|
export { affineTextStyles } from './text.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** easeOutBack: travel, overshoot a little, settle. */
|
|
2
|
+
export declare const SPRING_EASING = "cubic-bezier(0.34, 1.56, 0.64, 1)";
|
|
3
|
+
/** The house tempo of the edgeless chrome, in milliseconds. */
|
|
4
|
+
export declare const SPRING_DURATION_MS = 240;
|
|
5
|
+
/** {@link SPRING_EASING} for a `css` template. */
|
|
6
|
+
export declare const springEasing: import("lit").CSSResult;
|
|
7
|
+
/** {@link SPRING_DURATION_MS} for a `css` template. */
|
|
8
|
+
export declare const springDuration: import("lit").CSSResult;
|
|
9
|
+
/**
|
|
10
|
+
* Every animation and transition inside `container` off when the reader asked
|
|
11
|
+
* the OS for less motion. The end state is the resting state in each case, so
|
|
12
|
+
* dropping the animation loses nothing but the travel.
|
|
13
|
+
*/
|
|
14
|
+
export declare const reducedMotionStyle: (container: string) => import("lit").CSSResult;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chrome's motion tokens — the first of them, and deliberately only the
|
|
3
|
+
* values the library had already converged on by hand.
|
|
4
|
+
*
|
|
5
|
+
* The edgeless chrome has been animating at ~0.23-0.24s since upstream
|
|
6
|
+
* (`edgeless-toolbar.ts`, `create-popper.ts`, `date-picker/style.ts`, `toast`),
|
|
7
|
+
* and the fork's one overshoot curve is the senior toolbar's "pop upright"
|
|
8
|
+
* (`gfx/mindmap/src/toolbar/senior-tool.ts`): `cubic-bezier(0.34, 1.56, 0.64, 1)`,
|
|
9
|
+
* the standard easeOutBack. Nothing exported it, so the second component that
|
|
10
|
+
* wanted a springy settle would have invented a third easing. This module is
|
|
11
|
+
* where it stops being a literal.
|
|
12
|
+
*
|
|
13
|
+
* `springEasing` overshoots by design — only use it on a transform that has
|
|
14
|
+
* room to overshoot (a slide, a scale, a rotation), never on a colour or on
|
|
15
|
+
* anything whose end value must never be passed.
|
|
16
|
+
*/
|
|
17
|
+
import { css, unsafeCSS } from 'lit';
|
|
18
|
+
/** easeOutBack: travel, overshoot a little, settle. */
|
|
19
|
+
export const SPRING_EASING = 'cubic-bezier(0.34, 1.56, 0.64, 1)';
|
|
20
|
+
/** The house tempo of the edgeless chrome, in milliseconds. */
|
|
21
|
+
export const SPRING_DURATION_MS = 240;
|
|
22
|
+
/** {@link SPRING_EASING} for a `css` template. */
|
|
23
|
+
export const springEasing = unsafeCSS(SPRING_EASING);
|
|
24
|
+
/** {@link SPRING_DURATION_MS} for a `css` template. */
|
|
25
|
+
export const springDuration = unsafeCSS(`${SPRING_DURATION_MS}ms`);
|
|
26
|
+
/**
|
|
27
|
+
* Every animation and transition inside `container` off when the reader asked
|
|
28
|
+
* the OS for less motion. The end state is the resting state in each case, so
|
|
29
|
+
* dropping the animation loses nothing but the travel.
|
|
30
|
+
*/
|
|
31
|
+
export const reducedMotionStyle = (container) => css `
|
|
32
|
+
@media (prefers-reduced-motion: reduce) {
|
|
33
|
+
${unsafeCSS(container)}, ${unsafeCSS(container)} * {
|
|
34
|
+
animation: none !important;
|
|
35
|
+
transition: none !important;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
@@ -19,6 +19,16 @@ export declare function isMiddleButtonPressed(e: MouseEvent): boolean;
|
|
|
19
19
|
export declare function isRightButtonPressed(e: MouseEvent): boolean;
|
|
20
20
|
export declare function stopPropagation(event: Event): void;
|
|
21
21
|
export declare function isControlledKeyboardEvent(e: KeyboardEvent): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The editor swallows Tab, Shift-Tab and Enter so that indentation and block
|
|
24
|
+
* splitting stay under the control of the block-scoped handlers. That would
|
|
25
|
+
* however trap the focus on the native controls the editor renders (the
|
|
26
|
+
* collapse button of headings and lists, for instance), which then could
|
|
27
|
+
* neither be reached, left nor activated with the keyboard. When the event
|
|
28
|
+
* originates from such a control — and not from editable text — the native
|
|
29
|
+
* behaviour is let through.
|
|
30
|
+
*/
|
|
31
|
+
export declare function isNativeFocusableTarget(target: EventTarget | null): boolean;
|
|
22
32
|
export declare function isNewTabTrigger(event?: MouseEvent): boolean;
|
|
23
33
|
export declare function isNewViewTrigger(event?: MouseEvent): boolean;
|
|
24
34
|
export declare function on<T extends HTMLElement, K extends keyof M, M = HTMLElementEventMap>(element: T, event: K, handler: (ev: M[K]) => void, options?: boolean | AddEventListenerOptions): () => void;
|
|
@@ -37,6 +37,26 @@ export function stopPropagation(event) {
|
|
|
37
37
|
export function isControlledKeyboardEvent(e) {
|
|
38
38
|
return e.ctrlKey || e.metaKey || e.altKey;
|
|
39
39
|
}
|
|
40
|
+
// The editor host itself carries `tabindex="0"` so that it can receive the
|
|
41
|
+
// keystrokes aimed at a block selection; it is the editing surface, not a
|
|
42
|
+
// control, hence the exclusion.
|
|
43
|
+
const NATIVE_FOCUSABLE_SELECTOR = 'button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"]):not(editor-host)';
|
|
44
|
+
/**
|
|
45
|
+
* The editor swallows Tab, Shift-Tab and Enter so that indentation and block
|
|
46
|
+
* splitting stay under the control of the block-scoped handlers. That would
|
|
47
|
+
* however trap the focus on the native controls the editor renders (the
|
|
48
|
+
* collapse button of headings and lists, for instance), which then could
|
|
49
|
+
* neither be reached, left nor activated with the keyboard. When the event
|
|
50
|
+
* originates from such a control — and not from editable text — the native
|
|
51
|
+
* behaviour is let through.
|
|
52
|
+
*/
|
|
53
|
+
export function isNativeFocusableTarget(target) {
|
|
54
|
+
if (!(target instanceof Element))
|
|
55
|
+
return false;
|
|
56
|
+
if (target instanceof HTMLElement && target.isContentEditable)
|
|
57
|
+
return false;
|
|
58
|
+
return !!target.closest(NATIVE_FOCUSABLE_SELECTOR);
|
|
59
|
+
}
|
|
40
60
|
export function isNewTabTrigger(event) {
|
|
41
61
|
return event
|
|
42
62
|
? (event.ctrlKey || event.metaKey || event.button === 1) && !event.altKey
|
|
@@ -52,6 +52,22 @@ export declare function openSingleFileWith(acceptType?: AcceptTypes): Promise<Fi
|
|
|
52
52
|
*/
|
|
53
53
|
export declare function openSingleFileWithSpec(spec: FilePickerSpec): Promise<File | null>;
|
|
54
54
|
export declare function getImageFilesFromLocal(): Promise<File[]>;
|
|
55
|
+
/**
|
|
56
|
+
* A name a file system will accept, minus the extension.
|
|
57
|
+
*
|
|
58
|
+
* The sanitiser the framework exports each wrote for themselves
|
|
59
|
+
* (`wardleySafeFilename`, `c4SafeFilename`, BPMN's) — same five steps, same
|
|
60
|
+
* 120-character ceiling — lifted here for the callers that belong to no
|
|
61
|
+
* framework at all. The generic SVG export (ADR 0025) is the first of them: it
|
|
62
|
+
* writes a file for ELEVEN kinds of board, so it has no framework's fallback to
|
|
63
|
+
* borrow and takes one as a parameter instead.
|
|
64
|
+
*
|
|
65
|
+
* The three framework copies stay where they are: each is part of an
|
|
66
|
+
* interchange capability with its own format id and its own declared fallback
|
|
67
|
+
* (`map`, `board`, `process`), and rewriting them to call this one would touch
|
|
68
|
+
* three exported APIs for no behaviour change.
|
|
69
|
+
*/
|
|
70
|
+
export declare function safeFilename(raw: string | undefined, fallback: string): string;
|
|
55
71
|
export declare function downloadBlob(blob: Blob, name: string): void;
|
|
56
72
|
/**
|
|
57
73
|
* Because the image block and attachment block have different props.
|
|
@@ -188,6 +188,31 @@ export async function getImageFilesFromLocal() {
|
|
|
188
188
|
const files = await openFilesWith('Images');
|
|
189
189
|
return files ?? [];
|
|
190
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* A name a file system will accept, minus the extension.
|
|
193
|
+
*
|
|
194
|
+
* The sanitiser the framework exports each wrote for themselves
|
|
195
|
+
* (`wardleySafeFilename`, `c4SafeFilename`, BPMN's) — same five steps, same
|
|
196
|
+
* 120-character ceiling — lifted here for the callers that belong to no
|
|
197
|
+
* framework at all. The generic SVG export (ADR 0025) is the first of them: it
|
|
198
|
+
* writes a file for ELEVEN kinds of board, so it has no framework's fallback to
|
|
199
|
+
* borrow and takes one as a parameter instead.
|
|
200
|
+
*
|
|
201
|
+
* The three framework copies stay where they are: each is part of an
|
|
202
|
+
* interchange capability with its own format id and its own declared fallback
|
|
203
|
+
* (`map`, `board`, `process`), and rewriting them to call this one would touch
|
|
204
|
+
* three exported APIs for no behaviour change.
|
|
205
|
+
*/
|
|
206
|
+
export function safeFilename(raw, fallback) {
|
|
207
|
+
const safe = (raw ?? '')
|
|
208
|
+
.trim()
|
|
209
|
+
.replaceAll(/[\\/:*?"<>|]/g, '-')
|
|
210
|
+
.replaceAll(/\s+/g, ' ')
|
|
211
|
+
.trim()
|
|
212
|
+
.slice(0, 120)
|
|
213
|
+
.replace(/[. ]+$/, '');
|
|
214
|
+
return safe || fallback;
|
|
215
|
+
}
|
|
191
216
|
export function downloadBlob(blob, name) {
|
|
192
217
|
const dataURL = URL.createObjectURL(blob);
|
|
193
218
|
const tmpLink = document.createElement('a');
|
|
@@ -13,6 +13,7 @@ export * from './fractional-indexing.js';
|
|
|
13
13
|
export * from './image.js';
|
|
14
14
|
export * from './insert.js';
|
|
15
15
|
export * from './is-abort-error.js';
|
|
16
|
+
export * from './link-preview-refresh.js';
|
|
16
17
|
export * from './math.js';
|
|
17
18
|
export * from './model/index.js';
|
|
18
19
|
export * from './popper-position.js';
|
|
@@ -13,6 +13,7 @@ export * from './fractional-indexing.js';
|
|
|
13
13
|
export * from './image.js';
|
|
14
14
|
export * from './insert.js';
|
|
15
15
|
export * from './is-abort-error.js';
|
|
16
|
+
export * from './link-preview-refresh.js';
|
|
16
17
|
export * from './math.js';
|
|
17
18
|
export * from './model/index.js';
|
|
18
19
|
export * from './popper-position.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Store } from '../../store/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Whether a bookmark or embed card must refetch its link preview after a props
|
|
4
|
+
* change.
|
|
5
|
+
*
|
|
6
|
+
* `BlockModel.propsUpdated` carries the key only, so a subscriber cannot tell a
|
|
7
|
+
* local edit from an update that arrived from another peer. A readonly peer
|
|
8
|
+
* receives the change like everyone else; the author is the one who refetches
|
|
9
|
+
* and syncs the result. Without this guard every reader of the document races
|
|
10
|
+
* the author to rewrite the same title, description and image.
|
|
11
|
+
*/
|
|
12
|
+
export declare function shouldRefreshOnPropsUpdate(store: Store, key: string): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a bookmark or embed card must refetch its link preview after a props
|
|
3
|
+
* change.
|
|
4
|
+
*
|
|
5
|
+
* `BlockModel.propsUpdated` carries the key only, so a subscriber cannot tell a
|
|
6
|
+
* local edit from an update that arrived from another peer. A readonly peer
|
|
7
|
+
* receives the change like everyone else; the author is the one who refetches
|
|
8
|
+
* and syncs the result. Without this guard every reader of the document races
|
|
9
|
+
* the author to rewrite the same title, description and image.
|
|
10
|
+
*/
|
|
11
|
+
export function shouldRefreshOnPropsUpdate(store, key) {
|
|
12
|
+
return key === 'url' && !store.readonly;
|
|
13
|
+
}
|
|
@@ -138,11 +138,19 @@ export declare class EdgelessArtefactCatalogueWidget extends WidgetComponent<Roo
|
|
|
138
138
|
*/
|
|
139
139
|
private _chord;
|
|
140
140
|
/**
|
|
141
|
-
*
|
|
141
|
+
* Arm an artefact, run anything else. The panel STAYS OPEN either way.
|
|
142
142
|
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
* panel
|
|
143
|
+
* An artefact row arms the placement tool exactly as the senior menu's does
|
|
144
|
+
* (PO decision, 2026-09-16): the ghost goes under the cursor and the click on
|
|
145
|
+
* the canvas says where. The panel is one gesture away from the board, so it
|
|
146
|
+
* can stay open behind the ghost.
|
|
147
|
+
*
|
|
148
|
+
* For everything else `runCommand` is the one bottleneck (ADR 0008): the
|
|
149
|
+
* telemetry and the usage measure are emitted there, and `surface:
|
|
150
|
+
* 'catalogue'` is what makes this panel distinguishable from the sub-menu in
|
|
151
|
+
* the numbers. An armed artefact reports at PLACEMENT instead, through the
|
|
152
|
+
* tool, so its `surface` reads `'senior-menu'` — the row it belongs to,
|
|
153
|
+
* whichever surface offered it.
|
|
146
154
|
*
|
|
147
155
|
* Staying open is the PO's call (recette, 27/08/2026), reversing the first
|
|
148
156
|
* default: a catalogue is where a user furnishes a diagram, and furnishing is
|