@gravity-platform/unoverse-react 0.0.4 → 0.0.6
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/index.cjs +25 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +25 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7223,7 +7223,7 @@ var RESET_CSS = `
|
|
|
7223
7223
|
font: inherit; letter-spacing: inherit; color: inherit; margin: 0;
|
|
7224
7224
|
}
|
|
7225
7225
|
`;
|
|
7226
|
-
function IsolatedRoot({ children }) {
|
|
7226
|
+
function IsolatedRoot({ children, rootStyle }) {
|
|
7227
7227
|
const hostRef = (0, import_react3.useRef)(null);
|
|
7228
7228
|
const [shadow, setShadow] = (0, import_react3.useState)(null);
|
|
7229
7229
|
(0, import_react3.useEffect)(() => {
|
|
@@ -7234,7 +7234,7 @@ function IsolatedRoot({ children }) {
|
|
|
7234
7234
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { ref: hostRef, style: { display: "contents" }, children: shadow && (0, import_react_dom.createPortal)(
|
|
7235
7235
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
7236
7236
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("style", { children: RESET_CSS }),
|
|
7237
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "uno-isolate-root", children })
|
|
7237
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "uno-isolate-root", style: rootStyle, children })
|
|
7238
7238
|
] }),
|
|
7239
7239
|
shadow
|
|
7240
7240
|
) });
|
|
@@ -7268,12 +7268,19 @@ function UnoverseComponent({ client, uri, data, onAction, theme, isolate = true
|
|
|
7268
7268
|
const propDefaults2 = Object.fromEntries(
|
|
7269
7269
|
Object.entries(def.props ?? {}).map(([k, v]) => [k, v?.default])
|
|
7270
7270
|
);
|
|
7271
|
-
const merged = data ??
|
|
7272
|
-
const
|
|
7273
|
-
|
|
7274
|
-
|
|
7271
|
+
const merged = { ...propDefaults2, ...data ?? {} };
|
|
7272
|
+
const keyframes = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("style", { children: keyframesCss(activeTheme) });
|
|
7273
|
+
const tree = renderNode(def.root, merged, onAction, activeTheme);
|
|
7274
|
+
if (isolate) {
|
|
7275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(IsolatedRoot, { rootStyle: activeTheme.root, children: [
|
|
7276
|
+
keyframes,
|
|
7277
|
+
tree
|
|
7278
|
+
] });
|
|
7279
|
+
}
|
|
7280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
7281
|
+
keyframes,
|
|
7282
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { display: "contents", ...activeTheme.root }, children: tree })
|
|
7275
7283
|
] });
|
|
7276
|
-
return isolate ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IsolatedRoot, { children: body }) : body;
|
|
7277
7284
|
}
|
|
7278
7285
|
|
|
7279
7286
|
// src/streamed.tsx
|
|
@@ -7413,11 +7420,18 @@ function StreamedUnoverseTemplate({ client, store, uri, onAction, theme: themePr
|
|
|
7413
7420
|
// button submits it. Lives in the store (shared state), not locally in Input.
|
|
7414
7421
|
draft: store.getDraft()
|
|
7415
7422
|
};
|
|
7416
|
-
const
|
|
7417
|
-
|
|
7418
|
-
|
|
7423
|
+
const keyframes = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("style", { children: keyframesCss(theme) });
|
|
7424
|
+
const tree = renderNode(def.root, rootData, onAction, theme, void 0, resolve);
|
|
7425
|
+
if (isolate) {
|
|
7426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(IsolatedRoot, { rootStyle: theme.root, children: [
|
|
7427
|
+
keyframes,
|
|
7428
|
+
tree
|
|
7429
|
+
] });
|
|
7430
|
+
}
|
|
7431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
7432
|
+
keyframes,
|
|
7433
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { display: "contents", ...theme.root }, children: tree })
|
|
7419
7434
|
] });
|
|
7420
|
-
return isolate ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IsolatedRoot, { children: body }) : body;
|
|
7421
7435
|
}
|
|
7422
7436
|
|
|
7423
7437
|
// src/connection.tsx
|