@likec4/core 1.38.1 → 1.39.1

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 (98) hide show
  1. package/dist/builder/index.d.mts +6 -3
  2. package/dist/builder/index.mjs +55 -111
  3. package/dist/compute-view/index.d.mts +6 -3
  4. package/dist/compute-view/index.mjs +33 -34
  5. package/dist/compute-view/relationships-view/index.d.mts +6 -3
  6. package/dist/compute-view/relationships-view/index.mjs +6 -6
  7. package/dist/index.d.mts +8 -5
  8. package/dist/index.mjs +15 -24
  9. package/dist/model/connection/deployment/index.d.mts +8 -5
  10. package/dist/model/connection/deployment/index.mjs +7 -9
  11. package/dist/model/connection/index.d.mts +10 -7
  12. package/dist/model/connection/index.mjs +10 -14
  13. package/dist/model/connection/model/index.d.mts +8 -5
  14. package/dist/model/connection/model/index.mjs +7 -10
  15. package/dist/model/index.d.mts +13 -10
  16. package/dist/model/index.mjs +17 -20
  17. package/dist/shared/core.20m8Um0g.d.mts +253 -0
  18. package/dist/shared/{core.CpwrZi3D.mjs → core.4u1dVmfX.mjs} +3 -5
  19. package/dist/shared/{core.Bp-IQmJR.mjs → core.BB6zA-UU.mjs} +9 -214
  20. package/dist/shared/{core.BH0VqY-7.mjs → core.BVNaR17u.mjs} +1 -1
  21. package/dist/shared/{core.BL_xjl90.mjs → core.Be1n9a0i.mjs} +4 -5
  22. package/dist/shared/{core.BoyJPEen.mjs → core.Be4Jy9Qx.mjs} +2 -2
  23. package/dist/shared/{core.H8NbNp2X.mjs → core.BqVo8LrH.mjs} +1 -1
  24. package/dist/shared/{core.DDoAFHHp.mjs → core.BuoXfSMj.mjs} +1 -1
  25. package/dist/shared/{core.DhDo8LAz.d.mts → core.C7pZp1nR.d.mts} +3 -3
  26. package/dist/shared/{core.BH9nN-_I.mjs → core.CCD1ID81.mjs} +3 -4
  27. package/dist/shared/{core.8KM0D6va.mjs → core.CNGyqkJh.mjs} +1 -9
  28. package/dist/shared/{core.B0oEIXqd.mjs → core.CUw_2J9j.mjs} +1 -1
  29. package/dist/shared/{core.C4Cn4Jy_.mjs → core.CWv15GLo.mjs} +11 -15
  30. package/dist/shared/{core.Bf5zKDK1.d.mts → core.CXCmvCws.d.mts} +2 -2
  31. package/dist/shared/core.CaT0SUUK.mjs +201 -0
  32. package/dist/shared/{core.Dtw1SBlz.d.mts → core.ClpXZ4Ib.d.mts} +3 -3
  33. package/dist/shared/{core.DC6zzxS0.mjs → core.CsbOakly.mjs} +13 -22
  34. package/dist/shared/{core.Btl47GOn.mjs → core.DLpidoWc.mjs} +2 -2
  35. package/dist/shared/{core.wwaSalox.d.mts → core.DM3vdkO_.d.mts} +1 -1
  36. package/dist/shared/core.DXhDWKFZ.d.mts +3 -0
  37. package/dist/shared/{core.O6FG0HF9.d.mts → core.DdzRtJ9d.d.mts} +1 -1
  38. package/dist/shared/{core.OUoo2ohq.mjs → core.DgttqsJc.mjs} +5 -9
  39. package/dist/shared/{core.Dhc0yIwT.mjs → core.DlG1xWt2.mjs} +3 -43
  40. package/dist/shared/core.DnRszv-l.mjs +11982 -0
  41. package/dist/shared/core.DoM6aM9N.mjs +7 -0
  42. package/dist/shared/{core.CzHQRs5x.mjs → core.DozSPE83.mjs} +43 -60
  43. package/dist/shared/{core.DsMrjY2q.mjs → core.GTgsmXS_.mjs} +2 -2
  44. package/dist/shared/core.ILwny7BV.mjs +38 -0
  45. package/dist/shared/core.PHwHXzkG.d.mts +213 -0
  46. package/dist/shared/core.T-eLZTW_.mjs +59 -0
  47. package/dist/shared/{core.CE_hG7EJ.d.mts → core.aWJgARyY.d.mts} +10 -486
  48. package/dist/shared/{core.BvlHvikl.d.mts → core.v1iEaXaR.d.mts} +5 -3
  49. package/dist/shared/core.yHe79zEl.mjs +98 -0
  50. package/dist/theme/index.d.mts +3 -126
  51. package/dist/theme/index.mjs +2 -3
  52. package/dist/types/_aux.d.mts +1 -1
  53. package/dist/types/expression-model.d.mts +191 -0
  54. package/dist/types/expression-model.mjs +112 -0
  55. package/dist/types/expression.d.mts +7 -0
  56. package/dist/types/expression.mjs +116 -0
  57. package/dist/types/fqnRef.d.mts +61 -0
  58. package/dist/types/fqnRef.mjs +46 -0
  59. package/dist/types/index.d.mts +6 -3
  60. package/dist/types/index.mjs +9 -9
  61. package/dist/types/scalar.mjs +2 -3
  62. package/dist/utils/index.d.mts +6 -428
  63. package/dist/utils/index.mjs +56 -15
  64. package/dist/utils/iterable/index.d.mts +2 -3
  65. package/dist/utils/iterable/index.mjs +9 -44
  66. package/package.json +8 -7
  67. package/src/index.ts +24 -1
  68. package/src/model/RelationModel.ts +1 -1
  69. package/src/model/index.ts +1 -1
  70. package/src/theme/element.ts +2 -2
  71. package/src/theme/relationships.ts +2 -2
  72. package/src/types/RichText.ts +1 -1
  73. package/src/types/expression-model.ts +3 -1
  74. package/src/types/expression.ts +3 -1
  75. package/src/types/fqnRef.ts +4 -1
  76. package/src/utils/guards.ts +0 -1
  77. package/src/utils/index.ts +0 -1
  78. package/dist/shared/core.BW8K1y6R.mjs +0 -278
  79. package/dist/shared/core.BgvIuGGU.mjs +0 -3
  80. package/dist/shared/core.BpJu1RrF.mjs +0 -5
  81. package/dist/shared/core.ByrmCl9I.mjs +0 -5
  82. package/dist/shared/core.CnIyafWn.mjs +0 -3
  83. package/dist/shared/core.DK6I-Nr7.mjs +0 -149
  84. package/dist/shared/core.DbRvwARP.mjs +0 -5
  85. package/dist/shared/core.Dw47t7nG.mjs +0 -5236
  86. package/dist/shared/core.zLlww-07.mjs +0 -3
  87. package/src/builder/__snapshots__/Builder-style1.spec.ts.snap +0 -425
  88. package/src/builder/__snapshots__/Builder-style2.compute-model.json5 +0 -318
  89. package/src/builder/__snapshots__/Builder-style2.spec.ts.snap +0 -221
  90. package/src/compute-view/deployment-view/__test__/TestHelper.ts +0 -249
  91. package/src/compute-view/deployment-view/__test__/fixture.ts +0 -238
  92. package/src/compute-view/dynamic-view/__test__/fixture.ts +0 -67
  93. package/src/compute-view/element-view/__test__/TestHelper.ts +0 -282
  94. package/src/compute-view/element-view/__test__/__snapshots__/legacy.spec.ts.snap +0 -458
  95. package/src/compute-view/element-view/__test__/fixture.ts +0 -749
  96. package/src/compute-view/utils/__snapshots__/sortNodes.spec.ts.snap +0 -113
  97. package/src/model/__test__/fixture.ts +0 -168
  98. package/src/theme/__test__/theme-index.ts +0 -29
@@ -1,8 +1,7 @@
1
+ export { i as isIterable } from '../../shared/core.DXhDWKFZ.mjs';
1
2
  import { I as IteratorLike } from '../../shared/core.DuSLYTG6.mjs';
2
3
  import 'type-fest';
3
4
 
4
- declare function isIterable<T, I extends Iterable<T>>(something: I | unknown): something is Iterable<T>;
5
-
6
5
  /**
7
6
  * Filters an iterable based on a predicate.
8
7
  * Composabel first version of `ifilter`.
@@ -114,4 +113,4 @@ declare function toSet<T>(iterable: Iterable<T>): Set<T>;
114
113
  declare function iunique(): <T>(iterable: Iterable<T>) => IteratorLike<T>;
115
114
  declare function iunique<T>(iterable: Iterable<T>): IteratorLike<T>;
116
115
 
117
- export { ifilter, ifind, ifirst, iflat, ihead, imap, ireduce, isIterable, isome, iunique, toArray, toSet };
116
+ export { ifilter, ifind, ifirst, iflat, ihead, imap, ireduce, isome, iunique, toArray, toSet };
@@ -1,44 +1,9 @@
1
- import { n } from '../../shared/core.8KM0D6va.mjs';
2
- export { i as iflat, a as isIterable, b as iunique } from '../../shared/core.8KM0D6va.mjs';
3
- import { t } from '../../shared/core.BH9nN-_I.mjs';
4
- export { i as ifilter } from '../../shared/core.BH9nN-_I.mjs';
5
- export { i as ifind, a as ihead } from '../../shared/core.DsMrjY2q.mjs';
6
- import { i as invariant } from '../../shared/core.D4npX2q8.mjs';
7
- export { i as imap, t as toArray, a as toSet } from '../../shared/core.Btl47GOn.mjs';
8
- export { i as isome } from '../../shared/core.BoyJPEen.mjs';
9
-
10
- function ifirst(arg1, arg2) {
11
- const count = arg2 ?? arg1;
12
- invariant(typeof count === "number" && count >= 0, "Count must be a non-negative number");
13
- function* _first(iter) {
14
- let taken = 0;
15
- for (const value of iter) {
16
- if (taken >= count) {
17
- break;
18
- }
19
- yield value;
20
- taken++;
21
- }
22
- return;
23
- }
24
- if (arg2 === void 0) {
25
- return (iterable) => _first(iterable);
26
- }
27
- return _first(arg1);
28
- }
29
-
30
- function ireduce(arg1, arg2, arg3) {
31
- const reducer = n(arg3) ? arg2 : arg1;
32
- const initialValue = arg3 ?? arg2;
33
- invariant(t(reducer));
34
- function _reduce(iter) {
35
- let acc = initialValue;
36
- for (const value of iter) {
37
- acc = reducer(acc, value);
38
- }
39
- return acc;
40
- }
41
- return n(arg3) ? _reduce(arg1) : _reduce;
42
- }
43
-
44
- export { ifirst, ireduce };
1
+ export { i as isIterable } from '../../shared/core.DoM6aM9N.mjs';
2
+ export { i as ifilter } from '../../shared/core.CCD1ID81.mjs';
3
+ export { i as ifind, a as ihead } from '../../shared/core.GTgsmXS_.mjs';
4
+ export { i as ifirst, a as ireduce } from '../../shared/core.ILwny7BV.mjs';
5
+ export { i as iflat, a as iunique } from '../../shared/core.CNGyqkJh.mjs';
6
+ export { i as imap, t as toArray, a as toSet } from '../../shared/core.DLpidoWc.mjs';
7
+ export { i as isome } from '../../shared/core.Be4Jy9Qx.mjs';
8
+ import 'remeda';
9
+ import '../../shared/core.D4npX2q8.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likec4/core",
3
- "version": "1.38.1",
3
+ "version": "1.39.1",
4
4
  "license": "MIT",
5
5
  "homepage": "https://likec4.dev",
6
6
  "author": "Denis Davydkov <denis@davydkov.com>",
@@ -16,7 +16,8 @@
16
16
  "src",
17
17
  "!**/*.spec.ts",
18
18
  "!**/*.test-d.ts",
19
- "!**/__tests__/*",
19
+ "!**/__test__/*",
20
+ "!**/__snapshots__/*",
20
21
  "!**/*.map"
21
22
  ],
22
23
  "type": "module",
@@ -99,6 +100,8 @@
99
100
  "type-fest": "^4.41.0",
100
101
  "unified": "11.0.5",
101
102
  "chroma-js": "^3.1.2",
103
+ "remeda": "^2.23.1",
104
+ "defu": "^6.1.4",
102
105
  "@mantine/colors-generator": "8.2.4"
103
106
  },
104
107
  "devDependencies": {
@@ -110,9 +113,7 @@
110
113
  "@types/natural-compare-lite": "^1.4.2",
111
114
  "@types/object-hash": "^3.0.6",
112
115
  "@types/unist": "3.0.3",
113
- "@types/node": "~20.19.2",
114
- "defu": "^6.1.4",
115
- "fdir": "6.4.6",
116
+ "@types/node": "~20.19.11",
116
117
  "graphology": "^0.25.4",
117
118
  "graphology-dag": "^0.4.1",
118
119
  "graphology-types": "^0.24.8",
@@ -120,12 +121,12 @@
120
121
  "natural-compare-lite": "^1.4.0",
121
122
  "object-hash": "^3.0.0",
122
123
  "obliterator": "^2.0.5",
123
- "remeda": "^2.23.1",
124
+ "fdir": "6.4.6",
124
125
  "turbo": "2.5.6",
125
126
  "typescript": "5.9.2",
126
127
  "unbuild": "3.5.0",
127
128
  "vitest": "3.2.4",
128
- "@likec4/tsconfig": "1.38.1"
129
+ "@likec4/tsconfig": "1.39.1"
129
130
  },
130
131
  "scripts": {
131
132
  "typecheck": "tsc -b --verbose",
package/src/index.ts CHANGED
@@ -7,4 +7,27 @@ export {
7
7
 
8
8
  export * from './types'
9
9
 
10
- export * from './utils'
10
+ export {
11
+ ancestorsFqn,
12
+ BiMap,
13
+ DefaultMap,
14
+ DefaultWeakMap,
15
+ invariant,
16
+ isAncestor,
17
+ isDescendantOf,
18
+ isIterable,
19
+ isNonEmptyArray,
20
+ isSameHierarchy,
21
+ isString,
22
+ type IterableContainer,
23
+ LinkedList,
24
+ memoizeProp,
25
+ MultiMap,
26
+ nameFromFqn,
27
+ nonexhaustive,
28
+ nonNullable,
29
+ parentFqn,
30
+ Queue,
31
+ sortNaturalByFqn,
32
+ sortParentsFirst,
33
+ } from './utils'
@@ -24,7 +24,7 @@ export type RelationshipsIterator<A extends AnyAux> = IteratorLike<RelationshipM
24
24
  * A relationship between two elements (in logical or deployment model)
25
25
  * use {@link isDeploymentRelationModel} guard to check if the relationship is a deployment relationship
26
26
  */
27
- export interface AnyRelationshipModel<A extends AnyAux> extends WithTags<A>, WithMetadata<A> {
27
+ export interface AnyRelationshipModel<A extends AnyAux = AnyAux> extends WithTags<A>, WithMetadata<A> {
28
28
  readonly id: scalar.RelationId
29
29
  readonly expression: string
30
30
  readonly title: string | null
@@ -1,6 +1,6 @@
1
1
  export { ElementModel } from './ElementModel'
2
2
  export { type AnyLikeC4Model, LikeC4Model } from './LikeC4Model'
3
- export { RelationshipModel } from './RelationModel'
3
+ export { type AnyRelationshipModel, RelationshipModel } from './RelationModel'
4
4
 
5
5
  export {
6
6
  Connection,
@@ -21,7 +21,7 @@ const slate = {
21
21
  loContrast: '#cbd5e1',
22
22
  } satisfies ElementThemeColorValues
23
23
 
24
- export const ElementColors = {
24
+ export const ElementColors: ElementThemeColors = {
25
25
  primary: blue,
26
26
  blue,
27
27
  secondary: sky,
@@ -58,4 +58,4 @@ export const ElementColors = {
58
58
  hiContrast: '#eef2ff',
59
59
  loContrast: '#c7d2fe',
60
60
  },
61
- } as const satisfies ElementThemeColors
61
+ }
@@ -23,7 +23,7 @@ const sky = {
23
23
  labelColor: '#38bdf8', // 400
24
24
  } satisfies RelationshipThemeColorValues
25
25
 
26
- export const RelationshipColors = {
26
+ export const RelationshipColors: RelationshipThemeColors = {
27
27
  amber: {
28
28
  lineColor: '#b45309',
29
29
  labelBgColor: '#78350f',
@@ -51,4 +51,4 @@ export const RelationshipColors = {
51
51
  secondary: sky,
52
52
  sky,
53
53
  slate,
54
- } satisfies RelationshipThemeColors
54
+ }
@@ -1,5 +1,5 @@
1
- import type { MarkdownOrString } from '../types'
2
1
  import { markdownToHtml, markdownToText, memoizeProp, nonexhaustive } from '../utils'
2
+ import type { MarkdownOrString } from './scalar'
3
3
 
4
4
  const richtxt = Symbol.for('richtxt')
5
5
  const symb_text = Symbol.for('text')
@@ -1,5 +1,4 @@
1
1
  import type * as aux from './_aux'
2
- import type { AnyAux } from './_aux'
3
2
  import type { ExclusiveUnion } from './_common'
4
3
  import type { PredicateSelector } from './expression'
5
4
  import { FqnRef } from './fqnRef'
@@ -14,6 +13,9 @@ import type {
14
13
  ShapeSize,
15
14
  } from './styles'
16
15
 
16
+ // Alias for bundle exports
17
+ type AnyAux = aux.Any
18
+
17
19
  export namespace ModelFqnExpr {
18
20
  export type Wildcard = {
19
21
  wildcard: true
@@ -1,5 +1,4 @@
1
1
  import type * as aux from './_aux'
2
- import type { AnyAux } from './_aux'
3
2
  import type { ExclusiveUnion } from './_common'
4
3
  import { FqnRef } from './fqnRef'
5
4
  import type { WhereOperator } from './operators'
@@ -13,6 +12,9 @@ import type {
13
12
  ShapeSize,
14
13
  } from './styles'
15
14
 
15
+ // Alias for bundle exports
16
+ type AnyAux = aux.Any
17
+
16
18
  export type PredicateSelector =
17
19
  | 'children' // ele.*
18
20
  | 'expanded' // ele._
@@ -1,9 +1,12 @@
1
1
  import { isString } from 'remeda'
2
2
  import type * as aux from './_aux'
3
- import type { AnyAux, Unknown } from './_aux'
4
3
  import type { ExclusiveUnion } from './_common'
5
4
  import { GlobalFqn } from './scalar'
6
5
 
6
+ // Alias for bundle exports
7
+ type AnyAux = aux.Any
8
+ type Unknown = aux.Unknown
9
+
7
10
  export namespace FqnRef {
8
11
  /**
9
12
  * Reference to logical model element
@@ -1,5 +1,4 @@
1
1
  import type { NonEmptyArray } from '../types'
2
- export { hasAtLeast } from 'remeda'
3
2
 
4
3
  export function isString(value: unknown): value is string {
5
4
  return value != null && typeof value === 'string'
@@ -34,7 +34,6 @@ export {
34
34
  export { getOrCreate } from './getOrCreate'
35
35
 
36
36
  export {
37
- hasAtLeast,
38
37
  isNonEmptyArray,
39
38
  isString,
40
39
  } from './guards'
@@ -1,278 +0,0 @@
1
- import { F as FqnRef } from './core.DK6I-Nr7.mjs';
2
- import { n } from './core.CnIyafWn.mjs';
3
- import { e as isStepEdgeId } from './core.BL_xjl90.mjs';
4
-
5
- function o(r){return Array.isArray(r)}
6
-
7
- var FqnExpr;
8
- ((FqnExpr2) => {
9
- function isWildcard(expr) {
10
- return "wildcard" in expr && expr.wildcard === true;
11
- }
12
- FqnExpr2.isWildcard = isWildcard;
13
- function isModelRef(ref) {
14
- return "ref" in ref && FqnRef.isModelRef(ref.ref);
15
- }
16
- FqnExpr2.isModelRef = isModelRef;
17
- function isDeploymentRef(expr) {
18
- return "ref" in expr && FqnRef.isDeploymentRef(expr.ref);
19
- }
20
- FqnExpr2.isDeploymentRef = isDeploymentRef;
21
- function isElementKindExpr(expr) {
22
- return "elementKind" in expr && "isEqual" in expr;
23
- }
24
- FqnExpr2.isElementKindExpr = isElementKindExpr;
25
- function isElementTagExpr(expr) {
26
- return "elementTag" in expr && "isEqual" in expr;
27
- }
28
- FqnExpr2.isElementTagExpr = isElementTagExpr;
29
- function isWhere(expr) {
30
- return "where" in expr && is(expr.where.expr);
31
- }
32
- FqnExpr2.isWhere = isWhere;
33
- function isCustom(expr) {
34
- return "custom" in expr && (is(expr.custom.expr) || isWhere(expr.custom.expr));
35
- }
36
- FqnExpr2.isCustom = isCustom;
37
- function is(expr) {
38
- return isWildcard(expr) || isModelRef(expr) || isDeploymentRef(expr) || isElementKindExpr(expr) || isElementTagExpr(expr);
39
- }
40
- FqnExpr2.is = is;
41
- function unwrap(expr) {
42
- if (isCustom(expr)) {
43
- expr = expr.custom.expr;
44
- }
45
- if (isWhere(expr)) {
46
- expr = expr.where.expr;
47
- }
48
- return expr;
49
- }
50
- FqnExpr2.unwrap = unwrap;
51
- })(FqnExpr || (FqnExpr = {}));
52
- var RelationExpr;
53
- ((RelationExpr2) => {
54
- function isDirect(expr) {
55
- return "source" in expr && "target" in expr;
56
- }
57
- RelationExpr2.isDirect = isDirect;
58
- function isIncoming(expr) {
59
- return "incoming" in expr;
60
- }
61
- RelationExpr2.isIncoming = isIncoming;
62
- function isOutgoing(expr) {
63
- return "outgoing" in expr;
64
- }
65
- RelationExpr2.isOutgoing = isOutgoing;
66
- function isInOut(expr) {
67
- return "inout" in expr;
68
- }
69
- RelationExpr2.isInOut = isInOut;
70
- function isWhere(expr) {
71
- return "where" in expr && (isDirect(expr.where.expr) || isIncoming(expr.where.expr) || isOutgoing(expr.where.expr) || isInOut(expr.where.expr));
72
- }
73
- RelationExpr2.isWhere = isWhere;
74
- function isCustom(expr) {
75
- return "customRelation" in expr;
76
- }
77
- RelationExpr2.isCustom = isCustom;
78
- function is(expr) {
79
- return isDirect(expr) || isIncoming(expr) || isOutgoing(expr) || isInOut(expr);
80
- }
81
- RelationExpr2.is = is;
82
- function unwrap(expr) {
83
- if (isCustom(expr)) {
84
- expr = expr.customRelation.expr;
85
- }
86
- if (isWhere(expr)) {
87
- expr = expr.where.expr;
88
- }
89
- return expr;
90
- }
91
- RelationExpr2.unwrap = unwrap;
92
- })(RelationExpr || (RelationExpr = {}));
93
- var Expression;
94
- ((Expression2) => {
95
- function isWhere(expr) {
96
- return "where" in expr;
97
- }
98
- Expression2.isWhere = isWhere;
99
- function isRelationWhere(expr) {
100
- return RelationExpr.isWhere(expr);
101
- }
102
- Expression2.isRelationWhere = isRelationWhere;
103
- function isFqnExprWhere(expr) {
104
- return FqnExpr.isWhere(expr);
105
- }
106
- Expression2.isFqnExprWhere = isFqnExprWhere;
107
- function isFqnExpr(expr) {
108
- return FqnExpr.is(expr) || FqnExpr.isWhere(expr) || FqnExpr.isCustom(expr);
109
- }
110
- Expression2.isFqnExpr = isFqnExpr;
111
- function isRelation(expr) {
112
- return RelationExpr.is(expr) || RelationExpr.isWhere(expr) || RelationExpr.isCustom(expr);
113
- }
114
- Expression2.isRelation = isRelation;
115
- })(Expression || (Expression = {}));
116
-
117
- var ModelFqnExpr;
118
- ((ModelFqnExpr2) => {
119
- function isWildcard(expr) {
120
- return "wildcard" in expr && expr.wildcard === true;
121
- }
122
- ModelFqnExpr2.isWildcard = isWildcard;
123
- function isModelRef(ref) {
124
- return "ref" in ref && FqnRef.isModelRef(ref.ref);
125
- }
126
- ModelFqnExpr2.isModelRef = isModelRef;
127
- function isElementKindExpr(expr) {
128
- return "elementKind" in expr && "isEqual" in expr;
129
- }
130
- ModelFqnExpr2.isElementKindExpr = isElementKindExpr;
131
- function isElementTagExpr(expr) {
132
- return "elementTag" in expr && "isEqual" in expr;
133
- }
134
- ModelFqnExpr2.isElementTagExpr = isElementTagExpr;
135
- function isWhere(expr) {
136
- return "where" in expr && is(expr.where.expr);
137
- }
138
- ModelFqnExpr2.isWhere = isWhere;
139
- function isCustom(expr) {
140
- return "custom" in expr && (is(expr.custom.expr) || isWhere(expr.custom.expr));
141
- }
142
- ModelFqnExpr2.isCustom = isCustom;
143
- function is(expr) {
144
- return isWildcard(expr) || isModelRef(expr) || isElementKindExpr(expr) || isElementTagExpr(expr);
145
- }
146
- ModelFqnExpr2.is = is;
147
- function unwrap(expr) {
148
- if (isCustom(expr)) {
149
- expr = expr.custom.expr;
150
- }
151
- if (isWhere(expr)) {
152
- expr = expr.where.expr;
153
- }
154
- return expr;
155
- }
156
- ModelFqnExpr2.unwrap = unwrap;
157
- })(ModelFqnExpr || (ModelFqnExpr = {}));
158
- var ModelRelationExpr;
159
- ((ModelRelationExpr2) => {
160
- function isDirect(expr) {
161
- return "source" in expr && "target" in expr;
162
- }
163
- ModelRelationExpr2.isDirect = isDirect;
164
- function isIncoming(expr) {
165
- return "incoming" in expr;
166
- }
167
- ModelRelationExpr2.isIncoming = isIncoming;
168
- function isOutgoing(expr) {
169
- return "outgoing" in expr;
170
- }
171
- ModelRelationExpr2.isOutgoing = isOutgoing;
172
- function isInOut(expr) {
173
- return "inout" in expr;
174
- }
175
- ModelRelationExpr2.isInOut = isInOut;
176
- function isWhere(expr) {
177
- return "where" in expr && (isDirect(expr.where.expr) || isIncoming(expr.where.expr) || isOutgoing(expr.where.expr) || isInOut(expr.where.expr));
178
- }
179
- ModelRelationExpr2.isWhere = isWhere;
180
- function isCustom(expr) {
181
- return "customRelation" in expr;
182
- }
183
- ModelRelationExpr2.isCustom = isCustom;
184
- function is(expr) {
185
- return isDirect(expr) || isIncoming(expr) || isOutgoing(expr) || isInOut(expr);
186
- }
187
- ModelRelationExpr2.is = is;
188
- function unwrap(expr) {
189
- if (isCustom(expr)) {
190
- expr = expr.customRelation.expr;
191
- }
192
- if (isWhere(expr)) {
193
- expr = expr.where.expr;
194
- }
195
- return expr;
196
- }
197
- ModelRelationExpr2.unwrap = unwrap;
198
- })(ModelRelationExpr || (ModelRelationExpr = {}));
199
- var ModelExpression;
200
- ((ModelExpression2) => {
201
- function isWhere(expr) {
202
- return "where" in expr;
203
- }
204
- ModelExpression2.isWhere = isWhere;
205
- function isRelationWhere(expr) {
206
- return ModelRelationExpr.isWhere(expr);
207
- }
208
- ModelExpression2.isRelationWhere = isRelationWhere;
209
- function isFqnExprWhere(expr) {
210
- return ModelFqnExpr.isWhere(expr);
211
- }
212
- ModelExpression2.isFqnExprWhere = isFqnExprWhere;
213
- function isFqnExpr(expr) {
214
- return ModelFqnExpr.is(expr) || ModelFqnExpr.isWhere(expr) || ModelFqnExpr.isCustom(expr);
215
- }
216
- ModelExpression2.isFqnExpr = isFqnExpr;
217
- function isRelationExpr(expr) {
218
- return ModelRelationExpr.is(expr) || ModelRelationExpr.isWhere(expr) || ModelRelationExpr.isCustom(expr);
219
- }
220
- ModelExpression2.isRelationExpr = isRelationExpr;
221
- })(ModelExpression || (ModelExpression = {}));
222
-
223
- function isViewRulePredicate(rule) {
224
- return "include" in rule || "exclude" in rule;
225
- }
226
- function isViewRuleStyle(rule) {
227
- return "targets" in rule && "style" in rule;
228
- }
229
- function isComputedView(view) {
230
- return view._stage === "computed";
231
- }
232
- function isDiagramView(view) {
233
- return view._stage === "layouted";
234
- }
235
- function isElementView(view) {
236
- return view._type === "element";
237
- }
238
- function isScopedElementView(view) {
239
- return isElementView(view) && n(view.viewOf);
240
- }
241
- function isExtendsElementView(view) {
242
- return isElementView(view) && n(view.extends);
243
- }
244
- function isDeploymentView(view) {
245
- return view._type === "deployment";
246
- }
247
- function isDynamicView(view) {
248
- return view._type === "dynamic";
249
- }
250
-
251
- function isViewRuleGlobalStyle(rule) {
252
- return "styleId" in rule;
253
- }
254
- function isViewRuleGlobalPredicateRef(rule) {
255
- return "predicateId" in rule;
256
- }
257
- function isAutoLayoutDirection(autoLayout) {
258
- return autoLayout === "TB" || autoLayout === "BT" || autoLayout === "LR" || autoLayout === "RL";
259
- }
260
- function isViewRuleAutoLayout(rule) {
261
- return "direction" in rule;
262
- }
263
-
264
- function getParallelStepsPrefix(id) {
265
- if (isStepEdgeId(id) && id.includes(".")) {
266
- return id.slice(0, id.indexOf(".") + 1);
267
- }
268
- return null;
269
- }
270
- function isDynamicViewParallelSteps(step) {
271
- return "__parallel" in step && o(step.__parallel);
272
- }
273
-
274
- function isViewRuleGroup(rule) {
275
- return "title" in rule && "groupRules" in rule && Array.isArray(rule.groupRules);
276
- }
277
-
278
- export { Expression as E, FqnExpr as F, ModelFqnExpr as M, RelationExpr as R, ModelRelationExpr as a, ModelExpression as b, isViewRuleStyle as c, isComputedView as d, isDiagramView as e, isElementView as f, isScopedElementView as g, isExtendsElementView as h, isViewRulePredicate as i, isDeploymentView as j, isDynamicView as k, isViewRuleGlobalStyle as l, isViewRuleGlobalPredicateRef as m, isAutoLayoutDirection as n, isViewRuleAutoLayout as o, getParallelStepsPrefix as p, isDynamicViewParallelSteps as q, isViewRuleGroup as r, o as s };
@@ -1,3 +0,0 @@
1
- function o(a){return t=>!a(t)}
2
-
3
- export { o };
@@ -1,5 +0,0 @@
1
- import { u as u$1 } from './core.DbRvwARP.mjs';
2
-
3
- function k(...n){return u$1(u,n)}function u(n,e){if(n===e||Object.is(n,e))return true;if(typeof n!="object"||typeof e!="object"||n===null||e===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(e))return false;if(Array.isArray(n))return l(n,e);if(n instanceof Map)return a(n,e);if(n instanceof Set)return c(n,e);if(n instanceof Date)return n.getTime()===e.getTime();if(n instanceof RegExp)return n.toString()===e.toString();if(Object.keys(n).length!==Object.keys(e).length)return false;for(let[r,t]of Object.entries(n))if(!(r in e)||!u(t,e[r]))return false;return true}function l(n,e){if(n.length!==e.length)return false;for(let[r,t]of n.entries())if(!u(t,e[r]))return false;return true}function a(n,e){if(n.size!==e.size)return false;for(let[r,t]of n.entries())if(!e.has(r)||!u(t,e.get(r)))return false;return true}function c(n,e){if(n.size!==e.size)return false;let r=[...e];for(let t of n){let o=false;for(let[s,f]of r.entries())if(u(t,f)){o=true,r.splice(s,1);break}if(!o)return false}return true}
4
-
5
- export { k };
@@ -1,5 +0,0 @@
1
- import { u } from './core.DbRvwARP.mjs';
2
-
3
- function m(...a){return u(o,a,p)}var o=(a,e)=>a.map(e),p=a=>(e,t,r)=>({done:false,hasNext:true,next:a(e,t,r)});
4
-
5
- export { m };
@@ -1,3 +0,0 @@
1
- function n(e){return !!e}
2
-
3
- export { n };