@almadar/ui 5.125.0 → 5.127.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18511,6 +18511,32 @@ var init_ButtonGroup = __esm({
18511
18511
  ButtonGroup.displayName = "ButtonGroup";
18512
18512
  }
18513
18513
  });
18514
+
18515
+ // lib/getNestedValue.ts
18516
+ function getNestedValue(obj, path) {
18517
+ if (obj === null || obj === void 0 || !path) {
18518
+ return void 0;
18519
+ }
18520
+ if (!path.includes(".")) {
18521
+ return obj[path];
18522
+ }
18523
+ const parts = path.split(".");
18524
+ let value = obj;
18525
+ for (const part of parts) {
18526
+ if (value === null || value === void 0) {
18527
+ return void 0;
18528
+ }
18529
+ if (typeof value !== "object" || Array.isArray(value)) {
18530
+ return void 0;
18531
+ }
18532
+ value = value[part];
18533
+ }
18534
+ return value;
18535
+ }
18536
+ var init_getNestedValue = __esm({
18537
+ "lib/getNestedValue.ts"() {
18538
+ }
18539
+ });
18514
18540
  function dayWindowForViewport(width) {
18515
18541
  if (width <= 640) return 1;
18516
18542
  if (width <= 1024) return 3;
@@ -18557,17 +18583,31 @@ function getWeekDays(start) {
18557
18583
  }
18558
18584
  return days;
18559
18585
  }
18560
- function generateDefaultTimeSlots() {
18586
+ function eventStartDate(event, startField) {
18587
+ const raw = getNestedValue(event, startField);
18588
+ return new Date(raw ?? "");
18589
+ }
18590
+ function generateDefaultTimeSlots(events2, startField) {
18591
+ let first = DEFAULT_FIRST_HOUR;
18592
+ let last = DEFAULT_LAST_HOUR;
18593
+ for (const ev of events2) {
18594
+ const start = eventStartDate(ev, startField);
18595
+ if (Number.isNaN(start.getTime())) continue;
18596
+ const hour = start.getHours();
18597
+ if (hour < first) first = hour;
18598
+ if (hour > last) last = hour;
18599
+ }
18561
18600
  const slots = [];
18562
- for (let hour = 9; hour <= 17; hour++) {
18563
- slots.push(`${hour.toString().padStart(2, "0")}:00`);
18601
+ for (let hour = first; hour <= last; hour++) {
18602
+ slots.push(slotLabel(hour));
18564
18603
  }
18565
18604
  return slots;
18566
18605
  }
18567
- function eventInSlot(event, day, slotTime) {
18568
- const eventStart = new Date(event.startTime);
18569
- const [slotHour, slotMinute] = slotTime.split(":").map(Number);
18570
- return eventStart.toDateString() === day.toDateString() && eventStart.getHours() === slotHour && eventStart.getMinutes() === slotMinute;
18606
+ function eventInSlot(event, day, slotTime, startField) {
18607
+ const eventStart = eventStartDate(event, startField);
18608
+ if (Number.isNaN(eventStart.getTime())) return false;
18609
+ const [slotHour] = slotTime.split(":").map(Number);
18610
+ return eventStart.toDateString() === day.toDateString() && eventStart.getHours() === slotHour;
18571
18611
  }
18572
18612
  function CalendarGrid({
18573
18613
  weekStart,
@@ -18581,7 +18621,12 @@ function CalendarGrid({
18581
18621
  longPressPayload,
18582
18622
  swipeLeftEvent,
18583
18623
  swipeRightEvent,
18584
- dayWindow = "auto"
18624
+ dayWindow = "auto",
18625
+ titleField = "title",
18626
+ startField = "startTime",
18627
+ colorField = "color",
18628
+ children,
18629
+ renderItem
18585
18630
  }) {
18586
18631
  const evs = Array.isArray(events2) ? events2 : events2 ? [events2] : [];
18587
18632
  const eventBus = useEventBus();
@@ -18596,8 +18641,8 @@ function CalendarGrid({
18596
18641
  [resolvedWeekStart]
18597
18642
  );
18598
18643
  const resolvedTimeSlots = React82.useMemo(
18599
- () => timeSlots ?? generateDefaultTimeSlots(),
18600
- [timeSlots]
18644
+ () => timeSlots ?? generateDefaultTimeSlots(evs, startField),
18645
+ [timeSlots, evs, startField]
18601
18646
  );
18602
18647
  const visibleCount = useDayWindow(dayWindow);
18603
18648
  const [dayOffset, setDayOffset] = React82.useState(0);
@@ -18634,9 +18679,9 @@ function CalendarGrid({
18634
18679
  );
18635
18680
  const eventsForDayCount = React82.useCallback(
18636
18681
  (day) => evs.filter(
18637
- (ev) => new Date(ev.startTime).toDateString() === day.toDateString()
18682
+ (ev) => eventStartDate(ev, startField).toDateString() === day.toDateString()
18638
18683
  ).length,
18639
- [events2]
18684
+ [events2, startField]
18640
18685
  );
18641
18686
  const swipeCallbacks = React82.useMemo(() => ({
18642
18687
  onSwipeLeft: swipeLeftEvent ? () => eventBus.emit(`UI:${swipeLeftEvent}`, {}) : void 0,
@@ -18655,8 +18700,11 @@ function CalendarGrid({
18655
18700
  eventBus.emit(`UI:${longPressEvent}`, { date: day.toISOString(), time, ...longPressPayload });
18656
18701
  }, 500);
18657
18702
  }, [longPressEvent, longPressPayload, eventBus]);
18703
+ const renderChip = children ?? renderItem;
18658
18704
  const renderEvent = (event) => {
18659
- const color = event.color;
18705
+ const color = getNestedValue(event, colorField);
18706
+ const label = String(getNestedValue(event, titleField) ?? "");
18707
+ const eventIndex = evs.indexOf(event);
18660
18708
  return /* @__PURE__ */ jsxRuntime.jsx(
18661
18709
  Box,
18662
18710
  {
@@ -18668,7 +18716,7 @@ function CalendarGrid({
18668
18716
  color ? color : "bg-primary/10 border-primary/30 text-primary"
18669
18717
  ),
18670
18718
  onClick: (e) => handleEventClick(event, e),
18671
- children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "truncate font-medium", children: event.title })
18719
+ children: renderChip ? renderChip(event, eventIndex) : /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "truncate font-medium", children: label })
18672
18720
  },
18673
18721
  event.id
18674
18722
  );
@@ -18752,7 +18800,7 @@ function CalendarGrid({
18752
18800
  ) }),
18753
18801
  visibleDays.map((day) => {
18754
18802
  const slotEvents = evs.filter(
18755
- (ev) => eventInSlot(ev, day, time)
18803
+ (ev) => eventInSlot(ev, day, time, startField)
18756
18804
  );
18757
18805
  const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
18758
18806
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -18784,11 +18832,12 @@ function CalendarGrid({
18784
18832
  }
18785
18833
  );
18786
18834
  }
18787
- var SHORT_DATE;
18835
+ var SHORT_DATE, DEFAULT_FIRST_HOUR, DEFAULT_LAST_HOUR, slotLabel;
18788
18836
  var init_CalendarGrid = __esm({
18789
18837
  "components/core/molecules/CalendarGrid.tsx"() {
18790
18838
  "use client";
18791
18839
  init_cn();
18840
+ init_getNestedValue();
18792
18841
  init_Box();
18793
18842
  init_Button();
18794
18843
  init_Stack();
@@ -18799,35 +18848,12 @@ var init_CalendarGrid = __esm({
18799
18848
  init_useEventBus();
18800
18849
  init_useSwipeGesture();
18801
18850
  SHORT_DATE = { month: "short", day: "numeric" };
18851
+ DEFAULT_FIRST_HOUR = 9;
18852
+ DEFAULT_LAST_HOUR = 17;
18853
+ slotLabel = (hour) => `${hour.toString().padStart(2, "0")}:00`;
18802
18854
  CalendarGrid.displayName = "CalendarGrid";
18803
18855
  }
18804
18856
  });
18805
-
18806
- // lib/getNestedValue.ts
18807
- function getNestedValue(obj, path) {
18808
- if (obj === null || obj === void 0 || !path) {
18809
- return void 0;
18810
- }
18811
- if (!path.includes(".")) {
18812
- return obj[path];
18813
- }
18814
- const parts = path.split(".");
18815
- let value = obj;
18816
- for (const part of parts) {
18817
- if (value === null || value === void 0) {
18818
- return void 0;
18819
- }
18820
- if (typeof value !== "object" || Array.isArray(value)) {
18821
- return void 0;
18822
- }
18823
- value = value[part];
18824
- }
18825
- return value;
18826
- }
18827
- var init_getNestedValue = __esm({
18828
- "lib/getNestedValue.ts"() {
18829
- }
18830
- });
18831
18857
  var Pagination;
18832
18858
  var init_Pagination = __esm({
18833
18859
  "components/core/molecules/Pagination.tsx"() {
@@ -43328,6 +43354,13 @@ function MaybeTraitScope({
43328
43354
  if (wrap) {
43329
43355
  return /* @__PURE__ */ jsxRuntime.jsx(providers.TraitScopeProvider, { orbital, trait: sourceTrait, children });
43330
43356
  }
43357
+ if (sourceTrait !== void 0 && schemaCtx !== null) {
43358
+ scopeWrapLog.warn("decline", {
43359
+ sourceTrait,
43360
+ orbitalsByTraitSize: schemaCtx.orbitalsByTrait.size,
43361
+ reason: "sourceTrait not in orbitalsByTrait \u2014 children render unscoped"
43362
+ });
43363
+ }
43331
43364
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
43332
43365
  }
43333
43366
  function UISlotComponent({
@@ -43625,7 +43658,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
43625
43658
  const childId = `${parentId}-${index}`;
43626
43659
  const childPath = parentPath === "root" ? `root.children.${index}` : `${parentPath}.children.${index}`;
43627
43660
  const childAsRecord = child;
43628
- const { type: _childType, props: nestedProps, _id: _childNodeId, children: _childChildren, ...flatProps } = childAsRecord;
43661
+ const { type: _childType, props: nestedProps, _id: _childNodeId, _sourceTrait: childSourceTrait, children: _childChildren, ...flatProps } = childAsRecord;
43629
43662
  const resolvedProps = nestedProps !== void 0 ? nestedProps : flatProps;
43630
43663
  if (_childChildren !== void 0 && nestedProps === void 0) {
43631
43664
  resolvedProps.children = _childChildren;
@@ -43640,11 +43673,14 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
43640
43673
  // (e.g. form-section inside a stack) can resolve entityDef via
43641
43674
  // the trait's linkedEntity for form-field enrichment. The orbCtx
43642
43675
  // (slot/transition/state/entity) propagates the same way so every
43643
- // nested node carries a complete contextual-edit address.
43644
- ...sourceTrait !== void 0 && { sourceTrait },
43676
+ // nested node carries a complete contextual-edit address. A child
43677
+ // carrying its own `_sourceTrait` (multi-source slot stack) owns it
43678
+ // outright — inheriting the synthetic wrapper's sentinel instead
43679
+ // would erase the real owner.
43680
+ ...childSourceTrait !== void 0 ? { sourceTrait: childSourceTrait } : sourceTrait !== void 0 && { sourceTrait },
43645
43681
  ...orbCtx ?? {}
43646
43682
  };
43647
- return /* @__PURE__ */ jsxRuntime.jsx(
43683
+ const renderedChild = /* @__PURE__ */ jsxRuntime.jsx(
43648
43684
  SlotContentRenderer,
43649
43685
  {
43650
43686
  content: childContent,
@@ -43653,6 +43689,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
43653
43689
  },
43654
43690
  childId
43655
43691
  );
43692
+ return childSourceTrait !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(MaybeTraitScope, { sourceTrait: childSourceTrait, children: renderedChild }, childId) : renderedChild;
43656
43693
  });
43657
43694
  }
43658
43695
  function toDrawableNodes(children) {
@@ -45386,7 +45423,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
45386
45423
  crossTraitLog.debug("listen:fired", { busKey, targetTrait: binding.trait.name, triggers: listen.triggers });
45387
45424
  enqueueAndDrain(
45388
45425
  listen.triggers,
45389
- core.applyListenPayloadMapping(listen.payloadMapping, event.payload),
45426
+ core.applyListenPayloadMapping(listen.payloadMapping, event.payload, evaluator.evaluateListenPayloadExpr),
45390
45427
  binding.trait.name
45391
45428
  );
45392
45429
  });
@@ -11,7 +11,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
11
11
  import { createPortal } from 'react-dom';
12
12
  import { useTranslate } from '@almadar/ui/hooks';
13
13
  import { useUISlots, UISlotProvider, useTheme } from '@almadar/ui/context';
14
- import { evaluateGuard, evaluate, createMinimalContext, executeEffects } from '@almadar/evaluator';
14
+ import { evaluateGuard, evaluateListenPayloadExpr, evaluate, createMinimalContext, executeEffects } from '@almadar/evaluator';
15
15
  import { wrapCallbackForEvent, prepareSchemaForPreview, perfStore, pushPerfEntry, collectTraitRefsFromResolvedTrait, buildOrbitalsByTrait, collectEmbeddedTraits } from '@almadar/runtime/ui';
16
16
  export { PERF_NAMESPACE, adjustSchemaForMockData, buildMockData, clearPerf, perfEnd, perfStart, perfTime, prepareSchemaForPreview, wrapCallbackForEvent } from '@almadar/runtime/ui';
17
17
  import { Link, Outlet, useLocation } from 'react-router-dom';
@@ -18437,6 +18437,32 @@ var init_ButtonGroup = __esm({
18437
18437
  ButtonGroup.displayName = "ButtonGroup";
18438
18438
  }
18439
18439
  });
18440
+
18441
+ // lib/getNestedValue.ts
18442
+ function getNestedValue(obj, path) {
18443
+ if (obj === null || obj === void 0 || !path) {
18444
+ return void 0;
18445
+ }
18446
+ if (!path.includes(".")) {
18447
+ return obj[path];
18448
+ }
18449
+ const parts = path.split(".");
18450
+ let value = obj;
18451
+ for (const part of parts) {
18452
+ if (value === null || value === void 0) {
18453
+ return void 0;
18454
+ }
18455
+ if (typeof value !== "object" || Array.isArray(value)) {
18456
+ return void 0;
18457
+ }
18458
+ value = value[part];
18459
+ }
18460
+ return value;
18461
+ }
18462
+ var init_getNestedValue = __esm({
18463
+ "lib/getNestedValue.ts"() {
18464
+ }
18465
+ });
18440
18466
  function dayWindowForViewport(width) {
18441
18467
  if (width <= 640) return 1;
18442
18468
  if (width <= 1024) return 3;
@@ -18483,17 +18509,31 @@ function getWeekDays(start) {
18483
18509
  }
18484
18510
  return days;
18485
18511
  }
18486
- function generateDefaultTimeSlots() {
18512
+ function eventStartDate(event, startField) {
18513
+ const raw = getNestedValue(event, startField);
18514
+ return new Date(raw ?? "");
18515
+ }
18516
+ function generateDefaultTimeSlots(events2, startField) {
18517
+ let first = DEFAULT_FIRST_HOUR;
18518
+ let last = DEFAULT_LAST_HOUR;
18519
+ for (const ev of events2) {
18520
+ const start = eventStartDate(ev, startField);
18521
+ if (Number.isNaN(start.getTime())) continue;
18522
+ const hour = start.getHours();
18523
+ if (hour < first) first = hour;
18524
+ if (hour > last) last = hour;
18525
+ }
18487
18526
  const slots = [];
18488
- for (let hour = 9; hour <= 17; hour++) {
18489
- slots.push(`${hour.toString().padStart(2, "0")}:00`);
18527
+ for (let hour = first; hour <= last; hour++) {
18528
+ slots.push(slotLabel(hour));
18490
18529
  }
18491
18530
  return slots;
18492
18531
  }
18493
- function eventInSlot(event, day, slotTime) {
18494
- const eventStart = new Date(event.startTime);
18495
- const [slotHour, slotMinute] = slotTime.split(":").map(Number);
18496
- return eventStart.toDateString() === day.toDateString() && eventStart.getHours() === slotHour && eventStart.getMinutes() === slotMinute;
18532
+ function eventInSlot(event, day, slotTime, startField) {
18533
+ const eventStart = eventStartDate(event, startField);
18534
+ if (Number.isNaN(eventStart.getTime())) return false;
18535
+ const [slotHour] = slotTime.split(":").map(Number);
18536
+ return eventStart.toDateString() === day.toDateString() && eventStart.getHours() === slotHour;
18497
18537
  }
18498
18538
  function CalendarGrid({
18499
18539
  weekStart,
@@ -18507,7 +18547,12 @@ function CalendarGrid({
18507
18547
  longPressPayload,
18508
18548
  swipeLeftEvent,
18509
18549
  swipeRightEvent,
18510
- dayWindow = "auto"
18550
+ dayWindow = "auto",
18551
+ titleField = "title",
18552
+ startField = "startTime",
18553
+ colorField = "color",
18554
+ children,
18555
+ renderItem
18511
18556
  }) {
18512
18557
  const evs = Array.isArray(events2) ? events2 : events2 ? [events2] : [];
18513
18558
  const eventBus = useEventBus();
@@ -18522,8 +18567,8 @@ function CalendarGrid({
18522
18567
  [resolvedWeekStart]
18523
18568
  );
18524
18569
  const resolvedTimeSlots = useMemo(
18525
- () => timeSlots ?? generateDefaultTimeSlots(),
18526
- [timeSlots]
18570
+ () => timeSlots ?? generateDefaultTimeSlots(evs, startField),
18571
+ [timeSlots, evs, startField]
18527
18572
  );
18528
18573
  const visibleCount = useDayWindow(dayWindow);
18529
18574
  const [dayOffset, setDayOffset] = useState(0);
@@ -18560,9 +18605,9 @@ function CalendarGrid({
18560
18605
  );
18561
18606
  const eventsForDayCount = useCallback(
18562
18607
  (day) => evs.filter(
18563
- (ev) => new Date(ev.startTime).toDateString() === day.toDateString()
18608
+ (ev) => eventStartDate(ev, startField).toDateString() === day.toDateString()
18564
18609
  ).length,
18565
- [events2]
18610
+ [events2, startField]
18566
18611
  );
18567
18612
  const swipeCallbacks = useMemo(() => ({
18568
18613
  onSwipeLeft: swipeLeftEvent ? () => eventBus.emit(`UI:${swipeLeftEvent}`, {}) : void 0,
@@ -18581,8 +18626,11 @@ function CalendarGrid({
18581
18626
  eventBus.emit(`UI:${longPressEvent}`, { date: day.toISOString(), time, ...longPressPayload });
18582
18627
  }, 500);
18583
18628
  }, [longPressEvent, longPressPayload, eventBus]);
18629
+ const renderChip = children ?? renderItem;
18584
18630
  const renderEvent = (event) => {
18585
- const color = event.color;
18631
+ const color = getNestedValue(event, colorField);
18632
+ const label = String(getNestedValue(event, titleField) ?? "");
18633
+ const eventIndex = evs.indexOf(event);
18586
18634
  return /* @__PURE__ */ jsx(
18587
18635
  Box,
18588
18636
  {
@@ -18594,7 +18642,7 @@ function CalendarGrid({
18594
18642
  color ? color : "bg-primary/10 border-primary/30 text-primary"
18595
18643
  ),
18596
18644
  onClick: (e) => handleEventClick(event, e),
18597
- children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "truncate font-medium", children: event.title })
18645
+ children: renderChip ? renderChip(event, eventIndex) : /* @__PURE__ */ jsx(Typography, { variant: "small", className: "truncate font-medium", children: label })
18598
18646
  },
18599
18647
  event.id
18600
18648
  );
@@ -18678,7 +18726,7 @@ function CalendarGrid({
18678
18726
  ) }),
18679
18727
  visibleDays.map((day) => {
18680
18728
  const slotEvents = evs.filter(
18681
- (ev) => eventInSlot(ev, day, time)
18729
+ (ev) => eventInSlot(ev, day, time, startField)
18682
18730
  );
18683
18731
  const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
18684
18732
  return /* @__PURE__ */ jsx(
@@ -18710,11 +18758,12 @@ function CalendarGrid({
18710
18758
  }
18711
18759
  );
18712
18760
  }
18713
- var SHORT_DATE;
18761
+ var SHORT_DATE, DEFAULT_FIRST_HOUR, DEFAULT_LAST_HOUR, slotLabel;
18714
18762
  var init_CalendarGrid = __esm({
18715
18763
  "components/core/molecules/CalendarGrid.tsx"() {
18716
18764
  "use client";
18717
18765
  init_cn();
18766
+ init_getNestedValue();
18718
18767
  init_Box();
18719
18768
  init_Button();
18720
18769
  init_Stack();
@@ -18725,35 +18774,12 @@ var init_CalendarGrid = __esm({
18725
18774
  init_useEventBus();
18726
18775
  init_useSwipeGesture();
18727
18776
  SHORT_DATE = { month: "short", day: "numeric" };
18777
+ DEFAULT_FIRST_HOUR = 9;
18778
+ DEFAULT_LAST_HOUR = 17;
18779
+ slotLabel = (hour) => `${hour.toString().padStart(2, "0")}:00`;
18728
18780
  CalendarGrid.displayName = "CalendarGrid";
18729
18781
  }
18730
18782
  });
18731
-
18732
- // lib/getNestedValue.ts
18733
- function getNestedValue(obj, path) {
18734
- if (obj === null || obj === void 0 || !path) {
18735
- return void 0;
18736
- }
18737
- if (!path.includes(".")) {
18738
- return obj[path];
18739
- }
18740
- const parts = path.split(".");
18741
- let value = obj;
18742
- for (const part of parts) {
18743
- if (value === null || value === void 0) {
18744
- return void 0;
18745
- }
18746
- if (typeof value !== "object" || Array.isArray(value)) {
18747
- return void 0;
18748
- }
18749
- value = value[part];
18750
- }
18751
- return value;
18752
- }
18753
- var init_getNestedValue = __esm({
18754
- "lib/getNestedValue.ts"() {
18755
- }
18756
- });
18757
18783
  var Pagination;
18758
18784
  var init_Pagination = __esm({
18759
18785
  "components/core/molecules/Pagination.tsx"() {
@@ -43254,6 +43280,13 @@ function MaybeTraitScope({
43254
43280
  if (wrap) {
43255
43281
  return /* @__PURE__ */ jsx(TraitScopeProvider, { orbital, trait: sourceTrait, children });
43256
43282
  }
43283
+ if (sourceTrait !== void 0 && schemaCtx !== null) {
43284
+ scopeWrapLog.warn("decline", {
43285
+ sourceTrait,
43286
+ orbitalsByTraitSize: schemaCtx.orbitalsByTrait.size,
43287
+ reason: "sourceTrait not in orbitalsByTrait \u2014 children render unscoped"
43288
+ });
43289
+ }
43257
43290
  return /* @__PURE__ */ jsx(Fragment, { children });
43258
43291
  }
43259
43292
  function UISlotComponent({
@@ -43551,7 +43584,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
43551
43584
  const childId = `${parentId}-${index}`;
43552
43585
  const childPath = parentPath === "root" ? `root.children.${index}` : `${parentPath}.children.${index}`;
43553
43586
  const childAsRecord = child;
43554
- const { type: _childType, props: nestedProps, _id: _childNodeId, children: _childChildren, ...flatProps } = childAsRecord;
43587
+ const { type: _childType, props: nestedProps, _id: _childNodeId, _sourceTrait: childSourceTrait, children: _childChildren, ...flatProps } = childAsRecord;
43555
43588
  const resolvedProps = nestedProps !== void 0 ? nestedProps : flatProps;
43556
43589
  if (_childChildren !== void 0 && nestedProps === void 0) {
43557
43590
  resolvedProps.children = _childChildren;
@@ -43566,11 +43599,14 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
43566
43599
  // (e.g. form-section inside a stack) can resolve entityDef via
43567
43600
  // the trait's linkedEntity for form-field enrichment. The orbCtx
43568
43601
  // (slot/transition/state/entity) propagates the same way so every
43569
- // nested node carries a complete contextual-edit address.
43570
- ...sourceTrait !== void 0 && { sourceTrait },
43602
+ // nested node carries a complete contextual-edit address. A child
43603
+ // carrying its own `_sourceTrait` (multi-source slot stack) owns it
43604
+ // outright — inheriting the synthetic wrapper's sentinel instead
43605
+ // would erase the real owner.
43606
+ ...childSourceTrait !== void 0 ? { sourceTrait: childSourceTrait } : sourceTrait !== void 0 && { sourceTrait },
43571
43607
  ...orbCtx ?? {}
43572
43608
  };
43573
- return /* @__PURE__ */ jsx(
43609
+ const renderedChild = /* @__PURE__ */ jsx(
43574
43610
  SlotContentRenderer,
43575
43611
  {
43576
43612
  content: childContent,
@@ -43579,6 +43615,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
43579
43615
  },
43580
43616
  childId
43581
43617
  );
43618
+ return childSourceTrait !== void 0 ? /* @__PURE__ */ jsx(MaybeTraitScope, { sourceTrait: childSourceTrait, children: renderedChild }, childId) : renderedChild;
43582
43619
  });
43583
43620
  }
43584
43621
  function toDrawableNodes(children) {
@@ -45312,7 +45349,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
45312
45349
  crossTraitLog.debug("listen:fired", { busKey, targetTrait: binding.trait.name, triggers: listen.triggers });
45313
45350
  enqueueAndDrain(
45314
45351
  listen.triggers,
45315
- applyListenPayloadMapping(listen.payloadMapping, event.payload),
45352
+ applyListenPayloadMapping(listen.payloadMapping, event.payload, evaluateListenPayloadExpr),
45316
45353
  binding.trait.name
45317
45354
  );
45318
45355
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "5.125.0",
3
+ "version": "5.127.0",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -117,11 +117,11 @@
117
117
  "access": "public"
118
118
  },
119
119
  "dependencies": {
120
- "@almadar/core": "^10.34.0",
121
- "@almadar/evaluator": "^2.35.0",
120
+ "@almadar/core": "^10.35.0",
121
+ "@almadar/evaluator": "^2.36.0",
122
122
  "@almadar/logger": "^1.10.0",
123
- "@almadar/runtime": "^6.37.0",
124
- "@almadar/std": "^16.144.0",
123
+ "@almadar/runtime": "^6.38.0",
124
+ "@almadar/std": "^16.145.0",
125
125
  "@almadar/syntax": "^1.12.0",
126
126
  "@dnd-kit/core": "^6.3.1",
127
127
  "@dnd-kit/sortable": "^10.0.0",
@@ -231,7 +231,7 @@
231
231
  "@almadar/core": "$@almadar/core"
232
232
  },
233
233
  "scripts": {
234
- "build": "NODE_OPTIONS=--max-old-space-size=8192 tsup",
234
+ "build": "rm -rf dist && NODE_OPTIONS=--max-old-space-size=8192 tsup",
235
235
  "build:watch": "tsup --watch",
236
236
  "typecheck": "tsc --noEmit",
237
237
  "lint": "eslint --no-warn-ignored --max-warnings 0 .",