@formicoidea/labre-framework-wardley 0.23.1 → 0.23.3
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/consts.d.ts +0 -1
- package/dist/consts.js +0 -1
- package/dist/descriptor.d.ts +4 -4
- package/dist/descriptor.js +3 -4
- package/dist/effects.d.ts +0 -1
- package/dist/effects.js +0 -1
- package/dist/element-renderer.d.ts +1 -2
- package/dist/element-renderer.js +0 -1
- package/dist/element-view.d.ts +0 -1
- package/dist/element-view.js +0 -1
- package/dist/gradient.d.ts +0 -1
- package/dist/gradient.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/label-layout.d.ts +0 -1
- package/dist/label-layout.js +0 -1
- package/dist/legend.d.ts +0 -1
- package/dist/legend.js +0 -1
- package/dist/node/consts.d.ts +0 -1
- package/dist/node/consts.js +0 -1
- package/dist/node/node-renderer.d.ts +1 -2
- package/dist/node/node-renderer.js +0 -1
- package/dist/node/node-view.d.ts +0 -1
- package/dist/node/node-view.js +0 -1
- package/dist/templates/index.d.ts +0 -1
- package/dist/templates/index.js +0 -1
- package/dist/templates/maps.d.ts +0 -1
- package/dist/templates/maps.js +0 -1
- package/dist/toolbar/config.d.ts +0 -1
- package/dist/toolbar/config.js +101 -102
- package/dist/toolbar/icons.d.ts +0 -1
- package/dist/toolbar/icons.js +0 -1
- package/dist/toolbar/node-config.d.ts +0 -1
- package/dist/toolbar/node-config.js +0 -1
- package/dist/toolbar/senior-tool.d.ts +0 -1
- package/dist/toolbar/senior-tool.js +2 -3
- package/dist/toolbar/wardley-menu.d.ts +1 -2
- package/dist/toolbar/wardley-menu.js +106 -107
- package/dist/toolbar/wardley-senior-button.d.ts +1 -2
- package/dist/toolbar/wardley-senior-button.js +56 -57
- package/dist/view.d.ts +0 -1
- package/dist/view.js +0 -1
- package/package.json +2 -2
- package/dist/node/label-editor.d.ts +0 -28
- package/dist/node/label-editor.js +0 -216
- package/dist/toolbar/wardley-tool-button.d.ts +0 -10
- package/dist/toolbar/wardley-tool-button.js +0 -123
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
-
function accept(f) {
|
|
3
|
-
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
4
|
-
return f;
|
|
5
|
-
}
|
|
6
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
7
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
8
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
9
|
-
var _, done = false;
|
|
10
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
11
|
-
var context = {};
|
|
12
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
13
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
14
|
-
context.addInitializer = function(f) {
|
|
15
|
-
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
16
|
-
extraInitializers.push(accept(f || null));
|
|
17
|
-
};
|
|
18
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
19
|
-
if (kind === "accessor") {
|
|
20
|
-
if (result === void 0) continue;
|
|
21
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
22
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
23
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
24
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
25
|
-
} else if (_ = accept(result)) {
|
|
26
|
-
if (kind === "field") initializers.unshift(_);
|
|
27
|
-
else descriptor[key] = _;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
31
|
-
done = true;
|
|
32
|
-
};
|
|
33
|
-
var __runInitializers = function(thisArg, initializers, value) {
|
|
34
|
-
var useValue = arguments.length > 2;
|
|
35
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
36
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
37
|
-
}
|
|
38
|
-
return useValue ? value : void 0;
|
|
39
|
-
};
|
|
40
|
-
import { Bound } from "@blocksuite/global/gfx";
|
|
41
|
-
import { css, html, LitElement } from "lit";
|
|
42
|
-
import { property } from "lit/decorators.js";
|
|
43
|
-
import { REF_WIDTH } from "../consts";
|
|
44
|
-
const WardleyIcon = html`<svg
|
|
45
|
-
width="24"
|
|
46
|
-
height="24"
|
|
47
|
-
viewBox="0 0 24 24"
|
|
48
|
-
fill="none"
|
|
49
|
-
stroke="currentColor"
|
|
50
|
-
stroke-width="1.6"
|
|
51
|
-
stroke-linecap="round"
|
|
52
|
-
stroke-linejoin="round"
|
|
53
|
-
>
|
|
54
|
-
<path d="M5 4v15h15" />
|
|
55
|
-
<path d="M10 9l6 5" stroke-width="1.1" />
|
|
56
|
-
<circle cx="10" cy="9" r="1.4" fill="currentColor" stroke="none" />
|
|
57
|
-
<circle cx="16" cy="14" r="1.4" fill="currentColor" stroke="none" />
|
|
58
|
-
</svg>`;
|
|
59
|
-
let EdgelessWardleyToolButton = (() => {
|
|
60
|
-
let _classSuper = LitElement;
|
|
61
|
-
let _gfx_decorators;
|
|
62
|
-
let _gfx_initializers = [];
|
|
63
|
-
let _gfx_extraInitializers = [];
|
|
64
|
-
return class EdgelessWardleyToolButton extends _classSuper {
|
|
65
|
-
static {
|
|
66
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
67
|
-
_gfx_decorators = [property({ attribute: false })];
|
|
68
|
-
__esDecorate(this, null, _gfx_decorators, { kind: "accessor", name: "gfx", static: false, private: false, access: { has: (obj) => "gfx" in obj, get: (obj) => obj.gfx, set: (obj, value) => {
|
|
69
|
-
obj.gfx = value;
|
|
70
|
-
} }, metadata: _metadata }, _gfx_initializers, _gfx_extraInitializers);
|
|
71
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
72
|
-
}
|
|
73
|
-
static {
|
|
74
|
-
this.styles = css`
|
|
75
|
-
:host {
|
|
76
|
-
display: flex;
|
|
77
|
-
}
|
|
78
|
-
`;
|
|
79
|
-
}
|
|
80
|
-
_addWardley() {
|
|
81
|
-
const { gfx } = this;
|
|
82
|
-
if (!gfx?.surface)
|
|
83
|
-
return;
|
|
84
|
-
let width = REF_WIDTH;
|
|
85
|
-
for (const el of gfx.surface.getElementsByType("wardley")) {
|
|
86
|
-
const [, , ew, eh] = el.deserializedXYWH;
|
|
87
|
-
const effWidth = Math.max(ew, eh * 16 / 9);
|
|
88
|
-
if (effWidth > width)
|
|
89
|
-
width = effWidth;
|
|
90
|
-
}
|
|
91
|
-
const height = width * 9 / 16;
|
|
92
|
-
const { centerX, centerY } = gfx.viewport;
|
|
93
|
-
const id = gfx.surface.addElement({
|
|
94
|
-
type: "wardley",
|
|
95
|
-
xywh: new Bound(centerX - width / 2, centerY - height / 2, width, height).serialize()
|
|
96
|
-
});
|
|
97
|
-
gfx.doc.captureSync();
|
|
98
|
-
gfx.selection.set({ elements: [id], editing: false });
|
|
99
|
-
}
|
|
100
|
-
render() {
|
|
101
|
-
return html`<edgeless-tool-icon-button
|
|
102
|
-
.tooltip=${"Wardley map"}
|
|
103
|
-
.iconContainerPadding=${6}
|
|
104
|
-
.iconSize=${"24px"}
|
|
105
|
-
@click=${() => this._addWardley()}
|
|
106
|
-
>
|
|
107
|
-
${WardleyIcon}
|
|
108
|
-
</edgeless-tool-icon-button>`;
|
|
109
|
-
}
|
|
110
|
-
#gfx = __runInitializers(this, _gfx_initializers, void 0);
|
|
111
|
-
get gfx() {
|
|
112
|
-
return this.#gfx;
|
|
113
|
-
}
|
|
114
|
-
set gfx(_) {
|
|
115
|
-
this.#gfx = _;
|
|
116
|
-
}
|
|
117
|
-
constructor() {
|
|
118
|
-
super(...arguments);
|
|
119
|
-
__runInitializers(this, _gfx_extraInitializers);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
})();
|
|
123
|
-
export { EdgelessWardleyToolButton };
|