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.
Files changed (58) hide show
  1. package/dist/core/createBlock.d.ts +1 -1
  2. package/dist/core/createBlock.js +88 -108
  3. package/dist/core/hooks/useIsEditable.js +6 -10
  4. package/dist/core/lib/fieldTypes.js +10 -219
  5. package/dist/features/agent-chat/components/AgentChatSidebar.js +172 -0
  6. package/dist/features/agent-chat/components/AgentChatThread.js +9 -9
  7. package/dist/features/preview/CamoxPreview.js +137 -729
  8. package/dist/features/preview/components/{AddBlockSheet.js → AddBlockSidebar.js} +121 -131
  9. package/dist/features/preview/components/AssetFieldEditor.js +107 -82
  10. package/dist/features/preview/components/AssetLightbox.js +4 -4
  11. package/dist/features/preview/components/AssetPickerModal.js +277 -0
  12. package/dist/features/preview/components/BlockActionsPopover.js +18 -24
  13. package/dist/features/preview/components/CreatePageModal.js +6 -6
  14. package/dist/features/preview/components/FieldToolbar.js +64 -127
  15. package/dist/features/preview/components/ItemFieldsEditor.js +98 -125
  16. package/dist/features/preview/components/LeftSidebar.js +64 -0
  17. package/dist/features/preview/components/LinkFieldEditor.js +1 -1
  18. package/dist/features/preview/components/MultipleAssetFieldEditor.js +94 -56
  19. package/dist/features/preview/components/OverlayTracker.js +15 -15
  20. package/dist/features/preview/components/Overlays.js +12 -12
  21. package/dist/features/preview/components/PageEditorSidebar.js +563 -0
  22. package/dist/features/preview/components/PageInfoSidebar.js +1453 -0
  23. package/dist/features/preview/components/PageNavigatorSidebar.js +590 -0
  24. package/dist/features/preview/components/PagePicker.js +3 -3
  25. package/dist/features/preview/components/PageStatusBadge.js +1 -1
  26. package/dist/features/preview/components/PageTree.js +204 -564
  27. package/dist/features/preview/components/PreviewPanel.js +123 -158
  28. package/dist/features/preview/components/PreviewToolbar.js +260 -256
  29. package/dist/features/preview/components/PublishDialog.js +2 -2
  30. package/dist/features/preview/components/RepeatableItemsList.js +2 -2
  31. package/dist/features/preview/components/RightSidebar.js +109 -0
  32. package/dist/features/preview/components/UnlinkAssetButton.js +2 -2
  33. package/dist/features/preview/components/useRepeatableItemActions.js +3 -138
  34. package/dist/features/preview/components/useUpdateBlockPosition.js +1 -1
  35. package/dist/features/preview/previewQueryFns.js +23 -0
  36. package/dist/features/preview/previewStore.js +46 -63
  37. package/dist/features/provider/CamoxProvider.js +255 -70
  38. package/dist/features/provider/useAdminShortcuts.js +5 -48
  39. package/dist/features/routes/pageRoute.js +1 -1
  40. package/dist/features/studio/CamoxStudio.js +6 -5
  41. package/dist/features/studio/components/EnvironmentMenu.js +2 -2
  42. package/dist/features/studio/components/Navbar.js +53 -71
  43. package/dist/features/studio/components/ProjectMenu.js +1 -1
  44. package/dist/features/studio/components/UserButton.js +1 -1
  45. package/dist/features/studio/routes.js +7 -0
  46. package/dist/features/studio/useTheme.js +67 -33
  47. package/dist/features/vite/routeGeneration.js +68 -66
  48. package/dist/hooks/use-file-upload.js +1 -1
  49. package/dist/lib/auth.js +23 -22
  50. package/dist/lib/utils.js +1 -1
  51. package/dist/studio-overlays.css +1 -1
  52. package/dist/studio.css +1 -1
  53. package/package.json +4 -4
  54. package/dist/features/agent-chat/components/AgentChatSheet.js +0 -207
  55. package/dist/features/preview/components/AssetPickerGrid.js +0 -236
  56. package/dist/features/preview/components/PageContentSheet.js +0 -608
  57. package/dist/features/preview/components/PageMetadataModal.js +0 -908
  58. 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 { cn, getActionShortcut } from "../../../lib/utils.js";
2
+ import { getActionShortcut } from "../../../lib/utils.js";
3
+ import { previewStore } from "../previewStore.js";
4
4
  import { c } from "react/compiler-runtime";
5
- import { Kbd } from "@camox/ui/kbd";
5
+ import { Label } from "@camox/ui/label";
6
6
  import { useSelector } from "@xstate/store-react";
7
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
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(70);
18
- if ($[0] !== "9eb26d2e74b59f556130f84b8d22fd9907b3e87a936f560c3c15b54462b76f83") {
19
- for (let $i = 0; $i < 70; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
20
- $[0] = "9eb26d2e74b59f556130f84b8d22fd9907b3e87a936f560c3c15b54462b76f83";
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 isEditingLocked = useSelector(previewStore, _temp);
23
- const isEditingPanelOpen = useSelector(previewStore, _temp2);
24
- const isPresentationMode = useSelector(previewStore, _temp3);
25
- const isPreviewingNonDraft = useSelector(previewStore, _temp4) !== "draft";
26
- const isPageContentSheetOpen = useSelector(previewStore, _temp5);
27
- const isAddBlockSheetOpen = useSelector(previewStore, _temp6);
28
- const isAgentChatSheetOpen = useSelector(previewStore, _temp7);
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] !== t0) {
35
- t1 = cn("bottom-2 gap-4 justify-between", t0);
36
- $[1] = t0;
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
- const t2 = isEditingPanelOpen ? "off" : "on";
40
- const t3 = !isEditingPanelOpen;
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 ($[3] !== t2 || $[4] !== t3) {
43
- t4 = /* @__PURE__ */ jsx(Toggle, {
44
- "data-state": t2,
45
- pressed: t3,
46
- variant: "outline",
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
- $[3] = t2;
50
- $[4] = t3;
51
- $[5] = t4;
52
- } else t4 = $[5];
67
+ $[9] = t3;
68
+ $[10] = t4;
69
+ } else t4 = $[10];
53
70
  let t5;
54
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
55
- t5 = /* @__PURE__ */ jsx(PanelRight, {});
56
- $[6] = t5;
57
- } else t5 = $[6];
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
- $[7] = t4;
65
- $[8] = t6;
66
- } else t6 = $[8];
67
- let t7;
68
- if ($[9] !== actions) {
69
- t7 = getActionShortcut(actions, "toggle-editing-panel");
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 ($[11] !== t7) {
75
- t8 = /* @__PURE__ */ jsxs(Tooltip$1.TooltipContent, { children: ["Toggle sidebar ", t7] });
76
- $[11] = t7;
77
- $[12] = t8;
78
- } else t8 = $[12];
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 ($[13] !== t6 || $[14] !== t8) {
81
- t9 = /* @__PURE__ */ jsxs(Tooltip$1.Tooltip, { children: [t6, t8] });
82
- $[13] = t6;
83
- $[14] = t8;
84
- $[15] = t9;
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] = isEditingLocked;
97
- $[17] = isPreviewingNonDraft;
98
- $[18] = t10;
99
- $[19] = t11;
100
- } else t11 = $[19];
101
- let t12;
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
- t12 = /* @__PURE__ */ jsx(Lock, {});
104
- $[20] = t12;
105
- } else t12 = $[20];
106
- let t13;
107
- if ($[21] !== t11) {
108
- t13 = /* @__PURE__ */ jsx(Tooltip$1.TooltipTrigger, {
109
- render: t11,
110
- children: t12
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] = t11;
113
- $[22] = t13;
114
- } else t13 = $[22];
115
- let t14;
116
- if ($[23] !== isPreviewingNonDraft) {
117
- t14 = isPreviewingNonDraft ? "Switch to draft to edit" : /* @__PURE__ */ jsxs(Fragment, { children: ["Toggle edit mode ", /* @__PURE__ */ jsx(Kbd, { children: "L" })] });
118
- $[23] = isPreviewingNonDraft;
119
- $[24] = t14;
120
- } else t14 = $[24];
121
- let t15;
122
- if ($[25] !== t14) {
123
- t15 = /* @__PURE__ */ jsx(Tooltip$1.TooltipContent, { children: t14 });
124
- $[25] = t14;
125
- $[26] = t15;
126
- } else t15 = $[26];
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 ($[27] !== t13 || $[28] !== t15) {
129
- t16 = /* @__PURE__ */ jsxs(Tooltip$1.Tooltip, { children: [t13, t15] });
130
- $[27] = t13;
131
- $[28] = t15;
132
- $[29] = t16;
133
- } else t16 = $[29];
134
- const t17 = isMobileMode ? "on" : "off";
135
- let t18;
136
- if ($[30] !== isMobileMode || $[31] !== t17) {
137
- t18 = /* @__PURE__ */ jsx(Toggle, {
138
- "data-state": t17,
139
- pressed: isMobileMode,
140
- onPressedChange: _temp10,
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
- $[30] = isMobileMode;
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] === Symbol.for("react.memo_cache_sentinel")) {
149
- t19 = /* @__PURE__ */ jsx(TabletSmartphone, {});
150
- $[33] = t19;
151
- } else t19 = $[33];
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
- $[34] = t18;
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] !== actions) {
163
- t21 = getActionShortcut(actions, "toggle-mobile-mode");
164
- $[36] = actions;
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
- let t22;
168
- if ($[38] !== t21) {
169
- t22 = /* @__PURE__ */ jsxs(Tooltip$1.TooltipContent, { children: ["Toggle mobile layout ", t21] });
170
- $[38] = t21;
171
- $[39] = t22;
172
- } else t22 = $[39];
173
- let t23;
174
- if ($[40] !== t20 || $[41] !== t22) {
175
- t23 = /* @__PURE__ */ jsxs(Tooltip$1.Tooltip, { children: [t20, t22] });
176
- $[40] = t20;
177
- $[41] = t22;
178
- $[42] = t23;
179
- } else t23 = $[42];
180
- const t24 = isPresentationMode ? "on" : "off";
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 ($[43] !== isPresentationMode || $[44] !== t24) {
199
+ if ($[40] !== t22 || $[41] !== t23 || $[42] !== t24) {
183
200
  t25 = /* @__PURE__ */ jsx(Toggle, {
184
- "data-state": t24,
185
- pressed: isPresentationMode,
186
- variant: "outline",
187
- onClick: _temp11
201
+ "data-state": t22,
202
+ pressed: t23,
203
+ onPressedChange: t24,
204
+ variant: "outline"
188
205
  });
189
- $[43] = isPresentationMode;
190
- $[44] = t24;
191
- $[45] = t25;
192
- } else t25 = $[45];
206
+ $[40] = t22;
207
+ $[41] = t23;
208
+ $[42] = t24;
209
+ $[43] = t25;
210
+ } else t25 = $[43];
193
211
  let t26;
194
- if ($[46] === Symbol.for("react.memo_cache_sentinel")) {
195
- t26 = /* @__PURE__ */ jsx(MonitorPlay, {});
196
- $[46] = t26;
197
- } else t26 = $[46];
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 ($[47] !== t25) {
200
- t27 = /* @__PURE__ */ jsxs(Tooltip$1.TooltipTrigger, {
217
+ if ($[45] !== t25) {
218
+ t27 = /* @__PURE__ */ jsx(Tooltip$1.TooltipTrigger, {
201
219
  render: t25,
202
- children: [t26, "Preview"]
220
+ children: t26
203
221
  });
204
- $[47] = t25;
205
- $[48] = t27;
206
- } else t27 = $[48];
222
+ $[45] = t25;
223
+ $[46] = t27;
224
+ } else t27 = $[46];
207
225
  let t28;
208
- if ($[49] !== actions) {
209
- t28 = getActionShortcut(actions, "enter-presentation-mode");
210
- $[49] = actions;
211
- $[50] = t28;
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 ($[51] !== t28) {
215
- t29 = /* @__PURE__ */ jsxs(Tooltip$1.TooltipContent, { children: ["Hide Camox Studio ", t28] });
216
- $[51] = t28;
217
- $[52] = t29;
218
- } else t29 = $[52];
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 ($[53] !== t27 || $[54] !== t29) {
221
- t30 = /* @__PURE__ */ jsxs(Tooltip$1.Tooltip, { children: [t27, t29] });
222
- $[53] = t27;
223
- $[54] = t29;
224
- $[55] = t30;
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
- $[56] = t16;
235
- $[57] = t23;
236
- $[58] = t30;
237
- $[59] = t9;
238
- $[60] = t31;
239
- } else t31 = $[60];
240
- let t32;
241
- if ($[61] === Symbol.for("react.memo_cache_sentinel")) {
242
- t32 = /* @__PURE__ */ jsx("span", {
243
- className: "text-muted-foreground",
244
- children: "Ask for changes..."
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
- $[61] = t32;
247
- } else t32 = $[61];
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 ($[62] !== actions) {
250
- t33 = getActionShortcut(actions, "toggle-agent-chat");
251
- $[62] = actions;
252
- $[63] = t33;
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
- $[64] = t33;
263
- $[65] = t34;
264
- } else t34 = $[65];
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 ($[66] !== t1 || $[67] !== t31 || $[68] !== t34) {
267
- t35 = /* @__PURE__ */ jsxs(FloatingToolbar, {
268
- className: t1,
269
- children: [t31, t34]
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
- $[66] = t1;
272
- $[67] = t31;
273
- $[68] = t34;
274
- $[69] = t35;
275
- } else t35 = $[69];
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.isContentLocked;
310
+ return state.context.isEditMode;
280
311
  }
281
312
  function _temp2(state_0) {
282
- return state_0.context.isSidebarOpen;
313
+ return state_0.context.isToolbarHidden;
283
314
  }
284
315
  function _temp3(state_1) {
285
- return state_1.context.isPresentationMode;
316
+ return state_1.context.actions;
286
317
  }
287
318
  function _temp4(state_2) {
288
- return state_2.context.previewSource;
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 _temp12() {
318
- return previewStore.send({ type: "openAgentChatSheet" });
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";