lilact 0.2.1 → 0.2.3
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/lilact.development.min.js +2 -9657
- package/dist/lilact.development.min.js.LICENSE.txt +1 -1
- package/dist/lilact.development.min.js.map +1 -1
- package/dist/lilact.production.min.js +1 -1
- package/dist/lilact.production.min.js.map +1 -1
- package/docs/classes/accessories.ErrorBoundary.html +8 -8
- package/docs/classes/accessories.Suspense.html +7 -7
- package/docs/classes/components.Component.html +10 -10
- package/docs/classes/components.HTMLComponent.html +10 -10
- package/docs/classes/components.RootComponent.html +10 -10
- package/docs/functions/components.createComponent.html +1 -1
- package/docs/functions/components.createRoot.html +1 -1
- package/docs/functions/components.render.html +1 -1
- package/docs/functions/hooks.useActionState.html +3 -2
- package/docs/functions/hooks.useEffect.html +3 -2
- package/docs/functions/hooks.useImperativeHandle.html +1 -1
- package/docs/functions/hooks.useLayoutEffect.html +3 -2
- package/docs/functions/hooks.useLocalStorage.html +3 -2
- package/docs/functions/hooks.useMemo.html +3 -2
- package/docs/functions/hooks.useRef.html +3 -2
- package/docs/static/demos/pane.jsx +31 -0
- package/docs/static/index.html +1 -0
- package/docs/static/lilact.development.min.js +2 -9657
- package/docs/static/lilact.production.min.js +1 -1
- package/package.json +1 -1
- package/root/demos/pane.jsx +31 -0
- package/root/index.html +1 -0
- package/root/lilact.development.min.js +2 -9657
- package/root/lilact.production.min.js +1 -1
- package/src/components.jsx +4 -1
- package/src/hooks.jsx +15 -15
- package/src/misc.jsx +13 -1
- package/src/pane.jsx +207 -269
- package/webpack.config.js +1 -1
- package/docs/static/index 2.html +0 -95
- package/root/index 2.html +0 -95
package/src/pane.jsx
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { useEffect, useLayoutEffect, useMemo, useRef, useState, forwardRef, useImperativeHandle } from "./hooks.jsx";
|
|
2
2
|
import { Children } from "./misc.jsx";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
|
|
5
|
+
const clamp = (n, min, max) => {
|
|
6
|
+
if (!Number.isFinite(n)) return n;
|
|
7
|
+
return Math.min(max, Math.max(min, n));
|
|
8
|
+
};
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* ResizablePane
|
|
@@ -17,271 +19,207 @@ function clamp(n, min, max) {
|
|
|
17
19
|
* - Callback when size changes via onSizeChange
|
|
18
20
|
* - Children are rendered in two separate containers (no portals)
|
|
19
21
|
*/
|
|
20
|
-
export const ResizablePane = forwardRef(function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
ref
|
|
22
|
+
export const ResizablePane = forwardRef(function ResizablePane(
|
|
23
|
+
{
|
|
24
|
+
mode = "horizontal",
|
|
25
|
+
position, // controlled: number | undefined/null
|
|
26
|
+
defaultPosition = 0.5,
|
|
27
|
+
min = 0.1,
|
|
28
|
+
max = 0.9,
|
|
29
|
+
splitterSize = 8,
|
|
30
|
+
onSizeChange,
|
|
31
|
+
style,
|
|
32
|
+
className,
|
|
33
|
+
leftPaneStyle,
|
|
34
|
+
rightPaneStyle,
|
|
35
|
+
splitterStyle,
|
|
36
|
+
children,
|
|
37
|
+
},
|
|
38
|
+
ref
|
|
38
39
|
) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
flex: `1 1 auto`,
|
|
225
|
-
overflow: "auto",
|
|
226
|
-
...(rightPaneStyle || {}),
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
const splitterComputed =
|
|
230
|
-
modeResolved === "horizontal"
|
|
231
|
-
? {
|
|
232
|
-
width: `${splitterSize}px`,
|
|
233
|
-
flex: `0 0 ${splitterSize}px`,
|
|
234
|
-
cursor: "col-resize",
|
|
235
|
-
background: "transparent",
|
|
236
|
-
...(splitterStyle || {}),
|
|
237
|
-
}
|
|
238
|
-
: {
|
|
239
|
-
height: `${splitterSize}px`,
|
|
240
|
-
flex: `0 0 ${splitterSize}px`,
|
|
241
|
-
cursor: "row-resize",
|
|
242
|
-
background: "transparent",
|
|
243
|
-
...(splitterStyle || {}),
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
const dividerVisualStyle =
|
|
247
|
-
modeResolved === "horizontal"
|
|
248
|
-
? {
|
|
249
|
-
height: "100%",
|
|
250
|
-
width: "100%",
|
|
251
|
-
background: "rgba(0,0,0,0.08)",
|
|
252
|
-
}
|
|
253
|
-
: {
|
|
254
|
-
width: "100%",
|
|
255
|
-
height: "100%",
|
|
256
|
-
background: "rgba(0,0,0,0.08)",
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
return (
|
|
260
|
-
<div
|
|
261
|
-
ref={containerRef}
|
|
262
|
-
className={className}
|
|
263
|
-
style={rootStyle}
|
|
264
|
-
onPointerMove={onPointerMove}
|
|
265
|
-
>
|
|
266
|
-
<div style={leftPaneComputed}>{leftChild}</div>
|
|
267
|
-
|
|
268
|
-
<div
|
|
269
|
-
role="separator"
|
|
270
|
-
aria-orientation={modeResolved === "horizontal" ? "vertical" : "horizontal"}
|
|
271
|
-
aria-valuemin={min}
|
|
272
|
-
aria-valuemax={max}
|
|
273
|
-
aria-valuenow={posResolved}
|
|
274
|
-
tabIndex={0}
|
|
275
|
-
onPointerDown={onPointerDown}
|
|
276
|
-
onPointerUp={stopDragging}
|
|
277
|
-
onPointerCancel={stopDragging}
|
|
278
|
-
onKeyDown={onSplitterKeyDown}
|
|
279
|
-
style={splitterComputed}
|
|
280
|
-
>
|
|
281
|
-
<div style={dividerVisualStyle} />
|
|
282
|
-
</div>
|
|
283
|
-
|
|
284
|
-
<div style={rightPaneComputed}>{rightChild}</div>
|
|
285
|
-
</div>
|
|
286
|
-
);
|
|
40
|
+
const containerRef = useRef(null);
|
|
41
|
+
const panes = Children.toArray(children);
|
|
42
|
+
const leftChild = panes[0] ?? null;
|
|
43
|
+
const rightChild = panes[1] ?? null;
|
|
44
|
+
|
|
45
|
+
const isControlled = position != null;
|
|
46
|
+
|
|
47
|
+
const [internalMode, setInternalMode] = useState(mode);
|
|
48
|
+
|
|
49
|
+
const [posUncontrolled, setPosUncontrolled] = useState(() =>
|
|
50
|
+
clamp(
|
|
51
|
+
position ?? defaultPosition,
|
|
52
|
+
min,
|
|
53
|
+
max
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (mode != null) setInternalMode(mode);
|
|
59
|
+
}, [mode]);
|
|
60
|
+
|
|
61
|
+
// keep internal position clamped if min/max change (uncontrolled only)
|
|
62
|
+
useLayoutEffect(() => {
|
|
63
|
+
if (isControlled) return;
|
|
64
|
+
setPosUncontrolled((p) => clamp(p, min, max));
|
|
65
|
+
}, [min, max, isControlled]);
|
|
66
|
+
|
|
67
|
+
const posResolved = isControlled ? clamp(position, min, max) : posUncontrolled;
|
|
68
|
+
|
|
69
|
+
const setPosition = (next) => {
|
|
70
|
+
const clamped = clamp(next, min, max);
|
|
71
|
+
if (!isControlled) setPosUncontrolled(clamped);
|
|
72
|
+
onSizeChange?.(clamped);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const draggingRef = useRef(false);
|
|
76
|
+
const pointerIdRef = useRef(null);
|
|
77
|
+
|
|
78
|
+
const updateFromClient = (clientX, clientY) => {
|
|
79
|
+
const el = containerRef.current;
|
|
80
|
+
if (!el) return;
|
|
81
|
+
|
|
82
|
+
const rect = el.getBoundingClientRect();
|
|
83
|
+
|
|
84
|
+
if (internalMode === "horizontal") {
|
|
85
|
+
const usable = rect.width;
|
|
86
|
+
if (!Number.isFinite(usable) || usable <= 0) return; // no jump on init
|
|
87
|
+
const raw = (clientX - rect.left) / usable;
|
|
88
|
+
if (!Number.isFinite(raw)) return;
|
|
89
|
+
setPosition(raw);
|
|
90
|
+
} else {
|
|
91
|
+
const usable = rect.height;
|
|
92
|
+
if (!Number.isFinite(usable) || usable <= 0) return; // no jump on init
|
|
93
|
+
const raw = (clientY - rect.top) / usable;
|
|
94
|
+
if (!Number.isFinite(raw)) return;
|
|
95
|
+
setPosition(raw);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
// stable global listeners: only act while draggingRef.current === true
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
const onMove = (e) => {
|
|
102
|
+
if (!draggingRef.current) return;
|
|
103
|
+
if (pointerIdRef.current != null && e.pointerId !== pointerIdRef.current) return;
|
|
104
|
+
updateFromClient(e.clientX, e.clientY);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const stop = (e) => {
|
|
108
|
+
if (!draggingRef.current) return;
|
|
109
|
+
if (pointerIdRef.current != null && e.pointerId !== pointerIdRef.current) return;
|
|
110
|
+
draggingRef.current = false;
|
|
111
|
+
pointerIdRef.current = null;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
window.addEventListener("pointermove", onMove, { passive: true });
|
|
115
|
+
window.addEventListener("pointerup", stop, { passive: true });
|
|
116
|
+
window.addEventListener("pointercancel", stop, { passive: true });
|
|
117
|
+
|
|
118
|
+
return () => {
|
|
119
|
+
window.removeEventListener("pointermove", onMove);
|
|
120
|
+
window.removeEventListener("pointerup", stop);
|
|
121
|
+
window.removeEventListener("pointercancel", stop);
|
|
122
|
+
};
|
|
123
|
+
}, [internalMode]); // updateFromClient uses internalMode
|
|
124
|
+
|
|
125
|
+
const onPointerDown = (e) => {
|
|
126
|
+
if (e.button != null && e.button !== 0) return;
|
|
127
|
+
e.preventDefault();
|
|
128
|
+
|
|
129
|
+
draggingRef.current = true;
|
|
130
|
+
pointerIdRef.current = e.pointerId;
|
|
131
|
+
|
|
132
|
+
try {
|
|
133
|
+
e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
134
|
+
} catch {}
|
|
135
|
+
|
|
136
|
+
updateFromClient(e.clientX, e.clientY); // first update only if rect is sane
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const onKeyDown = (e) => {
|
|
140
|
+
const step = 0.02;
|
|
141
|
+
let delta = 0;
|
|
142
|
+
|
|
143
|
+
if (internalMode === "horizontal") {
|
|
144
|
+
if (e.key === "ArrowLeft") delta = -step;
|
|
145
|
+
if (e.key === "ArrowRight") delta = step;
|
|
146
|
+
} else {
|
|
147
|
+
if (e.key === "ArrowUp") delta = -step;
|
|
148
|
+
if (e.key === "ArrowDown") delta = step;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (delta !== 0) {
|
|
152
|
+
e.preventDefault();
|
|
153
|
+
setPosition(posResolved + delta);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const sizes = useMemo(() => {
|
|
158
|
+
const leftPct = `${posResolved * 100}%`;
|
|
159
|
+
const rightCalc = `calc(${100 - posResolved * 100}% - ${splitterSize}px)`;
|
|
160
|
+
return { leftPct, rightCalc };
|
|
161
|
+
}, [posResolved, splitterSize]);
|
|
162
|
+
|
|
163
|
+
const rootStyle = {
|
|
164
|
+
display: "flex",
|
|
165
|
+
width: "100%",
|
|
166
|
+
height: "100%",
|
|
167
|
+
overflow: "hidden",
|
|
168
|
+
touchAction: "none",
|
|
169
|
+
...(style || {}),
|
|
170
|
+
flexDirection: internalMode === "horizontal" ? "row" : "column",
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const leftPaneComputed =
|
|
174
|
+
internalMode === "horizontal"
|
|
175
|
+
? { width: sizes.leftPct, flex: `0 0 ${sizes.leftPct}`, overflow: "auto", ...(leftPaneStyle || {}) }
|
|
176
|
+
: { height: sizes.leftPct, flex: `0 0 ${sizes.leftPct}`, overflow: "auto", ...(leftPaneStyle || {}) };
|
|
177
|
+
|
|
178
|
+
const rightPaneComputed =
|
|
179
|
+
internalMode === "horizontal"
|
|
180
|
+
? { width: sizes.rightCalc, flex: "1 1 auto", overflow: "auto", ...(rightPaneStyle || {}) }
|
|
181
|
+
: { height: sizes.rightCalc, flex: "1 1 auto", overflow: "auto", ...(rightPaneStyle || {}) };
|
|
182
|
+
|
|
183
|
+
const splitterComputed =
|
|
184
|
+
internalMode === "horizontal"
|
|
185
|
+
? { width: `${splitterSize}px`, height: '100%', flex: `0 0 ${splitterSize}px`, background: "rgba(0,0,0,0.08)", cursor: "col-resize", ...(splitterStyle || {}) }
|
|
186
|
+
: { height: `${splitterSize}px`, width: '100%', flex: `0 0 ${splitterSize}px`, background: "rgba(0,0,0,0.08)", cursor: "row-resize", ...(splitterStyle || {}) };
|
|
187
|
+
|
|
188
|
+
const dividerVisualStyle =
|
|
189
|
+
internalMode === "horizontal"
|
|
190
|
+
? { height: "100%", width: "100%" }
|
|
191
|
+
: { width: "100%", height: "100%" };
|
|
192
|
+
|
|
193
|
+
useImperativeHandle(ref, () => ({
|
|
194
|
+
setPosition,
|
|
195
|
+
setMode: (nextMode) => setInternalMode(nextMode === "vertical" ? "vertical" : "horizontal"),
|
|
196
|
+
getPosition: () => posResolved,
|
|
197
|
+
getMode: () => internalMode,
|
|
198
|
+
}));
|
|
199
|
+
|
|
200
|
+
return (
|
|
201
|
+
<div ref={containerRef} className={className} style={rootStyle}>
|
|
202
|
+
<div style={leftPaneComputed}>{leftChild}</div>
|
|
203
|
+
|
|
204
|
+
<div
|
|
205
|
+
role="separator"
|
|
206
|
+
aria-orientation={internalMode === "horizontal" ? "vertical" : "horizontal"}
|
|
207
|
+
aria-valuemin={min}
|
|
208
|
+
aria-valuemax={max}
|
|
209
|
+
aria-valuenow={posResolved}
|
|
210
|
+
tabIndex={0}
|
|
211
|
+
onPointerDown={onPointerDown}
|
|
212
|
+
onPointerCancel={() => {
|
|
213
|
+
draggingRef.current = false;
|
|
214
|
+
pointerIdRef.current = null;
|
|
215
|
+
}}
|
|
216
|
+
onKeyDown={onKeyDown}
|
|
217
|
+
style={splitterComputed}
|
|
218
|
+
>
|
|
219
|
+
<div style={dividerVisualStyle} />
|
|
220
|
+
</div>
|
|
221
|
+
|
|
222
|
+
<div style={rightPaneComputed}>{rightChild}</div>
|
|
223
|
+
</div>
|
|
224
|
+
);
|
|
287
225
|
});
|
package/webpack.config.js
CHANGED
|
@@ -56,7 +56,7 @@ export default (env, argv) => {
|
|
|
56
56
|
optimization: {
|
|
57
57
|
concatenateModules: true, // scope hoisting
|
|
58
58
|
moduleIds: 'deterministic', // smaller stable ids (or 'hashed')
|
|
59
|
-
minimize: mode === 'production',
|
|
59
|
+
minimize: true, //mode === 'production',
|
|
60
60
|
},
|
|
61
61
|
experiments: {
|
|
62
62
|
outputModule: true // enable module output
|
package/docs/static/index 2.html
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8"/>
|
|
5
|
-
<title>Lilact Demo</title>
|
|
6
|
-
<script src='./lilact.development.min.js' type="module"></script>
|
|
7
|
-
|
|
8
|
-
<script src="prismjs/prism.min.js"></script>
|
|
9
|
-
<script src="prismjs/prism-jsx.min.js"></script>
|
|
10
|
-
<link rel="stylesheet" href="prismjs/prism.min.css">
|
|
11
|
-
|
|
12
|
-
</head>
|
|
13
|
-
|
|
14
|
-
<body></body>
|
|
15
|
-
|
|
16
|
-
<script type='text/jsx'>
|
|
17
|
-
|
|
18
|
-
const { useRef, useEffect, useState, Suspense, Spinner, run, render, lazy, require } = Lilact;
|
|
19
|
-
const { css,cx,injectGlobal } = Lilact.emotion;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
injectGlobal({"*:not(code):not(code *)" : {fontFamily: "Ubuntu, 'Segoe UI', 'Noto Sans', helvetica, sans", fontSize: "14px"}});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
injectGlobal({ code: { whiteSpace: "pre !important",
|
|
27
|
-
padding: "10px 0",
|
|
28
|
-
fontSize: "14px !important",
|
|
29
|
-
display: "block",
|
|
30
|
-
overflowWrap: "anywhere" }
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const outer = css({
|
|
34
|
-
display: "flex",
|
|
35
|
-
flexDirection: "row",
|
|
36
|
-
gap: 2,
|
|
37
|
-
alignItems: "stretch",
|
|
38
|
-
width: "100%",
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
const collapsible = css({
|
|
42
|
-
width: "100%",
|
|
43
|
-
display: "block",
|
|
44
|
-
fontSize: "16px",
|
|
45
|
-
border: "1px solid #888",
|
|
46
|
-
padding: "5px"
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const responsiveOuter = css({
|
|
50
|
-
"@media (max-width: 600px)": {
|
|
51
|
-
flexDirection: "column",
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const pane = css({ flex: "1 1 0",
|
|
56
|
-
border: "1px solid",
|
|
57
|
-
height: "400px",
|
|
58
|
-
minHeight: "400px",
|
|
59
|
-
overflowY: "auto",
|
|
60
|
-
padding: "10px"
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
const left = css({ float: "left" });
|
|
64
|
-
const right = css({ float: "right" });
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const Mod = lazy( ()=>require('demos/stopwatch.jsx') );
|
|
69
|
-
|
|
70
|
-
function DemoBlock({file})
|
|
71
|
-
{
|
|
72
|
-
return <>
|
|
73
|
-
<div>
|
|
74
|
-
<Suspense fallback={<Spinner/>}>
|
|
75
|
-
<Mod/>
|
|
76
|
-
</Suspense>
|
|
77
|
-
</div>
|
|
78
|
-
</>
|
|
79
|
-
;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
function App()
|
|
84
|
-
{
|
|
85
|
-
|
|
86
|
-
return <>
|
|
87
|
-
<DemoBlock/>
|
|
88
|
-
</>
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
render(<App/>, document.body);
|
|
92
|
-
|
|
93
|
-
</script>
|
|
94
|
-
|
|
95
|
-
</html>
|