@almadar/ui 6.27.0 → 6.29.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-CTZw2DbY.d.cts → EntityBindingContext-UyeCfEBS.d.cts} +29 -3
- package/dist/{EntityBindingContext-CTZw2DbY.d.ts → EntityBindingContext-UyeCfEBS.d.ts} +29 -3
- package/dist/avl/index.cjs +90 -50
- package/dist/avl/index.js +90 -50
- package/dist/components/index.cjs +50 -40
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +50 -40
- package/dist/providers/index.cjs +56 -44
- package/dist/providers/index.d.cts +1 -1
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.js +56 -44
- package/dist/runtime/index.cjs +90 -50
- package/dist/runtime/index.d.cts +16 -2
- package/dist/runtime/index.d.ts +16 -2
- package/dist/runtime/index.js +90 -50
- package/package.json +5 -5
package/dist/avl/index.js
CHANGED
|
@@ -6082,6 +6082,13 @@ var init_slot_types = __esm({
|
|
|
6082
6082
|
nextRefId = 1;
|
|
6083
6083
|
}
|
|
6084
6084
|
});
|
|
6085
|
+
var SlotContainedContext;
|
|
6086
|
+
var init_slotContained = __esm({
|
|
6087
|
+
"lib/slotContained.ts"() {
|
|
6088
|
+
"use client";
|
|
6089
|
+
SlotContainedContext = createContext(false);
|
|
6090
|
+
}
|
|
6091
|
+
});
|
|
6085
6092
|
function buildForkPaths(x, y, branches, scale) {
|
|
6086
6093
|
const inLength = 30 * scale;
|
|
6087
6094
|
const outLength = 30 * scale;
|
|
@@ -38394,7 +38401,6 @@ function TableView({
|
|
|
38394
38401
|
columns,
|
|
38395
38402
|
fields,
|
|
38396
38403
|
itemActions,
|
|
38397
|
-
maxInlineActions,
|
|
38398
38404
|
itemClickEvent = "",
|
|
38399
38405
|
selectable = false,
|
|
38400
38406
|
selectEvent,
|
|
@@ -38428,8 +38434,7 @@ function TableView({
|
|
|
38428
38434
|
const [localSelected, setLocalSelected] = React96__default.useState(/* @__PURE__ */ new Set());
|
|
38429
38435
|
const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
|
|
38430
38436
|
const actionDefs = Array.isArray(itemActions) ? itemActions : [];
|
|
38431
|
-
const
|
|
38432
|
-
const overflowActions = maxInlineActions != null ? actionDefs.slice(maxInlineActions) : actionDefs;
|
|
38437
|
+
const overflowActions = actionDefs;
|
|
38433
38438
|
const fireAction = (action, row) => eventBus.emit(`UI:${action.event}`, {
|
|
38434
38439
|
id: row.id,
|
|
38435
38440
|
row
|
|
@@ -38611,7 +38616,7 @@ function TableView({
|
|
|
38611
38616
|
}
|
|
38612
38617
|
return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx("span", { className: "truncate text-foreground", children: formatCell(raw, col.format, relationsData?.[col.field ?? col.key]) }) }, col.key);
|
|
38613
38618
|
}),
|
|
38614
|
-
hasActions && /* @__PURE__ */
|
|
38619
|
+
hasActions && /* @__PURE__ */ jsx(
|
|
38615
38620
|
HStack,
|
|
38616
38621
|
{
|
|
38617
38622
|
gap: "xs",
|
|
@@ -38625,38 +38630,20 @@ function TableView({
|
|
|
38625
38630
|
"border-l border-[var(--color-border)]",
|
|
38626
38631
|
lk.striped && index % 2 === 1 ? "bg-[var(--color-surface-subtle)]" : "bg-[var(--color-card)] group-hover:bg-[var(--color-surface-subtle)]"
|
|
38627
38632
|
),
|
|
38628
|
-
children:
|
|
38629
|
-
|
|
38630
|
-
|
|
38631
|
-
|
|
38632
|
-
|
|
38633
|
-
|
|
38634
|
-
|
|
38635
|
-
|
|
38636
|
-
|
|
38637
|
-
|
|
38638
|
-
|
|
38639
|
-
|
|
38640
|
-
|
|
38641
|
-
|
|
38642
|
-
},
|
|
38643
|
-
action.event
|
|
38644
|
-
)),
|
|
38645
|
-
overflowActions.length > 0 && /* @__PURE__ */ jsx(
|
|
38646
|
-
Menu,
|
|
38647
|
-
{
|
|
38648
|
-
position: "bottom-end",
|
|
38649
|
-
trigger: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", "data-row-id": String(row.id), children: /* @__PURE__ */ jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
|
|
38650
|
-
items: overflowActions.map((action) => ({
|
|
38651
|
-
label: action.label,
|
|
38652
|
-
icon: action.icon,
|
|
38653
|
-
event: action.event,
|
|
38654
|
-
variant: action.variant === "danger" ? "danger" : "default",
|
|
38655
|
-
onClick: () => fireAction(action, row)
|
|
38656
|
-
}))
|
|
38657
|
-
}
|
|
38658
|
-
)
|
|
38659
|
-
]
|
|
38633
|
+
children: overflowActions.length > 0 && /* @__PURE__ */ jsx(
|
|
38634
|
+
Menu,
|
|
38635
|
+
{
|
|
38636
|
+
position: "bottom-end",
|
|
38637
|
+
trigger: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", "data-row-id": String(row.id), children: /* @__PURE__ */ jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
|
|
38638
|
+
items: overflowActions.map((action) => ({
|
|
38639
|
+
label: action.label,
|
|
38640
|
+
icon: action.icon,
|
|
38641
|
+
event: action.event,
|
|
38642
|
+
variant: action.variant === "danger" ? "danger" : "default",
|
|
38643
|
+
onClick: () => fireAction(action, row)
|
|
38644
|
+
}))
|
|
38645
|
+
}
|
|
38646
|
+
)
|
|
38660
38647
|
}
|
|
38661
38648
|
)
|
|
38662
38649
|
]
|
|
@@ -47673,6 +47660,7 @@ var init_DetailPanel = __esm({
|
|
|
47673
47660
|
init_EmptyState();
|
|
47674
47661
|
init_cn();
|
|
47675
47662
|
init_portalRoot();
|
|
47663
|
+
init_slotContained();
|
|
47676
47664
|
init_format();
|
|
47677
47665
|
init_getNestedValue();
|
|
47678
47666
|
init_relationLabel();
|
|
@@ -47704,6 +47692,7 @@ var init_DetailPanel = __esm({
|
|
|
47704
47692
|
}) => {
|
|
47705
47693
|
const eventBus = useEventBus();
|
|
47706
47694
|
const { t } = useTranslate();
|
|
47695
|
+
const contained = useContext(SlotContainedContext);
|
|
47707
47696
|
const [titleDraft, setTitleDraft] = React96__default.useState(null);
|
|
47708
47697
|
const isFieldDefArray = (arr) => {
|
|
47709
47698
|
if (!arr || arr.length === 0) return false;
|
|
@@ -48091,8 +48080,9 @@ var init_DetailPanel = __esm({
|
|
|
48091
48080
|
if (!slideOver) {
|
|
48092
48081
|
return /* @__PURE__ */ jsx(Box, { className, children: content });
|
|
48093
48082
|
}
|
|
48094
|
-
const panel = /* @__PURE__ */ jsx(Box, { className: cn("fixed inset-y-0 right-0 w-full max-w-2xl bg-card shadow-lg z-50 overflow-y-auto p-6", className), children: content });
|
|
48095
|
-
|
|
48083
|
+
const panel = /* @__PURE__ */ jsx(Box, { className: cn(contained ? "absolute" : "fixed", "inset-y-0 right-0 w-full max-w-2xl bg-card shadow-lg z-50 overflow-y-auto p-6", className), children: content });
|
|
48084
|
+
if (contained || typeof document === "undefined") return panel;
|
|
48085
|
+
return createPortal(panel, getOrCreatePortalRoot());
|
|
48096
48086
|
};
|
|
48097
48087
|
DetailPanel.displayName = "DetailPanel";
|
|
48098
48088
|
}
|
|
@@ -54589,6 +54579,7 @@ var init_component_registry_generated = __esm({
|
|
|
54589
54579
|
// components/core/organisms/UISlotRenderer.tsx
|
|
54590
54580
|
var UISlotRenderer_exports = {};
|
|
54591
54581
|
__export(UISlotRenderer_exports, {
|
|
54582
|
+
SlotContainedContext: () => SlotContainedContext,
|
|
54592
54583
|
SlotContentRenderer: () => SlotContentRenderer,
|
|
54593
54584
|
SuspenseConfigProvider: () => SuspenseConfigProvider,
|
|
54594
54585
|
UISlotComponent: () => UISlotComponent,
|
|
@@ -54761,6 +54752,25 @@ function renderContainedPortal(t, slot, content, onDismiss) {
|
|
|
54761
54752
|
}
|
|
54762
54753
|
);
|
|
54763
54754
|
case "drawer":
|
|
54755
|
+
if (content.pattern === "detail-panel" && content.props.slideOver === true) {
|
|
54756
|
+
return /* @__PURE__ */ jsx(
|
|
54757
|
+
Box,
|
|
54758
|
+
{
|
|
54759
|
+
id: slotId,
|
|
54760
|
+
className: "absolute inset-0 z-50 overflow-hidden",
|
|
54761
|
+
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
54762
|
+
onClick: onDismiss,
|
|
54763
|
+
children: /* @__PURE__ */ jsx(
|
|
54764
|
+
Box,
|
|
54765
|
+
{
|
|
54766
|
+
className: "absolute inset-y-0 right-0 pointer-events-auto",
|
|
54767
|
+
onClick: (e) => e.stopPropagation(),
|
|
54768
|
+
children: slotContent
|
|
54769
|
+
}
|
|
54770
|
+
)
|
|
54771
|
+
}
|
|
54772
|
+
);
|
|
54773
|
+
}
|
|
54764
54774
|
return /* @__PURE__ */ jsx(
|
|
54765
54775
|
Box,
|
|
54766
54776
|
{
|
|
@@ -55612,7 +55622,7 @@ function UISlotRenderer({
|
|
|
55612
55622
|
}
|
|
55613
55623
|
return wrapped;
|
|
55614
55624
|
}
|
|
55615
|
-
var scopeWrapLog, TRAIT_BINDING_RE, SuspenseConfigContext,
|
|
55625
|
+
var scopeWrapLog, TRAIT_BINDING_RE, SuspenseConfigContext, SLOT_SKELETON_MAP, CONTENT_NODE_SLOTS, PATTERNS_WITH_CHILDREN, traitRefPresenceCache;
|
|
55616
55626
|
var init_UISlotRenderer = __esm({
|
|
55617
55627
|
"components/core/organisms/UISlotRenderer.tsx"() {
|
|
55618
55628
|
"use client";
|
|
@@ -55627,6 +55637,7 @@ var init_UISlotRenderer = __esm({
|
|
|
55627
55637
|
init_cn();
|
|
55628
55638
|
init_format();
|
|
55629
55639
|
init_portalRoot();
|
|
55640
|
+
init_slotContained();
|
|
55630
55641
|
init_ErrorBoundary();
|
|
55631
55642
|
init_Skeleton();
|
|
55632
55643
|
init_renderer();
|
|
@@ -55636,7 +55647,6 @@ var init_UISlotRenderer = __esm({
|
|
|
55636
55647
|
scopeWrapLog = createLogger("almadar:ui:scope-wrap");
|
|
55637
55648
|
TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
|
|
55638
55649
|
SuspenseConfigContext = createContext({ enabled: false });
|
|
55639
|
-
SlotContainedContext = createContext(false);
|
|
55640
55650
|
SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
|
|
55641
55651
|
SLOT_SKELETON_MAP = {
|
|
55642
55652
|
main: "table",
|
|
@@ -60478,6 +60488,9 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
60478
60488
|
const normalizedEvent = normalizeEventKey(eventKey);
|
|
60479
60489
|
return managerRef.current.canHandleEvent(traitName, normalizedEvent);
|
|
60480
60490
|
}, []);
|
|
60491
|
+
const commitServerEntity = useCallback((traitName, entity) => {
|
|
60492
|
+
traitFieldStatesRef.current.set(traitName, entity);
|
|
60493
|
+
}, []);
|
|
60481
60494
|
useEffect(() => {
|
|
60482
60495
|
const allEvents = /* @__PURE__ */ new Set();
|
|
60483
60496
|
for (const binding of traitBindings) {
|
|
@@ -60641,7 +60654,8 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
60641
60654
|
sendEvent,
|
|
60642
60655
|
getTraitState,
|
|
60643
60656
|
canHandleEvent,
|
|
60644
|
-
entityBindingSource
|
|
60657
|
+
entityBindingSource,
|
|
60658
|
+
commitServerEntity
|
|
60645
60659
|
};
|
|
60646
60660
|
}
|
|
60647
60661
|
|
|
@@ -60759,7 +60773,7 @@ function NavStackRefBridge({ apiRef }) {
|
|
|
60759
60773
|
}, [api, apiRef]);
|
|
60760
60774
|
return null;
|
|
60761
60775
|
}
|
|
60762
|
-
function TraitInitializer({ traits: traits2, routeParams, orbitalNames, onNavigate, onNavigateBack, onLocalFallback, localFallbackTimeoutMs, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits, callsiteCaptureChildrenByTrait, serverActiveTraits, children }) {
|
|
60776
|
+
function TraitInitializer({ traits: traits2, routeParams, orbitalNames, onNavigate, onNavigateBack, onLocalFallback, localFallbackTimeoutMs, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits, callsiteCaptureChildrenByTrait, serverActiveTraits, user, children }) {
|
|
60763
60777
|
const bridge = useServerBridge();
|
|
60764
60778
|
const activeTraitNames = useMemo(
|
|
60765
60779
|
() => new Set(traits2.map((b) => b.trait.name).filter((n) => !!n)),
|
|
@@ -60777,6 +60791,8 @@ function TraitInitializer({ traits: traits2, routeParams, orbitalNames, onNaviga
|
|
|
60777
60791
|
[serverActiveTraits]
|
|
60778
60792
|
);
|
|
60779
60793
|
const uiSlots = useUISlots();
|
|
60794
|
+
const commitServerEntityRef = useRef(() => {
|
|
60795
|
+
});
|
|
60780
60796
|
const onEventProcessed = useCallback((event, payload, dispatchedOrbitals, tick, sourceTrait, locallyEmitted, results, entityByTrait) => {
|
|
60781
60797
|
if (!bridge.connected || !orbitalNames?.length) return;
|
|
60782
60798
|
const targets = dispatchedOrbitals && dispatchedOrbitals.size > 0 ? orbitalNames.filter((n) => dispatchedOrbitals.has(n)) : orbitalNames;
|
|
@@ -60791,14 +60807,20 @@ function TraitInitializer({ traits: traits2, routeParams, orbitalNames, onNaviga
|
|
|
60791
60807
|
void bridge.sendEvent(name, event, withActiveTraits(payload), tick, sourceTrait);
|
|
60792
60808
|
continue;
|
|
60793
60809
|
}
|
|
60794
|
-
void bridge.sendEvent(name, event, withActiveTraits(payload), void 0, void 0, locallyEmitted, results, entityByTrait).then(({ effects, meta }) => {
|
|
60810
|
+
void bridge.sendEvent(name, event, withActiveTraits(payload), void 0, void 0, locallyEmitted, results, entityByTrait, user ?? void 0).then(({ effects, meta }) => {
|
|
60795
60811
|
recordServerResponse(name, event, { ...meta, effectResults: effectResultsToTraces(meta.effectResults) });
|
|
60812
|
+
if (meta.entityByTrait) {
|
|
60813
|
+
for (const [traitName, entity] of Object.entries(meta.entityByTrait)) {
|
|
60814
|
+
commitServerEntityRef.current(traitName, entity);
|
|
60815
|
+
}
|
|
60816
|
+
}
|
|
60796
60817
|
applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits, activeTraitNamesRef.current, onNavigateBack);
|
|
60797
60818
|
});
|
|
60798
60819
|
}
|
|
60799
|
-
}, [bridge.connected, bridge.sendEvent, orbitalNames, uiSlots, onNavigate, onNavigateBack, embeddedTraits, activeTraitNames, withActiveTraits]);
|
|
60820
|
+
}, [bridge.connected, bridge.sendEvent, orbitalNames, uiSlots, onNavigate, onNavigateBack, embeddedTraits, activeTraitNames, withActiveTraits, user]);
|
|
60800
60821
|
const opts = orbitalNames ? { onEventProcessed, navigate: onNavigate, navigateBack: onNavigateBack, traitConfigsByName, orbitalsByTrait, embeddedTraits, callsiteCaptureChildrenByTrait, initPayload: routeParams } : { navigate: onNavigate, navigateBack: onNavigateBack, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits, callsiteCaptureChildrenByTrait, initPayload: routeParams };
|
|
60801
|
-
const { sendEvent, entityBindingSource } = useTraitStateMachine(traits2, uiSlots, opts);
|
|
60822
|
+
const { sendEvent, entityBindingSource, commitServerEntity } = useTraitStateMachine(traits2, uiSlots, opts);
|
|
60823
|
+
commitServerEntityRef.current = commitServerEntity;
|
|
60802
60824
|
const initSentRef = useRef(false);
|
|
60803
60825
|
const prevTraitsRef = useRef(void 0);
|
|
60804
60826
|
const paramsKey = JSON.stringify(routeParams ?? {});
|
|
@@ -60838,8 +60860,23 @@ function TraitInitializer({ traits: traits2, routeParams, orbitalNames, onNaviga
|
|
|
60838
60860
|
initSentRef.current = true;
|
|
60839
60861
|
(async () => {
|
|
60840
60862
|
for (const name of orbitalNames) {
|
|
60841
|
-
const { effects, meta } = await bridge.sendEvent(
|
|
60863
|
+
const { effects, meta } = await bridge.sendEvent(
|
|
60864
|
+
name,
|
|
60865
|
+
"INIT",
|
|
60866
|
+
withActiveTraits({ ...routeParams ?? {} }),
|
|
60867
|
+
void 0,
|
|
60868
|
+
void 0,
|
|
60869
|
+
void 0,
|
|
60870
|
+
void 0,
|
|
60871
|
+
void 0,
|
|
60872
|
+
user ?? void 0
|
|
60873
|
+
);
|
|
60842
60874
|
recordServerResponse(name, "INIT", { ...meta, effectResults: effectResultsToTraces(meta.effectResults) });
|
|
60875
|
+
if (meta.entityByTrait) {
|
|
60876
|
+
for (const [traitName, entity] of Object.entries(meta.entityByTrait)) {
|
|
60877
|
+
commitServerEntityRef.current(traitName, entity);
|
|
60878
|
+
}
|
|
60879
|
+
}
|
|
60843
60880
|
const effectTraces = [
|
|
60844
60881
|
{ type: "fetch", args: [], status: "executed" },
|
|
60845
60882
|
...effects.map((eff) => ({
|
|
@@ -60859,7 +60896,7 @@ function TraitInitializer({ traits: traits2, routeParams, orbitalNames, onNaviga
|
|
|
60859
60896
|
applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits, activeTraitNamesRef.current, onNavigateBack);
|
|
60860
60897
|
}
|
|
60861
60898
|
})();
|
|
60862
|
-
}, [bridge.connected, orbitalNames, bridge.sendEvent, uiSlots, onNavigate, onNavigateBack, embeddedTraits, activeTraitNames, withActiveTraits, routeParams]);
|
|
60899
|
+
}, [bridge.connected, orbitalNames, bridge.sendEvent, uiSlots, onNavigate, onNavigateBack, embeddedTraits, activeTraitNames, withActiveTraits, routeParams, user]);
|
|
60863
60900
|
return /* @__PURE__ */ jsx(EntityBindingContext.Provider, { value: entityBindingSource, children });
|
|
60864
60901
|
}
|
|
60865
60902
|
function FitToBox({ children }) {
|
|
@@ -60886,7 +60923,7 @@ function FitToBox({ children }) {
|
|
|
60886
60923
|
}, []);
|
|
60887
60924
|
return /* @__PURE__ */ jsx("div", { ref: outerRef, className: "relative h-full w-full overflow-hidden", children: /* @__PURE__ */ jsx("div", { ref: innerRef, style: { transform: `scale(${scale})`, transformOrigin: "top left", width: "fit-content" }, children }) });
|
|
60888
60925
|
}
|
|
60889
|
-
function SchemaRunner({ schema, serverUrl, transport, getAccessToken, mockData, pageName, routeParams, onNavigate, onNavigateBack, onLocalFallback, localFallbackTimeoutMs, persistence }) {
|
|
60926
|
+
function SchemaRunner({ schema, serverUrl, transport, getAccessToken, mockData, pageName, routeParams, onNavigate, onNavigateBack, onLocalFallback, localFallbackTimeoutMs, persistence, user }) {
|
|
60890
60927
|
const { traits: traits2, allEntities, allTraits, ir } = useResolvedSchema(schema, pageName);
|
|
60891
60928
|
const allPageTraits = useMemo(() => {
|
|
60892
60929
|
let base;
|
|
@@ -61051,6 +61088,7 @@ function SchemaRunner({ schema, serverUrl, transport, getAccessToken, mockData,
|
|
|
61051
61088
|
onLocalFallback,
|
|
61052
61089
|
localFallbackTimeoutMs,
|
|
61053
61090
|
persistence,
|
|
61091
|
+
user,
|
|
61054
61092
|
children: /* @__PURE__ */ jsx(OrbitalThemeProvider, { theme: activeOrbitalTheme, children: /* @__PURE__ */ jsx(Box, { className: "h-full min-h-full overflow-auto p-4", children: /* @__PURE__ */ jsx(UISlotRenderer, { includeHud: true, hudMode: "inline", includeFloating: true }) }) })
|
|
61055
61093
|
}
|
|
61056
61094
|
)
|
|
@@ -61257,7 +61295,8 @@ function OrbPreview({
|
|
|
61257
61295
|
onNavigateBack: handleNavigateBack,
|
|
61258
61296
|
onLocalFallback: handleLocalFallback,
|
|
61259
61297
|
localFallbackTimeoutMs,
|
|
61260
|
-
persistence
|
|
61298
|
+
persistence,
|
|
61299
|
+
user
|
|
61261
61300
|
}
|
|
61262
61301
|
) }) : /* @__PURE__ */ jsx(
|
|
61263
61302
|
SchemaRunner,
|
|
@@ -61273,7 +61312,8 @@ function OrbPreview({
|
|
|
61273
61312
|
onNavigateBack: handleNavigateBack,
|
|
61274
61313
|
onLocalFallback: handleLocalFallback,
|
|
61275
61314
|
localFallbackTimeoutMs,
|
|
61276
|
-
persistence
|
|
61315
|
+
persistence,
|
|
61316
|
+
user
|
|
61277
61317
|
}
|
|
61278
61318
|
) }) })
|
|
61279
61319
|
]
|
|
@@ -7058,6 +7058,13 @@ var init_slot_types = __esm({
|
|
|
7058
7058
|
nextRefId = 1;
|
|
7059
7059
|
}
|
|
7060
7060
|
});
|
|
7061
|
+
var SlotContainedContext;
|
|
7062
|
+
var init_slotContained = __esm({
|
|
7063
|
+
"lib/slotContained.ts"() {
|
|
7064
|
+
"use client";
|
|
7065
|
+
SlotContainedContext = React79.createContext(false);
|
|
7066
|
+
}
|
|
7067
|
+
});
|
|
7061
7068
|
exports.ErrorState = void 0;
|
|
7062
7069
|
var init_ErrorState = __esm({
|
|
7063
7070
|
"components/core/molecules/ErrorState.tsx"() {
|
|
@@ -36972,7 +36979,6 @@ function TableView({
|
|
|
36972
36979
|
columns,
|
|
36973
36980
|
fields,
|
|
36974
36981
|
itemActions,
|
|
36975
|
-
maxInlineActions,
|
|
36976
36982
|
itemClickEvent = "",
|
|
36977
36983
|
selectable = false,
|
|
36978
36984
|
selectEvent,
|
|
@@ -37006,8 +37012,7 @@ function TableView({
|
|
|
37006
37012
|
const [localSelected, setLocalSelected] = React79__namespace.default.useState(/* @__PURE__ */ new Set());
|
|
37007
37013
|
const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
|
|
37008
37014
|
const actionDefs = Array.isArray(itemActions) ? itemActions : [];
|
|
37009
|
-
const
|
|
37010
|
-
const overflowActions = maxInlineActions != null ? actionDefs.slice(maxInlineActions) : actionDefs;
|
|
37015
|
+
const overflowActions = actionDefs;
|
|
37011
37016
|
const fireAction = (action, row) => eventBus.emit(`UI:${action.event}`, {
|
|
37012
37017
|
id: row.id,
|
|
37013
37018
|
row
|
|
@@ -37189,7 +37194,7 @@ function TableView({
|
|
|
37189
37194
|
}
|
|
37190
37195
|
return /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-foreground", children: formatCell(raw, col.format, relationsData?.[col.field ?? col.key]) }) }, col.key);
|
|
37191
37196
|
}),
|
|
37192
|
-
hasActions && /* @__PURE__ */ jsxRuntime.
|
|
37197
|
+
hasActions && /* @__PURE__ */ jsxRuntime.jsx(
|
|
37193
37198
|
exports.HStack,
|
|
37194
37199
|
{
|
|
37195
37200
|
gap: "xs",
|
|
@@ -37203,38 +37208,20 @@ function TableView({
|
|
|
37203
37208
|
"border-l border-[var(--color-border)]",
|
|
37204
37209
|
lk.striped && index % 2 === 1 ? "bg-[var(--color-surface-subtle)]" : "bg-[var(--color-card)] group-hover:bg-[var(--color-surface-subtle)]"
|
|
37205
37210
|
),
|
|
37206
|
-
children:
|
|
37207
|
-
|
|
37208
|
-
|
|
37209
|
-
|
|
37210
|
-
|
|
37211
|
-
|
|
37212
|
-
|
|
37213
|
-
|
|
37214
|
-
|
|
37215
|
-
|
|
37216
|
-
|
|
37217
|
-
|
|
37218
|
-
|
|
37219
|
-
|
|
37220
|
-
},
|
|
37221
|
-
action.event
|
|
37222
|
-
)),
|
|
37223
|
-
overflowActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
37224
|
-
exports.Menu,
|
|
37225
|
-
{
|
|
37226
|
-
position: "bottom-end",
|
|
37227
|
-
trigger: /* @__PURE__ */ jsxRuntime.jsx(exports.Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", "data-row-id": String(row.id), children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { name: "more-horizontal", size: "xs" }) }),
|
|
37228
|
-
items: overflowActions.map((action) => ({
|
|
37229
|
-
label: action.label,
|
|
37230
|
-
icon: action.icon,
|
|
37231
|
-
event: action.event,
|
|
37232
|
-
variant: action.variant === "danger" ? "danger" : "default",
|
|
37233
|
-
onClick: () => fireAction(action, row)
|
|
37234
|
-
}))
|
|
37235
|
-
}
|
|
37236
|
-
)
|
|
37237
|
-
]
|
|
37211
|
+
children: overflowActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
37212
|
+
exports.Menu,
|
|
37213
|
+
{
|
|
37214
|
+
position: "bottom-end",
|
|
37215
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsx(exports.Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", "data-row-id": String(row.id), children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { name: "more-horizontal", size: "xs" }) }),
|
|
37216
|
+
items: overflowActions.map((action) => ({
|
|
37217
|
+
label: action.label,
|
|
37218
|
+
icon: action.icon,
|
|
37219
|
+
event: action.event,
|
|
37220
|
+
variant: action.variant === "danger" ? "danger" : "default",
|
|
37221
|
+
onClick: () => fireAction(action, row)
|
|
37222
|
+
}))
|
|
37223
|
+
}
|
|
37224
|
+
)
|
|
37238
37225
|
}
|
|
37239
37226
|
)
|
|
37240
37227
|
]
|
|
@@ -46890,6 +46877,7 @@ var init_DetailPanel = __esm({
|
|
|
46890
46877
|
init_EmptyState();
|
|
46891
46878
|
init_cn();
|
|
46892
46879
|
init_portalRoot();
|
|
46880
|
+
init_slotContained();
|
|
46893
46881
|
init_format();
|
|
46894
46882
|
init_getNestedValue();
|
|
46895
46883
|
init_relationLabel();
|
|
@@ -46921,6 +46909,7 @@ var init_DetailPanel = __esm({
|
|
|
46921
46909
|
}) => {
|
|
46922
46910
|
const eventBus = useEventBus();
|
|
46923
46911
|
const { t } = hooks.useTranslate();
|
|
46912
|
+
const contained = React79.useContext(SlotContainedContext);
|
|
46924
46913
|
const [titleDraft, setTitleDraft] = React79__namespace.default.useState(null);
|
|
46925
46914
|
const isFieldDefArray = (arr) => {
|
|
46926
46915
|
if (!arr || arr.length === 0) return false;
|
|
@@ -47308,8 +47297,9 @@ var init_DetailPanel = __esm({
|
|
|
47308
47297
|
if (!slideOver) {
|
|
47309
47298
|
return /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className, children: content });
|
|
47310
47299
|
}
|
|
47311
|
-
const panel = /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: cn("fixed inset-y-0 right-0 w-full max-w-2xl bg-card shadow-lg z-50 overflow-y-auto p-6", className), children: content });
|
|
47312
|
-
|
|
47300
|
+
const panel = /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: cn(contained ? "absolute" : "fixed", "inset-y-0 right-0 w-full max-w-2xl bg-card shadow-lg z-50 overflow-y-auto p-6", className), children: content });
|
|
47301
|
+
if (contained || typeof document === "undefined") return panel;
|
|
47302
|
+
return reactDom.createPortal(panel, getOrCreatePortalRoot());
|
|
47313
47303
|
};
|
|
47314
47304
|
exports.DetailPanel.displayName = "DetailPanel";
|
|
47315
47305
|
}
|
|
@@ -53787,6 +53777,7 @@ var init_component_registry_generated = __esm({
|
|
|
53787
53777
|
// components/core/organisms/UISlotRenderer.tsx
|
|
53788
53778
|
var UISlotRenderer_exports = {};
|
|
53789
53779
|
__export(UISlotRenderer_exports, {
|
|
53780
|
+
SlotContainedContext: () => SlotContainedContext,
|
|
53790
53781
|
SlotContentRenderer: () => SlotContentRenderer,
|
|
53791
53782
|
SuspenseConfigProvider: () => SuspenseConfigProvider,
|
|
53792
53783
|
UISlotComponent: () => UISlotComponent,
|
|
@@ -53959,6 +53950,25 @@ function renderContainedPortal(t, slot, content, onDismiss) {
|
|
|
53959
53950
|
}
|
|
53960
53951
|
);
|
|
53961
53952
|
case "drawer":
|
|
53953
|
+
if (content.pattern === "detail-panel" && content.props.slideOver === true) {
|
|
53954
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
53955
|
+
exports.Box,
|
|
53956
|
+
{
|
|
53957
|
+
id: slotId,
|
|
53958
|
+
className: "absolute inset-0 z-50 overflow-hidden",
|
|
53959
|
+
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
53960
|
+
onClick: onDismiss,
|
|
53961
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
53962
|
+
exports.Box,
|
|
53963
|
+
{
|
|
53964
|
+
className: "absolute inset-y-0 right-0 pointer-events-auto",
|
|
53965
|
+
onClick: (e) => e.stopPropagation(),
|
|
53966
|
+
children: slotContent
|
|
53967
|
+
}
|
|
53968
|
+
)
|
|
53969
|
+
}
|
|
53970
|
+
);
|
|
53971
|
+
}
|
|
53962
53972
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
53963
53973
|
exports.Box,
|
|
53964
53974
|
{
|
|
@@ -54810,7 +54820,7 @@ function UISlotRenderer({
|
|
|
54810
54820
|
}
|
|
54811
54821
|
return wrapped;
|
|
54812
54822
|
}
|
|
54813
|
-
var scopeWrapLog, TRAIT_BINDING_RE, SuspenseConfigContext,
|
|
54823
|
+
var scopeWrapLog, TRAIT_BINDING_RE, SuspenseConfigContext, SLOT_SKELETON_MAP, CONTENT_NODE_SLOTS, PATTERNS_WITH_CHILDREN, traitRefPresenceCache;
|
|
54814
54824
|
var init_UISlotRenderer = __esm({
|
|
54815
54825
|
"components/core/organisms/UISlotRenderer.tsx"() {
|
|
54816
54826
|
"use client";
|
|
@@ -54825,6 +54835,7 @@ var init_UISlotRenderer = __esm({
|
|
|
54825
54835
|
init_cn();
|
|
54826
54836
|
init_format();
|
|
54827
54837
|
init_portalRoot();
|
|
54838
|
+
init_slotContained();
|
|
54828
54839
|
init_ErrorBoundary();
|
|
54829
54840
|
init_Skeleton();
|
|
54830
54841
|
init_renderer();
|
|
@@ -54834,7 +54845,6 @@ var init_UISlotRenderer = __esm({
|
|
|
54834
54845
|
scopeWrapLog = logger.createLogger("almadar:ui:scope-wrap");
|
|
54835
54846
|
TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
|
|
54836
54847
|
SuspenseConfigContext = React79.createContext({ enabled: false });
|
|
54837
|
-
SlotContainedContext = React79.createContext(false);
|
|
54838
54848
|
SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
|
|
54839
54849
|
SLOT_SKELETON_MAP = {
|
|
54840
54850
|
main: "table",
|
|
@@ -8306,7 +8306,7 @@ interface TableViewProps extends DataDndProps {
|
|
|
8306
8306
|
* column whose field is relation-typed. Same contract DetailPanel takes. */
|
|
8307
8307
|
relationsData?: Record<string, readonly RelationOption[]>;
|
|
8308
8308
|
}
|
|
8309
|
-
declare function TableView({ entity, columns, fields, itemActions,
|
|
8309
|
+
declare function TableView({ entity, columns, fields, itemActions, itemClickEvent, selectable, selectEvent, selectedIds, sortEvent, sortColumn, sortDirection, className, emptyMessage, isLoading, error, groupBy, pageSize, children, renderItem: _schemaRenderItem, look, dragGroup, accepts, sortable, dropEvent, reorderEvent, positionEvent, dndItemIdField, dndRoot, relationsData, }: TableViewProps): React__default.JSX.Element;
|
|
8310
8310
|
declare namespace TableView {
|
|
8311
8311
|
var displayName: string;
|
|
8312
8312
|
}
|
|
@@ -8306,7 +8306,7 @@ interface TableViewProps extends DataDndProps {
|
|
|
8306
8306
|
* column whose field is relation-typed. Same contract DetailPanel takes. */
|
|
8307
8307
|
relationsData?: Record<string, readonly RelationOption[]>;
|
|
8308
8308
|
}
|
|
8309
|
-
declare function TableView({ entity, columns, fields, itemActions,
|
|
8309
|
+
declare function TableView({ entity, columns, fields, itemActions, itemClickEvent, selectable, selectEvent, selectedIds, sortEvent, sortColumn, sortDirection, className, emptyMessage, isLoading, error, groupBy, pageSize, children, renderItem: _schemaRenderItem, look, dragGroup, accepts, sortable, dropEvent, reorderEvent, positionEvent, dndItemIdField, dndRoot, relationsData, }: TableViewProps): React__default.JSX.Element;
|
|
8310
8310
|
declare namespace TableView {
|
|
8311
8311
|
var displayName: string;
|
|
8312
8312
|
}
|