@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/avl/index.cjs
CHANGED
|
@@ -4566,14 +4566,17 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
4566
4566
|
Wrapped.displayName = `Lazy.${libKey}.${fallbackName}`;
|
|
4567
4567
|
return Wrapped;
|
|
4568
4568
|
}
|
|
4569
|
+
function isComponentLike(v) {
|
|
4570
|
+
return v != null && (typeof v === "function" || typeof v === "object");
|
|
4571
|
+
}
|
|
4569
4572
|
function resolveLucide(name) {
|
|
4570
4573
|
if (lucideAliases[name]) return lucideAliases[name];
|
|
4571
4574
|
const pascal = kebabToPascal(name);
|
|
4572
4575
|
const lucideMap = LucideIcons2__namespace;
|
|
4573
4576
|
const direct = lucideMap[pascal];
|
|
4574
|
-
if (direct
|
|
4577
|
+
if (isComponentLike(direct)) return direct;
|
|
4575
4578
|
const asIs = lucideMap[name];
|
|
4576
|
-
if (asIs
|
|
4579
|
+
if (isComponentLike(asIs)) return asIs;
|
|
4577
4580
|
return LucideIcons2__namespace.HelpCircle;
|
|
4578
4581
|
}
|
|
4579
4582
|
function resolvePhosphor(name, weight, family) {
|
|
@@ -5217,12 +5220,13 @@ function resolveIcon(name) {
|
|
|
5217
5220
|
}
|
|
5218
5221
|
function doResolve(name) {
|
|
5219
5222
|
if (iconAliases[name]) return iconAliases[name];
|
|
5223
|
+
const isComponentLike2 = (v) => v != null && (typeof v === "function" || typeof v === "object");
|
|
5220
5224
|
const pascalName = kebabToPascal2(name);
|
|
5221
5225
|
const lucideMap = LucideIcons2__namespace;
|
|
5222
5226
|
const directLookup = lucideMap[pascalName];
|
|
5223
|
-
if (directLookup
|
|
5227
|
+
if (isComponentLike2(directLookup)) return directLookup;
|
|
5224
5228
|
const asIs = lucideMap[name];
|
|
5225
|
-
if (asIs
|
|
5229
|
+
if (isComponentLike2(asIs)) return asIs;
|
|
5226
5230
|
return LucideIcons2__namespace.HelpCircle;
|
|
5227
5231
|
}
|
|
5228
5232
|
var colorTokenClasses, iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
|
|
@@ -22650,8 +22654,6 @@ function SimulationCanvas({
|
|
|
22650
22654
|
preset: presetProp,
|
|
22651
22655
|
width = 600,
|
|
22652
22656
|
height = 400,
|
|
22653
|
-
running,
|
|
22654
|
-
speed = 1,
|
|
22655
22657
|
bodies: externalBodies,
|
|
22656
22658
|
className
|
|
22657
22659
|
}) {
|
|
@@ -22662,59 +22664,6 @@ function SimulationCanvas({
|
|
|
22662
22664
|
React114.useEffect(() => {
|
|
22663
22665
|
bodiesRef.current = structuredClone(preset.bodies);
|
|
22664
22666
|
}, [preset]);
|
|
22665
|
-
const step = React114.useCallback(() => {
|
|
22666
|
-
const dt = Math.min(1 / 60 * speed, 1 / 15);
|
|
22667
|
-
const gx = preset.gravity?.x ?? 0;
|
|
22668
|
-
const gy = preset.gravity?.y ?? 9.81;
|
|
22669
|
-
const bodies = bodiesRef.current;
|
|
22670
|
-
const maxVel = Math.max(width, height) * 5;
|
|
22671
|
-
for (const body of bodies) {
|
|
22672
|
-
if (body.fixed) continue;
|
|
22673
|
-
body.vx += gx * dt;
|
|
22674
|
-
body.vy += gy * dt;
|
|
22675
|
-
body.vx = Math.max(-maxVel, Math.min(maxVel, body.vx));
|
|
22676
|
-
body.vy = Math.max(-maxVel, Math.min(maxVel, body.vy));
|
|
22677
|
-
body.x += body.vx * dt;
|
|
22678
|
-
body.y += body.vy * dt;
|
|
22679
|
-
if (body.y + body.radius > height) {
|
|
22680
|
-
body.y = height - body.radius;
|
|
22681
|
-
body.vy = -body.vy * 0.8;
|
|
22682
|
-
}
|
|
22683
|
-
if (body.y - body.radius < 0) {
|
|
22684
|
-
body.y = body.radius;
|
|
22685
|
-
body.vy = -body.vy * 0.8;
|
|
22686
|
-
}
|
|
22687
|
-
if (body.x + body.radius > width) {
|
|
22688
|
-
body.x = width - body.radius;
|
|
22689
|
-
body.vx = -body.vx * 0.8;
|
|
22690
|
-
}
|
|
22691
|
-
if (body.x - body.radius < 0) {
|
|
22692
|
-
body.x = body.radius;
|
|
22693
|
-
body.vx = -body.vx * 0.8;
|
|
22694
|
-
}
|
|
22695
|
-
}
|
|
22696
|
-
if (preset.constraints) {
|
|
22697
|
-
for (const c of preset.constraints) {
|
|
22698
|
-
const a = bodies[c.bodyA];
|
|
22699
|
-
const b = bodies[c.bodyB];
|
|
22700
|
-
if (!a || !b) continue;
|
|
22701
|
-
const dx = b.x - a.x;
|
|
22702
|
-
const dy = b.y - a.y;
|
|
22703
|
-
const dist = Math.sqrt(dx * dx + dy * dy) || 1e-3;
|
|
22704
|
-
const diff = (dist - c.length) / dist;
|
|
22705
|
-
const fx = dx * diff * c.stiffness;
|
|
22706
|
-
const fy = dy * diff * c.stiffness;
|
|
22707
|
-
if (!a.fixed) {
|
|
22708
|
-
a.vx += fx * dt;
|
|
22709
|
-
a.vy += fy * dt;
|
|
22710
|
-
}
|
|
22711
|
-
if (!b.fixed) {
|
|
22712
|
-
b.vx -= fx * dt;
|
|
22713
|
-
b.vy -= fy * dt;
|
|
22714
|
-
}
|
|
22715
|
-
}
|
|
22716
|
-
}
|
|
22717
|
-
}, [preset, width, height, speed]);
|
|
22718
22667
|
const draw = React114.useCallback(() => {
|
|
22719
22668
|
const canvas = canvasRef.current;
|
|
22720
22669
|
if (!canvas) return;
|
|
@@ -22816,21 +22765,8 @@ function SimulationCanvas({
|
|
|
22816
22765
|
return interp.startLoop(drawInterpolated);
|
|
22817
22766
|
}, [externalBodies !== void 0, interp.startLoop]);
|
|
22818
22767
|
React114.useEffect(() => {
|
|
22819
|
-
if (externalBodies !== void 0) return;
|
|
22820
|
-
if (!running) return;
|
|
22821
|
-
let raf;
|
|
22822
|
-
const loop = () => {
|
|
22823
|
-
step();
|
|
22824
|
-
draw();
|
|
22825
|
-
raf = requestAnimationFrame(loop);
|
|
22826
|
-
};
|
|
22827
|
-
raf = requestAnimationFrame(loop);
|
|
22828
|
-
return () => cancelAnimationFrame(raf);
|
|
22829
|
-
}, [running, step, draw, externalBodies]);
|
|
22830
|
-
React114.useEffect(() => {
|
|
22831
|
-
if (externalBodies !== void 0) return;
|
|
22832
22768
|
draw();
|
|
22833
|
-
}, [draw
|
|
22769
|
+
}, [draw]);
|
|
22834
22770
|
React114.useEffect(() => {
|
|
22835
22771
|
if (typeof window === "undefined") return;
|
|
22836
22772
|
const canvas = canvasRef.current;
|
|
@@ -25952,7 +25888,7 @@ function generateDiff(oldVal, newVal) {
|
|
|
25952
25888
|
}
|
|
25953
25889
|
return diff;
|
|
25954
25890
|
}
|
|
25955
|
-
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log4, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
25891
|
+
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log4, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
25956
25892
|
var init_CodeBlock = __esm({
|
|
25957
25893
|
"components/core/molecules/markdown/CodeBlock.tsx"() {
|
|
25958
25894
|
init_cn();
|
|
@@ -26069,9 +26005,13 @@ var init_CodeBlock = __esm({
|
|
|
26069
26005
|
CODE_LANGUAGE_SET = new Set(CODE_LANGUAGES);
|
|
26070
26006
|
DIFF_STYLES = {
|
|
26071
26007
|
add: { bg: "bg-success/10", prefix: "+", text: "text-success" },
|
|
26008
|
+
added: { bg: "bg-success/10", prefix: "+", text: "text-success" },
|
|
26072
26009
|
remove: { bg: "bg-error/10", prefix: "-", text: "text-error" },
|
|
26073
|
-
|
|
26010
|
+
removed: { bg: "bg-error/10", prefix: "-", text: "text-error" },
|
|
26011
|
+
context: { bg: "", prefix: " ", text: "text-foreground" },
|
|
26012
|
+
unchanged: { bg: "", prefix: " ", text: "text-foreground" }
|
|
26074
26013
|
};
|
|
26014
|
+
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
26075
26015
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
26076
26016
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
26077
26017
|
CodeBlock = React114__namespace.default.memo(
|
|
@@ -26436,7 +26376,7 @@ var init_CodeBlock = __esm({
|
|
|
26436
26376
|
}
|
|
26437
26377
|
),
|
|
26438
26378
|
/* @__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) => {
|
|
26439
|
-
const style = DIFF_STYLES[line.type];
|
|
26379
|
+
const style = DIFF_STYLES[line.type] ?? DIFF_STYLE_FALLBACK;
|
|
26440
26380
|
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
|
|
26441
26381
|
showLineNumbers && /* @__PURE__ */ jsxRuntime.jsx(
|
|
26442
26382
|
Typography,
|
|
@@ -29103,7 +29043,7 @@ var init_BookTableOfContents = __esm({
|
|
|
29103
29043
|
style: { direction },
|
|
29104
29044
|
children: [
|
|
29105
29045
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h1", className: "text-3xl font-bold text-center mb-4", children: t("book.tableOfContents") }),
|
|
29106
|
-
parts.map((part, partIdx) => {
|
|
29046
|
+
(Array.isArray(parts) ? parts : []).map((part, partIdx) => {
|
|
29107
29047
|
const chapters = Array.isArray(part.chapters) ? part.chapters : [];
|
|
29108
29048
|
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", children: [
|
|
29109
29049
|
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
@@ -43048,7 +42988,7 @@ var init_RichBlockEditor = __esm({
|
|
|
43048
42988
|
changeEvent,
|
|
43049
42989
|
readOnly = false,
|
|
43050
42990
|
placeholder,
|
|
43051
|
-
enableBlocks =
|
|
42991
|
+
enableBlocks = true,
|
|
43052
42992
|
showToolbar = true,
|
|
43053
42993
|
className
|
|
43054
42994
|
}) => {
|
package/dist/avl/index.js
CHANGED
|
@@ -4520,14 +4520,17 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
4520
4520
|
Wrapped.displayName = `Lazy.${libKey}.${fallbackName}`;
|
|
4521
4521
|
return Wrapped;
|
|
4522
4522
|
}
|
|
4523
|
+
function isComponentLike(v) {
|
|
4524
|
+
return v != null && (typeof v === "function" || typeof v === "object");
|
|
4525
|
+
}
|
|
4523
4526
|
function resolveLucide(name) {
|
|
4524
4527
|
if (lucideAliases[name]) return lucideAliases[name];
|
|
4525
4528
|
const pascal = kebabToPascal(name);
|
|
4526
4529
|
const lucideMap = LucideIcons2;
|
|
4527
4530
|
const direct = lucideMap[pascal];
|
|
4528
|
-
if (direct
|
|
4531
|
+
if (isComponentLike(direct)) return direct;
|
|
4529
4532
|
const asIs = lucideMap[name];
|
|
4530
|
-
if (asIs
|
|
4533
|
+
if (isComponentLike(asIs)) return asIs;
|
|
4531
4534
|
return LucideIcons2.HelpCircle;
|
|
4532
4535
|
}
|
|
4533
4536
|
function resolvePhosphor(name, weight, family) {
|
|
@@ -5171,12 +5174,13 @@ function resolveIcon(name) {
|
|
|
5171
5174
|
}
|
|
5172
5175
|
function doResolve(name) {
|
|
5173
5176
|
if (iconAliases[name]) return iconAliases[name];
|
|
5177
|
+
const isComponentLike2 = (v) => v != null && (typeof v === "function" || typeof v === "object");
|
|
5174
5178
|
const pascalName = kebabToPascal2(name);
|
|
5175
5179
|
const lucideMap = LucideIcons2;
|
|
5176
5180
|
const directLookup = lucideMap[pascalName];
|
|
5177
|
-
if (directLookup
|
|
5181
|
+
if (isComponentLike2(directLookup)) return directLookup;
|
|
5178
5182
|
const asIs = lucideMap[name];
|
|
5179
|
-
if (asIs
|
|
5183
|
+
if (isComponentLike2(asIs)) return asIs;
|
|
5180
5184
|
return LucideIcons2.HelpCircle;
|
|
5181
5185
|
}
|
|
5182
5186
|
var colorTokenClasses, iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
|
|
@@ -22604,8 +22608,6 @@ function SimulationCanvas({
|
|
|
22604
22608
|
preset: presetProp,
|
|
22605
22609
|
width = 600,
|
|
22606
22610
|
height = 400,
|
|
22607
|
-
running,
|
|
22608
|
-
speed = 1,
|
|
22609
22611
|
bodies: externalBodies,
|
|
22610
22612
|
className
|
|
22611
22613
|
}) {
|
|
@@ -22616,59 +22618,6 @@ function SimulationCanvas({
|
|
|
22616
22618
|
useEffect(() => {
|
|
22617
22619
|
bodiesRef.current = structuredClone(preset.bodies);
|
|
22618
22620
|
}, [preset]);
|
|
22619
|
-
const step = useCallback(() => {
|
|
22620
|
-
const dt = Math.min(1 / 60 * speed, 1 / 15);
|
|
22621
|
-
const gx = preset.gravity?.x ?? 0;
|
|
22622
|
-
const gy = preset.gravity?.y ?? 9.81;
|
|
22623
|
-
const bodies = bodiesRef.current;
|
|
22624
|
-
const maxVel = Math.max(width, height) * 5;
|
|
22625
|
-
for (const body of bodies) {
|
|
22626
|
-
if (body.fixed) continue;
|
|
22627
|
-
body.vx += gx * dt;
|
|
22628
|
-
body.vy += gy * dt;
|
|
22629
|
-
body.vx = Math.max(-maxVel, Math.min(maxVel, body.vx));
|
|
22630
|
-
body.vy = Math.max(-maxVel, Math.min(maxVel, body.vy));
|
|
22631
|
-
body.x += body.vx * dt;
|
|
22632
|
-
body.y += body.vy * dt;
|
|
22633
|
-
if (body.y + body.radius > height) {
|
|
22634
|
-
body.y = height - body.radius;
|
|
22635
|
-
body.vy = -body.vy * 0.8;
|
|
22636
|
-
}
|
|
22637
|
-
if (body.y - body.radius < 0) {
|
|
22638
|
-
body.y = body.radius;
|
|
22639
|
-
body.vy = -body.vy * 0.8;
|
|
22640
|
-
}
|
|
22641
|
-
if (body.x + body.radius > width) {
|
|
22642
|
-
body.x = width - body.radius;
|
|
22643
|
-
body.vx = -body.vx * 0.8;
|
|
22644
|
-
}
|
|
22645
|
-
if (body.x - body.radius < 0) {
|
|
22646
|
-
body.x = body.radius;
|
|
22647
|
-
body.vx = -body.vx * 0.8;
|
|
22648
|
-
}
|
|
22649
|
-
}
|
|
22650
|
-
if (preset.constraints) {
|
|
22651
|
-
for (const c of preset.constraints) {
|
|
22652
|
-
const a = bodies[c.bodyA];
|
|
22653
|
-
const b = bodies[c.bodyB];
|
|
22654
|
-
if (!a || !b) continue;
|
|
22655
|
-
const dx = b.x - a.x;
|
|
22656
|
-
const dy = b.y - a.y;
|
|
22657
|
-
const dist = Math.sqrt(dx * dx + dy * dy) || 1e-3;
|
|
22658
|
-
const diff = (dist - c.length) / dist;
|
|
22659
|
-
const fx = dx * diff * c.stiffness;
|
|
22660
|
-
const fy = dy * diff * c.stiffness;
|
|
22661
|
-
if (!a.fixed) {
|
|
22662
|
-
a.vx += fx * dt;
|
|
22663
|
-
a.vy += fy * dt;
|
|
22664
|
-
}
|
|
22665
|
-
if (!b.fixed) {
|
|
22666
|
-
b.vx -= fx * dt;
|
|
22667
|
-
b.vy -= fy * dt;
|
|
22668
|
-
}
|
|
22669
|
-
}
|
|
22670
|
-
}
|
|
22671
|
-
}, [preset, width, height, speed]);
|
|
22672
22621
|
const draw = useCallback(() => {
|
|
22673
22622
|
const canvas = canvasRef.current;
|
|
22674
22623
|
if (!canvas) return;
|
|
@@ -22770,21 +22719,8 @@ function SimulationCanvas({
|
|
|
22770
22719
|
return interp.startLoop(drawInterpolated);
|
|
22771
22720
|
}, [externalBodies !== void 0, interp.startLoop]);
|
|
22772
22721
|
useEffect(() => {
|
|
22773
|
-
if (externalBodies !== void 0) return;
|
|
22774
|
-
if (!running) return;
|
|
22775
|
-
let raf;
|
|
22776
|
-
const loop = () => {
|
|
22777
|
-
step();
|
|
22778
|
-
draw();
|
|
22779
|
-
raf = requestAnimationFrame(loop);
|
|
22780
|
-
};
|
|
22781
|
-
raf = requestAnimationFrame(loop);
|
|
22782
|
-
return () => cancelAnimationFrame(raf);
|
|
22783
|
-
}, [running, step, draw, externalBodies]);
|
|
22784
|
-
useEffect(() => {
|
|
22785
|
-
if (externalBodies !== void 0) return;
|
|
22786
22722
|
draw();
|
|
22787
|
-
}, [draw
|
|
22723
|
+
}, [draw]);
|
|
22788
22724
|
useEffect(() => {
|
|
22789
22725
|
if (typeof window === "undefined") return;
|
|
22790
22726
|
const canvas = canvasRef.current;
|
|
@@ -25906,7 +25842,7 @@ function generateDiff(oldVal, newVal) {
|
|
|
25906
25842
|
}
|
|
25907
25843
|
return diff;
|
|
25908
25844
|
}
|
|
25909
|
-
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log4, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
25845
|
+
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log4, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
25910
25846
|
var init_CodeBlock = __esm({
|
|
25911
25847
|
"components/core/molecules/markdown/CodeBlock.tsx"() {
|
|
25912
25848
|
init_cn();
|
|
@@ -26023,9 +25959,13 @@ var init_CodeBlock = __esm({
|
|
|
26023
25959
|
CODE_LANGUAGE_SET = new Set(CODE_LANGUAGES);
|
|
26024
25960
|
DIFF_STYLES = {
|
|
26025
25961
|
add: { bg: "bg-success/10", prefix: "+", text: "text-success" },
|
|
25962
|
+
added: { bg: "bg-success/10", prefix: "+", text: "text-success" },
|
|
26026
25963
|
remove: { bg: "bg-error/10", prefix: "-", text: "text-error" },
|
|
26027
|
-
|
|
25964
|
+
removed: { bg: "bg-error/10", prefix: "-", text: "text-error" },
|
|
25965
|
+
context: { bg: "", prefix: " ", text: "text-foreground" },
|
|
25966
|
+
unchanged: { bg: "", prefix: " ", text: "text-foreground" }
|
|
26028
25967
|
};
|
|
25968
|
+
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
26029
25969
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
26030
25970
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
26031
25971
|
CodeBlock = React114__default.memo(
|
|
@@ -26390,7 +26330,7 @@ var init_CodeBlock = __esm({
|
|
|
26390
26330
|
}
|
|
26391
26331
|
),
|
|
26392
26332
|
/* @__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) => {
|
|
26393
|
-
const style = DIFF_STYLES[line.type];
|
|
26333
|
+
const style = DIFF_STYLES[line.type] ?? DIFF_STYLE_FALLBACK;
|
|
26394
26334
|
return /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
|
|
26395
26335
|
showLineNumbers && /* @__PURE__ */ jsx(
|
|
26396
26336
|
Typography,
|
|
@@ -29057,7 +28997,7 @@ var init_BookTableOfContents = __esm({
|
|
|
29057
28997
|
style: { direction },
|
|
29058
28998
|
children: [
|
|
29059
28999
|
/* @__PURE__ */ jsx(Typography, { variant: "h1", className: "text-3xl font-bold text-center mb-4", children: t("book.tableOfContents") }),
|
|
29060
|
-
parts.map((part, partIdx) => {
|
|
29000
|
+
(Array.isArray(parts) ? parts : []).map((part, partIdx) => {
|
|
29061
29001
|
const chapters = Array.isArray(part.chapters) ? part.chapters : [];
|
|
29062
29002
|
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
|
|
29063
29003
|
/* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
@@ -43002,7 +42942,7 @@ var init_RichBlockEditor = __esm({
|
|
|
43002
42942
|
changeEvent,
|
|
43003
42943
|
readOnly = false,
|
|
43004
42944
|
placeholder,
|
|
43005
|
-
enableBlocks =
|
|
42945
|
+
enableBlocks = true,
|
|
43006
42946
|
showToolbar = true,
|
|
43007
42947
|
className
|
|
43008
42948
|
}) => {
|
|
@@ -25,7 +25,7 @@ export type CodeLanguage = (typeof CODE_LANGUAGES)[number];
|
|
|
25
25
|
export declare function toCodeLanguage(value: string | undefined): CodeLanguage;
|
|
26
26
|
export type CodeViewerMode = 'code' | 'diff';
|
|
27
27
|
export interface DiffLine {
|
|
28
|
-
type: 'add' | 'remove' | 'context';
|
|
28
|
+
type: 'add' | 'added' | 'remove' | 'removed' | 'context' | 'unchanged';
|
|
29
29
|
content: string;
|
|
30
30
|
lineNumber?: number;
|
|
31
31
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SimulationCanvas
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Pure renderer: paints the initial preset bodies and, when the `bodies` prop
|
|
5
|
+
* is provided, interpolates externally-driven snapshots to 60fps.
|
|
6
|
+
* Physics integration is owned by the LOLO animTick — this canvas does NOT
|
|
7
|
+
* self-advance positions.
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import type { PhysicsPreset, PhysicsBody } from '../../shared/lib/physicsTypes';
|
|
@@ -21,7 +21,7 @@ export interface SimulationCanvasProps {
|
|
|
21
21
|
bodies?: readonly Pick<PhysicsBody, 'id' | 'x' | 'y'>[];
|
|
22
22
|
className?: string;
|
|
23
23
|
}
|
|
24
|
-
export declare function SimulationCanvas({ preset: presetProp, width, height,
|
|
24
|
+
export declare function SimulationCanvas({ preset: presetProp, width, height, bodies: externalBodies, className, }: SimulationCanvasProps): React.JSX.Element;
|
|
25
25
|
export declare namespace SimulationCanvas {
|
|
26
26
|
var displayName: string;
|
|
27
27
|
}
|
|
@@ -2415,14 +2415,17 @@ var lucideAliases = {
|
|
|
2415
2415
|
"sort-asc": LucideIcons__namespace.ArrowUpNarrowWide,
|
|
2416
2416
|
"sort-desc": LucideIcons__namespace.ArrowDownNarrowWide
|
|
2417
2417
|
};
|
|
2418
|
+
function isComponentLike(v) {
|
|
2419
|
+
return v != null && (typeof v === "function" || typeof v === "object");
|
|
2420
|
+
}
|
|
2418
2421
|
function resolveLucide(name) {
|
|
2419
2422
|
if (lucideAliases[name]) return lucideAliases[name];
|
|
2420
2423
|
const pascal = kebabToPascal(name);
|
|
2421
2424
|
const lucideMap = LucideIcons__namespace;
|
|
2422
2425
|
const direct = lucideMap[pascal];
|
|
2423
|
-
if (direct
|
|
2426
|
+
if (isComponentLike(direct)) return direct;
|
|
2424
2427
|
const asIs = lucideMap[name];
|
|
2425
|
-
if (asIs
|
|
2428
|
+
if (isComponentLike(asIs)) return asIs;
|
|
2426
2429
|
return LucideIcons__namespace.HelpCircle;
|
|
2427
2430
|
}
|
|
2428
2431
|
var phosphorAliases = {
|
|
@@ -2391,14 +2391,17 @@ var lucideAliases = {
|
|
|
2391
2391
|
"sort-asc": LucideIcons.ArrowUpNarrowWide,
|
|
2392
2392
|
"sort-desc": LucideIcons.ArrowDownNarrowWide
|
|
2393
2393
|
};
|
|
2394
|
+
function isComponentLike(v) {
|
|
2395
|
+
return v != null && (typeof v === "function" || typeof v === "object");
|
|
2396
|
+
}
|
|
2394
2397
|
function resolveLucide(name) {
|
|
2395
2398
|
if (lucideAliases[name]) return lucideAliases[name];
|
|
2396
2399
|
const pascal = kebabToPascal(name);
|
|
2397
2400
|
const lucideMap = LucideIcons;
|
|
2398
2401
|
const direct = lucideMap[pascal];
|
|
2399
|
-
if (direct
|
|
2402
|
+
if (isComponentLike(direct)) return direct;
|
|
2400
2403
|
const asIs = lucideMap[name];
|
|
2401
|
-
if (asIs
|
|
2404
|
+
if (isComponentLike(asIs)) return asIs;
|
|
2402
2405
|
return LucideIcons.HelpCircle;
|
|
2403
2406
|
}
|
|
2404
2407
|
var phosphorAliases = {
|
|
@@ -1304,14 +1304,17 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
1304
1304
|
Wrapped.displayName = `Lazy.${libKey}.${fallbackName}`;
|
|
1305
1305
|
return Wrapped;
|
|
1306
1306
|
}
|
|
1307
|
+
function isComponentLike(v) {
|
|
1308
|
+
return v != null && (typeof v === "function" || typeof v === "object");
|
|
1309
|
+
}
|
|
1307
1310
|
function resolveLucide(name) {
|
|
1308
1311
|
if (lucideAliases[name]) return lucideAliases[name];
|
|
1309
1312
|
const pascal = kebabToPascal(name);
|
|
1310
1313
|
const lucideMap = LucideIcons2__namespace;
|
|
1311
1314
|
const direct = lucideMap[pascal];
|
|
1312
|
-
if (direct
|
|
1315
|
+
if (isComponentLike(direct)) return direct;
|
|
1313
1316
|
const asIs = lucideMap[name];
|
|
1314
|
-
if (asIs
|
|
1317
|
+
if (isComponentLike(asIs)) return asIs;
|
|
1315
1318
|
return LucideIcons2__namespace.HelpCircle;
|
|
1316
1319
|
}
|
|
1317
1320
|
function resolvePhosphor(name, weight, family) {
|
|
@@ -1955,12 +1958,13 @@ function resolveIcon(name) {
|
|
|
1955
1958
|
}
|
|
1956
1959
|
function doResolve(name) {
|
|
1957
1960
|
if (iconAliases[name]) return iconAliases[name];
|
|
1961
|
+
const isComponentLike2 = (v) => v != null && (typeof v === "function" || typeof v === "object");
|
|
1958
1962
|
const pascalName = kebabToPascal2(name);
|
|
1959
1963
|
const lucideMap = LucideIcons2__namespace;
|
|
1960
1964
|
const directLookup = lucideMap[pascalName];
|
|
1961
|
-
if (directLookup
|
|
1965
|
+
if (isComponentLike2(directLookup)) return directLookup;
|
|
1962
1966
|
const asIs = lucideMap[name];
|
|
1963
|
-
if (asIs
|
|
1967
|
+
if (isComponentLike2(asIs)) return asIs;
|
|
1964
1968
|
return LucideIcons2__namespace.HelpCircle;
|
|
1965
1969
|
}
|
|
1966
1970
|
var colorTokenClasses, iconAliases, resolvedCache, sizeClasses, animationClasses; exports.Icon = void 0;
|
|
@@ -12706,7 +12710,7 @@ function generateDiff(oldVal, newVal) {
|
|
|
12706
12710
|
}
|
|
12707
12711
|
return diff;
|
|
12708
12712
|
}
|
|
12709
|
-
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log5, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS; exports.CodeBlock = void 0;
|
|
12713
|
+
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log5, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS; exports.CodeBlock = void 0;
|
|
12710
12714
|
var init_CodeBlock = __esm({
|
|
12711
12715
|
"components/core/molecules/markdown/CodeBlock.tsx"() {
|
|
12712
12716
|
init_cn();
|
|
@@ -12823,9 +12827,13 @@ var init_CodeBlock = __esm({
|
|
|
12823
12827
|
CODE_LANGUAGE_SET = new Set(CODE_LANGUAGES);
|
|
12824
12828
|
DIFF_STYLES = {
|
|
12825
12829
|
add: { bg: "bg-success/10", prefix: "+", text: "text-success" },
|
|
12830
|
+
added: { bg: "bg-success/10", prefix: "+", text: "text-success" },
|
|
12826
12831
|
remove: { bg: "bg-error/10", prefix: "-", text: "text-error" },
|
|
12827
|
-
|
|
12832
|
+
removed: { bg: "bg-error/10", prefix: "-", text: "text-error" },
|
|
12833
|
+
context: { bg: "", prefix: " ", text: "text-foreground" },
|
|
12834
|
+
unchanged: { bg: "", prefix: " ", text: "text-foreground" }
|
|
12828
12835
|
};
|
|
12836
|
+
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
12829
12837
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
12830
12838
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
12831
12839
|
exports.CodeBlock = React80__namespace.default.memo(
|
|
@@ -13190,7 +13198,7 @@ var init_CodeBlock = __esm({
|
|
|
13190
13198
|
}
|
|
13191
13199
|
),
|
|
13192
13200
|
/* @__PURE__ */ jsxRuntime.jsx(exports.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) => {
|
|
13193
|
-
const style = DIFF_STYLES[line.type];
|
|
13201
|
+
const style = DIFF_STYLES[line.type] ?? DIFF_STYLE_FALLBACK;
|
|
13194
13202
|
return /* @__PURE__ */ jsxRuntime.jsxs(exports.HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
|
|
13195
13203
|
showLineNumbers && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13196
13204
|
exports.Typography,
|
|
@@ -15898,7 +15906,7 @@ var init_BookTableOfContents = __esm({
|
|
|
15898
15906
|
style: { direction },
|
|
15899
15907
|
children: [
|
|
15900
15908
|
/* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "h1", className: "text-3xl font-bold text-center mb-4", children: t("book.tableOfContents") }),
|
|
15901
|
-
parts.map((part, partIdx) => {
|
|
15909
|
+
(Array.isArray(parts) ? parts : []).map((part, partIdx) => {
|
|
15902
15910
|
const chapters = Array.isArray(part.chapters) ? part.chapters : [];
|
|
15903
15911
|
return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { gap: "sm", children: [
|
|
15904
15912
|
/* @__PURE__ */ jsxRuntime.jsxs(exports.HStack, { gap: "sm", align: "center", children: [
|
|
@@ -35466,8 +35474,6 @@ function SimulationCanvas({
|
|
|
35466
35474
|
preset: presetProp,
|
|
35467
35475
|
width = 600,
|
|
35468
35476
|
height = 400,
|
|
35469
|
-
running,
|
|
35470
|
-
speed = 1,
|
|
35471
35477
|
bodies: externalBodies,
|
|
35472
35478
|
className
|
|
35473
35479
|
}) {
|
|
@@ -35478,59 +35484,6 @@ function SimulationCanvas({
|
|
|
35478
35484
|
React80.useEffect(() => {
|
|
35479
35485
|
bodiesRef.current = structuredClone(preset.bodies);
|
|
35480
35486
|
}, [preset]);
|
|
35481
|
-
const step = React80.useCallback(() => {
|
|
35482
|
-
const dt = Math.min(1 / 60 * speed, 1 / 15);
|
|
35483
|
-
const gx = preset.gravity?.x ?? 0;
|
|
35484
|
-
const gy = preset.gravity?.y ?? 9.81;
|
|
35485
|
-
const bodies = bodiesRef.current;
|
|
35486
|
-
const maxVel = Math.max(width, height) * 5;
|
|
35487
|
-
for (const body of bodies) {
|
|
35488
|
-
if (body.fixed) continue;
|
|
35489
|
-
body.vx += gx * dt;
|
|
35490
|
-
body.vy += gy * dt;
|
|
35491
|
-
body.vx = Math.max(-maxVel, Math.min(maxVel, body.vx));
|
|
35492
|
-
body.vy = Math.max(-maxVel, Math.min(maxVel, body.vy));
|
|
35493
|
-
body.x += body.vx * dt;
|
|
35494
|
-
body.y += body.vy * dt;
|
|
35495
|
-
if (body.y + body.radius > height) {
|
|
35496
|
-
body.y = height - body.radius;
|
|
35497
|
-
body.vy = -body.vy * 0.8;
|
|
35498
|
-
}
|
|
35499
|
-
if (body.y - body.radius < 0) {
|
|
35500
|
-
body.y = body.radius;
|
|
35501
|
-
body.vy = -body.vy * 0.8;
|
|
35502
|
-
}
|
|
35503
|
-
if (body.x + body.radius > width) {
|
|
35504
|
-
body.x = width - body.radius;
|
|
35505
|
-
body.vx = -body.vx * 0.8;
|
|
35506
|
-
}
|
|
35507
|
-
if (body.x - body.radius < 0) {
|
|
35508
|
-
body.x = body.radius;
|
|
35509
|
-
body.vx = -body.vx * 0.8;
|
|
35510
|
-
}
|
|
35511
|
-
}
|
|
35512
|
-
if (preset.constraints) {
|
|
35513
|
-
for (const c of preset.constraints) {
|
|
35514
|
-
const a = bodies[c.bodyA];
|
|
35515
|
-
const b = bodies[c.bodyB];
|
|
35516
|
-
if (!a || !b) continue;
|
|
35517
|
-
const dx = b.x - a.x;
|
|
35518
|
-
const dy = b.y - a.y;
|
|
35519
|
-
const dist = Math.sqrt(dx * dx + dy * dy) || 1e-3;
|
|
35520
|
-
const diff = (dist - c.length) / dist;
|
|
35521
|
-
const fx = dx * diff * c.stiffness;
|
|
35522
|
-
const fy = dy * diff * c.stiffness;
|
|
35523
|
-
if (!a.fixed) {
|
|
35524
|
-
a.vx += fx * dt;
|
|
35525
|
-
a.vy += fy * dt;
|
|
35526
|
-
}
|
|
35527
|
-
if (!b.fixed) {
|
|
35528
|
-
b.vx -= fx * dt;
|
|
35529
|
-
b.vy -= fy * dt;
|
|
35530
|
-
}
|
|
35531
|
-
}
|
|
35532
|
-
}
|
|
35533
|
-
}, [preset, width, height, speed]);
|
|
35534
35487
|
const draw = React80.useCallback(() => {
|
|
35535
35488
|
const canvas = canvasRef.current;
|
|
35536
35489
|
if (!canvas) return;
|
|
@@ -35632,21 +35585,8 @@ function SimulationCanvas({
|
|
|
35632
35585
|
return interp.startLoop(drawInterpolated);
|
|
35633
35586
|
}, [externalBodies !== void 0, interp.startLoop]);
|
|
35634
35587
|
React80.useEffect(() => {
|
|
35635
|
-
if (externalBodies !== void 0) return;
|
|
35636
|
-
if (!running) return;
|
|
35637
|
-
let raf;
|
|
35638
|
-
const loop = () => {
|
|
35639
|
-
step();
|
|
35640
|
-
draw();
|
|
35641
|
-
raf = requestAnimationFrame(loop);
|
|
35642
|
-
};
|
|
35643
|
-
raf = requestAnimationFrame(loop);
|
|
35644
|
-
return () => cancelAnimationFrame(raf);
|
|
35645
|
-
}, [running, step, draw, externalBodies]);
|
|
35646
|
-
React80.useEffect(() => {
|
|
35647
|
-
if (externalBodies !== void 0) return;
|
|
35648
35588
|
draw();
|
|
35649
|
-
}, [draw
|
|
35589
|
+
}, [draw]);
|
|
35650
35590
|
React80.useEffect(() => {
|
|
35651
35591
|
if (typeof window === "undefined") return;
|
|
35652
35592
|
const canvas = canvasRef.current;
|
|
@@ -42008,7 +41948,7 @@ var init_RichBlockEditor = __esm({
|
|
|
42008
41948
|
changeEvent,
|
|
42009
41949
|
readOnly = false,
|
|
42010
41950
|
placeholder,
|
|
42011
|
-
enableBlocks =
|
|
41951
|
+
enableBlocks = true,
|
|
42012
41952
|
showToolbar = true,
|
|
42013
41953
|
className
|
|
42014
41954
|
}) => {
|