@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.
- package/MIGRATION.md +24 -0
- package/dist/ambient/index.js +8 -8
- package/dist/ambient/server/index.js +2 -2
- package/dist/ambient/worker/index.js +1 -1
- package/dist/background/index.js +7 -7
- package/dist/{chunk-GQKGOLHJ.js → chunk-67MOKJFZ.js} +178 -79
- package/dist/chunk-67MOKJFZ.js.map +1 -0
- package/dist/{chunk-2BLGNT5I.js → chunk-6IP6YFQX.js} +6 -6
- package/dist/{chunk-2BLGNT5I.js.map → chunk-6IP6YFQX.js.map} +1 -1
- package/dist/{chunk-CT4UILO2.js → chunk-7VU2OAJB.js} +4 -77
- package/dist/chunk-7VU2OAJB.js.map +1 -0
- package/dist/{chunk-5H6FZW3N.js → chunk-D222OCTV.js} +15 -9
- package/dist/chunk-D222OCTV.js.map +1 -0
- package/dist/{chunk-2LGI33JP.js → chunk-GKAJ4EM2.js} +169 -73
- package/dist/chunk-GKAJ4EM2.js.map +1 -0
- package/dist/{chunk-66MHDFNF.js → chunk-HFR6YROB.js} +9 -16
- package/dist/chunk-HFR6YROB.js.map +1 -0
- package/dist/{chunk-ZE6OGGA7.js → chunk-IH3STE7W.js} +120 -49
- package/dist/chunk-IH3STE7W.js.map +1 -0
- package/dist/chunk-K3LXE6D5.js +17 -0
- package/dist/{chunk-IR3DCLBM.js.map → chunk-K3LXE6D5.js.map} +1 -1
- package/dist/{chunk-NTUQYA73.js → chunk-KOYTJW5E.js} +60 -9
- package/dist/chunk-KOYTJW5E.js.map +1 -0
- package/dist/{chunk-WYVA6AN5.js → chunk-LKYW4LH6.js} +5 -5
- package/dist/{chunk-WYVA6AN5.js.map → chunk-LKYW4LH6.js.map} +1 -1
- package/dist/{chunk-PUD4IB3L.js → chunk-NCXFWCXP.js} +497 -366
- package/dist/chunk-NCXFWCXP.js.map +1 -0
- package/dist/{chunk-J4WUCHNR.js → chunk-QRXDXAQI.js} +5 -5
- package/dist/{chunk-J4WUCHNR.js.map → chunk-QRXDXAQI.js.map} +1 -1
- package/dist/{chunk-AAT3QWHN.js → chunk-R4K6VAOK.js} +4 -4
- package/dist/{chunk-AAT3QWHN.js.map → chunk-R4K6VAOK.js.map} +1 -1
- package/dist/{chunk-OEXWOZPS.js → chunk-RGC2VFQO.js} +6 -6
- package/dist/chunk-RGC2VFQO.js.map +1 -0
- package/dist/chunk-TAWTGCWJ.js +113 -0
- package/dist/chunk-TAWTGCWJ.js.map +1 -0
- package/dist/{chunk-LTO77WSO.js → chunk-UDJ7ARCH.js} +3 -3
- package/dist/{chunk-LTO77WSO.js.map → chunk-UDJ7ARCH.js.map} +1 -1
- package/dist/{chunk-26K6W4OQ.js → chunk-UE2KBW3D.js} +7 -7
- package/dist/{chunk-26K6W4OQ.js.map → chunk-UE2KBW3D.js.map} +1 -1
- package/dist/{chunk-WBBM67WL.js → chunk-UQLTP3XB.js} +6 -6
- package/dist/{chunk-WBBM67WL.js.map → chunk-UQLTP3XB.js.map} +1 -1
- package/dist/{chunk-LA3CQ6NY.js → chunk-VNSMNGWP.js} +5 -5
- package/dist/{chunk-LA3CQ6NY.js.map → chunk-VNSMNGWP.js.map} +1 -1
- package/dist/{chunk-Y2Q74PJP.js → chunk-WQTMOUCA.js} +3 -3
- package/dist/{chunk-Y2Q74PJP.js.map → chunk-WQTMOUCA.js.map} +1 -1
- package/dist/chunk-WZ5T2NXH.js +702 -0
- package/dist/chunk-WZ5T2NXH.js.map +1 -0
- package/dist/{chunk-RF2YGILF.js → chunk-XGAYTDSI.js} +37 -37
- package/dist/chunk-XGAYTDSI.js.map +1 -0
- package/dist/{chunk-KMN6J5SL.js → chunk-YZS2B6YE.js} +6 -6
- package/dist/{chunk-KMN6J5SL.js.map → chunk-YZS2B6YE.js.map} +1 -1
- package/dist/{chunk-5GVH4BQV.js → chunk-ZXRE2KZO.js} +5 -5
- package/dist/{chunk-5GVH4BQV.js.map → chunk-ZXRE2KZO.js.map} +1 -1
- package/dist/context-menu/index.js +13 -13
- package/dist/controls/index.js +4 -4
- package/dist/core/kernel/hooks.d.ts.map +1 -1
- package/dist/core/kernel/operations-records.d.ts +7 -0
- package/dist/core/kernel/operations-records.d.ts.map +1 -1
- package/dist/core/kernel/operations-resolve.d.ts.map +1 -1
- package/dist/core/kernel/operations.d.ts.map +1 -1
- package/dist/core/kernel/stabilize.d.ts.map +1 -1
- package/dist/core/provider/index.d.ts.map +1 -1
- package/dist/dock/index.js +12 -12
- package/dist/error/index.js +5 -5
- package/dist/foundation/recipes/cn.d.ts +3 -3
- package/dist/foundation/recipes/cn.d.ts.map +1 -1
- package/dist/foundation/recipes/define.d.ts +2 -3
- package/dist/foundation/recipes/define.d.ts.map +1 -1
- package/dist/foundation/recipes/recipe.d.ts +4 -4
- package/dist/foundation/recipes/recipe.d.ts.map +1 -1
- package/dist/foundation/utils/scheduler.d.ts +1 -1
- package/dist/foundation/utils/scheduler.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/index.js +22 -22
- package/dist/kernel/index.js +3 -3
- package/dist/loading/index.js +6 -6
- package/dist/media/index.js +4 -4
- package/dist/modal/index.js +11 -11
- package/dist/modules/ambient/analyze-ground.d.ts +42 -0
- package/dist/modules/ambient/analyze-ground.d.ts.map +1 -0
- package/dist/modules/ambient/analyze.d.ts +1 -1
- package/dist/modules/ambient/analyze.d.ts.map +1 -1
- package/dist/modules/ambient/dom.d.ts.map +1 -1
- package/dist/modules/ambient/hooks.d.ts.map +1 -1
- package/dist/modules/ambient/settings.d.ts.map +1 -1
- package/dist/modules/ambient/types.d.ts +16 -4
- package/dist/modules/ambient/types.d.ts.map +1 -1
- package/dist/modules/background/context.d.ts.map +1 -1
- package/dist/modules/dock/hooks/use-card-item-model.d.ts +4 -4
- package/dist/modules/dock/hooks/use-dock-height-controller.d.ts +1 -1
- package/dist/modules/dock/hooks/use-dock-height-controller.d.ts.map +1 -1
- package/dist/modules/dock/hooks/use-dock-viewport.d.ts.map +1 -1
- package/dist/modules/dock/lib/helpers.d.ts +1 -1
- package/dist/modules/dock/lib/helpers.d.ts.map +1 -1
- package/dist/modules/dock/lib/styles.d.ts +2 -2
- package/dist/modules/dock/model/layout.d.ts +19 -4
- package/dist/modules/dock/model/layout.d.ts.map +1 -1
- package/dist/modules/dock/model/paths.d.ts +7 -0
- package/dist/modules/dock/model/paths.d.ts.map +1 -1
- package/dist/modules/dock/motion.d.ts +2 -2
- package/dist/modules/dock/routing/navigation.d.ts.map +1 -1
- package/dist/modules/dock/runtime/dock.d.ts.map +1 -1
- package/dist/modules/dock/runtime/hooks/use-dock.d.ts.map +1 -1
- package/dist/modules/dock/types/card.d.ts +6 -0
- package/dist/modules/dock/types/card.d.ts.map +1 -1
- package/dist/modules/dock/types/theme.d.ts +20 -0
- package/dist/modules/dock/types/theme.d.ts.map +1 -1
- package/dist/modules/index.js +20 -20
- package/dist/modules/modal/module.d.ts.map +1 -1
- package/dist/navigation/index.js +7 -7
- package/dist/notification/index.js +5 -5
- package/dist/overlay-7QLGWHCH.js +13 -0
- package/dist/{overlay-YC336DAS.js.map → overlay-7QLGWHCH.js.map} +1 -1
- package/dist/provider/index.js +9 -8
- package/dist/react/ui/components/tooltip-group.d.ts +34 -0
- package/dist/react/ui/components/tooltip-group.d.ts.map +1 -0
- package/dist/react/ui/components/tooltip-placement.d.ts +43 -0
- package/dist/react/ui/components/tooltip-placement.d.ts.map +1 -0
- package/dist/react/ui/components/tooltip-slot.d.ts +23 -0
- package/dist/react/ui/components/tooltip-slot.d.ts.map +1 -0
- package/dist/react/ui/components/tooltip.d.ts +9 -7
- package/dist/react/ui/components/tooltip.d.ts.map +1 -1
- package/dist/react/ui/types.d.ts +24 -3
- package/dist/react/ui/types.d.ts.map +1 -1
- package/dist/recipes/index.js +22 -3
- package/dist/recipes/index.js.map +1 -1
- package/dist/ui/index.js +8 -8
- package/dist/utils/index.js +13 -7
- package/dist/utils/index.js.map +1 -1
- package/docs/architecture-and-rules.md +0 -2
- package/docs/core-engine.md +2 -2
- package/docs/design.md +17 -17
- package/docs/getting-started.md +6 -7
- package/docs/modules/ambient.md +79 -58
- package/docs/modules/dock.md +15 -15
- package/docs/modules/modal.md +2 -2
- package/package.json +1 -4
- package/dist/chunk-2LGI33JP.js.map +0 -1
- package/dist/chunk-37OBXNEO.js +0 -116
- package/dist/chunk-37OBXNEO.js.map +0 -1
- package/dist/chunk-5H6FZW3N.js.map +0 -1
- package/dist/chunk-66MHDFNF.js.map +0 -1
- package/dist/chunk-7RSRDKYE.js +0 -22
- package/dist/chunk-7RSRDKYE.js.map +0 -1
- package/dist/chunk-CT4UILO2.js.map +0 -1
- package/dist/chunk-GQKGOLHJ.js.map +0 -1
- package/dist/chunk-IR3DCLBM.js +0 -17
- package/dist/chunk-NTUQYA73.js.map +0 -1
- package/dist/chunk-OEXWOZPS.js.map +0 -1
- package/dist/chunk-PUD4IB3L.js.map +0 -1
- package/dist/chunk-RF2YGILF.js.map +0 -1
- package/dist/chunk-ZE6OGGA7.js.map +0 -1
- package/dist/overlay-YC336DAS.js +0 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useStore, useRequiredContext } from './chunk-
|
|
2
|
-
import { createStore, report, trimToNull } from './chunk-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
record
|
|
171
|
-
|
|
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
|
-
|
|
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 =
|
|
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 =
|
|
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
|
-
|
|
559
|
-
|
|
560
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
|
1586
|
-
|
|
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
|
-
|
|
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-
|
|
2341
|
-
//# sourceMappingURL=chunk-
|
|
2411
|
+
//# sourceMappingURL=chunk-IH3STE7W.js.map
|
|
2412
|
+
//# sourceMappingURL=chunk-IH3STE7W.js.map
|