@likec4/core 1.48.0 → 1.49.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/dist/THIRD-PARTY-LICENSES.md +1012 -0
- package/dist/_chunks/Builder.view-element.mjs +2 -3284
- package/dist/_chunks/LikeC4Model.d.mts +21 -25
- package/dist/_chunks/RichText.mjs +1 -148
- package/dist/_chunks/_types.d.mts +1 -5
- package/dist/_chunks/_types2.d.mts +2 -4
- package/dist/_chunks/assignTagColors.mjs +1 -24
- package/dist/_chunks/calcDriftsFromSnapshot.mjs +1 -379
- package/dist/_chunks/guards.d.mts +2026 -0
- package/dist/_chunks/guards.mjs +4 -0
- package/dist/_chunks/index.d.mts +255 -136
- package/dist/_chunks/libs/@mantine/colors-generator.mjs +2 -3403
- package/dist/_chunks/libs/@radix-ui/colors.mjs +1 -0
- package/dist/_chunks/libs/@ungap/structured-clone.mjs +1 -213
- package/dist/_chunks/libs/bail.mjs +1 -14
- package/dist/_chunks/libs/ccount.mjs +1 -25
- package/dist/_chunks/libs/character-entities-html4.mjs +1 -263
- package/dist/_chunks/libs/character-entities-legacy.mjs +1 -117
- package/dist/_chunks/libs/character-entities.mjs +2 -2136
- package/dist/_chunks/libs/comma-separated-tokens.mjs +1 -18
- package/dist/_chunks/libs/decode-named-character-reference.mjs +1 -21
- package/dist/_chunks/libs/defu.mjs +1 -42
- package/dist/_chunks/libs/devlop.mjs +1 -5
- package/dist/_chunks/libs/escape-string-regexp.mjs +1 -8
- package/dist/_chunks/libs/extend.mjs +1 -77
- package/dist/_chunks/libs/graphology-dag.mjs +1 -703
- package/dist/_chunks/libs/graphology.mjs +1 -4565
- package/dist/_chunks/libs/hast-util-sanitize.mjs +1 -863
- package/dist/_chunks/libs/hast-util-to-html.mjs +9 -2696
- package/dist/_chunks/libs/is-plain-obj.mjs +1 -9
- package/dist/_chunks/libs/longest-streak.mjs +1 -30
- package/dist/_chunks/libs/markdown-table.mjs +2 -290
- package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +1 -653
- package/dist/_chunks/libs/mdast-util-from-markdown.mjs +3 -8522
- package/dist/_chunks/libs/mdast-util-gfm.mjs +15 -2393
- package/dist/_chunks/libs/mdast-util-to-hast.mjs +11 -1803
- package/dist/_chunks/libs/micromark-extension-gfm.mjs +1 -2243
- package/dist/_chunks/libs/mnemonist.d.mts +1 -91
- package/dist/_chunks/libs/mnemonist.mjs +1 -1978
- package/dist/_chunks/libs/natural-compare-lite.mjs +9 -42
- package/dist/_chunks/libs/ohash.mjs +1 -0
- package/dist/_chunks/libs/rehype-sanitize.mjs +1 -29
- package/dist/_chunks/libs/rehype-stringify.mjs +1 -34
- package/dist/_chunks/libs/remark-gfm.mjs +1 -36
- package/dist/_chunks/libs/remark-github-blockquote-alert.mjs +3 -100
- package/dist/_chunks/libs/remark-parse.mjs +1 -39
- package/dist/_chunks/libs/remark-rehype.mjs +1 -171
- package/dist/_chunks/libs/remeda.mjs +1 -702
- package/dist/_chunks/libs/trough.mjs +1 -158
- package/dist/_chunks/libs/unified.mjs +1 -2212
- package/dist/_chunks/rolldown-runtime.mjs +1 -42
- package/dist/_chunks/{index3.d.mts → theme.d.mts} +15 -13
- package/dist/_chunks/{index7.d.mts → to-text.d.mts} +165 -29
- package/dist/_chunks/to-text.mjs +1 -0
- package/dist/_chunks/vector.d.mts +198 -0
- package/dist/_chunks/vector.mjs +1 -0
- package/dist/builder/index.d.mts +2 -8
- package/dist/builder/index.mjs +1 -662
- package/dist/compute-view/index.d.mts +86 -15
- package/dist/compute-view/index.mjs +2 -262
- package/dist/geometry/index.d.mts +2 -2
- package/dist/geometry/index.mjs +1 -3
- package/dist/index.d.mts +9 -13
- package/dist/index.mjs +1 -27
- package/dist/model/index.d.mts +4 -14
- package/dist/model/index.mjs +1 -11
- package/dist/styles/index.d.mts +2 -8
- package/dist/styles/index.mjs +1 -30
- package/dist/types/index.d.mts +3 -9
- package/dist/types/index.mjs +1 -15
- package/dist/utils/graphology/index.d.mts +1 -1
- package/dist/utils/graphology/index.mjs +1 -3
- package/dist/utils/index.d.mts +4 -11
- package/dist/utils/index.mjs +1 -17
- package/package.json +13 -12
- package/dist/_chunks/LikeC4Styles.mjs +0 -691
- package/dist/_chunks/RichText.d.mts +0 -84
- package/dist/_chunks/_aux.d.mts +0 -289
- package/dist/_chunks/_aux.mjs +0 -18
- package/dist/_chunks/connection.mjs +0 -0
- package/dist/_chunks/const.d.mts +0 -43
- package/dist/_chunks/const.mjs +0 -33
- package/dist/_chunks/expression-model.d.mts +0 -192
- package/dist/_chunks/expression-model.mjs +0 -103
- package/dist/_chunks/expression.d.mts +0 -347
- package/dist/_chunks/expression.mjs +0 -107
- package/dist/_chunks/find.d.mts +0 -82
- package/dist/_chunks/find.mjs +0 -646
- package/dist/_chunks/find2.d.mts +0 -78
- package/dist/_chunks/find2.mjs +0 -287
- package/dist/_chunks/fqnRef.d.mts +0 -58
- package/dist/_chunks/fqnRef.mjs +0 -41
- package/dist/_chunks/geometry.mjs +0 -335
- package/dist/_chunks/index2.d.mts +0 -937
- package/dist/_chunks/index4.d.mts +0 -62
- package/dist/_chunks/index5.d.mts +0 -42
- package/dist/_chunks/index6.d.mts +0 -43
- package/dist/_chunks/index8.d.mts +0 -144
- package/dist/_chunks/invariant.mjs +0 -18
- package/dist/_chunks/iterable.mjs +0 -146
- package/dist/_chunks/libs/graphology-types.d.mts +0 -601
- package/dist/_chunks/libs/graphology.d.mts +0 -6
- package/dist/_chunks/mnemonist.d.mts +0 -1
- package/dist/_chunks/mnemonist.mjs +0 -0
- package/dist/_chunks/model.mjs +0 -1898
- package/dist/_chunks/model2.mjs +0 -0
- package/dist/_chunks/relationships-view.mjs +0 -132
- package/dist/_chunks/scalar.d.mts +0 -109
- package/dist/_chunks/scalar.mjs +0 -84
- package/dist/_chunks/utils.mjs +0 -483
- package/dist/compute-view/relationships-view/index.d.mts +0 -16
- package/dist/compute-view/relationships-view/index.mjs +0 -7
- package/dist/model/connection/deployment/index.d.mts +0 -12
- package/dist/model/connection/deployment/index.mjs +0 -9
- package/dist/model/connection/index.d.mts +0 -14
- package/dist/model/connection/index.mjs +0 -10
- package/dist/model/connection/model/index.d.mts +0 -12
- package/dist/model/connection/model/index.mjs +0 -8
- package/dist/types/RichText.d.mts +0 -3
- package/dist/types/RichText.mjs +0 -7
- package/dist/types/_aux.d.mts +0 -3
- package/dist/types/_aux.mjs +0 -3
- package/dist/types/expression-model.d.mts +0 -6
- package/dist/types/expression-model.mjs +0 -7
- package/dist/types/expression.d.mts +0 -5
- package/dist/types/expression.mjs +0 -7
- package/dist/types/fqnRef.d.mts +0 -4
- package/dist/types/fqnRef.mjs +0 -7
- package/dist/types/scalar.d.mts +0 -2
- package/dist/types/scalar.mjs +0 -7
- package/dist/utils/iterable/index.d.mts +0 -9
- package/dist/utils/iterable/index.mjs +0 -3
- package/dist/utils/mnemonist.d.mts +0 -2
- package/dist/utils/mnemonist.mjs +0 -12
|
@@ -1,158 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @typedef {(error?: Error | null | undefined, ...output: Array<any>) => void} Callback
|
|
4
|
-
* Callback.
|
|
5
|
-
*
|
|
6
|
-
* @typedef {(...input: Array<any>) => any} Middleware
|
|
7
|
-
* Ware.
|
|
8
|
-
*
|
|
9
|
-
* @typedef Pipeline
|
|
10
|
-
* Pipeline.
|
|
11
|
-
* @property {Run} run
|
|
12
|
-
* Run the pipeline.
|
|
13
|
-
* @property {Use} use
|
|
14
|
-
* Add middleware.
|
|
15
|
-
*
|
|
16
|
-
* @typedef {(...input: Array<any>) => void} Run
|
|
17
|
-
* Call all middleware.
|
|
18
|
-
*
|
|
19
|
-
* Calls `done` on completion with either an error or the output of the
|
|
20
|
-
* last middleware.
|
|
21
|
-
*
|
|
22
|
-
* > 👉 **Note**: as the length of input defines whether async functions get a
|
|
23
|
-
* > `next` function,
|
|
24
|
-
* > it’s recommended to keep `input` at one value normally.
|
|
25
|
-
|
|
26
|
-
*
|
|
27
|
-
* @typedef {(fn: Middleware) => Pipeline} Use
|
|
28
|
-
* Add middleware.
|
|
29
|
-
*/
|
|
30
|
-
/**
|
|
31
|
-
* Create new middleware.
|
|
32
|
-
*
|
|
33
|
-
* @returns {Pipeline}
|
|
34
|
-
* Pipeline.
|
|
35
|
-
*/
|
|
36
|
-
function trough() {
|
|
37
|
-
/** @type {Array<Middleware>} */
|
|
38
|
-
const fns = [];
|
|
39
|
-
/** @type {Pipeline} */
|
|
40
|
-
const pipeline = {
|
|
41
|
-
run,
|
|
42
|
-
use
|
|
43
|
-
};
|
|
44
|
-
return pipeline;
|
|
45
|
-
/** @type {Run} */
|
|
46
|
-
function run(...values) {
|
|
47
|
-
let middlewareIndex = -1;
|
|
48
|
-
/** @type {Callback} */
|
|
49
|
-
const callback = values.pop();
|
|
50
|
-
if (typeof callback !== "function") throw new TypeError("Expected function as last argument, not " + callback);
|
|
51
|
-
next(null, ...values);
|
|
52
|
-
/**
|
|
53
|
-
* Run the next `fn`, or we’re done.
|
|
54
|
-
*
|
|
55
|
-
* @param {Error | null | undefined} error
|
|
56
|
-
* @param {Array<any>} output
|
|
57
|
-
*/
|
|
58
|
-
function next(error, ...output) {
|
|
59
|
-
const fn = fns[++middlewareIndex];
|
|
60
|
-
let index = -1;
|
|
61
|
-
if (error) {
|
|
62
|
-
callback(error);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
while (++index < values.length) if (output[index] === null || output[index] === void 0) output[index] = values[index];
|
|
66
|
-
values = output;
|
|
67
|
-
if (fn) wrap(fn, next)(...output);
|
|
68
|
-
else callback(null, ...output);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
/** @type {Use} */
|
|
72
|
-
function use(middelware) {
|
|
73
|
-
if (typeof middelware !== "function") throw new TypeError("Expected `middelware` to be a function, not " + middelware);
|
|
74
|
-
fns.push(middelware);
|
|
75
|
-
return pipeline;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Wrap `middleware` into a uniform interface.
|
|
80
|
-
*
|
|
81
|
-
* You can pass all input to the resulting function.
|
|
82
|
-
* `callback` is then called with the output of `middleware`.
|
|
83
|
-
*
|
|
84
|
-
* If `middleware` accepts more arguments than the later given in input,
|
|
85
|
-
* an extra `done` function is passed to it after that input,
|
|
86
|
-
* which must be called by `middleware`.
|
|
87
|
-
*
|
|
88
|
-
* The first value in `input` is the main input value.
|
|
89
|
-
* All other input values are the rest input values.
|
|
90
|
-
* The values given to `callback` are the input values,
|
|
91
|
-
* merged with every non-nullish output value.
|
|
92
|
-
*
|
|
93
|
-
* * if `middleware` throws an error,
|
|
94
|
-
* returns a promise that is rejected,
|
|
95
|
-
* or calls the given `done` function with an error,
|
|
96
|
-
* `callback` is called with that error
|
|
97
|
-
* * if `middleware` returns a value or returns a promise that is resolved,
|
|
98
|
-
* that value is the main output value
|
|
99
|
-
* * if `middleware` calls `done`,
|
|
100
|
-
* all non-nullish values except for the first one (the error) overwrite the
|
|
101
|
-
* output values
|
|
102
|
-
*
|
|
103
|
-
* @param {Middleware} middleware
|
|
104
|
-
* Function to wrap.
|
|
105
|
-
* @param {Callback} callback
|
|
106
|
-
* Callback called with the output of `middleware`.
|
|
107
|
-
* @returns {Run}
|
|
108
|
-
* Wrapped middleware.
|
|
109
|
-
*/
|
|
110
|
-
function wrap(middleware, callback) {
|
|
111
|
-
/** @type {boolean} */
|
|
112
|
-
let called;
|
|
113
|
-
return wrapped;
|
|
114
|
-
/**
|
|
115
|
-
* Call `middleware`.
|
|
116
|
-
* @this {any}
|
|
117
|
-
* @param {Array<any>} parameters
|
|
118
|
-
* @returns {void}
|
|
119
|
-
*/
|
|
120
|
-
function wrapped(...parameters) {
|
|
121
|
-
const fnExpectsCallback = middleware.length > parameters.length;
|
|
122
|
-
/** @type {any} */
|
|
123
|
-
let result;
|
|
124
|
-
if (fnExpectsCallback) parameters.push(done);
|
|
125
|
-
try {
|
|
126
|
-
result = middleware.apply(this, parameters);
|
|
127
|
-
} catch (error) {
|
|
128
|
-
const exception = error;
|
|
129
|
-
if (fnExpectsCallback && called) throw exception;
|
|
130
|
-
return done(exception);
|
|
131
|
-
}
|
|
132
|
-
if (!fnExpectsCallback) if (result && result.then && typeof result.then === "function") result.then(then, done);
|
|
133
|
-
else if (result instanceof Error) done(result);
|
|
134
|
-
else then(result);
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Call `callback`, only once.
|
|
138
|
-
*
|
|
139
|
-
* @type {Callback}
|
|
140
|
-
*/
|
|
141
|
-
function done(error, ...output) {
|
|
142
|
-
if (!called) {
|
|
143
|
-
called = true;
|
|
144
|
-
callback(error, ...output);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Call `done` with one value.
|
|
149
|
-
*
|
|
150
|
-
* @param {any} [value]
|
|
151
|
-
*/
|
|
152
|
-
function then(value) {
|
|
153
|
-
done(null, value);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
//#endregion
|
|
158
|
-
export { trough as t };
|
|
1
|
+
function trough(){let e=[],n={run:r,use:i};return n;function r(...n){let r=-1,i=n.pop();if(typeof i!=`function`)throw TypeError(`Expected function as last argument, not `+i);a(null,...n);function a(o,...s){let c=e[++r],l=-1;if(o){i(o);return}for(;++l<n.length;)(s[l]===null||s[l]===void 0)&&(s[l]=n[l]);n=s,c?wrap(c,a)(...s):i(null,...s)}}function i(t){if(typeof t!=`function`)throw TypeError("Expected `middelware` to be a function, not "+t);return e.push(t),n}}function wrap(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}export{trough as t};
|