@formicoidea/labre-core 0.49.0 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_pkgs/affine-block-attachment/asset-picker.d.ts +24 -0
- package/dist/_pkgs/affine-block-attachment/asset-picker.js +87 -0
- package/dist/_pkgs/affine-block-attachment/configs/slash-menu.js +3 -20
- package/dist/_pkgs/affine-block-attachment/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-attachment/index.js +1 -0
- package/dist/_pkgs/affine-block-attachment/utils.d.ts +9 -1
- package/dist/_pkgs/affine-block-attachment/utils.js +9 -0
- package/dist/_pkgs/affine-block-bookmark/adapters/markdown/markdown.js +14 -1
- package/dist/_pkgs/affine-block-bookmark/adapters/notion-html.js +5 -1
- package/dist/_pkgs/affine-block-database/adapters/markdown.js +5 -3
- package/dist/_pkgs/affine-block-embed/common/adapters/html.js +5 -3
- package/dist/_pkgs/affine-block-embed/common/adapters/markdown.js +11 -0
- package/dist/_pkgs/affine-block-frame/frame-template.d.ts +58 -0
- package/dist/_pkgs/affine-block-frame/frame-template.js +207 -0
- package/dist/_pkgs/affine-block-frame/frame-toolbar.js +19 -3
- package/dist/_pkgs/affine-block-frame/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-frame/index.js +1 -0
- package/dist/_pkgs/affine-block-frame/translations.d.ts +7 -0
- package/dist/_pkgs/affine-block-frame/translations.js +16 -1
- package/dist/_pkgs/affine-block-frame/view.js +6 -0
- package/dist/_pkgs/affine-block-image/asset-picker.d.ts +63 -0
- package/dist/_pkgs/affine-block-image/asset-picker.js +183 -0
- package/dist/_pkgs/affine-block-image/commands/insert-images.d.ts +5 -0
- package/dist/_pkgs/affine-block-image/commands/insert-images.js +8 -8
- package/dist/_pkgs/affine-block-image/components/page-image-block.d.ts +11 -0
- package/dist/_pkgs/affine-block-image/components/page-image-block.js +81 -12
- package/dist/_pkgs/affine-block-image/configs/replace-action.d.ts +9 -0
- package/dist/_pkgs/affine-block-image/configs/replace-action.js +27 -0
- package/dist/_pkgs/affine-block-image/configs/toolbar.js +6 -0
- package/dist/_pkgs/affine-block-image/crop/crop-controller.d.ts +46 -0
- package/dist/_pkgs/affine-block-image/crop/crop-controller.js +104 -0
- package/dist/_pkgs/affine-block-image/crop/crop-math.d.ts +70 -0
- package/dist/_pkgs/affine-block-image/crop/crop-math.js +141 -0
- package/dist/_pkgs/affine-block-image/crop/crop-overlay.d.ts +57 -0
- package/dist/_pkgs/affine-block-image/crop/crop-overlay.js +343 -0
- package/dist/_pkgs/affine-block-image/crop/crop-toolbar.d.ts +12 -0
- package/dist/_pkgs/affine-block-image/crop/crop-toolbar.js +78 -0
- package/dist/_pkgs/affine-block-image/crop/write-crop.d.ts +16 -0
- package/dist/_pkgs/affine-block-image/crop/write-crop.js +57 -0
- package/dist/_pkgs/affine-block-image/edgeless-clipboard-config.js +4 -1
- package/dist/_pkgs/affine-block-image/effects.js +2 -0
- package/dist/_pkgs/affine-block-image/image-block.d.ts +2 -0
- package/dist/_pkgs/affine-block-image/image-block.js +2 -0
- package/dist/_pkgs/affine-block-image/image-edgeless-block.d.ts +2 -0
- package/dist/_pkgs/affine-block-image/image-edgeless-block.js +36 -8
- package/dist/_pkgs/affine-block-image/image-resize-manager.js +15 -0
- package/dist/_pkgs/affine-block-image/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-image/index.js +1 -0
- package/dist/_pkgs/affine-block-image/translations.d.ts +15 -0
- package/dist/_pkgs/affine-block-image/translations.js +43 -0
- package/dist/_pkgs/affine-block-image/utils.d.ts +13 -0
- package/dist/_pkgs/affine-block-image/utils.js +10 -1
- package/dist/_pkgs/affine-block-root/clipboard/page-clipboard.js +5 -0
- package/dist/_pkgs/affine-block-root/commands/page-export-commands.d.ts +2 -0
- package/dist/_pkgs/affine-block-root/commands/page-export-commands.js +71 -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/view.js +8 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/capability.d.ts +30 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/capability.js +44 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/colors.d.ts +26 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/colors.js +82 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/command.d.ts +18 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/command.js +91 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/index.d.ts +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/index.js +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/writer.d.ts +50 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/writer.js +732 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/draw-image-block.d.ts +12 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/draw-image-block.js +15 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +7 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.d.ts +7 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.js +60 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.d.ts +2 -2
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.js +2 -2
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/marker-version.d.ts +6 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/marker-version.js +8 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.d.ts +28 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +66 -6
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.d.ts +2 -7
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.js +2 -6
- package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +2 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.js +2 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-export.d.ts +84 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-export.js +150 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +24 -2
- package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +23 -2
- package/dist/_pkgs/affine-block-surface/extensions/interchange.js +4 -1
- package/dist/_pkgs/affine-block-surface/extensions/legend-role.d.ts +18 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend-role.js +20 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend.d.ts +2 -19
- package/dist/_pkgs/affine-block-surface/extensions/legend.js +2 -18
- package/dist/_pkgs/affine-block-surface/extensions/svg-sanitize.d.ts +67 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sanitize.js +235 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.js +9 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +17 -13
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +52 -80
- package/dist/_pkgs/affine-block-surface/extensions/xml-element.d.ts +98 -0
- package/dist/_pkgs/affine-block-surface/extensions/xml-element.js +261 -0
- package/dist/_pkgs/affine-block-surface/extensions/xml-reader.d.ts +238 -0
- package/dist/_pkgs/affine-block-surface/extensions/xml-reader.js +570 -0
- package/dist/_pkgs/affine-block-surface/framework-background/def.js +1 -1
- package/dist/_pkgs/affine-block-surface/interchange-headless.d.ts +29 -0
- package/dist/_pkgs/affine-block-surface/interchange-headless.js +32 -0
- package/dist/_pkgs/affine-block-surface/view.js +22 -2
- package/dist/_pkgs/affine-block-table/adapters/utils.js +24 -1
- package/dist/_pkgs/affine-components/color-picker/color-panel.d.ts +11 -0
- package/dist/_pkgs/affine-components/color-picker/color-panel.js +87 -12
- package/dist/_pkgs/affine-components/color-picker/framework-palette.d.ts +8 -0
- package/dist/_pkgs/affine-components/color-picker/framework-palette.js +11 -3
- package/dist/_pkgs/affine-components/color-picker/icons.d.ts +9 -0
- package/dist/_pkgs/affine-components/color-picker/icons.js +12 -0
- package/dist/_pkgs/affine-gfx-note/toolbar/note-menu.js +5 -8
- package/dist/_pkgs/affine-gfx-template/contribute.d.ts +14 -4
- package/dist/_pkgs/affine-gfx-template/contribute.js +47 -6
- package/dist/_pkgs/affine-gfx-template/toolbar/builtin-templates.d.ts +7 -2
- package/dist/_pkgs/affine-gfx-template/toolbar/builtin-templates.js +14 -40
- package/dist/_pkgs/affine-gfx-template/toolbar/resolve-name.d.ts +1 -1
- package/dist/_pkgs/affine-gfx-template/toolbar/resolve-name.js +1 -1
- package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.d.ts +4 -4
- package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.js +9 -9
- package/dist/_pkgs/affine-gfx-template/toolbar/template-type.d.ts +2 -4
- package/dist/_pkgs/affine-gfx-template/translations.d.ts +5 -0
- package/dist/_pkgs/affine-gfx-template/translations.js +9 -0
- package/dist/_pkgs/affine-inline-footnote/adapters/markdown/inline-delta.js +6 -0
- package/dist/_pkgs/affine-inline-footnote/adapters/markdown/markdown-inline.js +7 -0
- package/dist/_pkgs/affine-inline-link/adapters/html/html-inline.js +4 -1
- package/dist/_pkgs/affine-inline-link/adapters/html/inline-delta.js +3 -1
- package/dist/_pkgs/affine-inline-link/adapters/markdown/inline-delta.js +4 -1
- package/dist/_pkgs/affine-inline-link/adapters/notion-html/html-inline.js +2 -1
- package/dist/_pkgs/affine-inline-link/link-node/affine-link.d.ts +7 -0
- package/dist/_pkgs/affine-inline-link/link-node/affine-link.js +37 -0
- package/dist/_pkgs/affine-inline-link/link-node/index.d.ts +1 -0
- package/dist/_pkgs/affine-inline-link/link-node/index.js +1 -0
- package/dist/_pkgs/affine-inline-link/link-node/propose-views.d.ts +22 -0
- package/dist/_pkgs/affine-inline-link/link-node/propose-views.js +59 -0
- package/dist/_pkgs/affine-model/blocks/database/types.d.ts +28 -0
- package/dist/_pkgs/affine-model/blocks/image/image-crop.d.ts +48 -0
- package/dist/_pkgs/affine-model/blocks/image/image-crop.js +78 -0
- package/dist/_pkgs/affine-model/blocks/image/image-model.d.ts +6 -0
- package/dist/_pkgs/affine-model/blocks/image/image-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/image/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/blocks/image/index.js +1 -0
- package/dist/_pkgs/affine-model/consts/shape.d.ts +2 -0
- package/dist/_pkgs/affine-model/consts/shape.js +5 -0
- package/dist/_pkgs/affine-model/elements/bpmn/consts.d.ts +31 -0
- package/dist/_pkgs/affine-model/elements/bpmn/consts.js +31 -0
- package/dist/_pkgs/affine-model/elements/bpmn/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/bpmn/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/bpmn/pool.d.ts +0 -25
- package/dist/_pkgs/affine-model/elements/bpmn/pool.js +1 -25
- package/dist/_pkgs/affine-model/elements/shape/shape.d.ts +0 -2
- package/dist/_pkgs/affine-model/elements/shape/shape.js +1 -2
- package/dist/_pkgs/affine-model/elements/uml/consts.d.ts +133 -0
- package/dist/_pkgs/affine-model/elements/uml/consts.js +107 -0
- package/dist/_pkgs/affine-model/elements/uml/diagram.d.ts +1 -79
- package/dist/_pkgs/affine-model/elements/uml/diagram.js +1 -53
- package/dist/_pkgs/affine-model/elements/uml/fragment.d.ts +0 -15
- package/dist/_pkgs/affine-model/elements/uml/fragment.js +1 -15
- package/dist/_pkgs/affine-model/elements/uml/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/uml/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/uml/partition.d.ts +0 -20
- package/dist/_pkgs/affine-model/elements/uml/partition.js +1 -20
- package/dist/_pkgs/affine-model/elements/uml/region.d.ts +0 -11
- package/dist/_pkgs/affine-model/elements/uml/region.js +1 -11
- package/dist/_pkgs/affine-model/headless.d.ts +19 -0
- package/dist/_pkgs/affine-model/headless.js +19 -0
- package/dist/_pkgs/affine-shared/headless.d.ts +10 -0
- package/dist/_pkgs/affine-shared/headless.js +10 -0
- package/dist/_pkgs/affine-shared/services/asset-picker-service.d.ts +63 -0
- package/dist/_pkgs/affine-shared/services/asset-picker-service.js +20 -0
- package/dist/_pkgs/affine-shared/services/data-source-picker-service.d.ts +6 -3
- package/dist/_pkgs/affine-shared/services/frame-template-service.d.ts +83 -0
- package/dist/_pkgs/affine-shared/services/frame-template-service.js +17 -0
- package/dist/_pkgs/affine-shared/services/index.d.ts +2 -0
- package/dist/_pkgs/affine-shared/services/index.js +2 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +6 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +10 -0
- package/dist/_pkgs/affine-widget-drag-handle/watchers/drag-event-watcher.js +8 -3
- package/dist/_pkgs/affine-widget-keyboard-toolbar/config.js +4 -16
- package/dist/_pkgs/affine-widget-linked-doc/transformers/html.d.ts +7 -0
- package/dist/_pkgs/affine-widget-linked-doc/transformers/html.js +25 -24
- package/dist/_pkgs/affine-widget-linked-doc/transformers/index.d.ts +1 -1
- package/dist/_pkgs/affine-widget-linked-doc/transformers/markdown.d.ts +7 -0
- package/dist/_pkgs/affine-widget-linked-doc/transformers/markdown.js +26 -25
- package/dist/_pkgs/affine-widget-linked-doc/transformers/utils.d.ts +23 -0
- package/dist/_pkgs/affine-widget-linked-doc/transformers/utils.js +14 -0
- package/dist/_pkgs/data-view/core/common/properties.d.ts +29 -0
- package/dist/_pkgs/data-view/core/common/properties.js +110 -8
- package/dist/_pkgs/data-view/core/common/property-menu.d.ts +44 -1
- package/dist/_pkgs/data-view/core/common/property-menu.js +100 -3
- package/dist/_pkgs/data-view/core/component/tags/color-carousel.d.ts +41 -0
- package/dist/_pkgs/data-view/core/component/tags/color-carousel.js +199 -0
- package/dist/_pkgs/data-view/core/component/tags/color-menu.d.ts +49 -0
- package/dist/_pkgs/data-view/core/component/tags/color-menu.js +123 -0
- package/dist/_pkgs/data-view/core/component/tags/index.d.ts +3 -0
- package/dist/_pkgs/data-view/core/component/tags/index.js +3 -0
- package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.d.ts +8 -1
- package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.js +21 -20
- package/dist/_pkgs/data-view/core/component/tags/softened-colors.d.ts +42 -0
- package/dist/_pkgs/data-view/core/component/tags/softened-colors.js +79 -0
- package/dist/_pkgs/data-view/core/data-view.d.ts +8 -1
- package/dist/_pkgs/data-view/core/data-view.js +18 -2
- package/dist/_pkgs/data-view/core/effect.js +2 -1
- package/dist/_pkgs/data-view/core/filter/eval.d.ts +6 -1
- package/dist/_pkgs/data-view/core/filter/eval.js +7 -2
- package/dist/_pkgs/data-view/core/group-by/renderer/select-group.d.ts +3 -0
- package/dist/_pkgs/data-view/core/group-by/renderer/select-group.js +119 -71
- package/dist/_pkgs/data-view/core/view/color-rules.d.ts +85 -0
- package/dist/_pkgs/data-view/core/view/color-rules.js +165 -0
- package/dist/_pkgs/data-view/core/view/index.d.ts +1 -0
- package/dist/_pkgs/data-view/core/view/index.js +1 -0
- package/dist/_pkgs/data-view/property-presets/multi-select/cell-renderer.js +1 -0
- package/dist/_pkgs/data-view/property-presets/select/cell-renderer.js +1 -0
- package/dist/_pkgs/data-view/translations.d.ts +34 -0
- package/dist/_pkgs/data-view/translations.js +80 -0
- package/dist/_pkgs/data-view/view-presets/gallery/gallery-view.js +7 -1
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/card.js +6 -1
- package/dist/_pkgs/data-view/view-presets/kanban/pc/card.js +6 -1
- package/dist/_pkgs/data-view/view-presets/list/list-view.js +4 -0
- package/dist/_pkgs/data-view/view-presets/table/mobile/row.js +3 -0
- package/dist/_pkgs/data-view/view-presets/table/pc/header/database-header-column.d.ts +3 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/header/database-header-column.js +149 -175
- package/dist/_pkgs/data-view/view-presets/table/pc/row/row.js +6 -0
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/color-rules-menu.d.ts +12 -0
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/color-rules-menu.js +206 -0
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-options.js +16 -2
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-settings.d.ts +4 -2
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-settings.js +11 -2
- package/dist/commands.js +5 -2
- package/dist/host-panels.d.ts +21 -1
- package/dist/host-panels.js +50 -10
- package/dist/interchange.d.ts +1 -0
- package/dist/interchange.js +1 -0
- package/dist/model/headless.d.ts +1 -0
- package/dist/model/headless.js +1 -0
- package/dist/shared/headless.d.ts +1 -0
- package/dist/shared/headless.js +1 -0
- package/dist/translations.js +8 -1
- package/package.json +13 -1
|
@@ -2,31 +2,6 @@ import type { SerializedXYWH } from '../../../global/gfx/index.js';
|
|
|
2
2
|
import type { PointTestOptions } from '../../../std/gfx/index.js';
|
|
3
3
|
import type { FrameworkBackgroundProps } from '../framework-background/index.js';
|
|
4
4
|
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
5
|
-
/**
|
|
6
|
-
* Width of the participant band — the left margin strip the pool name is
|
|
7
|
-
* written up, in model units.
|
|
8
|
-
*
|
|
9
|
-
* Declared HERE, in the model, and re-exported by `@labre/affine-gfx-bpmn`
|
|
10
|
-
* rather than the other way round. The pool's own hit test needs it (a pool is
|
|
11
|
-
* clickable by its title bands as well as its border, the bpmn.io convention),
|
|
12
|
-
* and `affine-model` cannot reach into `affine-block-surface` where the
|
|
13
|
-
* declaration is resolved. One number, owned by the layer that both the
|
|
14
|
-
* declaration and the hit test can read.
|
|
15
|
-
*/
|
|
16
|
-
export declare const POOL_BAND_WIDTH = 28;
|
|
17
|
-
/**
|
|
18
|
-
* Width of a lane's own title band — the strip immediately inside the
|
|
19
|
-
* participant band, with the lane name turned on its side.
|
|
20
|
-
*
|
|
21
|
-
* Four units narrower than {@link POOL_BAND_WIDTH}, and for the same reason the
|
|
22
|
-
* lane font is two points smaller: the two strips sit side by side, so the
|
|
23
|
-
* subordinate one has to say so. Identical widths read as a single 56-unit
|
|
24
|
-
* gutter rather than as a participant containing lanes, which is exactly the
|
|
25
|
-
* relationship the picture has to carry.
|
|
26
|
-
*
|
|
27
|
-
* NO fill, divider only — what bpmn.io, Camunda and Visio all draw.
|
|
28
|
-
*/
|
|
29
|
-
export declare const POOL_LANE_BAND_WIDTH = 24;
|
|
30
5
|
/**
|
|
31
6
|
* One LANE (couloir) of a pool: a horizontal band the participant's own work is
|
|
32
7
|
* divided into — "Sales", "Back office", "Automated".
|
|
@@ -35,31 +35,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
35
35
|
import { rotatePoint } from '../../../global/gfx/index.js';
|
|
36
36
|
import { field } from '../../../std/gfx/index.js';
|
|
37
37
|
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
38
|
-
|
|
39
|
-
* Width of the participant band — the left margin strip the pool name is
|
|
40
|
-
* written up, in model units.
|
|
41
|
-
*
|
|
42
|
-
* Declared HERE, in the model, and re-exported by `@labre/affine-gfx-bpmn`
|
|
43
|
-
* rather than the other way round. The pool's own hit test needs it (a pool is
|
|
44
|
-
* clickable by its title bands as well as its border, the bpmn.io convention),
|
|
45
|
-
* and `affine-model` cannot reach into `affine-block-surface` where the
|
|
46
|
-
* declaration is resolved. One number, owned by the layer that both the
|
|
47
|
-
* declaration and the hit test can read.
|
|
48
|
-
*/
|
|
49
|
-
export const POOL_BAND_WIDTH = 28;
|
|
50
|
-
/**
|
|
51
|
-
* Width of a lane's own title band — the strip immediately inside the
|
|
52
|
-
* participant band, with the lane name turned on its side.
|
|
53
|
-
*
|
|
54
|
-
* Four units narrower than {@link POOL_BAND_WIDTH}, and for the same reason the
|
|
55
|
-
* lane font is two points smaller: the two strips sit side by side, so the
|
|
56
|
-
* subordinate one has to say so. Identical widths read as a single 56-unit
|
|
57
|
-
* gutter rather than as a participant containing lanes, which is exactly the
|
|
58
|
-
* relationship the picture has to carry.
|
|
59
|
-
*
|
|
60
|
-
* NO fill, divider only — what bpmn.io, Camunda and Visio all draw.
|
|
61
|
-
*/
|
|
62
|
-
export const POOL_LANE_BAND_WIDTH = 24;
|
|
38
|
+
import { POOL_BAND_WIDTH, POOL_LANE_BAND_WIDTH } from './consts.js';
|
|
63
39
|
/**
|
|
64
40
|
* A BPMN "pool": a participant container drawn as a rounded-rect frame with a
|
|
65
41
|
* vertical name band on the left. It is a framework background like every other
|
|
@@ -47,8 +47,6 @@ export type ShapeProps = BaseElementProps & {
|
|
|
47
47
|
textFitMode?: TextFitMode;
|
|
48
48
|
maxWidth?: false | number;
|
|
49
49
|
} & Partial<TextStyleProps>;
|
|
50
|
-
export declare const SHAPE_TEXT_PADDING = 20;
|
|
51
|
-
export declare const SHAPE_TEXT_VERTICAL_PADDING = 10;
|
|
52
50
|
export declare class ShapeElementModel extends GfxPrimitiveElementModel<ShapeProps> {
|
|
53
51
|
/**
|
|
54
52
|
* The bound of the text content.
|
|
@@ -36,10 +36,9 @@ import { Bound, getBoundWithRotation } from '../../../global/gfx/index.js';
|
|
|
36
36
|
import { field, GfxLocalElementModel, GfxPrimitiveElementModel, local, prop, } from '../../../std/gfx/index.js';
|
|
37
37
|
import * as Y from 'yjs';
|
|
38
38
|
import { DEFAULT_ROUGHNESS, FontFamily, FontStyle, FontWeight, ShapeStyle, ShapeTextFontSize, ShapeType, StrokeStyle, TextAlign, TextFitMode, TextResizing, TextVerticalAlign, } from '../../consts/index.js';
|
|
39
|
+
import { SHAPE_TEXT_PADDING, SHAPE_TEXT_VERTICAL_PADDING, } from '../../consts/shape.js';
|
|
39
40
|
import { DefaultTheme } from '../../themes/index.js';
|
|
40
41
|
import { shapeMethods } from './api/index.js';
|
|
41
|
-
export const SHAPE_TEXT_PADDING = 20;
|
|
42
|
-
export const SHAPE_TEXT_VERTICAL_PADDING = 10;
|
|
43
42
|
let ShapeElementModel = (() => {
|
|
44
43
|
let _classSuper = GfxPrimitiveElementModel;
|
|
45
44
|
let _color_decorators;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The UML element constants an interchange reader needs WITHOUT the element
|
|
3
|
+
* classes: moved out of `diagram.ts`, `fragment.ts`, `partition.ts` and `region.ts`
|
|
4
|
+
* unchanged, so the
|
|
5
|
+
* model's headless entry (`@labre/affine-model/headless`) can export them with
|
|
6
|
+
* no `@labre/std/gfx` behind it (ADR 0012, P3 as amended 2026-10-14). The
|
|
7
|
+
* package index re-exports this file, so nothing an importer reads moved.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Height of the diagram frame's heading band — the strip across the top of the
|
|
11
|
+
* frame the `<kind> <name>` tag is written in, in model units.
|
|
12
|
+
*
|
|
13
|
+
* Declared HERE, in the model, and re-exported by `@labre/affine-gfx-uml`
|
|
14
|
+
* rather than the other way round, for the reason `C4_BOARD_TITLE_BAND_HEIGHT`
|
|
15
|
+
* is: the frame's own hit test needs it (a diagram is clickable by its heading
|
|
16
|
+
* band as well as by its border), and `affine-model` cannot reach into
|
|
17
|
+
* `affine-block-surface` where the declaration is resolved. One number, owned
|
|
18
|
+
* by the layer that both the declaration and the hit test can read.
|
|
19
|
+
*
|
|
20
|
+
* It is the frame's TOP MARGIN — the inset the drawing gives up so the heading
|
|
21
|
+
* has somewhere to be written — so the strip that is painted, the strip that is
|
|
22
|
+
* picked and the strip that opens the rename are one number rather than three.
|
|
23
|
+
*
|
|
24
|
+
* 44 is the height of the cut-corner tag UML 2.5.1 Annex A draws the heading
|
|
25
|
+
* in: a 20-unit label with the rest as breathing room above and below.
|
|
26
|
+
* Changing it moves the heading, so it is a visual decision and not a hit-test
|
|
27
|
+
* one.
|
|
28
|
+
*/
|
|
29
|
+
export declare const UML_FRAME_BAND_HEIGHT = 44;
|
|
30
|
+
/**
|
|
31
|
+
* Which kind of UML diagram this frame draws — the DECLARED fact, as opposed to
|
|
32
|
+
* the name, which is free text and says whatever its author wants it to.
|
|
33
|
+
*
|
|
34
|
+
* ## Where the values come from
|
|
35
|
+
*
|
|
36
|
+
* UML 2.5.1 Annex A gives the normative frame kind names, each with the
|
|
37
|
+
* abbreviation that may be written in its place:
|
|
38
|
+
*
|
|
39
|
+
* - `activity` / `act`;
|
|
40
|
+
* - `class` — the one kind Annex A gives NO abbreviation for, so the word
|
|
41
|
+
* itself is the tag;
|
|
42
|
+
* - `component` / `cmp`;
|
|
43
|
+
* - `deployment` / `dep`;
|
|
44
|
+
* - `interaction` / `sd`;
|
|
45
|
+
* - `package` / `pkg`;
|
|
46
|
+
* - `state machine` / `stm`;
|
|
47
|
+
* - `use case` / `uc`.
|
|
48
|
+
*
|
|
49
|
+
* `obj` is NOT in that list. Annex A has no frame kind for the object diagram —
|
|
50
|
+
* the standard treats it as a class diagram showing instances — but every tool
|
|
51
|
+
* that draws one tags it `obj`, and an architect reading the sheet expects to
|
|
52
|
+
* see it. So `obj` is kept as a TOOL CONVENTION, recorded as such here so that
|
|
53
|
+
* nobody later "fixes" it against the spec without knowing it was a choice.
|
|
54
|
+
*
|
|
55
|
+
* ## Widening this union is additive
|
|
56
|
+
*
|
|
57
|
+
* Phase 1 shipped the first four kinds below; phase 2 APPENDED `cmp` and `dep`,
|
|
58
|
+
* the two structural frames of §11.6.4 and §19.2.4, then `act` and `stm`, the
|
|
59
|
+
* two behaviour frames of §15.2.4 and §14.2.4; phase 3 appends `sd`. Each
|
|
60
|
+
* arrives as a new VALUE of the existing `kind`
|
|
61
|
+
* string field — no new field, no schema change, no migration and no backfill.
|
|
62
|
+
* The same promise `C4NodeKind` and `BpmnNodeKind` already make.
|
|
63
|
+
*
|
|
64
|
+
* Appended, never reordered: the union is read as a set of strings by every
|
|
65
|
+
* consumer, and a document only ever stores one of them, so the ORDER below is a
|
|
66
|
+
* reading aid. Keeping it chronological is what lets a reviewer see at a glance
|
|
67
|
+
* which build a value arrived in.
|
|
68
|
+
*
|
|
69
|
+
* A value a client has never seen reads back as the string it is, and
|
|
70
|
+
* {@link UmlDiagramElementModel.heading} writes it verbatim, so a document
|
|
71
|
+
* created by a newer build still shows its own heading on an older one.
|
|
72
|
+
*/
|
|
73
|
+
export type UmlDiagramKind = 'class' | 'pkg' | 'obj' | 'uc' | 'cmp' | 'dep' | 'act' | 'stm' | 'sd';
|
|
74
|
+
/**
|
|
75
|
+
* The word written in the heading tag, per kind.
|
|
76
|
+
*
|
|
77
|
+
* A table rather than the raw value so that a kind whose stored discriminant
|
|
78
|
+
* and whose printed tag ever diverge has one place to say so. Today they are
|
|
79
|
+
* the same four strings, and that is worth stating rather than assuming.
|
|
80
|
+
*
|
|
81
|
+
* `Partial` on purpose: a frame read off a document carries whatever string was
|
|
82
|
+
* written there, including a kind from a later phase this build has never heard
|
|
83
|
+
* of. Typing the lookup as total would make {@link
|
|
84
|
+
* UmlDiagramElementModel.heading}'s `?? this.kind` fallback look like dead
|
|
85
|
+
* defensive code, when it is the whole of the append-only promise.
|
|
86
|
+
*/
|
|
87
|
+
export declare const UML_DIAGRAM_KIND_TAG: Partial<Record<UmlDiagramKind, string>>;
|
|
88
|
+
/**
|
|
89
|
+
* Height of a combined fragment's OPERATOR BAND — the strip across its top the
|
|
90
|
+
* pentagon tag is drawn in, in model units.
|
|
91
|
+
*
|
|
92
|
+
* Owned by the model for the reason {@link UML_FRAME_BAND_HEIGHT} is: the
|
|
93
|
+
* fragment's own hit test reads it (a fragment is clickable by its tag strip as
|
|
94
|
+
* well as by its border), and `affine-model` cannot reach into
|
|
95
|
+
* `affine-block-surface` where the declaration is resolved.
|
|
96
|
+
*
|
|
97
|
+
* The diagram frame's own 44, and deliberately: §17.6.4 draws the operator in
|
|
98
|
+
* the very same cut-corner pentagon Annex A draws a frame heading in — it IS a
|
|
99
|
+
* frame, nested in another one — and two numbers for one piece of furniture
|
|
100
|
+
* would drift.
|
|
101
|
+
*/
|
|
102
|
+
export declare const UML_FRAGMENT_BAND = 44;
|
|
103
|
+
/**
|
|
104
|
+
* Height of a partition's NAME BAND — the strip its name is written in, in
|
|
105
|
+
* model units.
|
|
106
|
+
*
|
|
107
|
+
* Declared HERE, in the model, and re-exported by `@labre/affine-gfx-uml`, for
|
|
108
|
+
* the reason {@link UML_FRAME_BAND_HEIGHT} is: the partition's own hit test
|
|
109
|
+
* reads it (a swimlane is clickable by its header as well as by its border),
|
|
110
|
+
* and `affine-model` cannot reach into `affine-block-surface` where the
|
|
111
|
+
* declaration is resolved. One number, owned by the layer that both the
|
|
112
|
+
* declaration and the hit test can read.
|
|
113
|
+
*
|
|
114
|
+
* It is the band's THICKNESS whichever edge the band is on — the top for a
|
|
115
|
+
* vertical lane, the left for a horizontal one — because §15.6.4 draws one
|
|
116
|
+
* header strip and turns it with the lane rather than resizing it.
|
|
117
|
+
*
|
|
118
|
+
* 36 against the diagram frame's 44: a partition header is a name and not a
|
|
119
|
+
* `<kind> <name>` heading, and it is written inside a lane that already sits on
|
|
120
|
+
* a sheet, so it reads as a subdivision rather than as a second sheet.
|
|
121
|
+
*/
|
|
122
|
+
export declare const UML_PARTITION_BAND = 36;
|
|
123
|
+
/**
|
|
124
|
+
* Height of a region's NAME BAND — the strip its name is written in, in model
|
|
125
|
+
* units.
|
|
126
|
+
*
|
|
127
|
+
* Owned by the model for the reason {@link UML_PARTITION_BAND} is: the region's
|
|
128
|
+
* own hit test reads it, and `affine-model` cannot reach into the package where
|
|
129
|
+
* the declaration is resolved. The same 36 the partition uses, and deliberately
|
|
130
|
+
* so — the two are the same piece of furniture, a name written in a strip along
|
|
131
|
+
* the top of a transparent frame, and two numbers would drift.
|
|
132
|
+
*/
|
|
133
|
+
export declare const UML_REGION_BAND = 36;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The UML element constants an interchange reader needs WITHOUT the element
|
|
3
|
+
* classes: moved out of `diagram.ts`, `fragment.ts`, `partition.ts` and `region.ts`
|
|
4
|
+
* unchanged, so the
|
|
5
|
+
* model's headless entry (`@labre/affine-model/headless`) can export them with
|
|
6
|
+
* no `@labre/std/gfx` behind it (ADR 0012, P3 as amended 2026-10-14). The
|
|
7
|
+
* package index re-exports this file, so nothing an importer reads moved.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Height of the diagram frame's heading band — the strip across the top of the
|
|
11
|
+
* frame the `<kind> <name>` tag is written in, in model units.
|
|
12
|
+
*
|
|
13
|
+
* Declared HERE, in the model, and re-exported by `@labre/affine-gfx-uml`
|
|
14
|
+
* rather than the other way round, for the reason `C4_BOARD_TITLE_BAND_HEIGHT`
|
|
15
|
+
* is: the frame's own hit test needs it (a diagram is clickable by its heading
|
|
16
|
+
* band as well as by its border), and `affine-model` cannot reach into
|
|
17
|
+
* `affine-block-surface` where the declaration is resolved. One number, owned
|
|
18
|
+
* by the layer that both the declaration and the hit test can read.
|
|
19
|
+
*
|
|
20
|
+
* It is the frame's TOP MARGIN — the inset the drawing gives up so the heading
|
|
21
|
+
* has somewhere to be written — so the strip that is painted, the strip that is
|
|
22
|
+
* picked and the strip that opens the rename are one number rather than three.
|
|
23
|
+
*
|
|
24
|
+
* 44 is the height of the cut-corner tag UML 2.5.1 Annex A draws the heading
|
|
25
|
+
* in: a 20-unit label with the rest as breathing room above and below.
|
|
26
|
+
* Changing it moves the heading, so it is a visual decision and not a hit-test
|
|
27
|
+
* one.
|
|
28
|
+
*/
|
|
29
|
+
export const UML_FRAME_BAND_HEIGHT = 44;
|
|
30
|
+
/**
|
|
31
|
+
* The word written in the heading tag, per kind.
|
|
32
|
+
*
|
|
33
|
+
* A table rather than the raw value so that a kind whose stored discriminant
|
|
34
|
+
* and whose printed tag ever diverge has one place to say so. Today they are
|
|
35
|
+
* the same four strings, and that is worth stating rather than assuming.
|
|
36
|
+
*
|
|
37
|
+
* `Partial` on purpose: a frame read off a document carries whatever string was
|
|
38
|
+
* written there, including a kind from a later phase this build has never heard
|
|
39
|
+
* of. Typing the lookup as total would make {@link
|
|
40
|
+
* UmlDiagramElementModel.heading}'s `?? this.kind` fallback look like dead
|
|
41
|
+
* defensive code, when it is the whole of the append-only promise.
|
|
42
|
+
*/
|
|
43
|
+
export const UML_DIAGRAM_KIND_TAG = {
|
|
44
|
+
class: 'class',
|
|
45
|
+
pkg: 'pkg',
|
|
46
|
+
obj: 'obj',
|
|
47
|
+
uc: 'uc',
|
|
48
|
+
// Both are Annex A's own abbreviations, written exactly as the Annex writes
|
|
49
|
+
// them — `cmp` for the component diagram, `dep` for the deployment diagram.
|
|
50
|
+
cmp: 'cmp',
|
|
51
|
+
dep: 'dep',
|
|
52
|
+
// Annex A's own abbreviations again — `act` for the activity diagram, `stm`
|
|
53
|
+
// for the state machine diagram. `stm` is the one tag in the table that is
|
|
54
|
+
// NOT the kind spelled out: Annex A's frame kind is the two words `state
|
|
55
|
+
// machine`, and `stm` is the abbreviation it gives in their place.
|
|
56
|
+
act: 'act',
|
|
57
|
+
stm: 'stm',
|
|
58
|
+
// Annex A's abbreviation for the interaction frame, and the third tag in the
|
|
59
|
+
// table that is not the kind spelled out: the frame kind is `interaction`.
|
|
60
|
+
sd: 'sd',
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Height of a combined fragment's OPERATOR BAND — the strip across its top the
|
|
64
|
+
* pentagon tag is drawn in, in model units.
|
|
65
|
+
*
|
|
66
|
+
* Owned by the model for the reason {@link UML_FRAME_BAND_HEIGHT} is: the
|
|
67
|
+
* fragment's own hit test reads it (a fragment is clickable by its tag strip as
|
|
68
|
+
* well as by its border), and `affine-model` cannot reach into
|
|
69
|
+
* `affine-block-surface` where the declaration is resolved.
|
|
70
|
+
*
|
|
71
|
+
* The diagram frame's own 44, and deliberately: §17.6.4 draws the operator in
|
|
72
|
+
* the very same cut-corner pentagon Annex A draws a frame heading in — it IS a
|
|
73
|
+
* frame, nested in another one — and two numbers for one piece of furniture
|
|
74
|
+
* would drift.
|
|
75
|
+
*/
|
|
76
|
+
export const UML_FRAGMENT_BAND = 44;
|
|
77
|
+
/**
|
|
78
|
+
* Height of a partition's NAME BAND — the strip its name is written in, in
|
|
79
|
+
* model units.
|
|
80
|
+
*
|
|
81
|
+
* Declared HERE, in the model, and re-exported by `@labre/affine-gfx-uml`, for
|
|
82
|
+
* the reason {@link UML_FRAME_BAND_HEIGHT} is: the partition's own hit test
|
|
83
|
+
* reads it (a swimlane is clickable by its header as well as by its border),
|
|
84
|
+
* and `affine-model` cannot reach into `affine-block-surface` where the
|
|
85
|
+
* declaration is resolved. One number, owned by the layer that both the
|
|
86
|
+
* declaration and the hit test can read.
|
|
87
|
+
*
|
|
88
|
+
* It is the band's THICKNESS whichever edge the band is on — the top for a
|
|
89
|
+
* vertical lane, the left for a horizontal one — because §15.6.4 draws one
|
|
90
|
+
* header strip and turns it with the lane rather than resizing it.
|
|
91
|
+
*
|
|
92
|
+
* 36 against the diagram frame's 44: a partition header is a name and not a
|
|
93
|
+
* `<kind> <name>` heading, and it is written inside a lane that already sits on
|
|
94
|
+
* a sheet, so it reads as a subdivision rather than as a second sheet.
|
|
95
|
+
*/
|
|
96
|
+
export const UML_PARTITION_BAND = 36;
|
|
97
|
+
/**
|
|
98
|
+
* Height of a region's NAME BAND — the strip its name is written in, in model
|
|
99
|
+
* units.
|
|
100
|
+
*
|
|
101
|
+
* Owned by the model for the reason {@link UML_PARTITION_BAND} is: the region's
|
|
102
|
+
* own hit test reads it, and `affine-model` cannot reach into the package where
|
|
103
|
+
* the declaration is resolved. The same 36 the partition uses, and deliberately
|
|
104
|
+
* so — the two are the same piece of furniture, a name written in a strip along
|
|
105
|
+
* the top of a transparent frame, and two numbers would drift.
|
|
106
|
+
*/
|
|
107
|
+
export const UML_REGION_BAND = 36;
|
|
@@ -2,85 +2,7 @@ import type { SerializedXYWH } from '../../../global/gfx/index.js';
|
|
|
2
2
|
import type { PointTestOptions } from '../../../std/gfx/index.js';
|
|
3
3
|
import type { FrameworkBackgroundProps } from '../framework-background/index.js';
|
|
4
4
|
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
5
|
-
|
|
6
|
-
* Height of the diagram frame's heading band — the strip across the top of the
|
|
7
|
-
* frame the `<kind> <name>` tag is written in, in model units.
|
|
8
|
-
*
|
|
9
|
-
* Declared HERE, in the model, and re-exported by `@labre/affine-gfx-uml`
|
|
10
|
-
* rather than the other way round, for the reason `C4_BOARD_TITLE_BAND_HEIGHT`
|
|
11
|
-
* is: the frame's own hit test needs it (a diagram is clickable by its heading
|
|
12
|
-
* band as well as by its border), and `affine-model` cannot reach into
|
|
13
|
-
* `affine-block-surface` where the declaration is resolved. One number, owned
|
|
14
|
-
* by the layer that both the declaration and the hit test can read.
|
|
15
|
-
*
|
|
16
|
-
* It is the frame's TOP MARGIN — the inset the drawing gives up so the heading
|
|
17
|
-
* has somewhere to be written — so the strip that is painted, the strip that is
|
|
18
|
-
* picked and the strip that opens the rename are one number rather than three.
|
|
19
|
-
*
|
|
20
|
-
* 44 is the height of the cut-corner tag UML 2.5.1 Annex A draws the heading
|
|
21
|
-
* in: a 20-unit label with the rest as breathing room above and below.
|
|
22
|
-
* Changing it moves the heading, so it is a visual decision and not a hit-test
|
|
23
|
-
* one.
|
|
24
|
-
*/
|
|
25
|
-
export declare const UML_FRAME_BAND_HEIGHT = 44;
|
|
26
|
-
/**
|
|
27
|
-
* Which kind of UML diagram this frame draws — the DECLARED fact, as opposed to
|
|
28
|
-
* the name, which is free text and says whatever its author wants it to.
|
|
29
|
-
*
|
|
30
|
-
* ## Where the values come from
|
|
31
|
-
*
|
|
32
|
-
* UML 2.5.1 Annex A gives the normative frame kind names, each with the
|
|
33
|
-
* abbreviation that may be written in its place:
|
|
34
|
-
*
|
|
35
|
-
* - `activity` / `act`;
|
|
36
|
-
* - `class` — the one kind Annex A gives NO abbreviation for, so the word
|
|
37
|
-
* itself is the tag;
|
|
38
|
-
* - `component` / `cmp`;
|
|
39
|
-
* - `deployment` / `dep`;
|
|
40
|
-
* - `interaction` / `sd`;
|
|
41
|
-
* - `package` / `pkg`;
|
|
42
|
-
* - `state machine` / `stm`;
|
|
43
|
-
* - `use case` / `uc`.
|
|
44
|
-
*
|
|
45
|
-
* `obj` is NOT in that list. Annex A has no frame kind for the object diagram —
|
|
46
|
-
* the standard treats it as a class diagram showing instances — but every tool
|
|
47
|
-
* that draws one tags it `obj`, and an architect reading the sheet expects to
|
|
48
|
-
* see it. So `obj` is kept as a TOOL CONVENTION, recorded as such here so that
|
|
49
|
-
* nobody later "fixes" it against the spec without knowing it was a choice.
|
|
50
|
-
*
|
|
51
|
-
* ## Widening this union is additive
|
|
52
|
-
*
|
|
53
|
-
* Phase 1 shipped the first four kinds below; phase 2 APPENDED `cmp` and `dep`,
|
|
54
|
-
* the two structural frames of §11.6.4 and §19.2.4, then `act` and `stm`, the
|
|
55
|
-
* two behaviour frames of §15.2.4 and §14.2.4; phase 3 appends `sd`. Each
|
|
56
|
-
* arrives as a new VALUE of the existing `kind`
|
|
57
|
-
* string field — no new field, no schema change, no migration and no backfill.
|
|
58
|
-
* The same promise `C4NodeKind` and `BpmnNodeKind` already make.
|
|
59
|
-
*
|
|
60
|
-
* Appended, never reordered: the union is read as a set of strings by every
|
|
61
|
-
* consumer, and a document only ever stores one of them, so the ORDER below is a
|
|
62
|
-
* reading aid. Keeping it chronological is what lets a reviewer see at a glance
|
|
63
|
-
* which build a value arrived in.
|
|
64
|
-
*
|
|
65
|
-
* A value a client has never seen reads back as the string it is, and
|
|
66
|
-
* {@link UmlDiagramElementModel.heading} writes it verbatim, so a document
|
|
67
|
-
* created by a newer build still shows its own heading on an older one.
|
|
68
|
-
*/
|
|
69
|
-
export type UmlDiagramKind = 'class' | 'pkg' | 'obj' | 'uc' | 'cmp' | 'dep' | 'act' | 'stm' | 'sd';
|
|
70
|
-
/**
|
|
71
|
-
* The word written in the heading tag, per kind.
|
|
72
|
-
*
|
|
73
|
-
* A table rather than the raw value so that a kind whose stored discriminant
|
|
74
|
-
* and whose printed tag ever diverge has one place to say so. Today they are
|
|
75
|
-
* the same four strings, and that is worth stating rather than assuming.
|
|
76
|
-
*
|
|
77
|
-
* `Partial` on purpose: a frame read off a document carries whatever string was
|
|
78
|
-
* written there, including a kind from a later phase this build has never heard
|
|
79
|
-
* of. Typing the lookup as total would make {@link
|
|
80
|
-
* UmlDiagramElementModel.heading}'s `?? this.kind` fallback look like dead
|
|
81
|
-
* defensive code, when it is the whole of the append-only promise.
|
|
82
|
-
*/
|
|
83
|
-
export declare const UML_DIAGRAM_KIND_TAG: Partial<Record<UmlDiagramKind, string>>;
|
|
5
|
+
import { type UmlDiagramKind } from './consts.js';
|
|
84
6
|
export type UmlDiagramProps = FrameworkBackgroundProps & {
|
|
85
7
|
/** The diagram name, written in the heading tag — edited inline on dblclick. */
|
|
86
8
|
name?: string;
|
|
@@ -35,59 +35,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
35
35
|
import { rotatePoint } from '../../../global/gfx/index.js';
|
|
36
36
|
import { field } from '../../../std/gfx/index.js';
|
|
37
37
|
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
38
|
-
|
|
39
|
-
* Height of the diagram frame's heading band — the strip across the top of the
|
|
40
|
-
* frame the `<kind> <name>` tag is written in, in model units.
|
|
41
|
-
*
|
|
42
|
-
* Declared HERE, in the model, and re-exported by `@labre/affine-gfx-uml`
|
|
43
|
-
* rather than the other way round, for the reason `C4_BOARD_TITLE_BAND_HEIGHT`
|
|
44
|
-
* is: the frame's own hit test needs it (a diagram is clickable by its heading
|
|
45
|
-
* band as well as by its border), and `affine-model` cannot reach into
|
|
46
|
-
* `affine-block-surface` where the declaration is resolved. One number, owned
|
|
47
|
-
* by the layer that both the declaration and the hit test can read.
|
|
48
|
-
*
|
|
49
|
-
* It is the frame's TOP MARGIN — the inset the drawing gives up so the heading
|
|
50
|
-
* has somewhere to be written — so the strip that is painted, the strip that is
|
|
51
|
-
* picked and the strip that opens the rename are one number rather than three.
|
|
52
|
-
*
|
|
53
|
-
* 44 is the height of the cut-corner tag UML 2.5.1 Annex A draws the heading
|
|
54
|
-
* in: a 20-unit label with the rest as breathing room above and below.
|
|
55
|
-
* Changing it moves the heading, so it is a visual decision and not a hit-test
|
|
56
|
-
* one.
|
|
57
|
-
*/
|
|
58
|
-
export const UML_FRAME_BAND_HEIGHT = 44;
|
|
59
|
-
/**
|
|
60
|
-
* The word written in the heading tag, per kind.
|
|
61
|
-
*
|
|
62
|
-
* A table rather than the raw value so that a kind whose stored discriminant
|
|
63
|
-
* and whose printed tag ever diverge has one place to say so. Today they are
|
|
64
|
-
* the same four strings, and that is worth stating rather than assuming.
|
|
65
|
-
*
|
|
66
|
-
* `Partial` on purpose: a frame read off a document carries whatever string was
|
|
67
|
-
* written there, including a kind from a later phase this build has never heard
|
|
68
|
-
* of. Typing the lookup as total would make {@link
|
|
69
|
-
* UmlDiagramElementModel.heading}'s `?? this.kind` fallback look like dead
|
|
70
|
-
* defensive code, when it is the whole of the append-only promise.
|
|
71
|
-
*/
|
|
72
|
-
export const UML_DIAGRAM_KIND_TAG = {
|
|
73
|
-
class: 'class',
|
|
74
|
-
pkg: 'pkg',
|
|
75
|
-
obj: 'obj',
|
|
76
|
-
uc: 'uc',
|
|
77
|
-
// Both are Annex A's own abbreviations, written exactly as the Annex writes
|
|
78
|
-
// them — `cmp` for the component diagram, `dep` for the deployment diagram.
|
|
79
|
-
cmp: 'cmp',
|
|
80
|
-
dep: 'dep',
|
|
81
|
-
// Annex A's own abbreviations again — `act` for the activity diagram, `stm`
|
|
82
|
-
// for the state machine diagram. `stm` is the one tag in the table that is
|
|
83
|
-
// NOT the kind spelled out: Annex A's frame kind is the two words `state
|
|
84
|
-
// machine`, and `stm` is the abbreviation it gives in their place.
|
|
85
|
-
act: 'act',
|
|
86
|
-
stm: 'stm',
|
|
87
|
-
// Annex A's abbreviation for the interaction frame, and the third tag in the
|
|
88
|
-
// table that is not the kind spelled out: the frame kind is `interaction`.
|
|
89
|
-
sd: 'sd',
|
|
90
|
-
};
|
|
38
|
+
import { UML_DIAGRAM_KIND_TAG, UML_FRAME_BAND_HEIGHT, } from './consts.js';
|
|
91
39
|
/**
|
|
92
40
|
* The UML diagram frame: the sheet one diagram is drawn on — a class diagram, a
|
|
93
41
|
* package diagram, an object diagram, a use case diagram, a component diagram, a
|
|
@@ -2,21 +2,6 @@ import type { SerializedXYWH } from '../../../global/gfx/index.js';
|
|
|
2
2
|
import type { PointTestOptions } from '../../../std/gfx/index.js';
|
|
3
3
|
import type { FrameworkBackgroundProps } from '../framework-background/index.js';
|
|
4
4
|
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
5
|
-
/**
|
|
6
|
-
* Height of a combined fragment's OPERATOR BAND — the strip across its top the
|
|
7
|
-
* pentagon tag is drawn in, in model units.
|
|
8
|
-
*
|
|
9
|
-
* Owned by the model for the reason {@link UML_FRAME_BAND_HEIGHT} is: the
|
|
10
|
-
* fragment's own hit test reads it (a fragment is clickable by its tag strip as
|
|
11
|
-
* well as by its border), and `affine-model` cannot reach into
|
|
12
|
-
* `affine-block-surface` where the declaration is resolved.
|
|
13
|
-
*
|
|
14
|
-
* The diagram frame's own 44, and deliberately: §17.6.4 draws the operator in
|
|
15
|
-
* the very same cut-corner pentagon Annex A draws a frame heading in — it IS a
|
|
16
|
-
* frame, nested in another one — and two numbers for one piece of furniture
|
|
17
|
-
* would drift.
|
|
18
|
-
*/
|
|
19
|
-
export declare const UML_FRAGMENT_BAND = 44;
|
|
20
5
|
/**
|
|
21
6
|
* The INTERACTION OPERATOR of a combined fragment — the word written in its
|
|
22
7
|
* pentagon, and the whole of what the fragment says (UML 2.5.1 §17.6.4).
|
|
@@ -35,21 +35,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
35
35
|
import { field } from '../../../std/gfx/index.js';
|
|
36
36
|
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
37
37
|
import { umlInNameBand } from './band.js';
|
|
38
|
-
|
|
39
|
-
* Height of a combined fragment's OPERATOR BAND — the strip across its top the
|
|
40
|
-
* pentagon tag is drawn in, in model units.
|
|
41
|
-
*
|
|
42
|
-
* Owned by the model for the reason {@link UML_FRAME_BAND_HEIGHT} is: the
|
|
43
|
-
* fragment's own hit test reads it (a fragment is clickable by its tag strip as
|
|
44
|
-
* well as by its border), and `affine-model` cannot reach into
|
|
45
|
-
* `affine-block-surface` where the declaration is resolved.
|
|
46
|
-
*
|
|
47
|
-
* The diagram frame's own 44, and deliberately: §17.6.4 draws the operator in
|
|
48
|
-
* the very same cut-corner pentagon Annex A draws a frame heading in — it IS a
|
|
49
|
-
* frame, nested in another one — and two numbers for one piece of furniture
|
|
50
|
-
* would drift.
|
|
51
|
-
*/
|
|
52
|
-
export const UML_FRAGMENT_BAND = 44;
|
|
38
|
+
import { UML_FRAGMENT_BAND } from './consts.js';
|
|
53
39
|
/**
|
|
54
40
|
* A COMBINED FRAGMENT — the rectangle drawn round part of a sequence diagram
|
|
55
41
|
* with an operator in its corner (UML 2.5.1 §17.6.4), and, under the `ref`
|
|
@@ -2,26 +2,6 @@ import type { SerializedXYWH } from '../../../global/gfx/index.js';
|
|
|
2
2
|
import type { PointTestOptions } from '../../../std/gfx/index.js';
|
|
3
3
|
import type { FrameworkBackgroundProps } from '../framework-background/index.js';
|
|
4
4
|
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
5
|
-
/**
|
|
6
|
-
* Height of a partition's NAME BAND — the strip its name is written in, in
|
|
7
|
-
* model units.
|
|
8
|
-
*
|
|
9
|
-
* Declared HERE, in the model, and re-exported by `@labre/affine-gfx-uml`, for
|
|
10
|
-
* the reason {@link UML_FRAME_BAND_HEIGHT} is: the partition's own hit test
|
|
11
|
-
* reads it (a swimlane is clickable by its header as well as by its border),
|
|
12
|
-
* and `affine-model` cannot reach into `affine-block-surface` where the
|
|
13
|
-
* declaration is resolved. One number, owned by the layer that both the
|
|
14
|
-
* declaration and the hit test can read.
|
|
15
|
-
*
|
|
16
|
-
* It is the band's THICKNESS whichever edge the band is on — the top for a
|
|
17
|
-
* vertical lane, the left for a horizontal one — because §15.6.4 draws one
|
|
18
|
-
* header strip and turns it with the lane rather than resizing it.
|
|
19
|
-
*
|
|
20
|
-
* 36 against the diagram frame's 44: a partition header is a name and not a
|
|
21
|
-
* `<kind> <name>` heading, and it is written inside a lane that already sits on
|
|
22
|
-
* a sheet, so it reads as a subdivision rather than as a second sheet.
|
|
23
|
-
*/
|
|
24
|
-
export declare const UML_PARTITION_BAND = 36;
|
|
25
5
|
/**
|
|
26
6
|
* Which way a partition is sliced — the one thing §15.6.4 lets an author choose
|
|
27
7
|
* about a swimlane, and the thing that decides which edge the header is on.
|
|
@@ -35,26 +35,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
35
35
|
import { field } from '../../../std/gfx/index.js';
|
|
36
36
|
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
37
37
|
import { umlInNameBand } from './band.js';
|
|
38
|
-
|
|
39
|
-
* Height of a partition's NAME BAND — the strip its name is written in, in
|
|
40
|
-
* model units.
|
|
41
|
-
*
|
|
42
|
-
* Declared HERE, in the model, and re-exported by `@labre/affine-gfx-uml`, for
|
|
43
|
-
* the reason {@link UML_FRAME_BAND_HEIGHT} is: the partition's own hit test
|
|
44
|
-
* reads it (a swimlane is clickable by its header as well as by its border),
|
|
45
|
-
* and `affine-model` cannot reach into `affine-block-surface` where the
|
|
46
|
-
* declaration is resolved. One number, owned by the layer that both the
|
|
47
|
-
* declaration and the hit test can read.
|
|
48
|
-
*
|
|
49
|
-
* It is the band's THICKNESS whichever edge the band is on — the top for a
|
|
50
|
-
* vertical lane, the left for a horizontal one — because §15.6.4 draws one
|
|
51
|
-
* header strip and turns it with the lane rather than resizing it.
|
|
52
|
-
*
|
|
53
|
-
* 36 against the diagram frame's 44: a partition header is a name and not a
|
|
54
|
-
* `<kind> <name>` heading, and it is written inside a lane that already sits on
|
|
55
|
-
* a sheet, so it reads as a subdivision rather than as a second sheet.
|
|
56
|
-
*/
|
|
57
|
-
export const UML_PARTITION_BAND = 36;
|
|
38
|
+
import { UML_PARTITION_BAND } from './consts.js';
|
|
58
39
|
/**
|
|
59
40
|
* An activity PARTITION — the swimlane of UML 2.5.1 §15.6.4: the strip drawn
|
|
60
41
|
* across an activity diagram saying who (or what) is responsible for the
|
|
@@ -2,17 +2,6 @@ import type { SerializedXYWH } from '../../../global/gfx/index.js';
|
|
|
2
2
|
import type { PointTestOptions } from '../../../std/gfx/index.js';
|
|
3
3
|
import type { FrameworkBackgroundProps } from '../framework-background/index.js';
|
|
4
4
|
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
5
|
-
/**
|
|
6
|
-
* Height of a region's NAME BAND — the strip its name is written in, in model
|
|
7
|
-
* units.
|
|
8
|
-
*
|
|
9
|
-
* Owned by the model for the reason {@link UML_PARTITION_BAND} is: the region's
|
|
10
|
-
* own hit test reads it, and `affine-model` cannot reach into the package where
|
|
11
|
-
* the declaration is resolved. The same 36 the partition uses, and deliberately
|
|
12
|
-
* so — the two are the same piece of furniture, a name written in a strip along
|
|
13
|
-
* the top of a transparent frame, and two numbers would drift.
|
|
14
|
-
*/
|
|
15
|
-
export declare const UML_REGION_BAND = 36;
|
|
16
5
|
export type UmlRegionProps = FrameworkBackgroundProps & {
|
|
17
6
|
/** The state name, written in the band — edited inline on dblclick. */
|
|
18
7
|
name?: string;
|
|
@@ -35,17 +35,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
35
35
|
import { field } from '../../../std/gfx/index.js';
|
|
36
36
|
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
37
37
|
import { umlInNameBand } from './band.js';
|
|
38
|
-
|
|
39
|
-
* Height of a region's NAME BAND — the strip its name is written in, in model
|
|
40
|
-
* units.
|
|
41
|
-
*
|
|
42
|
-
* Owned by the model for the reason {@link UML_PARTITION_BAND} is: the region's
|
|
43
|
-
* own hit test reads it, and `affine-model` cannot reach into the package where
|
|
44
|
-
* the declaration is resolved. The same 36 the partition uses, and deliberately
|
|
45
|
-
* so — the two are the same piece of furniture, a name written in a strip along
|
|
46
|
-
* the top of a transparent frame, and two numbers would drift.
|
|
47
|
-
*/
|
|
48
|
-
export const UML_REGION_BAND = 36;
|
|
38
|
+
import { UML_REGION_BAND } from './consts.js';
|
|
49
39
|
/**
|
|
50
40
|
* A COMPOSITE STATE — the region of UML 2.5.1 §14.2.4: the rounded rectangle
|
|
51
41
|
* drawn round the sub-states of a state that has its own state machine inside
|