@almadar/ui 5.76.4 → 5.76.6
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/avl/index.cjs +18 -78
- package/dist/avl/index.js +18 -78
- package/dist/components/core/molecules/markdown/CodeBlock.d.ts +1 -1
- package/dist/components/game/2d/organisms/SimulationCanvas.d.ts +5 -5
- package/dist/components/game/3d/index.cjs +5 -2
- package/dist/components/game/3d/index.js +5 -2
- package/dist/components/index.cjs +18 -78
- package/dist/components/index.js +18 -78
- package/dist/marketing/index.cjs +8 -4
- package/dist/marketing/index.js +8 -4
- package/dist/providers/index.cjs +18 -78
- package/dist/providers/index.js +18 -78
- package/dist/runtime/index.cjs +18 -78
- package/dist/runtime/index.js +18 -78
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1258,14 +1258,17 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
1258
1258
|
Wrapped.displayName = `Lazy.${libKey}.${fallbackName}`;
|
|
1259
1259
|
return Wrapped;
|
|
1260
1260
|
}
|
|
1261
|
+
function isComponentLike(v) {
|
|
1262
|
+
return v != null && (typeof v === "function" || typeof v === "object");
|
|
1263
|
+
}
|
|
1261
1264
|
function resolveLucide(name) {
|
|
1262
1265
|
if (lucideAliases[name]) return lucideAliases[name];
|
|
1263
1266
|
const pascal = kebabToPascal(name);
|
|
1264
1267
|
const lucideMap = LucideIcons2;
|
|
1265
1268
|
const direct = lucideMap[pascal];
|
|
1266
|
-
if (direct
|
|
1269
|
+
if (isComponentLike(direct)) return direct;
|
|
1267
1270
|
const asIs = lucideMap[name];
|
|
1268
|
-
if (asIs
|
|
1271
|
+
if (isComponentLike(asIs)) return asIs;
|
|
1269
1272
|
return LucideIcons2.HelpCircle;
|
|
1270
1273
|
}
|
|
1271
1274
|
function resolvePhosphor(name, weight, family) {
|
|
@@ -1909,12 +1912,13 @@ function resolveIcon(name) {
|
|
|
1909
1912
|
}
|
|
1910
1913
|
function doResolve(name) {
|
|
1911
1914
|
if (iconAliases[name]) return iconAliases[name];
|
|
1915
|
+
const isComponentLike2 = (v) => v != null && (typeof v === "function" || typeof v === "object");
|
|
1912
1916
|
const pascalName = kebabToPascal2(name);
|
|
1913
1917
|
const lucideMap = LucideIcons2;
|
|
1914
1918
|
const directLookup = lucideMap[pascalName];
|
|
1915
|
-
if (directLookup
|
|
1919
|
+
if (isComponentLike2(directLookup)) return directLookup;
|
|
1916
1920
|
const asIs = lucideMap[name];
|
|
1917
|
-
if (asIs
|
|
1921
|
+
if (isComponentLike2(asIs)) return asIs;
|
|
1918
1922
|
return LucideIcons2.HelpCircle;
|
|
1919
1923
|
}
|
|
1920
1924
|
var colorTokenClasses, iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
|
|
@@ -12660,7 +12664,7 @@ function generateDiff(oldVal, newVal) {
|
|
|
12660
12664
|
}
|
|
12661
12665
|
return diff;
|
|
12662
12666
|
}
|
|
12663
|
-
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log5, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
12667
|
+
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log5, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
12664
12668
|
var init_CodeBlock = __esm({
|
|
12665
12669
|
"components/core/molecules/markdown/CodeBlock.tsx"() {
|
|
12666
12670
|
init_cn();
|
|
@@ -12777,9 +12781,13 @@ var init_CodeBlock = __esm({
|
|
|
12777
12781
|
CODE_LANGUAGE_SET = new Set(CODE_LANGUAGES);
|
|
12778
12782
|
DIFF_STYLES = {
|
|
12779
12783
|
add: { bg: "bg-success/10", prefix: "+", text: "text-success" },
|
|
12784
|
+
added: { bg: "bg-success/10", prefix: "+", text: "text-success" },
|
|
12780
12785
|
remove: { bg: "bg-error/10", prefix: "-", text: "text-error" },
|
|
12781
|
-
|
|
12786
|
+
removed: { bg: "bg-error/10", prefix: "-", text: "text-error" },
|
|
12787
|
+
context: { bg: "", prefix: " ", text: "text-foreground" },
|
|
12788
|
+
unchanged: { bg: "", prefix: " ", text: "text-foreground" }
|
|
12782
12789
|
};
|
|
12790
|
+
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
12783
12791
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
12784
12792
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
12785
12793
|
CodeBlock = React80__default.memo(
|
|
@@ -13144,7 +13152,7 @@ var init_CodeBlock = __esm({
|
|
|
13144
13152
|
}
|
|
13145
13153
|
),
|
|
13146
13154
|
/* @__PURE__ */ jsx(Box, { className: "overflow-auto bg-muted/20", style: { maxHeight }, children: diffLines ? /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column" }, className: "font-mono text-xs", children: diffLines.map((line, idx) => {
|
|
13147
|
-
const style = DIFF_STYLES[line.type];
|
|
13155
|
+
const style = DIFF_STYLES[line.type] ?? DIFF_STYLE_FALLBACK;
|
|
13148
13156
|
return /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
|
|
13149
13157
|
showLineNumbers && /* @__PURE__ */ jsx(
|
|
13150
13158
|
Typography,
|
|
@@ -15852,7 +15860,7 @@ var init_BookTableOfContents = __esm({
|
|
|
15852
15860
|
style: { direction },
|
|
15853
15861
|
children: [
|
|
15854
15862
|
/* @__PURE__ */ jsx(Typography, { variant: "h1", className: "text-3xl font-bold text-center mb-4", children: t("book.tableOfContents") }),
|
|
15855
|
-
parts.map((part, partIdx) => {
|
|
15863
|
+
(Array.isArray(parts) ? parts : []).map((part, partIdx) => {
|
|
15856
15864
|
const chapters = Array.isArray(part.chapters) ? part.chapters : [];
|
|
15857
15865
|
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
|
|
15858
15866
|
/* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
@@ -35420,8 +35428,6 @@ function SimulationCanvas({
|
|
|
35420
35428
|
preset: presetProp,
|
|
35421
35429
|
width = 600,
|
|
35422
35430
|
height = 400,
|
|
35423
|
-
running,
|
|
35424
|
-
speed = 1,
|
|
35425
35431
|
bodies: externalBodies,
|
|
35426
35432
|
className
|
|
35427
35433
|
}) {
|
|
@@ -35432,59 +35438,6 @@ function SimulationCanvas({
|
|
|
35432
35438
|
useEffect(() => {
|
|
35433
35439
|
bodiesRef.current = structuredClone(preset.bodies);
|
|
35434
35440
|
}, [preset]);
|
|
35435
|
-
const step = useCallback(() => {
|
|
35436
|
-
const dt = Math.min(1 / 60 * speed, 1 / 15);
|
|
35437
|
-
const gx = preset.gravity?.x ?? 0;
|
|
35438
|
-
const gy = preset.gravity?.y ?? 9.81;
|
|
35439
|
-
const bodies = bodiesRef.current;
|
|
35440
|
-
const maxVel = Math.max(width, height) * 5;
|
|
35441
|
-
for (const body of bodies) {
|
|
35442
|
-
if (body.fixed) continue;
|
|
35443
|
-
body.vx += gx * dt;
|
|
35444
|
-
body.vy += gy * dt;
|
|
35445
|
-
body.vx = Math.max(-maxVel, Math.min(maxVel, body.vx));
|
|
35446
|
-
body.vy = Math.max(-maxVel, Math.min(maxVel, body.vy));
|
|
35447
|
-
body.x += body.vx * dt;
|
|
35448
|
-
body.y += body.vy * dt;
|
|
35449
|
-
if (body.y + body.radius > height) {
|
|
35450
|
-
body.y = height - body.radius;
|
|
35451
|
-
body.vy = -body.vy * 0.8;
|
|
35452
|
-
}
|
|
35453
|
-
if (body.y - body.radius < 0) {
|
|
35454
|
-
body.y = body.radius;
|
|
35455
|
-
body.vy = -body.vy * 0.8;
|
|
35456
|
-
}
|
|
35457
|
-
if (body.x + body.radius > width) {
|
|
35458
|
-
body.x = width - body.radius;
|
|
35459
|
-
body.vx = -body.vx * 0.8;
|
|
35460
|
-
}
|
|
35461
|
-
if (body.x - body.radius < 0) {
|
|
35462
|
-
body.x = body.radius;
|
|
35463
|
-
body.vx = -body.vx * 0.8;
|
|
35464
|
-
}
|
|
35465
|
-
}
|
|
35466
|
-
if (preset.constraints) {
|
|
35467
|
-
for (const c of preset.constraints) {
|
|
35468
|
-
const a = bodies[c.bodyA];
|
|
35469
|
-
const b = bodies[c.bodyB];
|
|
35470
|
-
if (!a || !b) continue;
|
|
35471
|
-
const dx = b.x - a.x;
|
|
35472
|
-
const dy = b.y - a.y;
|
|
35473
|
-
const dist = Math.sqrt(dx * dx + dy * dy) || 1e-3;
|
|
35474
|
-
const diff = (dist - c.length) / dist;
|
|
35475
|
-
const fx = dx * diff * c.stiffness;
|
|
35476
|
-
const fy = dy * diff * c.stiffness;
|
|
35477
|
-
if (!a.fixed) {
|
|
35478
|
-
a.vx += fx * dt;
|
|
35479
|
-
a.vy += fy * dt;
|
|
35480
|
-
}
|
|
35481
|
-
if (!b.fixed) {
|
|
35482
|
-
b.vx -= fx * dt;
|
|
35483
|
-
b.vy -= fy * dt;
|
|
35484
|
-
}
|
|
35485
|
-
}
|
|
35486
|
-
}
|
|
35487
|
-
}, [preset, width, height, speed]);
|
|
35488
35441
|
const draw = useCallback(() => {
|
|
35489
35442
|
const canvas = canvasRef.current;
|
|
35490
35443
|
if (!canvas) return;
|
|
@@ -35586,21 +35539,8 @@ function SimulationCanvas({
|
|
|
35586
35539
|
return interp.startLoop(drawInterpolated);
|
|
35587
35540
|
}, [externalBodies !== void 0, interp.startLoop]);
|
|
35588
35541
|
useEffect(() => {
|
|
35589
|
-
if (externalBodies !== void 0) return;
|
|
35590
|
-
if (!running) return;
|
|
35591
|
-
let raf;
|
|
35592
|
-
const loop = () => {
|
|
35593
|
-
step();
|
|
35594
|
-
draw();
|
|
35595
|
-
raf = requestAnimationFrame(loop);
|
|
35596
|
-
};
|
|
35597
|
-
raf = requestAnimationFrame(loop);
|
|
35598
|
-
return () => cancelAnimationFrame(raf);
|
|
35599
|
-
}, [running, step, draw, externalBodies]);
|
|
35600
|
-
useEffect(() => {
|
|
35601
|
-
if (externalBodies !== void 0) return;
|
|
35602
35542
|
draw();
|
|
35603
|
-
}, [draw
|
|
35543
|
+
}, [draw]);
|
|
35604
35544
|
useEffect(() => {
|
|
35605
35545
|
if (typeof window === "undefined") return;
|
|
35606
35546
|
const canvas = canvasRef.current;
|
|
@@ -41962,7 +41902,7 @@ var init_RichBlockEditor = __esm({
|
|
|
41962
41902
|
changeEvent,
|
|
41963
41903
|
readOnly = false,
|
|
41964
41904
|
placeholder,
|
|
41965
|
-
enableBlocks =
|
|
41905
|
+
enableBlocks = true,
|
|
41966
41906
|
showToolbar = true,
|
|
41967
41907
|
className
|
|
41968
41908
|
}) => {
|
package/dist/marketing/index.cjs
CHANGED
|
@@ -3165,14 +3165,17 @@ var lucideAliases = {
|
|
|
3165
3165
|
"sort-asc": LucideIcons2__namespace.ArrowUpNarrowWide,
|
|
3166
3166
|
"sort-desc": LucideIcons2__namespace.ArrowDownNarrowWide
|
|
3167
3167
|
};
|
|
3168
|
+
function isComponentLike(v) {
|
|
3169
|
+
return v != null && (typeof v === "function" || typeof v === "object");
|
|
3170
|
+
}
|
|
3168
3171
|
function resolveLucide(name) {
|
|
3169
3172
|
if (lucideAliases[name]) return lucideAliases[name];
|
|
3170
3173
|
const pascal = kebabToPascal(name);
|
|
3171
3174
|
const lucideMap = LucideIcons2__namespace;
|
|
3172
3175
|
const direct = lucideMap[pascal];
|
|
3173
|
-
if (direct
|
|
3176
|
+
if (isComponentLike(direct)) return direct;
|
|
3174
3177
|
const asIs = lucideMap[name];
|
|
3175
|
-
if (asIs
|
|
3178
|
+
if (isComponentLike(asIs)) return asIs;
|
|
3176
3179
|
return LucideIcons2__namespace.HelpCircle;
|
|
3177
3180
|
}
|
|
3178
3181
|
var phosphorAliases = {
|
|
@@ -3806,12 +3809,13 @@ function resolveIcon(name) {
|
|
|
3806
3809
|
}
|
|
3807
3810
|
function doResolve(name) {
|
|
3808
3811
|
if (iconAliases[name]) return iconAliases[name];
|
|
3812
|
+
const isComponentLike2 = (v) => v != null && (typeof v === "function" || typeof v === "object");
|
|
3809
3813
|
const pascalName = kebabToPascal2(name);
|
|
3810
3814
|
const lucideMap = LucideIcons2__namespace;
|
|
3811
3815
|
const directLookup = lucideMap[pascalName];
|
|
3812
|
-
if (directLookup
|
|
3816
|
+
if (isComponentLike2(directLookup)) return directLookup;
|
|
3813
3817
|
const asIs = lucideMap[name];
|
|
3814
|
-
if (asIs
|
|
3818
|
+
if (isComponentLike2(asIs)) return asIs;
|
|
3815
3819
|
return LucideIcons2__namespace.HelpCircle;
|
|
3816
3820
|
}
|
|
3817
3821
|
var sizeClasses = {
|
package/dist/marketing/index.js
CHANGED
|
@@ -3141,14 +3141,17 @@ var lucideAliases = {
|
|
|
3141
3141
|
"sort-asc": LucideIcons2.ArrowUpNarrowWide,
|
|
3142
3142
|
"sort-desc": LucideIcons2.ArrowDownNarrowWide
|
|
3143
3143
|
};
|
|
3144
|
+
function isComponentLike(v) {
|
|
3145
|
+
return v != null && (typeof v === "function" || typeof v === "object");
|
|
3146
|
+
}
|
|
3144
3147
|
function resolveLucide(name) {
|
|
3145
3148
|
if (lucideAliases[name]) return lucideAliases[name];
|
|
3146
3149
|
const pascal = kebabToPascal(name);
|
|
3147
3150
|
const lucideMap = LucideIcons2;
|
|
3148
3151
|
const direct = lucideMap[pascal];
|
|
3149
|
-
if (direct
|
|
3152
|
+
if (isComponentLike(direct)) return direct;
|
|
3150
3153
|
const asIs = lucideMap[name];
|
|
3151
|
-
if (asIs
|
|
3154
|
+
if (isComponentLike(asIs)) return asIs;
|
|
3152
3155
|
return LucideIcons2.HelpCircle;
|
|
3153
3156
|
}
|
|
3154
3157
|
var phosphorAliases = {
|
|
@@ -3782,12 +3785,13 @@ function resolveIcon(name) {
|
|
|
3782
3785
|
}
|
|
3783
3786
|
function doResolve(name) {
|
|
3784
3787
|
if (iconAliases[name]) return iconAliases[name];
|
|
3788
|
+
const isComponentLike2 = (v) => v != null && (typeof v === "function" || typeof v === "object");
|
|
3785
3789
|
const pascalName = kebabToPascal2(name);
|
|
3786
3790
|
const lucideMap = LucideIcons2;
|
|
3787
3791
|
const directLookup = lucideMap[pascalName];
|
|
3788
|
-
if (directLookup
|
|
3792
|
+
if (isComponentLike2(directLookup)) return directLookup;
|
|
3789
3793
|
const asIs = lucideMap[name];
|
|
3790
|
-
if (asIs
|
|
3794
|
+
if (isComponentLike2(asIs)) return asIs;
|
|
3791
3795
|
return LucideIcons2.HelpCircle;
|
|
3792
3796
|
}
|
|
3793
3797
|
var sizeClasses = {
|
package/dist/providers/index.cjs
CHANGED
|
@@ -620,14 +620,17 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
620
620
|
Wrapped.displayName = `Lazy.${libKey}.${fallbackName}`;
|
|
621
621
|
return Wrapped;
|
|
622
622
|
}
|
|
623
|
+
function isComponentLike(v) {
|
|
624
|
+
return v != null && (typeof v === "function" || typeof v === "object");
|
|
625
|
+
}
|
|
623
626
|
function resolveLucide(name) {
|
|
624
627
|
if (lucideAliases[name]) return lucideAliases[name];
|
|
625
628
|
const pascal = kebabToPascal(name);
|
|
626
629
|
const lucideMap = LucideIcons2__namespace;
|
|
627
630
|
const direct = lucideMap[pascal];
|
|
628
|
-
if (direct
|
|
631
|
+
if (isComponentLike(direct)) return direct;
|
|
629
632
|
const asIs = lucideMap[name];
|
|
630
|
-
if (asIs
|
|
633
|
+
if (isComponentLike(asIs)) return asIs;
|
|
631
634
|
return LucideIcons2__namespace.HelpCircle;
|
|
632
635
|
}
|
|
633
636
|
function resolvePhosphor(name, weight, family) {
|
|
@@ -1271,12 +1274,13 @@ function resolveIcon(name) {
|
|
|
1271
1274
|
}
|
|
1272
1275
|
function doResolve(name) {
|
|
1273
1276
|
if (iconAliases[name]) return iconAliases[name];
|
|
1277
|
+
const isComponentLike2 = (v) => v != null && (typeof v === "function" || typeof v === "object");
|
|
1274
1278
|
const pascalName = kebabToPascal2(name);
|
|
1275
1279
|
const lucideMap = LucideIcons2__namespace;
|
|
1276
1280
|
const directLookup = lucideMap[pascalName];
|
|
1277
|
-
if (directLookup
|
|
1281
|
+
if (isComponentLike2(directLookup)) return directLookup;
|
|
1278
1282
|
const asIs = lucideMap[name];
|
|
1279
|
-
if (asIs
|
|
1283
|
+
if (isComponentLike2(asIs)) return asIs;
|
|
1280
1284
|
return LucideIcons2__namespace.HelpCircle;
|
|
1281
1285
|
}
|
|
1282
1286
|
var colorTokenClasses, iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
|
|
@@ -18895,8 +18899,6 @@ function SimulationCanvas({
|
|
|
18895
18899
|
preset: presetProp,
|
|
18896
18900
|
width = 600,
|
|
18897
18901
|
height = 400,
|
|
18898
|
-
running,
|
|
18899
|
-
speed = 1,
|
|
18900
18902
|
bodies: externalBodies,
|
|
18901
18903
|
className
|
|
18902
18904
|
}) {
|
|
@@ -18907,59 +18909,6 @@ function SimulationCanvas({
|
|
|
18907
18909
|
React107.useEffect(() => {
|
|
18908
18910
|
bodiesRef.current = structuredClone(preset.bodies);
|
|
18909
18911
|
}, [preset]);
|
|
18910
|
-
const step = React107.useCallback(() => {
|
|
18911
|
-
const dt = Math.min(1 / 60 * speed, 1 / 15);
|
|
18912
|
-
const gx = preset.gravity?.x ?? 0;
|
|
18913
|
-
const gy = preset.gravity?.y ?? 9.81;
|
|
18914
|
-
const bodies = bodiesRef.current;
|
|
18915
|
-
const maxVel = Math.max(width, height) * 5;
|
|
18916
|
-
for (const body of bodies) {
|
|
18917
|
-
if (body.fixed) continue;
|
|
18918
|
-
body.vx += gx * dt;
|
|
18919
|
-
body.vy += gy * dt;
|
|
18920
|
-
body.vx = Math.max(-maxVel, Math.min(maxVel, body.vx));
|
|
18921
|
-
body.vy = Math.max(-maxVel, Math.min(maxVel, body.vy));
|
|
18922
|
-
body.x += body.vx * dt;
|
|
18923
|
-
body.y += body.vy * dt;
|
|
18924
|
-
if (body.y + body.radius > height) {
|
|
18925
|
-
body.y = height - body.radius;
|
|
18926
|
-
body.vy = -body.vy * 0.8;
|
|
18927
|
-
}
|
|
18928
|
-
if (body.y - body.radius < 0) {
|
|
18929
|
-
body.y = body.radius;
|
|
18930
|
-
body.vy = -body.vy * 0.8;
|
|
18931
|
-
}
|
|
18932
|
-
if (body.x + body.radius > width) {
|
|
18933
|
-
body.x = width - body.radius;
|
|
18934
|
-
body.vx = -body.vx * 0.8;
|
|
18935
|
-
}
|
|
18936
|
-
if (body.x - body.radius < 0) {
|
|
18937
|
-
body.x = body.radius;
|
|
18938
|
-
body.vx = -body.vx * 0.8;
|
|
18939
|
-
}
|
|
18940
|
-
}
|
|
18941
|
-
if (preset.constraints) {
|
|
18942
|
-
for (const c of preset.constraints) {
|
|
18943
|
-
const a = bodies[c.bodyA];
|
|
18944
|
-
const b = bodies[c.bodyB];
|
|
18945
|
-
if (!a || !b) continue;
|
|
18946
|
-
const dx = b.x - a.x;
|
|
18947
|
-
const dy = b.y - a.y;
|
|
18948
|
-
const dist = Math.sqrt(dx * dx + dy * dy) || 1e-3;
|
|
18949
|
-
const diff = (dist - c.length) / dist;
|
|
18950
|
-
const fx = dx * diff * c.stiffness;
|
|
18951
|
-
const fy = dy * diff * c.stiffness;
|
|
18952
|
-
if (!a.fixed) {
|
|
18953
|
-
a.vx += fx * dt;
|
|
18954
|
-
a.vy += fy * dt;
|
|
18955
|
-
}
|
|
18956
|
-
if (!b.fixed) {
|
|
18957
|
-
b.vx -= fx * dt;
|
|
18958
|
-
b.vy -= fy * dt;
|
|
18959
|
-
}
|
|
18960
|
-
}
|
|
18961
|
-
}
|
|
18962
|
-
}, [preset, width, height, speed]);
|
|
18963
18912
|
const draw = React107.useCallback(() => {
|
|
18964
18913
|
const canvas = canvasRef.current;
|
|
18965
18914
|
if (!canvas) return;
|
|
@@ -19061,21 +19010,8 @@ function SimulationCanvas({
|
|
|
19061
19010
|
return interp.startLoop(drawInterpolated);
|
|
19062
19011
|
}, [externalBodies !== void 0, interp.startLoop]);
|
|
19063
19012
|
React107.useEffect(() => {
|
|
19064
|
-
if (externalBodies !== void 0) return;
|
|
19065
|
-
if (!running) return;
|
|
19066
|
-
let raf;
|
|
19067
|
-
const loop = () => {
|
|
19068
|
-
step();
|
|
19069
|
-
draw();
|
|
19070
|
-
raf = requestAnimationFrame(loop);
|
|
19071
|
-
};
|
|
19072
|
-
raf = requestAnimationFrame(loop);
|
|
19073
|
-
return () => cancelAnimationFrame(raf);
|
|
19074
|
-
}, [running, step, draw, externalBodies]);
|
|
19075
|
-
React107.useEffect(() => {
|
|
19076
|
-
if (externalBodies !== void 0) return;
|
|
19077
19013
|
draw();
|
|
19078
|
-
}, [draw
|
|
19014
|
+
}, [draw]);
|
|
19079
19015
|
React107.useEffect(() => {
|
|
19080
19016
|
if (typeof window === "undefined") return;
|
|
19081
19017
|
const canvas = canvasRef.current;
|
|
@@ -23407,7 +23343,7 @@ function generateDiff(oldVal, newVal) {
|
|
|
23407
23343
|
}
|
|
23408
23344
|
return diff;
|
|
23409
23345
|
}
|
|
23410
|
-
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log7, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
23346
|
+
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log7, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
23411
23347
|
var init_CodeBlock = __esm({
|
|
23412
23348
|
"components/core/molecules/markdown/CodeBlock.tsx"() {
|
|
23413
23349
|
init_cn();
|
|
@@ -23524,9 +23460,13 @@ var init_CodeBlock = __esm({
|
|
|
23524
23460
|
CODE_LANGUAGE_SET = new Set(CODE_LANGUAGES);
|
|
23525
23461
|
DIFF_STYLES = {
|
|
23526
23462
|
add: { bg: "bg-success/10", prefix: "+", text: "text-success" },
|
|
23463
|
+
added: { bg: "bg-success/10", prefix: "+", text: "text-success" },
|
|
23527
23464
|
remove: { bg: "bg-error/10", prefix: "-", text: "text-error" },
|
|
23528
|
-
|
|
23465
|
+
removed: { bg: "bg-error/10", prefix: "-", text: "text-error" },
|
|
23466
|
+
context: { bg: "", prefix: " ", text: "text-foreground" },
|
|
23467
|
+
unchanged: { bg: "", prefix: " ", text: "text-foreground" }
|
|
23529
23468
|
};
|
|
23469
|
+
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
23530
23470
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
23531
23471
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
23532
23472
|
CodeBlock = React107__namespace.default.memo(
|
|
@@ -23891,7 +23831,7 @@ var init_CodeBlock = __esm({
|
|
|
23891
23831
|
}
|
|
23892
23832
|
),
|
|
23893
23833
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "overflow-auto bg-muted/20", style: { maxHeight }, children: diffLines ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column" }, className: "font-mono text-xs", children: diffLines.map((line, idx) => {
|
|
23894
|
-
const style = DIFF_STYLES[line.type];
|
|
23834
|
+
const style = DIFF_STYLES[line.type] ?? DIFF_STYLE_FALLBACK;
|
|
23895
23835
|
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
|
|
23896
23836
|
showLineNumbers && /* @__PURE__ */ jsxRuntime.jsx(
|
|
23897
23837
|
Typography,
|
|
@@ -26558,7 +26498,7 @@ var init_BookTableOfContents = __esm({
|
|
|
26558
26498
|
style: { direction },
|
|
26559
26499
|
children: [
|
|
26560
26500
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h1", className: "text-3xl font-bold text-center mb-4", children: t("book.tableOfContents") }),
|
|
26561
|
-
parts.map((part, partIdx) => {
|
|
26501
|
+
(Array.isArray(parts) ? parts : []).map((part, partIdx) => {
|
|
26562
26502
|
const chapters = Array.isArray(part.chapters) ? part.chapters : [];
|
|
26563
26503
|
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", children: [
|
|
26564
26504
|
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
@@ -40503,7 +40443,7 @@ var init_RichBlockEditor = __esm({
|
|
|
40503
40443
|
changeEvent,
|
|
40504
40444
|
readOnly = false,
|
|
40505
40445
|
placeholder,
|
|
40506
|
-
enableBlocks =
|
|
40446
|
+
enableBlocks = true,
|
|
40507
40447
|
showToolbar = true,
|
|
40508
40448
|
className
|
|
40509
40449
|
}) => {
|
package/dist/providers/index.js
CHANGED
|
@@ -575,14 +575,17 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
575
575
|
Wrapped.displayName = `Lazy.${libKey}.${fallbackName}`;
|
|
576
576
|
return Wrapped;
|
|
577
577
|
}
|
|
578
|
+
function isComponentLike(v) {
|
|
579
|
+
return v != null && (typeof v === "function" || typeof v === "object");
|
|
580
|
+
}
|
|
578
581
|
function resolveLucide(name) {
|
|
579
582
|
if (lucideAliases[name]) return lucideAliases[name];
|
|
580
583
|
const pascal = kebabToPascal(name);
|
|
581
584
|
const lucideMap = LucideIcons2;
|
|
582
585
|
const direct = lucideMap[pascal];
|
|
583
|
-
if (direct
|
|
586
|
+
if (isComponentLike(direct)) return direct;
|
|
584
587
|
const asIs = lucideMap[name];
|
|
585
|
-
if (asIs
|
|
588
|
+
if (isComponentLike(asIs)) return asIs;
|
|
586
589
|
return LucideIcons2.HelpCircle;
|
|
587
590
|
}
|
|
588
591
|
function resolvePhosphor(name, weight, family) {
|
|
@@ -1226,12 +1229,13 @@ function resolveIcon(name) {
|
|
|
1226
1229
|
}
|
|
1227
1230
|
function doResolve(name) {
|
|
1228
1231
|
if (iconAliases[name]) return iconAliases[name];
|
|
1232
|
+
const isComponentLike2 = (v) => v != null && (typeof v === "function" || typeof v === "object");
|
|
1229
1233
|
const pascalName = kebabToPascal2(name);
|
|
1230
1234
|
const lucideMap = LucideIcons2;
|
|
1231
1235
|
const directLookup = lucideMap[pascalName];
|
|
1232
|
-
if (directLookup
|
|
1236
|
+
if (isComponentLike2(directLookup)) return directLookup;
|
|
1233
1237
|
const asIs = lucideMap[name];
|
|
1234
|
-
if (asIs
|
|
1238
|
+
if (isComponentLike2(asIs)) return asIs;
|
|
1235
1239
|
return LucideIcons2.HelpCircle;
|
|
1236
1240
|
}
|
|
1237
1241
|
var colorTokenClasses, iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
|
|
@@ -18850,8 +18854,6 @@ function SimulationCanvas({
|
|
|
18850
18854
|
preset: presetProp,
|
|
18851
18855
|
width = 600,
|
|
18852
18856
|
height = 400,
|
|
18853
|
-
running,
|
|
18854
|
-
speed = 1,
|
|
18855
18857
|
bodies: externalBodies,
|
|
18856
18858
|
className
|
|
18857
18859
|
}) {
|
|
@@ -18862,59 +18864,6 @@ function SimulationCanvas({
|
|
|
18862
18864
|
useEffect(() => {
|
|
18863
18865
|
bodiesRef.current = structuredClone(preset.bodies);
|
|
18864
18866
|
}, [preset]);
|
|
18865
|
-
const step = useCallback(() => {
|
|
18866
|
-
const dt = Math.min(1 / 60 * speed, 1 / 15);
|
|
18867
|
-
const gx = preset.gravity?.x ?? 0;
|
|
18868
|
-
const gy = preset.gravity?.y ?? 9.81;
|
|
18869
|
-
const bodies = bodiesRef.current;
|
|
18870
|
-
const maxVel = Math.max(width, height) * 5;
|
|
18871
|
-
for (const body of bodies) {
|
|
18872
|
-
if (body.fixed) continue;
|
|
18873
|
-
body.vx += gx * dt;
|
|
18874
|
-
body.vy += gy * dt;
|
|
18875
|
-
body.vx = Math.max(-maxVel, Math.min(maxVel, body.vx));
|
|
18876
|
-
body.vy = Math.max(-maxVel, Math.min(maxVel, body.vy));
|
|
18877
|
-
body.x += body.vx * dt;
|
|
18878
|
-
body.y += body.vy * dt;
|
|
18879
|
-
if (body.y + body.radius > height) {
|
|
18880
|
-
body.y = height - body.radius;
|
|
18881
|
-
body.vy = -body.vy * 0.8;
|
|
18882
|
-
}
|
|
18883
|
-
if (body.y - body.radius < 0) {
|
|
18884
|
-
body.y = body.radius;
|
|
18885
|
-
body.vy = -body.vy * 0.8;
|
|
18886
|
-
}
|
|
18887
|
-
if (body.x + body.radius > width) {
|
|
18888
|
-
body.x = width - body.radius;
|
|
18889
|
-
body.vx = -body.vx * 0.8;
|
|
18890
|
-
}
|
|
18891
|
-
if (body.x - body.radius < 0) {
|
|
18892
|
-
body.x = body.radius;
|
|
18893
|
-
body.vx = -body.vx * 0.8;
|
|
18894
|
-
}
|
|
18895
|
-
}
|
|
18896
|
-
if (preset.constraints) {
|
|
18897
|
-
for (const c of preset.constraints) {
|
|
18898
|
-
const a = bodies[c.bodyA];
|
|
18899
|
-
const b = bodies[c.bodyB];
|
|
18900
|
-
if (!a || !b) continue;
|
|
18901
|
-
const dx = b.x - a.x;
|
|
18902
|
-
const dy = b.y - a.y;
|
|
18903
|
-
const dist = Math.sqrt(dx * dx + dy * dy) || 1e-3;
|
|
18904
|
-
const diff = (dist - c.length) / dist;
|
|
18905
|
-
const fx = dx * diff * c.stiffness;
|
|
18906
|
-
const fy = dy * diff * c.stiffness;
|
|
18907
|
-
if (!a.fixed) {
|
|
18908
|
-
a.vx += fx * dt;
|
|
18909
|
-
a.vy += fy * dt;
|
|
18910
|
-
}
|
|
18911
|
-
if (!b.fixed) {
|
|
18912
|
-
b.vx -= fx * dt;
|
|
18913
|
-
b.vy -= fy * dt;
|
|
18914
|
-
}
|
|
18915
|
-
}
|
|
18916
|
-
}
|
|
18917
|
-
}, [preset, width, height, speed]);
|
|
18918
18867
|
const draw = useCallback(() => {
|
|
18919
18868
|
const canvas = canvasRef.current;
|
|
18920
18869
|
if (!canvas) return;
|
|
@@ -19016,21 +18965,8 @@ function SimulationCanvas({
|
|
|
19016
18965
|
return interp.startLoop(drawInterpolated);
|
|
19017
18966
|
}, [externalBodies !== void 0, interp.startLoop]);
|
|
19018
18967
|
useEffect(() => {
|
|
19019
|
-
if (externalBodies !== void 0) return;
|
|
19020
|
-
if (!running) return;
|
|
19021
|
-
let raf;
|
|
19022
|
-
const loop = () => {
|
|
19023
|
-
step();
|
|
19024
|
-
draw();
|
|
19025
|
-
raf = requestAnimationFrame(loop);
|
|
19026
|
-
};
|
|
19027
|
-
raf = requestAnimationFrame(loop);
|
|
19028
|
-
return () => cancelAnimationFrame(raf);
|
|
19029
|
-
}, [running, step, draw, externalBodies]);
|
|
19030
|
-
useEffect(() => {
|
|
19031
|
-
if (externalBodies !== void 0) return;
|
|
19032
18968
|
draw();
|
|
19033
|
-
}, [draw
|
|
18969
|
+
}, [draw]);
|
|
19034
18970
|
useEffect(() => {
|
|
19035
18971
|
if (typeof window === "undefined") return;
|
|
19036
18972
|
const canvas = canvasRef.current;
|
|
@@ -23362,7 +23298,7 @@ function generateDiff(oldVal, newVal) {
|
|
|
23362
23298
|
}
|
|
23363
23299
|
return diff;
|
|
23364
23300
|
}
|
|
23365
|
-
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log7, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
23301
|
+
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log7, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
23366
23302
|
var init_CodeBlock = __esm({
|
|
23367
23303
|
"components/core/molecules/markdown/CodeBlock.tsx"() {
|
|
23368
23304
|
init_cn();
|
|
@@ -23479,9 +23415,13 @@ var init_CodeBlock = __esm({
|
|
|
23479
23415
|
CODE_LANGUAGE_SET = new Set(CODE_LANGUAGES);
|
|
23480
23416
|
DIFF_STYLES = {
|
|
23481
23417
|
add: { bg: "bg-success/10", prefix: "+", text: "text-success" },
|
|
23418
|
+
added: { bg: "bg-success/10", prefix: "+", text: "text-success" },
|
|
23482
23419
|
remove: { bg: "bg-error/10", prefix: "-", text: "text-error" },
|
|
23483
|
-
|
|
23420
|
+
removed: { bg: "bg-error/10", prefix: "-", text: "text-error" },
|
|
23421
|
+
context: { bg: "", prefix: " ", text: "text-foreground" },
|
|
23422
|
+
unchanged: { bg: "", prefix: " ", text: "text-foreground" }
|
|
23484
23423
|
};
|
|
23424
|
+
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
23485
23425
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
23486
23426
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
23487
23427
|
CodeBlock = React107__default.memo(
|
|
@@ -23846,7 +23786,7 @@ var init_CodeBlock = __esm({
|
|
|
23846
23786
|
}
|
|
23847
23787
|
),
|
|
23848
23788
|
/* @__PURE__ */ jsx(Box, { className: "overflow-auto bg-muted/20", style: { maxHeight }, children: diffLines ? /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column" }, className: "font-mono text-xs", children: diffLines.map((line, idx) => {
|
|
23849
|
-
const style = DIFF_STYLES[line.type];
|
|
23789
|
+
const style = DIFF_STYLES[line.type] ?? DIFF_STYLE_FALLBACK;
|
|
23850
23790
|
return /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
|
|
23851
23791
|
showLineNumbers && /* @__PURE__ */ jsx(
|
|
23852
23792
|
Typography,
|
|
@@ -26513,7 +26453,7 @@ var init_BookTableOfContents = __esm({
|
|
|
26513
26453
|
style: { direction },
|
|
26514
26454
|
children: [
|
|
26515
26455
|
/* @__PURE__ */ jsx(Typography, { variant: "h1", className: "text-3xl font-bold text-center mb-4", children: t("book.tableOfContents") }),
|
|
26516
|
-
parts.map((part, partIdx) => {
|
|
26456
|
+
(Array.isArray(parts) ? parts : []).map((part, partIdx) => {
|
|
26517
26457
|
const chapters = Array.isArray(part.chapters) ? part.chapters : [];
|
|
26518
26458
|
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
|
|
26519
26459
|
/* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
@@ -40458,7 +40398,7 @@ var init_RichBlockEditor = __esm({
|
|
|
40458
40398
|
changeEvent,
|
|
40459
40399
|
readOnly = false,
|
|
40460
40400
|
placeholder,
|
|
40461
|
-
enableBlocks =
|
|
40401
|
+
enableBlocks = true,
|
|
40462
40402
|
showToolbar = true,
|
|
40463
40403
|
className
|
|
40464
40404
|
}) => {
|