@almadar/ui 2.20.7 → 2.21.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/runtime/index.cjs +9 -6
- package/dist/runtime/index.js +9 -6
- package/package.json +1 -1
package/dist/runtime/index.cjs
CHANGED
|
@@ -32172,7 +32172,7 @@ function normalizeChild(child) {
|
|
|
32172
32172
|
props: { ...rest, ...normalizedChildren !== void 0 ? { children: normalizedChildren } : {} }
|
|
32173
32173
|
};
|
|
32174
32174
|
}
|
|
32175
|
-
function SlotBridge() {
|
|
32175
|
+
function SlotBridge({ mockData }) {
|
|
32176
32176
|
const slots = useSlots();
|
|
32177
32177
|
const { render, clear } = context.useUISlots();
|
|
32178
32178
|
React112.useEffect(() => {
|
|
@@ -32182,7 +32182,10 @@ function SlotBridge() {
|
|
|
32182
32182
|
continue;
|
|
32183
32183
|
}
|
|
32184
32184
|
const entry = slotState.patterns[slotState.patterns.length - 1];
|
|
32185
|
-
|
|
32185
|
+
let patternRecord = entry.pattern;
|
|
32186
|
+
if (mockData && Object.keys(mockData).length > 0) {
|
|
32187
|
+
patternRecord = enrichFromResponse(patternRecord, mockData);
|
|
32188
|
+
}
|
|
32186
32189
|
const { type: patternType, children, ...inlineProps } = patternRecord;
|
|
32187
32190
|
const normalizedChildren = Array.isArray(children) ? children.map((c) => normalizeChild(c)) : children;
|
|
32188
32191
|
render({
|
|
@@ -32196,7 +32199,7 @@ function SlotBridge() {
|
|
|
32196
32199
|
sourceTrait: slotState.source?.trait
|
|
32197
32200
|
});
|
|
32198
32201
|
}
|
|
32199
|
-
}, [slots, render, clear]);
|
|
32202
|
+
}, [slots, render, clear, mockData]);
|
|
32200
32203
|
return null;
|
|
32201
32204
|
}
|
|
32202
32205
|
function TraitInitializer({ traits: traits2, orbitalNames }) {
|
|
@@ -32245,7 +32248,7 @@ function TraitInitializer({ traits: traits2, orbitalNames }) {
|
|
|
32245
32248
|
}, [bridge.connected, orbitalNames, bridge.sendEvent, slotsActions]);
|
|
32246
32249
|
return null;
|
|
32247
32250
|
}
|
|
32248
|
-
function SchemaRunner({ schema, serverUrl }) {
|
|
32251
|
+
function SchemaRunner({ schema, serverUrl, mockData }) {
|
|
32249
32252
|
const { traits: traits2, allEntities, ir } = useResolvedSchema(schema);
|
|
32250
32253
|
const allPageTraits = React112.useMemo(() => {
|
|
32251
32254
|
if (!ir?.pages || ir.pages.size <= 1) return traits2;
|
|
@@ -32272,7 +32275,7 @@ function SchemaRunner({ schema, serverUrl }) {
|
|
|
32272
32275
|
}, [schema]);
|
|
32273
32276
|
const inner = /* @__PURE__ */ jsxRuntime.jsx(VerificationProvider, { enabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(SlotsProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(EntitySchemaProvider, { entities: Array.from(allEntities.values()), children: [
|
|
32274
32277
|
/* @__PURE__ */ jsxRuntime.jsx(TraitInitializer, { traits: allPageTraits, orbitalNames: serverUrl ? orbitalNames : void 0 }),
|
|
32275
|
-
/* @__PURE__ */ jsxRuntime.jsx(SlotBridge, {}),
|
|
32278
|
+
/* @__PURE__ */ jsxRuntime.jsx(SlotBridge, { mockData: !serverUrl ? mockData : void 0 }),
|
|
32276
32279
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "min-h-full p-4", children: /* @__PURE__ */ jsxRuntime.jsx(UISlotRenderer, { includeHud: true, hudMode: "inline", includeFloating: true }) })
|
|
32277
32280
|
] }) }) });
|
|
32278
32281
|
if (serverUrl) {
|
|
@@ -32308,7 +32311,7 @@ function OrbPreview({
|
|
|
32308
32311
|
{
|
|
32309
32312
|
className: `overflow-auto border border-[var(--color-border)] rounded-[var(--radius-md)] ${className ?? ""}`,
|
|
32310
32313
|
style: { height },
|
|
32311
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(OrbitalProvider, { initialData: mockData, skipTheme: true, verification: true, children: /* @__PURE__ */ jsxRuntime.jsx(context.UISlotProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(SchemaRunner, { schema: parsedSchema, serverUrl }) }) })
|
|
32314
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(OrbitalProvider, { initialData: mockData, skipTheme: true, verification: true, children: /* @__PURE__ */ jsxRuntime.jsx(context.UISlotProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(SchemaRunner, { schema: parsedSchema, serverUrl, mockData }) }) })
|
|
32312
32315
|
}
|
|
32313
32316
|
);
|
|
32314
32317
|
}
|
package/dist/runtime/index.js
CHANGED
|
@@ -32142,7 +32142,7 @@ function normalizeChild(child) {
|
|
|
32142
32142
|
props: { ...rest, ...normalizedChildren !== void 0 ? { children: normalizedChildren } : {} }
|
|
32143
32143
|
};
|
|
32144
32144
|
}
|
|
32145
|
-
function SlotBridge() {
|
|
32145
|
+
function SlotBridge({ mockData }) {
|
|
32146
32146
|
const slots = useSlots();
|
|
32147
32147
|
const { render, clear } = useUISlots();
|
|
32148
32148
|
useEffect(() => {
|
|
@@ -32152,7 +32152,10 @@ function SlotBridge() {
|
|
|
32152
32152
|
continue;
|
|
32153
32153
|
}
|
|
32154
32154
|
const entry = slotState.patterns[slotState.patterns.length - 1];
|
|
32155
|
-
|
|
32155
|
+
let patternRecord = entry.pattern;
|
|
32156
|
+
if (mockData && Object.keys(mockData).length > 0) {
|
|
32157
|
+
patternRecord = enrichFromResponse(patternRecord, mockData);
|
|
32158
|
+
}
|
|
32156
32159
|
const { type: patternType, children, ...inlineProps } = patternRecord;
|
|
32157
32160
|
const normalizedChildren = Array.isArray(children) ? children.map((c) => normalizeChild(c)) : children;
|
|
32158
32161
|
render({
|
|
@@ -32166,7 +32169,7 @@ function SlotBridge() {
|
|
|
32166
32169
|
sourceTrait: slotState.source?.trait
|
|
32167
32170
|
});
|
|
32168
32171
|
}
|
|
32169
|
-
}, [slots, render, clear]);
|
|
32172
|
+
}, [slots, render, clear, mockData]);
|
|
32170
32173
|
return null;
|
|
32171
32174
|
}
|
|
32172
32175
|
function TraitInitializer({ traits: traits2, orbitalNames }) {
|
|
@@ -32215,7 +32218,7 @@ function TraitInitializer({ traits: traits2, orbitalNames }) {
|
|
|
32215
32218
|
}, [bridge.connected, orbitalNames, bridge.sendEvent, slotsActions]);
|
|
32216
32219
|
return null;
|
|
32217
32220
|
}
|
|
32218
|
-
function SchemaRunner({ schema, serverUrl }) {
|
|
32221
|
+
function SchemaRunner({ schema, serverUrl, mockData }) {
|
|
32219
32222
|
const { traits: traits2, allEntities, ir } = useResolvedSchema(schema);
|
|
32220
32223
|
const allPageTraits = useMemo(() => {
|
|
32221
32224
|
if (!ir?.pages || ir.pages.size <= 1) return traits2;
|
|
@@ -32242,7 +32245,7 @@ function SchemaRunner({ schema, serverUrl }) {
|
|
|
32242
32245
|
}, [schema]);
|
|
32243
32246
|
const inner = /* @__PURE__ */ jsx(VerificationProvider, { enabled: true, children: /* @__PURE__ */ jsx(SlotsProvider, { children: /* @__PURE__ */ jsxs(EntitySchemaProvider, { entities: Array.from(allEntities.values()), children: [
|
|
32244
32247
|
/* @__PURE__ */ jsx(TraitInitializer, { traits: allPageTraits, orbitalNames: serverUrl ? orbitalNames : void 0 }),
|
|
32245
|
-
/* @__PURE__ */ jsx(SlotBridge, {}),
|
|
32248
|
+
/* @__PURE__ */ jsx(SlotBridge, { mockData: !serverUrl ? mockData : void 0 }),
|
|
32246
32249
|
/* @__PURE__ */ jsx(Box, { className: "min-h-full p-4", children: /* @__PURE__ */ jsx(UISlotRenderer, { includeHud: true, hudMode: "inline", includeFloating: true }) })
|
|
32247
32250
|
] }) }) });
|
|
32248
32251
|
if (serverUrl) {
|
|
@@ -32278,7 +32281,7 @@ function OrbPreview({
|
|
|
32278
32281
|
{
|
|
32279
32282
|
className: `overflow-auto border border-[var(--color-border)] rounded-[var(--radius-md)] ${className ?? ""}`,
|
|
32280
32283
|
style: { height },
|
|
32281
|
-
children: /* @__PURE__ */ jsx(OrbitalProvider, { initialData: mockData, skipTheme: true, verification: true, children: /* @__PURE__ */ jsx(UISlotProvider, { children: /* @__PURE__ */ jsx(SchemaRunner, { schema: parsedSchema, serverUrl }) }) })
|
|
32284
|
+
children: /* @__PURE__ */ jsx(OrbitalProvider, { initialData: mockData, skipTheme: true, verification: true, children: /* @__PURE__ */ jsx(UISlotProvider, { children: /* @__PURE__ */ jsx(SchemaRunner, { schema: parsedSchema, serverUrl, mockData }) }) })
|
|
32282
32285
|
}
|
|
32283
32286
|
);
|
|
32284
32287
|
}
|