camox 0.66.0 → 0.68.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/core/editing/createEditableBlock.js +2 -1
- package/dist/features/content/components/MissingFromLocale.js +1 -1
- package/dist/features/page/UnplacedLayoutContent.js +141 -0
- package/dist/features/preview/components/ItemFieldsEditor.js +50 -44
- package/dist/features/preview/components/PreviewToolbar.js +77 -68
- package/dist/features/preview/components/SelectionEditor.js +284 -231
- package/dist/features/preview/components/contentFieldSchema.js +5 -1
- package/dist/features/preview/repeatableItemTargets.js +13 -7
- package/dist/features/runtime/RuntimeChrome.js +47 -61
- package/dist/features/runtime/pageApp.js +24 -10
- package/dist/features/runtime/runtime.d.ts +13 -0
- package/dist/features/runtime/runtime.js +58 -2
- package/dist/features/studio/components/ChatWidget.js +3 -4
- package/dist/features/studio/components/ConnectAgent.js +33 -59
- package/dist/features/studio/components/ContentFindings.js +397 -0
- package/dist/features/studio/components/DraftBar.js +139 -0
- package/dist/features/studio/components/DraftsControl.js +13 -57
- package/dist/features/studio/components/Navbar.js +3 -2
- package/dist/features/studio/components/Patrol.js +52 -34
- package/dist/features/studio/components/ReviewDraftSheet.js +4 -4
- package/dist/features/studio/components/Squareling.js +0 -9
- package/dist/features/studio/components/UserButton.js +7 -11
- package/dist/features/studio/findingSentence.js +3 -5
- package/dist/features/studio/patrollerBio.js +0 -1
- package/dist/features/studio/reportSentence.js +0 -5
- package/dist/features/studio/studioStore.js +0 -13
- package/dist/features/studio/workingSentence.js +0 -4
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/dist/features/studio/components/UnnamedDraftBar.js +0 -349
|
@@ -714,7 +714,8 @@ function createEditableBlock(options) {
|
|
|
714
714
|
$[5] = t2;
|
|
715
715
|
} else t2 = $[5];
|
|
716
716
|
const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_FIELD", "CAMOX_HOVER_FIELD_END", t2);
|
|
717
|
-
const
|
|
717
|
+
const isFocused = useFieldSelection(blockId, fieldName, "Artifact", itemId);
|
|
718
|
+
const overlayState = useOverlayState(isHovered || isHoveredFromSidebar, isFocused);
|
|
718
719
|
let t3;
|
|
719
720
|
if ($[6] !== blockId || $[7] !== fieldName || $[8] !== itemId || $[9] !== selectTarget) {
|
|
720
721
|
t3 = () => {
|
|
@@ -2,8 +2,8 @@ import { useViewLocale } from "../../../lib/view-locale-context.js";
|
|
|
2
2
|
import { useProjectUuid } from "../../../lib/auth.js";
|
|
3
3
|
import { reads, useReadQuery, useStudioCache } from "../../../lib/studio-reads.js";
|
|
4
4
|
import { localeMutations } from "../../../lib/queries.js";
|
|
5
|
-
import { ContentSidebarGroup } from "./ContentSidebarGroup.js";
|
|
6
5
|
import { localeLabel } from "../../studio/localeOptions.js";
|
|
6
|
+
import { ContentSidebarGroup } from "./ContentSidebarGroup.js";
|
|
7
7
|
import { c } from "react/compiler-runtime";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { useMutation } from "@tanstack/react-query";
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { useViewLocale } from "../../lib/view-locale-context.js";
|
|
2
|
+
import { usePageBlocks } from "../../lib/normalized-data.js";
|
|
3
|
+
import { buildLayoutContext } from "../../core/layoutContext.js";
|
|
4
|
+
import { SharedLayoutContent } from "./SharedLayoutContent.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/features/page/UnplacedLayoutContent.tsx
|
|
9
|
+
const EMPTY_PAGE = { blockIds: [] };
|
|
10
|
+
/**
|
|
11
|
+
* How tall the placeholder stands: short enough to leave the footer on the first screen, which
|
|
12
|
+
* shows whether it rises up it, or taller than any screen, as a long page is.
|
|
13
|
+
*/
|
|
14
|
+
const PLACEHOLDER_HEIGHTS = {
|
|
15
|
+
short: "16rem",
|
|
16
|
+
tall: "300vh"
|
|
17
|
+
};
|
|
18
|
+
/** A grey that reads on light and dark Themes alike. */
|
|
19
|
+
const HATCH = "rgba(128, 128, 128, 0.35)";
|
|
20
|
+
/**
|
|
21
|
+
* Where a page's content goes, as the look document's Layout Definition mode shows it: a labelled,
|
|
22
|
+
* hatched area, styled inline, since the site's stylesheet knows nothing of it.
|
|
23
|
+
*/
|
|
24
|
+
function PageContentPlaceholder(t0) {
|
|
25
|
+
const $ = c(6);
|
|
26
|
+
const { height } = t0;
|
|
27
|
+
const t1 = PLACEHOLDER_HEIGHTS[height];
|
|
28
|
+
let t2;
|
|
29
|
+
if ($[0] !== t1) {
|
|
30
|
+
t2 = {
|
|
31
|
+
minHeight: t1,
|
|
32
|
+
display: "flex",
|
|
33
|
+
alignItems: "flex-start",
|
|
34
|
+
justifyContent: "center",
|
|
35
|
+
padding: "2rem",
|
|
36
|
+
border: `2px dashed ${HATCH}`,
|
|
37
|
+
backgroundImage: `repeating-linear-gradient(45deg, ${HATCH} 0 2px, transparent 2px 14px)`,
|
|
38
|
+
font: "600 14px/1.4 system-ui, sans-serif",
|
|
39
|
+
color: "rgb(128, 128, 128)"
|
|
40
|
+
};
|
|
41
|
+
$[0] = t1;
|
|
42
|
+
$[1] = t2;
|
|
43
|
+
} else t2 = $[1];
|
|
44
|
+
const style = t2;
|
|
45
|
+
let t3;
|
|
46
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
47
|
+
t3 = /* @__PURE__ */ jsx("span", { children: "Page content" });
|
|
48
|
+
$[2] = t3;
|
|
49
|
+
} else t3 = $[2];
|
|
50
|
+
let t4;
|
|
51
|
+
if ($[3] !== height || $[4] !== style) {
|
|
52
|
+
t4 = /* @__PURE__ */ jsx("div", {
|
|
53
|
+
"data-camox-look-placeholder": height,
|
|
54
|
+
style,
|
|
55
|
+
children: t3
|
|
56
|
+
});
|
|
57
|
+
$[3] = height;
|
|
58
|
+
$[4] = style;
|
|
59
|
+
$[5] = t4;
|
|
60
|
+
} else t4 = $[5];
|
|
61
|
+
return t4;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A curated Layout around no page, alone, as the look document's Layout Definition mode shows it
|
|
65
|
+
* (ADR 0032): its blocks, read like a Layout's, around a placeholder for a page's content.
|
|
66
|
+
*/
|
|
67
|
+
function UnplacedLayoutContent(t0) {
|
|
68
|
+
const $ = c(21);
|
|
69
|
+
const { camoxApp, lookLayout } = t0;
|
|
70
|
+
let t1;
|
|
71
|
+
if ($[0] !== lookLayout.layout) {
|
|
72
|
+
t1 = {
|
|
73
|
+
page: EMPTY_PAGE,
|
|
74
|
+
layout: lookLayout.layout
|
|
75
|
+
};
|
|
76
|
+
$[0] = lookLayout.layout;
|
|
77
|
+
$[1] = t1;
|
|
78
|
+
} else t1 = $[1];
|
|
79
|
+
const { beforeBlocks, afterBlocks, layoutFiles, layoutItems } = usePageBlocks(t1);
|
|
80
|
+
const { locale } = useViewLocale();
|
|
81
|
+
let t2;
|
|
82
|
+
if ($[2] !== camoxApp || $[3] !== lookLayout.layoutId) {
|
|
83
|
+
t2 = camoxApp.getLayoutById(lookLayout.layoutId);
|
|
84
|
+
$[2] = camoxApp;
|
|
85
|
+
$[3] = lookLayout.layoutId;
|
|
86
|
+
$[4] = t2;
|
|
87
|
+
} else t2 = $[4];
|
|
88
|
+
const layout = t2;
|
|
89
|
+
if (!layout) throw new Error(`Unknown layout: ${lookLayout.layoutId}`);
|
|
90
|
+
let t3;
|
|
91
|
+
if ($[5] !== locale.tag || $[6] !== lookLayout.path || $[7] !== lookLayout.projectName) {
|
|
92
|
+
t3 = buildLayoutContext({
|
|
93
|
+
kind: "curated",
|
|
94
|
+
title: ""
|
|
95
|
+
}, {
|
|
96
|
+
path: lookLayout.path,
|
|
97
|
+
locale: locale.tag,
|
|
98
|
+
projectName: lookLayout.projectName
|
|
99
|
+
});
|
|
100
|
+
$[5] = locale.tag;
|
|
101
|
+
$[6] = lookLayout.path;
|
|
102
|
+
$[7] = lookLayout.projectName;
|
|
103
|
+
$[8] = t3;
|
|
104
|
+
} else t3 = $[8];
|
|
105
|
+
const context = t3;
|
|
106
|
+
let t4;
|
|
107
|
+
if ($[9] !== afterBlocks || $[10] !== beforeBlocks) {
|
|
108
|
+
t4 = [...beforeBlocks, ...afterBlocks];
|
|
109
|
+
$[9] = afterBlocks;
|
|
110
|
+
$[10] = beforeBlocks;
|
|
111
|
+
$[11] = t4;
|
|
112
|
+
} else t4 = $[11];
|
|
113
|
+
let t5;
|
|
114
|
+
if ($[12] !== lookLayout.placeholder) {
|
|
115
|
+
t5 = /* @__PURE__ */ jsx(PageContentPlaceholder, { height: lookLayout.placeholder });
|
|
116
|
+
$[12] = lookLayout.placeholder;
|
|
117
|
+
$[13] = t5;
|
|
118
|
+
} else t5 = $[13];
|
|
119
|
+
let t6;
|
|
120
|
+
if ($[14] !== context || $[15] !== layout || $[16] !== layoutFiles || $[17] !== layoutItems || $[18] !== t4 || $[19] !== t5) {
|
|
121
|
+
t6 = /* @__PURE__ */ jsx(SharedLayoutContent, {
|
|
122
|
+
layout,
|
|
123
|
+
context,
|
|
124
|
+
blocks: t4,
|
|
125
|
+
files: layoutFiles,
|
|
126
|
+
repeatableItems: layoutItems,
|
|
127
|
+
children: t5
|
|
128
|
+
});
|
|
129
|
+
$[14] = context;
|
|
130
|
+
$[15] = layout;
|
|
131
|
+
$[16] = layoutFiles;
|
|
132
|
+
$[17] = layoutItems;
|
|
133
|
+
$[18] = t4;
|
|
134
|
+
$[19] = t5;
|
|
135
|
+
$[20] = t6;
|
|
136
|
+
} else t6 = $[20];
|
|
137
|
+
return t6;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
//#endregion
|
|
141
|
+
export { UnplacedLayoutContent };
|
|
@@ -45,8 +45,8 @@ const getSchemaFieldsInOrder = (schema) => {
|
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
47
|
const ItemFieldsEditor = (t0) => {
|
|
48
|
-
const $ = c(
|
|
49
|
-
const { selectedFieldName, schema, data, blockId, itemId, onFieldChange, postToIframe, filesMap, itemsMap, references, placement, fieldIdPrefix } = t0;
|
|
48
|
+
const $ = c(59);
|
|
49
|
+
const { selectedFieldName, schema, data, blockId, itemId, onFieldChange, postToIframe, filesMap, itemsMap, references, placement, fieldIdPrefix, fieldHint } = t0;
|
|
50
50
|
const owner = React.useContext(PreviewEditingOwnerContext);
|
|
51
51
|
let t1;
|
|
52
52
|
if ($[0] !== schema || $[1] !== selectedFieldName) {
|
|
@@ -146,7 +146,7 @@ const ItemFieldsEditor = (t0) => {
|
|
|
146
146
|
React.useEffect(t8, t9);
|
|
147
147
|
let t10;
|
|
148
148
|
let t11;
|
|
149
|
-
if ($[25] !== blockId || $[26] !== data || $[27] !==
|
|
149
|
+
if ($[25] !== blockId || $[26] !== data || $[27] !== fieldHint || $[28] !== fields || $[29] !== filesMap || $[30] !== form || $[31] !== getFieldElementId || $[32] !== getFieldId || $[33] !== itemId || $[34] !== itemsMap || $[35] !== onFieldChange || $[36] !== owner || $[37] !== placement || $[38] !== postToIframe || $[39] !== references || $[40] !== schema || $[41] !== selectedFieldName) {
|
|
150
150
|
const handleScalarChange = (fieldName_2, value, fieldApi) => {
|
|
151
151
|
fieldApi.handleChange(value);
|
|
152
152
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
@@ -158,7 +158,7 @@ const ItemFieldsEditor = (t0) => {
|
|
|
158
158
|
}, 500);
|
|
159
159
|
};
|
|
160
160
|
let t12;
|
|
161
|
-
if ($[
|
|
161
|
+
if ($[44] !== blockId || $[45] !== itemId || $[46] !== owner || $[47] !== placement) {
|
|
162
162
|
t12 = (fieldName_3, fieldType) => {
|
|
163
163
|
if (owner === null) return;
|
|
164
164
|
if (placement) {
|
|
@@ -190,12 +190,12 @@ const ItemFieldsEditor = (t0) => {
|
|
|
190
190
|
fieldType
|
|
191
191
|
});
|
|
192
192
|
};
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
$[
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
} else t12 = $[
|
|
193
|
+
$[44] = blockId;
|
|
194
|
+
$[45] = itemId;
|
|
195
|
+
$[46] = owner;
|
|
196
|
+
$[47] = placement;
|
|
197
|
+
$[48] = t12;
|
|
198
|
+
} else t12 = $[48];
|
|
199
199
|
const selectField = t12;
|
|
200
200
|
const handleFieldFocus = (fieldName_4, fieldType_0) => {
|
|
201
201
|
if (owner === null) return;
|
|
@@ -216,7 +216,7 @@ const ItemFieldsEditor = (t0) => {
|
|
|
216
216
|
});
|
|
217
217
|
};
|
|
218
218
|
let t13;
|
|
219
|
-
if ($[
|
|
219
|
+
if ($[49] !== blockId || $[50] !== itemId || $[51] !== placement) {
|
|
220
220
|
t13 = (fieldName_6, recordId) => placement ? {
|
|
221
221
|
...placement,
|
|
222
222
|
nested: {
|
|
@@ -229,15 +229,15 @@ const ItemFieldsEditor = (t0) => {
|
|
|
229
229
|
fieldName: fieldName_6,
|
|
230
230
|
recordId
|
|
231
231
|
};
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
} else t13 = $[
|
|
232
|
+
$[49] = blockId;
|
|
233
|
+
$[50] = itemId;
|
|
234
|
+
$[51] = placement;
|
|
235
|
+
$[52] = t13;
|
|
236
|
+
} else t13 = $[52];
|
|
237
237
|
const placementOf = t13;
|
|
238
238
|
const opensRecords = !placement?.nested;
|
|
239
239
|
let t14;
|
|
240
|
-
if ($[
|
|
240
|
+
if ($[53] !== owner || $[54] !== placementOf) {
|
|
241
241
|
t14 = (fieldName_7, recordId_0) => {
|
|
242
242
|
if (owner === null) return;
|
|
243
243
|
previewStore.send({
|
|
@@ -246,10 +246,10 @@ const ItemFieldsEditor = (t0) => {
|
|
|
246
246
|
...placementOf(fieldName_7, recordId_0)
|
|
247
247
|
});
|
|
248
248
|
};
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
} else t14 = $[
|
|
249
|
+
$[53] = owner;
|
|
250
|
+
$[54] = placementOf;
|
|
251
|
+
$[55] = t14;
|
|
252
|
+
} else t14 = $[55];
|
|
253
253
|
const openRecord = t14;
|
|
254
254
|
t10 = "space-y-4 px-2 py-4";
|
|
255
255
|
t11 = fields.map((field_0) => {
|
|
@@ -342,6 +342,7 @@ const ItemFieldsEditor = (t0) => {
|
|
|
342
342
|
const preview = field_0.fieldType === "String" ? lexicalStateToPlainText(value_2 ?? "") || "Empty text" : field_0.fieldType === "Repeater" ? `${Array.isArray(value_2) ? value_2.length : 0} items` : field_0.fieldType === "Boolean" ? value_2 ? "On" : "Off" : typeof value_2 === "string" && value_2 ? value_2 : "Empty";
|
|
343
343
|
return /* @__PURE__ */ jsx(DrillRow, {
|
|
344
344
|
label,
|
|
345
|
+
hint: fieldHint?.(field_0.name),
|
|
345
346
|
preview,
|
|
346
347
|
Icon: field_0.fieldType === "String" ? Type : field_0.fieldType === "Repeater" ? List : field_0.fieldType === "Embed" ? Code : field_0.fieldType === "Boolean" ? ToggleLeft : ListFilter,
|
|
347
348
|
onClick: () => selectField(field_0.name, field_0.fieldType),
|
|
@@ -444,6 +445,7 @@ const ItemFieldsEditor = (t0) => {
|
|
|
444
445
|
const preview_0 = linkValue?.text || linkValue?.href || "Empty link";
|
|
445
446
|
return /* @__PURE__ */ jsx(DrillRow, {
|
|
446
447
|
label,
|
|
448
|
+
hint: fieldHint?.(field_0.name),
|
|
447
449
|
preview: preview_0,
|
|
448
450
|
Icon: Link2,
|
|
449
451
|
onClick: () => selectField(field_0.name, "Link"),
|
|
@@ -465,6 +467,7 @@ const ItemFieldsEditor = (t0) => {
|
|
|
465
467
|
else preview_1 = `${count} ${noun}s`;
|
|
466
468
|
return /* @__PURE__ */ jsx(DrillRow, {
|
|
467
469
|
label,
|
|
470
|
+
hint: fieldHint?.(field_0.name),
|
|
468
471
|
preview: preview_1,
|
|
469
472
|
Icon: isImage ? Images : FileIcon,
|
|
470
473
|
onClick: () => selectField(field_0.name, isImage ? "Image" : "File"),
|
|
@@ -480,6 +483,7 @@ const ItemFieldsEditor = (t0) => {
|
|
|
480
483
|
const preview_2 = resolveAssetValue(data[field_0.name], filesMap)?.filename || "No image";
|
|
481
484
|
return /* @__PURE__ */ jsx(DrillRow, {
|
|
482
485
|
label,
|
|
486
|
+
hint: fieldHint?.(field_0.name),
|
|
483
487
|
preview: preview_2,
|
|
484
488
|
Icon: ImageIcon,
|
|
485
489
|
onClick: () => selectField(field_0.name, "Image"),
|
|
@@ -494,6 +498,7 @@ const ItemFieldsEditor = (t0) => {
|
|
|
494
498
|
const preview_3 = resolveAssetValue(data[field_0.name], filesMap)?.filename || "No file";
|
|
495
499
|
return /* @__PURE__ */ jsx(DrillRow, {
|
|
496
500
|
label,
|
|
501
|
+
hint: fieldHint?.(field_0.name),
|
|
497
502
|
preview: preview_3,
|
|
498
503
|
Icon: FileIcon,
|
|
499
504
|
onClick: () => selectField(field_0.name, "File"),
|
|
@@ -526,36 +531,37 @@ const ItemFieldsEditor = (t0) => {
|
|
|
526
531
|
});
|
|
527
532
|
$[25] = blockId;
|
|
528
533
|
$[26] = data;
|
|
529
|
-
$[27] =
|
|
530
|
-
$[28] =
|
|
531
|
-
$[29] =
|
|
532
|
-
$[30] =
|
|
533
|
-
$[31] =
|
|
534
|
-
$[32] =
|
|
535
|
-
$[33] =
|
|
536
|
-
$[34] =
|
|
537
|
-
$[35] =
|
|
538
|
-
$[36] =
|
|
539
|
-
$[37] =
|
|
540
|
-
$[38] =
|
|
541
|
-
$[39] =
|
|
542
|
-
$[40] =
|
|
543
|
-
$[41] =
|
|
544
|
-
$[42] =
|
|
534
|
+
$[27] = fieldHint;
|
|
535
|
+
$[28] = fields;
|
|
536
|
+
$[29] = filesMap;
|
|
537
|
+
$[30] = form;
|
|
538
|
+
$[31] = getFieldElementId;
|
|
539
|
+
$[32] = getFieldId;
|
|
540
|
+
$[33] = itemId;
|
|
541
|
+
$[34] = itemsMap;
|
|
542
|
+
$[35] = onFieldChange;
|
|
543
|
+
$[36] = owner;
|
|
544
|
+
$[37] = placement;
|
|
545
|
+
$[38] = postToIframe;
|
|
546
|
+
$[39] = references;
|
|
547
|
+
$[40] = schema;
|
|
548
|
+
$[41] = selectedFieldName;
|
|
549
|
+
$[42] = t10;
|
|
550
|
+
$[43] = t11;
|
|
545
551
|
} else {
|
|
546
|
-
t10 = $[
|
|
547
|
-
t11 = $[
|
|
552
|
+
t10 = $[42];
|
|
553
|
+
t11 = $[43];
|
|
548
554
|
}
|
|
549
555
|
let t12;
|
|
550
|
-
if ($[
|
|
556
|
+
if ($[56] !== t10 || $[57] !== t11) {
|
|
551
557
|
t12 = /* @__PURE__ */ jsx("form", {
|
|
552
558
|
className: t10,
|
|
553
559
|
children: t11
|
|
554
560
|
});
|
|
555
|
-
$[
|
|
556
|
-
$[
|
|
557
|
-
$[
|
|
558
|
-
} else t12 = $[
|
|
561
|
+
$[56] = t10;
|
|
562
|
+
$[57] = t11;
|
|
563
|
+
$[58] = t12;
|
|
564
|
+
} else t12 = $[58];
|
|
559
565
|
return t12;
|
|
560
566
|
};
|
|
561
567
|
function _temp(f) {
|
|
@@ -3,6 +3,7 @@ import { formatShortcut } from "../../../lib/shortcuts.js";
|
|
|
3
3
|
import { TOGGLE_CANVAS_SHORTCUT } from "../previewConstants.js";
|
|
4
4
|
import { prefetchCanvas } from "./CanvasPreview.js";
|
|
5
5
|
import { DeviceSelector } from "../../../components/DeviceSelector.js";
|
|
6
|
+
import { DraftBar } from "../../studio/components/DraftBar.js";
|
|
6
7
|
import { c } from "react/compiler-runtime";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { useSelector } from "@xstate/store-react";
|
|
@@ -15,55 +16,60 @@ import { FloatingToolbar } from "@camox/ui/floating-toolbar";
|
|
|
15
16
|
|
|
16
17
|
//#region src/features/preview/components/PreviewToolbar.tsx
|
|
17
18
|
const PreviewToolbar = () => {
|
|
18
|
-
const $ = c(
|
|
19
|
+
const $ = c(22);
|
|
19
20
|
const isCanvasShown = useSelector(previewStore, selectIsCanvasShown);
|
|
20
21
|
const isToolbarHidden = useSelector(previewStore, _temp);
|
|
21
22
|
const viewportMode = useSelector(previewStore, _temp2);
|
|
22
23
|
if (isToolbarHidden) return null;
|
|
23
24
|
let t0;
|
|
24
|
-
if ($[0]
|
|
25
|
-
t0 = /* @__PURE__ */ jsx(
|
|
25
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
26
|
+
t0 = /* @__PURE__ */ jsx(DraftBar, { stacked: true });
|
|
27
|
+
$[0] = t0;
|
|
28
|
+
} else t0 = $[0];
|
|
29
|
+
let t1;
|
|
30
|
+
if ($[1] !== isCanvasShown) {
|
|
31
|
+
t1 = /* @__PURE__ */ jsx(Switch, {
|
|
26
32
|
id: "show-canvas",
|
|
27
33
|
checked: isCanvasShown,
|
|
28
34
|
onCheckedChange: _temp3
|
|
29
35
|
});
|
|
30
|
-
$[
|
|
31
|
-
$[
|
|
32
|
-
} else
|
|
33
|
-
let
|
|
34
|
-
if ($[
|
|
35
|
-
|
|
36
|
+
$[1] = isCanvasShown;
|
|
37
|
+
$[2] = t1;
|
|
38
|
+
} else t1 = $[2];
|
|
39
|
+
let t2;
|
|
40
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
41
|
+
t2 = /* @__PURE__ */ jsxs(Label, {
|
|
36
42
|
htmlFor: "show-canvas",
|
|
37
43
|
className: "flex items-center gap-2",
|
|
38
44
|
children: ["Show canvas ", formatShortcut(TOGGLE_CANVAS_SHORTCUT)]
|
|
39
45
|
});
|
|
40
|
-
$[
|
|
41
|
-
} else
|
|
42
|
-
let
|
|
43
|
-
if ($[
|
|
44
|
-
|
|
46
|
+
$[3] = t2;
|
|
47
|
+
} else t2 = $[3];
|
|
48
|
+
let t3;
|
|
49
|
+
if ($[4] !== t1) {
|
|
50
|
+
t3 = /* @__PURE__ */ jsxs("div", {
|
|
45
51
|
className: "flex shrink-0 items-center gap-2 px-2",
|
|
46
52
|
onPointerEnter: prefetchCanvas,
|
|
47
53
|
onFocus: prefetchCanvas,
|
|
48
|
-
children: [
|
|
54
|
+
children: [t1, t2]
|
|
49
55
|
});
|
|
50
|
-
$[
|
|
51
|
-
$[
|
|
52
|
-
} else
|
|
53
|
-
const
|
|
54
|
-
let
|
|
55
|
-
if ($[
|
|
56
|
-
|
|
57
|
-
value:
|
|
56
|
+
$[4] = t1;
|
|
57
|
+
$[5] = t3;
|
|
58
|
+
} else t3 = $[5];
|
|
59
|
+
const t4 = viewportMode === "full" ? "desktop" : viewportMode;
|
|
60
|
+
let t5;
|
|
61
|
+
if ($[6] !== t4) {
|
|
62
|
+
t5 = /* @__PURE__ */ jsx(DeviceSelector, {
|
|
63
|
+
value: t4,
|
|
58
64
|
desktopLabel: "Full view",
|
|
59
65
|
onValueChange: _temp4
|
|
60
66
|
});
|
|
61
|
-
$[5] = t3;
|
|
62
67
|
$[6] = t4;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
$[7] = t5;
|
|
69
|
+
} else t5 = $[7];
|
|
70
|
+
let t6;
|
|
71
|
+
if ($[8] !== isCanvasShown) {
|
|
72
|
+
t6 = /* @__PURE__ */ jsx(Button, {
|
|
67
73
|
type: "button",
|
|
68
74
|
variant: "ghost",
|
|
69
75
|
size: "icon",
|
|
@@ -72,58 +78,61 @@ const PreviewToolbar = () => {
|
|
|
72
78
|
"aria-label": "Hide toolbar",
|
|
73
79
|
className: "text-muted-foreground"
|
|
74
80
|
});
|
|
75
|
-
$[
|
|
76
|
-
$[8] = t5;
|
|
77
|
-
} else t5 = $[8];
|
|
78
|
-
let t6;
|
|
79
|
-
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
80
|
-
t6 = /* @__PURE__ */ jsx(X, {});
|
|
81
|
+
$[8] = isCanvasShown;
|
|
81
82
|
$[9] = t6;
|
|
82
83
|
} else t6 = $[9];
|
|
83
84
|
let t7;
|
|
84
|
-
if ($[10]
|
|
85
|
-
t7 = /* @__PURE__ */ jsx(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
});
|
|
89
|
-
$[10] = t5;
|
|
90
|
-
$[11] = t7;
|
|
91
|
-
} else t7 = $[11];
|
|
85
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
86
|
+
t7 = /* @__PURE__ */ jsx(X, {});
|
|
87
|
+
$[10] = t7;
|
|
88
|
+
} else t7 = $[10];
|
|
92
89
|
let t8;
|
|
93
|
-
if ($[
|
|
94
|
-
t8 = /* @__PURE__ */ jsx(Tooltip$1.
|
|
90
|
+
if ($[11] !== t6) {
|
|
91
|
+
t8 = /* @__PURE__ */ jsx(Tooltip$1.TooltipTrigger, {
|
|
92
|
+
render: t6,
|
|
93
|
+
children: t7
|
|
94
|
+
});
|
|
95
|
+
$[11] = t6;
|
|
95
96
|
$[12] = t8;
|
|
96
97
|
} else t8 = $[12];
|
|
97
98
|
let t9;
|
|
98
|
-
if ($[13]
|
|
99
|
-
t9 = /* @__PURE__ */ jsx("
|
|
99
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
100
|
+
t9 = /* @__PURE__ */ jsx(Tooltip$1.TooltipContent, { children: "Hide toolbar" });
|
|
101
|
+
$[13] = t9;
|
|
102
|
+
} else t9 = $[13];
|
|
103
|
+
let t10;
|
|
104
|
+
if ($[14] !== t8) {
|
|
105
|
+
t10 = /* @__PURE__ */ jsx("div", {
|
|
100
106
|
className: "-ml-2 flex items-center gap-2",
|
|
101
|
-
children: /* @__PURE__ */ jsxs(Tooltip$1.Tooltip, { children: [
|
|
107
|
+
children: /* @__PURE__ */ jsxs(Tooltip$1.Tooltip, { children: [t8, t9] })
|
|
102
108
|
});
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
105
|
-
} else
|
|
106
|
-
let
|
|
107
|
-
if ($[
|
|
108
|
-
|
|
109
|
+
$[14] = t8;
|
|
110
|
+
$[15] = t10;
|
|
111
|
+
} else t10 = $[15];
|
|
112
|
+
let t11;
|
|
113
|
+
if ($[16] !== t10 || $[17] !== t5) {
|
|
114
|
+
t11 = /* @__PURE__ */ jsxs("div", {
|
|
109
115
|
className: "flex shrink-0 items-center gap-6 self-stretch",
|
|
110
|
-
children: [
|
|
116
|
+
children: [t5, t10]
|
|
111
117
|
});
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
} else
|
|
116
|
-
let
|
|
117
|
-
if ($[
|
|
118
|
-
|
|
119
|
-
className: "fixed bottom-2
|
|
120
|
-
children: [
|
|
118
|
+
$[16] = t10;
|
|
119
|
+
$[17] = t5;
|
|
120
|
+
$[18] = t11;
|
|
121
|
+
} else t11 = $[18];
|
|
122
|
+
let t12;
|
|
123
|
+
if ($[19] !== t11 || $[20] !== t3) {
|
|
124
|
+
t12 = /* @__PURE__ */ jsxs("div", {
|
|
125
|
+
className: "pointer-events-none fixed bottom-2 left-1/2 z-30 flex -translate-x-1/2 flex-col items-center gap-2",
|
|
126
|
+
children: [t0, /* @__PURE__ */ jsxs(FloatingToolbar, {
|
|
127
|
+
className: "pointer-events-auto relative left-auto w-max translate-x-0 justify-between gap-6 transition-none",
|
|
128
|
+
children: [t3, t11]
|
|
129
|
+
})]
|
|
121
130
|
});
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
} else
|
|
126
|
-
return
|
|
131
|
+
$[19] = t11;
|
|
132
|
+
$[20] = t3;
|
|
133
|
+
$[21] = t12;
|
|
134
|
+
} else t12 = $[21];
|
|
135
|
+
return t12;
|
|
127
136
|
};
|
|
128
137
|
function _temp(state) {
|
|
129
138
|
return state.context.isToolbarHidden;
|