@draftably/editor 0.1.0 → 0.3.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.
Files changed (104) hide show
  1. package/README.md +4 -5
  2. package/dist/assets/engine.worker-BY9GKt7x.js +7505 -0
  3. package/dist/element.js +1 -1
  4. package/dist/index.js +20202 -2
  5. package/dist/types/src/cli/raster-fonts.d.ts +3 -0
  6. package/dist/types/src/components/controls.d.ts +8 -5
  7. package/dist/types/src/dsl/compile.d.ts +13 -0
  8. package/dist/types/src/dsl/corridors.d.ts +38 -0
  9. package/dist/types/src/model/types.d.ts +9 -0
  10. package/dist/types/src/state/canvas-commands.d.ts +169 -0
  11. package/dist/types/src/state/canvas-keyboard.d.ts +15 -0
  12. package/dist/types/src/state/links.d.ts +4 -1
  13. package/dist/types/src/state/workspace.d.ts +3 -0
  14. package/package.json +1 -1
  15. package/dist/assets/engine.worker-DmHew5f6.js +0 -6813
  16. package/dist/assets/import-d2.worker-CnXfFXoa.js +0 -5395
  17. package/dist/chunks/abnfDiagram-WEYOIA3C-llcpthp5.js +0 -87
  18. package/dist/chunks/arc-rJj0TtXf.js +0 -83
  19. package/dist/chunks/architectureDiagram-ZHVYKT53-CfiXg0Lk.js +0 -4781
  20. package/dist/chunks/blockDiagram-RJAE7QA3-CO-14jWz.js +0 -1440
  21. package/dist/chunks/browser-iNhbPsGc.js +0 -40
  22. package/dist/chunks/c4Diagram-XDPPPE54-DYKuxA4n.js +0 -1524
  23. package/dist/chunks/channel-qMvPU6eH.js +0 -5
  24. package/dist/chunks/chunk-2E7WHVMD-BEZwsFS3.js +0 -670
  25. package/dist/chunks/chunk-2Q5K7J3B-gqtzQ8ux.js +0 -18
  26. package/dist/chunks/chunk-4EMNKR2T-MC54CXVe.js +0 -262
  27. package/dist/chunks/chunk-55XCU76K-DkZUAaqC.js +0 -68
  28. package/dist/chunks/chunk-5VM5RSS4-CaKe4sjM.js +0 -19
  29. package/dist/chunks/chunk-JWPE2WC7-CnAFS2xF.js +0 -8
  30. package/dist/chunks/chunk-VQ5W62QI-CXRv7FiX.js +0 -19
  31. package/dist/chunks/chunk-XXDRQBXY-B-AMQgD2.js +0 -8
  32. package/dist/chunks/chunk-ZCHMQSOR-BALpdc3g.js +0 -451
  33. package/dist/chunks/classDiagram-v2-4MYWR3UA-wPjgJTg4.js +0 -1570
  34. package/dist/chunks/cose-bilkent-JH36ORCC-Bbh5ggBc.js +0 -2608
  35. package/dist/chunks/cynefin-EF2NZ3EQ-Bt6b88hY.js +0 -22361
  36. package/dist/chunks/cynefinDiagram-WF24UDRP-BHWZvxoF.js +0 -299
  37. package/dist/chunks/cytoscape.esm-CRsF_JA3.js +0 -18791
  38. package/dist/chunks/dagre-NK4GIZVX-Cz37yPrT.js +0 -2157
  39. package/dist/chunks/defaultLocale-BgPVtth8.js +0 -171
  40. package/dist/chunks/diagram-CBK3MWTC-Q2R6FJ0B.js +0 -531
  41. package/dist/chunks/diagram-I5XIIV2D-a2Kdu_wA.js +0 -153
  42. package/dist/chunks/diagram-ODIL2UCW-DTWXxcOn.js +0 -346
  43. package/dist/chunks/diagram-PFBEJUXE-DIAQQ5KX.js +0 -480
  44. package/dist/chunks/diagram-RJA3I4VV-BPD0GghS.js +0 -219
  45. package/dist/chunks/diagram-TYUNFSNR-BmdkONfG.js +0 -2586
  46. package/dist/chunks/dot-importer-B23jwEkx.js +0 -1547
  47. package/dist/chunks/ebnfDiagram-V4P3TTPT-C5IKvYlb.js +0 -109
  48. package/dist/chunks/elk-QONTBCTQ-CtdQFvh2.js +0 -49229
  49. package/dist/chunks/erDiagram-KYQIGQAA-5wguK9Dx.js +0 -1064
  50. package/dist/chunks/flowDiagram-IUGLLWBU-BijvFPku.js +0 -1771
  51. package/dist/chunks/ganttDiagram-R7GPNTJY-BaqGPz-O.js +0 -2729
  52. package/dist/chunks/gitGraphDiagram-PDYL7XHY-DZfMGyHE.js +0 -815
  53. package/dist/chunks/graph-CKJmgLki.js +0 -1541
  54. package/dist/chunks/import-core-C-I1wGfw.js +0 -145
  55. package/dist/chunks/infoDiagram-MVDRKAX5-C2vH_59e.js +0 -24
  56. package/dist/chunks/init-DjUOC4st.js +0 -16
  57. package/dist/chunks/ishikawaDiagram-HPEHV2GE-q149MFlV.js +0 -624
  58. package/dist/chunks/journeyDiagram-BOSHW7O7-D-2Z3VtR.js +0 -834
  59. package/dist/chunks/kanban-definition-FNSA4HC5-wvAjV5ub.js +0 -724
  60. package/dist/chunks/katex-BsrBVQKd.js +0 -11314
  61. package/dist/chunks/linear-4t7D_ros.js +0 -259
  62. package/dist/chunks/mermaid-facade-BoLWBerE.js +0 -289
  63. package/dist/chunks/mermaid-importer-Cgx1IhmR.js +0 -478
  64. package/dist/chunks/mermaid.core-DXv6D2Sm.js +0 -19244
  65. package/dist/chunks/mindmap-definition-6OY57UG3-r9wTKul_.js +0 -837
  66. package/dist/chunks/mount-C1Xk_GQz.js +0 -22131
  67. package/dist/chunks/ordinal-DfAQgscy.js +0 -61
  68. package/dist/chunks/pegDiagram-ECIUJNBX-CmKlFWiP.js +0 -95
  69. package/dist/chunks/pieDiagram-GNMPY74T-DNTw_qan.js +0 -208
  70. package/dist/chunks/quadrantDiagram-D57K4MC3-CT_tvVub.js +0 -1029
  71. package/dist/chunks/railroadDiagram-Y72NRBL7-C5TUvZBe.js +0 -77
  72. package/dist/chunks/requirementDiagram-EQYSW5RA-C_c65aCa.js +0 -889
  73. package/dist/chunks/sankeyDiagram-SY24JHO5-CKcbizM1.js +0 -859
  74. package/dist/chunks/sequenceDiagram-BLEHNHQU-GpVnHOjf.js +0 -2972
  75. package/dist/chunks/sizeCapture-INFHLROL-CToN3JSu.js +0 -46
  76. package/dist/chunks/stateDiagram-v2-A6IESKWZ-rJYd2FfM.js +0 -1520
  77. package/dist/chunks/swimlanes-B3ENRKFQ-C7w5pfxG.js +0 -4991
  78. package/dist/chunks/swimlanesDiagram-AYQRV4AK-BpGY_bvE.js +0 -13
  79. package/dist/chunks/timeline-definition-JXYKGLGB-ChKFPBKc.js +0 -1058
  80. package/dist/chunks/usecaseDiagram-WPOLBNNX-skXH8Dcu.js +0 -7945
  81. package/dist/chunks/vennDiagram-Q3Y3IDCW-C5KknmJf.js +0 -1578
  82. package/dist/chunks/wardleyDiagram-IVAIDKWA-DY4Lkfpu.js +0 -678
  83. package/dist/chunks/xychartDiagram-4URNHDU4-BHScsL7h.js +0 -1536
  84. package/dist/types/src/cli/png.d.ts +0 -23
  85. package/dist/types/src/import/browser.d.ts +0 -3
  86. package/dist/types/src/import/detect.d.ts +0 -31
  87. package/dist/types/src/import/dot-importer.d.ts +0 -3
  88. package/dist/types/src/import/import-core.d.ts +0 -105
  89. package/dist/types/src/import/mermaid-facade.d.ts +0 -120
  90. package/dist/types/src/import/mermaid-importer.d.ts +0 -4
  91. package/dist/types/src/import/mermaid-sequence.d.ts +0 -8
  92. package/dist/types/src/import/scratch.d.ts +0 -3
  93. package/dist/types/src/lib/source-hash.d.ts +0 -7
  94. package/dist/types/src/model/candidates.d.ts +0 -53
  95. package/dist/types/src/model/embed.d.ts +0 -17
  96. package/dist/types/src/model/examples.d.ts +0 -15
  97. package/dist/types/src/model/label-hits.d.ts +0 -27
  98. package/dist/types/src/model/static-scene.d.ts +0 -15
  99. package/dist/types/src/state/commands.d.ts +0 -529
  100. package/dist/types/src/state/comparison.d.ts +0 -151
  101. package/dist/types/src/state/files.d.ts +0 -61
  102. package/dist/types/src/state/keyboard.d.ts +0 -6
  103. package/dist/types/src/state/launch.d.ts +0 -61
  104. package/dist/types/src/state/ui.d.ts +0 -39
@@ -1,87 +0,0 @@
1
- import { g as p, r as u, d as a } from "./chunk-2E7WHVMD-BEZwsFS3.js";
2
- import { p as f } from "./chunk-JWPE2WC7-CnAFS2xF.js";
3
- import { _ as n, l as o } from "./mermaid.core-DXv6D2Sm.js";
4
- import { M as c, b as d } from "./cynefin-EF2NZ3EQ-Bt6b88hY.js";
5
- var v = d().RailroadAbnf.parser.LangiumParser, l = /* @__PURE__ */ n((e) => {
6
- const r = e.alternatives.map(g);
7
- return r.length === 1 ? r[0] : {
8
- type: "choice",
9
- alternatives: r
10
- };
11
- }, "transformAlternation"), g = /* @__PURE__ */ n((e) => {
12
- const r = e.elements.map(y);
13
- return r.length === 1 ? r[0] : {
14
- type: "sequence",
15
- elements: r
16
- };
17
- }, "transformConcatenation"), b = /* @__PURE__ */ n((e) => {
18
- if (e.includes("*")) {
19
- const [t, s] = e.split("*"), i = t ? parseInt(t, 10) : 0, m = s ? parseInt(s, 10) : 1 / 0;
20
- return { min: i, max: m };
21
- }
22
- const r = parseInt(e, 10);
23
- return { min: r, max: r };
24
- }, "parseRepeat"), y = /* @__PURE__ */ n((e) => {
25
- const r = A(e.primary);
26
- if (!e.repeat)
27
- return r;
28
- const { min: t, max: s } = b(e.repeat);
29
- return t === 0 && s === 1 ? { type: "optional", element: r } : {
30
- type: "repetition",
31
- element: r,
32
- min: t,
33
- max: s
34
- };
35
- }, "transformElement"), A = /* @__PURE__ */ n((e) => {
36
- switch (e.$type) {
37
- case "AbnfStringLiteral":
38
- return {
39
- type: "terminal",
40
- value: e.value
41
- };
42
- case "AbnfNumVal":
43
- return {
44
- type: "terminal",
45
- value: e.value
46
- };
47
- case "AbnfRuleName":
48
- return {
49
- type: "nonterminal",
50
- name: e.name
51
- };
52
- case "AbnfGroup":
53
- return l(e.element);
54
- case "AbnfOptionalGroup":
55
- return {
56
- type: "optional",
57
- element: l(e.element)
58
- };
59
- default:
60
- throw new Error(`Unsupported ABNF primary node: ${e.$type}`);
61
- }
62
- }, "transformPrimary"), P = /* @__PURE__ */ n((e) => ({
63
- name: e.name,
64
- definition: l(e.definition)
65
- }), "transformRule"), h = /* @__PURE__ */ n((e) => {
66
- f(e, a), e.title && a.setTitle(e.title), e.rules.map((r) => a.addRule(P(r)));
67
- }, "populateDb"), R = {
68
- parse: /* @__PURE__ */ n((e) => {
69
- a.clear(), o.debug("[ABNF Parser] Starting Langium parse");
70
- const r = v.parse(e);
71
- if (r.lexerErrors.length > 0 || r.parserErrors.length > 0)
72
- throw new c(r);
73
- const t = r.value;
74
- o.debug("[ABNF Parser] Parsed rules:", t.rules.length), h(t), o.debug("[ABNF Parser] Parse complete");
75
- }, "parse"),
76
- parser: {
77
- yy: a
78
- }
79
- }, w = {
80
- parser: R,
81
- db: a,
82
- renderer: u,
83
- styles: p
84
- };
85
- export {
86
- w as diagram
87
- };
@@ -1,83 +0,0 @@
1
- import { a6 as ln, a7 as an, a8 as G, a9 as j, aa as z, ab as un, ac as g, ad as tn, ae as K, af as _, ag as rn, ah as o, ai as on, aj as sn, ak as fn } from "./mermaid.core-DXv6D2Sm.js";
2
- function cn(l) {
3
- return l.innerRadius;
4
- }
5
- function gn(l) {
6
- return l.outerRadius;
7
- }
8
- function yn(l) {
9
- return l.startAngle;
10
- }
11
- function dn(l) {
12
- return l.endAngle;
13
- }
14
- function mn(l) {
15
- return l && l.padAngle;
16
- }
17
- function pn(l, h, E, q, v, A, B, a) {
18
- var I = E - l, i = q - h, n = B - v, d = a - A, u = d * I - n * i;
19
- if (!(u * u < g))
20
- return u = (n * (h - A) - d * (l - v)) / u, [l + u * I, h + u * i];
21
- }
22
- function V(l, h, E, q, v, A, B) {
23
- var a = l - E, I = h - q, i = (B ? A : -A) / K(a * a + I * I), n = i * I, d = -i * a, u = l + n, s = h + d, f = E + n, c = q + d, C = (u + f) / 2, t = (s + c) / 2, m = f - u, y = c - s, R = m * m + y * y, T = v - A, P = u * c - f * s, O = (y < 0 ? -1 : 1) * K(on(0, T * T * R - P * P)), S = (P * y - m * O) / R, k = (-P * m - y * O) / R, w = (P * y + m * O) / R, p = (-P * m + y * O) / R, x = S - C, e = k - t, r = w - C, F = p - t;
24
- return x * x + e * e > r * r + F * F && (S = w, k = p), {
25
- cx: S,
26
- cy: k,
27
- x01: -n,
28
- y01: -d,
29
- x11: S * (v / T - 1),
30
- y11: k * (v / T - 1)
31
- };
32
- }
33
- function hn() {
34
- var l = cn, h = gn, E = z(0), q = null, v = yn, A = dn, B = mn, a = null, I = ln(i);
35
- function i() {
36
- var n, d, u = +l.apply(this, arguments), s = +h.apply(this, arguments), f = v.apply(this, arguments) - un, c = A.apply(this, arguments) - un, C = rn(c - f), t = c > f;
37
- if (a || (a = n = I()), s < u && (d = s, s = u, u = d), !(s > g)) a.moveTo(0, 0);
38
- else if (C > tn - g)
39
- a.moveTo(s * G(f), s * j(f)), a.arc(0, 0, s, f, c, !t), u > g && (a.moveTo(u * G(c), u * j(c)), a.arc(0, 0, u, c, f, t));
40
- else {
41
- var m = f, y = c, R = f, T = c, P = C, O = C, S = B.apply(this, arguments) / 2, k = S > g && (q ? +q.apply(this, arguments) : K(u * u + s * s)), w = _(rn(s - u) / 2, +E.apply(this, arguments)), p = w, x = w, e, r;
42
- if (k > g) {
43
- var F = sn(k / u * j(S)), L = sn(k / s * j(S));
44
- (P -= F * 2) > g ? (F *= t ? 1 : -1, R += F, T -= F) : (P = 0, R = T = (f + c) / 2), (O -= L * 2) > g ? (L *= t ? 1 : -1, m += L, y -= L) : (O = 0, m = y = (f + c) / 2);
45
- }
46
- var H = s * G(m), J = s * j(m), M = u * G(T), N = u * j(T);
47
- if (w > g) {
48
- var Q = s * G(y), U = s * j(y), W = u * G(R), X = u * j(R), D;
49
- if (C < an)
50
- if (D = pn(H, J, W, X, Q, U, M, N)) {
51
- var Y = H - D[0], Z = J - D[1], $ = Q - D[0], b = U - D[1], nn = 1 / j(fn((Y * $ + Z * b) / (K(Y * Y + Z * Z) * K($ * $ + b * b))) / 2), en = K(D[0] * D[0] + D[1] * D[1]);
52
- p = _(w, (u - en) / (nn - 1)), x = _(w, (s - en) / (nn + 1));
53
- } else
54
- p = x = 0;
55
- }
56
- O > g ? x > g ? (e = V(W, X, H, J, s, x, t), r = V(Q, U, M, N, s, x, t), a.moveTo(e.cx + e.x01, e.cy + e.y01), x < w ? a.arc(e.cx, e.cy, x, o(e.y01, e.x01), o(r.y01, r.x01), !t) : (a.arc(e.cx, e.cy, x, o(e.y01, e.x01), o(e.y11, e.x11), !t), a.arc(0, 0, s, o(e.cy + e.y11, e.cx + e.x11), o(r.cy + r.y11, r.cx + r.x11), !t), a.arc(r.cx, r.cy, x, o(r.y11, r.x11), o(r.y01, r.x01), !t))) : (a.moveTo(H, J), a.arc(0, 0, s, m, y, !t)) : a.moveTo(H, J), !(u > g) || !(P > g) ? a.lineTo(M, N) : p > g ? (e = V(M, N, Q, U, u, -p, t), r = V(H, J, W, X, u, -p, t), a.lineTo(e.cx + e.x01, e.cy + e.y01), p < w ? a.arc(e.cx, e.cy, p, o(e.y01, e.x01), o(r.y01, r.x01), !t) : (a.arc(e.cx, e.cy, p, o(e.y01, e.x01), o(e.y11, e.x11), !t), a.arc(0, 0, u, o(e.cy + e.y11, e.cx + e.x11), o(r.cy + r.y11, r.cx + r.x11), t), a.arc(r.cx, r.cy, p, o(r.y11, r.x11), o(r.y01, r.x01), !t))) : a.arc(0, 0, u, T, R, t);
57
- }
58
- if (a.closePath(), n) return a = null, n + "" || null;
59
- }
60
- return i.centroid = function() {
61
- var n = (+l.apply(this, arguments) + +h.apply(this, arguments)) / 2, d = (+v.apply(this, arguments) + +A.apply(this, arguments)) / 2 - an / 2;
62
- return [G(d) * n, j(d) * n];
63
- }, i.innerRadius = function(n) {
64
- return arguments.length ? (l = typeof n == "function" ? n : z(+n), i) : l;
65
- }, i.outerRadius = function(n) {
66
- return arguments.length ? (h = typeof n == "function" ? n : z(+n), i) : h;
67
- }, i.cornerRadius = function(n) {
68
- return arguments.length ? (E = typeof n == "function" ? n : z(+n), i) : E;
69
- }, i.padRadius = function(n) {
70
- return arguments.length ? (q = n == null ? null : typeof n == "function" ? n : z(+n), i) : q;
71
- }, i.startAngle = function(n) {
72
- return arguments.length ? (v = typeof n == "function" ? n : z(+n), i) : v;
73
- }, i.endAngle = function(n) {
74
- return arguments.length ? (A = typeof n == "function" ? n : z(+n), i) : A;
75
- }, i.padAngle = function(n) {
76
- return arguments.length ? (B = typeof n == "function" ? n : z(+n), i) : B;
77
- }, i.context = function(n) {
78
- return arguments.length ? (a = n ?? null, i) : a;
79
- }, i;
80
- }
81
- export {
82
- hn as d
83
- };