@almadar/ui 5.158.0 → 5.159.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/dist/{EntityBindingContext-Bn3ePJQC.d.cts → EntityBindingContext-0Evn_LcT.d.cts} +1 -1
- package/dist/{EntityBindingContext-Bn3ePJQC.d.ts → EntityBindingContext-0Evn_LcT.d.ts} +1 -1
- package/dist/avl/index.cjs +144 -34
- package/dist/avl/index.js +145 -35
- package/dist/components/index.cjs +192 -7
- package/dist/components/index.d.cts +8 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.js +193 -8
- package/dist/context/index.cjs +134 -39
- package/dist/context/index.js +92 -1
- package/dist/hooks/index.cjs +328 -233
- package/dist/hooks/index.js +93 -2
- package/dist/lib/index.cjs +92 -0
- package/dist/lib/index.d.cts +58 -1
- package/dist/lib/index.d.ts +58 -1
- package/dist/lib/index.js +62 -1
- package/dist/locales/index.cjs +3 -0
- package/dist/locales/index.js +3 -0
- package/dist/perf-DaVdsbU0.d.cts +21 -0
- package/dist/perf-DaVdsbU0.d.ts +21 -0
- package/dist/providers/index.cjs +256 -96
- package/dist/providers/index.d.cts +1 -1
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.js +257 -97
- package/dist/runtime/index.cjs +152 -39
- package/dist/runtime/index.d.cts +5 -22
- package/dist/runtime/index.d.ts +5 -22
- package/dist/runtime/index.js +154 -40
- package/locales/ar.json +1 -0
- package/locales/en.json +1 -0
- package/locales/sl.json +1 -0
- package/package.json +5 -5
package/dist/components/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { evaluate, createMinimalContext } from '@almadar/evaluator';
|
|
|
14
14
|
import { createContextFromBindings, interpolateValue } from '@almadar/runtime';
|
|
15
15
|
import { mergeEntityFrame, isFileValue, isInlineTrait, isSecretConfigType, isRenderBindingMarker, ANIMATION_NAMES } from '@almadar/core';
|
|
16
16
|
import { createPortal } from 'react-dom';
|
|
17
|
-
import { wrapCallbackForEvent } from '@almadar/runtime/ui';
|
|
17
|
+
import { wrapCallbackForEvent, perfStart, perfEnd } from '@almadar/runtime/ui';
|
|
18
18
|
import { Link, Outlet, useLocation } from 'react-router-dom';
|
|
19
19
|
import ELK from 'elkjs/lib/elk.bundled.js';
|
|
20
20
|
import SyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-light.js';
|
|
@@ -6286,7 +6286,16 @@ function isPlainObject(value) {
|
|
|
6286
6286
|
if (typeof value === "function") return false;
|
|
6287
6287
|
return true;
|
|
6288
6288
|
}
|
|
6289
|
+
function isEvaluatorResolvedData(value) {
|
|
6290
|
+
return evaluatorResolvedData.has(value);
|
|
6291
|
+
}
|
|
6292
|
+
function brandResolved(value) {
|
|
6293
|
+
if (value !== null && typeof value === "object" && !React77__default.isValidElement(value) && !(value instanceof Date)) {
|
|
6294
|
+
resolvedMarkerFree.add(value);
|
|
6295
|
+
}
|
|
6296
|
+
}
|
|
6289
6297
|
function subtreeHasMarker(value) {
|
|
6298
|
+
if (resolvedMarkerFree.has(value)) return false;
|
|
6290
6299
|
const cached = markerPresenceCache.get(value);
|
|
6291
6300
|
if (cached !== void 0) return cached;
|
|
6292
6301
|
let found = false;
|
|
@@ -6308,10 +6317,23 @@ function subtreeHasMarker(value) {
|
|
|
6308
6317
|
}
|
|
6309
6318
|
function walkValue(value, scopeTrait, entity, config, state) {
|
|
6310
6319
|
if (isRenderBindingMarker(value)) {
|
|
6311
|
-
|
|
6320
|
+
const cached = markerResolutionCache.get(value);
|
|
6321
|
+
if (cached !== void 0 && cached.entity === entity && cached.config === config && cached.state === state) {
|
|
6322
|
+
return { resolved: cached.resolved, changed: false };
|
|
6323
|
+
}
|
|
6324
|
+
const resolved = resolveMarkerExpression(value.expression, entity, config, state);
|
|
6325
|
+
markerResolutionCache.set(value, { entity, config, state, resolved });
|
|
6326
|
+
if (resolved !== null && typeof resolved === "object" && !React77__default.isValidElement(resolved) && !(resolved instanceof Date)) {
|
|
6327
|
+
resolvedMarkerFree.add(resolved);
|
|
6328
|
+
evaluatorResolvedData.add(resolved);
|
|
6329
|
+
}
|
|
6330
|
+
return { resolved, changed: true };
|
|
6312
6331
|
}
|
|
6313
6332
|
if (Array.isArray(value)) {
|
|
6314
|
-
if (!subtreeHasMarker(value))
|
|
6333
|
+
if (!subtreeHasMarker(value)) {
|
|
6334
|
+
brandResolved(value);
|
|
6335
|
+
return { resolved: value, changed: false };
|
|
6336
|
+
}
|
|
6315
6337
|
const out = [];
|
|
6316
6338
|
let changed = false;
|
|
6317
6339
|
for (const item of value) {
|
|
@@ -6326,10 +6348,14 @@ function walkValue(value, scopeTrait, entity, config, state) {
|
|
|
6326
6348
|
out.push(resolved);
|
|
6327
6349
|
if (itemChanged) changed = true;
|
|
6328
6350
|
}
|
|
6351
|
+
brandResolved(out);
|
|
6329
6352
|
return changed ? { resolved: out, changed: true } : { resolved: value, changed: false };
|
|
6330
6353
|
}
|
|
6331
6354
|
if (isPlainObject(value)) {
|
|
6332
|
-
if (!subtreeHasMarker(value))
|
|
6355
|
+
if (!subtreeHasMarker(value)) {
|
|
6356
|
+
brandResolved(value);
|
|
6357
|
+
return { resolved: value, changed: false };
|
|
6358
|
+
}
|
|
6333
6359
|
const sourceTrait = value._sourceTrait;
|
|
6334
6360
|
if (typeof sourceTrait === "string" && sourceTrait !== scopeTrait) {
|
|
6335
6361
|
return { resolved: value, changed: false };
|
|
@@ -6341,11 +6367,13 @@ function walkValue(value, scopeTrait, entity, config, state) {
|
|
|
6341
6367
|
out[key] = resolved;
|
|
6342
6368
|
if (itemChanged) changed = true;
|
|
6343
6369
|
}
|
|
6370
|
+
brandResolved(out);
|
|
6344
6371
|
return changed ? { resolved: out, changed: true } : { resolved: value, changed: false };
|
|
6345
6372
|
}
|
|
6346
6373
|
return { resolved: value, changed: false };
|
|
6347
6374
|
}
|
|
6348
6375
|
function resolveRenderBindingMarkers(props, scopeTrait, entity, config, state) {
|
|
6376
|
+
if (resolvedMarkerFree.has(props)) return props;
|
|
6349
6377
|
const out = {};
|
|
6350
6378
|
let changed = false;
|
|
6351
6379
|
for (const [key, value] of Object.entries(props)) {
|
|
@@ -6353,13 +6381,17 @@ function resolveRenderBindingMarkers(props, scopeTrait, entity, config, state) {
|
|
|
6353
6381
|
out[key] = resolved;
|
|
6354
6382
|
if (propChanged) changed = true;
|
|
6355
6383
|
}
|
|
6384
|
+
brandResolved(out);
|
|
6356
6385
|
return changed ? out : props;
|
|
6357
6386
|
}
|
|
6358
|
-
var markerPresenceCache;
|
|
6387
|
+
var markerPresenceCache, markerResolutionCache, resolvedMarkerFree, evaluatorResolvedData;
|
|
6359
6388
|
var init_resolve_render_bindings = __esm({
|
|
6360
6389
|
"lib/resolve-render-bindings.ts"() {
|
|
6361
6390
|
"use client";
|
|
6362
6391
|
markerPresenceCache = /* @__PURE__ */ new WeakMap();
|
|
6392
|
+
markerResolutionCache = /* @__PURE__ */ new WeakMap();
|
|
6393
|
+
resolvedMarkerFree = /* @__PURE__ */ new WeakSet();
|
|
6394
|
+
evaluatorResolvedData = /* @__PURE__ */ new WeakSet();
|
|
6363
6395
|
}
|
|
6364
6396
|
});
|
|
6365
6397
|
var sizeClasses6, minWidthClasses, lookStyles2, Modal;
|
|
@@ -8445,6 +8477,10 @@ var init_ComponentPatterns = __esm({
|
|
|
8445
8477
|
AlertPattern.displayName = "AlertPattern";
|
|
8446
8478
|
}
|
|
8447
8479
|
});
|
|
8480
|
+
var init_perf = __esm({
|
|
8481
|
+
"lib/perf.ts"() {
|
|
8482
|
+
}
|
|
8483
|
+
});
|
|
8448
8484
|
function themeBodyFont(el) {
|
|
8449
8485
|
if (typeof getComputedStyle !== "function") return "system-ui, sans-serif";
|
|
8450
8486
|
const v = getComputedStyle(el).getPropertyValue("--font-family-body").trim();
|
|
@@ -8793,6 +8829,7 @@ var init_LearningCanvas = __esm({
|
|
|
8793
8829
|
"components/learning/atoms/LearningCanvas.tsx"() {
|
|
8794
8830
|
"use client";
|
|
8795
8831
|
init_cn();
|
|
8832
|
+
init_perf();
|
|
8796
8833
|
init_useEventBus();
|
|
8797
8834
|
DASH_PATTERNS = { dashed: [6, 4], dotted: [2, 3] };
|
|
8798
8835
|
TRACE_SERIES_COLORS = ["#2563eb", "#dc2626", "#16a34a", "#f59e0b"];
|
|
@@ -8836,6 +8873,7 @@ var init_LearningCanvas = __esm({
|
|
|
8836
8873
|
return [...shapes, ...traceOut, ...readoutOut];
|
|
8837
8874
|
}, [shapes, traces, readouts, width, height]);
|
|
8838
8875
|
const draw = useCallback(() => {
|
|
8876
|
+
const _perfT = perfStart("learningcanvas:paint");
|
|
8839
8877
|
const canvas = canvasRef.current;
|
|
8840
8878
|
if (!canvas) return;
|
|
8841
8879
|
const ctx = canvas.getContext("2d");
|
|
@@ -8857,6 +8895,7 @@ var init_LearningCanvas = __esm({
|
|
|
8857
8895
|
for (const shape of derivedShapes) {
|
|
8858
8896
|
if (shape.type === "text") drawShape(ctx, shape, width, height, derivedShapes);
|
|
8859
8897
|
}
|
|
8898
|
+
perfEnd("learningcanvas:paint", _perfT);
|
|
8860
8899
|
}, [width, height, backgroundColor, derivedShapes]);
|
|
8861
8900
|
useEffect(() => {
|
|
8862
8901
|
draw();
|
|
@@ -31646,6 +31685,7 @@ var init_MathCanvas = __esm({
|
|
|
31646
31685
|
"components/learning/molecules/MathCanvas.tsx"() {
|
|
31647
31686
|
"use client";
|
|
31648
31687
|
init_useEventBus();
|
|
31688
|
+
init_perf();
|
|
31649
31689
|
init_atoms();
|
|
31650
31690
|
init_Stack();
|
|
31651
31691
|
init_LearningCanvas();
|
|
@@ -31711,6 +31751,7 @@ var init_MathCanvas = __esm({
|
|
|
31711
31751
|
};
|
|
31712
31752
|
}, [stableKeyMap, stableKeyUpMap, eventBus]);
|
|
31713
31753
|
const derivedShapes = useMemo(() => {
|
|
31754
|
+
const _perfT = perfStart("mathcanvas:derive");
|
|
31714
31755
|
const out = [];
|
|
31715
31756
|
const margin = 24;
|
|
31716
31757
|
const plotW = width - margin * 2;
|
|
@@ -31954,6 +31995,7 @@ var init_MathCanvas = __esm({
|
|
|
31954
31995
|
}
|
|
31955
31996
|
}
|
|
31956
31997
|
out.push(...shapes);
|
|
31998
|
+
perfEnd("mathcanvas:derive", _perfT);
|
|
31957
31999
|
return out;
|
|
31958
32000
|
}, [
|
|
31959
32001
|
width,
|
|
@@ -38307,7 +38349,7 @@ var init_RichBlockEditor = __esm({
|
|
|
38307
38349
|
{
|
|
38308
38350
|
variant: "bordered",
|
|
38309
38351
|
padding: "none",
|
|
38310
|
-
className: cn("flex flex-col", className),
|
|
38352
|
+
className: cn("flex flex-col text-card-foreground", className),
|
|
38311
38353
|
children: [
|
|
38312
38354
|
enableBlocks && showToolbar && !readOnly && /* @__PURE__ */ jsx(
|
|
38313
38355
|
Box,
|
|
@@ -43760,6 +43802,7 @@ var init_DetailPanel = __esm({
|
|
|
43760
43802
|
"use client";
|
|
43761
43803
|
init_atoms();
|
|
43762
43804
|
init_Box();
|
|
43805
|
+
init_Input();
|
|
43763
43806
|
init_Stack();
|
|
43764
43807
|
init_SimpleGrid();
|
|
43765
43808
|
init_Menu();
|
|
@@ -43775,6 +43818,7 @@ var init_DetailPanel = __esm({
|
|
|
43775
43818
|
ReactMarkdown2 = lazy(() => import('react-markdown'));
|
|
43776
43819
|
DetailPanel = ({
|
|
43777
43820
|
title: propTitle,
|
|
43821
|
+
onTitleCommit,
|
|
43778
43822
|
subtitle,
|
|
43779
43823
|
status,
|
|
43780
43824
|
avatar,
|
|
@@ -43796,6 +43840,7 @@ var init_DetailPanel = __esm({
|
|
|
43796
43840
|
}) => {
|
|
43797
43841
|
const eventBus = useEventBus();
|
|
43798
43842
|
const { t } = useTranslate();
|
|
43843
|
+
const [titleDraft, setTitleDraft] = React77__default.useState(null);
|
|
43799
43844
|
const isFieldDefArray = (arr) => {
|
|
43800
43845
|
if (!arr || arr.length === 0) return false;
|
|
43801
43846
|
const first = arr[0];
|
|
@@ -44016,6 +44061,50 @@ var init_DetailPanel = __esm({
|
|
|
44016
44061
|
}),
|
|
44017
44062
|
status && /* @__PURE__ */ jsx(Badge, { variant: status.variant ?? "default", children: status.label })
|
|
44018
44063
|
] });
|
|
44064
|
+
const commitTitle = () => {
|
|
44065
|
+
if (!onTitleCommit) return;
|
|
44066
|
+
const next = (titleDraft ?? "").trim();
|
|
44067
|
+
setTitleDraft(null);
|
|
44068
|
+
if (!next || next === title) return;
|
|
44069
|
+
onTitleCommit(next, normalizedData?.id !== void 0 ? String(normalizedData.id) : "");
|
|
44070
|
+
};
|
|
44071
|
+
const titleNode = onTitleCommit && titleDraft !== null ? /* @__PURE__ */ jsx(
|
|
44072
|
+
Input,
|
|
44073
|
+
{
|
|
44074
|
+
value: titleDraft,
|
|
44075
|
+
autoFocus: true,
|
|
44076
|
+
"aria-label": t("common.title"),
|
|
44077
|
+
className: "h-auto py-1 text-3xl font-bold tracking-tight",
|
|
44078
|
+
onChange: (e) => setTitleDraft(e.target.value),
|
|
44079
|
+
onBlur: commitTitle,
|
|
44080
|
+
onKeyDown: (e) => {
|
|
44081
|
+
if (e.key === "Enter") {
|
|
44082
|
+
e.preventDefault();
|
|
44083
|
+
commitTitle();
|
|
44084
|
+
} else if (e.key === "Escape") {
|
|
44085
|
+
e.preventDefault();
|
|
44086
|
+
setTitleDraft(null);
|
|
44087
|
+
}
|
|
44088
|
+
},
|
|
44089
|
+
"data-testid": "detail-title-input"
|
|
44090
|
+
}
|
|
44091
|
+
) : onTitleCommit ? /* @__PURE__ */ jsx(
|
|
44092
|
+
Box,
|
|
44093
|
+
{
|
|
44094
|
+
role: "button",
|
|
44095
|
+
tabIndex: 0,
|
|
44096
|
+
className: "cursor-text rounded px-1 -mx-1 transition-colors hover:bg-muted/40",
|
|
44097
|
+
onClick: () => setTitleDraft(title ?? ""),
|
|
44098
|
+
onKeyDown: (e) => {
|
|
44099
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
44100
|
+
e.preventDefault();
|
|
44101
|
+
setTitleDraft(title ?? "");
|
|
44102
|
+
}
|
|
44103
|
+
},
|
|
44104
|
+
"data-testid": "detail-title-editable",
|
|
44105
|
+
children: /* @__PURE__ */ jsx(Typography, { variant: "h2", weight: "bold", children: title || "Details" })
|
|
44106
|
+
}
|
|
44107
|
+
) : /* @__PURE__ */ jsx(Typography, { variant: "h2", weight: "bold", children: title || "Details" });
|
|
44019
44108
|
const content = /* @__PURE__ */ jsx(Card, { variant: "elevated", children: /* @__PURE__ */ jsxs(VStack, { gap: "md", className: "p-6", children: [
|
|
44020
44109
|
/* @__PURE__ */ jsxs(HStack, { justify: "between", align: "start", gap: "md", children: [
|
|
44021
44110
|
/* @__PURE__ */ jsxs(HStack, { align: "start", gap: "sm", className: "min-w-0", children: [
|
|
@@ -44035,7 +44124,7 @@ var init_DetailPanel = __esm({
|
|
|
44035
44124
|
avatar,
|
|
44036
44125
|
/* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "min-w-0", children: [
|
|
44037
44126
|
/* @__PURE__ */ jsxs(HStack, { align: "center", gap: "sm", wrap: true, children: [
|
|
44038
|
-
|
|
44127
|
+
titleNode,
|
|
44039
44128
|
statusBadges
|
|
44040
44129
|
] }),
|
|
44041
44130
|
subtitle && /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: subtitle })
|
|
@@ -44596,7 +44685,7 @@ var init_Form = __esm({
|
|
|
44596
44685
|
});
|
|
44597
44686
|
debug(
|
|
44598
44687
|
"forms",
|
|
44599
|
-
`Calculation triggered: ${calc.variableName} = ${value}`
|
|
44688
|
+
`Calculation triggered: ${calc.variableName} = ${String(value)}`
|
|
44600
44689
|
);
|
|
44601
44690
|
}
|
|
44602
44691
|
});
|
|
@@ -51076,6 +51165,7 @@ function isPlainConfigObject(value) {
|
|
|
51076
51165
|
return proto === Object.prototype || proto === null;
|
|
51077
51166
|
}
|
|
51078
51167
|
function subtreeHasTraitRef(value) {
|
|
51168
|
+
if (isEvaluatorResolvedData(value)) return false;
|
|
51079
51169
|
const cached = traitRefPresenceCache.get(value);
|
|
51080
51170
|
if (cached !== void 0) return cached;
|
|
51081
51171
|
let found = false;
|
|
@@ -51148,6 +51238,10 @@ function renderPatternProps(props, onDismiss, propsSchema) {
|
|
|
51148
51238
|
};
|
|
51149
51239
|
rendered[key] = /* @__PURE__ */ jsx(SlotContentRenderer, { content: childContent, onDismiss });
|
|
51150
51240
|
} else if (Array.isArray(value)) {
|
|
51241
|
+
if (!isEvaluatorResolvedData(value) && value.some((el) => isPatternConfig(el))) ; else if (!subtreeHasTraitRef(value)) {
|
|
51242
|
+
rendered[key] = value;
|
|
51243
|
+
continue;
|
|
51244
|
+
}
|
|
51151
51245
|
const isDataArray = propsSchema?.[key]?.items?.types?.includes("object") ?? false;
|
|
51152
51246
|
rendered[key] = value.map((item, i) => {
|
|
51153
51247
|
const el = item;
|
|
@@ -52599,6 +52693,88 @@ function useDeepAgentGeneration() {
|
|
|
52599
52693
|
|
|
52600
52694
|
// hooks/index.ts
|
|
52601
52695
|
init_useEventBus();
|
|
52696
|
+
function expressionEqual(a, b) {
|
|
52697
|
+
if (Object.is(a, b)) return true;
|
|
52698
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
52699
|
+
if (a.length !== b.length) return false;
|
|
52700
|
+
for (let i = 0; i < a.length; i++) {
|
|
52701
|
+
if (!expressionEqual(a[i], b[i])) return false;
|
|
52702
|
+
}
|
|
52703
|
+
return true;
|
|
52704
|
+
}
|
|
52705
|
+
if (a !== null && b !== null && typeof a === "object" && typeof b === "object" && !Array.isArray(a) && !Array.isArray(b) && !(a instanceof Date) && !(b instanceof Date)) {
|
|
52706
|
+
const aKeys = Object.keys(a);
|
|
52707
|
+
const bKeys = Object.keys(b);
|
|
52708
|
+
if (aKeys.length !== bKeys.length) return false;
|
|
52709
|
+
for (const key of aKeys) {
|
|
52710
|
+
if (!Object.prototype.hasOwnProperty.call(b, key)) return false;
|
|
52711
|
+
if (!expressionEqual(
|
|
52712
|
+
a[key],
|
|
52713
|
+
b[key]
|
|
52714
|
+
)) return false;
|
|
52715
|
+
}
|
|
52716
|
+
return true;
|
|
52717
|
+
}
|
|
52718
|
+
return false;
|
|
52719
|
+
}
|
|
52720
|
+
function isPlainSlotObject(value) {
|
|
52721
|
+
if (value === null || value === void 0 || typeof value !== "object") return false;
|
|
52722
|
+
if (Array.isArray(value)) return false;
|
|
52723
|
+
if (React77__default.isValidElement(value)) return false;
|
|
52724
|
+
if (value instanceof Date) return false;
|
|
52725
|
+
if (isRenderBindingMarker(value)) return false;
|
|
52726
|
+
return true;
|
|
52727
|
+
}
|
|
52728
|
+
function shareValue(prev, next) {
|
|
52729
|
+
if (Object.is(prev, next)) return { value: prev, equal: true };
|
|
52730
|
+
const prevMarker = isRenderBindingMarker(prev) ? prev : void 0;
|
|
52731
|
+
const nextMarker = isRenderBindingMarker(next) ? next : void 0;
|
|
52732
|
+
if (prevMarker !== void 0 || nextMarker !== void 0) {
|
|
52733
|
+
if (prevMarker !== void 0 && nextMarker !== void 0 && expressionEqual(prevMarker.expression, nextMarker.expression)) {
|
|
52734
|
+
return { value: prev, equal: true };
|
|
52735
|
+
}
|
|
52736
|
+
return { value: next, equal: false };
|
|
52737
|
+
}
|
|
52738
|
+
if (prev instanceof Date || next instanceof Date) {
|
|
52739
|
+
return prev instanceof Date && next instanceof Date && prev.getTime() === next.getTime() ? { value: prev, equal: true } : { value: next, equal: false };
|
|
52740
|
+
}
|
|
52741
|
+
if (typeof prev === "function" || typeof next === "function") return { value: next, equal: false };
|
|
52742
|
+
if (React77__default.isValidElement(prev) || React77__default.isValidElement(next)) return { value: next, equal: false };
|
|
52743
|
+
if (Array.isArray(prev) && Array.isArray(next)) {
|
|
52744
|
+
let equal = prev.length === next.length;
|
|
52745
|
+
const out = new Array(next.length);
|
|
52746
|
+
for (let i = 0; i < next.length; i++) {
|
|
52747
|
+
const child = shareValue(prev[i], next[i]);
|
|
52748
|
+
out[i] = child.value;
|
|
52749
|
+
if (!child.equal) equal = false;
|
|
52750
|
+
}
|
|
52751
|
+
return equal ? { value: prev, equal: true } : { value: out, equal: false };
|
|
52752
|
+
}
|
|
52753
|
+
if (isPlainSlotObject(prev) && isPlainSlotObject(next)) {
|
|
52754
|
+
const prevKeys = Object.keys(prev);
|
|
52755
|
+
const nextKeys = Object.keys(next);
|
|
52756
|
+
let equal = prevKeys.length === nextKeys.length;
|
|
52757
|
+
const out = {};
|
|
52758
|
+
for (const key of nextKeys) {
|
|
52759
|
+
if (!Object.prototype.hasOwnProperty.call(prev, key)) {
|
|
52760
|
+
equal = false;
|
|
52761
|
+
out[key] = next[key];
|
|
52762
|
+
continue;
|
|
52763
|
+
}
|
|
52764
|
+
const child = shareValue(prev[key], next[key]);
|
|
52765
|
+
out[key] = child.value;
|
|
52766
|
+
if (!child.equal) equal = false;
|
|
52767
|
+
}
|
|
52768
|
+
return equal ? { value: prev, equal: true } : { value: out, equal: false };
|
|
52769
|
+
}
|
|
52770
|
+
return { value: next, equal: false };
|
|
52771
|
+
}
|
|
52772
|
+
function reconcileSlotProps(prev, next) {
|
|
52773
|
+
const result = shareValue(prev, next);
|
|
52774
|
+
return { value: result.value, equal: result.equal };
|
|
52775
|
+
}
|
|
52776
|
+
|
|
52777
|
+
// hooks/useUISlots.ts
|
|
52602
52778
|
var log17 = createLogger("almadar:ui:ui-slots");
|
|
52603
52779
|
var DEFAULT_SOURCE_KEY = "__default__";
|
|
52604
52780
|
var MULTI_SOURCE_STACK_TRAIT = "__multi_source_stack__";
|
|
@@ -52753,6 +52929,14 @@ function useUISlotManager() {
|
|
|
52753
52929
|
});
|
|
52754
52930
|
return prev;
|
|
52755
52931
|
}
|
|
52932
|
+
if (existing && existing.priority === content.priority && existing.pattern === content.pattern && existing.animation === content.animation && existing.transitionEvent === content.transitionEvent && existing.fromState === content.fromState && existing.entity === content.entity && existing.nodeId === content.nodeId && existing.autoDismissAt === void 0 && content.autoDismissAt === void 0 && existing.onDismiss === void 0 === (content.onDismiss === void 0)) {
|
|
52933
|
+
const reconciled = reconcileSlotProps(existing.props, content.props);
|
|
52934
|
+
if (reconciled.equal) {
|
|
52935
|
+
log17.debug("slot:flush-bail", { slot: config.target, sourceKey, pattern: content.pattern });
|
|
52936
|
+
return prev;
|
|
52937
|
+
}
|
|
52938
|
+
content.props = reconciled.value;
|
|
52939
|
+
}
|
|
52756
52940
|
const nextSources = {
|
|
52757
52941
|
...slotSources,
|
|
52758
52942
|
[sourceKey]: content
|
|
@@ -53100,6 +53284,7 @@ var en_default = {
|
|
|
53100
53284
|
"common.confirm": "Are you sure?",
|
|
53101
53285
|
"common.create": "Create",
|
|
53102
53286
|
"common.edit": "Edit",
|
|
53287
|
+
"common.title": "Title",
|
|
53103
53288
|
"common.view": "View",
|
|
53104
53289
|
"common.add": "Add",
|
|
53105
53290
|
"common.remove": "Remove",
|