@cratis/scene 0.114.1 → 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.
- package/dist/Prototypes/Rendering/index.d.ts +2 -0
- package/dist/Prototypes/Rendering/prototypeElementReading.d.ts +15 -0
- package/dist/Prototypes/Rendering/renderPrototypeElement.d.ts +4 -0
- package/dist/Prototypes/index.js +95 -122
- package/dist/ScreenEditor/index.js +121 -121
- package/dist/renderPrototypeElement-Xm7OIVPs.js +58 -0
- package/dist/scene.css +1 -1
- package/package.json +1 -1
|
@@ -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;
|
package/dist/Prototypes/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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 =
|
|
16
|
-
value:
|
|
17
|
-
children:
|
|
18
|
-
}),
|
|
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
|
-
],
|
|
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: `${
|
|
26
|
-
...
|
|
27
|
-
width:
|
|
28
|
-
height:
|
|
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
|
-
},
|
|
32
|
+
}, i)) }), W = 16, Q = 8, X = {
|
|
32
33
|
width: 180,
|
|
33
34
|
height: 36
|
|
34
|
-
},
|
|
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
|
-
},
|
|
52
|
-
function
|
|
53
|
-
let
|
|
54
|
-
return
|
|
55
|
-
if (!
|
|
56
|
-
position:
|
|
57
|
-
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
|
|
60
|
-
if (!
|
|
61
|
-
position:
|
|
62
|
-
size:
|
|
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:
|
|
66
|
-
y:
|
|
66
|
+
x: W,
|
|
67
|
+
y: i
|
|
67
68
|
};
|
|
68
|
-
return
|
|
69
|
+
return i += a.height + Q, {
|
|
69
70
|
position: s,
|
|
70
|
-
size:
|
|
71
|
+
size: a
|
|
71
72
|
};
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
|
-
var
|
|
75
|
-
switch (
|
|
76
|
-
case
|
|
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
|
|
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
|
|
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
|
-
},
|
|
104
|
-
const t =
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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__ */
|
|
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(
|
|
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:
|
|
127
|
+
height: x,
|
|
160
128
|
transform: `scale(${b})`,
|
|
161
129
|
transformOrigin: "top left",
|
|
162
|
-
...
|
|
130
|
+
...tt(i)
|
|
163
131
|
},
|
|
164
|
-
children:
|
|
165
|
-
const I = String(
|
|
132
|
+
children: C.map(({ element: r, position: g, size: y }) => {
|
|
133
|
+
const I = String(r.id), P = p ? {
|
|
166
134
|
position: "relative",
|
|
167
|
-
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
|
|
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:
|
|
184
|
-
component:
|
|
185
|
-
label:
|
|
151
|
+
children: r.RenderPrototype({
|
|
152
|
+
component: r,
|
|
153
|
+
label: r.label
|
|
186
154
|
})
|
|
187
155
|
}, I);
|
|
188
|
-
const
|
|
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:
|
|
160
|
+
children: T && /* @__PURE__ */ n("span", {
|
|
193
161
|
className: "prototype-thumbnail-element__label",
|
|
194
|
-
children:
|
|
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
|
|
171
|
+
return o ? /* @__PURE__ */ n("button", {
|
|
204
172
|
className: "prototype-thumbnail",
|
|
205
|
-
onClick:
|
|
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,
|
|
217
|
-
const
|
|
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,
|
|
221
|
-
titleBarHeight: Math.max(
|
|
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,
|
|
230
|
-
if (!
|
|
231
|
-
const
|
|
232
|
-
return `translate(${Math.round(
|
|
233
|
-
}, u = (
|
|
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
|
-
|
|
236
|
-
const
|
|
237
|
-
m.key === "Escape" &&
|
|
203
|
+
V(() => {
|
|
204
|
+
const d = (m) => {
|
|
205
|
+
m.key === "Escape" && a();
|
|
238
206
|
};
|
|
239
|
-
return window.addEventListener("keydown",
|
|
240
|
-
}, [
|
|
241
|
-
const c = vt(), h = ct(
|
|
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:
|
|
214
|
+
onClick: a,
|
|
247
215
|
onPointerDown: u,
|
|
248
216
|
onMouseDown: u,
|
|
249
217
|
onWheel: u,
|
|
250
218
|
onDoubleClick: u,
|
|
251
|
-
children: /* @__PURE__ */
|
|
219
|
+
children: /* @__PURE__ */ E("div", {
|
|
252
220
|
className: "prototype-preview-window",
|
|
253
221
|
style: v ? { "--prototype-preview-from": v } : void 0,
|
|
254
|
-
onClick: (
|
|
222
|
+
onClick: (d) => d.stopPropagation(),
|
|
255
223
|
children: [/* @__PURE__ */ n(nt, {
|
|
256
|
-
elements:
|
|
257
|
-
windowSize:
|
|
258
|
-
layout:
|
|
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:
|
|
234
|
+
onClick: a,
|
|
267
235
|
children: "×"
|
|
268
236
|
})]
|
|
269
237
|
})
|
|
270
238
|
});
|
|
271
|
-
return typeof document > "u" ?
|
|
272
|
-
},
|
|
239
|
+
return typeof document > "u" ? p : q(p, document.body);
|
|
240
|
+
}, It = 15;
|
|
273
241
|
export {
|
|
274
242
|
ut as AnchorEdges,
|
|
275
|
-
|
|
276
|
-
|
|
243
|
+
l as PrototypeLayout,
|
|
244
|
+
_t as PrototypePreview,
|
|
277
245
|
nt as PrototypeThumbnail,
|
|
278
246
|
D as SceneMessagesContext,
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
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 {
|
|
3
|
-
import {
|
|
4
|
-
|
|
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
|
-
},
|
|
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
|
-
],
|
|
20
|
-
const [
|
|
21
|
-
|
|
22
|
-
const [
|
|
23
|
-
|
|
24
|
-
const e = requestAnimationFrame(() =>
|
|
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 =
|
|
28
|
-
|
|
29
|
-
}, [
|
|
30
|
-
o.stopPropagation(), o.preventDefault(),
|
|
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:
|
|
35
|
-
startHeight:
|
|
35
|
+
startWidth: i.width,
|
|
36
|
+
startHeight: i.height
|
|
36
37
|
}, o.target.setPointerCapture(o.pointerId);
|
|
37
|
-
},
|
|
38
|
-
const o =
|
|
38
|
+
}, L = f((e) => {
|
|
39
|
+
const o = C.current;
|
|
39
40
|
if (!o) return;
|
|
40
|
-
const { direction:
|
|
41
|
-
let
|
|
42
|
-
if (
|
|
43
|
-
const
|
|
44
|
-
|
|
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 (
|
|
47
|
-
const
|
|
48
|
-
|
|
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:
|
|
52
|
-
height:
|
|
52
|
+
width: F,
|
|
53
|
+
height: T
|
|
53
54
|
});
|
|
54
|
-
}, []), N =
|
|
55
|
-
|
|
56
|
-
}, []), H =
|
|
57
|
-
size:
|
|
55
|
+
}, []), N = f(() => {
|
|
56
|
+
C.current = null;
|
|
57
|
+
}, []), H = n - (u ? 360 / 2 : 0), S = {
|
|
58
|
+
size: i,
|
|
58
59
|
setSize: D,
|
|
59
|
-
isInspectorOpen:
|
|
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 -
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
].join(" "), U = ["prototype-editor-overlay-backdrop",
|
|
69
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
73
|
+
children: [/* @__PURE__ */ x("div", {
|
|
73
74
|
className: j,
|
|
74
75
|
style: {
|
|
75
|
-
transformOrigin:
|
|
76
|
-
width:
|
|
77
|
-
height:
|
|
78
|
-
marginLeft: -(
|
|
79
|
-
marginTop: -(
|
|
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: [
|
|
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) =>
|
|
86
|
-
onPointerMove:
|
|
86
|
+
onPointerDown: (o) => E(e, o),
|
|
87
|
+
onPointerMove: L,
|
|
87
88
|
onPointerUp: N,
|
|
88
89
|
onPointerCancel: N
|
|
89
|
-
}, e)),
|
|
90
|
-
}),
|
|
91
|
-
className: `prototype-editor-overlay-inspector${
|
|
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": !
|
|
94
|
-
inert: !
|
|
94
|
+
"aria-hidden": !u,
|
|
95
|
+
inert: !u,
|
|
95
96
|
onClick: (e) => e.stopPropagation(),
|
|
96
97
|
onPointerDown: (e) => e.stopPropagation(),
|
|
97
|
-
children:
|
|
98
|
+
children: g(S)
|
|
98
99
|
})]
|
|
99
100
|
});
|
|
100
|
-
},
|
|
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
|
-
})({}),
|
|
103
|
+
})({}), w = 8, rt = (t) => {
|
|
103
104
|
switch (t) {
|
|
104
|
-
case
|
|
105
|
+
case p.Row:
|
|
105
106
|
return {
|
|
106
107
|
display: "flex",
|
|
107
108
|
flexDirection: "row",
|
|
108
|
-
gap:
|
|
109
|
+
gap: w
|
|
109
110
|
};
|
|
110
|
-
case
|
|
111
|
+
case p.Wrap:
|
|
111
112
|
return {
|
|
112
113
|
display: "flex",
|
|
113
114
|
flexDirection: "row",
|
|
114
115
|
flexWrap: "wrap",
|
|
115
|
-
gap:
|
|
116
|
+
gap: w
|
|
116
117
|
};
|
|
117
|
-
case
|
|
118
|
+
case p.Grid:
|
|
118
119
|
return {
|
|
119
120
|
display: "grid",
|
|
120
121
|
gridTemplateColumns: "repeat(auto-fill, minmax(120px, 1fr))",
|
|
121
|
-
gap:
|
|
122
|
+
gap: w
|
|
122
123
|
};
|
|
123
|
-
case
|
|
124
|
+
case p.Freeform:
|
|
124
125
|
return { position: "relative" };
|
|
125
|
-
case
|
|
126
|
-
case
|
|
126
|
+
case p.Column:
|
|
127
|
+
case p.Grouping:
|
|
127
128
|
return {
|
|
128
129
|
display: "flex",
|
|
129
130
|
flexDirection: "column",
|
|
130
|
-
gap:
|
|
131
|
+
gap: w
|
|
131
132
|
};
|
|
132
133
|
}
|
|
133
|
-
},
|
|
134
|
-
const
|
|
135
|
-
return /* @__PURE__ */
|
|
136
|
-
className: `prototype-layout-container${
|
|
137
|
-
"data-layout-arrangement":
|
|
138
|
-
style:
|
|
139
|
-
children: [
|
|
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
|
-
}),
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
},
|
|
161
|
-
class
|
|
160
|
+
}, h = "StudioLayout", z = "Layout", at = (t) => {
|
|
161
|
+
class r extends A {
|
|
162
162
|
componentName = t.type;
|
|
163
|
-
category =
|
|
164
|
-
library =
|
|
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(
|
|
175
|
-
return /* @__PURE__ */
|
|
176
|
-
...
|
|
174
|
+
RenderPrototype(a) {
|
|
175
|
+
return /* @__PURE__ */ y(it, {
|
|
176
|
+
...a,
|
|
177
177
|
arrangement: t.arrangement
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
return
|
|
182
|
-
},
|
|
183
|
-
const
|
|
184
|
-
for (const
|
|
185
|
-
const
|
|
186
|
-
n
|
|
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(
|
|
189
|
-
name:
|
|
188
|
+
return q(h, r), {
|
|
189
|
+
name: h,
|
|
190
190
|
bundlePath: "",
|
|
191
191
|
categories: [{
|
|
192
|
-
name:
|
|
193
|
-
components: t.map((
|
|
194
|
-
name:
|
|
195
|
-
category:
|
|
196
|
-
library:
|
|
192
|
+
name: z,
|
|
193
|
+
components: t.map((n) => ({
|
|
194
|
+
name: n.name,
|
|
195
|
+
category: z,
|
|
196
|
+
library: h,
|
|
197
197
|
bundlePath: "",
|
|
198
|
-
type: `${
|
|
199
|
-
component: new n
|
|
198
|
+
type: `${h}.${n.type}`,
|
|
199
|
+
component: new r[n.type]()
|
|
200
200
|
}))
|
|
201
201
|
}]
|
|
202
202
|
};
|
|
203
203
|
};
|
|
204
204
|
export {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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*/
|