@likec4/core 1.0.0-next.2 → 1.0.0-rc.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/dist/{cjs/errors → errors}/index.d.ts +1 -1
- package/dist/types/{types/expression.d.ts → expression.d.ts} +7 -2
- package/dist/types/expression.js +8 -1
- package/dist/types/index.d.ts +11 -7
- package/dist/{cjs/utils → utils}/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/promises.d.ts +1 -0
- package/dist/utils/promises.js +8 -0
- package/package.json +24 -39
- package/dist/cjs/colors/element.js +0 -82
- package/dist/cjs/colors/index.js +0 -27
- package/dist/cjs/colors/relationships.js +0 -76
- package/dist/cjs/errors/index.js +0 -118
- package/dist/cjs/index.js +0 -49
- package/dist/cjs/log.d.ts +0 -3
- package/dist/cjs/log.js +0 -10
- package/dist/cjs/reset.d.ts +0 -2
- package/dist/cjs/types/_common.js +0 -1
- package/dist/cjs/types/computed-view.js +0 -1
- package/dist/cjs/types/diagram.js +0 -1
- package/dist/cjs/types/element.js +0 -16
- package/dist/cjs/types/expression.d.ts +0 -71
- package/dist/cjs/types/expression.js +0 -49
- package/dist/cjs/types/index.d.ts +0 -11
- package/dist/cjs/types/index.js +0 -132
- package/dist/cjs/types/model.js +0 -1
- package/dist/cjs/types/opaque.js +0 -1
- package/dist/cjs/types/relation.js +0 -12
- package/dist/cjs/types/theme.js +0 -1
- package/dist/cjs/types/view.js +0 -25
- package/dist/cjs/utils/fqn.js +0 -101
- package/dist/cjs/utils/guards.js +0 -20
- package/dist/cjs/utils/index.js +0 -38
- package/dist/cjs/utils/relations.js +0 -77
- package/dist/esm/colors/element.d.ts +0 -68
- package/dist/esm/colors/element.js +0 -75
- package/dist/esm/colors/index.d.ts +0 -132
- package/dist/esm/colors/index.js +0 -9
- package/dist/esm/colors/relationships.d.ts +0 -57
- package/dist/esm/colors/relationships.js +0 -64
- package/dist/esm/errors/index.d.ts +0 -39
- package/dist/esm/errors/index.js +0 -82
- package/dist/esm/index.d.ts +0 -6
- package/dist/esm/index.js +0 -4
- package/dist/esm/log.d.ts +0 -3
- package/dist/esm/log.js +0 -5
- package/dist/esm/reset.d.ts +0 -2
- package/dist/esm/types/_common.d.ts +0 -3
- package/dist/esm/types/_common.js +0 -0
- package/dist/esm/types/computed-view.d.ts +0 -45
- package/dist/esm/types/computed-view.js +0 -0
- package/dist/esm/types/diagram.d.ts +0 -40
- package/dist/esm/types/diagram.js +0 -0
- package/dist/esm/types/element.d.ts +0 -30
- package/dist/esm/types/element.js +0 -14
- package/dist/esm/types/expression.d.ts +0 -71
- package/dist/esm/types/expression.js +0 -33
- package/dist/esm/types/index.d.ts +0 -11
- package/dist/esm/types/index.js +0 -11
- package/dist/esm/types/model.d.ts +0 -14
- package/dist/esm/types/model.js +0 -0
- package/dist/esm/types/opaque.d.ts +0 -102
- package/dist/esm/types/opaque.js +0 -0
- package/dist/esm/types/relation.d.ts +0 -24
- package/dist/esm/types/relation.js +0 -3
- package/dist/esm/types/theme.d.ts +0 -26
- package/dist/esm/types/theme.js +0 -0
- package/dist/esm/types/view.d.ts +0 -62
- package/dist/esm/types/view.js +0 -15
- package/dist/esm/utils/fqn.d.ts +0 -33
- package/dist/esm/utils/fqn.js +0 -83
- package/dist/esm/utils/guards.d.ts +0 -4
- package/dist/esm/utils/guards.js +0 -7
- package/dist/esm/utils/index.d.ts +0 -3
- package/dist/esm/utils/index.js +0 -3
- package/dist/esm/utils/relations.d.ts +0 -29
- package/dist/esm/utils/relations.js +0 -69
- package/dist/types/colors/element.d.ts +0 -69
- package/dist/types/colors/index.d.ts +0 -133
- package/dist/types/colors/relationships.d.ts +0 -58
- package/dist/types/errors/index.d.ts +0 -40
- package/dist/types/log.d.ts +0 -4
- package/dist/types/types/_common.d.ts +0 -4
- package/dist/types/types/computed-view.d.ts +0 -46
- package/dist/types/types/diagram.d.ts +0 -41
- package/dist/types/types/element.d.ts +0 -31
- package/dist/types/types/index.d.ts +0 -12
- package/dist/types/types/model.d.ts +0 -15
- package/dist/types/types/opaque.d.ts +0 -103
- package/dist/types/types/relation.d.ts +0 -25
- package/dist/types/types/theme.d.ts +0 -27
- package/dist/types/types/view.d.ts +0 -63
- package/dist/types/utils/fqn.d.ts +0 -34
- package/dist/types/utils/guards.d.ts +0 -5
- package/dist/types/utils/index.d.ts +0 -4
- package/dist/types/utils/relations.d.ts +0 -30
- /package/dist/{cjs/colors → colors}/element.d.ts +0 -0
- /package/dist/{cjs/colors → colors}/index.d.ts +0 -0
- /package/dist/{cjs/colors → colors}/relationships.d.ts +0 -0
- /package/dist/{cjs/index.d.ts → index.d.ts} +0 -0
- /package/dist/{cjs/types → types}/_common.d.ts +0 -0
- /package/dist/{cjs/types → types}/computed-view.d.ts +0 -0
- /package/dist/{cjs/types → types}/diagram.d.ts +0 -0
- /package/dist/{cjs/types → types}/element.d.ts +0 -0
- /package/dist/{cjs/types → types}/model.d.ts +0 -0
- /package/dist/{cjs/types → types}/opaque.d.ts +0 -0
- /package/dist/{cjs/types → types}/relation.d.ts +0 -0
- /package/dist/{cjs/types → types}/theme.d.ts +0 -0
- /package/dist/{cjs/types → types}/view.d.ts +0 -0
- /package/dist/{cjs/utils → utils}/fqn.d.ts +0 -0
- /package/dist/{cjs/utils → utils}/guards.d.ts +0 -0
- /package/dist/{cjs/utils → utils}/relations.d.ts +0 -0
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { ElementKind, ElementShape, Fqn, Tag } from './element';
|
|
2
|
-
import type { ThemeColor } from './theme';
|
|
3
|
-
import type { ViewID } from './view';
|
|
4
|
-
interface BaseExpr {
|
|
5
|
-
element?: never;
|
|
6
|
-
custom?: never;
|
|
7
|
-
elementKind?: never;
|
|
8
|
-
elementTag?: never;
|
|
9
|
-
isEqual?: never;
|
|
10
|
-
isDescedants?: never;
|
|
11
|
-
wildcard?: never;
|
|
12
|
-
source?: never;
|
|
13
|
-
target?: never;
|
|
14
|
-
inout?: never;
|
|
15
|
-
incoming?: never;
|
|
16
|
-
outgoing?: never;
|
|
17
|
-
}
|
|
18
|
-
export interface ElementRefExpr extends Omit<BaseExpr, 'element' | 'isDescedants'> {
|
|
19
|
-
element: Fqn;
|
|
20
|
-
isDescedants?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export declare function isElementRef(expr: Expression): expr is ElementRefExpr;
|
|
23
|
-
export interface CustomElementExpr extends Omit<BaseExpr, 'custom'> {
|
|
24
|
-
custom: {
|
|
25
|
-
element: Fqn;
|
|
26
|
-
title?: string;
|
|
27
|
-
description?: string;
|
|
28
|
-
technology?: string;
|
|
29
|
-
shape?: ElementShape;
|
|
30
|
-
color?: ThemeColor;
|
|
31
|
-
navigateTo?: ViewID;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export declare function isCustomElement(expr: Expression): expr is CustomElementExpr;
|
|
35
|
-
export interface WildcardExpr extends Omit<BaseExpr, 'wildcard'> {
|
|
36
|
-
wildcard: true;
|
|
37
|
-
}
|
|
38
|
-
export declare function isWildcard(expr: Expression): expr is WildcardExpr;
|
|
39
|
-
export interface ElementKindExpr extends Omit<BaseExpr, 'elementKind' | 'isEqual'> {
|
|
40
|
-
elementKind: ElementKind;
|
|
41
|
-
isEqual: boolean;
|
|
42
|
-
}
|
|
43
|
-
export declare function isElementKindExpr(expr: Expression): expr is ElementKindExpr;
|
|
44
|
-
export interface ElementTagExpr extends Omit<BaseExpr, 'elementTag' | 'isEqual'> {
|
|
45
|
-
elementTag: Tag;
|
|
46
|
-
isEqual: boolean;
|
|
47
|
-
}
|
|
48
|
-
export declare function isElementTagExpr(expr: Expression): expr is ElementTagExpr;
|
|
49
|
-
export type ElementExpression = ElementRefExpr | WildcardExpr | ElementKindExpr | ElementTagExpr;
|
|
50
|
-
export declare function isElement(expr: Expression): expr is ElementExpression;
|
|
51
|
-
export interface RelationExpr extends Omit<BaseExpr, 'source' | 'target'> {
|
|
52
|
-
source: ElementExpression;
|
|
53
|
-
target: ElementExpression;
|
|
54
|
-
}
|
|
55
|
-
export declare function isRelation(expr: Expression): expr is RelationExpr;
|
|
56
|
-
export interface InOutExpr extends Omit<BaseExpr, 'inout'> {
|
|
57
|
-
inout: ElementExpression;
|
|
58
|
-
}
|
|
59
|
-
export declare function isInOut(expr: Expression): expr is InOutExpr;
|
|
60
|
-
export interface IncomingExpr extends Omit<BaseExpr, 'incoming'> {
|
|
61
|
-
incoming: ElementExpression;
|
|
62
|
-
}
|
|
63
|
-
export declare function isIncoming(expr: Expression): expr is IncomingExpr;
|
|
64
|
-
export interface OutgoingExpr extends Omit<BaseExpr, 'outgoing'> {
|
|
65
|
-
outgoing: ElementExpression;
|
|
66
|
-
}
|
|
67
|
-
export declare function isOutgoing(expr: Expression): expr is OutgoingExpr;
|
|
68
|
-
export type AnyRelationExpression = RelationExpr | InOutExpr | IncomingExpr | OutgoingExpr;
|
|
69
|
-
export declare function isAnyRelation(expr: Expression): expr is AnyRelationExpression;
|
|
70
|
-
export type Expression = ElementExpression | CustomElementExpr | AnyRelationExpression;
|
|
71
|
-
export {};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isAnyRelation = isAnyRelation;
|
|
7
|
-
exports.isCustomElement = isCustomElement;
|
|
8
|
-
exports.isElement = isElement;
|
|
9
|
-
exports.isElementKindExpr = isElementKindExpr;
|
|
10
|
-
exports.isElementRef = isElementRef;
|
|
11
|
-
exports.isElementTagExpr = isElementTagExpr;
|
|
12
|
-
exports.isInOut = isInOut;
|
|
13
|
-
exports.isIncoming = isIncoming;
|
|
14
|
-
exports.isOutgoing = isOutgoing;
|
|
15
|
-
exports.isRelation = isRelation;
|
|
16
|
-
exports.isWildcard = isWildcard;
|
|
17
|
-
function isElementRef(expr) {
|
|
18
|
-
return "element" in expr;
|
|
19
|
-
}
|
|
20
|
-
function isCustomElement(expr) {
|
|
21
|
-
return "custom" in expr;
|
|
22
|
-
}
|
|
23
|
-
function isWildcard(expr) {
|
|
24
|
-
return "wildcard" in expr;
|
|
25
|
-
}
|
|
26
|
-
function isElementKindExpr(expr) {
|
|
27
|
-
return "elementKind" in expr && "isEqual" in expr;
|
|
28
|
-
}
|
|
29
|
-
function isElementTagExpr(expr) {
|
|
30
|
-
return "elementTag" in expr && "isEqual" in expr;
|
|
31
|
-
}
|
|
32
|
-
function isElement(expr) {
|
|
33
|
-
return isElementRef(expr) || isWildcard(expr) || isElementKindExpr(expr) || isElementTagExpr(expr);
|
|
34
|
-
}
|
|
35
|
-
function isRelation(expr) {
|
|
36
|
-
return "source" in expr && "target" in expr;
|
|
37
|
-
}
|
|
38
|
-
function isInOut(expr) {
|
|
39
|
-
return "inout" in expr;
|
|
40
|
-
}
|
|
41
|
-
function isIncoming(expr) {
|
|
42
|
-
return "incoming" in expr;
|
|
43
|
-
}
|
|
44
|
-
function isOutgoing(expr) {
|
|
45
|
-
return "outgoing" in expr;
|
|
46
|
-
}
|
|
47
|
-
function isAnyRelation(expr) {
|
|
48
|
-
return isRelation(expr) || isInOut(expr) || isIncoming(expr) || isOutgoing(expr);
|
|
49
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './_common';
|
|
2
|
-
export * from './computed-view';
|
|
3
|
-
export * from './diagram';
|
|
4
|
-
export * from './element';
|
|
5
|
-
export * from './expression';
|
|
6
|
-
export * from './model';
|
|
7
|
-
export * from './opaque';
|
|
8
|
-
export * from './relation';
|
|
9
|
-
export * from './theme';
|
|
10
|
-
export * from './view';
|
|
11
|
-
export * as Expr from './expression';
|
package/dist/cjs/types/index.js
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
Expr: true
|
|
8
|
-
};
|
|
9
|
-
exports.Expr = void 0;
|
|
10
|
-
var _common = require("./_common");
|
|
11
|
-
Object.keys(_common).forEach(function (key) {
|
|
12
|
-
if (key === "default" || key === "__esModule") return;
|
|
13
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
14
|
-
if (key in exports && exports[key] === _common[key]) return;
|
|
15
|
-
Object.defineProperty(exports, key, {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () {
|
|
18
|
-
return _common[key];
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
var _computedView = require("./computed-view");
|
|
23
|
-
Object.keys(_computedView).forEach(function (key) {
|
|
24
|
-
if (key === "default" || key === "__esModule") return;
|
|
25
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
26
|
-
if (key in exports && exports[key] === _computedView[key]) return;
|
|
27
|
-
Object.defineProperty(exports, key, {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function () {
|
|
30
|
-
return _computedView[key];
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
var _diagram = require("./diagram");
|
|
35
|
-
Object.keys(_diagram).forEach(function (key) {
|
|
36
|
-
if (key === "default" || key === "__esModule") return;
|
|
37
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
38
|
-
if (key in exports && exports[key] === _diagram[key]) return;
|
|
39
|
-
Object.defineProperty(exports, key, {
|
|
40
|
-
enumerable: true,
|
|
41
|
-
get: function () {
|
|
42
|
-
return _diagram[key];
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
var _element = require("./element");
|
|
47
|
-
Object.keys(_element).forEach(function (key) {
|
|
48
|
-
if (key === "default" || key === "__esModule") return;
|
|
49
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
50
|
-
if (key in exports && exports[key] === _element[key]) return;
|
|
51
|
-
Object.defineProperty(exports, key, {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
get: function () {
|
|
54
|
-
return _element[key];
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
var _Expr = _interopRequireWildcard(require("./expression"));
|
|
59
|
-
exports.Expr = _Expr;
|
|
60
|
-
Object.keys(_Expr).forEach(function (key) {
|
|
61
|
-
if (key === "default" || key === "__esModule") return;
|
|
62
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
63
|
-
if (key in exports && exports[key] === _Expr[key]) return;
|
|
64
|
-
Object.defineProperty(exports, key, {
|
|
65
|
-
enumerable: true,
|
|
66
|
-
get: function () {
|
|
67
|
-
return _Expr[key];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
var _model = require("./model");
|
|
72
|
-
Object.keys(_model).forEach(function (key) {
|
|
73
|
-
if (key === "default" || key === "__esModule") return;
|
|
74
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
75
|
-
if (key in exports && exports[key] === _model[key]) return;
|
|
76
|
-
Object.defineProperty(exports, key, {
|
|
77
|
-
enumerable: true,
|
|
78
|
-
get: function () {
|
|
79
|
-
return _model[key];
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
var _opaque = require("./opaque");
|
|
84
|
-
Object.keys(_opaque).forEach(function (key) {
|
|
85
|
-
if (key === "default" || key === "__esModule") return;
|
|
86
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
87
|
-
if (key in exports && exports[key] === _opaque[key]) return;
|
|
88
|
-
Object.defineProperty(exports, key, {
|
|
89
|
-
enumerable: true,
|
|
90
|
-
get: function () {
|
|
91
|
-
return _opaque[key];
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
var _relation = require("./relation");
|
|
96
|
-
Object.keys(_relation).forEach(function (key) {
|
|
97
|
-
if (key === "default" || key === "__esModule") return;
|
|
98
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
99
|
-
if (key in exports && exports[key] === _relation[key]) return;
|
|
100
|
-
Object.defineProperty(exports, key, {
|
|
101
|
-
enumerable: true,
|
|
102
|
-
get: function () {
|
|
103
|
-
return _relation[key];
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
var _theme = require("./theme");
|
|
108
|
-
Object.keys(_theme).forEach(function (key) {
|
|
109
|
-
if (key === "default" || key === "__esModule") return;
|
|
110
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
111
|
-
if (key in exports && exports[key] === _theme[key]) return;
|
|
112
|
-
Object.defineProperty(exports, key, {
|
|
113
|
-
enumerable: true,
|
|
114
|
-
get: function () {
|
|
115
|
-
return _theme[key];
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
var _view = require("./view");
|
|
120
|
-
Object.keys(_view).forEach(function (key) {
|
|
121
|
-
if (key === "default" || key === "__esModule") return;
|
|
122
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
123
|
-
if (key in exports && exports[key] === _view[key]) return;
|
|
124
|
-
Object.defineProperty(exports, key, {
|
|
125
|
-
enumerable: true,
|
|
126
|
-
get: function () {
|
|
127
|
-
return _view[key];
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
132
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
package/dist/cjs/types/model.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/dist/cjs/types/opaque.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.DefaultRelationshipColor = exports.DefaultLineStyle = exports.DefaultArrowType = void 0;
|
|
7
|
-
const DefaultLineStyle = "dashed";
|
|
8
|
-
exports.DefaultLineStyle = DefaultLineStyle;
|
|
9
|
-
const DefaultArrowType = "normal";
|
|
10
|
-
exports.DefaultArrowType = DefaultArrowType;
|
|
11
|
-
const DefaultRelationshipColor = "gray";
|
|
12
|
-
exports.DefaultRelationshipColor = DefaultRelationshipColor;
|
package/dist/cjs/types/theme.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/dist/cjs/types/view.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isExtendsElementView = isExtendsElementView;
|
|
7
|
-
exports.isStrictElementView = isStrictElementView;
|
|
8
|
-
exports.isViewRuleAutoLayout = isViewRuleAutoLayout;
|
|
9
|
-
exports.isViewRuleExpression = isViewRuleExpression;
|
|
10
|
-
exports.isViewRuleStyle = isViewRuleStyle;
|
|
11
|
-
function isViewRuleExpression(rule) {
|
|
12
|
-
return "include" in rule && Array.isArray(rule.include) || "exclude" in rule && Array.isArray(rule.exclude);
|
|
13
|
-
}
|
|
14
|
-
function isViewRuleStyle(rule) {
|
|
15
|
-
return "style" in rule && "targets" in rule;
|
|
16
|
-
}
|
|
17
|
-
function isViewRuleAutoLayout(rule) {
|
|
18
|
-
return "autoLayout" in rule;
|
|
19
|
-
}
|
|
20
|
-
function isStrictElementView(view) {
|
|
21
|
-
return "viewOf" in view;
|
|
22
|
-
}
|
|
23
|
-
function isExtendsElementView(view) {
|
|
24
|
-
return "extends" in view;
|
|
25
|
-
}
|
package/dist/cjs/utils/fqn.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ancestorsFqn = ancestorsFqn;
|
|
7
|
-
exports.commonAncestor = commonAncestor;
|
|
8
|
-
exports.compareByFqnHierarchically = compareByFqnHierarchically;
|
|
9
|
-
exports.compareFqnHierarchically = compareFqnHierarchically;
|
|
10
|
-
exports.isAncestor = isAncestor;
|
|
11
|
-
exports.isDescendantOf = isDescendantOf;
|
|
12
|
-
exports.isSameHierarchy = isSameHierarchy;
|
|
13
|
-
exports.nameFromFqn = nameFromFqn;
|
|
14
|
-
exports.notDescendantOf = notDescendantOf;
|
|
15
|
-
exports.parentFqn = parentFqn;
|
|
16
|
-
var _guards = require("./guards");
|
|
17
|
-
function nameFromFqn(fqn) {
|
|
18
|
-
const lastDot = fqn.lastIndexOf(".");
|
|
19
|
-
if (lastDot > 0) {
|
|
20
|
-
return fqn.slice(lastDot + 1);
|
|
21
|
-
} else {
|
|
22
|
-
return fqn;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
function isAncestor(...args) {
|
|
26
|
-
const ancestor = (0, _guards.isString)(args[0]) ? args[0] : args[0].id;
|
|
27
|
-
const another = (0, _guards.isString)(args[1]) ? args[1] : args[1].id;
|
|
28
|
-
return another.startsWith(ancestor + ".");
|
|
29
|
-
}
|
|
30
|
-
function isSameHierarchy(one, another) {
|
|
31
|
-
const first = (0, _guards.isString)(one) ? one : one.id;
|
|
32
|
-
const second = (0, _guards.isString)(another) ? another : another.id;
|
|
33
|
-
return first === second || second.startsWith(first + ".") || first.startsWith(second + ".");
|
|
34
|
-
}
|
|
35
|
-
function isDescendantOf(ancestors) {
|
|
36
|
-
const predicates = ancestors.flatMap(a => [e => e.id === a.id, e => isAncestor(a, e)]);
|
|
37
|
-
return e => predicates.some(p => p(e));
|
|
38
|
-
}
|
|
39
|
-
function notDescendantOf(ancestors) {
|
|
40
|
-
const isDescendant = isDescendantOf(ancestors);
|
|
41
|
-
return e => !isDescendant(e);
|
|
42
|
-
}
|
|
43
|
-
function commonAncestor(first, second) {
|
|
44
|
-
const parentA = parentFqn(first);
|
|
45
|
-
const parentB = parentFqn(second);
|
|
46
|
-
if (parentA === parentB) {
|
|
47
|
-
return parentA;
|
|
48
|
-
}
|
|
49
|
-
if (!parentA || !parentB) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
const a = first.split(".");
|
|
53
|
-
const b = second.split(".");
|
|
54
|
-
let ancestor = null;
|
|
55
|
-
while (a.length > 1 && b.length > 1 && !!a[0] && a[0] === b[0]) {
|
|
56
|
-
ancestor = ancestor ? `${ancestor}.${a[0]}` : a[0];
|
|
57
|
-
a.shift();
|
|
58
|
-
b.shift();
|
|
59
|
-
}
|
|
60
|
-
return ancestor;
|
|
61
|
-
}
|
|
62
|
-
function parentFqn(fqn) {
|
|
63
|
-
const lastDot = fqn.lastIndexOf(".");
|
|
64
|
-
if (lastDot > 0) {
|
|
65
|
-
return fqn.substring(0, lastDot);
|
|
66
|
-
}
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
function ancestorsFqn(fqn) {
|
|
70
|
-
const path = fqn.split(".");
|
|
71
|
-
path.pop();
|
|
72
|
-
if (path.length === 0) {
|
|
73
|
-
return [];
|
|
74
|
-
}
|
|
75
|
-
return path.reduce((acc, _, idx) => {
|
|
76
|
-
const ancestor = path.slice(0, idx + 1).join(".");
|
|
77
|
-
acc.unshift(ancestor);
|
|
78
|
-
return acc;
|
|
79
|
-
}, []);
|
|
80
|
-
}
|
|
81
|
-
function compareFqnHierarchically(a, b) {
|
|
82
|
-
const depthA = a.split(".").length;
|
|
83
|
-
const depthB = b.split(".").length;
|
|
84
|
-
switch (true) {
|
|
85
|
-
case depthA > depthB:
|
|
86
|
-
{
|
|
87
|
-
return 1;
|
|
88
|
-
}
|
|
89
|
-
case depthA < depthB:
|
|
90
|
-
{
|
|
91
|
-
return -1;
|
|
92
|
-
}
|
|
93
|
-
default:
|
|
94
|
-
{
|
|
95
|
-
return 0;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
function compareByFqnHierarchically(a, b) {
|
|
100
|
-
return compareFqnHierarchically(a.id, b.id);
|
|
101
|
-
}
|
package/dist/cjs/utils/guards.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "hasAtLeast", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _remeda.hasAtLeast;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
exports.isNonEmptyArray = isNonEmptyArray;
|
|
13
|
-
exports.isString = isString;
|
|
14
|
-
var _remeda = require("remeda");
|
|
15
|
-
function isString(value) {
|
|
16
|
-
return value != null && typeof value === "string";
|
|
17
|
-
}
|
|
18
|
-
function isNonEmptyArray(arr) {
|
|
19
|
-
return !!arr && Array.isArray(arr) && arr.length > 0;
|
|
20
|
-
}
|
package/dist/cjs/utils/index.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _fqn = require("./fqn");
|
|
7
|
-
Object.keys(_fqn).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _fqn[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _fqn[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _guards = require("./guards");
|
|
18
|
-
Object.keys(_guards).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _guards[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _guards[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _relations = require("./relations");
|
|
29
|
-
Object.keys(_relations).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _relations[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _relations[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.compareRelations = exports.Relations = void 0;
|
|
7
|
-
var _fqn = require("./fqn");
|
|
8
|
-
const compareRelations = (a, b) => {
|
|
9
|
-
const parentA = (0, _fqn.commonAncestor)(a.source, a.target);
|
|
10
|
-
const parentB = (0, _fqn.commonAncestor)(b.source, b.target);
|
|
11
|
-
if (parentA && !parentB) {
|
|
12
|
-
return 1;
|
|
13
|
-
}
|
|
14
|
-
if (!parentA && parentB) {
|
|
15
|
-
return -1;
|
|
16
|
-
}
|
|
17
|
-
const compareParents = parentA && parentB ? (0, _fqn.compareFqnHierarchically)(parentA, parentB) : 0;
|
|
18
|
-
if (compareParents === 0) {
|
|
19
|
-
const compareSource = (0, _fqn.compareFqnHierarchically)(a.source, b.source);
|
|
20
|
-
if (compareSource !== 0) {
|
|
21
|
-
return compareSource;
|
|
22
|
-
}
|
|
23
|
-
return (0, _fqn.compareFqnHierarchically)(a.target, b.target);
|
|
24
|
-
}
|
|
25
|
-
return compareParents;
|
|
26
|
-
};
|
|
27
|
-
exports.compareRelations = compareRelations;
|
|
28
|
-
const isInside = parent => {
|
|
29
|
-
const prefix = parent + ".";
|
|
30
|
-
return rel => {
|
|
31
|
-
return rel.source.startsWith(prefix) && rel.target.startsWith(prefix);
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
const isBetween = (source, target) => {
|
|
35
|
-
const sourcePrefix = source + ".";
|
|
36
|
-
const targetPrefix = target + ".";
|
|
37
|
-
return rel => {
|
|
38
|
-
return (rel.source === source || (rel.source + ".").startsWith(sourcePrefix)) && (rel.target === target || (rel.target + ".").startsWith(targetPrefix));
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
const isAnyBetween = (source, target) => {
|
|
42
|
-
const predicates = [isBetween(source, target), isBetween(target, source)];
|
|
43
|
-
return rel => predicates.some(p => p(rel));
|
|
44
|
-
};
|
|
45
|
-
const isIncoming = target => {
|
|
46
|
-
const targetPrefix = target + ".";
|
|
47
|
-
return rel => {
|
|
48
|
-
return !(rel.source + ".").startsWith(targetPrefix) && (rel.target === target || (rel.target + ".").startsWith(targetPrefix));
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
const isOutgoing = source => {
|
|
52
|
-
const sourcePrefix = source + ".";
|
|
53
|
-
return rel => {
|
|
54
|
-
return (rel.source === source || (rel.source + ".").startsWith(sourcePrefix)) && !(rel.target + ".").startsWith(sourcePrefix);
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
const isAnyInOut = source => {
|
|
58
|
-
const predicates = [isIncoming(source), isOutgoing(source)];
|
|
59
|
-
return rel => {
|
|
60
|
-
return predicates.some(p => p(rel));
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
const hasRelation = rel => {
|
|
64
|
-
return element => {
|
|
65
|
-
return rel.source === element.id || rel.target === element.id || (0, _fqn.isAncestor)(element.id, rel.source) || (0, _fqn.isAncestor)(element.id, rel.target);
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
const Relations = {
|
|
69
|
-
isInside,
|
|
70
|
-
isBetween,
|
|
71
|
-
isAnyBetween,
|
|
72
|
-
isIncoming,
|
|
73
|
-
isOutgoing,
|
|
74
|
-
isAnyInOut,
|
|
75
|
-
hasRelation
|
|
76
|
-
};
|
|
77
|
-
exports.Relations = Relations;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
export declare const ElementColors: {
|
|
2
|
-
readonly primary: {
|
|
3
|
-
fill: "#3b82f6";
|
|
4
|
-
stroke: "#2563eb";
|
|
5
|
-
hiContrast: "#eff6ff";
|
|
6
|
-
loContrast: "#bfdbfe";
|
|
7
|
-
};
|
|
8
|
-
readonly blue: {
|
|
9
|
-
fill: "#3b82f6";
|
|
10
|
-
stroke: "#2563eb";
|
|
11
|
-
hiContrast: "#eff6ff";
|
|
12
|
-
loContrast: "#bfdbfe";
|
|
13
|
-
};
|
|
14
|
-
readonly secondary: {
|
|
15
|
-
fill: "#0284c7";
|
|
16
|
-
stroke: "#0369a1";
|
|
17
|
-
hiContrast: "#f0f9ff";
|
|
18
|
-
loContrast: "#B6ECF7";
|
|
19
|
-
};
|
|
20
|
-
readonly sky: {
|
|
21
|
-
fill: "#0284c7";
|
|
22
|
-
stroke: "#0369a1";
|
|
23
|
-
hiContrast: "#f0f9ff";
|
|
24
|
-
loContrast: "#B6ECF7";
|
|
25
|
-
};
|
|
26
|
-
readonly muted: {
|
|
27
|
-
fill: "#64748b";
|
|
28
|
-
stroke: "#475569";
|
|
29
|
-
hiContrast: "#f8fafc";
|
|
30
|
-
loContrast: "#cbd5e1";
|
|
31
|
-
};
|
|
32
|
-
readonly slate: {
|
|
33
|
-
fill: "#64748b";
|
|
34
|
-
stroke: "#475569";
|
|
35
|
-
hiContrast: "#f8fafc";
|
|
36
|
-
loContrast: "#cbd5e1";
|
|
37
|
-
};
|
|
38
|
-
readonly gray: {
|
|
39
|
-
readonly fill: "#737373";
|
|
40
|
-
readonly stroke: "#525252";
|
|
41
|
-
readonly hiContrast: "#fafafa";
|
|
42
|
-
readonly loContrast: "#d4d4d4";
|
|
43
|
-
};
|
|
44
|
-
readonly red: {
|
|
45
|
-
readonly fill: "#AC4D39";
|
|
46
|
-
readonly stroke: "#853A2D";
|
|
47
|
-
readonly hiContrast: "#FBD3CB";
|
|
48
|
-
readonly loContrast: "#FF977D";
|
|
49
|
-
};
|
|
50
|
-
readonly green: {
|
|
51
|
-
readonly fill: "#428a4f";
|
|
52
|
-
readonly stroke: "#2d5d39";
|
|
53
|
-
readonly hiContrast: "#f8fafc";
|
|
54
|
-
readonly loContrast: "#c2f0c2";
|
|
55
|
-
};
|
|
56
|
-
readonly amber: {
|
|
57
|
-
readonly fill: "#A35829";
|
|
58
|
-
readonly stroke: "#7E451D";
|
|
59
|
-
readonly hiContrast: "#FFE0C2";
|
|
60
|
-
readonly loContrast: "#FFA057";
|
|
61
|
-
};
|
|
62
|
-
readonly indigo: {
|
|
63
|
-
readonly fill: "#6366f1";
|
|
64
|
-
readonly stroke: "#4f46e5";
|
|
65
|
-
readonly hiContrast: "#eef2ff";
|
|
66
|
-
readonly loContrast: "#c7d2fe";
|
|
67
|
-
};
|
|
68
|
-
};
|