@likec4/core 1.5.0 → 1.6.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.
- package/LICENSE +21 -0
- package/dist/colors/element.d.ts +1 -1
- package/dist/colors/element.js +1 -1
- package/dist/colors/index.d.ts +2 -2
- package/dist/colors/index.js +1 -1
- package/dist/types/expression.d.ts +2 -1
- package/dist/types/theme.d.ts +1 -1
- package/dist/types/view.d.ts +3 -3
- package/dist/types/view.js +1 -1
- package/package.json +3 -3
- package/src/colors/element.ts +1 -1
- package/src/colors/index.ts +1 -1
- package/src/types/expression.ts +3 -1
- package/src/types/theme.ts +1 -1
- package/src/types/view.ts +3 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023-2024 Denis Davydkov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/colors/element.d.ts
CHANGED
package/dist/colors/element.js
CHANGED
package/dist/colors/index.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ export declare const defaultTheme: {
|
|
|
60
60
|
readonly fill: "#A35829";
|
|
61
61
|
readonly stroke: "#7E451D";
|
|
62
62
|
readonly hiContrast: "#FFE0C2";
|
|
63
|
-
readonly loContrast: "#
|
|
63
|
+
readonly loContrast: "#f9b27c";
|
|
64
64
|
};
|
|
65
65
|
readonly indigo: {
|
|
66
66
|
readonly fill: "#6366f1";
|
|
@@ -126,7 +126,7 @@ export declare const defaultTheme: {
|
|
|
126
126
|
labelColor: "#cbd5e1";
|
|
127
127
|
};
|
|
128
128
|
};
|
|
129
|
-
font: "
|
|
129
|
+
font: "Arial";
|
|
130
130
|
shadow: "#0a0a0a";
|
|
131
131
|
};
|
|
132
132
|
export { ElementColors, RelationshipColors };
|
package/dist/colors/index.js
CHANGED
|
@@ -89,7 +89,8 @@ export interface CustomRelationExpr extends Omit<BaseExpr, 'customRelation'> {
|
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
export declare function isCustomRelationExpr(expr: Expression): expr is CustomRelationExpr;
|
|
92
|
-
export type
|
|
92
|
+
export type RelationExpression = RelationExpr | InOutExpr | IncomingExpr | OutgoingExpr;
|
|
93
|
+
export type RelationPredicateExpression = RelationExpression | CustomRelationExpr;
|
|
93
94
|
export declare function isAnyRelation(expr: Expression): expr is RelationPredicateExpression;
|
|
94
95
|
export type Expression = ElementPredicateExpression | RelationPredicateExpression;
|
|
95
96
|
export {};
|
package/dist/types/theme.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type RelationshipThemeColors = {
|
|
|
19
19
|
[key in ThemeColor]: RelationshipThemeColorValues;
|
|
20
20
|
};
|
|
21
21
|
export interface LikeC4Theme {
|
|
22
|
-
font: '
|
|
22
|
+
font: 'Arial';
|
|
23
23
|
shadow: ColorLiteral;
|
|
24
24
|
relationships: RelationshipThemeColors;
|
|
25
25
|
elements: ElementThemeColors;
|
package/dist/types/view.d.ts
CHANGED
|
@@ -5,14 +5,14 @@ import type { Opaque } from './opaque';
|
|
|
5
5
|
import type { RelationID, RelationshipArrowType, RelationshipLineType } from './relation';
|
|
6
6
|
import type { ThemeColor } from './theme';
|
|
7
7
|
export type ViewID = Opaque<string, 'ViewID'>;
|
|
8
|
-
export type
|
|
8
|
+
export type ViewRulePredicate = {
|
|
9
9
|
include: Expression[];
|
|
10
10
|
exclude?: never;
|
|
11
11
|
} | {
|
|
12
12
|
include?: never;
|
|
13
13
|
exclude: Expression[];
|
|
14
14
|
};
|
|
15
|
-
export declare function
|
|
15
|
+
export declare function isViewRulePredicate(rule: ViewRule): rule is ViewRulePredicate;
|
|
16
16
|
export interface ViewRuleStyle {
|
|
17
17
|
targets: ElementExpression[];
|
|
18
18
|
style: ElementStyle & {
|
|
@@ -27,7 +27,7 @@ export interface ViewRuleAutoLayout {
|
|
|
27
27
|
autoLayout: AutoLayoutDirection;
|
|
28
28
|
}
|
|
29
29
|
export declare function isViewRuleAutoLayout(rule: ViewRule): rule is ViewRuleAutoLayout;
|
|
30
|
-
export type ViewRule =
|
|
30
|
+
export type ViewRule = ViewRulePredicate | ViewRuleStyle | ViewRuleAutoLayout;
|
|
31
31
|
export interface BasicView<ViewType extends 'element' | 'dynamic'> {
|
|
32
32
|
readonly __?: ViewType;
|
|
33
33
|
readonly id: ViewID;
|
package/dist/types/view.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://likec4.dev",
|
|
6
6
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
"type-fest": "^4.21.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@likec4/tsconfig": "1.
|
|
74
|
+
"@likec4/tsconfig": "1.6.0",
|
|
75
75
|
"@total-typescript/ts-reset": "^0.5.1",
|
|
76
76
|
"execa": "^9.3.0",
|
|
77
77
|
"typescript": "^5.5.3",
|
|
78
|
-
"vitest": "~
|
|
78
|
+
"vitest": "~2.0.3"
|
|
79
79
|
},
|
|
80
80
|
"packageManager": "yarn@4.3.1"
|
|
81
81
|
}
|
package/src/colors/element.ts
CHANGED
package/src/colors/index.ts
CHANGED
package/src/types/expression.ts
CHANGED
|
@@ -136,7 +136,9 @@ export function isCustomRelationExpr(expr: Expression): expr is CustomRelationEx
|
|
|
136
136
|
return 'customRelation' in expr
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
export type
|
|
139
|
+
export type RelationExpression = RelationExpr | InOutExpr | IncomingExpr | OutgoingExpr
|
|
140
|
+
|
|
141
|
+
export type RelationPredicateExpression = RelationExpression | CustomRelationExpr
|
|
140
142
|
|
|
141
143
|
export function isAnyRelation(expr: Expression): expr is RelationPredicateExpression {
|
|
142
144
|
return isRelation(expr) || isInOut(expr) || isIncoming(expr) || isOutgoing(expr) || isCustomRelationExpr(expr)
|
package/src/types/theme.ts
CHANGED
package/src/types/view.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { ThemeColor } from './theme'
|
|
|
9
9
|
// Full-qualified-name
|
|
10
10
|
export type ViewID = Opaque<string, 'ViewID'>
|
|
11
11
|
|
|
12
|
-
export type
|
|
12
|
+
export type ViewRulePredicate =
|
|
13
13
|
| {
|
|
14
14
|
include: Expression[]
|
|
15
15
|
exclude?: never
|
|
@@ -18,7 +18,7 @@ export type ViewRuleExpression =
|
|
|
18
18
|
include?: never
|
|
19
19
|
exclude: Expression[]
|
|
20
20
|
}
|
|
21
|
-
export function
|
|
21
|
+
export function isViewRulePredicate(rule: ViewRule): rule is ViewRulePredicate {
|
|
22
22
|
return (
|
|
23
23
|
('include' in rule && Array.isArray(rule.include))
|
|
24
24
|
|| ('exclude' in rule && Array.isArray(rule.exclude))
|
|
@@ -45,7 +45,7 @@ export function isViewRuleAutoLayout(rule: ViewRule): rule is ViewRuleAutoLayout
|
|
|
45
45
|
return 'autoLayout' in rule
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export type ViewRule =
|
|
48
|
+
export type ViewRule = ViewRulePredicate | ViewRuleStyle | ViewRuleAutoLayout
|
|
49
49
|
|
|
50
50
|
export interface BasicView<ViewType extends 'element' | 'dynamic'> {
|
|
51
51
|
readonly __?: ViewType
|