@likec4/core 1.23.1 → 1.24.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 (72) hide show
  1. package/dist/builder/index.d.mts +3 -3
  2. package/dist/builder/index.d.ts +3 -3
  3. package/dist/builder/index.mjs +2 -2
  4. package/dist/compute-view/index.d.mts +4 -4
  5. package/dist/compute-view/index.d.ts +4 -4
  6. package/dist/compute-view/index.mjs +4 -4
  7. package/dist/index.d.mts +7 -8
  8. package/dist/index.d.ts +7 -8
  9. package/dist/index.mjs +4 -4
  10. package/dist/model/index.d.mts +5 -5
  11. package/dist/model/index.d.ts +5 -5
  12. package/dist/model/index.mjs +1 -1
  13. package/dist/shared/{core.3xeQpJ_K.d.cts → core.3L0y_SNW.d.mts} +2 -2
  14. package/dist/shared/{core.QP35c488.d.cts → core.Bhx0OGK8.d.mts} +1 -1
  15. package/dist/shared/{core.QP35c488.d.mts → core.Bhx0OGK8.d.ts} +1 -1
  16. package/dist/shared/{core.DsDq-blc.d.ts → core.BreLKHbT.d.mts} +1 -2
  17. package/dist/shared/{core.DQCc-Jxk.d.ts → core.BsAIrb_r.d.ts} +1 -1
  18. package/dist/shared/{core.GIZxdz4M.mjs → core.C92OYZca.mjs} +1 -1
  19. package/dist/shared/{core.CJaCUZQ9.d.mts → core.C9UbC1nX.d.ts} +1 -2
  20. package/dist/shared/{core.s6UB2oA0.d.ts → core.DBToPQ3n.d.ts} +2 -2
  21. package/dist/shared/{core.1pNr6Ryk.d.ts → core.DbfQeUKm.d.mts} +5 -4
  22. package/dist/shared/core.FFJhmauw.mjs +2078 -0
  23. package/dist/shared/{core.BYs5deiY.d.cts → core.RiWsY3jz.d.mts} +1 -1
  24. package/dist/shared/{core.uGbvOLGK.mjs → core.gWObeLn9.mjs} +28 -9
  25. package/dist/shared/{core.DKJ2y3NP.d.mts → core.k4jahJ8j.d.ts} +5 -4
  26. package/dist/types/index.d.mts +4 -4
  27. package/dist/types/index.d.ts +4 -4
  28. package/dist/types/index.mjs +1 -1
  29. package/dist/utils/index.d.mts +46 -4
  30. package/dist/utils/index.d.ts +46 -4
  31. package/dist/utils/index.mjs +2 -2
  32. package/package.json +3 -27
  33. package/src/compute-view/deployment-view/clean-connections.ts +1 -1
  34. package/src/compute-view/deployment-view/stages/stage-final.ts +1 -1
  35. package/src/compute-view/element-view/compute.ts +1 -1
  36. package/src/compute-view/element-view/memory/memory.ts +1 -1
  37. package/src/compute-view/memory/ops.ts +1 -1
  38. package/src/compute-view/relationships-view/layout.ts +1 -1
  39. package/src/compute-view/relationships-view/utils.ts +1 -1
  40. package/src/model/DeploymentElementModel.ts +4 -6
  41. package/src/model/DeploymentModel.ts +1 -1
  42. package/src/model/LikeC4Model.ts +22 -1
  43. package/src/model/view/LikeC4ViewModel.ts +5 -6
  44. package/src/types/deployments.ts +0 -1
  45. package/src/types/index.ts +1 -1
  46. package/src/types/theme.ts +1 -1
  47. package/src/utils/index.ts +7 -1
  48. package/src/utils/mnemonist.ts +7 -0
  49. package/src/utils/set.ts +5 -3
  50. package/dist/builder/index.cjs +0 -887
  51. package/dist/builder/index.d.cts +0 -509
  52. package/dist/compute-view/index.cjs +0 -86
  53. package/dist/compute-view/index.d.cts +0 -23
  54. package/dist/index.cjs +0 -3857
  55. package/dist/index.d.cts +0 -146
  56. package/dist/model/index.cjs +0 -40
  57. package/dist/model/index.d.cts +0 -259
  58. package/dist/shared/core.BHQYwEvc.d.mts +0 -12
  59. package/dist/shared/core.BS_nXBsP.d.cts +0 -858
  60. package/dist/shared/core.BYiA0A6H.cjs +0 -39
  61. package/dist/shared/core.CEJQrbXY.cjs +0 -441
  62. package/dist/shared/core.D0KD4FiT.d.mts +0 -127
  63. package/dist/shared/core.DEzbhxsA.cjs +0 -14874
  64. package/dist/shared/core.DUbKSpjd.cjs +0 -26
  65. package/dist/shared/core.DqmAHWZs.cjs +0 -7501
  66. package/dist/shared/core.OjOfEBRQ.d.cts +0 -731
  67. package/dist/shared/core.QP35c488.d.ts +0 -185
  68. package/dist/shared/core.f1tiPwpd.mjs +0 -14819
  69. package/dist/types/index.cjs +0 -110
  70. package/dist/types/index.d.cts +0 -72
  71. package/dist/utils/index.cjs +0 -99
  72. package/dist/utils/index.d.cts +0 -340
@@ -1,185 +0,0 @@
1
- import { LiteralUnion, Tagged, Simplify, UnionToIntersection, TupleToUnion } from 'type-fest';
2
-
3
- declare const ThemeColors: readonly ["amber", "blue", "gray", "slate", "green", "indigo", "muted", "primary", "red", "secondary", "sky"];
4
- type ThemeColor = typeof ThemeColors[number];
5
- type HexColorLiteral = `#${string}`;
6
- type ColorLiteral = HexColorLiteral;
7
- type Color = LiteralUnion<ThemeColor, string>;
8
- type ShapeSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
9
- /**
10
- * For padding, margin, etc.
11
- */
12
- type SpacingSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
13
- type TextSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
14
- declare function isThemeColor(color: Color): color is ThemeColor;
15
- interface ElementThemeColorValues {
16
- fill: ColorLiteral;
17
- stroke: ColorLiteral;
18
- hiContrast: ColorLiteral;
19
- loContrast: ColorLiteral;
20
- }
21
- type ElementThemeColors = {
22
- [key in ThemeColor]: ElementThemeColorValues;
23
- };
24
- interface RelationshipThemeColorValues {
25
- lineColor: ColorLiteral;
26
- labelBgColor: ColorLiteral;
27
- labelColor: ColorLiteral;
28
- }
29
- interface ThemeColorValues {
30
- elements: ElementThemeColorValues;
31
- relationships: RelationshipThemeColorValues;
32
- }
33
- type RelationshipThemeColors = {
34
- [key in ThemeColor]: RelationshipThemeColorValues;
35
- };
36
- interface LikeC4Theme {
37
- font: 'Arial';
38
- shadow: ColorLiteral;
39
- relationships: RelationshipThemeColors;
40
- elements: ElementThemeColors;
41
- sizes: {
42
- [key in ShapeSize]: {
43
- width: number;
44
- height: number;
45
- };
46
- };
47
- spacing: {
48
- [key in SpacingSize]: number;
49
- };
50
- textSizes: {
51
- [key in TextSize]: number;
52
- };
53
- }
54
-
55
- type NonEmptyArray<T> = [T, ...T[]];
56
- type NonEmptyReadonlyArray<T> = readonly [T, ...T[]];
57
- type IconUrl = Tagged<string, 'IconUrl'> | 'none';
58
- type CustomColor = string;
59
- type Point = readonly [x: number, y: number];
60
- interface XYPoint {
61
- x: number;
62
- y: number;
63
- }
64
- type KeysOf<T> = keyof T extends infer K extends string ? K : never;
65
- type AllNever<Expressions> = UnionToIntersection<{
66
- [Name in keyof Expressions]: {
67
- -readonly [Key in keyof Expressions[Name]]?: never;
68
- };
69
- }[keyof Expressions]>;
70
- /**
71
- * @example
72
- * type Variant1 = {
73
- * a: string
74
- * }
75
- * type Variant2 = {
76
- * b: number
77
- * }
78
- *
79
- * type Variants = ExclusiveUnion<{
80
- * Variant1: Variant1,
81
- * Variant2: Variant2
82
- * }>
83
- *
84
- * Fail here
85
- * const variant1: Variants = {
86
- * a: 'one',
87
- * b: 1
88
- * }
89
- */
90
- type ExclusiveUnion<Expressions> = Expressions extends object ? {
91
- [Name in keyof Expressions]: Simplify<Omit<AllNever<Expressions>, keyof Expressions[Name]> & Expressions[Name]>;
92
- }[keyof Expressions] : Expressions;
93
- /**
94
- * Copy from https://github.com/remeda/remeda/blob/main/src/internal/types/NTuple.ts
95
- * An array with *exactly* N elements in it.
96
- *
97
- * Only literal N values are supported. For very large N the type might result
98
- * in a recurse depth error. For negative N the type would result in an infinite
99
- * recursion. None of these have protections because this is an internal type!
100
- */
101
- type NTuple<T, N extends number, Result extends Array<unknown> = []> = Result['length'] extends N ? Result : NTuple<T, N, [...Result, T]>;
102
- type IteratorLike<T> = IteratorObject<T, BuiltinIteratorReturn>;
103
- type Predicate<T> = (x: T) => boolean;
104
-
105
- type Fqn<Id extends string = string> = Tagged<Id, 'Fqn'>;
106
- declare function AsFqn(name: string, parent?: Fqn | null): Fqn;
107
- declare const BorderStyles: readonly ["solid", "dashed", "dotted", "none"];
108
- type BorderStyle = TupleToUnion<typeof BorderStyles>;
109
- type ElementKind<Kinds extends string = string> = Tagged<Kinds, 'ElementKind'>;
110
- declare namespace ElementKind {
111
- const Group: ElementKind;
112
- }
113
- declare const ElementShapes: readonly ["rectangle", "person", "browser", "mobile", "cylinder", "storage", "queue"];
114
- type ElementShape = TupleToUnion<typeof ElementShapes>;
115
- declare const DefaultThemeColor: ThemeColor;
116
- declare const DefaultElementShape: ElementShape;
117
- declare const DefaultShapeSize: ShapeSize;
118
- declare const DefaultPaddingSize: SpacingSize;
119
- declare const DefaultTextSize: TextSize;
120
- interface ElementStyle {
121
- readonly border?: BorderStyle;
122
- /**
123
- * In percentage 0-100, 0 is fully transparent
124
- *
125
- * @default 100
126
- */
127
- readonly opacity?: number;
128
- /**
129
- * If true, the element is rendered as multiple shapes
130
- * @default false
131
- */
132
- readonly multiple?: boolean;
133
- /**
134
- * Shape size
135
- *
136
- * @default 'md'
137
- */
138
- readonly size?: ShapeSize;
139
- readonly padding?: SpacingSize;
140
- readonly textSize?: TextSize;
141
- }
142
- type Tag<Tags extends string = string> = Tagged<Tags, 'Tag'>;
143
- interface TagSpec {
144
- readonly id: Tag;
145
- readonly style: ElementStyle;
146
- }
147
- interface Link {
148
- readonly title?: string;
149
- readonly url: string;
150
- readonly relative?: string;
151
- }
152
- interface TypedElement<Ids extends string, Kinds extends string, Tags extends string, MetadataKeys extends string = never> {
153
- readonly id: Fqn<Ids>;
154
- readonly kind: ElementKind<Kinds>;
155
- readonly title: string;
156
- readonly description: string | null;
157
- readonly technology: string | null;
158
- readonly tags: NonEmptyArray<Tag<Tags>> | null;
159
- readonly links: NonEmptyArray<Link> | null;
160
- readonly icon?: IconUrl;
161
- readonly shape?: ElementShape;
162
- readonly color?: Color;
163
- readonly style?: ElementStyle;
164
- readonly notation?: string;
165
- readonly metadata?: Record<MetadataKeys, string>;
166
- }
167
- interface Element extends TypedElement<string, string, string, string> {
168
- }
169
- interface ElementKindSpecificationStyle {
170
- shape?: ElementShape;
171
- icon?: IconUrl;
172
- color?: Color;
173
- border?: BorderStyle;
174
- opacity?: number;
175
- size?: ShapeSize;
176
- padding?: SpacingSize;
177
- textSize?: TextSize;
178
- }
179
- interface ElementKindSpecification {
180
- readonly technology?: string;
181
- readonly notation?: string;
182
- readonly style: ElementKindSpecificationStyle;
183
- }
184
-
185
- export { AsFqn as A, BorderStyles as B, type CustomColor as C, DefaultElementShape as D, type ExclusiveUnion as E, type Fqn as F, type SpacingSize as G, type HexColorLiteral as H, type IconUrl as I, type TextSize as J, type KeysOf as K, type LikeC4Theme as L, type ThemeColor as M, type NonEmptyArray as N, type Point as P, type RelationshipThemeColors as R, type ShapeSize as S, type ThemeColorValues as T, type XYPoint as X, type IteratorLike as a, type NonEmptyReadonlyArray as b, type NTuple as c, type Predicate as d, DefaultPaddingSize as e, DefaultShapeSize as f, DefaultTextSize as g, DefaultThemeColor as h, ElementKind as i, ElementShapes as j, type BorderStyle as k, type Element as l, type ElementKindSpecification as m, type ElementKindSpecificationStyle as n, type ElementShape as o, type ElementStyle as p, type Link as q, type Tag as r, type TagSpec as s, type TypedElement as t, isThemeColor as u, type Color as v, type ColorLiteral as w, type ElementThemeColors as x, type ElementThemeColorValues as y, type RelationshipThemeColorValues as z };