@almadar/ui 5.124.0 → 5.126.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/avl/index.cjs +118 -75
- package/dist/avl/index.d.cts +1859 -0
- package/dist/avl/index.d.ts +1859 -0
- package/dist/avl/index.js +119 -76
- package/dist/components/index.cjs +115 -62
- package/dist/components/index.js +115 -62
- package/dist/context/index.cjs +3 -2
- package/dist/context/index.js +3 -2
- package/dist/hooks/index.cjs +3 -2
- package/dist/hooks/index.js +3 -2
- package/dist/marketing/index.d.cts +1086 -0
- package/dist/marketing/index.d.ts +1086 -0
- package/dist/{offline-executor-aRuNznZx.d.cts → offline-executor-Qz4b6GpF.d.cts} +19 -1
- package/dist/{offline-executor-aRuNznZx.d.ts → offline-executor-Qz4b6GpF.d.ts} +19 -1
- package/dist/providers/index.cjs +145 -68
- package/dist/providers/index.d.cts +2 -2
- package/dist/providers/index.d.ts +2 -2
- package/dist/providers/index.js +144 -69
- package/dist/renderer/index.cjs +8 -0
- package/dist/renderer/index.d.cts +2 -2
- package/dist/renderer/index.d.ts +2 -2
- package/dist/renderer/index.js +1 -1
- package/dist/runtime/index.cjs +118 -75
- package/dist/runtime/index.js +119 -76
- package/package.json +11 -10
package/dist/providers/index.js
CHANGED
|
@@ -18914,17 +18914,27 @@ function getWeekDays(start) {
|
|
|
18914
18914
|
}
|
|
18915
18915
|
return days;
|
|
18916
18916
|
}
|
|
18917
|
-
function generateDefaultTimeSlots() {
|
|
18917
|
+
function generateDefaultTimeSlots(events2) {
|
|
18918
|
+
let first = DEFAULT_FIRST_HOUR;
|
|
18919
|
+
let last = DEFAULT_LAST_HOUR;
|
|
18920
|
+
for (const ev of events2) {
|
|
18921
|
+
const start = new Date(ev.startTime);
|
|
18922
|
+
if (Number.isNaN(start.getTime())) continue;
|
|
18923
|
+
const hour = start.getHours();
|
|
18924
|
+
if (hour < first) first = hour;
|
|
18925
|
+
if (hour > last) last = hour;
|
|
18926
|
+
}
|
|
18918
18927
|
const slots = [];
|
|
18919
|
-
for (let hour =
|
|
18920
|
-
slots.push(
|
|
18928
|
+
for (let hour = first; hour <= last; hour++) {
|
|
18929
|
+
slots.push(slotLabel(hour));
|
|
18921
18930
|
}
|
|
18922
18931
|
return slots;
|
|
18923
18932
|
}
|
|
18924
18933
|
function eventInSlot(event, day, slotTime) {
|
|
18925
18934
|
const eventStart = new Date(event.startTime);
|
|
18926
|
-
|
|
18927
|
-
|
|
18935
|
+
if (Number.isNaN(eventStart.getTime())) return false;
|
|
18936
|
+
const [slotHour] = slotTime.split(":").map(Number);
|
|
18937
|
+
return eventStart.toDateString() === day.toDateString() && eventStart.getHours() === slotHour;
|
|
18928
18938
|
}
|
|
18929
18939
|
function CalendarGrid({
|
|
18930
18940
|
weekStart,
|
|
@@ -18953,8 +18963,8 @@ function CalendarGrid({
|
|
|
18953
18963
|
[resolvedWeekStart]
|
|
18954
18964
|
);
|
|
18955
18965
|
const resolvedTimeSlots = useMemo(
|
|
18956
|
-
() => timeSlots ?? generateDefaultTimeSlots(),
|
|
18957
|
-
[timeSlots]
|
|
18966
|
+
() => timeSlots ?? generateDefaultTimeSlots(evs),
|
|
18967
|
+
[timeSlots, evs]
|
|
18958
18968
|
);
|
|
18959
18969
|
const visibleCount = useDayWindow(dayWindow);
|
|
18960
18970
|
const [dayOffset, setDayOffset] = useState(0);
|
|
@@ -19141,7 +19151,7 @@ function CalendarGrid({
|
|
|
19141
19151
|
}
|
|
19142
19152
|
);
|
|
19143
19153
|
}
|
|
19144
|
-
var SHORT_DATE;
|
|
19154
|
+
var SHORT_DATE, DEFAULT_FIRST_HOUR, DEFAULT_LAST_HOUR, slotLabel;
|
|
19145
19155
|
var init_CalendarGrid = __esm({
|
|
19146
19156
|
"components/core/molecules/CalendarGrid.tsx"() {
|
|
19147
19157
|
"use client";
|
|
@@ -19156,6 +19166,9 @@ var init_CalendarGrid = __esm({
|
|
|
19156
19166
|
init_useEventBus();
|
|
19157
19167
|
init_useSwipeGesture();
|
|
19158
19168
|
SHORT_DATE = { month: "short", day: "numeric" };
|
|
19169
|
+
DEFAULT_FIRST_HOUR = 9;
|
|
19170
|
+
DEFAULT_LAST_HOUR = 17;
|
|
19171
|
+
slotLabel = (hour) => `${hour.toString().padStart(2, "0")}:00`;
|
|
19159
19172
|
CalendarGrid.displayName = "CalendarGrid";
|
|
19160
19173
|
}
|
|
19161
19174
|
});
|
|
@@ -23240,13 +23253,13 @@ function DataGrid({
|
|
|
23240
23253
|
}
|
|
23241
23254
|
),
|
|
23242
23255
|
/* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1 min-w-0", children: [
|
|
23243
|
-
titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
23256
|
+
titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center min-w-0", children: [
|
|
23244
23257
|
titleField?.icon && renderIconInput(titleField.icon, { size: "sm", className: "text-primary flex-shrink-0" }),
|
|
23245
23258
|
/* @__PURE__ */ jsx(
|
|
23246
23259
|
Typography,
|
|
23247
23260
|
{
|
|
23248
23261
|
variant: titleField?.variant === "h3" ? "h3" : "h4",
|
|
23249
|
-
className: "font-semibold truncate",
|
|
23262
|
+
className: "font-semibold truncate min-w-0",
|
|
23250
23263
|
children: String(titleValue)
|
|
23251
23264
|
}
|
|
23252
23265
|
)
|
|
@@ -23304,7 +23317,7 @@ function DataGrid({
|
|
|
23304
23317
|
)
|
|
23305
23318
|
] }, field.name);
|
|
23306
23319
|
}) }) }),
|
|
23307
|
-
primaryActions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 mt-auto border-t border-border", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-end", children: [
|
|
23320
|
+
primaryActions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 mt-auto border-t border-border", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-end flex-wrap", children: [
|
|
23308
23321
|
(maxInlineActions != null ? primaryActions.slice(0, maxInlineActions) : primaryActions).map((action, idx) => /* @__PURE__ */ jsxs(
|
|
23309
23322
|
Button,
|
|
23310
23323
|
{
|
|
@@ -28317,7 +28330,7 @@ function TableView({
|
|
|
28317
28330
|
col.key
|
|
28318
28331
|
);
|
|
28319
28332
|
}),
|
|
28320
|
-
hasActions && /* @__PURE__ */ jsx(Box, { "aria-hidden": true })
|
|
28333
|
+
hasActions && /* @__PURE__ */ jsx(Box, { "aria-hidden": true, className: "sticky right-0 bg-[var(--color-surface-subtle)]" })
|
|
28321
28334
|
]
|
|
28322
28335
|
}
|
|
28323
28336
|
);
|
|
@@ -28361,41 +28374,54 @@ function TableView({
|
|
|
28361
28374
|
}
|
|
28362
28375
|
return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx("span", { className: "truncate", children: formatCell(raw, col.format) }) }, col.key);
|
|
28363
28376
|
}),
|
|
28364
|
-
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxs(
|
|
28365
|
-
|
|
28366
|
-
|
|
28367
|
-
|
|
28368
|
-
|
|
28369
|
-
|
|
28370
|
-
|
|
28371
|
-
|
|
28372
|
-
"
|
|
28373
|
-
|
|
28374
|
-
|
|
28375
|
-
|
|
28376
|
-
|
|
28377
|
-
|
|
28378
|
-
|
|
28379
|
-
|
|
28380
|
-
|
|
28381
|
-
|
|
28382
|
-
|
|
28383
|
-
|
|
28384
|
-
|
|
28385
|
-
|
|
28386
|
-
|
|
28387
|
-
|
|
28388
|
-
|
|
28389
|
-
|
|
28390
|
-
|
|
28391
|
-
|
|
28392
|
-
|
|
28393
|
-
|
|
28394
|
-
|
|
28395
|
-
|
|
28396
|
-
|
|
28397
|
-
|
|
28398
|
-
|
|
28377
|
+
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxs(
|
|
28378
|
+
HStack,
|
|
28379
|
+
{
|
|
28380
|
+
gap: "xs",
|
|
28381
|
+
className: cn(
|
|
28382
|
+
// Pinned: the fixed column tracks routinely overflow the caller's
|
|
28383
|
+
// scroll container, which used to leave the actions off-screen.
|
|
28384
|
+
// Opaque so scrolled cells pass underneath it.
|
|
28385
|
+
"justify-end flex-shrink-0 sticky right-0 z-[1] transition-colors",
|
|
28386
|
+
lk.striped && index % 2 === 1 ? "bg-[var(--color-surface-subtle)]" : "bg-[var(--color-card)] group-hover:bg-[var(--color-surface-subtle)]"
|
|
28387
|
+
),
|
|
28388
|
+
children: [
|
|
28389
|
+
(maxInlineActions != null ? itemActions.slice(0, maxInlineActions) : itemActions).map((action, i) => /* @__PURE__ */ jsxs(
|
|
28390
|
+
Button,
|
|
28391
|
+
{
|
|
28392
|
+
variant: action.variant ?? "ghost",
|
|
28393
|
+
size: "sm",
|
|
28394
|
+
onClick: handleActionClick(action, row),
|
|
28395
|
+
"data-testid": `action-${action.event}`,
|
|
28396
|
+
"data-row-id": String(row.id),
|
|
28397
|
+
className: cn(action.variant === "danger" && "text-error hover:bg-error/10"),
|
|
28398
|
+
children: [
|
|
28399
|
+
action.icon && renderIconInput3(action.icon, { size: "xs", className: "mr-1" }),
|
|
28400
|
+
action.label
|
|
28401
|
+
]
|
|
28402
|
+
},
|
|
28403
|
+
i
|
|
28404
|
+
)),
|
|
28405
|
+
maxInlineActions != null && itemActions.length > maxInlineActions && /* @__PURE__ */ jsx(
|
|
28406
|
+
Menu,
|
|
28407
|
+
{
|
|
28408
|
+
position: "bottom-end",
|
|
28409
|
+
trigger: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", children: /* @__PURE__ */ jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
|
|
28410
|
+
items: itemActions.slice(maxInlineActions).map((action) => ({
|
|
28411
|
+
label: action.label,
|
|
28412
|
+
icon: action.icon,
|
|
28413
|
+
event: action.event,
|
|
28414
|
+
variant: action.variant === "danger" ? "danger" : "default",
|
|
28415
|
+
onClick: () => eventBus.emit(`UI:${action.event}`, {
|
|
28416
|
+
id: row.id,
|
|
28417
|
+
row
|
|
28418
|
+
})
|
|
28419
|
+
}))
|
|
28420
|
+
}
|
|
28421
|
+
)
|
|
28422
|
+
]
|
|
28423
|
+
}
|
|
28424
|
+
)
|
|
28399
28425
|
]
|
|
28400
28426
|
}
|
|
28401
28427
|
);
|
|
@@ -37130,6 +37156,16 @@ function normalizeFieldDefs(fields) {
|
|
|
37130
37156
|
return String(f3);
|
|
37131
37157
|
});
|
|
37132
37158
|
}
|
|
37159
|
+
function buildFieldLabelMap(fields) {
|
|
37160
|
+
const map = {};
|
|
37161
|
+
if (!fields) return map;
|
|
37162
|
+
for (const f3 of fields) {
|
|
37163
|
+
if (typeof f3 === "object" && "key" in f3 && f3.header !== void 0 && f3.header !== "") {
|
|
37164
|
+
map[f3.key] = f3.header;
|
|
37165
|
+
}
|
|
37166
|
+
}
|
|
37167
|
+
return map;
|
|
37168
|
+
}
|
|
37133
37169
|
function buildFieldTypeMap(fields) {
|
|
37134
37170
|
const map = {};
|
|
37135
37171
|
if (!fields) return map;
|
|
@@ -37181,6 +37217,8 @@ var init_DetailPanel = __esm({
|
|
|
37181
37217
|
};
|
|
37182
37218
|
const effectiveFieldNames = isFieldDefArray(propFields) ? normalizeFieldDefs(propFields) : fieldNames;
|
|
37183
37219
|
const fieldTypeMap = isFieldDefArray(propFields) ? buildFieldTypeMap(propFields) : {};
|
|
37220
|
+
const fieldLabelMap = isFieldDefArray(propFields) ? buildFieldLabelMap(propFields) : {};
|
|
37221
|
+
const labelFor = (field) => fieldLabelMap[field] ?? formatFieldLabel(field);
|
|
37184
37222
|
const handleActionClick = useCallback(
|
|
37185
37223
|
(action, data2) => {
|
|
37186
37224
|
if (action.navigatesTo) {
|
|
@@ -37216,7 +37254,7 @@ var init_DetailPanel = __esm({
|
|
|
37216
37254
|
if (typeof field === "string") {
|
|
37217
37255
|
const value = getNestedValue(normalizedData, field);
|
|
37218
37256
|
return {
|
|
37219
|
-
label:
|
|
37257
|
+
label: labelFor(field),
|
|
37220
37258
|
value: formatFieldValue(value, field),
|
|
37221
37259
|
icon: getFieldIcon(field)
|
|
37222
37260
|
};
|
|
@@ -37227,7 +37265,10 @@ var init_DetailPanel = __esm({
|
|
|
37227
37265
|
}
|
|
37228
37266
|
if (normalizedData && effectiveFieldNames) {
|
|
37229
37267
|
const primaryField = effectiveFieldNames[0];
|
|
37230
|
-
|
|
37268
|
+
const titleDerivedFromPrimary = Boolean(
|
|
37269
|
+
!title && primaryField && normalizedData[primaryField]
|
|
37270
|
+
);
|
|
37271
|
+
if (titleDerivedFromPrimary) {
|
|
37231
37272
|
title = String(normalizedData[primaryField]);
|
|
37232
37273
|
}
|
|
37233
37274
|
const statusFields = effectiveFieldNames.filter(
|
|
@@ -37246,16 +37287,16 @@ var init_DetailPanel = __esm({
|
|
|
37246
37287
|
(f3) => f3.toLowerCase().includes("description") || f3.toLowerCase().includes("note")
|
|
37247
37288
|
);
|
|
37248
37289
|
const otherFields = effectiveFieldNames.filter(
|
|
37249
|
-
(f3) => f3 !== primaryField && !statusFields.includes(f3) && !progressFields.includes(f3) && !metricFields.includes(f3) && !dateFields.includes(f3) && !descriptionFields.includes(f3)
|
|
37290
|
+
(f3) => (!titleDerivedFromPrimary || f3 !== primaryField) && !statusFields.includes(f3) && !progressFields.includes(f3) && !metricFields.includes(f3) && !dateFields.includes(f3) && !descriptionFields.includes(f3)
|
|
37250
37291
|
);
|
|
37251
37292
|
sections = [];
|
|
37252
37293
|
if (statusFields.length > 0 || otherFields.length > 0) {
|
|
37253
37294
|
const overviewFields = [];
|
|
37254
|
-
[...statusFields, ...otherFields
|
|
37295
|
+
[...statusFields, ...otherFields].forEach((field) => {
|
|
37255
37296
|
const value = getNestedValue(normalizedData, field);
|
|
37256
37297
|
if (value !== void 0 && value !== null) {
|
|
37257
37298
|
overviewFields.push({
|
|
37258
|
-
label:
|
|
37299
|
+
label: labelFor(field),
|
|
37259
37300
|
value: renderRichFieldValue(value, field, fieldTypeMap[field]),
|
|
37260
37301
|
icon: getFieldIcon(field)
|
|
37261
37302
|
});
|
|
@@ -37271,7 +37312,7 @@ var init_DetailPanel = __esm({
|
|
|
37271
37312
|
const value = getNestedValue(normalizedData, field);
|
|
37272
37313
|
if (value !== void 0 && value !== null) {
|
|
37273
37314
|
metricsFields.push({
|
|
37274
|
-
label:
|
|
37315
|
+
label: labelFor(field),
|
|
37275
37316
|
value: renderRichFieldValue(value, field, fieldTypeMap[field]),
|
|
37276
37317
|
icon: getFieldIcon(field)
|
|
37277
37318
|
});
|
|
@@ -37287,7 +37328,7 @@ var init_DetailPanel = __esm({
|
|
|
37287
37328
|
const value = getNestedValue(normalizedData, field);
|
|
37288
37329
|
if (value !== void 0 && value !== null) {
|
|
37289
37330
|
timelineFields.push({
|
|
37290
|
-
label:
|
|
37331
|
+
label: labelFor(field),
|
|
37291
37332
|
value: renderRichFieldValue(value, field, fieldTypeMap[field]),
|
|
37292
37333
|
icon: getFieldIcon(field)
|
|
37293
37334
|
});
|
|
@@ -37303,7 +37344,7 @@ var init_DetailPanel = __esm({
|
|
|
37303
37344
|
const value = getNestedValue(normalizedData, field);
|
|
37304
37345
|
if (value !== void 0 && value !== null) {
|
|
37305
37346
|
descFields.push({
|
|
37306
|
-
label:
|
|
37347
|
+
label: labelFor(field),
|
|
37307
37348
|
value: renderRichFieldValue(value, field, fieldTypeMap[field]),
|
|
37308
37349
|
icon: getFieldIcon(field)
|
|
37309
37350
|
});
|
|
@@ -37351,7 +37392,7 @@ var init_DetailPanel = __esm({
|
|
|
37351
37392
|
if (typeof field === "string") {
|
|
37352
37393
|
const value = normalizedData ? getNestedValue(normalizedData, field) : void 0;
|
|
37353
37394
|
allFields.push({
|
|
37354
|
-
label:
|
|
37395
|
+
label: labelFor(field),
|
|
37355
37396
|
value: renderRichFieldValue(value, field, fieldTypeMap[field]),
|
|
37356
37397
|
icon: getFieldIcon(field)
|
|
37357
37398
|
});
|
|
@@ -43854,6 +43895,13 @@ function MaybeTraitScope({
|
|
|
43854
43895
|
if (wrap) {
|
|
43855
43896
|
return /* @__PURE__ */ jsx(TraitScopeProvider, { orbital, trait: sourceTrait, children });
|
|
43856
43897
|
}
|
|
43898
|
+
if (sourceTrait !== void 0 && schemaCtx !== null) {
|
|
43899
|
+
scopeWrapLog.warn("decline", {
|
|
43900
|
+
sourceTrait,
|
|
43901
|
+
orbitalsByTraitSize: schemaCtx.orbitalsByTrait.size,
|
|
43902
|
+
reason: "sourceTrait not in orbitalsByTrait \u2014 children render unscoped"
|
|
43903
|
+
});
|
|
43904
|
+
}
|
|
43857
43905
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
43858
43906
|
}
|
|
43859
43907
|
function UISlotComponent({
|
|
@@ -44151,7 +44199,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
44151
44199
|
const childId = `${parentId}-${index}`;
|
|
44152
44200
|
const childPath = parentPath === "root" ? `root.children.${index}` : `${parentPath}.children.${index}`;
|
|
44153
44201
|
const childAsRecord = child;
|
|
44154
|
-
const { type: _childType, props: nestedProps, _id: _childNodeId, children: _childChildren, ...flatProps } = childAsRecord;
|
|
44202
|
+
const { type: _childType, props: nestedProps, _id: _childNodeId, _sourceTrait: childSourceTrait, children: _childChildren, ...flatProps } = childAsRecord;
|
|
44155
44203
|
const resolvedProps = nestedProps !== void 0 ? nestedProps : flatProps;
|
|
44156
44204
|
if (_childChildren !== void 0 && nestedProps === void 0) {
|
|
44157
44205
|
resolvedProps.children = _childChildren;
|
|
@@ -44166,11 +44214,14 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
44166
44214
|
// (e.g. form-section inside a stack) can resolve entityDef via
|
|
44167
44215
|
// the trait's linkedEntity for form-field enrichment. The orbCtx
|
|
44168
44216
|
// (slot/transition/state/entity) propagates the same way so every
|
|
44169
|
-
// nested node carries a complete contextual-edit address.
|
|
44170
|
-
|
|
44217
|
+
// nested node carries a complete contextual-edit address. A child
|
|
44218
|
+
// carrying its own `_sourceTrait` (multi-source slot stack) owns it
|
|
44219
|
+
// outright — inheriting the synthetic wrapper's sentinel instead
|
|
44220
|
+
// would erase the real owner.
|
|
44221
|
+
...childSourceTrait !== void 0 ? { sourceTrait: childSourceTrait } : sourceTrait !== void 0 && { sourceTrait },
|
|
44171
44222
|
...orbCtx ?? {}
|
|
44172
44223
|
};
|
|
44173
|
-
|
|
44224
|
+
const renderedChild = /* @__PURE__ */ jsx(
|
|
44174
44225
|
SlotContentRenderer,
|
|
44175
44226
|
{
|
|
44176
44227
|
content: childContent,
|
|
@@ -44179,6 +44230,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
44179
44230
|
},
|
|
44180
44231
|
childId
|
|
44181
44232
|
);
|
|
44233
|
+
return childSourceTrait !== void 0 ? /* @__PURE__ */ jsx(MaybeTraitScope, { sourceTrait: childSourceTrait, children: renderedChild }, childId) : renderedChild;
|
|
44182
44234
|
});
|
|
44183
44235
|
}
|
|
44184
44236
|
function toDrawableNodes(children) {
|
|
@@ -45461,6 +45513,28 @@ function extractRouteParams2(pattern, path) {
|
|
|
45461
45513
|
function pathMatches2(pattern, path) {
|
|
45462
45514
|
return matchPath2(pattern, path) !== null;
|
|
45463
45515
|
}
|
|
45516
|
+
function comparePathSpecificity2(a, b) {
|
|
45517
|
+
const aParts = a.split("/").filter(Boolean);
|
|
45518
|
+
const bParts = b.split("/").filter(Boolean);
|
|
45519
|
+
const shared = Math.min(aParts.length, bParts.length);
|
|
45520
|
+
for (let i = 0; i < shared; i++) {
|
|
45521
|
+
const aParam = aParts[i].startsWith(":");
|
|
45522
|
+
const bParam = bParts[i].startsWith(":");
|
|
45523
|
+
if (aParam !== bParam) return aParam ? 1 : -1;
|
|
45524
|
+
}
|
|
45525
|
+
return 0;
|
|
45526
|
+
}
|
|
45527
|
+
function matchPathAmong2(candidates, path, pathOf) {
|
|
45528
|
+
const routed = candidates.filter((candidate) => Boolean(pathOf(candidate)));
|
|
45529
|
+
const ranked = [...routed].sort(
|
|
45530
|
+
(a, b) => comparePathSpecificity2(pathOf(a), pathOf(b))
|
|
45531
|
+
);
|
|
45532
|
+
for (const candidate of ranked) {
|
|
45533
|
+
const params = matchPath2(pathOf(candidate), path);
|
|
45534
|
+
if (params !== null) return { candidate, params };
|
|
45535
|
+
}
|
|
45536
|
+
return null;
|
|
45537
|
+
}
|
|
45464
45538
|
function isInlineOrbital(orbital) {
|
|
45465
45539
|
return "name" in orbital && typeof orbital.name === "string";
|
|
45466
45540
|
}
|
|
@@ -45469,21 +45543,22 @@ function isInlinePage(page) {
|
|
|
45469
45543
|
}
|
|
45470
45544
|
function findPageByPath2(schema, path) {
|
|
45471
45545
|
if (!schema.orbitals) return null;
|
|
45546
|
+
const candidates = [];
|
|
45472
45547
|
for (const orbital of schema.orbitals) {
|
|
45473
45548
|
if (!isInlineOrbital(orbital)) continue;
|
|
45474
45549
|
if (!orbital.pages) continue;
|
|
45475
45550
|
for (const pageRef of orbital.pages) {
|
|
45476
45551
|
if (!isInlinePage(pageRef)) continue;
|
|
45477
|
-
|
|
45478
|
-
const pagePath = page.path;
|
|
45479
|
-
if (!pagePath) continue;
|
|
45480
|
-
const params = matchPath2(pagePath, path);
|
|
45481
|
-
if (params !== null) {
|
|
45482
|
-
return { page, params, orbitalName: orbital.name };
|
|
45483
|
-
}
|
|
45552
|
+
candidates.push({ page: pageRef, orbitalName: orbital.name });
|
|
45484
45553
|
}
|
|
45485
45554
|
}
|
|
45486
|
-
|
|
45555
|
+
const hit = matchPathAmong2(candidates, path, (entry) => entry.page.path);
|
|
45556
|
+
if (!hit) return null;
|
|
45557
|
+
return {
|
|
45558
|
+
page: hit.candidate.page,
|
|
45559
|
+
params: hit.params,
|
|
45560
|
+
orbitalName: hit.candidate.orbitalName
|
|
45561
|
+
};
|
|
45487
45562
|
}
|
|
45488
45563
|
function findPageByName2(schema, pageName) {
|
|
45489
45564
|
if (!schema.orbitals) return null;
|
|
@@ -46077,4 +46152,4 @@ function GameAudioProvider2({
|
|
|
46077
46152
|
}
|
|
46078
46153
|
GameAudioProvider2.displayName = "GameAudioProvider";
|
|
46079
46154
|
|
|
46080
|
-
export { ANONYMOUS_USER, CurrentPagePathContext, CurrentPagePathProvider, EntitySchemaProvider, EventBusContext2 as EventBusContext, EventBusProvider, GameAudioContext2 as GameAudioContext, GameAudioProvider2 as GameAudioProvider, NavigationProvider2 as NavigationProvider, OfflineModeProvider, OrbitalProvider, OrbitalThemeProvider, SelectionContext, SelectionProvider, ServerBridgeProvider, TraitContext, TraitProvider, TraitScopeProvider3 as TraitScopeProvider, UserContext, UserProvider, VerificationProvider, extractRouteParams2 as extractRouteParams, findPageByName2 as findPageByName, findPageByPath2 as findPageByPath, getAllPages2 as getAllPages, getDefaultPage2 as getDefaultPage, matchPath2 as matchPath, pathMatches2 as pathMatches, useActivePage2 as useActivePage, useCurrentPagePath2 as useCurrentPagePath, useEntitySchema, useEntitySchemaOptional6 as useEntitySchemaOptional, useGameAudioContext2 as useGameAudioContext, useGameAudioContextOptional2 as useGameAudioContextOptional, useHasPermission, useHasRole, useInitPayload2 as useInitPayload, useNavigateTo2 as useNavigateTo, useNavigation2 as useNavigation, useNavigationId2 as useNavigationId, useNavigationState2 as useNavigationState, useOfflineMode, useOptionalOfflineMode, useSelection, useSelectionOptional, useServerBridge, useTrait, useTraitContext, useTraitScope, useTraitScopeChain2 as useTraitScopeChain, useUser, useUserForEvaluation };
|
|
46155
|
+
export { ANONYMOUS_USER, CurrentPagePathContext, CurrentPagePathProvider, EntitySchemaProvider, EventBusContext2 as EventBusContext, EventBusProvider, GameAudioContext2 as GameAudioContext, GameAudioProvider2 as GameAudioProvider, NavigationProvider2 as NavigationProvider, OfflineModeProvider, OrbitalProvider, OrbitalThemeProvider, SelectionContext, SelectionProvider, ServerBridgeProvider, TraitContext, TraitProvider, TraitScopeProvider3 as TraitScopeProvider, UserContext, UserProvider, VerificationProvider, comparePathSpecificity2 as comparePathSpecificity, extractRouteParams2 as extractRouteParams, findPageByName2 as findPageByName, findPageByPath2 as findPageByPath, getAllPages2 as getAllPages, getDefaultPage2 as getDefaultPage, matchPath2 as matchPath, matchPathAmong2 as matchPathAmong, pathMatches2 as pathMatches, useActivePage2 as useActivePage, useCurrentPagePath2 as useCurrentPagePath, useEntitySchema, useEntitySchemaOptional6 as useEntitySchemaOptional, useGameAudioContext2 as useGameAudioContext, useGameAudioContextOptional2 as useGameAudioContextOptional, useHasPermission, useHasRole, useInitPayload2 as useInitPayload, useNavigateTo2 as useNavigateTo, useNavigation2 as useNavigation, useNavigationId2 as useNavigationId, useNavigationState2 as useNavigationState, useOfflineMode, useOptionalOfflineMode, useSelection, useSelectionOptional, useServerBridge, useTrait, useTraitContext, useTraitScope, useTraitScopeChain2 as useTraitScopeChain, useUser, useUserForEvaluation };
|
package/dist/renderer/index.cjs
CHANGED
|
@@ -769,6 +769,10 @@ Object.defineProperty(exports, "NavigationProvider", {
|
|
|
769
769
|
enumerable: true,
|
|
770
770
|
get: function () { return providers.NavigationProvider; }
|
|
771
771
|
});
|
|
772
|
+
Object.defineProperty(exports, "comparePathSpecificity", {
|
|
773
|
+
enumerable: true,
|
|
774
|
+
get: function () { return providers.comparePathSpecificity; }
|
|
775
|
+
});
|
|
772
776
|
Object.defineProperty(exports, "extractRouteParams", {
|
|
773
777
|
enumerable: true,
|
|
774
778
|
get: function () { return providers.extractRouteParams; }
|
|
@@ -793,6 +797,10 @@ Object.defineProperty(exports, "matchPath", {
|
|
|
793
797
|
enumerable: true,
|
|
794
798
|
get: function () { return providers.matchPath; }
|
|
795
799
|
});
|
|
800
|
+
Object.defineProperty(exports, "matchPathAmong", {
|
|
801
|
+
enumerable: true,
|
|
802
|
+
get: function () { return providers.matchPathAmong; }
|
|
803
|
+
});
|
|
796
804
|
Object.defineProperty(exports, "pathMatches", {
|
|
797
805
|
enumerable: true,
|
|
798
806
|
get: function () { return providers.pathMatches; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MappedPattern, C as ClientEffect,
|
|
2
|
-
export { E as EventResponse, N as NavigationContextValue, b as NavigationProvider, c as NavigationProviderProps, d as NavigationState, O as OfflineExecutor,
|
|
1
|
+
import { M as MappedPattern, C as ClientEffect, s as ClientEffectExecutorConfig, t as NotifyOptions, D as DataContext, v as DataResolution, S as SlotDefinition } from '../offline-executor-Qz4b6GpF.cjs';
|
|
2
|
+
export { E as EventResponse, N as NavigationContextValue, b as NavigationProvider, c as NavigationProviderProps, d as NavigationState, O as OfflineExecutor, w as OfflineExecutorConfig, x as OfflineExecutorState, P as PendingSyncEffect, y as SlotType, a as UseOfflineExecutorOptions, U as UseOfflineExecutorResult, e as comparePathSpecificity, z as createOfflineExecutor, f as extractRouteParams, g as findPageByName, h as findPageByPath, i as getAllPages, j as getDefaultPage, m as matchPath, k as matchPathAmong, p as pathMatches, u as useActivePage, l as useInitPayload, n as useNavigateTo, o as useNavigation, q as useNavigationId, r as useNavigationState, A as useOfflineExecutor } from '../offline-executor-Qz4b6GpF.cjs';
|
|
3
3
|
import { PatternPropDef } from '@almadar/core/patterns';
|
|
4
4
|
import { PatternConfig, FieldValue, EntityRow, UISlot } from '@almadar/core';
|
|
5
5
|
export { PatternConfig, UISlot } from '@almadar/core';
|
package/dist/renderer/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MappedPattern, C as ClientEffect,
|
|
2
|
-
export { E as EventResponse, N as NavigationContextValue, b as NavigationProvider, c as NavigationProviderProps, d as NavigationState, O as OfflineExecutor,
|
|
1
|
+
import { M as MappedPattern, C as ClientEffect, s as ClientEffectExecutorConfig, t as NotifyOptions, D as DataContext, v as DataResolution, S as SlotDefinition } from '../offline-executor-Qz4b6GpF.js';
|
|
2
|
+
export { E as EventResponse, N as NavigationContextValue, b as NavigationProvider, c as NavigationProviderProps, d as NavigationState, O as OfflineExecutor, w as OfflineExecutorConfig, x as OfflineExecutorState, P as PendingSyncEffect, y as SlotType, a as UseOfflineExecutorOptions, U as UseOfflineExecutorResult, e as comparePathSpecificity, z as createOfflineExecutor, f as extractRouteParams, g as findPageByName, h as findPageByPath, i as getAllPages, j as getDefaultPage, m as matchPath, k as matchPathAmong, p as pathMatches, u as useActivePage, l as useInitPayload, n as useNavigateTo, o as useNavigation, q as useNavigationId, r as useNavigationState, A as useOfflineExecutor } from '../offline-executor-Qz4b6GpF.js';
|
|
3
3
|
import { PatternPropDef } from '@almadar/core/patterns';
|
|
4
4
|
import { PatternConfig, FieldValue, EntityRow, UISlot } from '@almadar/core';
|
|
5
5
|
export { PatternConfig, UISlot } from '@almadar/core';
|
package/dist/renderer/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createLogger } from '@almadar/logger';
|
|
2
2
|
import { createContext, useRef, useCallback, useEffect, useContext, useState } from 'react';
|
|
3
|
-
export { NavigationProvider, extractRouteParams, findPageByName, findPageByPath, getAllPages, getDefaultPage, matchPath, pathMatches, useActivePage, useInitPayload, useNavigateTo, useNavigation, useNavigationId, useNavigationState } from '@almadar/ui/providers';
|
|
3
|
+
export { NavigationProvider, comparePathSpecificity, extractRouteParams, findPageByName, findPageByPath, getAllPages, getDefaultPage, matchPath, matchPathAmong, pathMatches, useActivePage, useInitPayload, useNavigateTo, useNavigation, useNavigationId, useNavigationState } from '@almadar/ui/providers';
|
|
4
4
|
import { componentMapping as componentMapping$1, patternsRegistry } from '@almadar/core/patterns';
|
|
5
5
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|