@almadar/ui 5.79.0 → 5.79.2

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.
@@ -14093,7 +14093,7 @@ function GameHud({
14093
14093
  }) {
14094
14094
  const rawStats = propStats ?? items ?? (elements && Array.isArray(elements) ? convertElementsToStats(elements) : DEFAULT_HUD_STATS);
14095
14095
  const stats = Array.isArray(rawStats) ? rawStats : [];
14096
- const position = propPosition ?? "corners";
14096
+ const position = propPosition ?? "top";
14097
14097
  if (position === "corners") {
14098
14098
  const leftStats = stats.slice(0, Math.ceil(stats.length / 2));
14099
14099
  const rightStats = stats.slice(Math.ceil(stats.length / 2));
@@ -14102,17 +14102,37 @@ function GameHud({
14102
14102
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-4 right-4 flex flex-col gap-2 items-end pointer-events-auto", children: rightStats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) })
14103
14103
  ] });
14104
14104
  }
14105
+ if (position === "top" || position === "bottom") {
14106
+ const mid = Math.ceil(stats.length / 2);
14107
+ const leftStats = stats.slice(0, mid);
14108
+ const rightStats = stats.slice(mid);
14109
+ const isTop = position === "top";
14110
+ return /* @__PURE__ */ jsxRuntime.jsxs(
14111
+ "div",
14112
+ {
14113
+ className: cn(
14114
+ "flex items-center justify-between w-full",
14115
+ "px-4 py-2 gap-4",
14116
+ !transparent && (isTop ? "border-b border-border/40 bg-surface/90 backdrop-blur-sm" : "border-t border-border/40 bg-surface/90 backdrop-blur-sm"),
14117
+ transparent && (isTop ? "border-b border-white/10 bg-black/40 backdrop-blur-sm" : "border-t border-white/10 bg-black/40 backdrop-blur-sm"),
14118
+ className
14119
+ ),
14120
+ children: [
14121
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 flex-shrink-0", children: leftStats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) }),
14122
+ rightStats.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 flex-shrink-0", children: rightStats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) })
14123
+ ]
14124
+ }
14125
+ );
14126
+ }
14105
14127
  return /* @__PURE__ */ jsxRuntime.jsx(
14106
14128
  "div",
14107
14129
  {
14108
14130
  className: cn(
14109
- "relative z-10",
14110
- positionMap[position],
14111
- transparent && "bg-gradient-to-b from-background/50 to-transparent",
14112
- position === "bottom" && "bg-gradient-to-t from-background/50 to-transparent",
14131
+ "relative z-10 flex items-center gap-4 px-4 py-2",
14132
+ transparent ? "bg-black/30 backdrop-blur-sm" : "bg-surface/90 backdrop-blur-sm",
14113
14133
  className
14114
14134
  ),
14115
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-4", children: stats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) })
14135
+ children: stats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i))
14116
14136
  }
14117
14137
  );
14118
14138
  }
@@ -14122,8 +14142,6 @@ var init_GameHud = __esm({
14122
14142
  init_cn();
14123
14143
  init_StatBadge();
14124
14144
  positionMap = {
14125
- top: "top-0 left-0 right-0 flex justify-between items-start p-4",
14126
- bottom: "bottom-0 left-0 right-0 flex justify-between items-end p-4",
14127
14145
  corners: "inset-0 pointer-events-none"
14128
14146
  };
14129
14147
  DEFAULT_HUD_STATS = [
@@ -22741,7 +22759,8 @@ function asDescriptor(v) {
22741
22759
  if (typeof o.type !== "string") return null;
22742
22760
  const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
22743
22761
  const _id = typeof o._id === "string" ? o._id : void 0;
22744
- return { type: o.type, props, _id };
22762
+ const sourceTrait = typeof o.sourceTrait === "string" ? o.sourceTrait : void 0;
22763
+ return { type: o.type, props, _id, sourceTrait };
22745
22764
  }
22746
22765
  function getSlotContentRenderer3() {
22747
22766
  if (_scr2) return _scr2;
@@ -22760,7 +22779,13 @@ function resolveDescriptor2(value, idPrefix) {
22760
22779
  const desc = asDescriptor(value);
22761
22780
  if (desc !== null && patterns.getComponentForPattern(desc.type) !== null) {
22762
22781
  const resolvedProps = desc.props ?? {};
22763
- const content = { id: desc._id ?? idPrefix, pattern: desc.type, props: resolvedProps, priority: 0 };
22782
+ const content = {
22783
+ id: desc._id ?? idPrefix,
22784
+ pattern: desc.type,
22785
+ props: resolvedProps,
22786
+ priority: 0,
22787
+ ...desc.sourceTrait !== void 0 && { sourceTrait: desc.sourceTrait }
22788
+ };
22764
22789
  const SCR = getSlotContentRenderer3();
22765
22790
  return /* @__PURE__ */ jsxRuntime.jsx(SCR, { content, onDismiss: () => void 0 }, content.id);
22766
22791
  }
@@ -22800,30 +22825,35 @@ var init_GameShell = __esm({
22800
22825
  },
22801
22826
  children: [
22802
22827
  showTopBar && /* @__PURE__ */ jsxRuntime.jsxs(
22803
- HStack,
22828
+ Box,
22804
22829
  {
22805
- align: "center",
22806
- justify: "between",
22807
22830
  className: "game-shell__header",
22808
22831
  style: {
22809
- padding: "0.5rem 1rem",
22810
- borderBottom: "1px solid var(--color-border, #2a2a3a)",
22832
+ flexShrink: 0,
22811
22833
  background: "var(--color-surface, #12121f)",
22812
- flexShrink: 0
22834
+ borderBottom: "1px solid var(--color-border, #2a2a3a)"
22813
22835
  },
22814
22836
  children: [
22815
22837
  /* @__PURE__ */ jsxRuntime.jsx(
22816
- Typography,
22838
+ HStack,
22817
22839
  {
22818
- variant: "h6",
22819
- style: {
22820
- fontWeight: 700,
22821
- letterSpacing: "0.02em"
22822
- },
22823
- children: appName
22840
+ align: "center",
22841
+ justify: "between",
22842
+ style: { padding: "0.375rem 1rem" },
22843
+ children: /* @__PURE__ */ jsxRuntime.jsx(
22844
+ Typography,
22845
+ {
22846
+ variant: "h6",
22847
+ style: {
22848
+ fontWeight: 700,
22849
+ letterSpacing: "0.02em"
22850
+ },
22851
+ children: appName
22852
+ }
22853
+ )
22824
22854
  }
22825
22855
  ),
22826
- hud && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "game-shell__hud", children: resolveDescriptor2(hud, "gs-hud") })
22856
+ hud && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "game-shell__hud", style: { width: "100%" }, children: resolveDescriptor2(hud, "gs-hud") })
22827
22857
  ]
22828
22858
  }
22829
22859
  ),
package/dist/avl/index.js CHANGED
@@ -14047,7 +14047,7 @@ function GameHud({
14047
14047
  }) {
14048
14048
  const rawStats = propStats ?? items ?? (elements && Array.isArray(elements) ? convertElementsToStats(elements) : DEFAULT_HUD_STATS);
14049
14049
  const stats = Array.isArray(rawStats) ? rawStats : [];
14050
- const position = propPosition ?? "corners";
14050
+ const position = propPosition ?? "top";
14051
14051
  if (position === "corners") {
14052
14052
  const leftStats = stats.slice(0, Math.ceil(stats.length / 2));
14053
14053
  const rightStats = stats.slice(Math.ceil(stats.length / 2));
@@ -14056,17 +14056,37 @@ function GameHud({
14056
14056
  /* @__PURE__ */ jsx("div", { className: "absolute top-4 right-4 flex flex-col gap-2 items-end pointer-events-auto", children: rightStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) })
14057
14057
  ] });
14058
14058
  }
14059
+ if (position === "top" || position === "bottom") {
14060
+ const mid = Math.ceil(stats.length / 2);
14061
+ const leftStats = stats.slice(0, mid);
14062
+ const rightStats = stats.slice(mid);
14063
+ const isTop = position === "top";
14064
+ return /* @__PURE__ */ jsxs(
14065
+ "div",
14066
+ {
14067
+ className: cn(
14068
+ "flex items-center justify-between w-full",
14069
+ "px-4 py-2 gap-4",
14070
+ !transparent && (isTop ? "border-b border-border/40 bg-surface/90 backdrop-blur-sm" : "border-t border-border/40 bg-surface/90 backdrop-blur-sm"),
14071
+ transparent && (isTop ? "border-b border-white/10 bg-black/40 backdrop-blur-sm" : "border-t border-white/10 bg-black/40 backdrop-blur-sm"),
14072
+ className
14073
+ ),
14074
+ children: [
14075
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 flex-shrink-0", children: leftStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) }),
14076
+ rightStats.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 flex-shrink-0", children: rightStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) })
14077
+ ]
14078
+ }
14079
+ );
14080
+ }
14059
14081
  return /* @__PURE__ */ jsx(
14060
14082
  "div",
14061
14083
  {
14062
14084
  className: cn(
14063
- "relative z-10",
14064
- positionMap[position],
14065
- transparent && "bg-gradient-to-b from-background/50 to-transparent",
14066
- position === "bottom" && "bg-gradient-to-t from-background/50 to-transparent",
14085
+ "relative z-10 flex items-center gap-4 px-4 py-2",
14086
+ transparent ? "bg-black/30 backdrop-blur-sm" : "bg-surface/90 backdrop-blur-sm",
14067
14087
  className
14068
14088
  ),
14069
- children: /* @__PURE__ */ jsx("div", { className: "flex gap-4", children: stats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) })
14089
+ children: stats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i))
14070
14090
  }
14071
14091
  );
14072
14092
  }
@@ -14076,8 +14096,6 @@ var init_GameHud = __esm({
14076
14096
  init_cn();
14077
14097
  init_StatBadge();
14078
14098
  positionMap = {
14079
- top: "top-0 left-0 right-0 flex justify-between items-start p-4",
14080
- bottom: "bottom-0 left-0 right-0 flex justify-between items-end p-4",
14081
14099
  corners: "inset-0 pointer-events-none"
14082
14100
  };
14083
14101
  DEFAULT_HUD_STATS = [
@@ -22695,7 +22713,8 @@ function asDescriptor(v) {
22695
22713
  if (typeof o.type !== "string") return null;
22696
22714
  const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
22697
22715
  const _id = typeof o._id === "string" ? o._id : void 0;
22698
- return { type: o.type, props, _id };
22716
+ const sourceTrait = typeof o.sourceTrait === "string" ? o.sourceTrait : void 0;
22717
+ return { type: o.type, props, _id, sourceTrait };
22699
22718
  }
22700
22719
  function getSlotContentRenderer3() {
22701
22720
  if (_scr2) return _scr2;
@@ -22714,7 +22733,13 @@ function resolveDescriptor2(value, idPrefix) {
22714
22733
  const desc = asDescriptor(value);
22715
22734
  if (desc !== null && getComponentForPattern(desc.type) !== null) {
22716
22735
  const resolvedProps = desc.props ?? {};
22717
- const content = { id: desc._id ?? idPrefix, pattern: desc.type, props: resolvedProps, priority: 0 };
22736
+ const content = {
22737
+ id: desc._id ?? idPrefix,
22738
+ pattern: desc.type,
22739
+ props: resolvedProps,
22740
+ priority: 0,
22741
+ ...desc.sourceTrait !== void 0 && { sourceTrait: desc.sourceTrait }
22742
+ };
22718
22743
  const SCR = getSlotContentRenderer3();
22719
22744
  return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 }, content.id);
22720
22745
  }
@@ -22754,30 +22779,35 @@ var init_GameShell = __esm({
22754
22779
  },
22755
22780
  children: [
22756
22781
  showTopBar && /* @__PURE__ */ jsxs(
22757
- HStack,
22782
+ Box,
22758
22783
  {
22759
- align: "center",
22760
- justify: "between",
22761
22784
  className: "game-shell__header",
22762
22785
  style: {
22763
- padding: "0.5rem 1rem",
22764
- borderBottom: "1px solid var(--color-border, #2a2a3a)",
22786
+ flexShrink: 0,
22765
22787
  background: "var(--color-surface, #12121f)",
22766
- flexShrink: 0
22788
+ borderBottom: "1px solid var(--color-border, #2a2a3a)"
22767
22789
  },
22768
22790
  children: [
22769
22791
  /* @__PURE__ */ jsx(
22770
- Typography,
22792
+ HStack,
22771
22793
  {
22772
- variant: "h6",
22773
- style: {
22774
- fontWeight: 700,
22775
- letterSpacing: "0.02em"
22776
- },
22777
- children: appName
22794
+ align: "center",
22795
+ justify: "between",
22796
+ style: { padding: "0.375rem 1rem" },
22797
+ children: /* @__PURE__ */ jsx(
22798
+ Typography,
22799
+ {
22800
+ variant: "h6",
22801
+ style: {
22802
+ fontWeight: 700,
22803
+ letterSpacing: "0.02em"
22804
+ },
22805
+ children: appName
22806
+ }
22807
+ )
22778
22808
  }
22779
22809
  ),
22780
- hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", children: resolveDescriptor2(hud, "gs-hud") })
22810
+ hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", style: { width: "100%" }, children: resolveDescriptor2(hud, "gs-hud") })
22781
22811
  ]
22782
22812
  }
22783
22813
  ),
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import type { BloomLevel } from './BloomQuizBlock';
12
12
  import { type MixedSegment } from './lessonSegmentUtils';
13
+ export type InteractiveOrbitalType = 'chart' | 'simulation' | 'math' | 'physics' | 'biology' | 'chemistry' | 'probability';
13
14
  export type LessonSegment = MixedSegment | {
14
15
  type: 'quiz';
15
16
  question: string;
@@ -30,7 +31,7 @@ export type LessonSegment = MixedSegment | {
30
31
  answer: string;
31
32
  } | {
32
33
  type: 'visualization';
33
- visualizationType: 'chart' | 'simulation';
34
+ visualizationType: InteractiveOrbitalType;
34
35
  description: string;
35
36
  };
36
37
  /** User progress state passed into SegmentRenderer. */
@@ -12,7 +12,7 @@
12
12
  */
13
13
  import React from 'react';
14
14
  import { type CodeSimulationOutput } from './CodeRunnerPanel';
15
- import type { LessonSegment, LessonUserProgress } from '../molecules/parseLessonSegments';
15
+ import type { LessonSegment, LessonUserProgress, InteractiveOrbitalType } from '../molecules/parseLessonSegments';
16
16
  export type { LessonSegment, LessonUserProgress, CodeSimulationOutput };
17
17
  export interface SegmentRendererProps {
18
18
  /** Parsed lesson segments (see `parseLessonSegments`) */
@@ -33,6 +33,6 @@ export interface SegmentRendererProps {
33
33
  * visualization segments are silently skipped. Callers can wire this to any
34
34
  * custom component or orbital generator.
35
35
  */
36
- onRenderVisualization?: (type: 'chart' | 'simulation', description: string, index: number) => React.ReactNode;
36
+ onRenderVisualization?: (type: InteractiveOrbitalType, description: string, index: number) => React.ReactNode;
37
37
  }
38
38
  export declare const SegmentRenderer: React.FC<SegmentRendererProps>;
@@ -30362,7 +30362,7 @@ function GameHud({
30362
30362
  }) {
30363
30363
  const rawStats = propStats ?? items ?? (elements && Array.isArray(elements) ? convertElementsToStats(elements) : DEFAULT_HUD_STATS);
30364
30364
  const stats = Array.isArray(rawStats) ? rawStats : [];
30365
- const position = propPosition ?? "corners";
30365
+ const position = propPosition ?? "top";
30366
30366
  if (position === "corners") {
30367
30367
  const leftStats = stats.slice(0, Math.ceil(stats.length / 2));
30368
30368
  const rightStats = stats.slice(Math.ceil(stats.length / 2));
@@ -30371,17 +30371,37 @@ function GameHud({
30371
30371
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-4 right-4 flex flex-col gap-2 items-end pointer-events-auto", children: rightStats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) })
30372
30372
  ] });
30373
30373
  }
30374
+ if (position === "top" || position === "bottom") {
30375
+ const mid = Math.ceil(stats.length / 2);
30376
+ const leftStats = stats.slice(0, mid);
30377
+ const rightStats = stats.slice(mid);
30378
+ const isTop = position === "top";
30379
+ return /* @__PURE__ */ jsxRuntime.jsxs(
30380
+ "div",
30381
+ {
30382
+ className: cn(
30383
+ "flex items-center justify-between w-full",
30384
+ "px-4 py-2 gap-4",
30385
+ !transparent && (isTop ? "border-b border-border/40 bg-surface/90 backdrop-blur-sm" : "border-t border-border/40 bg-surface/90 backdrop-blur-sm"),
30386
+ transparent && (isTop ? "border-b border-white/10 bg-black/40 backdrop-blur-sm" : "border-t border-white/10 bg-black/40 backdrop-blur-sm"),
30387
+ className
30388
+ ),
30389
+ children: [
30390
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 flex-shrink-0", children: leftStats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) }),
30391
+ rightStats.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 flex-shrink-0", children: rightStats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) })
30392
+ ]
30393
+ }
30394
+ );
30395
+ }
30374
30396
  return /* @__PURE__ */ jsxRuntime.jsx(
30375
30397
  "div",
30376
30398
  {
30377
30399
  className: cn(
30378
- "relative z-10",
30379
- positionMap[position],
30380
- transparent && "bg-gradient-to-b from-background/50 to-transparent",
30381
- position === "bottom" && "bg-gradient-to-t from-background/50 to-transparent",
30400
+ "relative z-10 flex items-center gap-4 px-4 py-2",
30401
+ transparent ? "bg-black/30 backdrop-blur-sm" : "bg-surface/90 backdrop-blur-sm",
30382
30402
  className
30383
30403
  ),
30384
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-4", children: stats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) })
30404
+ children: stats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i))
30385
30405
  }
30386
30406
  );
30387
30407
  }
@@ -30391,8 +30411,6 @@ var init_GameHud = __esm({
30391
30411
  init_cn();
30392
30412
  init_StatBadge();
30393
30413
  positionMap = {
30394
- top: "top-0 left-0 right-0 flex justify-between items-start p-4",
30395
- bottom: "bottom-0 left-0 right-0 flex justify-between items-end p-4",
30396
30414
  corners: "inset-0 pointer-events-none"
30397
30415
  };
30398
30416
  DEFAULT_HUD_STATS = [
@@ -36362,7 +36380,8 @@ function asDescriptor(v) {
36362
36380
  if (typeof o.type !== "string") return null;
36363
36381
  const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
36364
36382
  const _id = typeof o._id === "string" ? o._id : void 0;
36365
- return { type: o.type, props, _id };
36383
+ const sourceTrait = typeof o.sourceTrait === "string" ? o.sourceTrait : void 0;
36384
+ return { type: o.type, props, _id, sourceTrait };
36366
36385
  }
36367
36386
  function getSlotContentRenderer2() {
36368
36387
  if (_scr2) return _scr2;
@@ -36381,7 +36400,13 @@ function resolveDescriptor2(value, idPrefix) {
36381
36400
  const desc = asDescriptor(value);
36382
36401
  if (desc !== null && patterns.getComponentForPattern(desc.type) !== null) {
36383
36402
  const resolvedProps = desc.props ?? {};
36384
- const content = { id: desc._id ?? idPrefix, pattern: desc.type, props: resolvedProps, priority: 0 };
36403
+ const content = {
36404
+ id: desc._id ?? idPrefix,
36405
+ pattern: desc.type,
36406
+ props: resolvedProps,
36407
+ priority: 0,
36408
+ ...desc.sourceTrait !== void 0 && { sourceTrait: desc.sourceTrait }
36409
+ };
36385
36410
  const SCR = getSlotContentRenderer2();
36386
36411
  return /* @__PURE__ */ jsxRuntime.jsx(SCR, { content, onDismiss: () => void 0 }, content.id);
36387
36412
  }
@@ -36421,30 +36446,35 @@ var init_GameShell = __esm({
36421
36446
  },
36422
36447
  children: [
36423
36448
  showTopBar && /* @__PURE__ */ jsxRuntime.jsxs(
36424
- exports.HStack,
36449
+ exports.Box,
36425
36450
  {
36426
- align: "center",
36427
- justify: "between",
36428
36451
  className: "game-shell__header",
36429
36452
  style: {
36430
- padding: "0.5rem 1rem",
36431
- borderBottom: "1px solid var(--color-border, #2a2a3a)",
36453
+ flexShrink: 0,
36432
36454
  background: "var(--color-surface, #12121f)",
36433
- flexShrink: 0
36455
+ borderBottom: "1px solid var(--color-border, #2a2a3a)"
36434
36456
  },
36435
36457
  children: [
36436
36458
  /* @__PURE__ */ jsxRuntime.jsx(
36437
- exports.Typography,
36459
+ exports.HStack,
36438
36460
  {
36439
- variant: "h6",
36440
- style: {
36441
- fontWeight: 700,
36442
- letterSpacing: "0.02em"
36443
- },
36444
- children: appName
36461
+ align: "center",
36462
+ justify: "between",
36463
+ style: { padding: "0.375rem 1rem" },
36464
+ children: /* @__PURE__ */ jsxRuntime.jsx(
36465
+ exports.Typography,
36466
+ {
36467
+ variant: "h6",
36468
+ style: {
36469
+ fontWeight: 700,
36470
+ letterSpacing: "0.02em"
36471
+ },
36472
+ children: appName
36473
+ }
36474
+ )
36445
36475
  }
36446
36476
  ),
36447
- hud && /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "game-shell__hud", children: resolveDescriptor2(hud, "gs-hud") })
36477
+ hud && /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "game-shell__hud", style: { width: "100%" }, children: resolveDescriptor2(hud, "gs-hud") })
36448
36478
  ]
36449
36479
  }
36450
36480
  ),
@@ -46720,7 +46750,7 @@ function parseLessonSegments(lesson) {
46720
46750
  content = content.replace(connectResult.fullMatch, "").trim();
46721
46751
  }
46722
46752
  const tagRegex = new RegExp(
46723
- '(?<reflect><reflect>(?<reflectClosed>[\\s\\S]*?)<\\/reflect>)|(?<reflectUnclosed><reflect>(?<reflectOpen>[\\s\\S]*?)(?=<(?:activate|connect|reflect|bloom|prq|question|answer|visualize)|\\n\\n#|$))|(?<bloom><bloom\\s+level="(?<bloomLevel>remember|understand|apply|analyze|evaluate|create)">(?<bloomClosed>[\\s\\S]*?)<\\/bloom>)|(?<bloomUnclosed><bloom\\s+level="(?<bloomLevelUn>remember|understand|apply|analyze|evaluate|create)">(?<bloomOpen>[\\s\\S]*?)(?=<(?:activate|connect|reflect|bloom|prq|question|answer|visualize)|\\n\\n#|$))|(?<quiz><question>(?<quizQuestion>[\\s\\S]*?)<\\/question>\\s*<answer>(?<quizAnswer>[\\s\\S]*?)<\\/answer>)|(?<visualize><visualize\\s+type="(?<vizType>chart|simulation)"\\s+description="(?<vizDesc>[^"]*?)"\\s*\\/?>)',
46753
+ '(?<reflect><reflect>(?<reflectClosed>[\\s\\S]*?)<\\/reflect>)|(?<reflectUnclosed><reflect>(?<reflectOpen>[\\s\\S]*?)(?=<(?:activate|connect|reflect|bloom|prq|question|answer|visualize)|\\n\\n#|$))|(?<bloom><bloom\\s+level="(?<bloomLevel>remember|understand|apply|analyze|evaluate|create)">(?<bloomClosed>[\\s\\S]*?)<\\/bloom>)|(?<bloomUnclosed><bloom\\s+level="(?<bloomLevelUn>remember|understand|apply|analyze|evaluate|create)">(?<bloomOpen>[\\s\\S]*?)(?=<(?:activate|connect|reflect|bloom|prq|question|answer|visualize)|\\n\\n#|$))|(?<quiz><question>(?<quizQuestion>[\\s\\S]*?)<\\/question>\\s*<answer>(?<quizAnswer>[\\s\\S]*?)<\\/answer>)|(?<visualize><visualize\\s+type="(?<vizType>chart|simulation|math|physics|biology|chemistry|probability)"\\s+description="(?<vizDesc>[^"]*?)"\\s*\\/?>)',
46724
46754
  "gi"
46725
46755
  );
46726
46756
  let lastIndex = 0;
@@ -30316,7 +30316,7 @@ function GameHud({
30316
30316
  }) {
30317
30317
  const rawStats = propStats ?? items ?? (elements && Array.isArray(elements) ? convertElementsToStats(elements) : DEFAULT_HUD_STATS);
30318
30318
  const stats = Array.isArray(rawStats) ? rawStats : [];
30319
- const position = propPosition ?? "corners";
30319
+ const position = propPosition ?? "top";
30320
30320
  if (position === "corners") {
30321
30321
  const leftStats = stats.slice(0, Math.ceil(stats.length / 2));
30322
30322
  const rightStats = stats.slice(Math.ceil(stats.length / 2));
@@ -30325,17 +30325,37 @@ function GameHud({
30325
30325
  /* @__PURE__ */ jsx("div", { className: "absolute top-4 right-4 flex flex-col gap-2 items-end pointer-events-auto", children: rightStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) })
30326
30326
  ] });
30327
30327
  }
30328
+ if (position === "top" || position === "bottom") {
30329
+ const mid = Math.ceil(stats.length / 2);
30330
+ const leftStats = stats.slice(0, mid);
30331
+ const rightStats = stats.slice(mid);
30332
+ const isTop = position === "top";
30333
+ return /* @__PURE__ */ jsxs(
30334
+ "div",
30335
+ {
30336
+ className: cn(
30337
+ "flex items-center justify-between w-full",
30338
+ "px-4 py-2 gap-4",
30339
+ !transparent && (isTop ? "border-b border-border/40 bg-surface/90 backdrop-blur-sm" : "border-t border-border/40 bg-surface/90 backdrop-blur-sm"),
30340
+ transparent && (isTop ? "border-b border-white/10 bg-black/40 backdrop-blur-sm" : "border-t border-white/10 bg-black/40 backdrop-blur-sm"),
30341
+ className
30342
+ ),
30343
+ children: [
30344
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 flex-shrink-0", children: leftStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) }),
30345
+ rightStats.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 flex-shrink-0", children: rightStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) })
30346
+ ]
30347
+ }
30348
+ );
30349
+ }
30328
30350
  return /* @__PURE__ */ jsx(
30329
30351
  "div",
30330
30352
  {
30331
30353
  className: cn(
30332
- "relative z-10",
30333
- positionMap[position],
30334
- transparent && "bg-gradient-to-b from-background/50 to-transparent",
30335
- position === "bottom" && "bg-gradient-to-t from-background/50 to-transparent",
30354
+ "relative z-10 flex items-center gap-4 px-4 py-2",
30355
+ transparent ? "bg-black/30 backdrop-blur-sm" : "bg-surface/90 backdrop-blur-sm",
30336
30356
  className
30337
30357
  ),
30338
- children: /* @__PURE__ */ jsx("div", { className: "flex gap-4", children: stats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) })
30358
+ children: stats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i))
30339
30359
  }
30340
30360
  );
30341
30361
  }
@@ -30345,8 +30365,6 @@ var init_GameHud = __esm({
30345
30365
  init_cn();
30346
30366
  init_StatBadge();
30347
30367
  positionMap = {
30348
- top: "top-0 left-0 right-0 flex justify-between items-start p-4",
30349
- bottom: "bottom-0 left-0 right-0 flex justify-between items-end p-4",
30350
30368
  corners: "inset-0 pointer-events-none"
30351
30369
  };
30352
30370
  DEFAULT_HUD_STATS = [
@@ -36316,7 +36334,8 @@ function asDescriptor(v) {
36316
36334
  if (typeof o.type !== "string") return null;
36317
36335
  const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
36318
36336
  const _id = typeof o._id === "string" ? o._id : void 0;
36319
- return { type: o.type, props, _id };
36337
+ const sourceTrait = typeof o.sourceTrait === "string" ? o.sourceTrait : void 0;
36338
+ return { type: o.type, props, _id, sourceTrait };
36320
36339
  }
36321
36340
  function getSlotContentRenderer2() {
36322
36341
  if (_scr2) return _scr2;
@@ -36335,7 +36354,13 @@ function resolveDescriptor2(value, idPrefix) {
36335
36354
  const desc = asDescriptor(value);
36336
36355
  if (desc !== null && getComponentForPattern(desc.type) !== null) {
36337
36356
  const resolvedProps = desc.props ?? {};
36338
- const content = { id: desc._id ?? idPrefix, pattern: desc.type, props: resolvedProps, priority: 0 };
36357
+ const content = {
36358
+ id: desc._id ?? idPrefix,
36359
+ pattern: desc.type,
36360
+ props: resolvedProps,
36361
+ priority: 0,
36362
+ ...desc.sourceTrait !== void 0 && { sourceTrait: desc.sourceTrait }
36363
+ };
36339
36364
  const SCR = getSlotContentRenderer2();
36340
36365
  return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 }, content.id);
36341
36366
  }
@@ -36375,30 +36400,35 @@ var init_GameShell = __esm({
36375
36400
  },
36376
36401
  children: [
36377
36402
  showTopBar && /* @__PURE__ */ jsxs(
36378
- HStack,
36403
+ Box,
36379
36404
  {
36380
- align: "center",
36381
- justify: "between",
36382
36405
  className: "game-shell__header",
36383
36406
  style: {
36384
- padding: "0.5rem 1rem",
36385
- borderBottom: "1px solid var(--color-border, #2a2a3a)",
36407
+ flexShrink: 0,
36386
36408
  background: "var(--color-surface, #12121f)",
36387
- flexShrink: 0
36409
+ borderBottom: "1px solid var(--color-border, #2a2a3a)"
36388
36410
  },
36389
36411
  children: [
36390
36412
  /* @__PURE__ */ jsx(
36391
- Typography,
36413
+ HStack,
36392
36414
  {
36393
- variant: "h6",
36394
- style: {
36395
- fontWeight: 700,
36396
- letterSpacing: "0.02em"
36397
- },
36398
- children: appName
36415
+ align: "center",
36416
+ justify: "between",
36417
+ style: { padding: "0.375rem 1rem" },
36418
+ children: /* @__PURE__ */ jsx(
36419
+ Typography,
36420
+ {
36421
+ variant: "h6",
36422
+ style: {
36423
+ fontWeight: 700,
36424
+ letterSpacing: "0.02em"
36425
+ },
36426
+ children: appName
36427
+ }
36428
+ )
36399
36429
  }
36400
36430
  ),
36401
- hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", children: resolveDescriptor2(hud, "gs-hud") })
36431
+ hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", style: { width: "100%" }, children: resolveDescriptor2(hud, "gs-hud") })
36402
36432
  ]
36403
36433
  }
36404
36434
  ),
@@ -46674,7 +46704,7 @@ function parseLessonSegments(lesson) {
46674
46704
  content = content.replace(connectResult.fullMatch, "").trim();
46675
46705
  }
46676
46706
  const tagRegex = new RegExp(
46677
- '(?<reflect><reflect>(?<reflectClosed>[\\s\\S]*?)<\\/reflect>)|(?<reflectUnclosed><reflect>(?<reflectOpen>[\\s\\S]*?)(?=<(?:activate|connect|reflect|bloom|prq|question|answer|visualize)|\\n\\n#|$))|(?<bloom><bloom\\s+level="(?<bloomLevel>remember|understand|apply|analyze|evaluate|create)">(?<bloomClosed>[\\s\\S]*?)<\\/bloom>)|(?<bloomUnclosed><bloom\\s+level="(?<bloomLevelUn>remember|understand|apply|analyze|evaluate|create)">(?<bloomOpen>[\\s\\S]*?)(?=<(?:activate|connect|reflect|bloom|prq|question|answer|visualize)|\\n\\n#|$))|(?<quiz><question>(?<quizQuestion>[\\s\\S]*?)<\\/question>\\s*<answer>(?<quizAnswer>[\\s\\S]*?)<\\/answer>)|(?<visualize><visualize\\s+type="(?<vizType>chart|simulation)"\\s+description="(?<vizDesc>[^"]*?)"\\s*\\/?>)',
46707
+ '(?<reflect><reflect>(?<reflectClosed>[\\s\\S]*?)<\\/reflect>)|(?<reflectUnclosed><reflect>(?<reflectOpen>[\\s\\S]*?)(?=<(?:activate|connect|reflect|bloom|prq|question|answer|visualize)|\\n\\n#|$))|(?<bloom><bloom\\s+level="(?<bloomLevel>remember|understand|apply|analyze|evaluate|create)">(?<bloomClosed>[\\s\\S]*?)<\\/bloom>)|(?<bloomUnclosed><bloom\\s+level="(?<bloomLevelUn>remember|understand|apply|analyze|evaluate|create)">(?<bloomOpen>[\\s\\S]*?)(?=<(?:activate|connect|reflect|bloom|prq|question|answer|visualize)|\\n\\n#|$))|(?<quiz><question>(?<quizQuestion>[\\s\\S]*?)<\\/question>\\s*<answer>(?<quizAnswer>[\\s\\S]*?)<\\/answer>)|(?<visualize><visualize\\s+type="(?<vizType>chart|simulation|math|physics|biology|chemistry|probability)"\\s+description="(?<vizDesc>[^"]*?)"\\s*\\/?>)',
46678
46708
  "gi"
46679
46709
  );
46680
46710
  let lastIndex = 0;
@@ -10338,7 +10338,7 @@ function GameHud({
10338
10338
  }) {
10339
10339
  const rawStats = propStats ?? items ?? (elements && Array.isArray(elements) ? convertElementsToStats(elements) : DEFAULT_HUD_STATS);
10340
10340
  const stats = Array.isArray(rawStats) ? rawStats : [];
10341
- const position = propPosition ?? "corners";
10341
+ const position = propPosition ?? "top";
10342
10342
  if (position === "corners") {
10343
10343
  const leftStats = stats.slice(0, Math.ceil(stats.length / 2));
10344
10344
  const rightStats = stats.slice(Math.ceil(stats.length / 2));
@@ -10347,17 +10347,37 @@ function GameHud({
10347
10347
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-4 right-4 flex flex-col gap-2 items-end pointer-events-auto", children: rightStats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) })
10348
10348
  ] });
10349
10349
  }
10350
+ if (position === "top" || position === "bottom") {
10351
+ const mid = Math.ceil(stats.length / 2);
10352
+ const leftStats = stats.slice(0, mid);
10353
+ const rightStats = stats.slice(mid);
10354
+ const isTop = position === "top";
10355
+ return /* @__PURE__ */ jsxRuntime.jsxs(
10356
+ "div",
10357
+ {
10358
+ className: cn(
10359
+ "flex items-center justify-between w-full",
10360
+ "px-4 py-2 gap-4",
10361
+ !transparent && (isTop ? "border-b border-border/40 bg-surface/90 backdrop-blur-sm" : "border-t border-border/40 bg-surface/90 backdrop-blur-sm"),
10362
+ transparent && (isTop ? "border-b border-white/10 bg-black/40 backdrop-blur-sm" : "border-t border-white/10 bg-black/40 backdrop-blur-sm"),
10363
+ className
10364
+ ),
10365
+ children: [
10366
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 flex-shrink-0", children: leftStats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) }),
10367
+ rightStats.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 flex-shrink-0", children: rightStats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) })
10368
+ ]
10369
+ }
10370
+ );
10371
+ }
10350
10372
  return /* @__PURE__ */ jsxRuntime.jsx(
10351
10373
  "div",
10352
10374
  {
10353
10375
  className: cn(
10354
- "relative z-10",
10355
- positionMap[position],
10356
- transparent && "bg-gradient-to-b from-background/50 to-transparent",
10357
- position === "bottom" && "bg-gradient-to-t from-background/50 to-transparent",
10376
+ "relative z-10 flex items-center gap-4 px-4 py-2",
10377
+ transparent ? "bg-black/30 backdrop-blur-sm" : "bg-surface/90 backdrop-blur-sm",
10358
10378
  className
10359
10379
  ),
10360
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-4", children: stats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) })
10380
+ children: stats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i))
10361
10381
  }
10362
10382
  );
10363
10383
  }
@@ -10367,8 +10387,6 @@ var init_GameHud = __esm({
10367
10387
  init_cn();
10368
10388
  init_StatBadge();
10369
10389
  positionMap = {
10370
- top: "top-0 left-0 right-0 flex justify-between items-start p-4",
10371
- bottom: "bottom-0 left-0 right-0 flex justify-between items-end p-4",
10372
10390
  corners: "inset-0 pointer-events-none"
10373
10391
  };
10374
10392
  DEFAULT_HUD_STATS = [
@@ -18986,7 +19004,8 @@ function asDescriptor(v) {
18986
19004
  if (typeof o.type !== "string") return null;
18987
19005
  const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
18988
19006
  const _id = typeof o._id === "string" ? o._id : void 0;
18989
- return { type: o.type, props, _id };
19007
+ const sourceTrait = typeof o.sourceTrait === "string" ? o.sourceTrait : void 0;
19008
+ return { type: o.type, props, _id, sourceTrait };
18990
19009
  }
18991
19010
  function getSlotContentRenderer3() {
18992
19011
  if (_scr2) return _scr2;
@@ -19005,7 +19024,13 @@ function resolveDescriptor2(value, idPrefix) {
19005
19024
  const desc = asDescriptor(value);
19006
19025
  if (desc !== null && patterns.getComponentForPattern(desc.type) !== null) {
19007
19026
  const resolvedProps = desc.props ?? {};
19008
- const content = { id: desc._id ?? idPrefix, pattern: desc.type, props: resolvedProps, priority: 0 };
19027
+ const content = {
19028
+ id: desc._id ?? idPrefix,
19029
+ pattern: desc.type,
19030
+ props: resolvedProps,
19031
+ priority: 0,
19032
+ ...desc.sourceTrait !== void 0 && { sourceTrait: desc.sourceTrait }
19033
+ };
19009
19034
  const SCR = getSlotContentRenderer3();
19010
19035
  return /* @__PURE__ */ jsxRuntime.jsx(SCR, { content, onDismiss: () => void 0 }, content.id);
19011
19036
  }
@@ -19045,30 +19070,35 @@ var init_GameShell = __esm({
19045
19070
  },
19046
19071
  children: [
19047
19072
  showTopBar && /* @__PURE__ */ jsxRuntime.jsxs(
19048
- HStack,
19073
+ Box,
19049
19074
  {
19050
- align: "center",
19051
- justify: "between",
19052
19075
  className: "game-shell__header",
19053
19076
  style: {
19054
- padding: "0.5rem 1rem",
19055
- borderBottom: "1px solid var(--color-border, #2a2a3a)",
19077
+ flexShrink: 0,
19056
19078
  background: "var(--color-surface, #12121f)",
19057
- flexShrink: 0
19079
+ borderBottom: "1px solid var(--color-border, #2a2a3a)"
19058
19080
  },
19059
19081
  children: [
19060
19082
  /* @__PURE__ */ jsxRuntime.jsx(
19061
- Typography,
19083
+ HStack,
19062
19084
  {
19063
- variant: "h6",
19064
- style: {
19065
- fontWeight: 700,
19066
- letterSpacing: "0.02em"
19067
- },
19068
- children: appName
19085
+ align: "center",
19086
+ justify: "between",
19087
+ style: { padding: "0.375rem 1rem" },
19088
+ children: /* @__PURE__ */ jsxRuntime.jsx(
19089
+ Typography,
19090
+ {
19091
+ variant: "h6",
19092
+ style: {
19093
+ fontWeight: 700,
19094
+ letterSpacing: "0.02em"
19095
+ },
19096
+ children: appName
19097
+ }
19098
+ )
19069
19099
  }
19070
19100
  ),
19071
- hud && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "game-shell__hud", children: resolveDescriptor2(hud, "gs-hud") })
19101
+ hud && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "game-shell__hud", style: { width: "100%" }, children: resolveDescriptor2(hud, "gs-hud") })
19072
19102
  ]
19073
19103
  }
19074
19104
  ),
@@ -10293,7 +10293,7 @@ function GameHud({
10293
10293
  }) {
10294
10294
  const rawStats = propStats ?? items ?? (elements && Array.isArray(elements) ? convertElementsToStats(elements) : DEFAULT_HUD_STATS);
10295
10295
  const stats = Array.isArray(rawStats) ? rawStats : [];
10296
- const position = propPosition ?? "corners";
10296
+ const position = propPosition ?? "top";
10297
10297
  if (position === "corners") {
10298
10298
  const leftStats = stats.slice(0, Math.ceil(stats.length / 2));
10299
10299
  const rightStats = stats.slice(Math.ceil(stats.length / 2));
@@ -10302,17 +10302,37 @@ function GameHud({
10302
10302
  /* @__PURE__ */ jsx("div", { className: "absolute top-4 right-4 flex flex-col gap-2 items-end pointer-events-auto", children: rightStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) })
10303
10303
  ] });
10304
10304
  }
10305
+ if (position === "top" || position === "bottom") {
10306
+ const mid = Math.ceil(stats.length / 2);
10307
+ const leftStats = stats.slice(0, mid);
10308
+ const rightStats = stats.slice(mid);
10309
+ const isTop = position === "top";
10310
+ return /* @__PURE__ */ jsxs(
10311
+ "div",
10312
+ {
10313
+ className: cn(
10314
+ "flex items-center justify-between w-full",
10315
+ "px-4 py-2 gap-4",
10316
+ !transparent && (isTop ? "border-b border-border/40 bg-surface/90 backdrop-blur-sm" : "border-t border-border/40 bg-surface/90 backdrop-blur-sm"),
10317
+ transparent && (isTop ? "border-b border-white/10 bg-black/40 backdrop-blur-sm" : "border-t border-white/10 bg-black/40 backdrop-blur-sm"),
10318
+ className
10319
+ ),
10320
+ children: [
10321
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 flex-shrink-0", children: leftStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) }),
10322
+ rightStats.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 flex-shrink-0", children: rightStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) })
10323
+ ]
10324
+ }
10325
+ );
10326
+ }
10305
10327
  return /* @__PURE__ */ jsx(
10306
10328
  "div",
10307
10329
  {
10308
10330
  className: cn(
10309
- "relative z-10",
10310
- positionMap[position],
10311
- transparent && "bg-gradient-to-b from-background/50 to-transparent",
10312
- position === "bottom" && "bg-gradient-to-t from-background/50 to-transparent",
10331
+ "relative z-10 flex items-center gap-4 px-4 py-2",
10332
+ transparent ? "bg-black/30 backdrop-blur-sm" : "bg-surface/90 backdrop-blur-sm",
10313
10333
  className
10314
10334
  ),
10315
- children: /* @__PURE__ */ jsx("div", { className: "flex gap-4", children: stats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) })
10335
+ children: stats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i))
10316
10336
  }
10317
10337
  );
10318
10338
  }
@@ -10322,8 +10342,6 @@ var init_GameHud = __esm({
10322
10342
  init_cn();
10323
10343
  init_StatBadge();
10324
10344
  positionMap = {
10325
- top: "top-0 left-0 right-0 flex justify-between items-start p-4",
10326
- bottom: "bottom-0 left-0 right-0 flex justify-between items-end p-4",
10327
10345
  corners: "inset-0 pointer-events-none"
10328
10346
  };
10329
10347
  DEFAULT_HUD_STATS = [
@@ -18941,7 +18959,8 @@ function asDescriptor(v) {
18941
18959
  if (typeof o.type !== "string") return null;
18942
18960
  const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
18943
18961
  const _id = typeof o._id === "string" ? o._id : void 0;
18944
- return { type: o.type, props, _id };
18962
+ const sourceTrait = typeof o.sourceTrait === "string" ? o.sourceTrait : void 0;
18963
+ return { type: o.type, props, _id, sourceTrait };
18945
18964
  }
18946
18965
  function getSlotContentRenderer3() {
18947
18966
  if (_scr2) return _scr2;
@@ -18960,7 +18979,13 @@ function resolveDescriptor2(value, idPrefix) {
18960
18979
  const desc = asDescriptor(value);
18961
18980
  if (desc !== null && getComponentForPattern(desc.type) !== null) {
18962
18981
  const resolvedProps = desc.props ?? {};
18963
- const content = { id: desc._id ?? idPrefix, pattern: desc.type, props: resolvedProps, priority: 0 };
18982
+ const content = {
18983
+ id: desc._id ?? idPrefix,
18984
+ pattern: desc.type,
18985
+ props: resolvedProps,
18986
+ priority: 0,
18987
+ ...desc.sourceTrait !== void 0 && { sourceTrait: desc.sourceTrait }
18988
+ };
18964
18989
  const SCR = getSlotContentRenderer3();
18965
18990
  return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 }, content.id);
18966
18991
  }
@@ -19000,30 +19025,35 @@ var init_GameShell = __esm({
19000
19025
  },
19001
19026
  children: [
19002
19027
  showTopBar && /* @__PURE__ */ jsxs(
19003
- HStack,
19028
+ Box,
19004
19029
  {
19005
- align: "center",
19006
- justify: "between",
19007
19030
  className: "game-shell__header",
19008
19031
  style: {
19009
- padding: "0.5rem 1rem",
19010
- borderBottom: "1px solid var(--color-border, #2a2a3a)",
19032
+ flexShrink: 0,
19011
19033
  background: "var(--color-surface, #12121f)",
19012
- flexShrink: 0
19034
+ borderBottom: "1px solid var(--color-border, #2a2a3a)"
19013
19035
  },
19014
19036
  children: [
19015
19037
  /* @__PURE__ */ jsx(
19016
- Typography,
19038
+ HStack,
19017
19039
  {
19018
- variant: "h6",
19019
- style: {
19020
- fontWeight: 700,
19021
- letterSpacing: "0.02em"
19022
- },
19023
- children: appName
19040
+ align: "center",
19041
+ justify: "between",
19042
+ style: { padding: "0.375rem 1rem" },
19043
+ children: /* @__PURE__ */ jsx(
19044
+ Typography,
19045
+ {
19046
+ variant: "h6",
19047
+ style: {
19048
+ fontWeight: 700,
19049
+ letterSpacing: "0.02em"
19050
+ },
19051
+ children: appName
19052
+ }
19053
+ )
19024
19054
  }
19025
19055
  ),
19026
- hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", children: resolveDescriptor2(hud, "gs-hud") })
19056
+ hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", style: { width: "100%" }, children: resolveDescriptor2(hud, "gs-hud") })
19027
19057
  ]
19028
19058
  }
19029
19059
  ),
@@ -10864,7 +10864,7 @@ function GameHud({
10864
10864
  }) {
10865
10865
  const rawStats = propStats ?? items ?? (elements && Array.isArray(elements) ? convertElementsToStats(elements) : DEFAULT_HUD_STATS);
10866
10866
  const stats = Array.isArray(rawStats) ? rawStats : [];
10867
- const position = propPosition ?? "corners";
10867
+ const position = propPosition ?? "top";
10868
10868
  if (position === "corners") {
10869
10869
  const leftStats = stats.slice(0, Math.ceil(stats.length / 2));
10870
10870
  const rightStats = stats.slice(Math.ceil(stats.length / 2));
@@ -10873,17 +10873,37 @@ function GameHud({
10873
10873
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-4 right-4 flex flex-col gap-2 items-end pointer-events-auto", children: rightStats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) })
10874
10874
  ] });
10875
10875
  }
10876
+ if (position === "top" || position === "bottom") {
10877
+ const mid = Math.ceil(stats.length / 2);
10878
+ const leftStats = stats.slice(0, mid);
10879
+ const rightStats = stats.slice(mid);
10880
+ const isTop = position === "top";
10881
+ return /* @__PURE__ */ jsxRuntime.jsxs(
10882
+ "div",
10883
+ {
10884
+ className: cn(
10885
+ "flex items-center justify-between w-full",
10886
+ "px-4 py-2 gap-4",
10887
+ !transparent && (isTop ? "border-b border-border/40 bg-surface/90 backdrop-blur-sm" : "border-t border-border/40 bg-surface/90 backdrop-blur-sm"),
10888
+ transparent && (isTop ? "border-b border-white/10 bg-black/40 backdrop-blur-sm" : "border-t border-white/10 bg-black/40 backdrop-blur-sm"),
10889
+ className
10890
+ ),
10891
+ children: [
10892
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 flex-shrink-0", children: leftStats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) }),
10893
+ rightStats.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 flex-shrink-0", children: rightStats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) })
10894
+ ]
10895
+ }
10896
+ );
10897
+ }
10876
10898
  return /* @__PURE__ */ jsxRuntime.jsx(
10877
10899
  "div",
10878
10900
  {
10879
10901
  className: cn(
10880
- "relative z-10",
10881
- positionMap[position],
10882
- transparent && "bg-gradient-to-b from-background/50 to-transparent",
10883
- position === "bottom" && "bg-gradient-to-t from-background/50 to-transparent",
10902
+ "relative z-10 flex items-center gap-4 px-4 py-2",
10903
+ transparent ? "bg-black/30 backdrop-blur-sm" : "bg-surface/90 backdrop-blur-sm",
10884
10904
  className
10885
10905
  ),
10886
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-4", children: stats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) })
10906
+ children: stats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i))
10887
10907
  }
10888
10908
  );
10889
10909
  }
@@ -10893,8 +10913,6 @@ var init_GameHud = __esm({
10893
10913
  init_cn();
10894
10914
  init_StatBadge();
10895
10915
  positionMap = {
10896
- top: "top-0 left-0 right-0 flex justify-between items-start p-4",
10897
- bottom: "bottom-0 left-0 right-0 flex justify-between items-end p-4",
10898
10916
  corners: "inset-0 pointer-events-none"
10899
10917
  };
10900
10918
  DEFAULT_HUD_STATS = [
@@ -19333,7 +19351,8 @@ function asDescriptor(v) {
19333
19351
  if (typeof o.type !== "string") return null;
19334
19352
  const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
19335
19353
  const _id = typeof o._id === "string" ? o._id : void 0;
19336
- return { type: o.type, props, _id };
19354
+ const sourceTrait = typeof o.sourceTrait === "string" ? o.sourceTrait : void 0;
19355
+ return { type: o.type, props, _id, sourceTrait };
19337
19356
  }
19338
19357
  function getSlotContentRenderer3() {
19339
19358
  if (_scr2) return _scr2;
@@ -19352,7 +19371,13 @@ function resolveDescriptor2(value, idPrefix) {
19352
19371
  const desc = asDescriptor(value);
19353
19372
  if (desc !== null && patterns.getComponentForPattern(desc.type) !== null) {
19354
19373
  const resolvedProps = desc.props ?? {};
19355
- const content = { id: desc._id ?? idPrefix, pattern: desc.type, props: resolvedProps, priority: 0 };
19374
+ const content = {
19375
+ id: desc._id ?? idPrefix,
19376
+ pattern: desc.type,
19377
+ props: resolvedProps,
19378
+ priority: 0,
19379
+ ...desc.sourceTrait !== void 0 && { sourceTrait: desc.sourceTrait }
19380
+ };
19356
19381
  const SCR = getSlotContentRenderer3();
19357
19382
  return /* @__PURE__ */ jsxRuntime.jsx(SCR, { content, onDismiss: () => void 0 }, content.id);
19358
19383
  }
@@ -19392,30 +19417,35 @@ var init_GameShell = __esm({
19392
19417
  },
19393
19418
  children: [
19394
19419
  showTopBar && /* @__PURE__ */ jsxRuntime.jsxs(
19395
- HStack,
19420
+ Box,
19396
19421
  {
19397
- align: "center",
19398
- justify: "between",
19399
19422
  className: "game-shell__header",
19400
19423
  style: {
19401
- padding: "0.5rem 1rem",
19402
- borderBottom: "1px solid var(--color-border, #2a2a3a)",
19424
+ flexShrink: 0,
19403
19425
  background: "var(--color-surface, #12121f)",
19404
- flexShrink: 0
19426
+ borderBottom: "1px solid var(--color-border, #2a2a3a)"
19405
19427
  },
19406
19428
  children: [
19407
19429
  /* @__PURE__ */ jsxRuntime.jsx(
19408
- Typography,
19430
+ HStack,
19409
19431
  {
19410
- variant: "h6",
19411
- style: {
19412
- fontWeight: 700,
19413
- letterSpacing: "0.02em"
19414
- },
19415
- children: appName
19432
+ align: "center",
19433
+ justify: "between",
19434
+ style: { padding: "0.375rem 1rem" },
19435
+ children: /* @__PURE__ */ jsxRuntime.jsx(
19436
+ Typography,
19437
+ {
19438
+ variant: "h6",
19439
+ style: {
19440
+ fontWeight: 700,
19441
+ letterSpacing: "0.02em"
19442
+ },
19443
+ children: appName
19444
+ }
19445
+ )
19416
19446
  }
19417
19447
  ),
19418
- hud && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "game-shell__hud", children: resolveDescriptor2(hud, "gs-hud") })
19448
+ hud && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "game-shell__hud", style: { width: "100%" }, children: resolveDescriptor2(hud, "gs-hud") })
19419
19449
  ]
19420
19450
  }
19421
19451
  ),
@@ -10819,7 +10819,7 @@ function GameHud({
10819
10819
  }) {
10820
10820
  const rawStats = propStats ?? items ?? (elements && Array.isArray(elements) ? convertElementsToStats(elements) : DEFAULT_HUD_STATS);
10821
10821
  const stats = Array.isArray(rawStats) ? rawStats : [];
10822
- const position = propPosition ?? "corners";
10822
+ const position = propPosition ?? "top";
10823
10823
  if (position === "corners") {
10824
10824
  const leftStats = stats.slice(0, Math.ceil(stats.length / 2));
10825
10825
  const rightStats = stats.slice(Math.ceil(stats.length / 2));
@@ -10828,17 +10828,37 @@ function GameHud({
10828
10828
  /* @__PURE__ */ jsx("div", { className: "absolute top-4 right-4 flex flex-col gap-2 items-end pointer-events-auto", children: rightStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) })
10829
10829
  ] });
10830
10830
  }
10831
+ if (position === "top" || position === "bottom") {
10832
+ const mid = Math.ceil(stats.length / 2);
10833
+ const leftStats = stats.slice(0, mid);
10834
+ const rightStats = stats.slice(mid);
10835
+ const isTop = position === "top";
10836
+ return /* @__PURE__ */ jsxs(
10837
+ "div",
10838
+ {
10839
+ className: cn(
10840
+ "flex items-center justify-between w-full",
10841
+ "px-4 py-2 gap-4",
10842
+ !transparent && (isTop ? "border-b border-border/40 bg-surface/90 backdrop-blur-sm" : "border-t border-border/40 bg-surface/90 backdrop-blur-sm"),
10843
+ transparent && (isTop ? "border-b border-white/10 bg-black/40 backdrop-blur-sm" : "border-t border-white/10 bg-black/40 backdrop-blur-sm"),
10844
+ className
10845
+ ),
10846
+ children: [
10847
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 flex-shrink-0", children: leftStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) }),
10848
+ rightStats.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 flex-shrink-0", children: rightStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) })
10849
+ ]
10850
+ }
10851
+ );
10852
+ }
10831
10853
  return /* @__PURE__ */ jsx(
10832
10854
  "div",
10833
10855
  {
10834
10856
  className: cn(
10835
- "relative z-10",
10836
- positionMap[position],
10837
- transparent && "bg-gradient-to-b from-background/50 to-transparent",
10838
- position === "bottom" && "bg-gradient-to-t from-background/50 to-transparent",
10857
+ "relative z-10 flex items-center gap-4 px-4 py-2",
10858
+ transparent ? "bg-black/30 backdrop-blur-sm" : "bg-surface/90 backdrop-blur-sm",
10839
10859
  className
10840
10860
  ),
10841
- children: /* @__PURE__ */ jsx("div", { className: "flex gap-4", children: stats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) })
10861
+ children: stats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i))
10842
10862
  }
10843
10863
  );
10844
10864
  }
@@ -10848,8 +10868,6 @@ var init_GameHud = __esm({
10848
10868
  init_cn();
10849
10869
  init_StatBadge();
10850
10870
  positionMap = {
10851
- top: "top-0 left-0 right-0 flex justify-between items-start p-4",
10852
- bottom: "bottom-0 left-0 right-0 flex justify-between items-end p-4",
10853
10871
  corners: "inset-0 pointer-events-none"
10854
10872
  };
10855
10873
  DEFAULT_HUD_STATS = [
@@ -19288,7 +19306,8 @@ function asDescriptor(v) {
19288
19306
  if (typeof o.type !== "string") return null;
19289
19307
  const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
19290
19308
  const _id = typeof o._id === "string" ? o._id : void 0;
19291
- return { type: o.type, props, _id };
19309
+ const sourceTrait = typeof o.sourceTrait === "string" ? o.sourceTrait : void 0;
19310
+ return { type: o.type, props, _id, sourceTrait };
19292
19311
  }
19293
19312
  function getSlotContentRenderer3() {
19294
19313
  if (_scr2) return _scr2;
@@ -19307,7 +19326,13 @@ function resolveDescriptor2(value, idPrefix) {
19307
19326
  const desc = asDescriptor(value);
19308
19327
  if (desc !== null && getComponentForPattern(desc.type) !== null) {
19309
19328
  const resolvedProps = desc.props ?? {};
19310
- const content = { id: desc._id ?? idPrefix, pattern: desc.type, props: resolvedProps, priority: 0 };
19329
+ const content = {
19330
+ id: desc._id ?? idPrefix,
19331
+ pattern: desc.type,
19332
+ props: resolvedProps,
19333
+ priority: 0,
19334
+ ...desc.sourceTrait !== void 0 && { sourceTrait: desc.sourceTrait }
19335
+ };
19311
19336
  const SCR = getSlotContentRenderer3();
19312
19337
  return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 }, content.id);
19313
19338
  }
@@ -19347,30 +19372,35 @@ var init_GameShell = __esm({
19347
19372
  },
19348
19373
  children: [
19349
19374
  showTopBar && /* @__PURE__ */ jsxs(
19350
- HStack,
19375
+ Box,
19351
19376
  {
19352
- align: "center",
19353
- justify: "between",
19354
19377
  className: "game-shell__header",
19355
19378
  style: {
19356
- padding: "0.5rem 1rem",
19357
- borderBottom: "1px solid var(--color-border, #2a2a3a)",
19379
+ flexShrink: 0,
19358
19380
  background: "var(--color-surface, #12121f)",
19359
- flexShrink: 0
19381
+ borderBottom: "1px solid var(--color-border, #2a2a3a)"
19360
19382
  },
19361
19383
  children: [
19362
19384
  /* @__PURE__ */ jsx(
19363
- Typography,
19385
+ HStack,
19364
19386
  {
19365
- variant: "h6",
19366
- style: {
19367
- fontWeight: 700,
19368
- letterSpacing: "0.02em"
19369
- },
19370
- children: appName
19387
+ align: "center",
19388
+ justify: "between",
19389
+ style: { padding: "0.375rem 1rem" },
19390
+ children: /* @__PURE__ */ jsx(
19391
+ Typography,
19392
+ {
19393
+ variant: "h6",
19394
+ style: {
19395
+ fontWeight: 700,
19396
+ letterSpacing: "0.02em"
19397
+ },
19398
+ children: appName
19399
+ }
19400
+ )
19371
19401
  }
19372
19402
  ),
19373
- hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", children: resolveDescriptor2(hud, "gs-hud") })
19403
+ hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", style: { width: "100%" }, children: resolveDescriptor2(hud, "gs-hud") })
19374
19404
  ]
19375
19405
  }
19376
19406
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "5.79.0",
3
+ "version": "5.79.2",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [