@formicoidea/labre-core 0.32.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_pkgs/affine-block-attachment/attachment-block.js +1 -1
- package/dist/_pkgs/affine-block-callout/callout-block.js +1 -1
- package/dist/_pkgs/affine-block-code/code-block-inline.js +1 -1
- package/dist/_pkgs/affine-block-code/code-toolbar/config.js +3 -1
- package/dist/_pkgs/affine-block-code/code-toolbar/index.js +1 -1
- package/dist/_pkgs/affine-block-database/data-source.js +1 -2
- package/dist/_pkgs/affine-block-database/external-data-source.js +1 -1
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-text-block.js +1 -1
- package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.js +1 -1
- package/dist/_pkgs/affine-block-embed/embed-figma-block/embed-figma-service.js +1 -1
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +2 -2
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/toolbar.js +1 -1
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/utils.js +1 -1
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/configs/toolbar.js +1 -1
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-synced-doc-block.js +1 -1
- package/dist/_pkgs/affine-block-frame/frame-manager.js +3 -1
- package/dist/_pkgs/affine-block-frame/frame-tool.js +1 -1
- package/dist/_pkgs/affine-block-image/components/page-image-block.js +1 -1
- package/dist/_pkgs/affine-block-image/image-edgeless-block.js +1 -1
- package/dist/_pkgs/affine-block-list/utils/forward-delete.js +1 -1
- package/dist/_pkgs/affine-block-note/commands/select-block.js +1 -1
- package/dist/_pkgs/affine-block-note/commands/select-blocks-between.js +1 -1
- package/dist/_pkgs/affine-block-note/move-block.js +1 -1
- package/dist/_pkgs/affine-block-paragraph/utils/forward-delete.js +2 -2
- package/dist/_pkgs/affine-block-paragraph/utils/merge-with-prev.js +1 -1
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.js +1 -1
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.js +1 -1
- package/dist/_pkgs/affine-block-root/edgeless/utils/clipboard-utils.js +1 -1
- package/dist/_pkgs/affine-block-surface/adapters/markdown/element-adapter/type.js +1 -1
- package/dist/_pkgs/affine-block-surface/adapters/plain-text/element-adapter/type.js +1 -1
- package/dist/_pkgs/affine-block-surface/element-model/index.d.ts +18 -3
- package/dist/_pkgs/affine-block-surface/element-model/index.js +12 -2
- package/dist/_pkgs/affine-block-surface/extensions/audit.js +23 -6
- package/dist/_pkgs/affine-block-surface/extensions/crud-extension.js +10 -5
- package/dist/_pkgs/affine-block-surface/extensions/editor-anchored-panel.js +2 -1
- package/dist/_pkgs/affine-block-surface/extensions/element-renderer.js +1 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +1 -1
- package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +4 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.js +4 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.d.ts +172 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +393 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +306 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange.js +64 -0
- package/dist/_pkgs/affine-block-surface/extensions/map-quality-widget.js +61 -61
- package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.d.ts +248 -0
- package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.js +248 -0
- package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +78 -80
- package/dist/_pkgs/affine-block-surface/extensions/reading.js +2 -2
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +107 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +958 -0
- package/dist/_pkgs/affine-block-surface/extensions/validation.d.ts +809 -20
- package/dist/_pkgs/affine-block-surface/extensions/validation.js +1661 -50
- package/dist/_pkgs/affine-block-surface/extensions/violation-detail-widget.d.ts +50 -6
- package/dist/_pkgs/affine-block-surface/extensions/violation-detail-widget.js +129 -32
- package/dist/_pkgs/affine-block-surface/framework-background/def.d.ts +289 -0
- package/dist/_pkgs/affine-block-surface/framework-background/def.js +126 -1
- package/dist/_pkgs/affine-block-surface/framework-background/labels.d.ts +42 -2
- package/dist/_pkgs/affine-block-surface/framework-background/labels.js +80 -4
- package/dist/_pkgs/affine-block-surface/framework-background/renderer.js +172 -11
- package/dist/_pkgs/affine-block-surface/renderer/overlay.js +1 -1
- package/dist/_pkgs/affine-block-surface-ref/portal/note.js +2 -2
- package/dist/_pkgs/affine-block-table/commands.js +1 -1
- package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.js +1 -1
- package/dist/_pkgs/affine-components/embed-card-modal/embed-card-edit-modal.js +1 -1
- package/dist/_pkgs/affine-components/filterable-list/styles.js +1 -1
- package/dist/_pkgs/affine-components/peek/peekable.js +1 -1
- package/dist/_pkgs/affine-components/toolbar/index.d.ts +1 -0
- package/dist/_pkgs/affine-components/toolbar/index.js +1 -0
- package/dist/_pkgs/affine-components/toolbar/menu-button.js +1 -1
- package/dist/_pkgs/affine-components/toolbar/picker-menu.d.ts +55 -0
- package/dist/_pkgs/affine-components/toolbar/picker-menu.js +47 -0
- package/dist/_pkgs/affine-fragment-frame-panel/body/frame-panel-body.js +2 -2
- package/dist/_pkgs/affine-fragment-frame-panel/header/frame-panel-header.js +2 -2
- package/dist/_pkgs/affine-fragment-frame-panel/header/frames-setting-menu.js +1 -1
- package/dist/_pkgs/affine-fragment-outline/mobile-outline-panel.js +1 -1
- package/dist/_pkgs/affine-gfx-brush/toolbar/components/pen/pen-tool-button.js +1 -1
- package/dist/_pkgs/affine-gfx-connector/connector-manager.js +7 -10
- package/dist/_pkgs/affine-gfx-connector/connector-tool.d.ts +19 -1
- package/dist/_pkgs/affine-gfx-connector/connector-tool.js +10 -2
- package/dist/_pkgs/affine-gfx-connector/connector-watcher.js +1 -4
- package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.js +2 -1
- package/dist/_pkgs/affine-gfx-connector/direction/invert-direction.js +1 -3
- package/dist/_pkgs/affine-gfx-connector/element-renderer/index.js +1 -1
- package/dist/_pkgs/affine-gfx-connector/element-renderer/utils.js +1 -1
- package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/adapter/markdown/index.js +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/adapter/utils.js +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/templates/index.js +583 -4
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-menu.js +23 -23
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-tool-button.js +5 -1
- package/dist/_pkgs/affine-gfx-mindmap/view/utils.js +1 -1
- package/dist/_pkgs/affine-gfx-note/overlay/overlay.js +1 -1
- package/dist/_pkgs/affine-gfx-note/toolbar/note-senior-button.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/consts.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/draggable/shape-draggable.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/element-renderer/shape/polygon.js +17 -9
- package/dist/_pkgs/affine-gfx-shape/element-renderer/shape/utils.js +8 -3
- package/dist/_pkgs/affine-gfx-shape/element-view.js +19 -12
- package/dist/_pkgs/affine-gfx-shape/overlay/polygon-drawing-overlay.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/overlay/polygon-vertex-editing-overlay.js +12 -7
- package/dist/_pkgs/affine-gfx-shape/overlay/shape-overlay.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/polygon-tool.js +4 -2
- package/dist/_pkgs/affine-gfx-shape/shape-tool.js +1 -1
- package/dist/_pkgs/affine-gfx-shape/text/edgeless-shape-text-editor.js +1 -3
- package/dist/_pkgs/affine-gfx-template/builtin/other.js +66 -17
- package/dist/_pkgs/affine-gfx-template/toolbar/overlay-scrollbar.js +1 -1
- package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.js +1 -1
- package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +1 -1
- package/dist/_pkgs/affine-inline-link/command.js +1 -1
- package/dist/_pkgs/affine-inline-preset/command/format-block.js +1 -1
- package/dist/_pkgs/affine-inline-preset/command/format-native.js +2 -2
- package/dist/_pkgs/affine-inline-preset/command/format-text.js +1 -1
- package/dist/_pkgs/affine-inline-preset/inline-spec.js +1 -1
- package/dist/_pkgs/affine-inline-reference/reference-node/reference-node.js +1 -1
- package/dist/_pkgs/affine-model/elements/bpmn/node.d.ts +40 -7
- package/dist/_pkgs/affine-model/elements/bpmn/node.js +4 -2
- package/dist/_pkgs/affine-model/elements/bpmn/pool.d.ts +74 -17
- package/dist/_pkgs/affine-model/elements/bpmn/pool.js +55 -26
- package/dist/_pkgs/affine-model/elements/c4/board.d.ts +88 -0
- package/dist/_pkgs/affine-model/elements/c4/board.js +128 -0
- package/dist/_pkgs/affine-model/elements/c4/boundary.d.ts +63 -0
- package/dist/_pkgs/affine-model/elements/c4/boundary.js +134 -0
- package/dist/_pkgs/affine-model/elements/c4/index.d.ts +3 -0
- package/dist/_pkgs/affine-model/elements/c4/index.js +3 -0
- package/dist/_pkgs/affine-model/elements/c4/node.d.ts +97 -0
- package/dist/_pkgs/affine-model/elements/c4/node.js +130 -0
- package/dist/_pkgs/affine-model/elements/connector/connector.js +1 -1
- package/dist/_pkgs/affine-model/elements/context-map/context-map.d.ts +27 -0
- package/dist/_pkgs/affine-model/elements/context-map/context-map.js +94 -0
- package/dist/_pkgs/affine-model/elements/context-map/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/context-map/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/core-domain/core-domain.d.ts +34 -17
- package/dist/_pkgs/affine-model/elements/core-domain/core-domain.js +28 -26
- package/dist/_pkgs/affine-model/elements/event-storming/event-storming.d.ts +36 -0
- package/dist/_pkgs/affine-model/elements/event-storming/event-storming.js +103 -0
- package/dist/_pkgs/affine-model/elements/event-storming/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/event-storming/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/index.d.ts +11 -0
- package/dist/_pkgs/affine-model/elements/index.js +3 -0
- package/dist/_pkgs/affine-model/elements/shape/api/polygon.js +2 -8
- package/dist/_pkgs/affine-shared/adapters/html/block-adapter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/markdown/block-adapter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/markdown/delta-converter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/notion-html/block-adapter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/notion-html/delta-converter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/plain-text/block-adapter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/plain-text/delta-converter.js +1 -1
- package/dist/_pkgs/affine-shared/adapters/utils/color.js +5 -2
- package/dist/_pkgs/affine-shared/commands/model-crud/draft-selected-models.js +1 -1
- package/dist/_pkgs/affine-shared/commands/selection/focus-block-end.js +1 -1
- package/dist/_pkgs/affine-shared/commands/selection/focus-block-start.js +1 -1
- package/dist/_pkgs/affine-shared/consts/index.d.ts +10 -0
- package/dist/_pkgs/affine-shared/consts/index.js +10 -0
- package/dist/_pkgs/affine-shared/services/artefact-catalogue-service.d.ts +55 -0
- package/dist/_pkgs/affine-shared/services/artefact-catalogue-service.js +35 -0
- package/dist/_pkgs/affine-shared/services/audit-service.d.ts +11 -0
- package/dist/_pkgs/affine-shared/services/command-usage-service.d.ts +31 -0
- package/dist/_pkgs/affine-shared/services/command-usage-service.js +109 -0
- package/dist/_pkgs/affine-shared/services/comment-service/block-comment-manager.js +1 -1
- package/dist/_pkgs/affine-shared/services/doc-display-meta-service.js +1 -1
- package/dist/_pkgs/affine-shared/services/embed-iframe/embed-iframe-config.js +1 -1
- 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/pivot-materiality-publisher.js +2 -1
- package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +73 -1
- package/dist/_pkgs/affine-shared/services/toolbar-service/registry.d.ts +44 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/registry.js +161 -3
- package/dist/_pkgs/affine-shared/services/universe-tag-defs-service.js +5 -3
- package/dist/_pkgs/affine-shared/test-utils/affine-template.js +1 -1
- package/dist/_pkgs/affine-shared/utils/edgeless.js +1 -1
- package/dist/_pkgs/affine-shared/utils/file/filesys.d.ts +34 -0
- package/dist/_pkgs/affine-shared/utils/file/filesys.js +48 -7
- package/dist/_pkgs/affine-shared/utils/zod-schema.js +1 -3
- package/dist/_pkgs/affine-widget-drag-handle/utils.js +1 -1
- package/dist/_pkgs/affine-widget-edgeless-auto-connect/index.js +1 -1
- package/dist/_pkgs/affine-widget-edgeless-dragging-area/edgeless-dragging-area-rect.js +1 -1
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-default.d.ts +14 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-default.js +40 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.d.ts +158 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +572 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/catalogue-groups.d.ts +46 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/catalogue-groups.js +66 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/chord-format.d.ts +13 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/chord-format.js +50 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/edgeless-toolbar.d.ts +6 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/edgeless-toolbar.js +15 -5
- package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.d.ts +2 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.js +2 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/extension/index.d.ts +7 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/index.d.ts +4 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/index.js +4 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.d.ts +19 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.js +51 -10
- package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +9 -0
- package/dist/_pkgs/affine-widget-keyboard-toolbar/keyboard-tool-panel.js +1 -1
- package/dist/_pkgs/affine-widget-linked-doc/import-doc/import-doc.js +1 -1
- package/dist/_pkgs/affine-widget-linked-doc/linked-doc-popover.js +1 -1
- package/dist/_pkgs/affine-widget-page-dragging-area/index.js +1 -1
- package/dist/_pkgs/affine-widget-remote-selection/doc/doc-remote-selection.js +1 -1
- package/dist/_pkgs/affine-widget-toolbar/toolbar.js +6 -2
- package/dist/_pkgs/affine-widget-toolbar/utils.js +6 -2
- package/dist/_pkgs/data-view/view-presets/calendar/pc/actions.js +8 -12
- package/dist/_pkgs/data-view/view-presets/calendar/pc/view.js +52 -40
- package/dist/_pkgs/data-view/view-presets/table/mobile/group.js +3 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/group.js +3 -1
- package/dist/_pkgs/std/clipboard/utils.js +4 -1
- package/dist/_pkgs/std/extension/command-registry.d.ts +159 -5
- package/dist/_pkgs/std/extension/command-registry.js +202 -4
- package/dist/_pkgs/std/extension/shortcut.js +2 -1
- package/dist/_pkgs/std/gfx/grid.js +1 -1
- package/dist/_pkgs/std/gfx/index.d.ts +1 -1
- package/dist/_pkgs/std/gfx/model/surface/element-model.d.ts +160 -0
- package/dist/_pkgs/std/gfx/model/surface/element-model.js +75 -1
- package/dist/_pkgs/std/gfx/model/surface/role.js +5 -3
- package/dist/_pkgs/std/gfx/model/surface/surface-model.js +2 -1
- package/dist/_pkgs/std/gfx/selection.js +1 -1
- package/dist/_pkgs/std/gfx/viewport.js +1 -1
- package/dist/_pkgs/std/inline/extensions/inline-manager.js +1 -1
- package/dist/_pkgs/std/inline/extensions/markdown-matcher.js +1 -1
- package/dist/_pkgs/store/model/store/crud.js +4 -1
- package/dist/commands.js +1 -1
- package/dist/extensions/command-usage.d.ts +23 -0
- package/dist/extensions/command-usage.js +37 -0
- package/dist/extensions/view.js +12 -0
- package/dist/frameworks.js +32 -0
- package/dist/translations.js +90 -2
- package/package.json +1 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
35
|
+
import { field } from '../../../std/gfx/index.js';
|
|
36
|
+
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
37
|
+
/**
|
|
38
|
+
* A C4 boundary: the dashed rectangle drawn AROUND a group of elements to say
|
|
39
|
+
* "all of this is one system" (or one container). A framework background, so
|
|
40
|
+
* nodes are dropped on it and connectors never snap to it — but a transparent
|
|
41
|
+
* one, unlike every other background in the library: a boundary is drawn over
|
|
42
|
+
* the board it sits on, and an opaque card would hide the diagram it encloses.
|
|
43
|
+
*
|
|
44
|
+
* What it LOOKS like is declared, not coded: see `C4_BOUNDARY_BACKGROUND` in
|
|
45
|
+
* `@labre/affine-gfx-c4`.
|
|
46
|
+
*/
|
|
47
|
+
let C4BoundaryElementModel = (() => {
|
|
48
|
+
let _classSuper = FrameworkBackgroundElementModel;
|
|
49
|
+
let _name_decorators;
|
|
50
|
+
let _name_initializers = [];
|
|
51
|
+
let _name_extraInitializers = [];
|
|
52
|
+
let _resizeEnabled_decorators;
|
|
53
|
+
let _resizeEnabled_initializers = [];
|
|
54
|
+
let _resizeEnabled_extraInitializers = [];
|
|
55
|
+
let _rotate_decorators;
|
|
56
|
+
let _rotate_initializers = [];
|
|
57
|
+
let _rotate_extraInitializers = [];
|
|
58
|
+
let _xywh_decorators;
|
|
59
|
+
let _xywh_initializers = [];
|
|
60
|
+
let _xywh_extraInitializers = [];
|
|
61
|
+
let _variant_decorators;
|
|
62
|
+
let _variant_initializers = [];
|
|
63
|
+
let _variant_extraInitializers = [];
|
|
64
|
+
return class C4BoundaryElementModel extends _classSuper {
|
|
65
|
+
static {
|
|
66
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
67
|
+
_name_decorators = [field('Boundary')];
|
|
68
|
+
_resizeEnabled_decorators = [field(true)];
|
|
69
|
+
_rotate_decorators = [field(0)];
|
|
70
|
+
_xywh_decorators = [field()];
|
|
71
|
+
_variant_decorators = [field()];
|
|
72
|
+
__esDecorate(this, null, _name_decorators, { kind: "accessor", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
|
|
73
|
+
__esDecorate(this, null, _resizeEnabled_decorators, { kind: "accessor", name: "resizeEnabled", static: false, private: false, access: { has: obj => "resizeEnabled" in obj, get: obj => obj.resizeEnabled, set: (obj, value) => { obj.resizeEnabled = value; } }, metadata: _metadata }, _resizeEnabled_initializers, _resizeEnabled_extraInitializers);
|
|
74
|
+
__esDecorate(this, null, _rotate_decorators, { kind: "accessor", name: "rotate", static: false, private: false, access: { has: obj => "rotate" in obj, get: obj => obj.rotate, set: (obj, value) => { obj.rotate = value; } }, metadata: _metadata }, _rotate_initializers, _rotate_extraInitializers);
|
|
75
|
+
__esDecorate(this, null, _xywh_decorators, { kind: "accessor", name: "xywh", static: false, private: false, access: { has: obj => "xywh" in obj, get: obj => obj.xywh, set: (obj, value) => { obj.xywh = value; } }, metadata: _metadata }, _xywh_initializers, _xywh_extraInitializers);
|
|
76
|
+
__esDecorate(this, null, _variant_decorators, { kind: "accessor", name: "variant", static: false, private: false, access: { has: obj => "variant" in obj, get: obj => obj.variant, set: (obj, value) => { obj.variant = value; } }, metadata: _metadata }, _variant_initializers, _variant_extraInitializers);
|
|
77
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
78
|
+
}
|
|
79
|
+
get type() {
|
|
80
|
+
return 'c4Boundary';
|
|
81
|
+
}
|
|
82
|
+
#name_accessor_storage = __runInitializers(this, _name_initializers, 'Boundary');
|
|
83
|
+
get name() { return this.#name_accessor_storage; }
|
|
84
|
+
set name(value) { this.#name_accessor_storage = value; }
|
|
85
|
+
#resizeEnabled_accessor_storage = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _resizeEnabled_initializers, true));
|
|
86
|
+
get resizeEnabled() { return this.#resizeEnabled_accessor_storage; }
|
|
87
|
+
set resizeEnabled(value) { this.#resizeEnabled_accessor_storage = value; }
|
|
88
|
+
#rotate_accessor_storage = (__runInitializers(this, _resizeEnabled_extraInitializers), __runInitializers(this, _rotate_initializers, 0));
|
|
89
|
+
get rotate() { return this.#rotate_accessor_storage; }
|
|
90
|
+
set rotate(value) { this.#rotate_accessor_storage = value; }
|
|
91
|
+
#xywh_accessor_storage = (__runInitializers(this, _rotate_extraInitializers), __runInitializers(this, _xywh_initializers, '[0,0,520,360]'));
|
|
92
|
+
get xywh() { return this.#xywh_accessor_storage; }
|
|
93
|
+
set xywh(value) { this.#xywh_accessor_storage = value; }
|
|
94
|
+
#variant_accessor_storage = (__runInitializers(this, _xywh_extraInitializers), __runInitializers(this, _variant_initializers, undefined));
|
|
95
|
+
/**
|
|
96
|
+
* The level enclosed — the only OPTIONAL field of this element, and optional
|
|
97
|
+
* on purpose.
|
|
98
|
+
*
|
|
99
|
+
* `@field()`'s `init` writes nothing for an `undefined` default, so a boundary
|
|
100
|
+
* that never states its level stays byte-identical to one created before this
|
|
101
|
+
* value existed: no schema version bump, no migration, and every document
|
|
102
|
+
* already on disk opens and paints exactly as it did. The same call
|
|
103
|
+
* `BpmnPoolElementModel.lanes` makes, for the same reason.
|
|
104
|
+
*
|
|
105
|
+
* Absent reads as `'system'` everywhere — the outermost boundary, which is the
|
|
106
|
+
* one a reader draws first and the one the default wording names.
|
|
107
|
+
*/
|
|
108
|
+
get variant() { return this.#variant_accessor_storage; }
|
|
109
|
+
set variant(value) { this.#variant_accessor_storage = value; }
|
|
110
|
+
/**
|
|
111
|
+
* The variant every reader of this element should use — `variant` with its
|
|
112
|
+
* documented default already applied.
|
|
113
|
+
*
|
|
114
|
+
* Derived, not stored: nothing here reaches the document, and an element that
|
|
115
|
+
* never stated a level is untouched by the existence of this getter.
|
|
116
|
+
*
|
|
117
|
+
* It is what lets the declaration gate a piece of itself on the level
|
|
118
|
+
* (`variantProp`), which a raw optional field cannot do: an unstated `variant`
|
|
119
|
+
* stringifies to `"undefined"`, matches no declared variant, and would paint
|
|
120
|
+
* NOTHING — the trap the boundary declaration used to avoid by declaring no
|
|
121
|
+
* `variantProp` at all. Reading the default here removes the trap instead of
|
|
122
|
+
* routing round it, so the frame can finally write the bracket line the
|
|
123
|
+
* stencil puts under a boundary's name.
|
|
124
|
+
*/
|
|
125
|
+
get variantOrDefault() {
|
|
126
|
+
return this.variant ?? 'system';
|
|
127
|
+
}
|
|
128
|
+
constructor() {
|
|
129
|
+
super(...arguments);
|
|
130
|
+
__runInitializers(this, _variant_extraInitializers);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
})();
|
|
134
|
+
export { C4BoundaryElementModel };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { PointTestOptions } from '../../../std/gfx/index.js';
|
|
2
|
+
import { ShapeElementModel } from '../shape/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* The C4 artefacts the pack draws — the four levels of the model, plus the
|
|
5
|
+
* container flavours the official stencil gives a silhouette of their own:
|
|
6
|
+
*
|
|
7
|
+
* - people — `person` and `person-ext`, a head over a rounded body;
|
|
8
|
+
* - systems — `system` and `system-ext`, a plain rounded rectangle;
|
|
9
|
+
* - containers — `container`, plus `database` (a cylinder), `mobile` (a
|
|
10
|
+
* phone bezel down the leading edge) and `browser` (a chrome band across the
|
|
11
|
+
* top). All four are CONTAINERS: what differs is the picture, never the
|
|
12
|
+
* level;
|
|
13
|
+
* - components — `component`, the innermost level C4 draws.
|
|
14
|
+
*
|
|
15
|
+
* ## Why "external" is a KIND and not a flag
|
|
16
|
+
*
|
|
17
|
+
* `person-ext` and `system-ext` are separate values rather than an `external`
|
|
18
|
+
* boolean, mirroring {@link BpmnNodeKind}'s message and timer starts: the C4
|
|
19
|
+
* stencil greys an external element out entirely — fill, border and label — so
|
|
20
|
+
* externality is a different picture, not a modifier on one. One discriminant
|
|
21
|
+
* keeps the renderer's switch total and the size / palette tables keyed the same
|
|
22
|
+
* way; a second, orthogonal flag would multiply both by two and let a
|
|
23
|
+
* combination exist that the notation has no drawing for.
|
|
24
|
+
*
|
|
25
|
+
* ## Compatibility
|
|
26
|
+
*
|
|
27
|
+
* This union is only ever WIDENED, and it is widened with new VALUES of the
|
|
28
|
+
* existing `kind` string field — no new field, no schema change, no migration
|
|
29
|
+
* and no backfill. Same promise `wardley` and `bpmn` already make.
|
|
30
|
+
*/
|
|
31
|
+
export type C4NodeKind = 'person' | 'person-ext' | 'system' | 'system-ext' | 'container' | 'database' | 'mobile' | 'browser' | 'component';
|
|
32
|
+
/**
|
|
33
|
+
* A C4 node. Extends {@link ShapeElementModel} (a native shape) so it inherits
|
|
34
|
+
* ALL shape behaviour — editable stroke width / colours, inner text, native
|
|
35
|
+
* resize, the shape context toolbar — for free. `kind` discriminates the
|
|
36
|
+
* artefacts and drives the RENDERING alone; what a node MEANS is the `role`
|
|
37
|
+
* stamped on it at creation (`gfx/c4/src/roles.ts`).
|
|
38
|
+
*
|
|
39
|
+
* Mirrors {@link BpmnNodeElementModel}.
|
|
40
|
+
*/
|
|
41
|
+
export declare class C4NodeElementModel extends ShapeElementModel {
|
|
42
|
+
get type(): string;
|
|
43
|
+
/**
|
|
44
|
+
* Connector anchors are restricted to the centre, as they are for a BPMN flow
|
|
45
|
+
* object: a C4 relationship attaches to the node centre and clips at the
|
|
46
|
+
* perimeter, so an arrow between two boxes points at the boxes rather than at
|
|
47
|
+
* whichever of their twelve anchors the hand was nearest.
|
|
48
|
+
*/
|
|
49
|
+
get centerAnchorOnly(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* A C4 node is SOLID whatever its `filled` flag says.
|
|
52
|
+
*
|
|
53
|
+
* `rect.includesPoint` (and `ellipse`'s, and `diamond`'s) skips the interior
|
|
54
|
+
* test for an unfilled shape and falls back to the stroke plus the tight
|
|
55
|
+
* bounding box of the text run — the behaviour that makes a hollow group let
|
|
56
|
+
* clicks through to the work it encloses. Three of the nine C4 kinds are
|
|
57
|
+
* created unfilled and unstroked on purpose (`person`, `person-ext`,
|
|
58
|
+
* `database`, and the two decorated containers): their silhouette is a head
|
|
59
|
+
* over a body, a cylinder, a phone or a browser window, none of which a native
|
|
60
|
+
* rect can be, so the GLYPH paints the body and the native shape paints
|
|
61
|
+
* nothing at all.
|
|
62
|
+
*
|
|
63
|
+
* The consequence, reported by the PO on 27/08/2026, is that those nodes could
|
|
64
|
+
* not be double-clicked into their own text editor: the body a user can
|
|
65
|
+
* plainly see was not a hit target, and only the border and the handful of
|
|
66
|
+
* characters of the label were. Pointer events reach an element view through
|
|
67
|
+
* this method (`GfxViewEventHandler`), so selecting, hovering, dragging and
|
|
68
|
+
* `dblclick` were all affected — the last one visibly.
|
|
69
|
+
*
|
|
70
|
+
* Forcing `ignoreTransparent: false` says the one thing that is true of every
|
|
71
|
+
* C4 artefact and of no BPMN group: it is a BOX, and its whole area belongs to
|
|
72
|
+
* it. Nothing here is stored — the override changes hit testing, never the
|
|
73
|
+
* document — so it applies to nodes drawn before it existed as well as after.
|
|
74
|
+
*
|
|
75
|
+
* The same latent gap exists for BPMN's `dataObject` / `dataStore`; it is not
|
|
76
|
+
* fixed there because a BPMN artifact's own answer may well be different (its
|
|
77
|
+
* `hollow` kinds want the click-through), and guessing on another pack's
|
|
78
|
+
* behalf is how a fix becomes a regression.
|
|
79
|
+
*/
|
|
80
|
+
includesPoint(x: number, y: number, options: PointTestOptions): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* The one field a C4 node carries, and the whole of its schema.
|
|
83
|
+
*
|
|
84
|
+
* The two other tiers of the notation — the type line and the description —
|
|
85
|
+
* are deliberately NOT fields here. They are canvas TEXT elements, grouped
|
|
86
|
+
* with the shape, and they are edited in place exactly like any other words on
|
|
87
|
+
* the canvas (PO recette, 28/08/2026). A field would have been a second place
|
|
88
|
+
* to write the same sentence, reachable only through a form, and the form is
|
|
89
|
+
* the mechanism the recette rejected: an architect writes on the picture.
|
|
90
|
+
*
|
|
91
|
+
* What that buys the document format is that this model stays exactly what it
|
|
92
|
+
* was — `kind`, on a native shape — while the component grows two more tiers.
|
|
93
|
+
* See `gfx/c4/src/actions.ts` for how the group is assembled and
|
|
94
|
+
* `gfx/c4/src/export.ts` for how it is read back.
|
|
95
|
+
*/
|
|
96
|
+
accessor kind: C4NodeKind;
|
|
97
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
35
|
+
import { field } from '../../../std/gfx/index.js';
|
|
36
|
+
import { ShapeElementModel } from '../shape/index.js';
|
|
37
|
+
/**
|
|
38
|
+
* A C4 node. Extends {@link ShapeElementModel} (a native shape) so it inherits
|
|
39
|
+
* ALL shape behaviour — editable stroke width / colours, inner text, native
|
|
40
|
+
* resize, the shape context toolbar — for free. `kind` discriminates the
|
|
41
|
+
* artefacts and drives the RENDERING alone; what a node MEANS is the `role`
|
|
42
|
+
* stamped on it at creation (`gfx/c4/src/roles.ts`).
|
|
43
|
+
*
|
|
44
|
+
* Mirrors {@link BpmnNodeElementModel}.
|
|
45
|
+
*/
|
|
46
|
+
let C4NodeElementModel = (() => {
|
|
47
|
+
let _classSuper = ShapeElementModel;
|
|
48
|
+
let _kind_decorators;
|
|
49
|
+
let _kind_initializers = [];
|
|
50
|
+
let _kind_extraInitializers = [];
|
|
51
|
+
return class C4NodeElementModel extends _classSuper {
|
|
52
|
+
static {
|
|
53
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
54
|
+
_kind_decorators = [field('system')];
|
|
55
|
+
__esDecorate(this, null, _kind_decorators, { kind: "accessor", name: "kind", static: false, private: false, access: { has: obj => "kind" in obj, get: obj => obj.kind, set: (obj, value) => { obj.kind = value; } }, metadata: _metadata }, _kind_initializers, _kind_extraInitializers);
|
|
56
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
57
|
+
}
|
|
58
|
+
get type() {
|
|
59
|
+
return 'c4Node';
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Connector anchors are restricted to the centre, as they are for a BPMN flow
|
|
63
|
+
* object: a C4 relationship attaches to the node centre and clips at the
|
|
64
|
+
* perimeter, so an arrow between two boxes points at the boxes rather than at
|
|
65
|
+
* whichever of their twelve anchors the hand was nearest.
|
|
66
|
+
*/
|
|
67
|
+
get centerAnchorOnly() {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A C4 node is SOLID whatever its `filled` flag says.
|
|
72
|
+
*
|
|
73
|
+
* `rect.includesPoint` (and `ellipse`'s, and `diamond`'s) skips the interior
|
|
74
|
+
* test for an unfilled shape and falls back to the stroke plus the tight
|
|
75
|
+
* bounding box of the text run — the behaviour that makes a hollow group let
|
|
76
|
+
* clicks through to the work it encloses. Three of the nine C4 kinds are
|
|
77
|
+
* created unfilled and unstroked on purpose (`person`, `person-ext`,
|
|
78
|
+
* `database`, and the two decorated containers): their silhouette is a head
|
|
79
|
+
* over a body, a cylinder, a phone or a browser window, none of which a native
|
|
80
|
+
* rect can be, so the GLYPH paints the body and the native shape paints
|
|
81
|
+
* nothing at all.
|
|
82
|
+
*
|
|
83
|
+
* The consequence, reported by the PO on 27/08/2026, is that those nodes could
|
|
84
|
+
* not be double-clicked into their own text editor: the body a user can
|
|
85
|
+
* plainly see was not a hit target, and only the border and the handful of
|
|
86
|
+
* characters of the label were. Pointer events reach an element view through
|
|
87
|
+
* this method (`GfxViewEventHandler`), so selecting, hovering, dragging and
|
|
88
|
+
* `dblclick` were all affected — the last one visibly.
|
|
89
|
+
*
|
|
90
|
+
* Forcing `ignoreTransparent: false` says the one thing that is true of every
|
|
91
|
+
* C4 artefact and of no BPMN group: it is a BOX, and its whole area belongs to
|
|
92
|
+
* it. Nothing here is stored — the override changes hit testing, never the
|
|
93
|
+
* document — so it applies to nodes drawn before it existed as well as after.
|
|
94
|
+
*
|
|
95
|
+
* The same latent gap exists for BPMN's `dataObject` / `dataStore`; it is not
|
|
96
|
+
* fixed there because a BPMN artifact's own answer may well be different (its
|
|
97
|
+
* `hollow` kinds want the click-through), and guessing on another pack's
|
|
98
|
+
* behalf is how a fix becomes a regression.
|
|
99
|
+
*/
|
|
100
|
+
includesPoint(x, y, options) {
|
|
101
|
+
return super.includesPoint(x, y, {
|
|
102
|
+
...options,
|
|
103
|
+
ignoreTransparent: false,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
#kind_accessor_storage = __runInitializers(this, _kind_initializers, 'system');
|
|
107
|
+
/**
|
|
108
|
+
* The one field a C4 node carries, and the whole of its schema.
|
|
109
|
+
*
|
|
110
|
+
* The two other tiers of the notation — the type line and the description —
|
|
111
|
+
* are deliberately NOT fields here. They are canvas TEXT elements, grouped
|
|
112
|
+
* with the shape, and they are edited in place exactly like any other words on
|
|
113
|
+
* the canvas (PO recette, 28/08/2026). A field would have been a second place
|
|
114
|
+
* to write the same sentence, reachable only through a form, and the form is
|
|
115
|
+
* the mechanism the recette rejected: an architect writes on the picture.
|
|
116
|
+
*
|
|
117
|
+
* What that buys the document format is that this model stays exactly what it
|
|
118
|
+
* was — `kind`, on a native shape — while the component grows two more tiers.
|
|
119
|
+
* See `gfx/c4/src/actions.ts` for how the group is assembled and
|
|
120
|
+
* `gfx/c4/src/export.ts` for how it is read back.
|
|
121
|
+
*/
|
|
122
|
+
get kind() { return this.#kind_accessor_storage; }
|
|
123
|
+
set kind(value) { this.#kind_accessor_storage = value; }
|
|
124
|
+
constructor() {
|
|
125
|
+
super(...arguments);
|
|
126
|
+
__runInitializers(this, _kind_extraInitializers);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
})();
|
|
130
|
+
export { C4NodeElementModel };
|
|
@@ -33,7 +33,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
35
|
import { Bound, curveIntersects, getBezierNearestPoint, getBezierNearestTime, getBezierParameters, getBezierPoint, linePolylineIntersects, PointLocation, Polyline, polyLineNearestPoint, Vec, } from '../../../global/gfx/index.js';
|
|
36
|
-
import { derive, field, GfxPrimitiveElementModel, local
|
|
36
|
+
import { derive, field, GfxPrimitiveElementModel, local } from '../../../std/gfx/index.js';
|
|
37
37
|
import * as Y from 'yjs';
|
|
38
38
|
import { CONNECTOR_LABEL_MAX_WIDTH, ConnectorLabelOffsetAnchor, ConnectorMode, DEFAULT_CONNECTOR_MODE, DEFAULT_ROUGHNESS, FontFamily, FontStyle, FontWeight, StrokeStyle, TextAlign, } from '../../consts/index.js';
|
|
39
39
|
import { DefaultTheme } from '../../themes/index.js';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { SerializedXYWH } from '../../../global/gfx/index.js';
|
|
2
|
+
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
3
|
+
import type { FrameworkBackgroundProps } from '../framework-background/index.js';
|
|
4
|
+
export type ContextMapBoardProps = FrameworkBackgroundProps;
|
|
5
|
+
/**
|
|
6
|
+
* The Context Map board: the white card a Context Map is drawn ON.
|
|
7
|
+
*
|
|
8
|
+
* Deliberately the emptiest background in the library — no axis, no zone, no
|
|
9
|
+
* label. A Context Map has no frame of reference: nothing about where a bounded
|
|
10
|
+
* context sits on the sheet means anything, and drawing graduations would invent
|
|
11
|
+
* a semantic the framework does not have. What the board IS for is the FRAME:
|
|
12
|
+
* it carries the `context-map:board` role, which is what lets a rule say "this
|
|
13
|
+
* context is off the map" and what gives a per-map validation profile something
|
|
14
|
+
* to be written on.
|
|
15
|
+
*
|
|
16
|
+
* Adds no field of its own beyond the primitive's `resizeEnabled`, so a board is
|
|
17
|
+
* byte-identical to what {@link FrameworkBackgroundElementModel} already
|
|
18
|
+
* persists. It is created 1400 × 900 and freely resizable in both directions —
|
|
19
|
+
* a context map grows sideways as contexts are found, and locking its
|
|
20
|
+
* proportion would fight the hand.
|
|
21
|
+
*/
|
|
22
|
+
export declare class ContextMapBoardElementModel extends FrameworkBackgroundElementModel<ContextMapBoardProps> {
|
|
23
|
+
get type(): string;
|
|
24
|
+
accessor resizeEnabled: boolean;
|
|
25
|
+
accessor rotate: number;
|
|
26
|
+
accessor xywh: SerializedXYWH;
|
|
27
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
35
|
+
import { field } from '../../../std/gfx/index.js';
|
|
36
|
+
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
37
|
+
/**
|
|
38
|
+
* The Context Map board: the white card a Context Map is drawn ON.
|
|
39
|
+
*
|
|
40
|
+
* Deliberately the emptiest background in the library — no axis, no zone, no
|
|
41
|
+
* label. A Context Map has no frame of reference: nothing about where a bounded
|
|
42
|
+
* context sits on the sheet means anything, and drawing graduations would invent
|
|
43
|
+
* a semantic the framework does not have. What the board IS for is the FRAME:
|
|
44
|
+
* it carries the `context-map:board` role, which is what lets a rule say "this
|
|
45
|
+
* context is off the map" and what gives a per-map validation profile something
|
|
46
|
+
* to be written on.
|
|
47
|
+
*
|
|
48
|
+
* Adds no field of its own beyond the primitive's `resizeEnabled`, so a board is
|
|
49
|
+
* byte-identical to what {@link FrameworkBackgroundElementModel} already
|
|
50
|
+
* persists. It is created 1400 × 900 and freely resizable in both directions —
|
|
51
|
+
* a context map grows sideways as contexts are found, and locking its
|
|
52
|
+
* proportion would fight the hand.
|
|
53
|
+
*/
|
|
54
|
+
let ContextMapBoardElementModel = (() => {
|
|
55
|
+
let _classSuper = FrameworkBackgroundElementModel;
|
|
56
|
+
let _resizeEnabled_decorators;
|
|
57
|
+
let _resizeEnabled_initializers = [];
|
|
58
|
+
let _resizeEnabled_extraInitializers = [];
|
|
59
|
+
let _rotate_decorators;
|
|
60
|
+
let _rotate_initializers = [];
|
|
61
|
+
let _rotate_extraInitializers = [];
|
|
62
|
+
let _xywh_decorators;
|
|
63
|
+
let _xywh_initializers = [];
|
|
64
|
+
let _xywh_extraInitializers = [];
|
|
65
|
+
return class ContextMapBoardElementModel extends _classSuper {
|
|
66
|
+
static {
|
|
67
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
68
|
+
_resizeEnabled_decorators = [field(true)];
|
|
69
|
+
_rotate_decorators = [field(0)];
|
|
70
|
+
_xywh_decorators = [field()];
|
|
71
|
+
__esDecorate(this, null, _resizeEnabled_decorators, { kind: "accessor", name: "resizeEnabled", static: false, private: false, access: { has: obj => "resizeEnabled" in obj, get: obj => obj.resizeEnabled, set: (obj, value) => { obj.resizeEnabled = value; } }, metadata: _metadata }, _resizeEnabled_initializers, _resizeEnabled_extraInitializers);
|
|
72
|
+
__esDecorate(this, null, _rotate_decorators, { kind: "accessor", name: "rotate", static: false, private: false, access: { has: obj => "rotate" in obj, get: obj => obj.rotate, set: (obj, value) => { obj.rotate = value; } }, metadata: _metadata }, _rotate_initializers, _rotate_extraInitializers);
|
|
73
|
+
__esDecorate(this, null, _xywh_decorators, { kind: "accessor", name: "xywh", static: false, private: false, access: { has: obj => "xywh" in obj, get: obj => obj.xywh, set: (obj, value) => { obj.xywh = value; } }, metadata: _metadata }, _xywh_initializers, _xywh_extraInitializers);
|
|
74
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
75
|
+
}
|
|
76
|
+
get type() {
|
|
77
|
+
return 'contextMap';
|
|
78
|
+
}
|
|
79
|
+
#resizeEnabled_accessor_storage = __runInitializers(this, _resizeEnabled_initializers, true);
|
|
80
|
+
get resizeEnabled() { return this.#resizeEnabled_accessor_storage; }
|
|
81
|
+
set resizeEnabled(value) { this.#resizeEnabled_accessor_storage = value; }
|
|
82
|
+
#rotate_accessor_storage = (__runInitializers(this, _resizeEnabled_extraInitializers), __runInitializers(this, _rotate_initializers, 0));
|
|
83
|
+
get rotate() { return this.#rotate_accessor_storage; }
|
|
84
|
+
set rotate(value) { this.#rotate_accessor_storage = value; }
|
|
85
|
+
#xywh_accessor_storage = (__runInitializers(this, _rotate_extraInitializers), __runInitializers(this, _xywh_initializers, '[0,0,1400,900]'));
|
|
86
|
+
get xywh() { return this.#xywh_accessor_storage; }
|
|
87
|
+
set xywh(value) { this.#xywh_accessor_storage = value; }
|
|
88
|
+
constructor() {
|
|
89
|
+
super(...arguments);
|
|
90
|
+
__runInitializers(this, _xywh_extraInitializers);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
})();
|
|
94
|
+
export { ContextMapBoardElementModel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './context-map.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './context-map.js';
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type { SerializedXYWH } from '../../../global/gfx/index.js';
|
|
2
|
+
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
3
|
+
import type { FrameworkBackgroundProps } from '../framework-background/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Which READING of the chart this instance is turned to.
|
|
6
|
+
*
|
|
7
|
+
* `classic` is the DDD Crew chart everybody knows — Generic / Supporting / Core
|
|
8
|
+
* over Complexity × Business differentiation. `migration` keeps the very same
|
|
9
|
+
* frame and names its four quadrants after the migration conversation instead
|
|
10
|
+
* (low-hanging fruit, risk-seeking, risk-averse, last toothpaste), which is why
|
|
11
|
+
* it is a variant of one background and not a second element type.
|
|
12
|
+
*/
|
|
13
|
+
export type CoreDomainVariant = 'classic' | 'migration';
|
|
14
|
+
export type CoreDomainChartProps = FrameworkBackgroundProps & {
|
|
8
15
|
/** When false the translucent Core / Supporting / Generic zone bands are hidden. */
|
|
9
16
|
showZones?: boolean;
|
|
10
17
|
/** When false the axis titles, Low/High ticks and zone names are hidden. */
|
|
11
18
|
showLabels?: boolean;
|
|
19
|
+
/** Which reading of the chart is drawn. */
|
|
20
|
+
variant?: CoreDomainVariant;
|
|
12
21
|
};
|
|
13
22
|
/**
|
|
14
23
|
* The Core Domain Chart background (DDD Crew): the two axes (Complexity ×
|
|
@@ -16,21 +25,29 @@ export type CoreDomainChartProps = BaseElementProps & {
|
|
|
16
25
|
* Generic / Supporting / Core zone bands. The user places sub-domain dots,
|
|
17
26
|
* movement arrows and the Notation legend on top of it.
|
|
18
27
|
*
|
|
19
|
-
*
|
|
20
|
-
* {@link
|
|
21
|
-
*
|
|
22
|
-
*
|
|
28
|
+
* An INSTANCE of the framework-background primitive
|
|
29
|
+
* ({@link FrameworkBackgroundElementModel}): the geometry and the passive-canvas
|
|
30
|
+
* behaviour come from the primitive — which declares the very same
|
|
31
|
+
* `connectable` getter and the very same four geometry overrides this class
|
|
32
|
+
* used to spell out — and what the chart LOOKS like comes from the
|
|
33
|
+
* `CORE_DOMAIN_BACKGROUND` declaration in `@labre/affine-gfx-ddd-core-domain`.
|
|
34
|
+
*
|
|
35
|
+
* The fields below are the persisted document and are NOT the primitive's
|
|
36
|
+
* business: the base swap adds no field, renames none and changes no default,
|
|
37
|
+
* so a chart authored before it is byte-identical to one authored after.
|
|
23
38
|
*/
|
|
24
|
-
export declare class CoreDomainChartElementModel extends
|
|
39
|
+
export declare class CoreDomainChartElementModel extends FrameworkBackgroundElementModel<CoreDomainChartProps> {
|
|
25
40
|
get type(): string;
|
|
26
|
-
get connectable(): boolean;
|
|
27
|
-
containsBound(bounds: Bound): boolean;
|
|
28
|
-
getLineIntersections(start: IVec, end: IVec): import("../../../global/gfx/index.js").PointLocation[] | null;
|
|
29
|
-
getNearestPoint(point: IVec): IVec;
|
|
30
|
-
includesPoint(x: number, y: number): boolean;
|
|
31
41
|
accessor resizeEnabled: boolean;
|
|
32
42
|
accessor showZones: boolean;
|
|
33
43
|
accessor showLabels: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* A HARD default, on the Wardley `variant` pattern: `classic` is written into
|
|
46
|
+
* the Y.Map at creation and is also what an older chart — which carries no
|
|
47
|
+
* such key at all — reads back as. Both roads lead to the chart the user has
|
|
48
|
+
* always seen, so the field ships with no migration and no backfill.
|
|
49
|
+
*/
|
|
50
|
+
accessor variant: CoreDomainVariant;
|
|
34
51
|
accessor rotate: number;
|
|
35
52
|
accessor xywh: SerializedXYWH;
|
|
36
53
|
}
|