@likec4/core 1.47.0 → 1.48.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 (181) hide show
  1. package/LICENSE +1 -1
  2. package/dist/_chunks/Builder.view-element.mjs +3284 -0
  3. package/dist/_chunks/LikeC4Model.d.mts +1287 -0
  4. package/dist/_chunks/LikeC4Styles.mjs +691 -0
  5. package/dist/_chunks/RichText.d.mts +84 -0
  6. package/dist/_chunks/RichText.mjs +148 -0
  7. package/dist/_chunks/_aux.d.mts +289 -0
  8. package/dist/_chunks/_aux.mjs +18 -0
  9. package/dist/_chunks/_types.d.mts +781 -0
  10. package/dist/_chunks/_types2.d.mts +38 -0
  11. package/dist/_chunks/assignTagColors.mjs +24 -0
  12. package/dist/_chunks/calcDriftsFromSnapshot.mjs +379 -0
  13. package/dist/_chunks/connection.mjs +0 -0
  14. package/dist/_chunks/const.d.mts +43 -0
  15. package/dist/_chunks/const.mjs +33 -0
  16. package/dist/_chunks/expression-model.d.mts +192 -0
  17. package/dist/_chunks/expression-model.mjs +103 -0
  18. package/dist/_chunks/expression.d.mts +347 -0
  19. package/dist/_chunks/expression.mjs +107 -0
  20. package/dist/_chunks/find.d.mts +82 -0
  21. package/dist/_chunks/find.mjs +646 -0
  22. package/dist/_chunks/find2.d.mts +78 -0
  23. package/dist/_chunks/find2.mjs +287 -0
  24. package/dist/_chunks/fqnRef.d.mts +58 -0
  25. package/dist/_chunks/fqnRef.mjs +41 -0
  26. package/dist/_chunks/geometry.mjs +335 -0
  27. package/dist/_chunks/index.d.mts +169 -0
  28. package/dist/_chunks/index2.d.mts +937 -0
  29. package/dist/_chunks/index3.d.mts +146 -0
  30. package/dist/_chunks/index4.d.mts +62 -0
  31. package/dist/_chunks/index5.d.mts +42 -0
  32. package/dist/_chunks/index6.d.mts +43 -0
  33. package/dist/{shared/core.OtRNdMxy.d.mts → _chunks/index7.d.mts} +113 -197
  34. package/dist/_chunks/index8.d.mts +144 -0
  35. package/dist/_chunks/invariant.mjs +18 -0
  36. package/dist/_chunks/iterable.mjs +146 -0
  37. package/dist/_chunks/libs/@mantine/colors-generator.mjs +3416 -0
  38. package/dist/_chunks/libs/@ungap/structured-clone.mjs +213 -0
  39. package/dist/_chunks/libs/bail.mjs +14 -0
  40. package/dist/_chunks/libs/ccount.mjs +25 -0
  41. package/dist/_chunks/libs/character-entities-html4.mjs +263 -0
  42. package/dist/_chunks/libs/character-entities-legacy.mjs +117 -0
  43. package/dist/_chunks/libs/character-entities.mjs +2136 -0
  44. package/dist/_chunks/libs/comma-separated-tokens.mjs +18 -0
  45. package/dist/_chunks/libs/decode-named-character-reference.mjs +21 -0
  46. package/dist/_chunks/libs/defu.mjs +42 -0
  47. package/dist/_chunks/libs/devlop.mjs +5 -0
  48. package/dist/_chunks/libs/escape-string-regexp.mjs +8 -0
  49. package/dist/_chunks/libs/extend.mjs +77 -0
  50. package/dist/_chunks/libs/graphology-dag.mjs +703 -0
  51. package/dist/_chunks/libs/graphology-types.d.mts +601 -0
  52. package/dist/_chunks/libs/graphology.d.mts +6 -0
  53. package/dist/_chunks/libs/graphology.mjs +4565 -0
  54. package/dist/_chunks/libs/hast-util-sanitize.mjs +863 -0
  55. package/dist/_chunks/libs/hast-util-to-html.mjs +2696 -0
  56. package/dist/_chunks/libs/is-plain-obj.mjs +9 -0
  57. package/dist/_chunks/libs/longest-streak.mjs +30 -0
  58. package/dist/_chunks/libs/markdown-table.mjs +290 -0
  59. package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +653 -0
  60. package/dist/_chunks/libs/mdast-util-from-markdown.mjs +8522 -0
  61. package/dist/_chunks/libs/mdast-util-gfm.mjs +2393 -0
  62. package/dist/_chunks/libs/mdast-util-to-hast.mjs +1803 -0
  63. package/dist/_chunks/libs/micromark-extension-gfm.mjs +2243 -0
  64. package/dist/_chunks/libs/mnemonist.d.mts +254 -0
  65. package/dist/_chunks/libs/mnemonist.mjs +1978 -0
  66. package/dist/_chunks/libs/natural-compare-lite.mjs +42 -0
  67. package/dist/_chunks/libs/rehype-sanitize.mjs +29 -0
  68. package/dist/_chunks/libs/rehype-stringify.mjs +34 -0
  69. package/dist/_chunks/libs/remark-gfm.mjs +36 -0
  70. package/dist/_chunks/libs/remark-github-blockquote-alert.mjs +100 -0
  71. package/dist/_chunks/libs/remark-parse.mjs +39 -0
  72. package/dist/_chunks/libs/remark-rehype.mjs +171 -0
  73. package/dist/_chunks/libs/remeda.mjs +702 -0
  74. package/dist/_chunks/libs/trough.mjs +158 -0
  75. package/dist/_chunks/libs/unified.mjs +2212 -0
  76. package/dist/_chunks/mnemonist.d.mts +1 -0
  77. package/dist/_chunks/mnemonist.mjs +0 -0
  78. package/dist/_chunks/model.mjs +1898 -0
  79. package/dist/_chunks/model2.mjs +0 -0
  80. package/dist/_chunks/relationships-view.mjs +132 -0
  81. package/dist/_chunks/rolldown-runtime.mjs +42 -0
  82. package/dist/{shared/core.C_3y3eqV.d.mts → _chunks/scalar.d.mts} +13 -43
  83. package/dist/_chunks/scalar.mjs +84 -0
  84. package/dist/_chunks/utils.mjs +483 -0
  85. package/dist/builder/index.d.mts +11 -775
  86. package/dist/builder/index.mjs +631 -1022
  87. package/dist/compute-view/index.d.mts +85 -56
  88. package/dist/compute-view/index.mjs +247 -214
  89. package/dist/compute-view/relationships-view/index.d.mts +16 -51
  90. package/dist/compute-view/relationships-view/index.mjs +6 -184
  91. package/dist/geometry/index.d.mts +2 -109
  92. package/dist/geometry/index.mjs +2 -327
  93. package/dist/index.d.mts +18 -20
  94. package/dist/index.mjs +27 -18
  95. package/dist/model/connection/deployment/index.d.mts +12 -15
  96. package/dist/model/connection/deployment/index.mjs +9 -2
  97. package/dist/model/connection/index.d.mts +14 -75
  98. package/dist/model/connection/index.mjs +10 -3
  99. package/dist/model/connection/model/index.d.mts +12 -15
  100. package/dist/model/connection/model/index.mjs +8 -2
  101. package/dist/model/index.d.mts +15 -57
  102. package/dist/model/index.mjs +11 -4
  103. package/dist/styles/index.d.mts +9 -117
  104. package/dist/styles/index.mjs +26 -59
  105. package/dist/types/RichText.d.mts +3 -0
  106. package/dist/types/RichText.mjs +7 -0
  107. package/dist/types/_aux.d.mts +3 -4
  108. package/dist/types/_aux.mjs +2 -7
  109. package/dist/types/expression-model.d.mts +6 -190
  110. package/dist/types/expression-model.mjs +6 -108
  111. package/dist/types/expression.d.mts +5 -6
  112. package/dist/types/expression.mjs +6 -112
  113. package/dist/types/fqnRef.d.mts +4 -60
  114. package/dist/types/fqnRef.mjs +6 -44
  115. package/dist/types/index.d.mts +9 -47
  116. package/dist/types/index.mjs +14 -16
  117. package/dist/types/scalar.d.mts +2 -2
  118. package/dist/types/scalar.mjs +7 -4
  119. package/dist/utils/graphology/index.d.mts +2 -1864
  120. package/dist/utils/graphology/index.mjs +3 -1
  121. package/dist/utils/index.d.mts +11 -124
  122. package/dist/utils/index.mjs +16 -43
  123. package/dist/utils/iterable/index.d.mts +9 -132
  124. package/dist/utils/iterable/index.mjs +2 -61
  125. package/dist/utils/mnemonist.d.mts +2 -0
  126. package/dist/utils/mnemonist.mjs +12 -0
  127. package/package.json +17 -22
  128. package/compute-view/relationships/package.json +0 -4
  129. package/dist/shared/core.3ZhnKAlZ.mjs +0 -106
  130. package/dist/shared/core.78IWAHAE.mjs +0 -332
  131. package/dist/shared/core.B85MJLTf.mjs +0 -5
  132. package/dist/shared/core.BFd1lU9R.mjs +0 -29
  133. package/dist/shared/core.BKlholso.mjs +0 -3
  134. package/dist/shared/core.BNN-3vPH.mjs +0 -1255
  135. package/dist/shared/core.BPGOjone.d.mts +0 -46
  136. package/dist/shared/core.BP_QHEXs.mjs +0 -785
  137. package/dist/shared/core.BbE4y-yl.mjs +0 -177
  138. package/dist/shared/core.Bdy3hhTc.mjs +0 -28382
  139. package/dist/shared/core.BfCKSW-g.d.mts +0 -1266
  140. package/dist/shared/core.BhNcrwzK.mjs +0 -7
  141. package/dist/shared/core.BkVA6gjl.mjs +0 -5
  142. package/dist/shared/core.BoYfZOBm.mjs +0 -3
  143. package/dist/shared/core.BsSXS-_R.mjs +0 -7
  144. package/dist/shared/core.C3JowhaZ.mjs +0 -32
  145. package/dist/shared/core.C4x8aaWa.mjs +0 -27
  146. package/dist/shared/core.CAgYpDtM.d.mts +0 -98
  147. package/dist/shared/core.CHf8VEa3.mjs +0 -1206
  148. package/dist/shared/core.CLSZtnFh.mjs +0 -69
  149. package/dist/shared/core.CbT8JVYL.mjs +0 -5
  150. package/dist/shared/core.CdNCAwq7.mjs +0 -176
  151. package/dist/shared/core.CmGY9blO.mjs +0 -6717
  152. package/dist/shared/core.CmPXpJ8l.mjs +0 -21
  153. package/dist/shared/core.Coi_LOUZ.mjs +0 -7
  154. package/dist/shared/core.CqAJJpK_.mjs +0 -3
  155. package/dist/shared/core.CywrQs86.d.mts +0 -31
  156. package/dist/shared/core.D00YbOhQ.d.mts +0 -300
  157. package/dist/shared/core.D0WZutNd.mjs +0 -94
  158. package/dist/shared/core.D4npX2q8.mjs +0 -18
  159. package/dist/shared/core.DB0Ue5Wx.d.mts +0 -70
  160. package/dist/shared/core.DC5IAaDT.d.mts +0 -334
  161. package/dist/shared/core.DE9qzhn8.d.mts +0 -83
  162. package/dist/shared/core.DGcIbsj4.mjs +0 -3946
  163. package/dist/shared/core.DH7TXqXf.mjs +0 -136
  164. package/dist/shared/core.DKhRkHRN.d.mts +0 -41
  165. package/dist/shared/core.DRJma0Ol.mjs +0 -22
  166. package/dist/shared/core.DU5SRqNF.mjs +0 -2209
  167. package/dist/shared/core.DXhDWKFZ.d.mts +0 -3
  168. package/dist/shared/core.DbfO90vF.mjs +0 -434
  169. package/dist/shared/core.DcS-0zys.mjs +0 -10
  170. package/dist/shared/core.Dh119QSP.mjs +0 -4995
  171. package/dist/shared/core.DjcWextK.mjs +0 -1371
  172. package/dist/shared/core.Dojz4bvg.d.mts +0 -504
  173. package/dist/shared/core.FZ305VYd.mjs +0 -21
  174. package/dist/shared/core.RfnaEmgA.mjs +0 -7
  175. package/dist/shared/core.btEq3i3f.mjs +0 -300
  176. package/dist/shared/core.oSV6SRfk.mjs +0 -13
  177. package/dist/shared/core.om36dXXW.mjs +0 -41
  178. package/dist/shared/core.osFs8tU7.d.mts +0 -466
  179. package/dist/shared/core.q10OP9oJ.mjs +0 -5
  180. package/dist/shared/core.tpvDGvdC.d.mts +0 -87
  181. package/dist/shared/core.uFk_o9X6.mjs +0 -13
File without changes
@@ -0,0 +1,132 @@
1
+ import { Q as t } from "./libs/remeda.mjs";
2
+ import { A as sortParentsFirst, C as isAncestor, w as isDescendantOf } from "./utils.mjs";
3
+ import { n as nonNullable, t as invariant } from "./invariant.mjs";
4
+ import { n as import_default_map } from "./libs/mnemonist.mjs";
5
+ import { f as ifilter, n as toArray, o as imap, r as toSet } from "./iterable.mjs";
6
+
7
+ //#region src/compute-view/relationships-view/utils.ts
8
+ function treeFromElements(elements) {
9
+ const sorted = sortParentsFirst([...elements]);
10
+ const root = new Set(sorted);
11
+ const map = new Map(sorted.map((e) => [e._literalId, e]));
12
+ const parents = new import_default_map.default(() => null);
13
+ const children = sorted.reduce((acc, parent, index, all) => {
14
+ acc.set(parent, all.slice(index + 1).filter(isDescendantOf(parent)).map((e) => {
15
+ root.delete(e);
16
+ return e;
17
+ }).reduce((acc, el) => {
18
+ if (!acc.some(isAncestor(el))) {
19
+ acc.push(el);
20
+ parents.set(el, parent);
21
+ }
22
+ return acc;
23
+ }, []));
24
+ return acc;
25
+ }, new import_default_map.default(() => []));
26
+ return {
27
+ sorted,
28
+ byId: (id) => nonNullable(map.get(id), `Element not found by id: ${id}`),
29
+ root,
30
+ parent: (el) => parents.get(el),
31
+ children: (el) => children.get(el),
32
+ flatten: () => {
33
+ return new Set([...root, ...sorted.reduce((acc, el) => {
34
+ const _children = children.get(el);
35
+ if (_children.length === 0) {
36
+ acc.push(el);
37
+ return acc;
38
+ }
39
+ if (_children.length > 1) acc.push(..._children);
40
+ return acc;
41
+ }, [])]);
42
+ }
43
+ };
44
+ }
45
+
46
+ //#endregion
47
+ //#region src/compute-view/relationships-view/compute.ts
48
+ const finalize = (elements, explicits) => {
49
+ if (elements.size > 2 && explicits.size !== elements.size) return new Set(sortParentsFirst([...treeFromElements(elements).flatten(), ...explicits]));
50
+ if (elements.size > 1) return new Set(sortParentsFirst([...elements]));
51
+ return elements;
52
+ };
53
+ function computeRelationships(subject, others, relationships) {
54
+ const isOther = (e) => others.has(e);
55
+ let subjects = new Set([subject]);
56
+ const explicits = {
57
+ incomers: /* @__PURE__ */ new Set(),
58
+ subjects: new Set([subject]),
59
+ outgoers: /* @__PURE__ */ new Set()
60
+ };
61
+ let incomers = new Set(relationships.incoming.flatMap((r) => {
62
+ explicits.subjects.add(r.target);
63
+ explicits.incomers.add(r.source);
64
+ subjects.add(r.target);
65
+ if (r.target !== subject) {
66
+ let target = r.target.parent;
67
+ while (target && target !== subject) {
68
+ subjects.add(target);
69
+ target = target.parent;
70
+ }
71
+ }
72
+ let source = r.source;
73
+ const incomerBranch = [];
74
+ while (true) {
75
+ incomerBranch.push(source);
76
+ if (isOther(source) || !source.parent) break;
77
+ source = source.parent;
78
+ }
79
+ return incomerBranch;
80
+ }));
81
+ let outgoers = new Set(relationships.outgoing.flatMap((r) => {
82
+ explicits.subjects.add(r.source);
83
+ explicits.outgoers.add(r.target);
84
+ subjects.add(r.source);
85
+ if (r.source !== subject) {
86
+ let source = r.source.parent;
87
+ while (source && source !== subject) {
88
+ subjects.add(source);
89
+ source = source.parent;
90
+ }
91
+ }
92
+ let target = r.target;
93
+ const outgoerBranch = [];
94
+ while (true) {
95
+ outgoerBranch.push(target);
96
+ if (isOther(target) || !target.parent) break;
97
+ target = target.parent;
98
+ }
99
+ return outgoerBranch;
100
+ }));
101
+ return {
102
+ incomers: finalize(incomers, explicits.incomers),
103
+ incoming: new Set(relationships.incoming),
104
+ subjects: finalize(subjects, explicits.subjects),
105
+ outgoing: new Set(relationships.outgoing),
106
+ outgoers: finalize(outgoers, explicits.outgoers)
107
+ };
108
+ }
109
+ function computeRelationshipsView(subjectId, likec4model, scopeViewId, scope = "global") {
110
+ const view = scopeViewId ? likec4model.findView(scopeViewId) : null;
111
+ if (scope === "view") {
112
+ invariant(view, "Scope view id is required when scope is \"view\"");
113
+ return computeScopedRelationshipsView(subjectId, view, likec4model);
114
+ }
115
+ const subject = likec4model.element(subjectId);
116
+ return computeRelationships(subject, toSet(subject.ascendingSiblings()), {
117
+ incoming: [...subject.incoming()],
118
+ outgoing: [...subject.outgoing()]
119
+ });
120
+ }
121
+ function computeScopedRelationshipsView(subjectId, view, likec4model) {
122
+ const subject = likec4model.element(subjectId);
123
+ let relationships = {
124
+ incoming: toArray(ifilter(subject.incoming(), (r) => view.includesRelation(r.id))),
125
+ outgoing: toArray(ifilter(subject.outgoing(), (r) => view.includesRelation(r.id)))
126
+ };
127
+ const isDescendant = isDescendantOf(subject);
128
+ return computeRelationships(subject, new Set([...subject.ascendingSiblings(), ...t(view.elements(), imap((e) => e.element), ifilter((e) => e !== subject && isDescendant(e)))]), relationships);
129
+ }
130
+
131
+ //#endregion
132
+ export { treeFromElements as n, computeRelationshipsView as t };
@@ -0,0 +1,42 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
9
+ var __exportAll = (all, symbols) => {
10
+ let target = {};
11
+ for (var name in all) {
12
+ __defProp(target, name, {
13
+ get: all[name],
14
+ enumerable: true
15
+ });
16
+ }
17
+ if (symbols) {
18
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
19
+ }
20
+ return target;
21
+ };
22
+ var __copyProps = (to, from, except, desc) => {
23
+ if (from && typeof from === "object" || typeof from === "function") {
24
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
25
+ key = keys[i];
26
+ if (!__hasOwnProp.call(to, key) && key !== except) {
27
+ __defProp(to, key, {
28
+ get: ((k) => from[k]).bind(null, key),
29
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
30
+ });
31
+ }
32
+ }
33
+ }
34
+ return to;
35
+ };
36
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
37
+ value: mod,
38
+ enumerable: true
39
+ }) : target, mod));
40
+
41
+ //#endregion
42
+ export { __exportAll as n, __toESM as r, __commonJSMin as t };
@@ -1,13 +1,17 @@
1
- import { Tagged } from 'type-fest';
1
+ import { Tagged } from "type-fest";
2
2
 
3
+ //#region src/types/scalar.d.ts
4
+ declare namespace scalar_d_exports {
5
+ export { AnyFqn, BuiltInIcon, DeploymentFqn, DeploymentKind, EdgeId, ElementKind, Fqn, GlobalFqn, GroupElementKind, Icon, IconUrl, MarkdownOrString, NodeId, NoneIcon, ProjectId, RelationId, RelationKind, RelationshipKind, StepEdgeId, StepEdgeIdLiteral, StepEdgeKind, Tag, ViewId, extractStep, flattenMarkdownOrString, isGlobalFqn, isGroupElementKind, isStepEdgeId, splitGlobalFqn, stepEdgeId };
6
+ }
3
7
  type ProjectId<T = string> = Tagged<T, 'ProjectID'>;
4
8
  declare function ProjectId(name: string): ProjectId;
5
9
  type MarkdownOrString = {
6
- txt: string;
7
- md?: never;
10
+ txt: string;
11
+ md?: never;
8
12
  } | {
9
- md: string;
10
- txt?: never;
13
+ md: string;
14
+ txt?: never;
11
15
  };
12
16
  /**
13
17
  * Converts a MarkdownOrString object or a plain string into a simple string representation.
@@ -66,9 +70,9 @@ type ElementKind<Kinds = string> = Tagged<Kinds, 'ElementKind'>;
66
70
  declare const GroupElementKind: ElementKind<"@group">;
67
71
  type GroupElementKind = typeof GroupElementKind;
68
72
  declare function isGroupElementKind<V extends {
69
- kind?: any;
73
+ kind?: any;
70
74
  }>(v: V): v is V & {
71
- kind: GroupElementKind;
75
+ kind: GroupElementKind;
72
76
  };
73
77
  /**
74
78
  * Full-qualified-name for deployment elements
@@ -101,39 +105,5 @@ declare function stepEdgeId(step: number, parallelStep?: number): StepEdgeId;
101
105
  declare const StepEdgeKind = "@step";
102
106
  declare function isStepEdgeId(id: string): id is StepEdgeId;
103
107
  declare function extractStep(id: EdgeId): number;
104
-
105
- type scalar_AnyFqn<T = string> = AnyFqn<T>;
106
- type scalar_BuiltInIcon = BuiltInIcon;
107
- declare const scalar_DeploymentFqn: typeof DeploymentFqn;
108
- type scalar_DeploymentKind<Kinds = string> = DeploymentKind<Kinds>;
109
- declare const scalar_EdgeId: typeof EdgeId;
110
- type scalar_ElementKind<Kinds = string> = ElementKind<Kinds>;
111
- declare const scalar_Fqn: typeof Fqn;
112
- declare const scalar_GlobalFqn: typeof GlobalFqn;
113
- type scalar_GroupElementKind = GroupElementKind;
114
- type scalar_Icon = Icon;
115
- type scalar_IconUrl = IconUrl;
116
- type scalar_MarkdownOrString = MarkdownOrString;
117
- declare const scalar_NodeId: typeof NodeId;
118
- declare const scalar_NoneIcon: typeof NoneIcon;
119
- declare const scalar_ProjectId: typeof ProjectId;
120
- declare const scalar_RelationId: typeof RelationId;
121
- type scalar_RelationKind<Kinds = string> = RelationKind<Kinds>;
122
- type scalar_RelationshipKind<Kinds = string> = RelationshipKind<Kinds>;
123
- type scalar_StepEdgeId = StepEdgeId;
124
- type scalar_StepEdgeIdLiteral = StepEdgeIdLiteral;
125
- declare const scalar_StepEdgeKind: typeof StepEdgeKind;
126
- type scalar_Tag<T = string> = Tag<T>;
127
- declare const scalar_ViewId: typeof ViewId;
128
- declare const scalar_extractStep: typeof extractStep;
129
- declare const scalar_flattenMarkdownOrString: typeof flattenMarkdownOrString;
130
- declare const scalar_isGlobalFqn: typeof isGlobalFqn;
131
- declare const scalar_isGroupElementKind: typeof isGroupElementKind;
132
- declare const scalar_isStepEdgeId: typeof isStepEdgeId;
133
- declare const scalar_splitGlobalFqn: typeof splitGlobalFqn;
134
- declare const scalar_stepEdgeId: typeof stepEdgeId;
135
- declare namespace scalar {
136
- export { type scalar_AnyFqn as AnyFqn, type scalar_BuiltInIcon as BuiltInIcon, scalar_DeploymentFqn as DeploymentFqn, type scalar_DeploymentKind as DeploymentKind, scalar_EdgeId as EdgeId, type scalar_ElementKind as ElementKind, scalar_Fqn as Fqn, scalar_GlobalFqn as GlobalFqn, type scalar_GroupElementKind as GroupElementKind, type scalar_Icon as Icon, type scalar_IconUrl as IconUrl, type scalar_MarkdownOrString as MarkdownOrString, scalar_NodeId as NodeId, scalar_NoneIcon as NoneIcon, scalar_ProjectId as ProjectId, scalar_RelationId as RelationId, type scalar_RelationKind as RelationKind, type scalar_RelationshipKind as RelationshipKind, type scalar_StepEdgeId as StepEdgeId, type scalar_StepEdgeIdLiteral as StepEdgeIdLiteral, scalar_StepEdgeKind as StepEdgeKind, type scalar_Tag as Tag, scalar_ViewId as ViewId, scalar_extractStep as extractStep, scalar_flattenMarkdownOrString as flattenMarkdownOrString, scalar_isGlobalFqn as isGlobalFqn, scalar_isGroupElementKind as isGroupElementKind, scalar_isStepEdgeId as isStepEdgeId, scalar_splitGlobalFqn as splitGlobalFqn, scalar_stepEdgeId as stepEdgeId };
137
- }
138
-
139
- export { type AnyFqn as A, type BuiltInIcon as B, DeploymentFqn as D, type ElementKind as E, Fqn as F, GroupElementKind as G, type Icon as I, type MarkdownOrString as M, NoneIcon as N, ProjectId as P, type RelationKind as R, type StepEdgeIdLiteral as S, type Tag as T, ViewId as V, type IconUrl as a, type DeploymentKind as b, type RelationshipKind as c, RelationId as d, GlobalFqn as e, flattenMarkdownOrString as f, isGlobalFqn as g, splitGlobalFqn as h, isGroupElementKind as i, NodeId as j, EdgeId as k, type StepEdgeId as l, stepEdgeId as m, StepEdgeKind as n, isStepEdgeId as o, extractStep as p, scalar as s };
108
+ //#endregion
109
+ export { splitGlobalFqn as A, ViewId as C, isGroupElementKind as D, isGlobalFqn as E, isStepEdgeId as O, Tag as S, flattenMarkdownOrString as T, RelationKind as _, EdgeId as a, StepEdgeIdLiteral as b, GlobalFqn as c, IconUrl as d, MarkdownOrString as f, RelationId as g, ProjectId as h, DeploymentKind as i, stepEdgeId as j, scalar_d_exports as k, GroupElementKind as l, NoneIcon as m, BuiltInIcon as n, ElementKind as o, NodeId as p, DeploymentFqn as r, Fqn as s, AnyFqn as t, Icon as u, RelationshipKind as v, extractStep as w, StepEdgeKind as x, StepEdgeId as y };
@@ -0,0 +1,84 @@
1
+ import { n as __exportAll } from "./rolldown-runtime.mjs";
2
+ import { D as e$1, O as e } from "./libs/remeda.mjs";
3
+ import { t as invariant } from "./invariant.mjs";
4
+
5
+ //#region src/types/scalar.ts
6
+ var scalar_exports = /* @__PURE__ */ __exportAll({
7
+ DeploymentFqn: () => DeploymentFqn,
8
+ EdgeId: () => EdgeId,
9
+ Fqn: () => Fqn,
10
+ GlobalFqn: () => GlobalFqn,
11
+ GroupElementKind: () => GroupElementKind,
12
+ NodeId: () => NodeId,
13
+ NoneIcon: () => NoneIcon,
14
+ ProjectId: () => ProjectId,
15
+ RelationId: () => RelationId,
16
+ StepEdgeKind: () => StepEdgeKind,
17
+ ViewId: () => ViewId,
18
+ extractStep: () => extractStep,
19
+ flattenMarkdownOrString: () => flattenMarkdownOrString,
20
+ isGlobalFqn: () => isGlobalFqn,
21
+ isGroupElementKind: () => isGroupElementKind,
22
+ isStepEdgeId: () => isStepEdgeId,
23
+ splitGlobalFqn: () => splitGlobalFqn,
24
+ stepEdgeId: () => stepEdgeId
25
+ });
26
+ function ProjectId(name) {
27
+ return name;
28
+ }
29
+ function flattenMarkdownOrString(value) {
30
+ if (value === null || value === void 0) return null;
31
+ const content = e(value) ? value : value.txt ?? value.md;
32
+ return e$1(content?.trim()) ? content : null;
33
+ }
34
+ const NoneIcon = "none";
35
+ function Fqn(name, parent) {
36
+ return parent ? parent + "." + name : name;
37
+ }
38
+ const GroupElementKind = "@group";
39
+ function isGroupElementKind(v) {
40
+ return v.kind === GroupElementKind;
41
+ }
42
+ function DeploymentFqn(name, parent) {
43
+ return parent ? parent + "." + name : name;
44
+ }
45
+ function ViewId(id) {
46
+ return id;
47
+ }
48
+ function RelationId(id) {
49
+ return id;
50
+ }
51
+ function GlobalFqn(projectId, name) {
52
+ invariant(typeof projectId === "string" && projectId != "");
53
+ return "@" + projectId + "." + name;
54
+ }
55
+ function isGlobalFqn(fqn) {
56
+ return fqn.startsWith("@");
57
+ }
58
+ function splitGlobalFqn(fqn) {
59
+ if (!fqn.startsWith("@")) return [null, fqn];
60
+ const firstDot = fqn.indexOf(".");
61
+ if (firstDot < 2) throw new Error("Invalid global FQN");
62
+ return [fqn.slice(1, firstDot), fqn.slice(firstDot + 1)];
63
+ }
64
+ function NodeId(id) {
65
+ return id;
66
+ }
67
+ function EdgeId(id) {
68
+ return id;
69
+ }
70
+ function stepEdgeId(step, parallelStep) {
71
+ const id = `step-${String(step).padStart(2, "0")}`;
72
+ return parallelStep ? `${id}.${parallelStep}` : id;
73
+ }
74
+ const StepEdgeKind = "@step";
75
+ function isStepEdgeId(id) {
76
+ return id.startsWith("step-");
77
+ }
78
+ function extractStep(id) {
79
+ if (!isStepEdgeId(id)) throw new Error(`Invalid step edge id: ${id}`);
80
+ return parseFloat(id.slice(5));
81
+ }
82
+
83
+ //#endregion
84
+ export { scalar_exports as _, GroupElementKind as a, ProjectId as c, ViewId as d, extractStep as f, isStepEdgeId as g, isGroupElementKind as h, GlobalFqn as i, RelationId as l, isGlobalFqn as m, EdgeId as n, NodeId as o, flattenMarkdownOrString as p, Fqn as r, NoneIcon as s, DeploymentFqn as t, StepEdgeKind as u, splitGlobalFqn as v, stepEdgeId as y };