@charisol/plexo-sdk 1.0.20 → 1.0.21
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.js +17 -38
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -52157,14 +52157,8 @@ oF.displayName = "PlexoBuilder";
|
|
|
52157
52157
|
//#endregion
|
|
52158
52158
|
//#region src/playground.tsx
|
|
52159
52159
|
var sF = c((e, t) => {
|
|
52160
|
-
let n = m(null), r = m(null), i = m(null), [a, o] = h(
|
|
52161
|
-
|
|
52162
|
-
height: 0
|
|
52163
|
-
}), [s, c] = h({
|
|
52164
|
-
width: 0,
|
|
52165
|
-
height: 0
|
|
52166
|
-
}), [l, u] = h(1), [p, g] = h(!0);
|
|
52167
|
-
f(t, () => ({
|
|
52160
|
+
let n = m(null), r = m(null), i = m(null), [a, o] = h(1), s = m(1), [c, l] = h(!0);
|
|
52161
|
+
return f(t, () => ({
|
|
52168
52162
|
exportDesign: async (e) => {
|
|
52169
52163
|
if (!n.current) throw Error("PlexoBuilder is not ready yet.");
|
|
52170
52164
|
return n.current.exportDesign(e);
|
|
@@ -52177,17 +52171,12 @@ var sF = c((e, t) => {
|
|
|
52177
52171
|
let e = () => {
|
|
52178
52172
|
let e = r.current, t = i.current;
|
|
52179
52173
|
if (!e || !t) return;
|
|
52180
|
-
let n = e.clientWidth
|
|
52181
|
-
if (!n
|
|
52182
|
-
|
|
52183
|
-
|
|
52184
|
-
|
|
52185
|
-
|
|
52186
|
-
width: s,
|
|
52187
|
-
height: l
|
|
52188
|
-
});
|
|
52189
|
-
let d = Math.min(1, n / s);
|
|
52190
|
-
u(Number.isFinite(d) && d > 0 ? d : 1), g(!1);
|
|
52174
|
+
let n = e.clientWidth;
|
|
52175
|
+
if (!n) return;
|
|
52176
|
+
let a = s.current || 1, c = t.scrollWidth / a;
|
|
52177
|
+
if (!c) return;
|
|
52178
|
+
let u = Math.min(1, n / c), d = Number.isFinite(u) && u > 0 ? u : 1;
|
|
52179
|
+
d !== s.current && (s.current = d, o(d)), l(!1);
|
|
52191
52180
|
}, t = () => {
|
|
52192
52181
|
window.requestAnimationFrame(e);
|
|
52193
52182
|
};
|
|
@@ -52201,12 +52190,10 @@ var sF = c((e, t) => {
|
|
|
52201
52190
|
e.initialHtml,
|
|
52202
52191
|
e.initialCss,
|
|
52203
52192
|
e.initialJs
|
|
52204
|
-
])
|
|
52205
|
-
let _ = s.width * l, v = s.height * l;
|
|
52206
|
-
return /* @__PURE__ */ D("div", {
|
|
52193
|
+
]), /* @__PURE__ */ D("div", {
|
|
52207
52194
|
ref: r,
|
|
52208
52195
|
className: "relative h-full w-full overflow-auto",
|
|
52209
|
-
children: [
|
|
52196
|
+
children: [c && /* @__PURE__ */ E("div", {
|
|
52210
52197
|
className: "absolute inset-0 z-[1500] flex items-center justify-center bg-white/90 text-center px-4",
|
|
52211
52198
|
children: /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("p", {
|
|
52212
52199
|
className: "text-sm font-bold text-slate-900",
|
|
@@ -52216,23 +52203,15 @@ var sF = c((e, t) => {
|
|
|
52216
52203
|
children: "Please wait while we set up your kitchen"
|
|
52217
52204
|
})] })
|
|
52218
52205
|
}), /* @__PURE__ */ E("div", {
|
|
52219
|
-
|
|
52206
|
+
ref: i,
|
|
52220
52207
|
style: {
|
|
52221
|
-
|
|
52222
|
-
|
|
52208
|
+
zoom: a,
|
|
52209
|
+
width: "100%",
|
|
52210
|
+
height: "100%"
|
|
52223
52211
|
},
|
|
52224
|
-
children: /* @__PURE__ */ E(
|
|
52225
|
-
ref:
|
|
52226
|
-
|
|
52227
|
-
transform: `scale(${l})`,
|
|
52228
|
-
transformOrigin: "top left",
|
|
52229
|
-
width: "100%",
|
|
52230
|
-
height: "100%"
|
|
52231
|
-
},
|
|
52232
|
-
children: /* @__PURE__ */ E(oF, {
|
|
52233
|
-
ref: n,
|
|
52234
|
-
...e
|
|
52235
|
-
})
|
|
52212
|
+
children: /* @__PURE__ */ E(oF, {
|
|
52213
|
+
ref: n,
|
|
52214
|
+
...e
|
|
52236
52215
|
})
|
|
52237
52216
|
})]
|
|
52238
52217
|
});
|
package/package.json
CHANGED