@cratis/scene 0.114.0 → 0.115.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.
@@ -7,3 +7,5 @@ export * from './PrototypeThumbnail';
7
7
  export * from './PrototypePreview';
8
8
  export * from './PrototypePreviewFit';
9
9
  export * from './fitPrototypePreview';
10
+ export * from './prototypeElementReading';
11
+ export * from './renderPrototypeElement';
@@ -0,0 +1,15 @@
1
+ import type { IComponent } from '../../IComponent';
2
+ import type { UIElement } from '../../UIElement';
3
+ export declare const elementPosition: (element: UIElement | IComponent) => {
4
+ x: number;
5
+ y: number;
6
+ };
7
+ export declare const elementSize: (element: UIElement | IComponent) => {
8
+ width: number;
9
+ height: number;
10
+ };
11
+ export declare const nativePreview: (element: UIElement | IComponent) => {
12
+ type: string;
13
+ label: string;
14
+ } | undefined;
15
+ export declare const elementCaption: (element: UIElement | IComponent) => string;
@@ -0,0 +1,4 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { IComponent } from '../../IComponent';
3
+ import type { UIElement } from '../../UIElement';
4
+ export declare const renderPrototypeElement: (element: UIElement | IComponent) => ReactNode;
@@ -1,7 +1,8 @@
1
- import { c as C, f as p, k as ut } from "../Scene-DaQtzf1e.js";
2
- import { createContext as G, useContext as U, useEffect as S } from "react";
3
- import { Fragment as A, jsx as n, jsxs as T } from "react/jsx-runtime";
4
- import { createPortal as j } from "react-dom";
1
+ import { c as $, f as l, k as ut } from "../Scene-DaQtzf1e.js";
2
+ import { a as M, i as G, n as ft, r as U, t as bt } from "../renderPrototypeElement-Xm7OIVPs.js";
3
+ import { createContext as S, useContext as j, useEffect as V } from "react";
4
+ import { Fragment as A, jsx as n, jsxs as E } from "react/jsx-runtime";
5
+ import { createPortal as q } from "react-dom";
5
6
  var L = {
6
7
  prototypeThumbnail: {
7
8
  openEditor: "Open prototype editor",
@@ -12,26 +13,26 @@ var L = {
12
13
  title: "Prototype preview",
13
14
  close: "Close preview"
14
15
  }
15
- }, D = G(L), k = () => U(D), xt = ({ messages: e, children: t }) => /* @__PURE__ */ n(D.Provider, {
16
- value: e,
17
- children: t
18
- }), V = [
16
+ }, D = S(L), k = () => j(D), Ht = ({ messages: t, children: e }) => /* @__PURE__ */ n(D.Provider, {
17
+ value: t,
18
+ children: e
19
+ }), J = [
19
20
  "#f66",
20
21
  "#fa0",
21
22
  "#3c3"
22
- ], q = ({ size: e }) => /* @__PURE__ */ n(A, { children: V.map((t, o) => /* @__PURE__ */ n("div", {
23
+ ], K = ({ size: t }) => /* @__PURE__ */ n(A, { children: J.map((e, i) => /* @__PURE__ */ n("div", {
23
24
  className: "prototype-window-traffic-light",
24
25
  style: {
25
- border: `${e ? Math.max(1, e / 8) : 1.5}px solid ${t}`,
26
- ...e ? {
27
- width: e,
28
- height: e
26
+ border: `${t ? Math.max(1, t / 8) : 1.5}px solid ${e}`,
27
+ ...t ? {
28
+ width: t,
29
+ height: t
29
30
  } : {}
30
31
  }
31
- }, o)) }), M = 16, J = 8, K = {
32
+ }, i)) }), W = 16, Q = 8, X = {
32
33
  width: 180,
33
34
  height: 36
34
- }, Q = {
35
+ }, Y = {
35
36
  dataTable: {
36
37
  width: 360,
37
38
  height: 120
@@ -48,32 +49,32 @@ var L = {
48
49
  width: 300,
49
50
  height: 150
50
51
  }
51
- }, X = (e) => !(e.width > 0) || !(e.height > 0);
52
- function Y(e, t) {
53
- let o = M;
54
- return e.map((i) => {
55
- if (!i.native || !X(i.size)) return {
56
- position: i.position,
57
- size: i.size
52
+ }, Z = (t) => !(t.width > 0) || !(t.height > 0);
53
+ function z(t, e) {
54
+ let i = W;
55
+ return t.map((o) => {
56
+ if (!o.native || !Z(o.size)) return {
57
+ position: o.position,
58
+ size: o.size
58
59
  };
59
- const r = Q[i.name] ?? K;
60
- if (!t) return {
61
- position: i.position,
62
- size: r
60
+ const a = Y[o.name] ?? X;
61
+ if (!e) return {
62
+ position: o.position,
63
+ size: a
63
64
  };
64
65
  const s = {
65
- x: M,
66
- y: o
66
+ x: W,
67
+ y: i
67
68
  };
68
- return o += r.height + J, {
69
+ return i += a.height + Q, {
69
70
  position: s,
70
- size: r
71
+ size: a
71
72
  };
72
73
  });
73
74
  }
74
- var Z = (e) => {
75
- switch (e) {
76
- case p.flexRow:
75
+ var tt = (t) => {
76
+ switch (t) {
77
+ case l.flexRow:
77
78
  return {
78
79
  display: "flex",
79
80
  flexDirection: "row",
@@ -82,14 +83,14 @@ var Z = (e) => {
82
83
  padding: 12,
83
84
  alignContent: "flex-start"
84
85
  };
85
- case p.flexColumn:
86
+ case l.flexColumn:
86
87
  return {
87
88
  display: "flex",
88
89
  flexDirection: "column",
89
90
  gap: 12,
90
91
  padding: 12
91
92
  };
92
- case p.grid:
93
+ case l.grid:
93
94
  return {
94
95
  display: "grid",
95
96
  gridTemplateColumns: "repeat(auto-fill, minmax(180px, 1fr))",
@@ -100,52 +101,19 @@ var Z = (e) => {
100
101
  default:
101
102
  return {};
102
103
  }
103
- }, z = 900, tt = 640, et = 40, ot = 150, it = 16, rt = (e) => {
104
- const t = e;
105
- if (t.position && typeof t.position.x == "number") return {
106
- x: t.position.x,
107
- y: t.position.y ?? 0
108
- };
109
- const o = t.properties?.canvas ?? {};
110
- return {
111
- x: o.x ?? 0,
112
- y: o.y ?? 0
113
- };
114
- }, at = (e) => {
115
- const t = e;
116
- return t.size && typeof t.size.width == "number" ? {
117
- width: t.size.width,
118
- height: t.size.height ?? 0
119
- } : {
120
- width: t.width ?? 0,
121
- height: t.height ?? 0
122
- };
123
- }, N = (e) => {
124
- const t = e;
125
- if (typeof t.componentName != "string" || t.componentName.includes(".")) return;
126
- const o = t.properties && typeof t.properties == "object" ? t.properties : {}, i = [
127
- o.label,
128
- o.text,
129
- o.title,
130
- t.componentName
131
- ].find((r) => typeof r == "string" && r.length > 0);
132
- return typeof i == "string" ? {
133
- type: t.componentName,
134
- label: i
135
- } : void 0;
136
- }, nt = ({ elements: e, windowSize: t, layout: o = p.absolute, onClick: i, width: r = ot, titleBarHeight: s = it, openTitle: c }) => {
137
- const h = k().prototypeThumbnail, w = t && t.width > 0 ? t.width : z, v = t && t.height > 0 ? t.height : tt, d = o !== p.absolute, l = o === p.grid, m = e.filter(Boolean).map(C), F = Y(m.map((a) => ({
138
- native: N(a) !== void 0,
139
- name: String(a.componentName ?? ""),
140
- position: rt(a),
141
- size: at(a)
142
- })), !d), f = w, E = Math.max(1, v - et), b = r / f, R = Math.round(f * b), B = Math.round(E * b), O = m.map((a, g) => ({
143
- element: a,
104
+ }, et = 900, ot = 640, rt = 40, it = 150, at = 16, nt = ({ elements: t, windowSize: e, layout: i = l.absolute, onClick: o, width: a = it, titleBarHeight: s = at, openTitle: c }) => {
105
+ const h = k().prototypeThumbnail, w = e && e.width > 0 ? e.width : et, v = e && e.height > 0 ? e.height : ot, p = i !== l.absolute, d = i === l.grid, m = t.filter(Boolean).map($), F = z(m.map((r) => ({
106
+ native: M(r) !== void 0,
107
+ name: String(r.componentName ?? ""),
108
+ position: U(r),
109
+ size: G(r)
110
+ })), !p), f = w, x = Math.max(1, v - rt), b = a / f, R = Math.round(f * b), B = Math.round(x * b), C = m.map((r, g) => ({
111
+ element: r,
144
112
  ...F[g]
145
- })), H = /* @__PURE__ */ T(A, { children: [/* @__PURE__ */ T("div", {
113
+ })), H = /* @__PURE__ */ E(A, { children: [/* @__PURE__ */ E("div", {
146
114
  className: "prototype-thumbnail-title-bar",
147
115
  style: { height: s },
148
- children: [/* @__PURE__ */ n(q, { size: Math.round(s * 0.375) }), /* @__PURE__ */ n("span", {
116
+ children: [/* @__PURE__ */ n(K, { size: Math.round(s * 0.375) }), /* @__PURE__ */ n("span", {
149
117
  className: "prototype-thumbnail-title",
150
118
  children: h.windowTitle
151
119
  })]
@@ -156,15 +124,15 @@ var Z = (e) => {
156
124
  className: "prototype-thumbnail-canvas-scaler",
157
125
  style: {
158
126
  width: f,
159
- height: E,
127
+ height: x,
160
128
  transform: `scale(${b})`,
161
129
  transformOrigin: "top left",
162
- ...Z(o)
130
+ ...tt(i)
163
131
  },
164
- children: O.map(({ element: a, position: g, size: y }) => {
165
- const I = String(a.id), P = d ? {
132
+ children: C.map(({ element: r, position: g, size: y }) => {
133
+ const I = String(r.id), P = p ? {
166
134
  position: "relative",
167
- width: l ? "100%" : y.width,
135
+ width: d ? "100%" : y.width,
168
136
  height: y.height,
169
137
  flexShrink: 0
170
138
  } : {
@@ -174,24 +142,24 @@ var Z = (e) => {
174
142
  width: y.width,
175
143
  height: y.height
176
144
  };
177
- if ("RenderPrototype" in a && typeof a.RenderPrototype == "function") return /* @__PURE__ */ n("div", {
145
+ if ("RenderPrototype" in r && typeof r.RenderPrototype == "function") return /* @__PURE__ */ n("div", {
178
146
  style: {
179
147
  ...P,
180
148
  pointerEvents: "none",
181
149
  overflow: "hidden"
182
150
  },
183
- children: a.RenderPrototype({
184
- component: a,
185
- label: a.label
151
+ children: r.RenderPrototype({
152
+ component: r,
153
+ label: r.label
186
154
  })
187
155
  }, I);
188
- const x = N(a), $ = x ? " prototype-thumbnail-element--native" : "type" in a && typeof a.type == "string" ? ` prototype-thumbnail-element--${a.type}` : "";
156
+ const T = M(r), O = T ? " prototype-thumbnail-element--native" : "type" in r && typeof r.type == "string" ? ` prototype-thumbnail-element--${r.type}` : "";
189
157
  return /* @__PURE__ */ n("div", {
190
- className: `prototype-thumbnail-element${$}`,
158
+ className: `prototype-thumbnail-element${O}`,
191
159
  style: P,
192
- children: x && /* @__PURE__ */ n("span", {
160
+ children: T && /* @__PURE__ */ n("span", {
193
161
  className: "prototype-thumbnail-element__label",
194
- children: x.label
162
+ children: T.label
195
163
  })
196
164
  }, I);
197
165
  })
@@ -200,9 +168,9 @@ var Z = (e) => {
200
168
  width: R,
201
169
  height: s + B
202
170
  };
203
- return i ? /* @__PURE__ */ n("button", {
171
+ return o ? /* @__PURE__ */ n("button", {
204
172
  className: "prototype-thumbnail",
205
- onClick: i,
173
+ onClick: o,
206
174
  title: c ?? h.openEditor,
207
175
  style: _,
208
176
  children: H
@@ -213,12 +181,12 @@ var Z = (e) => {
213
181
  style: _,
214
182
  children: H
215
183
  });
216
- }, st = 900, ht = 640, W = 40, pt = 24, lt = 0.9, dt = 0.85, ct = (e, t) => {
217
- const o = e && e.width > 0 ? e.width : st, i = e && e.height > 0 ? e.height : ht, r = Math.max(0.1, Math.min(1, t.width * lt / o, t.height * dt / i)), s = Math.round(o * r);
184
+ }, st = 900, ht = 640, N = 40, lt = 24, dt = 0.9, pt = 0.85, ct = (t, e) => {
185
+ const i = t && t.width > 0 ? t.width : st, o = t && t.height > 0 ? t.height : ht, a = Math.max(0.1, Math.min(1, e.width * dt / i, e.height * pt / o)), s = Math.round(i * a);
218
186
  return {
219
187
  width: s,
220
- canvasHeight: Math.round(Math.max(1, i - W) * (s / o)),
221
- titleBarHeight: Math.max(pt, Math.round(W * r))
188
+ canvasHeight: Math.round(Math.max(1, o - N) * (s / i)),
189
+ titleBarHeight: Math.max(lt, Math.round(N * a))
222
190
  };
223
191
  }, vt = () => typeof window > "u" ? {
224
192
  width: 1280,
@@ -226,36 +194,36 @@ var Z = (e) => {
226
194
  } : {
227
195
  width: window.innerWidth,
228
196
  height: window.innerHeight
229
- }, mt = (e, t, o, i) => {
230
- if (!e || e.width <= 0) return;
231
- const r = (i.width - t) / 2, s = (i.height - o) / 2;
232
- return `translate(${Math.round(e.left - r)}px, ${Math.round(e.top - s)}px) scale(${(e.width / t).toFixed(4)})`;
233
- }, u = (e) => e.stopPropagation(), Tt = ({ elements: e, windowSize: t, layout: o = p.absolute, sourceRect: i, onClose: r }) => {
197
+ }, mt = (t, e, i, o) => {
198
+ if (!t || t.width <= 0) return;
199
+ const a = (o.width - e) / 2, s = (o.height - i) / 2;
200
+ return `translate(${Math.round(t.left - a)}px, ${Math.round(t.top - s)}px) scale(${(t.width / e).toFixed(4)})`;
201
+ }, u = (t) => t.stopPropagation(), _t = ({ elements: t, windowSize: e, layout: i = l.absolute, sourceRect: o, onClose: a }) => {
234
202
  const s = k().prototypePreview ?? L.prototypePreview;
235
- S(() => {
236
- const l = (m) => {
237
- m.key === "Escape" && r();
203
+ V(() => {
204
+ const d = (m) => {
205
+ m.key === "Escape" && a();
238
206
  };
239
- return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
240
- }, [r]);
241
- const c = vt(), h = ct(t, c), w = h.titleBarHeight + h.canvasHeight, v = mt(i, h.width, w, c), d = /* @__PURE__ */ n("div", {
207
+ return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
208
+ }, [a]);
209
+ const c = vt(), h = ct(e, c), w = h.titleBarHeight + h.canvasHeight, v = mt(o, h.width, w, c), p = /* @__PURE__ */ n("div", {
242
210
  className: "prototype-preview-backdrop",
243
211
  role: "dialog",
244
212
  "aria-modal": "true",
245
213
  "aria-label": s.title,
246
- onClick: r,
214
+ onClick: a,
247
215
  onPointerDown: u,
248
216
  onMouseDown: u,
249
217
  onWheel: u,
250
218
  onDoubleClick: u,
251
- children: /* @__PURE__ */ T("div", {
219
+ children: /* @__PURE__ */ E("div", {
252
220
  className: "prototype-preview-window",
253
221
  style: v ? { "--prototype-preview-from": v } : void 0,
254
- onClick: (l) => l.stopPropagation(),
222
+ onClick: (d) => d.stopPropagation(),
255
223
  children: [/* @__PURE__ */ n(nt, {
256
- elements: e,
257
- windowSize: t,
258
- layout: o,
224
+ elements: t,
225
+ windowSize: e,
226
+ layout: i,
259
227
  width: h.width,
260
228
  titleBarHeight: h.titleBarHeight
261
229
  }), /* @__PURE__ */ n("button", {
@@ -263,23 +231,28 @@ var Z = (e) => {
263
231
  className: "prototype-preview-close",
264
232
  "aria-label": s.close,
265
233
  title: s.close,
266
- onClick: r,
234
+ onClick: a,
267
235
  children: "×"
268
236
  })]
269
237
  })
270
238
  });
271
- return typeof document > "u" ? d : j(d, document.body);
272
- }, Et = 15;
239
+ return typeof document > "u" ? p : q(p, document.body);
240
+ }, It = 15;
273
241
  export {
274
242
  ut as AnchorEdges,
275
- p as PrototypeLayout,
276
- Tt as PrototypePreview,
243
+ l as PrototypeLayout,
244
+ _t as PrototypePreview,
277
245
  nt as PrototypeThumbnail,
278
246
  D as SceneMessagesContext,
279
- xt as SceneMessagesProvider,
280
- q as TrafficLights,
281
- Et as allAnchorEdgesForEditor,
247
+ Ht as SceneMessagesProvider,
248
+ K as TrafficLights,
249
+ It as allAnchorEdgesForEditor,
282
250
  L as defaultSceneMessages,
251
+ ft as elementCaption,
252
+ U as elementPosition,
253
+ G as elementSize,
283
254
  ct as fitPrototypePreview,
255
+ M as nativePreview,
256
+ bt as renderPrototypeElement,
284
257
  k as useSceneMessages
285
258
  };
@@ -1,13 +1,14 @@
1
- import { u as q, x as A } from "../Scene-DaQtzf1e.js";
2
- import { useCallback as y, useEffect as B, useRef as S, useState as C } from "react";
3
- import { jsx as u, jsxs as b } from "react/jsx-runtime";
4
- var $ = 900, X = 640, J = 320, K = 300, at = 360, Q = (t) => t ? {
1
+ import { c as B, u as q, x as A } from "../Scene-DaQtzf1e.js";
2
+ import { i as J, r as K, t as Q } from "../renderPrototypeElement-Xm7OIVPs.js";
3
+ import { useCallback as f, useEffect as V, useRef as W, useState as b } from "react";
4
+ import { jsx as y, jsxs as x } from "react/jsx-runtime";
5
+ var $ = 900, X = 640, Z = 320, tt = 300, dt = 360, et = (t) => t ? {
5
6
  width: t.width > 0 ? t.width : $,
6
7
  height: t.height > 0 ? t.height : X
7
8
  } : {
8
9
  width: $,
9
10
  height: X
10
- }, V = [
11
+ }, ot = [
11
12
  "n",
12
13
  "s",
13
14
  "e",
@@ -16,152 +17,151 @@ var $ = 900, X = 640, J = 320, K = 300, at = 360, Q = (t) => t ? {
16
17
  "nw",
17
18
  "se",
18
19
  "sw"
19
- ], st = ({ sourceRect: t, initialSize: n, centerOffsetX: i = 0, children: s, renderInspector: m, canClose: r, onClosed: x }) => {
20
- const [d, z] = C("entering"), [a, D] = C(() => Q(n)), w = S(a);
21
- w.current = a;
22
- const [h, _] = C(!1), k = y(() => _((e) => !e), []), f = S(null);
23
- B(() => {
24
- const e = requestAnimationFrame(() => z("visible"));
20
+ ], ht = ({ sourceRect: t, initialSize: r, centerOffsetX: n = 0, children: a, renderInspector: g, canClose: s, onClosed: c }) => {
21
+ const [l, m] = b("entering"), [i, D] = b(() => et(r)), v = W(i);
22
+ v.current = i;
23
+ const [u, _] = b(!1), k = f(() => _((e) => !e), []), C = W(null);
24
+ V(() => {
25
+ const e = requestAnimationFrame(() => m("visible"));
25
26
  return () => cancelAnimationFrame(e);
26
27
  }, []);
27
- const I = y(async () => {
28
- r && !await r(w.current) || (z("closing"), setTimeout(() => x(w.current), 300));
29
- }, [r, x]), L = (e, o) => {
30
- o.stopPropagation(), o.preventDefault(), f.current = {
28
+ const I = f(async () => {
29
+ s && !await s(v.current) || (m("closing"), setTimeout(() => c(v.current), 300));
30
+ }, [s, c]), E = (e, o) => {
31
+ o.stopPropagation(), o.preventDefault(), C.current = {
31
32
  direction: e,
32
33
  startX: o.clientX,
33
34
  startY: o.clientY,
34
- startWidth: a.width,
35
- startHeight: a.height
35
+ startWidth: i.width,
36
+ startHeight: i.height
36
37
  }, o.target.setPointerCapture(o.pointerId);
37
- }, R = y((e) => {
38
- const o = f.current;
38
+ }, L = f((e) => {
39
+ const o = C.current;
39
40
  if (!o) return;
40
- const { direction: p } = o;
41
- let T = o.startWidth, W = o.startHeight;
42
- if (p.includes("e") || p.includes("w")) {
43
- const v = p.includes("e") ? e.clientX - o.startX : o.startX - e.clientX;
44
- T = Math.max(J, o.startWidth + v * 2);
41
+ const { direction: d } = o;
42
+ let F = o.startWidth, T = o.startHeight;
43
+ if (d.includes("e") || d.includes("w")) {
44
+ const P = d.includes("e") ? e.clientX - o.startX : o.startX - e.clientX;
45
+ F = Math.max(Z, o.startWidth + P * 2);
45
46
  }
46
- if (p.includes("s") || p.includes("n")) {
47
- const v = p.includes("s") ? e.clientY - o.startY : o.startY - e.clientY;
48
- W = Math.max(K, o.startHeight + v * 2);
47
+ if (d.includes("s") || d.includes("n")) {
48
+ const P = d.includes("s") ? e.clientY - o.startY : o.startY - e.clientY;
49
+ T = Math.max(tt, o.startHeight + P * 2);
49
50
  }
50
51
  D({
51
- width: T,
52
- height: W
52
+ width: F,
53
+ height: T
53
54
  });
54
- }, []), N = y(() => {
55
- f.current = null;
56
- }, []), H = i - (h ? 360 / 2 : 0), F = {
57
- size: a,
55
+ }, []), N = f(() => {
56
+ C.current = null;
57
+ }, []), H = n - (u ? 360 / 2 : 0), S = {
58
+ size: i,
58
59
  setSize: D,
59
- isInspectorOpen: h,
60
+ isInspectorOpen: u,
60
61
  toggleInspector: k,
61
62
  close: () => {
62
63
  I();
63
64
  }
64
- }, Y = t.left + t.width / 2, G = t.top + t.height / 2, M = window.innerWidth / 2 + H - a.width / 2, O = window.innerHeight / 2 - a.height / 2, E = `${Y - M}px ${G - O}px`, j = [
65
+ }, Y = t.left + t.width / 2, G = t.top + t.height / 2, M = window.innerWidth / 2 + H - i.width / 2, O = window.innerHeight / 2 - i.height / 2, R = `${Y - M}px ${G - O}px`, j = [
65
66
  "prototype-editor-overlay-content",
66
- d === "visible" ? "prototype-editor-overlay-content--visible" : "",
67
- d === "closing" ? "prototype-editor-overlay-content--closing" : ""
68
- ].join(" "), U = ["prototype-editor-overlay-backdrop", d === "visible" ? "prototype-editor-overlay-backdrop--visible" : ""].join(" ");
69
- return /* @__PURE__ */ b("div", {
67
+ l === "visible" ? "prototype-editor-overlay-content--visible" : "",
68
+ l === "closing" ? "prototype-editor-overlay-content--closing" : ""
69
+ ].join(" "), U = ["prototype-editor-overlay-backdrop", l === "visible" ? "prototype-editor-overlay-backdrop--visible" : ""].join(" ");
70
+ return /* @__PURE__ */ x("div", {
70
71
  className: U,
71
72
  onClick: I,
72
- children: [/* @__PURE__ */ b("div", {
73
+ children: [/* @__PURE__ */ x("div", {
73
74
  className: j,
74
75
  style: {
75
- transformOrigin: E,
76
- width: a.width,
77
- height: a.height,
78
- marginLeft: -(a.width / 2) + H,
79
- marginTop: -(a.height / 2)
76
+ transformOrigin: R,
77
+ width: i.width,
78
+ height: i.height,
79
+ marginLeft: -(i.width / 2) + H,
80
+ marginTop: -(i.height / 2)
80
81
  },
81
82
  onClick: (e) => e.stopPropagation(),
82
83
  onPointerDown: (e) => e.stopPropagation(),
83
- children: [d === "visible" && V.map((e) => /* @__PURE__ */ u("div", {
84
+ children: [l === "visible" && ot.map((e) => /* @__PURE__ */ y("div", {
84
85
  className: `prototype-editor-overlay-resize prototype-editor-overlay-resize--${e}`,
85
- onPointerDown: (o) => L(e, o),
86
- onPointerMove: R,
86
+ onPointerDown: (o) => E(e, o),
87
+ onPointerMove: L,
87
88
  onPointerUp: N,
88
89
  onPointerCancel: N
89
- }, e)), s(F)]
90
- }), m && /* @__PURE__ */ u("aside", {
91
- className: `prototype-editor-overlay-inspector${h && d === "visible" ? " prototype-editor-overlay-inspector--open" : ""}`,
90
+ }, e)), a(S)]
91
+ }), g && /* @__PURE__ */ y("aside", {
92
+ className: `prototype-editor-overlay-inspector${u && l === "visible" ? " prototype-editor-overlay-inspector--open" : ""}`,
92
93
  style: { width: 360 },
93
- "aria-hidden": !h,
94
- inert: !h,
94
+ "aria-hidden": !u,
95
+ inert: !u,
95
96
  onClick: (e) => e.stopPropagation(),
96
97
  onPointerDown: (e) => e.stopPropagation(),
97
- children: m(F)
98
+ children: g(S)
98
99
  })]
99
100
  });
100
- }, l = /* @__PURE__ */ (function(t) {
101
+ }, p = /* @__PURE__ */ (function(t) {
101
102
  return t.Row = "row", t.Column = "column", t.Grid = "grid", t.Wrap = "wrap", t.Freeform = "freeform", t.Grouping = "grouping", t;
102
- })({}), g = 8, Z = (t) => {
103
+ })({}), w = 8, rt = (t) => {
103
104
  switch (t) {
104
- case l.Row:
105
+ case p.Row:
105
106
  return {
106
107
  display: "flex",
107
108
  flexDirection: "row",
108
- gap: g
109
+ gap: w
109
110
  };
110
- case l.Wrap:
111
+ case p.Wrap:
111
112
  return {
112
113
  display: "flex",
113
114
  flexDirection: "row",
114
115
  flexWrap: "wrap",
115
- gap: g
116
+ gap: w
116
117
  };
117
- case l.Grid:
118
+ case p.Grid:
118
119
  return {
119
120
  display: "grid",
120
121
  gridTemplateColumns: "repeat(auto-fill, minmax(120px, 1fr))",
121
- gap: g
122
+ gap: w
122
123
  };
123
- case l.Freeform:
124
+ case p.Freeform:
124
125
  return { position: "relative" };
125
- case l.Column:
126
- case l.Grouping:
126
+ case p.Column:
127
+ case p.Grouping:
127
128
  return {
128
129
  display: "flex",
129
130
  flexDirection: "column",
130
- gap: g
131
+ gap: w
131
132
  };
132
133
  }
133
- }, tt = (t) => t !== l.Freeform, et = ({ component: t, arrangement: n, isDragOver: i }) => {
134
- const s = t.children ?? [], m = tt(n);
135
- return /* @__PURE__ */ b("div", {
136
- className: `prototype-layout-container${i ? " prototype-layout-container--drag-over" : ""}`,
137
- "data-layout-arrangement": n,
138
- style: Z(n),
139
- children: [s.length === 0 && /* @__PURE__ */ u("div", {
134
+ }, nt = (t) => t !== p.Freeform, it = ({ component: t, arrangement: r, isDragOver: n }) => {
135
+ const a = (t.children ?? []).filter(Boolean).map(B), g = nt(r);
136
+ return /* @__PURE__ */ x("div", {
137
+ className: `prototype-layout-container${n ? " prototype-layout-container--drag-over" : ""}`,
138
+ "data-layout-arrangement": r,
139
+ style: rt(r),
140
+ children: [a.length === 0 && /* @__PURE__ */ y("div", {
140
141
  className: "prototype-layout-container__empty",
141
142
  "aria-hidden": "true"
142
- }), s.map((r) => /* @__PURE__ */ u("div", {
143
- className: "prototype-layout-container__item",
144
- style: m ? {
145
- width: r.size.width,
146
- height: r.size.height
147
- } : {
148
- position: "absolute",
149
- left: r.position.x,
150
- top: r.position.y,
151
- width: r.size.width,
152
- height: r.size.height
153
- },
154
- children: r.RenderPrototype({
155
- component: r,
156
- label: r.label
157
- })
158
- }, r.id))]
143
+ }), a.map((s) => {
144
+ const c = J(s), l = K(s), m = {
145
+ width: c.width > 0 ? c.width : void 0,
146
+ height: c.height > 0 ? c.height : void 0
147
+ };
148
+ return /* @__PURE__ */ y("div", {
149
+ className: "prototype-layout-container__item",
150
+ style: g ? m : {
151
+ position: "absolute",
152
+ left: l.x,
153
+ top: l.y,
154
+ ...m
155
+ },
156
+ children: Q(s)
157
+ }, String(s.id));
158
+ })]
159
159
  });
160
- }, c = "StudioLayout", P = "Layout", ot = (t) => {
161
- class n extends A {
160
+ }, h = "StudioLayout", z = "Layout", at = (t) => {
161
+ class r extends A {
162
162
  componentName = t.type;
163
- category = P;
164
- library = c;
163
+ category = z;
164
+ library = h;
165
165
  initialSize = {
166
166
  width: 260,
167
167
  height: 140
@@ -171,44 +171,44 @@ var $ = 900, X = 640, J = 320, K = 300, at = 360, Q = (t) => t ? {
171
171
  get toolbarIcon() {
172
172
  return t.icon;
173
173
  }
174
- RenderPrototype(s) {
175
- return /* @__PURE__ */ u(et, {
176
- ...s,
174
+ RenderPrototype(a) {
175
+ return /* @__PURE__ */ y(it, {
176
+ ...a,
177
177
  arrangement: t.arrangement
178
178
  });
179
179
  }
180
180
  }
181
- return n;
182
- }, lt = (t) => {
183
- const n = {};
184
- for (const i of t) {
185
- const s = ot(i);
186
- n[i.type] = s, n[`${c}.${i.type}`] = s;
181
+ return r;
182
+ }, mt = (t) => {
183
+ const r = {};
184
+ for (const n of t) {
185
+ const a = at(n);
186
+ r[n.type] = a, r[`${h}.${n.type}`] = a;
187
187
  }
188
- return q(c, n), {
189
- name: c,
188
+ return q(h, r), {
189
+ name: h,
190
190
  bundlePath: "",
191
191
  categories: [{
192
- name: P,
193
- components: t.map((i) => ({
194
- name: i.name,
195
- category: P,
196
- library: c,
192
+ name: z,
193
+ components: t.map((n) => ({
194
+ name: n.name,
195
+ category: z,
196
+ library: h,
197
197
  bundlePath: "",
198
- type: `${c}.${i.type}`,
199
- component: new n[i.type]()
198
+ type: `${h}.${n.type}`,
199
+ component: new r[n.type]()
200
200
  }))
201
201
  }]
202
202
  };
203
203
  };
204
204
  export {
205
- l as LayoutArrangement,
206
- st as PrototypeOverlayFrame,
207
- Z as arrangementStyle,
208
- ot as createLayoutContainerComponent,
209
- at as inspectorWidth,
210
- tt as isFlowArrangement,
211
- P as layoutContainerCategory,
212
- c as layoutContainerLibrary,
213
- lt as registerLayoutContainers
205
+ p as LayoutArrangement,
206
+ ht as PrototypeOverlayFrame,
207
+ rt as arrangementStyle,
208
+ at as createLayoutContainerComponent,
209
+ dt as inspectorWidth,
210
+ nt as isFlowArrangement,
211
+ z as layoutContainerCategory,
212
+ h as layoutContainerLibrary,
213
+ mt as registerLayoutContainers
214
214
  };
@@ -0,0 +1,58 @@
1
+ import { c as p } from "./Scene-DaQtzf1e.js";
2
+ import { jsx as s } from "react/jsx-runtime";
3
+ var y = (n) => {
4
+ const e = n;
5
+ if (e.position && typeof e.position.x == "number") return {
6
+ x: e.position.x,
7
+ y: e.position.y ?? 0
8
+ };
9
+ const t = e.properties?.canvas ?? {};
10
+ return {
11
+ x: t.x ?? 0,
12
+ y: t.y ?? 0
13
+ };
14
+ }, d = (n) => {
15
+ const e = n;
16
+ return e.size && typeof e.size.width == "number" ? {
17
+ width: e.size.width,
18
+ height: e.size.height ?? 0
19
+ } : {
20
+ width: e.width ?? 0,
21
+ height: e.height ?? 0
22
+ };
23
+ }, a = (n) => {
24
+ const e = n;
25
+ if (typeof e.componentName != "string" || e.componentName.includes(".")) return;
26
+ const t = e.properties && typeof e.properties == "object" ? e.properties : {}, o = [
27
+ t.label,
28
+ t.text,
29
+ t.title,
30
+ e.componentName
31
+ ].find((r) => typeof r == "string" && r.length > 0);
32
+ return typeof o == "string" ? {
33
+ type: e.componentName,
34
+ label: o
35
+ } : void 0;
36
+ }, i = (n) => {
37
+ const e = n, t = [e.name, e.componentName].find((o) => typeof o == "string" && o.length > 0);
38
+ return typeof t == "string" ? t : "";
39
+ }, l = (n) => {
40
+ const e = p(n);
41
+ if ("RenderPrototype" in e && typeof e.RenderPrototype == "function") return e.RenderPrototype({
42
+ component: e,
43
+ label: e.label ?? i(e)
44
+ });
45
+ const t = a(e);
46
+ return /* @__PURE__ */ s("div", {
47
+ className: "prototype-unrendered-element",
48
+ "data-prototype-element": t?.type,
49
+ children: t?.label ?? i(e)
50
+ });
51
+ };
52
+ export {
53
+ a,
54
+ d as i,
55
+ i as n,
56
+ y as r,
57
+ l as t
58
+ };
package/dist/scene.css CHANGED
@@ -1,2 +1,2 @@
1
- .prototype-window-traffic-light{box-sizing:border-box;background:0 0;border-radius:50%;width:12px;height:12px}.prototype-thumbnail{cursor:default;box-sizing:border-box;background:var(--surface-card);border:none;flex-direction:column;flex-shrink:0;padding:0;display:flex;position:relative;overflow:hidden}.prototype-thumbnail:is(button){cursor:pointer}.prototype-thumbnail-title-bar{border-bottom:1px solid var(--surface-200);background:var(--surface-50);flex-shrink:0;align-items:center;gap:3px;padding:0 5px;display:flex;position:relative}.prototype-thumbnail-title{text-align:center;color:var(--text-color-secondary);pointer-events:none;font-family:system-ui,sans-serif;font-size:8px;position:absolute;left:0;right:0}.prototype-thumbnail-body{background:var(--surface-ground);flex:1;position:relative;overflow:hidden}.prototype-thumbnail-canvas-scaler{position:absolute;top:0;left:0}.prototype-thumbnail-element{box-sizing:border-box;background:var(--surface-200);border:1px solid var(--surface-300);border-radius:2px;position:absolute}.prototype-thumbnail-element--button,.prototype-thumbnail-element--button-hot{background:var(--surface-200);border:1px solid var(--surface-300)}.prototype-thumbnail-element--button-hot{background:var(--primary-color);border-color:var(--primary-color);opacity:.7}.prototype-thumbnail-element--native{color:var(--text-color);text-align:center;justify-content:center;align-items:center;padding:2px 6px;font-family:system-ui,sans-serif;font-size:12px;display:flex;overflow:hidden}.prototype-thumbnail-element__label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.prototype-thumbnail-element--text-input{background:var(--surface-0);border:1px solid var(--surface-300)}.prototype-thumbnail-element--label{border-bottom:1px solid var(--surface-300);background:0 0}.prototype-thumbnail-element--checkbox,.prototype-thumbnail-element--radio,.prototype-thumbnail-element--dropdown{background:var(--surface-0);border:1px solid var(--surface-300)}.prototype-thumbnail-element--image{background:var(--surface-100);border:1px dashed var(--surface-300)}.prototype-thumbnail-element--panel{background:var(--surface-50);border:1px solid var(--surface-200)}.prototype-thumbnail-element--data-table{background:var(--surface-0);border:1px solid var(--surface-300)}.prototype-thumbnail-element--toolbar{background:var(--surface-100);border:1px solid var(--surface-200)}.prototype-thumbnail-element--kpi-card{background:var(--surface-100);border:1px solid var(--primary-300,var(--surface-300));border-radius:3px}.prototype-thumbnail-element--bar-chart{background:var(--surface-0);border:1px solid var(--surface-300);background-image:repeating-linear-gradient(to top, var(--primary-400,#7c6fe0) 0px, var(--primary-400,#7c6fe0) 60%, transparent 60%, transparent 100%);background-position:10% 0,35% 0,60% 0,85% 0;background-repeat:no-repeat;background-size:20% 100%}.prototype-thumbnail-element--line-chart{background:var(--surface-0);border:1px solid var(--surface-300)}.prototype-thumbnail-element--pie-chart{background:var(--surface-0);border:1px solid var(--surface-300);border-radius:50%}.prototype-thumbnail-element--progress-bar{background:var(--surface-100);border:1px solid var(--surface-300);background-image:linear-gradient(to right, var(--primary-400,#7c6fe0) 0%, var(--primary-400,#7c6fe0) 55%, transparent 55%)}.prototype-thumbnail-element--activity-feed{background:var(--surface-0);border:1px solid var(--surface-300);background-image:repeating-linear-gradient(to bottom, transparent 0px, transparent 3px, var(--surface-200) 3px, var(--surface-200) 4px);background-size:100% 8px}.prototype-thumbnail-element--nav-topbar{background:var(--surface-100);border:1px solid var(--surface-200);border-radius:2px 2px 0 0}.prototype-thumbnail-element--nav-footer{background:var(--surface-100);border:1px solid var(--surface-200);border-radius:0 0 2px 2px}.prototype-thumbnail-element--nav-sidebar{background:var(--surface-50);border:1px solid var(--surface-200);border-radius:2px 0 0 2px}.prototype-thumbnail-element--content-area{background:var(--surface-ground);border:1.5px dashed var(--surface-300)}.prototype-thumbnail-element--command-form{background:var(--surface-0);border:1px solid var(--surface-300);background-image:repeating-linear-gradient(to bottom, transparent 0px, transparent 5px, var(--surface-100) 5px, var(--surface-100) 8px);background-position:0 4px;background-size:100% 12px}.prototype-preview-backdrop{z-index:1000;cursor:default;background:#00000073;justify-content:center;align-items:center;animation:.16s ease-out prototype-preview-fade;display:flex;position:fixed;inset:0}.prototype-preview-window{border:1px solid var(--surface-300);transform-origin:0 0;border-radius:8px;animation:.22s cubic-bezier(.2,.8,.2,1) prototype-preview-zoom;position:relative;overflow:hidden;box-shadow:0 24px 64px #00000073}.prototype-preview-window .prototype-thumbnail-title{font-size:13px}.prototype-preview-window .prototype-thumbnail-title-bar{gap:8px;padding:0 12px}.prototype-preview-close{z-index:1;width:28px;height:28px;color:var(--text-color-secondary);cursor:pointer;background:0 0;border:none;border-radius:50%;font-size:18px;line-height:1;position:absolute;top:6px;right:8px}.prototype-preview-close:hover{background:var(--surface-200);color:var(--text-color)}@keyframes prototype-preview-zoom{0%{transform:var(--prototype-preview-from,scale(.9));opacity:.4}to{opacity:1;transform:none}}@keyframes prototype-preview-fade{0%{background:0 0}to{background:#00000073}}@media (prefers-reduced-motion:reduce){.prototype-preview-backdrop,.prototype-preview-window{animation:none}}.prototype-editor-overlay-backdrop{z-index:50;opacity:0;pointer-events:auto;background:#0000008c;justify-content:center;align-items:center;transition:opacity .28s;display:flex;position:fixed;inset:0}.prototype-editor-overlay-backdrop--visible{opacity:1}.prototype-editor-overlay-content{opacity:0;border-radius:10px;flex-direction:column;transition:transform .28s cubic-bezier(.4,0,.2,1),opacity .28s;display:flex;position:fixed;top:50%;left:50%;overflow:hidden;transform:scale(.08);box-shadow:0 24px 80px #0000008c}.prototype-editor-overlay-content--visible{opacity:1;transform:scale(1)}.prototype-editor-overlay-content--closing{opacity:0;transform:scale(.08)}.prototype-editor-overlay-resize{z-index:10;position:absolute}.prototype-editor-overlay-resize--n{cursor:ns-resize;height:6px;top:0;left:8px;right:8px}.prototype-editor-overlay-resize--s{cursor:ns-resize;height:6px;bottom:0;left:8px;right:8px}.prototype-editor-overlay-resize--e{cursor:ew-resize;width:6px;top:8px;bottom:8px;right:0}.prototype-editor-overlay-resize--w{cursor:ew-resize;width:6px;top:8px;bottom:8px;left:0}.prototype-editor-overlay-resize--ne{cursor:nesw-resize;width:12px;height:12px;top:0;right:0}.prototype-editor-overlay-resize--nw{cursor:nwse-resize;width:12px;height:12px;top:0;left:0}.prototype-editor-overlay-resize--se{cursor:nwse-resize;width:12px;height:12px;bottom:0;right:0}.prototype-editor-overlay-resize--sw{cursor:nesw-resize;width:12px;height:12px;bottom:0;left:0}.prototype-editor-overlay-inspector{background:var(--cratis-surface-card);color:var(--cratis-text-color);border-left:1px solid var(--cratis-surface-border);box-shadow:var(--cratis-shadow-overlay);z-index:12;flex-direction:column;transition:transform .24s cubic-bezier(.4,0,.2,1);display:flex;position:fixed;top:0;bottom:0;right:0;transform:translate(100%)}.prototype-editor-overlay-inspector--open{transform:translate(0)}.prototype-layout-container{box-sizing:border-box;border:1px dashed var(--cratis-surface-border);border-radius:var(--cratis-border-radius);background:color-mix(in srgb, var(--cratis-surface-card) 60%, transparent);width:100%;height:100%;padding:8px;overflow:hidden}.prototype-layout-container--drag-over{border:2px dashed var(--cratis-primary-color)}.prototype-layout-container__item{box-sizing:border-box;flex:none}.prototype-layout-container__empty{border-radius:var(--cratis-border-radius);background:repeating-linear-gradient(45deg, transparent, transparent 6px, var(--cratis-surface-hover) 6px, var(--cratis-surface-hover) 12px);pointer-events:none;flex:auto;min-height:32px}
1
+ .prototype-unrendered-element{box-sizing:border-box;border:1px solid var(--cratis-surface-border,var(--surface-300));border-radius:var(--cratis-border-radius,4px);background:var(--cratis-surface-hover,var(--surface-200));min-height:28px;color:var(--cratis-text-secondary-color,var(--text-color-secondary));text-overflow:ellipsis;white-space:nowrap;padding:4px 8px;font-size:12px;overflow:hidden}.prototype-window-traffic-light{box-sizing:border-box;background:0 0;border-radius:50%;width:12px;height:12px}.prototype-thumbnail{cursor:default;box-sizing:border-box;background:var(--surface-card);border:none;flex-direction:column;flex-shrink:0;padding:0;display:flex;position:relative;overflow:hidden}.prototype-thumbnail:is(button){cursor:pointer}.prototype-thumbnail-title-bar{border-bottom:1px solid var(--surface-200);background:var(--surface-50);flex-shrink:0;align-items:center;gap:3px;padding:0 5px;display:flex;position:relative}.prototype-thumbnail-title{text-align:center;color:var(--text-color-secondary);pointer-events:none;font-family:system-ui,sans-serif;font-size:8px;position:absolute;left:0;right:0}.prototype-thumbnail-body{background:var(--surface-ground);flex:1;position:relative;overflow:hidden}.prototype-thumbnail-canvas-scaler{position:absolute;top:0;left:0}.prototype-thumbnail-element{box-sizing:border-box;background:var(--surface-200);border:1px solid var(--surface-300);border-radius:2px;position:absolute}.prototype-thumbnail-element--button,.prototype-thumbnail-element--button-hot{background:var(--surface-200);border:1px solid var(--surface-300)}.prototype-thumbnail-element--button-hot{background:var(--primary-color);border-color:var(--primary-color);opacity:.7}.prototype-thumbnail-element--native{color:var(--text-color);text-align:center;justify-content:center;align-items:center;padding:2px 6px;font-family:system-ui,sans-serif;font-size:12px;display:flex;overflow:hidden}.prototype-thumbnail-element__label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.prototype-thumbnail-element--text-input{background:var(--surface-0);border:1px solid var(--surface-300)}.prototype-thumbnail-element--label{border-bottom:1px solid var(--surface-300);background:0 0}.prototype-thumbnail-element--checkbox,.prototype-thumbnail-element--radio,.prototype-thumbnail-element--dropdown{background:var(--surface-0);border:1px solid var(--surface-300)}.prototype-thumbnail-element--image{background:var(--surface-100);border:1px dashed var(--surface-300)}.prototype-thumbnail-element--panel{background:var(--surface-50);border:1px solid var(--surface-200)}.prototype-thumbnail-element--data-table{background:var(--surface-0);border:1px solid var(--surface-300)}.prototype-thumbnail-element--toolbar{background:var(--surface-100);border:1px solid var(--surface-200)}.prototype-thumbnail-element--kpi-card{background:var(--surface-100);border:1px solid var(--primary-300,var(--surface-300));border-radius:3px}.prototype-thumbnail-element--bar-chart{background:var(--surface-0);border:1px solid var(--surface-300);background-image:repeating-linear-gradient(to top, var(--primary-400,#7c6fe0) 0px, var(--primary-400,#7c6fe0) 60%, transparent 60%, transparent 100%);background-position:10% 0,35% 0,60% 0,85% 0;background-repeat:no-repeat;background-size:20% 100%}.prototype-thumbnail-element--line-chart{background:var(--surface-0);border:1px solid var(--surface-300)}.prototype-thumbnail-element--pie-chart{background:var(--surface-0);border:1px solid var(--surface-300);border-radius:50%}.prototype-thumbnail-element--progress-bar{background:var(--surface-100);border:1px solid var(--surface-300);background-image:linear-gradient(to right, var(--primary-400,#7c6fe0) 0%, var(--primary-400,#7c6fe0) 55%, transparent 55%)}.prototype-thumbnail-element--activity-feed{background:var(--surface-0);border:1px solid var(--surface-300);background-image:repeating-linear-gradient(to bottom, transparent 0px, transparent 3px, var(--surface-200) 3px, var(--surface-200) 4px);background-size:100% 8px}.prototype-thumbnail-element--nav-topbar{background:var(--surface-100);border:1px solid var(--surface-200);border-radius:2px 2px 0 0}.prototype-thumbnail-element--nav-footer{background:var(--surface-100);border:1px solid var(--surface-200);border-radius:0 0 2px 2px}.prototype-thumbnail-element--nav-sidebar{background:var(--surface-50);border:1px solid var(--surface-200);border-radius:2px 0 0 2px}.prototype-thumbnail-element--content-area{background:var(--surface-ground);border:1.5px dashed var(--surface-300)}.prototype-thumbnail-element--command-form{background:var(--surface-0);border:1px solid var(--surface-300);background-image:repeating-linear-gradient(to bottom, transparent 0px, transparent 5px, var(--surface-100) 5px, var(--surface-100) 8px);background-position:0 4px;background-size:100% 12px}.prototype-preview-backdrop{z-index:1000;cursor:default;background:#00000073;justify-content:center;align-items:center;animation:.16s ease-out prototype-preview-fade;display:flex;position:fixed;inset:0}.prototype-preview-window{border:1px solid var(--surface-300);transform-origin:0 0;border-radius:8px;animation:.22s cubic-bezier(.2,.8,.2,1) prototype-preview-zoom;position:relative;overflow:hidden;box-shadow:0 24px 64px #00000073}.prototype-preview-window .prototype-thumbnail-title{font-size:13px}.prototype-preview-window .prototype-thumbnail-title-bar{gap:8px;padding:0 12px}.prototype-preview-close{z-index:1;width:28px;height:28px;color:var(--text-color-secondary);cursor:pointer;background:0 0;border:none;border-radius:50%;font-size:18px;line-height:1;position:absolute;top:6px;right:8px}.prototype-preview-close:hover{background:var(--surface-200);color:var(--text-color)}@keyframes prototype-preview-zoom{0%{transform:var(--prototype-preview-from,scale(.9));opacity:.4}to{opacity:1;transform:none}}@keyframes prototype-preview-fade{0%{background:0 0}to{background:#00000073}}@media (prefers-reduced-motion:reduce){.prototype-preview-backdrop,.prototype-preview-window{animation:none}}.prototype-editor-overlay-backdrop{z-index:50;opacity:0;pointer-events:auto;background:#0000008c;justify-content:center;align-items:center;transition:opacity .28s;display:flex;position:fixed;inset:0}.prototype-editor-overlay-backdrop--visible{opacity:1}.prototype-editor-overlay-content{opacity:0;border-radius:10px;flex-direction:column;transition:transform .28s cubic-bezier(.4,0,.2,1),opacity .28s;display:flex;position:fixed;top:50%;left:50%;overflow:hidden;transform:scale(.08);box-shadow:0 24px 80px #0000008c}.prototype-editor-overlay-content--visible{opacity:1;transform:scale(1)}.prototype-editor-overlay-content--closing{opacity:0;transform:scale(.08)}.prototype-editor-overlay-resize{z-index:10;position:absolute}.prototype-editor-overlay-resize--n{cursor:ns-resize;height:6px;top:0;left:8px;right:8px}.prototype-editor-overlay-resize--s{cursor:ns-resize;height:6px;bottom:0;left:8px;right:8px}.prototype-editor-overlay-resize--e{cursor:ew-resize;width:6px;top:8px;bottom:8px;right:0}.prototype-editor-overlay-resize--w{cursor:ew-resize;width:6px;top:8px;bottom:8px;left:0}.prototype-editor-overlay-resize--ne{cursor:nesw-resize;width:12px;height:12px;top:0;right:0}.prototype-editor-overlay-resize--nw{cursor:nwse-resize;width:12px;height:12px;top:0;left:0}.prototype-editor-overlay-resize--se{cursor:nwse-resize;width:12px;height:12px;bottom:0;right:0}.prototype-editor-overlay-resize--sw{cursor:nesw-resize;width:12px;height:12px;bottom:0;left:0}.prototype-editor-overlay-inspector{background:var(--cratis-surface-card);color:var(--cratis-text-color);border-left:1px solid var(--cratis-surface-border);box-shadow:var(--cratis-shadow-overlay);z-index:12;flex-direction:column;transition:transform .24s cubic-bezier(.4,0,.2,1);display:flex;position:fixed;top:0;bottom:0;right:0;transform:translate(100%)}.prototype-editor-overlay-inspector--open{transform:translate(0)}.prototype-layout-container{box-sizing:border-box;border:1px dashed var(--cratis-surface-border);border-radius:var(--cratis-border-radius);background:color-mix(in srgb, var(--cratis-surface-card) 60%, transparent);width:100%;height:100%;padding:8px;overflow:hidden}.prototype-layout-container--drag-over{border:2px dashed var(--cratis-primary-color)}.prototype-layout-container__item{box-sizing:border-box;flex:none}.prototype-layout-container__empty{border-radius:var(--cratis-border-radius);background:repeating-linear-gradient(45deg, transparent, transparent 6px, var(--cratis-surface-hover) 6px, var(--cratis-surface-hover) 12px);pointer-events:none;flex:auto;min-height:32px}
2
2
  /*$vite$:1*/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/scene",
3
- "version": "0.114.0",
3
+ "version": "0.115.0",
4
4
  "description": "Cratis Scene: renders Studio prototypes as thumbnails and previews.",
5
5
  "license": "MIT",
6
6
  "author": "Cratis",