@likec4/core 1.5.0 → 1.6.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.
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.
@@ -57,7 +57,7 @@ export declare const ElementColors: {
57
57
  readonly fill: "#A35829";
58
58
  readonly stroke: "#7E451D";
59
59
  readonly hiContrast: "#FFE0C2";
60
- readonly loContrast: "#FFA057";
60
+ readonly loContrast: "#f9b27c";
61
61
  };
62
62
  readonly indigo: {
63
63
  readonly fill: "#6366f1";
@@ -60,7 +60,7 @@ export const ElementColors = {
60
60
  fill: '#A35829',
61
61
  stroke: '#7E451D',
62
62
  hiContrast: '#FFE0C2',
63
- loContrast: '#FFA057'
63
+ loContrast: '#f9b27c'
64
64
  },
65
65
  indigo: {
66
66
  // fill: colors.indigo[500],
@@ -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: "#FFA057";
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: "Helvetica";
129
+ font: "Arial";
130
130
  shadow: "#0a0a0a";
131
131
  };
132
132
  export { ElementColors, RelationshipColors };
@@ -3,7 +3,7 @@ import { RelationshipColors } from './relationships';
3
3
  export const defaultTheme = {
4
4
  elements: ElementColors,
5
5
  relationships: RelationshipColors,
6
- font: 'Helvetica',
6
+ font: 'Arial',
7
7
  shadow: '#0a0a0a'
8
8
  };
9
9
  export { ElementColors, RelationshipColors };
@@ -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 RelationPredicateExpression = RelationExpr | InOutExpr | IncomingExpr | OutgoingExpr | CustomRelationExpr;
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 {};
@@ -19,7 +19,7 @@ export type RelationshipThemeColors = {
19
19
  [key in ThemeColor]: RelationshipThemeColorValues;
20
20
  };
21
21
  export interface LikeC4Theme {
22
- font: 'Helvetica';
22
+ font: 'Arial';
23
23
  shadow: ColorLiteral;
24
24
  relationships: RelationshipThemeColors;
25
25
  elements: ElementThemeColors;
@@ -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 ViewRuleExpression = {
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 isViewRuleExpression(rule: ViewRule): rule is ViewRuleExpression;
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 = ViewRuleExpression | ViewRuleStyle | ViewRuleAutoLayout;
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;
@@ -1,5 +1,5 @@
1
1
  import { isNullish } from 'remeda';
2
- export function isViewRuleExpression(rule) {
2
+ export function isViewRulePredicate(rule) {
3
3
  return (('include' in rule && Array.isArray(rule.include))
4
4
  || ('exclude' in rule && Array.isArray(rule.exclude)));
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likec4/core",
3
- "version": "1.5.0",
3
+ "version": "1.6.1",
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.5.0",
74
+ "@likec4/tsconfig": "1.6.1",
75
75
  "@total-typescript/ts-reset": "^0.5.1",
76
76
  "execa": "^9.3.0",
77
77
  "typescript": "^5.5.3",
78
- "vitest": "~1.6.0"
78
+ "vitest": "~2.0.3"
79
79
  },
80
80
  "packageManager": "yarn@4.3.1"
81
81
  }
@@ -65,7 +65,7 @@ export const ElementColors = {
65
65
  fill: '#A35829',
66
66
  stroke: '#7E451D',
67
67
  hiContrast: '#FFE0C2',
68
- loContrast: '#FFA057'
68
+ loContrast: '#f9b27c'
69
69
  },
70
70
  indigo: {
71
71
  // fill: colors.indigo[500],
@@ -5,7 +5,7 @@ import { RelationshipColors } from './relationships'
5
5
  export const defaultTheme = {
6
6
  elements: ElementColors,
7
7
  relationships: RelationshipColors,
8
- font: 'Helvetica',
8
+ font: 'Arial',
9
9
  shadow: '#0a0a0a'
10
10
  } satisfies LikeC4Theme
11
11
 
@@ -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 RelationPredicateExpression = RelationExpr | InOutExpr | IncomingExpr | OutgoingExpr | CustomRelationExpr
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)
@@ -39,7 +39,7 @@ export type RelationshipThemeColors = {
39
39
  }
40
40
 
41
41
  export interface LikeC4Theme {
42
- font: 'Helvetica' // for now only support Helvetica
42
+ font: 'Arial'
43
43
  shadow: ColorLiteral
44
44
  relationships: RelationshipThemeColors
45
45
  elements: ElementThemeColors
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 ViewRuleExpression =
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 isViewRuleExpression(rule: ViewRule): rule is ViewRuleExpression {
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 = ViewRuleExpression | ViewRuleStyle | ViewRuleAutoLayout
48
+ export type ViewRule = ViewRulePredicate | ViewRuleStyle | ViewRuleAutoLayout
49
49
 
50
50
  export interface BasicView<ViewType extends 'element' | 'dynamic'> {
51
51
  readonly __?: ViewType