likec4 1.7.4 → 1.8.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/README.md +7 -10
- package/dist/__app__/react/likec4.tsx +14 -1
- package/dist/__app__/src/chunks/{likec4-DA506XqP.js → likec4-Blyd4UZO.js} +229 -209
- package/dist/__app__/src/chunks/{mantine-CIkjlE3R.js → mantine-BYr8JSNL.js} +502 -347
- package/dist/__app__/src/chunks/{tanstack-router-C3bHLsEH.js → tanstack-router-ma6rQsdz.js} +34 -125
- package/dist/__app__/src/const.js +3 -1
- package/dist/__app__/src/main.js +1600 -986
- package/dist/__app__/src/style.css +1 -1
- package/dist/__app__/tsconfig.tsbuildinfo +1 -1
- package/dist/__app__/webcomponent/webcomponent.js +1640 -902
- package/dist/cli/index.mjs +299 -232
- package/package.json +28 -25
- package/react/LikeC4ViewElement.d.ts +24 -1
- package/react/index.mjs +1377 -643
- package/react/types-filter.d.ts +1 -1
- package/react/types.d.ts +27 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import React__default from "react";
|
|
4
3
|
import { flushSync } from "react-dom";
|
|
4
|
+
import { w as withSelectorExports } from "./likec4-Blyd4UZO.js";
|
|
5
5
|
const pushStateEvent = "pushstate", popStateEvent = "popstate", beforeUnloadEvent = "beforeunload", beforeUnloadListener = (event) => (event.preventDefault(), event.returnValue = ""), stopBlocking = () => {
|
|
6
6
|
removeEventListener(beforeUnloadEvent, beforeUnloadListener, {
|
|
7
7
|
capture: !0
|
|
@@ -107,7 +107,7 @@ function createBrowserHistory(opts) {
|
|
|
107
107
|
replaceState: (href, state) => queueHistoryAction("replace", href, state),
|
|
108
108
|
back: () => win.history.back(),
|
|
109
109
|
forward: () => win.history.forward(),
|
|
110
|
-
go: (
|
|
110
|
+
go: (n) => win.history.go(n),
|
|
111
111
|
createHref: (href) => createHref(href),
|
|
112
112
|
flush,
|
|
113
113
|
destroy: () => {
|
|
@@ -157,8 +157,8 @@ function createMemoryHistory(opts = {
|
|
|
157
157
|
forward: () => {
|
|
158
158
|
currentState = assignKey(currentState), index = Math.min(index + 1, entries.length - 1);
|
|
159
159
|
},
|
|
160
|
-
go: (
|
|
161
|
-
currentState = assignKey(currentState), index = Math.min(Math.max(index +
|
|
160
|
+
go: (n) => {
|
|
161
|
+
currentState = assignKey(currentState), index = Math.min(Math.max(index + n, 0), entries.length - 1);
|
|
162
162
|
},
|
|
163
163
|
createHref: (path) => path
|
|
164
164
|
});
|
|
@@ -212,97 +212,6 @@ function useRouter(opts) {
|
|
|
212
212
|
"useRouter must be used inside a <RouterProvider> component!"
|
|
213
213
|
), value;
|
|
214
214
|
}
|
|
215
|
-
var withSelector = { exports: {} }, withSelector_production_min = {}, shim = { exports: {} }, useSyncExternalStoreShim_production_min = {};
|
|
216
|
-
/**
|
|
217
|
-
* @license React
|
|
218
|
-
* use-sync-external-store-shim.production.min.js
|
|
219
|
-
*
|
|
220
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
221
|
-
*
|
|
222
|
-
* This source code is licensed under the MIT license found in the
|
|
223
|
-
* LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/
|
|
225
|
-
var e = React__default;
|
|
226
|
-
function h$1(a, b) {
|
|
227
|
-
return a === b && (a !== 0 || 1 / a === 1 / b) || a !== a && b !== b;
|
|
228
|
-
}
|
|
229
|
-
var k = typeof Object.is == "function" ? Object.is : h$1, l = e.useState, m = e.useEffect, n$1 = e.useLayoutEffect, p$1 = e.useDebugValue;
|
|
230
|
-
function q$1(a, b) {
|
|
231
|
-
var d = b(), f = l({ inst: { value: d, getSnapshot: b } }), c = f[0].inst, g = f[1];
|
|
232
|
-
return n$1(function() {
|
|
233
|
-
c.value = d, c.getSnapshot = b, r$1(c) && g({ inst: c });
|
|
234
|
-
}, [a, d, b]), m(function() {
|
|
235
|
-
return r$1(c) && g({ inst: c }), a(function() {
|
|
236
|
-
r$1(c) && g({ inst: c });
|
|
237
|
-
});
|
|
238
|
-
}, [a]), p$1(d), d;
|
|
239
|
-
}
|
|
240
|
-
function r$1(a) {
|
|
241
|
-
var b = a.getSnapshot;
|
|
242
|
-
a = a.value;
|
|
243
|
-
try {
|
|
244
|
-
var d = b();
|
|
245
|
-
return !k(a, d);
|
|
246
|
-
} catch {
|
|
247
|
-
return !0;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
function t$1(a, b) {
|
|
251
|
-
return b();
|
|
252
|
-
}
|
|
253
|
-
var u$1 = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? t$1 : q$1;
|
|
254
|
-
useSyncExternalStoreShim_production_min.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : u$1;
|
|
255
|
-
shim.exports;
|
|
256
|
-
shim.exports = useSyncExternalStoreShim_production_min;
|
|
257
|
-
var shimExports = shim.exports;
|
|
258
|
-
/**
|
|
259
|
-
* @license React
|
|
260
|
-
* use-sync-external-store-shim/with-selector.production.min.js
|
|
261
|
-
*
|
|
262
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
263
|
-
*
|
|
264
|
-
* This source code is licensed under the MIT license found in the
|
|
265
|
-
* LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/
|
|
267
|
-
var h = React__default, n = shimExports;
|
|
268
|
-
function p(a, b) {
|
|
269
|
-
return a === b && (a !== 0 || 1 / a === 1 / b) || a !== a && b !== b;
|
|
270
|
-
}
|
|
271
|
-
var q = typeof Object.is == "function" ? Object.is : p, r = n.useSyncExternalStore, t = h.useRef, u = h.useEffect, v = h.useMemo, w = h.useDebugValue;
|
|
272
|
-
withSelector_production_min.useSyncExternalStoreWithSelector = function(a, b, e2, l2, g) {
|
|
273
|
-
var c = t(null);
|
|
274
|
-
if (c.current === null) {
|
|
275
|
-
var f = { hasValue: !1, value: null };
|
|
276
|
-
c.current = f;
|
|
277
|
-
} else f = c.current;
|
|
278
|
-
c = v(function() {
|
|
279
|
-
function a2(a3) {
|
|
280
|
-
if (!c2) {
|
|
281
|
-
if (c2 = !0, d2 = a3, a3 = l2(a3), g !== void 0 && f.hasValue) {
|
|
282
|
-
var b2 = f.value;
|
|
283
|
-
if (g(b2, a3)) return k2 = b2;
|
|
284
|
-
}
|
|
285
|
-
return k2 = a3;
|
|
286
|
-
}
|
|
287
|
-
if (b2 = k2, q(d2, a3)) return b2;
|
|
288
|
-
var e3 = l2(a3);
|
|
289
|
-
return g !== void 0 && g(b2, e3) ? b2 : (d2 = a3, k2 = e3);
|
|
290
|
-
}
|
|
291
|
-
var c2 = !1, d2, k2, m2 = e2 === void 0 ? null : e2;
|
|
292
|
-
return [function() {
|
|
293
|
-
return a2(b());
|
|
294
|
-
}, m2 === null ? void 0 : function() {
|
|
295
|
-
return a2(m2());
|
|
296
|
-
}];
|
|
297
|
-
}, [b, e2, l2, g]);
|
|
298
|
-
var d = r(a, c[0], c[1]);
|
|
299
|
-
return u(function() {
|
|
300
|
-
f.hasValue = !0, f.value = d;
|
|
301
|
-
}, [d]), w(d), d;
|
|
302
|
-
};
|
|
303
|
-
withSelector.exports;
|
|
304
|
-
withSelector.exports = withSelector_production_min;
|
|
305
|
-
var withSelectorExports = withSelector.exports;
|
|
306
215
|
class Store {
|
|
307
216
|
constructor(initialState, options) {
|
|
308
217
|
this.listeners = /* @__PURE__ */ new Set(), this._batching = !1, this._flushing = 0, this.subscribe = (listener) => {
|
|
@@ -352,14 +261,14 @@ function shallow(objA, objB) {
|
|
|
352
261
|
}
|
|
353
262
|
const rootRouteId = "__root__";
|
|
354
263
|
function encode(obj, pfx) {
|
|
355
|
-
let
|
|
356
|
-
for (
|
|
357
|
-
if ((tmp = obj[
|
|
264
|
+
let k, i, tmp, str = "";
|
|
265
|
+
for (k in obj)
|
|
266
|
+
if ((tmp = obj[k]) !== void 0)
|
|
358
267
|
if (Array.isArray(tmp))
|
|
359
268
|
for (i = 0; i < tmp.length; i++)
|
|
360
|
-
str && (str += "&"), str += encodeURIComponent(
|
|
269
|
+
str && (str += "&"), str += encodeURIComponent(k) + "=" + encodeURIComponent(tmp[i]);
|
|
361
270
|
else
|
|
362
|
-
str && (str += "&"), str += encodeURIComponent(
|
|
271
|
+
str && (str += "&"), str += encodeURIComponent(k) + "=" + encodeURIComponent(tmp);
|
|
363
272
|
return "" + str;
|
|
364
273
|
}
|
|
365
274
|
function toValue(mix) {
|
|
@@ -368,16 +277,16 @@ function toValue(mix) {
|
|
|
368
277
|
return str === "false" ? !1 : str === "true" ? !0 : +str * 0 === 0 && +str + "" === str ? +str : str;
|
|
369
278
|
}
|
|
370
279
|
function decode(str, pfx) {
|
|
371
|
-
let tmp,
|
|
280
|
+
let tmp, k;
|
|
372
281
|
const out = {}, arr = str.split("&");
|
|
373
282
|
for (; tmp = arr.shift(); ) {
|
|
374
283
|
const equalIndex = tmp.indexOf("=");
|
|
375
284
|
if (equalIndex !== -1) {
|
|
376
|
-
|
|
285
|
+
k = tmp.slice(0, equalIndex);
|
|
377
286
|
const value = tmp.slice(equalIndex + 1);
|
|
378
|
-
out[
|
|
287
|
+
out[k] !== void 0 ? out[k] = [].concat(out[k], toValue(value)) : out[k] = toValue(value);
|
|
379
288
|
} else
|
|
380
|
-
|
|
289
|
+
k = tmp, out[k] = "";
|
|
381
290
|
}
|
|
382
291
|
return out;
|
|
383
292
|
}
|
|
@@ -486,8 +395,8 @@ function createControlledPromise(onResolve) {
|
|
|
486
395
|
});
|
|
487
396
|
return controlledPromise.status = "pending", controlledPromise.resolve = (value) => {
|
|
488
397
|
controlledPromise.status = "resolved", controlledPromise.value = value, resolveLoadPromise(value), onResolve?.(value);
|
|
489
|
-
}, controlledPromise.reject = (
|
|
490
|
-
controlledPromise.status = "rejected", rejectLoadPromise(
|
|
398
|
+
}, controlledPromise.reject = (e) => {
|
|
399
|
+
controlledPromise.status = "rejected", rejectLoadPromise(e);
|
|
491
400
|
}, controlledPromise;
|
|
492
401
|
}
|
|
493
402
|
function usePrevious(value) {
|
|
@@ -1063,7 +972,7 @@ class Router {
|
|
|
1063
972
|
"Could not find match for from: " + dest.from
|
|
1064
973
|
);
|
|
1065
974
|
const fromSearch = ((_a = last(fromMatches)) == null ? void 0 : _a.search) || this.latestLocation.search, stayingMatches = matches?.filter(
|
|
1066
|
-
(d) => fromMatches.find((
|
|
975
|
+
(d) => fromMatches.find((e) => e.routeId === d.routeId)
|
|
1067
976
|
), fromRouteByFromPathRouteId = this.routesById[(_b = stayingMatches?.find((d) => d.pathname === fromPath)) == null ? void 0 : _b.routeId];
|
|
1068
977
|
let pathname = dest.to ? this.resolvePathWithBase(fromPath, `${dest.to}`) : this.resolvePathWithBase(
|
|
1069
978
|
fromPath,
|
|
@@ -1219,7 +1128,7 @@ class Router {
|
|
|
1219
1128
|
location: next,
|
|
1220
1129
|
pendingMatches,
|
|
1221
1130
|
// If a cached moved to pendingMatches, remove it from cachedMatches
|
|
1222
|
-
cachedMatches: s.cachedMatches.filter((d) => !pendingMatches.find((
|
|
1131
|
+
cachedMatches: s.cachedMatches.filter((d) => !pendingMatches.find((e) => e.id === d.id))
|
|
1223
1132
|
}));
|
|
1224
1133
|
}), this.state.redirect || this.emit({
|
|
1225
1134
|
type: "onBeforeNavigate",
|
|
@@ -1531,11 +1440,11 @@ class Router {
|
|
|
1531
1440
|
meta,
|
|
1532
1441
|
headers
|
|
1533
1442
|
}));
|
|
1534
|
-
} catch (
|
|
1535
|
-
let error =
|
|
1536
|
-
await potentialPendingMinPromise(), handleRedirectAndNotFound(this.getMatch(matchId),
|
|
1443
|
+
} catch (e) {
|
|
1444
|
+
let error = e;
|
|
1445
|
+
await potentialPendingMinPromise(), handleRedirectAndNotFound(this.getMatch(matchId), e);
|
|
1537
1446
|
try {
|
|
1538
|
-
(_h = (_g = route.options).onError) == null || _h.call(_g,
|
|
1447
|
+
(_h = (_g = route.options).onError) == null || _h.call(_g, e);
|
|
1539
1448
|
} catch (onErrorError) {
|
|
1540
1449
|
error = onErrorError, handleRedirectAndNotFound(
|
|
1541
1450
|
this.getMatch(matchId),
|
|
@@ -2001,9 +1910,9 @@ function useLinkProps(options) {
|
|
|
2001
1910
|
...onMouseLeave && { onMouseLeave },
|
|
2002
1911
|
...onTouchStart && { onTouchStart }
|
|
2003
1912
|
};
|
|
2004
|
-
const handleClick = (
|
|
2005
|
-
if (!disabled && !isCtrlEvent(
|
|
2006
|
-
|
|
1913
|
+
const handleClick = (e) => {
|
|
1914
|
+
if (!disabled && !isCtrlEvent(e) && !e.defaultPrevented && (!target || target === "_self") && e.button === 0) {
|
|
1915
|
+
e.preventDefault(), flushSync(() => {
|
|
2007
1916
|
setIsTransitioning(!0);
|
|
2008
1917
|
});
|
|
2009
1918
|
const unsub = router.subscribe("onResolved", () => {
|
|
@@ -2022,11 +1931,11 @@ function useLinkProps(options) {
|
|
|
2022
1931
|
router.preloadRoute(options).catch((err) => {
|
|
2023
1932
|
console.warn(err), console.warn(preloadWarning);
|
|
2024
1933
|
});
|
|
2025
|
-
}, handleFocus = (
|
|
1934
|
+
}, handleFocus = (e) => {
|
|
2026
1935
|
disabled || preload && doPreload();
|
|
2027
|
-
}, handleTouchStart = handleFocus, handleEnter = (
|
|
1936
|
+
}, handleTouchStart = handleFocus, handleEnter = (e) => {
|
|
2028
1937
|
if (disabled) return;
|
|
2029
|
-
const eventTarget =
|
|
1938
|
+
const eventTarget = e.target || {};
|
|
2030
1939
|
if (preload) {
|
|
2031
1940
|
if (eventTarget.preloadTimeout)
|
|
2032
1941
|
return;
|
|
@@ -2034,14 +1943,14 @@ function useLinkProps(options) {
|
|
|
2034
1943
|
eventTarget.preloadTimeout = null, doPreload();
|
|
2035
1944
|
}, preloadDelay);
|
|
2036
1945
|
}
|
|
2037
|
-
}, handleLeave = (
|
|
1946
|
+
}, handleLeave = (e) => {
|
|
2038
1947
|
if (disabled) return;
|
|
2039
|
-
const eventTarget =
|
|
1948
|
+
const eventTarget = e.target || {};
|
|
2040
1949
|
eventTarget.preloadTimeout && (clearTimeout(eventTarget.preloadTimeout), eventTarget.preloadTimeout = null);
|
|
2041
|
-
}, composeHandlers = (handlers) => (
|
|
1950
|
+
}, composeHandlers = (handlers) => (e) => {
|
|
2042
1951
|
var _a;
|
|
2043
|
-
(_a =
|
|
2044
|
-
|
|
1952
|
+
(_a = e.persist) == null || _a.call(e), handlers.filter(Boolean).forEach((handler) => {
|
|
1953
|
+
e.defaultPrevented || handler(e);
|
|
2045
1954
|
});
|
|
2046
1955
|
}, resolvedActiveProps = isActive ? functionalUpdate(activeProps, {}) ?? {} : {}, resolvedInactiveProps = isActive ? {} : functionalUpdate(inactiveProps, {}), resolvedClassName = [
|
|
2047
1956
|
className,
|
|
@@ -2087,8 +1996,8 @@ const Link = React.forwardRef((props, ref) => {
|
|
|
2087
1996
|
children
|
|
2088
1997
|
);
|
|
2089
1998
|
});
|
|
2090
|
-
function isCtrlEvent(
|
|
2091
|
-
return !!(
|
|
1999
|
+
function isCtrlEvent(e) {
|
|
2000
|
+
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
2092
2001
|
}
|
|
2093
2002
|
function Transitioner() {
|
|
2094
2003
|
const router = useRouter(), mountLoadForRouter = React.useRef({ router, mounted: !1 }), routerState = useRouterState({
|
|
@@ -8,6 +8,8 @@ if (!BASE.endsWith('/')) {
|
|
|
8
8
|
BASE = BASE + '/'
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const useHashHistory = __USE_HASH_HISTORY__
|
|
11
|
+
export const useHashHistory = __USE_HASH_HISTORY__ === true
|
|
12
12
|
|
|
13
13
|
export const basepath = useHashHistory ? '/' : BASE
|
|
14
|
+
|
|
15
|
+
export const withOverviewGraph = __USE_OVERVIEW_GRAPH__ === true
|