@likec4/core 1.17.1 → 1.19.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 (184) hide show
  1. package/LICENSE +1 -1
  2. package/dist/builder/index.d.mts +502 -0
  3. package/dist/builder/index.d.ts +502 -0
  4. package/dist/builder/index.js +871 -0
  5. package/dist/compute-view/index.d.mts +22 -0
  6. package/dist/compute-view/index.d.ts +22 -0
  7. package/dist/compute-view/index.js +78 -0
  8. package/dist/index.d.mts +10 -919
  9. package/dist/index.d.ts +10 -919
  10. package/dist/{index.mjs → index.js} +7 -1688
  11. package/dist/model/index.d.mts +254 -0
  12. package/dist/model/index.d.ts +254 -0
  13. package/dist/model/index.js +1 -0
  14. package/dist/shared/chunk-RAAYCPUM.M-JWF7SS.js +21 -0
  15. package/dist/shared/core.BIfgabEw.d.ts +719 -0
  16. package/dist/shared/core.BZ9Msq7w.d.mts +719 -0
  17. package/dist/shared/{core.CoLQkcYL.d.cts → core.C05RDLhi.d.ts} +460 -362
  18. package/dist/shared/{core.CoLQkcYL.d.mts → core.CmYMqgha.d.mts} +460 -362
  19. package/dist/shared/core.D6-fWbM3.d.ts +127 -0
  20. package/dist/shared/core.D74xkKkG.d.mts +148 -0
  21. package/dist/shared/core.D74xkKkG.d.ts +148 -0
  22. package/dist/shared/core.sLaWHBjR.d.mts +127 -0
  23. package/dist/shared/index.-BdzdI2C.js +7443 -0
  24. package/dist/shared/object_hash.CE_oF3I3.js +1222 -0
  25. package/dist/shared/{core.BXTs-8n7.mjs → view.CyZrG8BJ.js} +108 -47
  26. package/dist/types/index.d.mts +71 -1
  27. package/dist/types/index.d.ts +71 -1
  28. package/dist/types/index.js +20 -0
  29. package/dist/utils/index.d.mts +404 -0
  30. package/dist/utils/index.d.ts +404 -0
  31. package/dist/utils/index.js +330 -0
  32. package/package.json +59 -47
  33. package/src/builder/Builder-style1.test-d.ts +190 -0
  34. package/src/builder/Builder-style2.test-d.ts +175 -0
  35. package/src/builder/Builder.deployment.ts +224 -0
  36. package/src/builder/Builder.deploymentModel.ts +385 -0
  37. package/src/builder/Builder.element.ts +19 -19
  38. package/src/builder/Builder.model.ts +67 -42
  39. package/src/builder/Builder.ts +533 -367
  40. package/src/builder/Builder.view-common.ts +234 -0
  41. package/src/builder/Builder.view-deployment.ts +135 -0
  42. package/src/builder/Builder.view-element.ts +189 -0
  43. package/src/builder/Builder.views.ts +109 -33
  44. package/src/builder/Builder.with.ts +475 -0
  45. package/src/builder/__snapshots__/Builder-style1.spec.ts.snap +374 -0
  46. package/src/builder/__snapshots__/Builder-style2.spec.ts.snap +183 -0
  47. package/src/builder/__snapshots__/Builder.spec.ts.snap +374 -0
  48. package/src/builder/_types.ts +113 -18
  49. package/src/builder/index.ts +10 -4
  50. package/src/colors/index.ts +2 -2
  51. package/src/compute-view/compute-view.ts +83 -0
  52. package/src/compute-view/deployment-view/__test__/TestHelper.ts +236 -0
  53. package/src/compute-view/deployment-view/__test__/fixture.ts +198 -0
  54. package/src/compute-view/deployment-view/_types.ts +37 -0
  55. package/src/compute-view/deployment-view/clean-connections.ts +238 -0
  56. package/src/compute-view/deployment-view/compute.ts +125 -0
  57. package/src/compute-view/deployment-view/memory/index.ts +9 -0
  58. package/src/compute-view/deployment-view/memory/memory.ts +97 -0
  59. package/src/compute-view/deployment-view/predicates/elements.ts +144 -0
  60. package/src/compute-view/deployment-view/predicates/relation-direct.ts +237 -0
  61. package/src/compute-view/deployment-view/predicates/relation-in-out.ts +61 -0
  62. package/src/compute-view/deployment-view/predicates/relation-incoming.ts +95 -0
  63. package/src/compute-view/deployment-view/predicates/relation-outgoing.ts +88 -0
  64. package/src/compute-view/deployment-view/predicates/wildcard.ts +29 -0
  65. package/src/compute-view/deployment-view/stages/stage-exclude.ts +5 -0
  66. package/src/compute-view/deployment-view/stages/stage-final.ts +245 -0
  67. package/src/compute-view/deployment-view/stages/stage-include.ts +95 -0
  68. package/src/compute-view/deployment-view/utils.ts +276 -0
  69. package/src/compute-view/dynamic-view/__test__/fixture.ts +58 -0
  70. package/src/compute-view/dynamic-view/compute.ts +324 -0
  71. package/src/compute-view/element-view/__test__/TestHelper.ts +258 -0
  72. package/src/compute-view/element-view/__test__/__snapshots__/legacy.spec.ts.snap +458 -0
  73. package/src/compute-view/element-view/__test__/fixture.ts +675 -0
  74. package/src/compute-view/element-view/_types.ts +48 -0
  75. package/src/compute-view/element-view/clean-connections.ts +113 -0
  76. package/src/compute-view/element-view/compute.ts +315 -0
  77. package/src/compute-view/element-view/memory/NodeGroup.ts +31 -0
  78. package/src/compute-view/element-view/memory/index.ts +10 -0
  79. package/src/compute-view/element-view/memory/memory.ts +177 -0
  80. package/src/compute-view/element-view/memory/stage-exclude.ts +59 -0
  81. package/src/compute-view/element-view/memory/stage-final.ts +129 -0
  82. package/src/compute-view/element-view/memory/stage-include.ts +128 -0
  83. package/src/compute-view/element-view/predicates/_utils.ts +86 -0
  84. package/src/compute-view/element-view/predicates/element-expand.ts +33 -0
  85. package/src/compute-view/element-view/predicates/element-kind-tag.ts +26 -0
  86. package/src/compute-view/element-view/predicates/element-ref.ts +37 -0
  87. package/src/compute-view/element-view/predicates/relation-direct.ts +309 -0
  88. package/src/compute-view/element-view/predicates/relation-in-out.ts +66 -0
  89. package/src/compute-view/element-view/predicates/relation-in.ts +118 -0
  90. package/src/compute-view/element-view/predicates/relation-out.ts +116 -0
  91. package/src/compute-view/element-view/predicates/wildcard.ts +88 -0
  92. package/src/compute-view/element-view/utils.ts +59 -0
  93. package/src/compute-view/index.ts +4 -0
  94. package/src/compute-view/memory/AbstractMemory.ts +45 -0
  95. package/src/compute-view/memory/AbstractStageExclude.ts +216 -0
  96. package/src/compute-view/memory/AbstractStageInclude.ts +200 -0
  97. package/src/compute-view/memory/_types.ts +147 -0
  98. package/src/compute-view/memory/index.ts +5 -0
  99. package/src/compute-view/memory/ops.ts +43 -0
  100. package/src/compute-view/utils/__snapshots__/sortNodes.spec.ts.snap +113 -0
  101. package/src/compute-view/utils/ancestorsOfNode.ts +19 -0
  102. package/src/compute-view/utils/applyCustomElementProperties.ts +66 -0
  103. package/src/compute-view/utils/applyCustomRelationProperties.ts +41 -0
  104. package/src/compute-view/utils/applyViewRuleStyles.ts +53 -0
  105. package/src/compute-view/utils/buildComputedNodes.ts +148 -0
  106. package/src/compute-view/utils/buildElementNotations.ts +63 -0
  107. package/src/compute-view/utils/elementExpressionToPredicate.ts +50 -0
  108. package/src/compute-view/utils/link-nodes-with-edges.ts +54 -0
  109. package/src/compute-view/utils/merge-props-from-relationships.ts +128 -0
  110. package/src/compute-view/utils/relationExpressionToPredicates.ts +55 -0
  111. package/src/compute-view/utils/resolve-extended-views.ts +69 -0
  112. package/src/compute-view/utils/resolve-global-rules.ts +83 -0
  113. package/src/compute-view/utils/topological-sort.ts +256 -0
  114. package/src/compute-view/utils/uniqueTags.test.ts +42 -0
  115. package/src/compute-view/utils/uniqueTags.ts +21 -0
  116. package/src/compute-view/utils/view-hash.ts +27 -0
  117. package/src/compute-view/utils/with-readable-edges.ts +36 -0
  118. package/src/index.ts +22 -12
  119. package/src/model/DeploymentElementModel.ts +599 -0
  120. package/src/model/DeploymentModel.ts +370 -0
  121. package/src/model/ElementModel.ts +221 -0
  122. package/src/model/LikeC4Model.test-d.ts +152 -0
  123. package/src/model/LikeC4Model.ts +336 -457
  124. package/src/model/RelationModel.ts +85 -0
  125. package/src/model/__test__/fixture.ts +149 -338
  126. package/src/model/connection/Connection.ts +72 -0
  127. package/src/model/connection/deployment/DeploymentConnectionModel.ts +178 -0
  128. package/src/model/connection/deployment/find.ts +120 -0
  129. package/src/model/connection/deployment/index.ts +8 -0
  130. package/src/model/connection/index.ts +22 -0
  131. package/src/model/connection/model/ConnectionModel.ts +157 -0
  132. package/src/model/connection/model/find.ts +117 -0
  133. package/src/model/connection/model/index.ts +8 -0
  134. package/src/model/connection/ops.ts +274 -0
  135. package/src/model/guards.ts +9 -0
  136. package/src/model/index.ts +46 -2
  137. package/src/model/types.ts +112 -15
  138. package/src/model/view/EdgeModel.ts +103 -0
  139. package/src/model/view/LikeC4ViewModel.ts +226 -0
  140. package/src/model/view/NodeModel.ts +229 -0
  141. package/src/types/_common.ts +55 -1
  142. package/src/types/deployments.ts +169 -0
  143. package/src/types/element.ts +9 -5
  144. package/src/types/expression-v2.ts +172 -0
  145. package/src/types/expression.ts +17 -11
  146. package/src/types/global.ts +3 -3
  147. package/src/types/index.ts +220 -12
  148. package/src/types/model.ts +75 -12
  149. package/src/types/operators.ts +1 -1
  150. package/src/types/overview-graph.ts +2 -2
  151. package/src/types/relation.ts +18 -14
  152. package/src/types/theme.ts +0 -1
  153. package/src/types/view-notation.ts +2 -2
  154. package/src/types/view.ts +117 -41
  155. package/src/utils/{commonHead.ts → common-head.ts} +2 -0
  156. package/src/utils/const.ts +1 -0
  157. package/src/utils/fqn.ts +203 -56
  158. package/src/utils/getOrCreate.ts +42 -0
  159. package/src/utils/graphlib.ts +10 -0
  160. package/src/utils/index.ts +74 -6
  161. package/src/utils/iterable/_types.ts +5 -0
  162. package/src/utils/iterable/filter.ts +55 -0
  163. package/src/utils/iterable/flat.ts +17 -0
  164. package/src/utils/iterable/index.ts +12 -0
  165. package/src/utils/iterable/map.ts +40 -0
  166. package/src/utils/iterable/reduce.ts +24 -0
  167. package/src/utils/iterable/some.ts +36 -0
  168. package/src/utils/iterable/to.ts +19 -0
  169. package/src/utils/iterable/unique.ts +29 -0
  170. package/src/utils/object-hash.ts +3 -0
  171. package/src/utils/relations.ts +3 -64
  172. package/src/utils/set.ts +78 -0
  173. package/src/utils/string-hash.ts +16 -0
  174. package/dist/index.cjs +0 -5452
  175. package/dist/index.d.cts +0 -1053
  176. package/dist/shared/core.CoLQkcYL.d.ts +0 -734
  177. package/dist/shared/core.DIYZvpVg.cjs +0 -353
  178. package/dist/types/index.cjs +0 -70
  179. package/dist/types/index.d.cts +0 -2
  180. package/dist/types/index.mjs +0 -1
  181. package/src/builder/Builder.test-d.ts +0 -69
  182. package/src/builder/Builder.view.ts +0 -358
  183. package/src/model/LikeC4DiagramModel.ts +0 -338
  184. package/src/model/LikeC4ViewModel.ts +0 -320
@@ -1,353 +0,0 @@
1
- 'use strict';
2
-
3
- function u$1(t,n,a){let o=r=>t(r,...n);return a===void 0?o:Object.assign(o,{lazy:a,lazyArgs:n})}
4
-
5
- function u(r,n,a){let o=r.length-n.length;if(o===0)return r(...n);if(o===1)return u$1(r,n,a);throw new Error("Wrong number of arguments")}
6
-
7
- function o$1(a){return t=>!a(t)}
8
-
9
- function n(e){return e==null}
10
-
11
- function o(r){return Array.isArray(r)}
12
-
13
- function t(...a){return u(e,a)}var e=(a,o)=>o.every(l=>l(a));
14
-
15
- function y(...a){return u(r,a)}var r=(a,o)=>o.some(e=>e(a));
16
-
17
- function nonNullable(value, message) {
18
- if (typeof value === "undefined" || value == null) {
19
- throw new Error(message ?? `Expected defined value, but received ${value}`);
20
- }
21
- return value;
22
- }
23
- function invariant(condition, message) {
24
- if (condition) {
25
- return;
26
- }
27
- throw new Error(message ?? "Invariant failed");
28
- }
29
- function nonexhaustive(value) {
30
- throw new Error(`NonExhaustive value: ${value}`);
31
- }
32
-
33
- function AsFqn(name, parent) {
34
- return parent ? parent + "." + name : name;
35
- }
36
- const BorderStyles = ["solid", "dashed", "dotted", "none"];
37
- exports.ElementKind = void 0;
38
- ((ElementKind2) => {
39
- ElementKind2.Group = "@group";
40
- })(exports.ElementKind || (exports.ElementKind = {}));
41
- const ElementShapes = [
42
- "rectangle",
43
- "person",
44
- "browser",
45
- "mobile",
46
- "cylinder",
47
- "storage",
48
- "queue"
49
- ];
50
- const DefaultThemeColor = "primary";
51
- const DefaultElementShape = "rectangle";
52
-
53
- function isElementRef(expr) {
54
- return "element" in expr;
55
- }
56
- function isExpandedElementExpr(expr) {
57
- return "expanded" in expr;
58
- }
59
- function isCustomElement(expr) {
60
- return "custom" in expr && (isElement(expr.custom.expr) || isElementWhere(expr.custom.expr));
61
- }
62
- function isWildcard(expr) {
63
- return "wildcard" in expr;
64
- }
65
- function isElementKindExpr(expr) {
66
- return "elementKind" in expr && "isEqual" in expr;
67
- }
68
- function isElementTagExpr(expr) {
69
- return "elementTag" in expr && "isEqual" in expr;
70
- }
71
- function isElement(expr) {
72
- return isElementRef(expr) || isWildcard(expr) || isElementKindExpr(expr) || isElementTagExpr(expr) || isExpandedElementExpr(expr);
73
- }
74
- function isElementWhere(expr) {
75
- return "where" in expr && isElement(expr.where.expr);
76
- }
77
- function isElementPredicateExpr(expr) {
78
- return isElement(expr) || isElementWhere(expr) || isCustomElement(expr);
79
- }
80
- function isRelation(expr) {
81
- return "source" in expr && "target" in expr;
82
- }
83
- function isInOut(expr) {
84
- return "inout" in expr;
85
- }
86
- function isIncoming(expr) {
87
- return "incoming" in expr;
88
- }
89
- function isOutgoing(expr) {
90
- return "outgoing" in expr;
91
- }
92
- function isRelationExpression(expr) {
93
- return isRelation(expr) || isInOut(expr) || isIncoming(expr) || isOutgoing(expr);
94
- }
95
- function isRelationWhere(expr) {
96
- return "where" in expr && isRelationExpression(expr.where.expr);
97
- }
98
- function isCustomRelationExpr(expr) {
99
- return "customRelation" in expr;
100
- }
101
- function isRelationPredicateExpr(expr) {
102
- return isRelationExpression(expr) || isRelationWhere(expr) || isCustomRelationExpr(expr);
103
- }
104
-
105
- const expression = {
106
- __proto__: null,
107
- isCustomElement: isCustomElement,
108
- isCustomRelationExpr: isCustomRelationExpr,
109
- isElement: isElement,
110
- isElementKindExpr: isElementKindExpr,
111
- isElementPredicateExpr: isElementPredicateExpr,
112
- isElementRef: isElementRef,
113
- isElementTagExpr: isElementTagExpr,
114
- isElementWhere: isElementWhere,
115
- isExpandedElementExpr: isExpandedElementExpr,
116
- isInOut: isInOut,
117
- isIncoming: isIncoming,
118
- isOutgoing: isOutgoing,
119
- isRelation: isRelation,
120
- isRelationExpression: isRelationExpression,
121
- isRelationPredicateExpr: isRelationPredicateExpr,
122
- isRelationWhere: isRelationWhere,
123
- isWildcard: isWildcard
124
- };
125
-
126
- const isTagEqual = (operator) => {
127
- return "tag" in operator;
128
- };
129
- const isKindEqual = (operator) => {
130
- return "kind" in operator;
131
- };
132
- const isNotOperator = (operator) => {
133
- return "not" in operator;
134
- };
135
- const isAndOperator = (operator) => {
136
- return "and" in operator;
137
- };
138
- const isOrOperator = (operator) => {
139
- return "or" in operator;
140
- };
141
- function whereOperatorAsPredicate(operator) {
142
- switch (true) {
143
- case isTagEqual(operator): {
144
- if ("eq" in operator.tag) {
145
- const tag2 = operator.tag.eq;
146
- return (value) => {
147
- return Array.isArray(value.tags) && value.tags.includes(tag2);
148
- };
149
- }
150
- const tag = operator.tag.neq;
151
- return (value) => {
152
- return !Array.isArray(value.tags) || !value.tags.includes(tag);
153
- };
154
- }
155
- case isKindEqual(operator): {
156
- if ("eq" in operator.kind) {
157
- const kind2 = operator.kind.eq;
158
- return (value) => {
159
- return value.kind === kind2;
160
- };
161
- }
162
- const kind = operator.kind.neq;
163
- return (value) => {
164
- return n(value.kind) || value.kind !== kind;
165
- };
166
- }
167
- case isNotOperator(operator): {
168
- const predicate = whereOperatorAsPredicate(operator.not);
169
- return o$1(predicate);
170
- }
171
- case isAndOperator(operator): {
172
- const predicates = operator.and.map(whereOperatorAsPredicate);
173
- return t(predicates);
174
- }
175
- case isOrOperator(operator): {
176
- const predicates = operator.or.map(whereOperatorAsPredicate);
177
- return y(predicates);
178
- }
179
- default:
180
- nonexhaustive(operator);
181
- }
182
- }
183
-
184
- const DefaultLineStyle = "dashed";
185
- const DefaultArrowType = "normal";
186
- const DefaultRelationshipColor = "gray";
187
-
188
- const ThemeColors = [
189
- "amber",
190
- "blue",
191
- "gray",
192
- "slate",
193
- "green",
194
- "indigo",
195
- "muted",
196
- "primary",
197
- "red",
198
- "secondary",
199
- "sky"
200
- ];
201
- function isThemeColor(color) {
202
- return color in ThemeColors;
203
- }
204
-
205
- function isViewRulePredicate(rule) {
206
- return "include" in rule && Array.isArray(rule.include) || "exclude" in rule && Array.isArray(rule.exclude);
207
- }
208
- function isViewRuleGlobalPredicateRef(rule) {
209
- return "predicateId" in rule;
210
- }
211
- function isViewRuleStyle(rule) {
212
- return "style" in rule && "targets" in rule;
213
- }
214
- function isViewRuleGlobalStyle(rule) {
215
- return "styleId" in rule;
216
- }
217
- function isAutoLayoutDirection(autoLayout) {
218
- return autoLayout === "TB" || autoLayout === "BT" || autoLayout === "LR" || autoLayout === "RL";
219
- }
220
- function isViewRuleAutoLayout(rule) {
221
- return "direction" in rule;
222
- }
223
- function isViewRuleGroup(rule) {
224
- return "title" in rule && "groupRules" in rule && Array.isArray(rule.groupRules);
225
- }
226
- function isDynamicViewIncludeRule(rule) {
227
- return "include" in rule && Array.isArray(rule.include);
228
- }
229
- function isDynamicViewParallelSteps(step) {
230
- return "__parallel" in step && o(step.__parallel);
231
- }
232
- function isDynamicView(view) {
233
- return view.__ === "dynamic";
234
- }
235
- function isElementView(view) {
236
- return n(view.__) || view.__ === "element";
237
- }
238
- function isExtendsElementView(view) {
239
- return isElementView(view) && "extends" in view;
240
- }
241
- function isScopedElementView(view) {
242
- return isElementView(view) && "viewOf" in view;
243
- }
244
- function StepEdgeId(step, parallelStep) {
245
- const id = `step-${String(step).padStart(2, "0")}`;
246
- return parallelStep ? `${id}.${parallelStep}` : id;
247
- }
248
- function isStepEdgeId(id) {
249
- return id.startsWith("step-");
250
- }
251
- function extractStep(id) {
252
- if (!isStepEdgeId(id)) {
253
- throw new Error(`Invalid step edge id: ${id}`);
254
- }
255
- return parseFloat(id.slice("step-".length));
256
- }
257
- function getParallelStepsPrefix(id) {
258
- if (isStepEdgeId(id) && id.includes(".")) {
259
- return id.slice(0, id.indexOf(".") + 1);
260
- }
261
- return null;
262
- }
263
- exports.ComputedNode = void 0;
264
- ((ComputedNode2) => {
265
- function isNodesGroup(node) {
266
- return node.kind === exports.ElementKind.Group;
267
- }
268
- ComputedNode2.isNodesGroup = isNodesGroup;
269
- })(exports.ComputedNode || (exports.ComputedNode = {}));
270
- function isComputedDynamicView(view) {
271
- return view.__ === "dynamic";
272
- }
273
- function isComputedElementView(view) {
274
- return n(view.__) || view.__ === "element";
275
- }
276
- function getBBoxCenter({
277
- x,
278
- y,
279
- width,
280
- height
281
- }) {
282
- return {
283
- x: x + width / 2,
284
- y: y + height / 2
285
- };
286
- }
287
- exports.DiagramNode = void 0;
288
- ((DiagramNode2) => {
289
- function isNodesGroup(node) {
290
- return node.kind === exports.ElementKind.Group;
291
- }
292
- DiagramNode2.isNodesGroup = isNodesGroup;
293
- })(exports.DiagramNode || (exports.DiagramNode = {}));
294
-
295
- exports.AsFqn = AsFqn;
296
- exports.BorderStyles = BorderStyles;
297
- exports.DefaultArrowType = DefaultArrowType;
298
- exports.DefaultElementShape = DefaultElementShape;
299
- exports.DefaultLineStyle = DefaultLineStyle;
300
- exports.DefaultRelationshipColor = DefaultRelationshipColor;
301
- exports.DefaultThemeColor = DefaultThemeColor;
302
- exports.ElementShapes = ElementShapes;
303
- exports.StepEdgeId = StepEdgeId;
304
- exports.expression = expression;
305
- exports.extractStep = extractStep;
306
- exports.getBBoxCenter = getBBoxCenter;
307
- exports.getParallelStepsPrefix = getParallelStepsPrefix;
308
- exports.invariant = invariant;
309
- exports.isAndOperator = isAndOperator;
310
- exports.isAutoLayoutDirection = isAutoLayoutDirection;
311
- exports.isComputedDynamicView = isComputedDynamicView;
312
- exports.isComputedElementView = isComputedElementView;
313
- exports.isCustomElement = isCustomElement;
314
- exports.isCustomRelationExpr = isCustomRelationExpr;
315
- exports.isDynamicView = isDynamicView;
316
- exports.isDynamicViewIncludeRule = isDynamicViewIncludeRule;
317
- exports.isDynamicViewParallelSteps = isDynamicViewParallelSteps;
318
- exports.isElement = isElement;
319
- exports.isElementKindExpr = isElementKindExpr;
320
- exports.isElementPredicateExpr = isElementPredicateExpr;
321
- exports.isElementRef = isElementRef;
322
- exports.isElementTagExpr = isElementTagExpr;
323
- exports.isElementView = isElementView;
324
- exports.isElementWhere = isElementWhere;
325
- exports.isExpandedElementExpr = isExpandedElementExpr;
326
- exports.isExtendsElementView = isExtendsElementView;
327
- exports.isInOut = isInOut;
328
- exports.isIncoming = isIncoming;
329
- exports.isKindEqual = isKindEqual;
330
- exports.isNotOperator = isNotOperator;
331
- exports.isOrOperator = isOrOperator;
332
- exports.isOutgoing = isOutgoing;
333
- exports.isRelation = isRelation;
334
- exports.isRelationExpression = isRelationExpression;
335
- exports.isRelationPredicateExpr = isRelationPredicateExpr;
336
- exports.isRelationWhere = isRelationWhere;
337
- exports.isScopedElementView = isScopedElementView;
338
- exports.isStepEdgeId = isStepEdgeId;
339
- exports.isTagEqual = isTagEqual;
340
- exports.isThemeColor = isThemeColor;
341
- exports.isViewRuleAutoLayout = isViewRuleAutoLayout;
342
- exports.isViewRuleGlobalPredicateRef = isViewRuleGlobalPredicateRef;
343
- exports.isViewRuleGlobalStyle = isViewRuleGlobalStyle;
344
- exports.isViewRuleGroup = isViewRuleGroup;
345
- exports.isViewRulePredicate = isViewRulePredicate;
346
- exports.isViewRuleStyle = isViewRuleStyle;
347
- exports.isWildcard = isWildcard;
348
- exports.n = n;
349
- exports.nonNullable = nonNullable;
350
- exports.nonexhaustive = nonexhaustive;
351
- exports.o = o;
352
- exports.u = u;
353
- exports.whereOperatorAsPredicate = whereOperatorAsPredicate;
@@ -1,70 +0,0 @@
1
- 'use strict';
2
-
3
- const types_index = require('../shared/core.DIYZvpVg.cjs');
4
-
5
-
6
-
7
- exports.AsFqn = types_index.AsFqn;
8
- exports.BorderStyles = types_index.BorderStyles;
9
- Object.defineProperty(exports, "ComputedNode", {
10
- enumerable: true,
11
- get: function () { return types_index.ComputedNode; }
12
- });
13
- exports.DefaultArrowType = types_index.DefaultArrowType;
14
- exports.DefaultElementShape = types_index.DefaultElementShape;
15
- exports.DefaultLineStyle = types_index.DefaultLineStyle;
16
- exports.DefaultRelationshipColor = types_index.DefaultRelationshipColor;
17
- exports.DefaultThemeColor = types_index.DefaultThemeColor;
18
- Object.defineProperty(exports, "DiagramNode", {
19
- enumerable: true,
20
- get: function () { return types_index.DiagramNode; }
21
- });
22
- Object.defineProperty(exports, "ElementKind", {
23
- enumerable: true,
24
- get: function () { return types_index.ElementKind; }
25
- });
26
- exports.ElementShapes = types_index.ElementShapes;
27
- exports.StepEdgeId = types_index.StepEdgeId;
28
- exports.extractStep = types_index.extractStep;
29
- exports.getBBoxCenter = types_index.getBBoxCenter;
30
- exports.getParallelStepsPrefix = types_index.getParallelStepsPrefix;
31
- exports.isAndOperator = types_index.isAndOperator;
32
- exports.isAutoLayoutDirection = types_index.isAutoLayoutDirection;
33
- exports.isComputedDynamicView = types_index.isComputedDynamicView;
34
- exports.isComputedElementView = types_index.isComputedElementView;
35
- exports.isCustomElement = types_index.isCustomElement;
36
- exports.isCustomRelationExpr = types_index.isCustomRelationExpr;
37
- exports.isDynamicView = types_index.isDynamicView;
38
- exports.isDynamicViewIncludeRule = types_index.isDynamicViewIncludeRule;
39
- exports.isDynamicViewParallelSteps = types_index.isDynamicViewParallelSteps;
40
- exports.isElement = types_index.isElement;
41
- exports.isElementKindExpr = types_index.isElementKindExpr;
42
- exports.isElementPredicateExpr = types_index.isElementPredicateExpr;
43
- exports.isElementRef = types_index.isElementRef;
44
- exports.isElementTagExpr = types_index.isElementTagExpr;
45
- exports.isElementView = types_index.isElementView;
46
- exports.isElementWhere = types_index.isElementWhere;
47
- exports.isExpandedElementExpr = types_index.isExpandedElementExpr;
48
- exports.isExtendsElementView = types_index.isExtendsElementView;
49
- exports.isInOut = types_index.isInOut;
50
- exports.isIncoming = types_index.isIncoming;
51
- exports.isKindEqual = types_index.isKindEqual;
52
- exports.isNotOperator = types_index.isNotOperator;
53
- exports.isOrOperator = types_index.isOrOperator;
54
- exports.isOutgoing = types_index.isOutgoing;
55
- exports.isRelation = types_index.isRelation;
56
- exports.isRelationExpression = types_index.isRelationExpression;
57
- exports.isRelationPredicateExpr = types_index.isRelationPredicateExpr;
58
- exports.isRelationWhere = types_index.isRelationWhere;
59
- exports.isScopedElementView = types_index.isScopedElementView;
60
- exports.isStepEdgeId = types_index.isStepEdgeId;
61
- exports.isTagEqual = types_index.isTagEqual;
62
- exports.isThemeColor = types_index.isThemeColor;
63
- exports.isViewRuleAutoLayout = types_index.isViewRuleAutoLayout;
64
- exports.isViewRuleGlobalPredicateRef = types_index.isViewRuleGlobalPredicateRef;
65
- exports.isViewRuleGlobalStyle = types_index.isViewRuleGlobalStyle;
66
- exports.isViewRuleGroup = types_index.isViewRuleGroup;
67
- exports.isViewRulePredicate = types_index.isViewRulePredicate;
68
- exports.isViewRuleStyle = types_index.isViewRuleStyle;
69
- exports.isWildcard = types_index.isWildcard;
70
- exports.whereOperatorAsPredicate = types_index.whereOperatorAsPredicate;
@@ -1,2 +0,0 @@
1
- export { aG as AndOperator, G as AsFqn, A as AutoLayoutDirection, bF as BBox, bc as BasicElementView, bb as BasicView, B as BorderStyle, J as BorderStyles, C as Color, aS as ColorLiteral, bC as ComputedDynamicView, q as ComputedEdge, bB as ComputedElementView, r as ComputedLikeC4Model, n as ComputedNode, l as ComputedView, y as CustomColor, bo as CustomColorDefinitions, g as CustomElementExpr, h as CustomRelationExpr, aP as DefaultArrowType, O as DefaultElementShape, aO as DefaultLineStyle, aQ as DefaultRelationshipColor, M as DefaultThemeColor, v as DiagramEdge, u as DiagramNode, D as DiagramView, bm as DynamicView, bj as DynamicViewIncludeRule, bh as DynamicViewParallelSteps, bl as DynamicViewRule, bg as DynamicViewStep, bi as DynamicViewStepOrParallel, k as EdgeId, d as Element, a8 as ElementExpression, p as ElementKind, a4 as ElementKindExpr, E as ElementKindSpecification, Y as ElementKindSpecificationStyle, bJ as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, a as ElementShape, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aU as ElementThemeColorValues, aV as ElementThemeColors, bf as ElementView, aa as ElementWhereExpr, az as EqualOperator, $ as ExpandedElementExpr, f as Expression, be as ExtendsElementView, aL as Filterable, F as Fqn, av as GlobalDynamicPredicates, at as GlobalPredicateId, au as GlobalPredicates, aw as GlobalStyleID, ax as GlobalStyles, H as HexColorLiteral, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, aC as KindEqual, s as LayoutedLikeC4Model, aY as LikeC4Theme, L as LikeC4View, U as Link, ay as ModelGlobals, o as NodeId, N as NonEmptyArray, x as NonEmptyReadonlyArray, aE as NotOperator, aI as OrOperator, ak as OutgoingExpr, aN as OverviewGraph, P as ParsedLikeC4Model, z as Point, e as Relation, ae as RelationExpr, am as RelationExpression, i as RelationID, ar as RelationPredicateExpression, ao as RelationWhereExpr, b as RelationshipArrowType, t as RelationshipKind, R as RelationshipKindSpecification, c as RelationshipLineType, aW as RelationshipThemeColorValues, aX as RelationshipThemeColors, bd as ScopedElementView, bu as StepEdgeId, bt as StepEdgeIdLiteral, m as Tag, aA as TagEqual, S as TagSpec, aR as ThemeColor, T as ThemeColorValues, W as TypedElement, bA as ViewAutoLayout, bI as ViewChange, j as ViewID, bH as ViewManualLayout, ba as ViewRule, b6 as ViewRuleAutoLayout, a$ as ViewRuleGlobalPredicateRef, b2 as ViewRuleGlobalStyle, b8 as ViewRuleGroup, aZ as ViewRulePredicate, V as ViewRuleStyle, b4 as ViewRuleStyleOrGlobalRef, by as ViewWithHash, bz as ViewWithNotation, aK as WhereOperator, a2 as WildcardExpr, X as XYPoint, bw as extractStep, bG as getBBoxCenter, bx as getParallelStepsPrefix, aH as isAndOperator, b5 as isAutoLayoutDirection, bD as isComputedDynamicView, bE as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bp as isDynamicView, bk as isDynamicViewIncludeRule, bn as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bq as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, br as isExtendsElementView, ah as isInOut, aj as isIncoming, aD as isKindEqual, aF as isNotOperator, aJ as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bs as isScopedElementView, bv as isStepEdgeId, aB as isTagEqual, aT as isThemeColor, b7 as isViewRuleAutoLayout, b0 as isViewRuleGlobalPredicateRef, b3 as isViewRuleGlobalStyle, b9 as isViewRuleGroup, a_ as isViewRulePredicate, b1 as isViewRuleStyle, a3 as isWildcard, aM as whereOperatorAsPredicate } from '../shared/core.CoLQkcYL.cjs';
2
- import 'type-fest';
@@ -1 +0,0 @@
1
- export { A as AsFqn, B as BorderStyles, a3 as ComputedNode, N as DefaultArrowType, c as DefaultElementShape, M as DefaultLineStyle, e as DefaultRelationshipColor, D as DefaultThemeColor, a7 as DiagramNode, E as ElementKind, h as ElementShapes, $ as StepEdgeId, a1 as extractStep, a6 as getBBoxCenter, a2 as getParallelStepsPrefix, J as isAndOperator, T as isAutoLayoutDirection, a4 as isComputedDynamicView, a5 as isComputedElementView, l as isCustomElement, C as isCustomRelationExpr, Y as isDynamicView, W as isDynamicViewIncludeRule, X as isDynamicViewParallelSteps, r as isElement, p as isElementKindExpr, i as isElementPredicateExpr, j as isElementRef, q as isElementTagExpr, Z as isElementView, s as isElementWhere, k as isExpandedElementExpr, _ as isExtendsElementView, v as isInOut, w as isIncoming, H as isKindEqual, I as isNotOperator, K as isOrOperator, x as isOutgoing, t as isRelation, y as isRelationExpression, F as isRelationPredicateExpr, z as isRelationWhere, b as isScopedElementView, a0 as isStepEdgeId, G as isTagEqual, O as isThemeColor, U as isViewRuleAutoLayout, Q as isViewRuleGlobalPredicateRef, S as isViewRuleGlobalStyle, V as isViewRuleGroup, P as isViewRulePredicate, R as isViewRuleStyle, m as isWildcard, L as whereOperatorAsPredicate } from '../shared/core.BXTs-8n7.mjs';
@@ -1,69 +0,0 @@
1
- import { expectTypeOf, test } from 'vitest'
2
- import type { ParsedLikeC4Model } from '../types'
3
- import { Builder } from './Builder'
4
-
5
- test('should have types', () => {
6
- const {
7
- model: {
8
- model,
9
- actor,
10
- system,
11
- component,
12
- relTo
13
- },
14
- views: {
15
- views,
16
- view,
17
- viewOf,
18
- $include
19
- },
20
- builder
21
- } = Builder.forSpecification({
22
- elements: {
23
- actor: {
24
- style: {
25
- shape: 'person'
26
- }
27
- },
28
- system: {},
29
- component: {}
30
- },
31
- relationships: {
32
- like: {},
33
- dislike: {}
34
- },
35
- tags: ['tag1', 'tag2', 'tag1']
36
- })
37
-
38
- const m = builder
39
- .with(
40
- model(
41
- actor('alice'),
42
- actor('bob'),
43
- system('cloud').with(
44
- component('backend').with(
45
- component('api'),
46
- component('db')
47
- ),
48
- component('frontend').with(
49
- relTo('cloud.backend.api')
50
- )
51
- )
52
- ),
53
- views(
54
- view('index', $include('*')),
55
- viewOf('cloud', 'cloud', $include('*'))
56
- )
57
- )
58
- .build()
59
-
60
- expectTypeOf(m).toEqualTypeOf(
61
- {} as ParsedLikeC4Model<
62
- 'actor' | 'system' | 'component',
63
- 'like' | 'dislike',
64
- 'tag1' | 'tag2',
65
- 'alice' | 'bob' | 'cloud' | 'cloud.backend' | 'cloud.backend.api' | 'cloud.backend.db' | 'cloud.frontend',
66
- 'index' | 'cloud'
67
- >
68
- )
69
- })