@omerdlw/base-framework 3.2.1 → 3.3.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.
Files changed (153) hide show
  1. package/MIGRATION.md +24 -0
  2. package/dist/ambient/index.js +8 -8
  3. package/dist/ambient/server/index.js +2 -2
  4. package/dist/ambient/worker/index.js +1 -1
  5. package/dist/background/index.js +7 -7
  6. package/dist/{chunk-GQKGOLHJ.js → chunk-67MOKJFZ.js} +178 -79
  7. package/dist/chunk-67MOKJFZ.js.map +1 -0
  8. package/dist/{chunk-2BLGNT5I.js → chunk-6IP6YFQX.js} +6 -6
  9. package/dist/{chunk-2BLGNT5I.js.map → chunk-6IP6YFQX.js.map} +1 -1
  10. package/dist/{chunk-CT4UILO2.js → chunk-7VU2OAJB.js} +4 -77
  11. package/dist/chunk-7VU2OAJB.js.map +1 -0
  12. package/dist/{chunk-5H6FZW3N.js → chunk-D222OCTV.js} +15 -9
  13. package/dist/chunk-D222OCTV.js.map +1 -0
  14. package/dist/{chunk-2LGI33JP.js → chunk-GKAJ4EM2.js} +169 -73
  15. package/dist/chunk-GKAJ4EM2.js.map +1 -0
  16. package/dist/{chunk-66MHDFNF.js → chunk-HFR6YROB.js} +9 -16
  17. package/dist/chunk-HFR6YROB.js.map +1 -0
  18. package/dist/{chunk-ZE6OGGA7.js → chunk-IH3STE7W.js} +120 -49
  19. package/dist/chunk-IH3STE7W.js.map +1 -0
  20. package/dist/chunk-K3LXE6D5.js +17 -0
  21. package/dist/{chunk-IR3DCLBM.js.map → chunk-K3LXE6D5.js.map} +1 -1
  22. package/dist/{chunk-NTUQYA73.js → chunk-KOYTJW5E.js} +60 -9
  23. package/dist/chunk-KOYTJW5E.js.map +1 -0
  24. package/dist/{chunk-WYVA6AN5.js → chunk-LKYW4LH6.js} +5 -5
  25. package/dist/{chunk-WYVA6AN5.js.map → chunk-LKYW4LH6.js.map} +1 -1
  26. package/dist/{chunk-PUD4IB3L.js → chunk-NCXFWCXP.js} +497 -366
  27. package/dist/chunk-NCXFWCXP.js.map +1 -0
  28. package/dist/{chunk-J4WUCHNR.js → chunk-QRXDXAQI.js} +5 -5
  29. package/dist/{chunk-J4WUCHNR.js.map → chunk-QRXDXAQI.js.map} +1 -1
  30. package/dist/{chunk-AAT3QWHN.js → chunk-R4K6VAOK.js} +4 -4
  31. package/dist/{chunk-AAT3QWHN.js.map → chunk-R4K6VAOK.js.map} +1 -1
  32. package/dist/{chunk-OEXWOZPS.js → chunk-RGC2VFQO.js} +6 -6
  33. package/dist/chunk-RGC2VFQO.js.map +1 -0
  34. package/dist/chunk-TAWTGCWJ.js +113 -0
  35. package/dist/chunk-TAWTGCWJ.js.map +1 -0
  36. package/dist/{chunk-LTO77WSO.js → chunk-UDJ7ARCH.js} +3 -3
  37. package/dist/{chunk-LTO77WSO.js.map → chunk-UDJ7ARCH.js.map} +1 -1
  38. package/dist/{chunk-26K6W4OQ.js → chunk-UE2KBW3D.js} +7 -7
  39. package/dist/{chunk-26K6W4OQ.js.map → chunk-UE2KBW3D.js.map} +1 -1
  40. package/dist/{chunk-WBBM67WL.js → chunk-UQLTP3XB.js} +6 -6
  41. package/dist/{chunk-WBBM67WL.js.map → chunk-UQLTP3XB.js.map} +1 -1
  42. package/dist/{chunk-LA3CQ6NY.js → chunk-VNSMNGWP.js} +5 -5
  43. package/dist/{chunk-LA3CQ6NY.js.map → chunk-VNSMNGWP.js.map} +1 -1
  44. package/dist/{chunk-Y2Q74PJP.js → chunk-WQTMOUCA.js} +3 -3
  45. package/dist/{chunk-Y2Q74PJP.js.map → chunk-WQTMOUCA.js.map} +1 -1
  46. package/dist/chunk-WZ5T2NXH.js +702 -0
  47. package/dist/chunk-WZ5T2NXH.js.map +1 -0
  48. package/dist/{chunk-RF2YGILF.js → chunk-XGAYTDSI.js} +37 -37
  49. package/dist/chunk-XGAYTDSI.js.map +1 -0
  50. package/dist/{chunk-KMN6J5SL.js → chunk-YZS2B6YE.js} +6 -6
  51. package/dist/{chunk-KMN6J5SL.js.map → chunk-YZS2B6YE.js.map} +1 -1
  52. package/dist/{chunk-5GVH4BQV.js → chunk-ZXRE2KZO.js} +5 -5
  53. package/dist/{chunk-5GVH4BQV.js.map → chunk-ZXRE2KZO.js.map} +1 -1
  54. package/dist/context-menu/index.js +13 -13
  55. package/dist/controls/index.js +4 -4
  56. package/dist/core/kernel/hooks.d.ts.map +1 -1
  57. package/dist/core/kernel/operations-records.d.ts +7 -0
  58. package/dist/core/kernel/operations-records.d.ts.map +1 -1
  59. package/dist/core/kernel/operations-resolve.d.ts.map +1 -1
  60. package/dist/core/kernel/operations.d.ts.map +1 -1
  61. package/dist/core/kernel/stabilize.d.ts.map +1 -1
  62. package/dist/core/provider/index.d.ts.map +1 -1
  63. package/dist/dock/index.js +12 -12
  64. package/dist/error/index.js +5 -5
  65. package/dist/foundation/recipes/cn.d.ts +3 -3
  66. package/dist/foundation/recipes/cn.d.ts.map +1 -1
  67. package/dist/foundation/recipes/define.d.ts +2 -3
  68. package/dist/foundation/recipes/define.d.ts.map +1 -1
  69. package/dist/foundation/recipes/recipe.d.ts +4 -4
  70. package/dist/foundation/recipes/recipe.d.ts.map +1 -1
  71. package/dist/foundation/utils/scheduler.d.ts +1 -1
  72. package/dist/foundation/utils/scheduler.d.ts.map +1 -1
  73. package/dist/hooks/index.js +2 -2
  74. package/dist/index.js +22 -22
  75. package/dist/kernel/index.js +3 -3
  76. package/dist/loading/index.js +6 -6
  77. package/dist/media/index.js +4 -4
  78. package/dist/modal/index.js +11 -11
  79. package/dist/modules/ambient/analyze-ground.d.ts +42 -0
  80. package/dist/modules/ambient/analyze-ground.d.ts.map +1 -0
  81. package/dist/modules/ambient/analyze.d.ts +1 -1
  82. package/dist/modules/ambient/analyze.d.ts.map +1 -1
  83. package/dist/modules/ambient/dom.d.ts.map +1 -1
  84. package/dist/modules/ambient/hooks.d.ts.map +1 -1
  85. package/dist/modules/ambient/settings.d.ts.map +1 -1
  86. package/dist/modules/ambient/types.d.ts +16 -4
  87. package/dist/modules/ambient/types.d.ts.map +1 -1
  88. package/dist/modules/background/context.d.ts.map +1 -1
  89. package/dist/modules/dock/hooks/use-card-item-model.d.ts +4 -4
  90. package/dist/modules/dock/hooks/use-dock-height-controller.d.ts +1 -1
  91. package/dist/modules/dock/hooks/use-dock-height-controller.d.ts.map +1 -1
  92. package/dist/modules/dock/hooks/use-dock-viewport.d.ts.map +1 -1
  93. package/dist/modules/dock/lib/helpers.d.ts +1 -1
  94. package/dist/modules/dock/lib/helpers.d.ts.map +1 -1
  95. package/dist/modules/dock/lib/styles.d.ts +2 -2
  96. package/dist/modules/dock/model/layout.d.ts +19 -4
  97. package/dist/modules/dock/model/layout.d.ts.map +1 -1
  98. package/dist/modules/dock/model/paths.d.ts +7 -0
  99. package/dist/modules/dock/model/paths.d.ts.map +1 -1
  100. package/dist/modules/dock/motion.d.ts +2 -2
  101. package/dist/modules/dock/routing/navigation.d.ts.map +1 -1
  102. package/dist/modules/dock/runtime/dock.d.ts.map +1 -1
  103. package/dist/modules/dock/runtime/hooks/use-dock.d.ts.map +1 -1
  104. package/dist/modules/dock/types/card.d.ts +6 -0
  105. package/dist/modules/dock/types/card.d.ts.map +1 -1
  106. package/dist/modules/dock/types/theme.d.ts +20 -0
  107. package/dist/modules/dock/types/theme.d.ts.map +1 -1
  108. package/dist/modules/index.js +20 -20
  109. package/dist/modules/modal/module.d.ts.map +1 -1
  110. package/dist/navigation/index.js +7 -7
  111. package/dist/notification/index.js +5 -5
  112. package/dist/overlay-7QLGWHCH.js +13 -0
  113. package/dist/{overlay-YC336DAS.js.map → overlay-7QLGWHCH.js.map} +1 -1
  114. package/dist/provider/index.js +9 -8
  115. package/dist/react/ui/components/tooltip-group.d.ts +34 -0
  116. package/dist/react/ui/components/tooltip-group.d.ts.map +1 -0
  117. package/dist/react/ui/components/tooltip-placement.d.ts +43 -0
  118. package/dist/react/ui/components/tooltip-placement.d.ts.map +1 -0
  119. package/dist/react/ui/components/tooltip-slot.d.ts +23 -0
  120. package/dist/react/ui/components/tooltip-slot.d.ts.map +1 -0
  121. package/dist/react/ui/components/tooltip.d.ts +9 -7
  122. package/dist/react/ui/components/tooltip.d.ts.map +1 -1
  123. package/dist/react/ui/types.d.ts +24 -3
  124. package/dist/react/ui/types.d.ts.map +1 -1
  125. package/dist/recipes/index.js +22 -3
  126. package/dist/recipes/index.js.map +1 -1
  127. package/dist/ui/index.js +8 -8
  128. package/dist/utils/index.js +13 -7
  129. package/dist/utils/index.js.map +1 -1
  130. package/docs/architecture-and-rules.md +0 -2
  131. package/docs/core-engine.md +2 -2
  132. package/docs/design.md +17 -17
  133. package/docs/getting-started.md +6 -7
  134. package/docs/modules/ambient.md +79 -58
  135. package/docs/modules/dock.md +15 -15
  136. package/docs/modules/modal.md +2 -2
  137. package/package.json +1 -4
  138. package/dist/chunk-2LGI33JP.js.map +0 -1
  139. package/dist/chunk-37OBXNEO.js +0 -116
  140. package/dist/chunk-37OBXNEO.js.map +0 -1
  141. package/dist/chunk-5H6FZW3N.js.map +0 -1
  142. package/dist/chunk-66MHDFNF.js.map +0 -1
  143. package/dist/chunk-7RSRDKYE.js +0 -22
  144. package/dist/chunk-7RSRDKYE.js.map +0 -1
  145. package/dist/chunk-CT4UILO2.js.map +0 -1
  146. package/dist/chunk-GQKGOLHJ.js.map +0 -1
  147. package/dist/chunk-IR3DCLBM.js +0 -17
  148. package/dist/chunk-NTUQYA73.js.map +0 -1
  149. package/dist/chunk-OEXWOZPS.js.map +0 -1
  150. package/dist/chunk-PUD4IB3L.js.map +0 -1
  151. package/dist/chunk-RF2YGILF.js.map +0 -1
  152. package/dist/chunk-ZE6OGGA7.js.map +0 -1
  153. package/dist/overlay-YC336DAS.js +0 -13
@@ -1,5 +1,5 @@
1
- import { useStore, useRequiredContext } from './chunk-Y2Q74PJP.js';
2
- import { createStore, report, trimToNull } from './chunk-5H6FZW3N.js';
1
+ import { useStore, useRequiredContext } from './chunk-WQTMOUCA.js';
2
+ import { createStore, report, trimToNull } from './chunk-D222OCTV.js';
3
3
  import { getOrCreateGlobalContext } from './chunk-J3VTDBC6.js';
4
4
  import { isObject, shallowEqual, isPlainObject } from './chunk-BMFHS3GV.js';
5
5
  import { c } from 'react/compiler-runtime';
@@ -149,26 +149,28 @@ function buildSourceRecord({
149
149
  scope
150
150
  };
151
151
  }
152
+ var SEP = "\0";
152
153
  function createRecordKey(source, instanceId = null, scope = DEFAULT_REGISTRY_SCOPE) {
154
+ const hasInstance = typeof instanceId === "string" && instanceId.length > 0;
153
155
  if (scope === DEFAULT_REGISTRY_SCOPE) {
154
- if (typeof instanceId === "string" && instanceId.length > 0) {
155
- return `instance:${JSON.stringify([source, instanceId])}`;
156
- }
157
- return `source:${JSON.stringify(source)}`;
158
- }
159
- if (typeof instanceId === "string" && instanceId.length > 0) {
160
- return `instance:${JSON.stringify([scope, source, instanceId])}`;
156
+ return hasInstance ? `i${SEP}${source}${SEP}${instanceId}` : `s${SEP}${source}`;
161
157
  }
162
- return `source:${JSON.stringify([scope, source])}`;
158
+ return hasInstance ? `I${SEP}${scope}${SEP}${source}${SEP}${instanceId}` : `S${SEP}${scope}${SEP}${source}`;
163
159
  }
164
160
  function getSourceRecords(entry, source, scope = null) {
165
161
  if (!entry) return [];
166
- return Object.entries(entry).map(([recordKey, rawRecord]) => ({
167
- recordKey,
168
- record: toSourceRecord(rawRecord, recordKey)
169
- })).filter(({
170
- record
171
- }) => record?.source === source && (scope === null || record.scope === scope));
162
+ const matches = [];
163
+ for (const recordKey in entry) {
164
+ if (!hasOwnProperty(entry, recordKey)) continue;
165
+ const record = toSourceRecord(entry[recordKey], recordKey);
166
+ if (record?.source === source && (scope === null || record.scope === scope)) {
167
+ matches.push({
168
+ recordKey,
169
+ record
170
+ });
171
+ }
172
+ }
173
+ return matches;
172
174
  }
173
175
  function getSourceRecord(entry, source, instanceId = null, scope = DEFAULT_REGISTRY_SCOPE) {
174
176
  const recordKey = createRecordKey(source, instanceId, scope);
@@ -181,8 +183,14 @@ function resolveRecordPriority(options, source) {
181
183
  }
182
184
  return REGISTRY_SOURCE_PRIORITY[source] ?? 0;
183
185
  }
186
+ function isNormalizedRecord(value) {
187
+ if (!isObject(value)) return false;
188
+ const record = value;
189
+ return typeof record.priority === "number" && Number.isFinite(record.priority) && typeof record.updatedAt === "number" && typeof record.sequence === "number" && typeof record.source === "string" && typeof record.scope === "string" && (record.instanceId === null || typeof record.instanceId === "string") && hasOwnProperty(record, "value");
190
+ }
184
191
  function toSourceRecord(rawValue, source = DEFAULT_SOURCE) {
185
192
  if (rawValue === void 0) return null;
193
+ if (isNormalizedRecord(rawValue)) return rawValue;
186
194
  const rawRecord = rawValue;
187
195
  const isWrappedRecord = isObject(rawValue) && hasOwnProperty(rawRecord, "value") && hasOwnProperty(rawRecord, "updatedAt") && hasOwnProperty(rawRecord, "priority") && hasOwnProperty(rawRecord, "source");
188
196
  if (isWrappedRecord) {
@@ -225,7 +233,13 @@ function hasRecordChanged(prevRecord, nextRecord) {
225
233
  return prevRecord.priority !== nextRecord.priority || prevRecord.source !== nextRecord.source || prevRecord.instanceId !== nextRecord.instanceId || prevRecord.scope !== nextRecord.scope || !recordsHaveSameValue(prevRecord, nextRecord);
226
234
  }
227
235
  function hasAnySourceRecord(entry) {
228
- return Object.values(entry || {}).some((rawRecord) => rawRecord !== void 0);
236
+ if (!entry) return false;
237
+ for (const recordKey in entry) {
238
+ if (hasOwnProperty(entry, recordKey) && entry[recordKey] !== void 0) {
239
+ return true;
240
+ }
241
+ }
242
+ return false;
229
243
  }
230
244
  function setSourceRecord(state, type, key, source, record) {
231
245
  const typeRegistry = state[type] || {};
@@ -296,11 +310,22 @@ function removeSourceRecord(state, type, key, source, instanceId = null, scope =
296
310
  // src/core/kernel/operations-resolve.ts
297
311
  function resolveEntryValueFor(definitions, type, entry, scope = null) {
298
312
  if (!entry) return void 0;
299
- const activeRecords = Object.entries(entry).map(([source, rawRecord]) => toSourceRecord(rawRecord, source)).filter((record) => record !== null && (scope === null || record.scope === scope));
313
+ const activeRecords = [];
314
+ for (const recordKey in entry) {
315
+ if (!Object.prototype.hasOwnProperty.call(entry, recordKey)) continue;
316
+ const record = toSourceRecord(entry[recordKey], recordKey);
317
+ if (record !== null && (scope === null || record.scope === scope)) {
318
+ activeRecords.push(record);
319
+ }
320
+ }
300
321
  if (activeRecords.length === 0) return void 0;
301
322
  const merge = definitions.get(type)?.merge;
323
+ if (activeRecords.length === 1) {
324
+ const [only] = activeRecords;
325
+ return merge && isObject(only.value) ? merge([only.value]) : only.value;
326
+ }
302
327
  if (merge) {
303
- const sortedRecords = [...activeRecords].sort(compareRecords);
328
+ const sortedRecords = activeRecords.sort(compareRecords);
304
329
  const mergeCandidate = sortedRecords.every((record) => isObject(record.value));
305
330
  if (mergeCandidate) {
306
331
  const values = sortedRecords.map((record) => record.value);
@@ -553,17 +578,61 @@ function hasOperationEffectFor(definitions, state, operation) {
553
578
  }
554
579
  return false;
555
580
  }
581
+ function writableEntry(draft, type, key) {
582
+ if (draft.state === draft.base) draft.state = {
583
+ ...draft.base
584
+ };
585
+ if (!draft.types.has(type)) {
586
+ draft.state[type] = {
587
+ ...draft.state[type] || {}
588
+ };
589
+ draft.types.add(type);
590
+ }
591
+ const registry = draft.state[type];
592
+ const id = `${type}\0${key}`;
593
+ let entry = registry[key];
594
+ if (!draft.entries.has(id) || !entry) {
595
+ entry = {
596
+ ...entry || {}
597
+ };
598
+ registry[key] = entry;
599
+ draft.entries.add(id);
600
+ }
601
+ return entry;
602
+ }
603
+ function applyOperationToDraft(draft, operation) {
604
+ if (operation.kind === "register") {
605
+ const entry2 = writableEntry(draft, operation.type, operation.key);
606
+ const recordKey = createRecordKey(operation.source, operation.record.instanceId, operation.record.scope);
607
+ entry2[recordKey] = operation.record;
608
+ return;
609
+ }
610
+ const current = draft.state[operation.type]?.[operation.key];
611
+ if (!current) return;
612
+ const records = findRecordsToRemove(current, operation.source, operation.instanceId, operation.scope);
613
+ if (records.length === 0) return;
614
+ const entry = writableEntry(draft, operation.type, operation.key);
615
+ for (const {
616
+ recordKey
617
+ } of records) delete entry[recordKey];
618
+ if (!hasAnySourceRecord(entry)) delete draft.state[operation.type][operation.key];
619
+ }
556
620
  function resolveEffectiveOperationsFor(definitions, state, operations) {
557
621
  const effectiveOperations = [];
558
- let nextState = state;
559
- operations.forEach((operation) => {
560
- if (!hasOperationEffectFor(definitions, nextState, operation)) return;
622
+ const draft = {
623
+ base: state,
624
+ entries: /* @__PURE__ */ new Set(),
625
+ state,
626
+ types: /* @__PURE__ */ new Set()
627
+ };
628
+ for (const operation of operations) {
629
+ if (!hasOperationEffectFor(definitions, draft.state, operation)) continue;
561
630
  effectiveOperations.push(operation);
562
- nextState = applyOperationFor(definitions, nextState, operation);
563
- });
631
+ applyOperationToDraft(draft, operation);
632
+ }
564
633
  return {
565
634
  effectiveOperations,
566
- nextState
635
+ nextState: draft.state
567
636
  };
568
637
  }
569
638
  function createRegistryOperations(definitions) {
@@ -1514,8 +1583,10 @@ function createStableFunctionEntry(fn) {
1514
1583
  };
1515
1584
  return entry;
1516
1585
  }
1586
+ var DIRECT_COMPONENT_PATH = /^config\.([^.[]+)\.[^.[]+$/;
1517
1587
  function isDirectRegistryComponentPath(path, componentSlices) {
1518
- const match = /^config\.([^.[]+)\.[^.[]+$/.exec(path);
1588
+ if (componentSlices.size === 0) return false;
1589
+ const match = DIRECT_COMPONENT_PATH.exec(path);
1519
1590
  return Boolean(match && componentSlices.has(match[1]));
1520
1591
  }
1521
1592
  function isReactNodeLike(value) {
@@ -1534,7 +1605,8 @@ function hasSameObjectKeys(previousValue, nextValue) {
1534
1605
  return nextKeys.every((key) => Object.prototype.hasOwnProperty.call(previousValue, key));
1535
1606
  }
1536
1607
  function stabilizeFunction(fn, path, scope) {
1537
- const isComponent = fn.name && /^[A-Z]/.test(fn.name);
1608
+ const first = fn.name.charCodeAt(0);
1609
+ const isComponent = first >= 65 && first <= 90;
1538
1610
  if (isComponent || isDirectRegistryComponentPath(path, scope.componentSlices)) {
1539
1611
  return fn;
1540
1612
  }
@@ -1548,19 +1620,19 @@ function stabilizeFunction(fn, path, scope) {
1548
1620
  }
1549
1621
  return entry.stable;
1550
1622
  }
1551
- function stabilizeElement(element, path, previousValue, state) {
1552
- const nextProps = stabilizeNested(element.props, `${path}.props`, isValidElement(previousValue) ? previousValue.props : void 0, state);
1623
+ function stabilizeElement(element, path, previousValue, state, depth) {
1624
+ const nextProps = stabilize(element.props, `${path}.props`, isValidElement(previousValue) ? previousValue.props : void 0, state, depth + 1);
1553
1625
  if (isValidElement(previousValue) && previousValue.type === element.type && previousValue.key === element.key && previousValue.props === nextProps) {
1554
1626
  return previousValue;
1555
1627
  }
1556
1628
  return cloneElement(element, nextProps);
1557
1629
  }
1558
- function stabilizeArray(array, path, previousValue, state) {
1630
+ function stabilizeArray(array, path, previousValue, state, depth) {
1559
1631
  const nextValue = array.every(isReactNodeLike) ? Children.toArray(array) : array;
1560
1632
  const previousArray = Array.isArray(previousValue) ? previousValue : null;
1561
1633
  let hasChanged = !previousArray || previousArray.length !== nextValue.length;
1562
1634
  const stabilizedValue = nextValue.map((item, index) => {
1563
- const nextItem = stabilizeNested(item, `${path}[${index}]`, previousArray?.[index], state);
1635
+ const nextItem = stabilize(item, `${path}[${index}]`, previousArray?.[index], state, depth + 1);
1564
1636
  if (!previousArray || nextItem !== previousArray[index]) {
1565
1637
  hasChanged = true;
1566
1638
  }
@@ -1568,13 +1640,13 @@ function stabilizeArray(array, path, previousValue, state) {
1568
1640
  });
1569
1641
  return !hasChanged ? previousArray : stabilizedValue;
1570
1642
  }
1571
- function stabilizeObject(source, path, previousValue, state) {
1643
+ function stabilizeObject(source, path, previousValue, state, depth) {
1572
1644
  const previousRecord = previousValue;
1573
1645
  const stabilizedValue = {};
1574
1646
  const canReusePrevious = hasSameObjectKeys(previousValue, source);
1575
1647
  let hasChanged = !canReusePrevious;
1576
1648
  Object.keys(source).forEach((key) => {
1577
- const nextValue = stabilizeNested(source[key], `${path}.${key}`, previousRecord?.[key], state);
1649
+ const nextValue = stabilize(source[key], `${path}.${key}`, previousRecord?.[key], state, depth + 1);
1578
1650
  stabilizedValue[key] = nextValue;
1579
1651
  if (!canReusePrevious || nextValue !== previousRecord?.[key]) {
1580
1652
  hasChanged = true;
@@ -1582,14 +1654,8 @@ function stabilizeObject(source, path, previousValue, state) {
1582
1654
  });
1583
1655
  return !hasChanged ? previousValue : stabilizedValue;
1584
1656
  }
1585
- function stabilizeNested(value, path, previousValue, state) {
1586
- return stabilize(value, path, previousValue, {
1587
- ...state,
1588
- depth: state.depth + 1
1589
- });
1590
- }
1591
- function stabilize(value, path, previousValue, state) {
1592
- if (state.depth > MAX_STABILIZATION_DEPTH) return value;
1657
+ function stabilize(value, path, previousValue, state, depth) {
1658
+ if (depth > MAX_STABILIZATION_DEPTH) return value;
1593
1659
  if (typeof value === "function") {
1594
1660
  return stabilizeFunction(value, path, state.scope);
1595
1661
  }
@@ -1598,20 +1664,19 @@ function stabilize(value, path, previousValue, state) {
1598
1664
  state.seen.add(value);
1599
1665
  }
1600
1666
  if (isValidElement(value)) {
1601
- return stabilizeElement(value, path, previousValue, state);
1667
+ return stabilizeElement(value, path, previousValue, state, depth);
1602
1668
  }
1603
1669
  if (Array.isArray(value)) {
1604
- return stabilizeArray(value, path, previousValue, state);
1670
+ return stabilizeArray(value, path, previousValue, state, depth);
1605
1671
  }
1606
1672
  if (typeof value !== "object" || value === null) return value;
1607
- return stabilizeObject(value, path, previousValue, state);
1673
+ return stabilizeObject(value, path, previousValue, state, depth);
1608
1674
  }
1609
1675
  function stabilizeRegistryValue(value, path, scope, previousValue, seen = /* @__PURE__ */ new WeakSet(), depth = 0) {
1610
1676
  return stabilize(value, path, previousValue, {
1611
- depth,
1612
1677
  scope,
1613
1678
  seen
1614
- });
1679
+ }, depth);
1615
1680
  }
1616
1681
 
1617
1682
  // src/core/kernel/hooks.ts
@@ -1677,8 +1742,14 @@ function sameContextInputs(a, b) {
1677
1742
  function samePayloadInputs(a, b) {
1678
1743
  return a.config === b.config && a.modules === b.modules && shallowEqual(a.metadata ?? NO_METADATA, b.metadata ?? NO_METADATA);
1679
1744
  }
1745
+ var componentSlicesByModules = /* @__PURE__ */ new WeakMap();
1680
1746
  function componentSliceIds(modules) {
1681
- return new Set(modules.filter((coreModule) => coreModule.registry?.valueKind === "component").map((coreModule) => coreModule.id));
1747
+ let ids = componentSlicesByModules.get(modules);
1748
+ if (!ids) {
1749
+ ids = new Set(modules.filter((coreModule) => coreModule.registry?.valueKind === "component").map((coreModule) => coreModule.id));
1750
+ componentSlicesByModules.set(modules, ids);
1751
+ }
1752
+ return ids;
1682
1753
  }
1683
1754
  function useAppliedRegistryConfig(inputs) {
1684
1755
  const $ = c(5);
@@ -2337,5 +2408,5 @@ function Compose({
2337
2408
  }
2338
2409
 
2339
2410
  export { Compose, ModuleBoundary, ModuleHost, PageControllerProvider, REGISTRY_SOURCES, RegistryProvider, applyRegistryConfig, createModuleRegistryDefinitions, createRegistryApplyContext, createRegistryOperations, createRegistryStore, defineModule, definePeer, hasOwnProperty, sortModules, useIsModuleInstalled, useModule, useModuleRegistration, useModuleState, usePage, usePageController, useRegistryEntries, useRegistryValue };
2340
- //# sourceMappingURL=chunk-ZE6OGGA7.js.map
2341
- //# sourceMappingURL=chunk-ZE6OGGA7.js.map
2411
+ //# sourceMappingURL=chunk-IH3STE7W.js.map
2412
+ //# sourceMappingURL=chunk-IH3STE7W.js.map