camox 0.32.0 → 0.33.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/createBlock.d.ts +1 -1
- package/dist/core/createBlock.js +88 -108
- package/dist/core/hooks/useIsEditable.js +6 -10
- package/dist/core/lib/fieldTypes.js +10 -219
- package/dist/features/agent-chat/components/AgentChatSidebar.js +172 -0
- package/dist/features/agent-chat/components/AgentChatThread.js +9 -9
- package/dist/features/preview/CamoxPreview.js +137 -729
- package/dist/features/preview/components/{AddBlockSheet.js → AddBlockSidebar.js} +121 -131
- package/dist/features/preview/components/AssetFieldEditor.js +107 -82
- package/dist/features/preview/components/AssetLightbox.js +4 -4
- package/dist/features/preview/components/AssetPickerModal.js +277 -0
- package/dist/features/preview/components/BlockActionsPopover.js +18 -24
- package/dist/features/preview/components/CreatePageModal.js +6 -6
- package/dist/features/preview/components/FieldToolbar.js +64 -127
- package/dist/features/preview/components/ItemFieldsEditor.js +98 -125
- package/dist/features/preview/components/LeftSidebar.js +64 -0
- package/dist/features/preview/components/LinkFieldEditor.js +1 -1
- package/dist/features/preview/components/MultipleAssetFieldEditor.js +94 -56
- package/dist/features/preview/components/OverlayTracker.js +15 -15
- package/dist/features/preview/components/Overlays.js +12 -12
- package/dist/features/preview/components/PageEditorSidebar.js +563 -0
- package/dist/features/preview/components/PageInfoSidebar.js +1453 -0
- package/dist/features/preview/components/PageNavigatorSidebar.js +590 -0
- package/dist/features/preview/components/PagePicker.js +3 -3
- package/dist/features/preview/components/PageStatusBadge.js +1 -1
- package/dist/features/preview/components/PageTree.js +204 -564
- package/dist/features/preview/components/PreviewPanel.js +123 -158
- package/dist/features/preview/components/PreviewToolbar.js +260 -256
- package/dist/features/preview/components/PublishDialog.js +2 -2
- package/dist/features/preview/components/RepeatableItemsList.js +2 -2
- package/dist/features/preview/components/RightSidebar.js +109 -0
- package/dist/features/preview/components/UnlinkAssetButton.js +2 -2
- package/dist/features/preview/components/useRepeatableItemActions.js +3 -138
- package/dist/features/preview/components/useUpdateBlockPosition.js +1 -1
- package/dist/features/preview/previewQueryFns.js +23 -0
- package/dist/features/preview/previewStore.js +46 -63
- package/dist/features/provider/CamoxProvider.js +255 -70
- package/dist/features/provider/useAdminShortcuts.js +5 -48
- package/dist/features/routes/pageRoute.js +1 -1
- package/dist/features/studio/CamoxStudio.js +6 -5
- package/dist/features/studio/components/EnvironmentMenu.js +2 -2
- package/dist/features/studio/components/Navbar.js +53 -71
- package/dist/features/studio/components/ProjectMenu.js +1 -1
- package/dist/features/studio/components/UserButton.js +1 -1
- package/dist/features/studio/routes.js +7 -0
- package/dist/features/studio/useTheme.js +67 -33
- package/dist/features/vite/routeGeneration.js +68 -66
- package/dist/hooks/use-file-upload.js +1 -1
- package/dist/lib/auth.js +23 -22
- package/dist/lib/utils.js +1 -1
- package/dist/studio-overlays.css +1 -1
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/dist/features/agent-chat/components/AgentChatSheet.js +0 -207
- package/dist/features/preview/components/AssetPickerGrid.js +0 -236
- package/dist/features/preview/components/PageContentSheet.js +0 -608
- package/dist/features/preview/components/PageMetadataModal.js +0 -908
- package/dist/features/preview/components/PreviewSideSheet.js +0 -76
|
@@ -1,321 +1,325 @@
|
|
|
1
|
-
import { previewStore } from "../previewStore.js";
|
|
2
1
|
import { actionsStore } from "../../provider/actionsStore.js";
|
|
3
|
-
import {
|
|
2
|
+
import { getActionShortcut } from "../../../lib/utils.js";
|
|
3
|
+
import { previewStore } from "../previewStore.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
|
-
import {
|
|
5
|
+
import { Label } from "@camox/ui/label";
|
|
6
6
|
import { useSelector } from "@xstate/store-react";
|
|
7
|
-
import {
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { Button } from "@camox/ui/button";
|
|
9
|
+
import { Monitor, Smartphone, Tablet, X } from "lucide-react";
|
|
9
10
|
import { ButtonGroup } from "@camox/ui/button-group";
|
|
11
|
+
import { Switch } from "@camox/ui/switch";
|
|
10
12
|
import * as Tooltip$1 from "@camox/ui/tooltip";
|
|
11
|
-
import { Lock, MonitorPlay, PanelRight, TabletSmartphone } from "lucide-react";
|
|
12
13
|
import { FloatingToolbar } from "@camox/ui/floating-toolbar";
|
|
13
14
|
import { Toggle } from "@camox/ui/toggle";
|
|
14
15
|
|
|
15
16
|
//#region src/features/preview/components/PreviewToolbar.tsx
|
|
16
|
-
const PreviewToolbar = () => {
|
|
17
|
-
const $ = c(
|
|
18
|
-
if ($[0] !== "
|
|
19
|
-
for (let $i = 0; $i <
|
|
20
|
-
$[0] = "
|
|
17
|
+
const PreviewToolbar = (t0) => {
|
|
18
|
+
const $ = c(68);
|
|
19
|
+
if ($[0] !== "7f97fe4efcae19473f6dd43a818ab3693d9d0ba512e5bbc200f8678f54e861dc") {
|
|
20
|
+
for (let $i = 0; $i < 68; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
21
|
+
$[0] = "7f97fe4efcae19473f6dd43a818ab3693d9d0ba512e5bbc200f8678f54e861dc";
|
|
21
22
|
}
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
const isAnySideSheetOpen = isPageContentSheetOpen || isAddBlockSheetOpen || isAgentChatSheetOpen;
|
|
30
|
-
const actions = useSelector(actionsStore, _temp8);
|
|
31
|
-
const isMobileMode = useSelector(previewStore, _temp9);
|
|
32
|
-
const t0 = isAnySideSheetOpen && "opacity-0 pointer-events-none translate-y-full";
|
|
23
|
+
const { onEditModeChange } = t0;
|
|
24
|
+
const isEditMode = useSelector(previewStore, _temp);
|
|
25
|
+
const isToolbarHidden = useSelector(previewStore, _temp2);
|
|
26
|
+
const actions = useSelector(actionsStore, _temp3);
|
|
27
|
+
const viewportMode = useSelector(previewStore, _temp4);
|
|
28
|
+
const editModeActionId = isEditMode ? "exit-edit-mode" : "enter-edit-mode";
|
|
29
|
+
if (isToolbarHidden) return null;
|
|
33
30
|
let t1;
|
|
34
|
-
if ($[1] !==
|
|
35
|
-
t1 =
|
|
36
|
-
|
|
31
|
+
if ($[1] !== onEditModeChange) {
|
|
32
|
+
t1 = (checked) => {
|
|
33
|
+
if (onEditModeChange) {
|
|
34
|
+
onEditModeChange(checked);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
previewStore.send({ type: checked ? "enterEditMode" : "exitEditMode" });
|
|
38
|
+
};
|
|
39
|
+
$[1] = onEditModeChange;
|
|
37
40
|
$[2] = t1;
|
|
38
41
|
} else t1 = $[2];
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
let t2;
|
|
43
|
+
if ($[3] !== isEditMode || $[4] !== t1) {
|
|
44
|
+
t2 = /* @__PURE__ */ jsx(Switch, {
|
|
45
|
+
id: "edit-mode",
|
|
46
|
+
checked: isEditMode,
|
|
47
|
+
onCheckedChange: t1
|
|
48
|
+
});
|
|
49
|
+
$[3] = isEditMode;
|
|
50
|
+
$[4] = t1;
|
|
51
|
+
$[5] = t2;
|
|
52
|
+
} else t2 = $[5];
|
|
53
|
+
let t3;
|
|
54
|
+
if ($[6] !== actions || $[7] !== editModeActionId) {
|
|
55
|
+
t3 = getActionShortcut(actions, editModeActionId);
|
|
56
|
+
$[6] = actions;
|
|
57
|
+
$[7] = editModeActionId;
|
|
58
|
+
$[8] = t3;
|
|
59
|
+
} else t3 = $[8];
|
|
41
60
|
let t4;
|
|
42
|
-
if ($[
|
|
43
|
-
t4 = /* @__PURE__ */
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
onClick: _temp0
|
|
61
|
+
if ($[9] !== t3) {
|
|
62
|
+
t4 = /* @__PURE__ */ jsxs(Label, {
|
|
63
|
+
htmlFor: "edit-mode",
|
|
64
|
+
className: "flex items-center gap-2",
|
|
65
|
+
children: ["Edit mode ", t3]
|
|
48
66
|
});
|
|
49
|
-
$[
|
|
50
|
-
$[
|
|
51
|
-
|
|
52
|
-
} else t4 = $[5];
|
|
67
|
+
$[9] = t3;
|
|
68
|
+
$[10] = t4;
|
|
69
|
+
} else t4 = $[10];
|
|
53
70
|
let t5;
|
|
54
|
-
if ($[
|
|
55
|
-
t5 = /* @__PURE__ */
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
let t6;
|
|
59
|
-
if ($[7] !== t4) {
|
|
60
|
-
t6 = /* @__PURE__ */ jsx(Tooltip$1.TooltipTrigger, {
|
|
61
|
-
render: t4,
|
|
62
|
-
children: t5
|
|
71
|
+
if ($[11] !== t2 || $[12] !== t4) {
|
|
72
|
+
t5 = /* @__PURE__ */ jsxs("div", {
|
|
73
|
+
className: "flex items-center gap-2 px-2",
|
|
74
|
+
children: [t2, t4]
|
|
63
75
|
});
|
|
64
|
-
$[
|
|
65
|
-
$[
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
$[9] = actions;
|
|
71
|
-
$[10] = t7;
|
|
72
|
-
} else t7 = $[10];
|
|
76
|
+
$[11] = t2;
|
|
77
|
+
$[12] = t4;
|
|
78
|
+
$[13] = t5;
|
|
79
|
+
} else t5 = $[13];
|
|
80
|
+
const t6 = viewportMode === "full" ? "on" : "off";
|
|
81
|
+
const t7 = viewportMode === "full";
|
|
73
82
|
let t8;
|
|
74
|
-
if ($[
|
|
75
|
-
t8 =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
if ($[14] !== viewportMode) {
|
|
84
|
+
t8 = () => {
|
|
85
|
+
if (viewportMode === "full") return;
|
|
86
|
+
previewStore.send({
|
|
87
|
+
type: "setViewportMode",
|
|
88
|
+
mode: "full"
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
$[14] = viewportMode;
|
|
92
|
+
$[15] = t8;
|
|
93
|
+
} else t8 = $[15];
|
|
79
94
|
let t9;
|
|
80
|
-
if ($[
|
|
81
|
-
t9 = /* @__PURE__ */
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
} else t9 = $[15];
|
|
86
|
-
const t10 = isEditingLocked ? "on" : "off";
|
|
87
|
-
let t11;
|
|
88
|
-
if ($[16] !== isEditingLocked || $[17] !== isPreviewingNonDraft || $[18] !== t10) {
|
|
89
|
-
t11 = /* @__PURE__ */ jsx(Toggle, {
|
|
90
|
-
"data-state": t10,
|
|
91
|
-
pressed: isEditingLocked,
|
|
92
|
-
disabled: isPreviewingNonDraft,
|
|
93
|
-
onPressedChange: _temp1,
|
|
95
|
+
if ($[16] !== t6 || $[17] !== t7 || $[18] !== t8) {
|
|
96
|
+
t9 = /* @__PURE__ */ jsx(Toggle, {
|
|
97
|
+
"data-state": t6,
|
|
98
|
+
pressed: t7,
|
|
99
|
+
onPressedChange: t8,
|
|
94
100
|
variant: "outline"
|
|
95
101
|
});
|
|
96
|
-
$[16] =
|
|
97
|
-
$[17] =
|
|
98
|
-
$[18] =
|
|
99
|
-
$[19] =
|
|
100
|
-
} else
|
|
101
|
-
let
|
|
102
|
+
$[16] = t6;
|
|
103
|
+
$[17] = t7;
|
|
104
|
+
$[18] = t8;
|
|
105
|
+
$[19] = t9;
|
|
106
|
+
} else t9 = $[19];
|
|
107
|
+
let t10;
|
|
102
108
|
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
103
|
-
|
|
104
|
-
$[20] =
|
|
105
|
-
} else
|
|
106
|
-
let
|
|
107
|
-
if ($[21] !==
|
|
108
|
-
|
|
109
|
-
render:
|
|
110
|
-
children:
|
|
109
|
+
t10 = /* @__PURE__ */ jsx(Monitor, {});
|
|
110
|
+
$[20] = t10;
|
|
111
|
+
} else t10 = $[20];
|
|
112
|
+
let t11;
|
|
113
|
+
if ($[21] !== t9) {
|
|
114
|
+
t11 = /* @__PURE__ */ jsx(Tooltip$1.TooltipTrigger, {
|
|
115
|
+
render: t9,
|
|
116
|
+
children: t10
|
|
111
117
|
});
|
|
112
|
-
$[21] =
|
|
113
|
-
$[22] =
|
|
114
|
-
} else
|
|
115
|
-
let
|
|
116
|
-
if ($[23]
|
|
117
|
-
|
|
118
|
-
$[23] =
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
$[25] =
|
|
125
|
-
|
|
126
|
-
|
|
118
|
+
$[21] = t9;
|
|
119
|
+
$[22] = t11;
|
|
120
|
+
} else t11 = $[22];
|
|
121
|
+
let t12;
|
|
122
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
123
|
+
t12 = /* @__PURE__ */ jsx(Tooltip$1.TooltipContent, { children: "Full view" });
|
|
124
|
+
$[23] = t12;
|
|
125
|
+
} else t12 = $[23];
|
|
126
|
+
let t13;
|
|
127
|
+
if ($[24] !== t11) {
|
|
128
|
+
t13 = /* @__PURE__ */ jsxs(Tooltip$1.Tooltip, { children: [t11, t12] });
|
|
129
|
+
$[24] = t11;
|
|
130
|
+
$[25] = t13;
|
|
131
|
+
} else t13 = $[25];
|
|
132
|
+
const t14 = viewportMode === "tablet" ? "on" : "off";
|
|
133
|
+
const t15 = viewportMode === "tablet";
|
|
127
134
|
let t16;
|
|
128
|
-
if ($[
|
|
129
|
-
t16 =
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
135
|
+
if ($[26] !== viewportMode) {
|
|
136
|
+
t16 = () => {
|
|
137
|
+
if (viewportMode === "tablet") return;
|
|
138
|
+
previewStore.send({
|
|
139
|
+
type: "setViewportMode",
|
|
140
|
+
mode: "tablet"
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
$[26] = viewportMode;
|
|
144
|
+
$[27] = t16;
|
|
145
|
+
} else t16 = $[27];
|
|
146
|
+
let t17;
|
|
147
|
+
if ($[28] !== t14 || $[29] !== t15 || $[30] !== t16) {
|
|
148
|
+
t17 = /* @__PURE__ */ jsx(Toggle, {
|
|
149
|
+
"data-state": t14,
|
|
150
|
+
pressed: t15,
|
|
151
|
+
onPressedChange: t16,
|
|
141
152
|
variant: "outline"
|
|
142
153
|
});
|
|
143
|
-
$[
|
|
154
|
+
$[28] = t14;
|
|
155
|
+
$[29] = t15;
|
|
156
|
+
$[30] = t16;
|
|
144
157
|
$[31] = t17;
|
|
158
|
+
} else t17 = $[31];
|
|
159
|
+
let t18;
|
|
160
|
+
if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
|
|
161
|
+
t18 = /* @__PURE__ */ jsx(Tablet, {});
|
|
145
162
|
$[32] = t18;
|
|
146
163
|
} else t18 = $[32];
|
|
147
164
|
let t19;
|
|
148
|
-
if ($[33]
|
|
149
|
-
t19 = /* @__PURE__ */ jsx(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
let t20;
|
|
153
|
-
if ($[34] !== t18) {
|
|
154
|
-
t20 = /* @__PURE__ */ jsx(Tooltip$1.TooltipTrigger, {
|
|
155
|
-
render: t18,
|
|
156
|
-
children: t19
|
|
165
|
+
if ($[33] !== t17) {
|
|
166
|
+
t19 = /* @__PURE__ */ jsx(Tooltip$1.TooltipTrigger, {
|
|
167
|
+
render: t17,
|
|
168
|
+
children: t18
|
|
157
169
|
});
|
|
158
|
-
$[
|
|
170
|
+
$[33] = t17;
|
|
171
|
+
$[34] = t19;
|
|
172
|
+
} else t19 = $[34];
|
|
173
|
+
let t20;
|
|
174
|
+
if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
|
|
175
|
+
t20 = /* @__PURE__ */ jsx(Tooltip$1.TooltipContent, { children: "Tablet view" });
|
|
159
176
|
$[35] = t20;
|
|
160
177
|
} else t20 = $[35];
|
|
161
178
|
let t21;
|
|
162
|
-
if ($[36] !==
|
|
163
|
-
t21 =
|
|
164
|
-
$[36] =
|
|
179
|
+
if ($[36] !== t19) {
|
|
180
|
+
t21 = /* @__PURE__ */ jsxs(Tooltip$1.Tooltip, { children: [t19, t20] });
|
|
181
|
+
$[36] = t19;
|
|
165
182
|
$[37] = t21;
|
|
166
183
|
} else t21 = $[37];
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
$[
|
|
179
|
-
|
|
180
|
-
|
|
184
|
+
const t22 = viewportMode === "mobile" ? "on" : "off";
|
|
185
|
+
const t23 = viewportMode === "mobile";
|
|
186
|
+
let t24;
|
|
187
|
+
if ($[38] !== viewportMode) {
|
|
188
|
+
t24 = () => {
|
|
189
|
+
if (viewportMode === "mobile") return;
|
|
190
|
+
previewStore.send({
|
|
191
|
+
type: "setViewportMode",
|
|
192
|
+
mode: "mobile"
|
|
193
|
+
});
|
|
194
|
+
};
|
|
195
|
+
$[38] = viewportMode;
|
|
196
|
+
$[39] = t24;
|
|
197
|
+
} else t24 = $[39];
|
|
181
198
|
let t25;
|
|
182
|
-
if ($[
|
|
199
|
+
if ($[40] !== t22 || $[41] !== t23 || $[42] !== t24) {
|
|
183
200
|
t25 = /* @__PURE__ */ jsx(Toggle, {
|
|
184
|
-
"data-state":
|
|
185
|
-
pressed:
|
|
186
|
-
|
|
187
|
-
|
|
201
|
+
"data-state": t22,
|
|
202
|
+
pressed: t23,
|
|
203
|
+
onPressedChange: t24,
|
|
204
|
+
variant: "outline"
|
|
188
205
|
});
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
|
|
206
|
+
$[40] = t22;
|
|
207
|
+
$[41] = t23;
|
|
208
|
+
$[42] = t24;
|
|
209
|
+
$[43] = t25;
|
|
210
|
+
} else t25 = $[43];
|
|
193
211
|
let t26;
|
|
194
|
-
if ($[
|
|
195
|
-
t26 = /* @__PURE__ */ jsx(
|
|
196
|
-
$[
|
|
197
|
-
} else t26 = $[
|
|
212
|
+
if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
|
|
213
|
+
t26 = /* @__PURE__ */ jsx(Smartphone, {});
|
|
214
|
+
$[44] = t26;
|
|
215
|
+
} else t26 = $[44];
|
|
198
216
|
let t27;
|
|
199
|
-
if ($[
|
|
200
|
-
t27 = /* @__PURE__ */
|
|
217
|
+
if ($[45] !== t25) {
|
|
218
|
+
t27 = /* @__PURE__ */ jsx(Tooltip$1.TooltipTrigger, {
|
|
201
219
|
render: t25,
|
|
202
|
-
children:
|
|
220
|
+
children: t26
|
|
203
221
|
});
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
} else t27 = $[
|
|
222
|
+
$[45] = t25;
|
|
223
|
+
$[46] = t27;
|
|
224
|
+
} else t27 = $[46];
|
|
207
225
|
let t28;
|
|
208
|
-
if ($[
|
|
209
|
-
t28 =
|
|
210
|
-
$[
|
|
211
|
-
|
|
212
|
-
} else t28 = $[50];
|
|
226
|
+
if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
|
|
227
|
+
t28 = /* @__PURE__ */ jsx(Tooltip$1.TooltipContent, { children: "Mobile view" });
|
|
228
|
+
$[47] = t28;
|
|
229
|
+
} else t28 = $[47];
|
|
213
230
|
let t29;
|
|
214
|
-
if ($[
|
|
215
|
-
t29 = /* @__PURE__ */ jsxs(Tooltip$1.
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
} else t29 = $[
|
|
231
|
+
if ($[48] !== t27) {
|
|
232
|
+
t29 = /* @__PURE__ */ jsxs(Tooltip$1.Tooltip, { children: [t27, t28] });
|
|
233
|
+
$[48] = t27;
|
|
234
|
+
$[49] = t29;
|
|
235
|
+
} else t29 = $[49];
|
|
219
236
|
let t30;
|
|
220
|
-
if ($[
|
|
221
|
-
t30 = /* @__PURE__ */ jsxs(
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
} else t30 = $[55];
|
|
226
|
-
let t31;
|
|
227
|
-
if ($[56] !== t16 || $[57] !== t23 || $[58] !== t30 || $[59] !== t9) {
|
|
228
|
-
t31 = /* @__PURE__ */ jsxs(ButtonGroup, { children: [
|
|
229
|
-
t9,
|
|
230
|
-
t16,
|
|
231
|
-
t23,
|
|
232
|
-
t30
|
|
237
|
+
if ($[50] !== t13 || $[51] !== t21 || $[52] !== t29) {
|
|
238
|
+
t30 = /* @__PURE__ */ jsxs(ButtonGroup, { children: [
|
|
239
|
+
t13,
|
|
240
|
+
t21,
|
|
241
|
+
t29
|
|
233
242
|
] });
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
$[50] = t13;
|
|
244
|
+
$[51] = t21;
|
|
245
|
+
$[52] = t29;
|
|
246
|
+
$[53] = t30;
|
|
247
|
+
} else t30 = $[53];
|
|
248
|
+
let t31;
|
|
249
|
+
if ($[54] !== isEditMode) {
|
|
250
|
+
t31 = /* @__PURE__ */ jsx(Button, {
|
|
251
|
+
type: "button",
|
|
252
|
+
variant: "ghost",
|
|
253
|
+
size: "icon",
|
|
254
|
+
disabled: isEditMode,
|
|
255
|
+
onClick: _temp5,
|
|
256
|
+
"aria-label": "Hide toolbar",
|
|
257
|
+
className: "text-muted-foreground"
|
|
245
258
|
});
|
|
246
|
-
$[
|
|
247
|
-
|
|
259
|
+
$[54] = isEditMode;
|
|
260
|
+
$[55] = t31;
|
|
261
|
+
} else t31 = $[55];
|
|
262
|
+
let t32;
|
|
263
|
+
if ($[56] === Symbol.for("react.memo_cache_sentinel")) {
|
|
264
|
+
t32 = /* @__PURE__ */ jsx(X, {});
|
|
265
|
+
$[56] = t32;
|
|
266
|
+
} else t32 = $[56];
|
|
248
267
|
let t33;
|
|
249
|
-
if ($[
|
|
250
|
-
t33 =
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
} else t33 = $[63];
|
|
254
|
-
let t34;
|
|
255
|
-
if ($[64] !== t33) {
|
|
256
|
-
t34 = /* @__PURE__ */ jsxs(Button, {
|
|
257
|
-
variant: "outline",
|
|
258
|
-
className: "bg-transparent dark:bg-transparent",
|
|
259
|
-
onClick: _temp12,
|
|
260
|
-
children: [t32, t33]
|
|
268
|
+
if ($[57] !== t31) {
|
|
269
|
+
t33 = /* @__PURE__ */ jsx(Tooltip$1.TooltipTrigger, {
|
|
270
|
+
render: t31,
|
|
271
|
+
children: t32
|
|
261
272
|
});
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
264
|
-
} else
|
|
273
|
+
$[57] = t31;
|
|
274
|
+
$[58] = t33;
|
|
275
|
+
} else t33 = $[58];
|
|
276
|
+
let t34;
|
|
277
|
+
if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
|
|
278
|
+
t34 = /* @__PURE__ */ jsx(Tooltip$1.TooltipContent, { children: "Hide toolbar" });
|
|
279
|
+
$[59] = t34;
|
|
280
|
+
} else t34 = $[59];
|
|
265
281
|
let t35;
|
|
266
|
-
if ($[
|
|
267
|
-
t35 = /* @__PURE__ */ jsxs(
|
|
268
|
-
|
|
269
|
-
|
|
282
|
+
if ($[60] !== t33) {
|
|
283
|
+
t35 = /* @__PURE__ */ jsxs(Tooltip$1.Tooltip, { children: [t33, t34] });
|
|
284
|
+
$[60] = t33;
|
|
285
|
+
$[61] = t35;
|
|
286
|
+
} else t35 = $[61];
|
|
287
|
+
let t36;
|
|
288
|
+
if ($[62] !== t30 || $[63] !== t35) {
|
|
289
|
+
t36 = /* @__PURE__ */ jsxs("div", {
|
|
290
|
+
className: "flex items-center gap-2",
|
|
291
|
+
children: [t30, t35]
|
|
292
|
+
});
|
|
293
|
+
$[62] = t30;
|
|
294
|
+
$[63] = t35;
|
|
295
|
+
$[64] = t36;
|
|
296
|
+
} else t36 = $[64];
|
|
297
|
+
let t37;
|
|
298
|
+
if ($[65] !== t36 || $[66] !== t5) {
|
|
299
|
+
t37 = /* @__PURE__ */ jsxs(FloatingToolbar, {
|
|
300
|
+
className: "bottom-2 justify-between gap-8",
|
|
301
|
+
children: [t5, t36]
|
|
270
302
|
});
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
return t35;
|
|
303
|
+
$[65] = t36;
|
|
304
|
+
$[66] = t5;
|
|
305
|
+
$[67] = t37;
|
|
306
|
+
} else t37 = $[67];
|
|
307
|
+
return t37;
|
|
277
308
|
};
|
|
278
309
|
function _temp(state) {
|
|
279
|
-
return state.context.
|
|
310
|
+
return state.context.isEditMode;
|
|
280
311
|
}
|
|
281
312
|
function _temp2(state_0) {
|
|
282
|
-
return state_0.context.
|
|
313
|
+
return state_0.context.isToolbarHidden;
|
|
283
314
|
}
|
|
284
315
|
function _temp3(state_1) {
|
|
285
|
-
return state_1.context.
|
|
316
|
+
return state_1.context.actions;
|
|
286
317
|
}
|
|
287
318
|
function _temp4(state_2) {
|
|
288
|
-
return state_2.context.
|
|
289
|
-
}
|
|
290
|
-
function _temp5(state_3) {
|
|
291
|
-
return state_3.context.isPageContentSheetOpen;
|
|
292
|
-
}
|
|
293
|
-
function _temp6(state_4) {
|
|
294
|
-
return state_4.context.isAddBlockSheetOpen;
|
|
295
|
-
}
|
|
296
|
-
function _temp7(state_5) {
|
|
297
|
-
return state_5.context.isAgentChatSheetOpen;
|
|
298
|
-
}
|
|
299
|
-
function _temp8(state_6) {
|
|
300
|
-
return state_6.context.actions;
|
|
301
|
-
}
|
|
302
|
-
function _temp9(state_7) {
|
|
303
|
-
return state_7.context.isMobileMode;
|
|
304
|
-
}
|
|
305
|
-
function _temp0() {
|
|
306
|
-
return previewStore.send({ type: "toggleSidebar" });
|
|
307
|
-
}
|
|
308
|
-
function _temp1() {
|
|
309
|
-
return previewStore.send({ type: "toggleLockContent" });
|
|
310
|
-
}
|
|
311
|
-
function _temp10() {
|
|
312
|
-
return previewStore.send({ type: "toggleMobileMode" });
|
|
313
|
-
}
|
|
314
|
-
function _temp11() {
|
|
315
|
-
return previewStore.send({ type: "enterPresentationMode" });
|
|
319
|
+
return state_2.context.viewportMode;
|
|
316
320
|
}
|
|
317
|
-
function
|
|
318
|
-
return previewStore.send({ type: "
|
|
321
|
+
function _temp5() {
|
|
322
|
+
return previewStore.send({ type: "hideToolbar" });
|
|
319
323
|
}
|
|
320
324
|
|
|
321
325
|
//#endregion
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { trackClientEvent } from "../../../lib/telemetry-client.js";
|
|
2
1
|
import { pageMutations } from "../../../lib/queries.js";
|
|
2
|
+
import { trackClientEvent } from "../../../lib/telemetry-client.js";
|
|
3
3
|
import { Label } from "@camox/ui/label";
|
|
4
|
-
import { toast } from "@camox/ui/toaster";
|
|
5
4
|
import { useMutation } from "@tanstack/react-query";
|
|
6
5
|
import * as React from "react";
|
|
7
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { toast } from "@camox/ui/toaster";
|
|
8
8
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@camox/ui/alert-dialog";
|
|
9
9
|
import { Switch } from "@camox/ui/switch";
|
|
10
10
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { previewStore, selectionItemId } from "../previewStore.js";
|
|
2
1
|
import { repeatableItemMutations } from "../../../lib/queries.js";
|
|
3
2
|
import { cn } from "../../../lib/utils.js";
|
|
3
|
+
import { previewStore, selectionItemId } from "../previewStore.js";
|
|
4
4
|
import { useRepeatableItemActions } from "./useRepeatableItemActions.js";
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
6
6
|
import { useMutation } from "@tanstack/react-query";
|
|
7
7
|
import { useSelector } from "@xstate/store-react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { Button } from "@camox/ui/button";
|
|
10
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from "@camox/ui/tooltip";
|
|
11
10
|
import { CircleMinus, CirclePlus, GripVertical } from "lucide-react";
|
|
11
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@camox/ui/tooltip";
|
|
12
12
|
import { DndContext, KeyboardSensor, PointerSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
|
|
13
13
|
import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
|
|
14
14
|
import { SortableContext, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|