camox 0.38.0 → 0.40.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.
@@ -1,7 +1,6 @@
1
1
  import { useLocation } from "../../navigation/navigation.js";
2
2
  import { actionsStore } from "../../provider/actionsStore.js";
3
3
  import { pageMutations } from "../../../lib/queries.js";
4
- import { cn } from "../../../lib/utils.js";
5
4
  import { trackClientEvent } from "../../../lib/telemetry-client.js";
6
5
  import { previewStore } from "../previewStore.js";
7
6
  import { PagePicker } from "./PagePicker.js";
@@ -24,9 +23,9 @@ import { ButtonGroup } from "@camox/ui/button-group";
24
23
  //#region src/features/preview/components/PageNavigatorSidebar.tsx
25
24
  const PageNavigatorPublishRow = (t0) => {
26
25
  const $ = c(86);
27
- if ($[0] !== "58005eef0d61f3afd8b013b7c48c297a3232450e2bc7cede8029a7249f17fd1c") {
26
+ if ($[0] !== "2915f869d656485105344add68411e21930be9804f68664ad81148c2ec2fd863") {
28
27
  for (let $i = 0; $i < 86; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
29
- $[0] = "58005eef0d61f3afd8b013b7c48c297a3232450e2bc7cede8029a7249f17fd1c";
28
+ $[0] = "2915f869d656485105344add68411e21930be9804f68664ad81148c2ec2fd863";
30
29
  }
31
30
  const { page } = t0;
32
31
  const previewSource = useSelector(previewStore, _temp);
@@ -451,50 +450,60 @@ const PageNavigatorPublishRow = (t0) => {
451
450
  } else t39 = $[85];
452
451
  return t39;
453
452
  };
454
- const PageNavigatorSidebar = (t0) => {
455
- const $ = c(8);
456
- if ($[0] !== "58005eef0d61f3afd8b013b7c48c297a3232450e2bc7cede8029a7249f17fd1c") {
457
- for (let $i = 0; $i < 8; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
458
- $[0] = "58005eef0d61f3afd8b013b7c48c297a3232450e2bc7cede8029a7249f17fd1c";
453
+ const PageNavigatorHeader = (t0) => {
454
+ const $ = c(4);
455
+ if ($[0] !== "2915f869d656485105344add68411e21930be9804f68664ad81148c2ec2fd863") {
456
+ for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
457
+ $[0] = "2915f869d656485105344add68411e21930be9804f68664ad81148c2ec2fd863";
459
458
  }
460
459
  const { page } = t0;
461
460
  let t1;
462
461
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
463
- t1 = cn("flex flex-col gap-2 px-2 pt-2 pb-3");
464
- $[1] = t1;
465
- } else t1 = $[1];
466
- let t2;
467
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
468
- t2 = /* @__PURE__ */ jsx("div", {
462
+ t1 = /* @__PURE__ */ jsx("div", {
469
463
  className: "flex w-full",
470
464
  children: /* @__PURE__ */ jsx(PagePicker, {})
471
465
  });
472
- $[2] = t2;
473
- } else t2 = $[2];
474
- let t3;
475
- if ($[3] !== page) {
476
- t3 = /* @__PURE__ */ jsxs(PanelHeader, {
477
- className: t1,
478
- children: [t2, /* @__PURE__ */ jsx(PageNavigatorPublishRow, { page })]
466
+ $[1] = t1;
467
+ } else t1 = $[1];
468
+ let t2;
469
+ if ($[2] !== page) {
470
+ t2 = /* @__PURE__ */ jsxs(PanelHeader, {
471
+ className: "flex flex-col gap-2 px-2 pt-2 pb-3",
472
+ children: [t1, /* @__PURE__ */ jsx(PageNavigatorPublishRow, { page })]
479
473
  });
480
- $[3] = page;
481
- $[4] = t3;
482
- } else t3 = $[4];
483
- let t4;
484
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
485
- t4 = /* @__PURE__ */ jsx(PanelContent, {
474
+ $[2] = page;
475
+ $[3] = t2;
476
+ } else t2 = $[3];
477
+ return t2;
478
+ };
479
+ const PageNavigatorSidebar = (t0) => {
480
+ const $ = c(6);
481
+ if ($[0] !== "2915f869d656485105344add68411e21930be9804f68664ad81148c2ec2fd863") {
482
+ for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
483
+ $[0] = "2915f869d656485105344add68411e21930be9804f68664ad81148c2ec2fd863";
484
+ }
485
+ const { page } = t0;
486
+ let t1;
487
+ if ($[1] !== page) {
488
+ t1 = /* @__PURE__ */ jsx(PageNavigatorHeader, { page });
489
+ $[1] = page;
490
+ $[2] = t1;
491
+ } else t1 = $[2];
492
+ let t2;
493
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
494
+ t2 = /* @__PURE__ */ jsx(PanelContent, {
486
495
  className: "flex grow basis-0 flex-col gap-2 overflow-auto p-2",
487
496
  children: /* @__PURE__ */ jsx(PageTree, {})
488
497
  });
489
- $[5] = t4;
490
- } else t4 = $[5];
491
- let t5;
492
- if ($[6] !== t3) {
493
- t5 = /* @__PURE__ */ jsxs(Fragment, { children: [t3, t4] });
494
- $[6] = t3;
495
- $[7] = t5;
496
- } else t5 = $[7];
497
- return t5;
498
+ $[3] = t2;
499
+ } else t2 = $[3];
500
+ let t3;
501
+ if ($[4] !== t1) {
502
+ t3 = /* @__PURE__ */ jsxs(Fragment, { children: [t1, t2] });
503
+ $[4] = t1;
504
+ $[5] = t3;
505
+ } else t3 = $[5];
506
+ return t3;
498
507
  };
499
508
  function _temp(state) {
500
509
  return state.context.previewSource;
@@ -515,4 +524,4 @@ function _temp3(current) {
515
524
  }
516
525
 
517
526
  //#endregion
518
- export { PageNavigatorSidebar };
527
+ export { PageNavigatorHeader, PageNavigatorSidebar };
@@ -5,6 +5,7 @@ import { useBlockActionsShortcuts } from "./BlockActionsPopover.js";
5
5
  import { FieldOverlayStyles } from "./FieldOverlayStyles.js";
6
6
  import { FieldToolbar } from "./FieldToolbar.js";
7
7
  import { Frame, useFrame } from "./Frame.js";
8
+ import { MobilePreviewDrawer } from "./MobilePreviewDrawer.js";
8
9
  import { Overlays } from "./Overlays.js";
9
10
  import { OverlayTracker } from "./OverlayTracker.js";
10
11
  import { PreviewToolbar } from "./PreviewToolbar.js";
@@ -17,9 +18,9 @@ import { PanelContent } from "@camox/ui/panel";
17
18
  //#region src/features/preview/components/PreviewPanel.tsx
18
19
  const PreviewFrame = (t0) => {
19
20
  const $ = c(9);
20
- if ($[0] !== "730f56a45d2b6c768058a961ac2ddb25f186cbd0a88cb4389cd59d3a0fda899d") {
21
+ if ($[0] !== "e11c3b34ca0f5fb034c9be15c118c7ca06abc87dbf81a94c0e4b32239a67ad26") {
21
22
  for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
22
- $[0] = "730f56a45d2b6c768058a961ac2ddb25f186cbd0a88cb4389cd59d3a0fda899d";
23
+ $[0] = "e11c3b34ca0f5fb034c9be15c118c7ca06abc87dbf81a94c0e4b32239a67ad26";
23
24
  }
24
25
  const { children, style, className, onIframeReady } = t0;
25
26
  let t1;
@@ -60,9 +61,9 @@ const PreviewFrame = (t0) => {
60
61
  };
61
62
  const KeyDownForwarder = () => {
62
63
  const $ = c(5);
63
- if ($[0] !== "730f56a45d2b6c768058a961ac2ddb25f186cbd0a88cb4389cd59d3a0fda899d") {
64
+ if ($[0] !== "e11c3b34ca0f5fb034c9be15c118c7ca06abc87dbf81a94c0e4b32239a67ad26") {
64
65
  for (let $i = 0; $i < 5; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
65
- $[0] = "730f56a45d2b6c768058a961ac2ddb25f186cbd0a88cb4389cd59d3a0fda899d";
66
+ $[0] = "e11c3b34ca0f5fb034c9be15c118c7ca06abc87dbf81a94c0e4b32239a67ad26";
66
67
  }
67
68
  const { window: iframeWindow } = useFrame();
68
69
  const actions = useSelector(actionsStore, _temp);
@@ -112,26 +113,67 @@ const viewportClassName = {
112
113
  mobile: "h-175 w-[393px] max-h-full max-w-full"
113
114
  };
114
115
  const PreviewPanel = (t0) => {
115
- const $ = c(8);
116
- if ($[0] !== "730f56a45d2b6c768058a961ac2ddb25f186cbd0a88cb4389cd59d3a0fda899d") {
117
- for (let $i = 0; $i < 8; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
118
- $[0] = "730f56a45d2b6c768058a961ac2ddb25f186cbd0a88cb4389cd59d3a0fda899d";
116
+ const $ = c(17);
117
+ if ($[0] !== "e11c3b34ca0f5fb034c9be15c118c7ca06abc87dbf81a94c0e4b32239a67ad26") {
118
+ for (let $i = 0; $i < 17; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
119
+ $[0] = "e11c3b34ca0f5fb034c9be15c118c7ca06abc87dbf81a94c0e4b32239a67ad26";
119
120
  }
120
- const { children, toolbarProps } = t0;
121
+ const { children, isMobileExperience: t1, page, projectName: t2, toolbarProps } = t0;
122
+ const isMobileExperience = t1 === void 0 ? false : t1;
123
+ const projectName = t2 === void 0 ? "Project" : t2;
121
124
  useBlockActionsShortcuts();
122
125
  const iframeElement = useSelector(previewStore, _temp2);
123
126
  const handleIframeReady = _temp3;
124
127
  const viewportMode = useSelector(previewStore, _temp4);
125
128
  const isEditMode = useSelector(previewStore, _temp5);
126
- let t1;
129
+ const isToolbarHidden = useSelector(previewStore, _temp6);
130
+ let t3;
127
131
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
128
- t1 = [];
129
- $[1] = t1;
130
- } else t1 = $[1];
131
- React.useEffect(_temp17, t1);
132
- let t2;
133
- if ($[2] !== children || $[3] !== iframeElement || $[4] !== isEditMode || $[5] !== toolbarProps || $[6] !== viewportMode) {
134
- t2 = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(PanelContent, {
132
+ t3 = [];
133
+ $[1] = t3;
134
+ } else t3 = $[1];
135
+ React.useEffect(_temp16, t3);
136
+ if (isMobileExperience) {
137
+ if (!page) return null;
138
+ let t4;
139
+ if ($[2] !== children) {
140
+ t4 = /* @__PURE__ */ jsx("div", {
141
+ className: "relative min-h-0 flex-1",
142
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
143
+ className: "h-full w-full",
144
+ onIframeReady: handleIframeReady,
145
+ children
146
+ })
147
+ });
148
+ $[2] = children;
149
+ $[3] = t4;
150
+ } else t4 = $[3];
151
+ let t5;
152
+ if ($[4] !== isToolbarHidden || $[5] !== page || $[6] !== projectName) {
153
+ t5 = !isToolbarHidden && /* @__PURE__ */ jsx(MobilePreviewDrawer, {
154
+ page,
155
+ projectName
156
+ });
157
+ $[4] = isToolbarHidden;
158
+ $[5] = page;
159
+ $[6] = projectName;
160
+ $[7] = t5;
161
+ } else t5 = $[7];
162
+ let t6;
163
+ if ($[8] !== t4 || $[9] !== t5) {
164
+ t6 = /* @__PURE__ */ jsxs(PanelContent, {
165
+ className: "flex min-h-0 flex-col overflow-hidden bg-black",
166
+ children: [t4, t5]
167
+ });
168
+ $[8] = t4;
169
+ $[9] = t5;
170
+ $[10] = t6;
171
+ } else t6 = $[10];
172
+ return t6;
173
+ }
174
+ let t4;
175
+ if ($[11] !== children || $[12] !== iframeElement || $[13] !== isEditMode || $[14] !== toolbarProps || $[15] !== viewportMode) {
176
+ t4 = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(PanelContent, {
135
177
  className: "relative overflow-hidden bg-black",
136
178
  children: /* @__PURE__ */ jsx("div", {
137
179
  className: "absolute inset-0",
@@ -161,14 +203,14 @@ const PreviewPanel = (t0) => {
161
203
  })
162
204
  })
163
205
  }) });
164
- $[2] = children;
165
- $[3] = iframeElement;
166
- $[4] = isEditMode;
167
- $[5] = toolbarProps;
168
- $[6] = viewportMode;
169
- $[7] = t2;
170
- } else t2 = $[7];
171
- return t2;
206
+ $[11] = children;
207
+ $[12] = iframeElement;
208
+ $[13] = isEditMode;
209
+ $[14] = toolbarProps;
210
+ $[15] = viewportMode;
211
+ $[16] = t4;
212
+ } else t4 = $[16];
213
+ return t4;
172
214
  };
173
215
  function _temp(state) {
174
216
  return state.context.actions;
@@ -188,56 +230,52 @@ function _temp4(state_0) {
188
230
  function _temp5(state_1) {
189
231
  return state_1.context.isEditMode;
190
232
  }
191
- function _temp6() {
192
- return true;
233
+ function _temp6(state_2) {
234
+ return state_2.context.isToolbarHidden;
193
235
  }
194
236
  function _temp7() {
195
- return previewStore.send({ type: "cycleViewportMode" });
237
+ return true;
196
238
  }
197
239
  function _temp8() {
198
- return true;
240
+ return previewStore.send({ type: "cycleViewportMode" });
199
241
  }
200
242
  function _temp9() {
243
+ return true;
244
+ }
245
+ function _temp0() {
201
246
  return previewStore.send({
202
247
  type: "setViewportMode",
203
248
  mode: "full"
204
249
  });
205
250
  }
206
- function _temp0() {
251
+ function _temp1() {
207
252
  return true;
208
253
  }
209
- function _temp1() {
254
+ function _temp10() {
210
255
  return previewStore.send({
211
256
  type: "setViewportMode",
212
257
  mode: "tablet"
213
258
  });
214
259
  }
215
- function _temp10() {
260
+ function _temp11() {
216
261
  return true;
217
262
  }
218
- function _temp11() {
263
+ function _temp12() {
219
264
  return previewStore.send({
220
265
  type: "setViewportMode",
221
266
  mode: "mobile"
222
267
  });
223
268
  }
224
- function _temp12() {
225
- return true;
226
- }
227
269
  function _temp13() {
228
- const { isAgentChatSidebarOpen } = previewStore.getSnapshot().context;
229
- previewStore.send({ type: isAgentChatSidebarOpen ? "closeAgentChatSidebar" : "openAgentChatSidebar" });
230
- }
231
- function _temp14() {
232
270
  return true;
233
271
  }
234
- function _temp15() {
272
+ function _temp14() {
235
273
  previewStore.send({ type: "clearSelection" });
236
274
  }
237
- function _temp16(a) {
275
+ function _temp15(a) {
238
276
  return a.id;
239
277
  }
240
- function _temp17() {
278
+ function _temp16() {
241
279
  const actions = [
242
280
  {
243
281
  id: "cycle-viewport-mode",
@@ -248,8 +286,8 @@ function _temp17() {
248
286
  "Device preview"
249
287
  ],
250
288
  groupLabel: "Preview",
251
- checkIfAvailable: _temp6,
252
- execute: _temp7,
289
+ checkIfAvailable: _temp7,
290
+ execute: _temp8,
253
291
  shortcut: { key: "m" }
254
292
  },
255
293
  {
@@ -261,16 +299,16 @@ function _temp17() {
261
299
  "Full width preview"
262
300
  ],
263
301
  groupLabel: "Preview",
264
- checkIfAvailable: _temp8,
265
- execute: _temp9
302
+ checkIfAvailable: _temp9,
303
+ execute: _temp0
266
304
  },
267
305
  {
268
306
  id: "set-viewport-tablet",
269
307
  label: "Set tablet viewport",
270
308
  aliases: ["Tablet preview", "Responsive preview"],
271
309
  groupLabel: "Preview",
272
- checkIfAvailable: _temp0,
273
- execute: _temp1
310
+ checkIfAvailable: _temp1,
311
+ execute: _temp10
274
312
  },
275
313
  {
276
314
  id: "set-viewport-mobile",
@@ -281,33 +319,16 @@ function _temp17() {
281
319
  "Responsive preview"
282
320
  ],
283
321
  groupLabel: "Preview",
284
- checkIfAvailable: _temp10,
285
- execute: _temp11
286
- },
287
- {
288
- id: "toggle-agent-chat",
289
- label: "Toggle agent chat",
290
- aliases: [
291
- "AI chat",
292
- "Assistant",
293
- "Ask AI",
294
- "Open chat"
295
- ],
296
- groupLabel: "Preview",
297
- checkIfAvailable: _temp12,
298
- execute: _temp13,
299
- shortcut: {
300
- key: "i",
301
- withAlt: true
302
- }
322
+ checkIfAvailable: _temp11,
323
+ execute: _temp12
303
324
  },
304
325
  {
305
326
  id: "clear-selection",
306
327
  label: "Clear selection",
307
328
  aliases: ["Deselect", "Unselect"],
308
329
  groupLabel: "Preview",
309
- checkIfAvailable: _temp14,
310
- execute: _temp15,
330
+ checkIfAvailable: _temp13,
331
+ execute: _temp14,
311
332
  shortcut: { key: "Escape" }
312
333
  }
313
334
  ];
@@ -318,7 +339,7 @@ function _temp17() {
318
339
  return () => {
319
340
  actionsStore.send({
320
341
  type: "unregisterManyActions",
321
- ids: actions.map(_temp16)
342
+ ids: actions.map(_temp15)
322
343
  });
323
344
  };
324
345
  }
@@ -1,5 +1,4 @@
1
1
  import { previewStore, selectionBlockId } from "../previewStore.js";
2
- import { AgentChatSidebar } from "../../agent-chat/components/AgentChatSidebar.js";
3
2
  import { PageEditorSidebar } from "./PageEditorSidebar.js";
4
3
  import { PageInfoSidebar } from "./PageInfoSidebar.js";
5
4
  import { c } from "react/compiler-runtime";
@@ -7,101 +6,64 @@ import { jsx, jsxs } from "react/jsx-runtime";
7
6
  import { useSelector } from "@xstate/store-react";
8
7
 
9
8
  //#region src/features/preview/components/RightSidebar.tsx
10
- const getRightSidebarRoute = ({ pageId, selectedBlockId, isAgentChatSidebarOpen }) => {
11
- if (isAgentChatSidebarOpen) return { type: "agent-chat" };
12
- if (selectedBlockId == null) return {
13
- type: "page-info",
14
- pageId
15
- };
16
- return { type: "page-editor" };
17
- };
18
9
  const RightSidebar = (t0) => {
19
- const $ = c(20);
20
- if ($[0] !== "e28d4f43142dcdc5527c359ae145ad38b0701935b08a0740871f5af399460a0b") {
21
- for (let $i = 0; $i < 20; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
22
- $[0] = "e28d4f43142dcdc5527c359ae145ad38b0701935b08a0740871f5af399460a0b";
10
+ const $ = c(12);
11
+ if ($[0] !== "b9589c1fea2c3efabdd9fae80871373106138216610ee3b8e2f4045e3b45670f") {
12
+ for (let $i = 0; $i < 12; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
13
+ $[0] = "b9589c1fea2c3efabdd9fae80871373106138216610ee3b8e2f4045e3b45670f";
23
14
  }
24
15
  const { pageId } = t0;
25
16
  const selection = useSelector(previewStore, _temp);
26
- const isAgentChatSidebarOpen = useSelector(previewStore, _temp2);
27
- const isAddBlockSidebarOpen = useSelector(previewStore, _temp3);
17
+ const isAddBlockSidebarOpen = useSelector(previewStore, _temp2);
28
18
  let t1;
29
- if ($[1] !== isAgentChatSidebarOpen || $[2] !== pageId || $[3] !== selection) {
30
- t1 = getRightSidebarRoute({
31
- pageId,
32
- selectedBlockId: selectionBlockId(selection),
33
- isAgentChatSidebarOpen
34
- });
35
- $[1] = isAgentChatSidebarOpen;
36
- $[2] = pageId;
37
- $[3] = selection;
38
- $[4] = t1;
39
- } else t1 = $[4];
40
- const route = t1;
19
+ if ($[1] !== selection) {
20
+ t1 = selectionBlockId(selection);
21
+ $[1] = selection;
22
+ $[2] = t1;
23
+ } else t1 = $[2];
24
+ const selectedBlockId = t1;
41
25
  let t2;
42
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
26
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
43
27
  t2 = { width: 250 };
44
- $[5] = t2;
45
- } else t2 = $[5];
28
+ $[3] = t2;
29
+ } else t2 = $[3];
46
30
  let t3;
47
- if ($[6] !== route.type) {
48
- t3 = route.type === "agent-chat" && /* @__PURE__ */ jsx(AgentChatSidebar, {});
49
- $[6] = route.type;
50
- $[7] = t3;
51
- } else t3 = $[7];
31
+ if ($[4] !== pageId || $[5] !== selectedBlockId) {
32
+ t3 = selectedBlockId == null ? /* @__PURE__ */ jsx(PageInfoSidebar, { pageId }) : /* @__PURE__ */ jsx(PageEditorSidebar, {});
33
+ $[4] = pageId;
34
+ $[5] = selectedBlockId;
35
+ $[6] = t3;
36
+ } else t3 = $[6];
52
37
  let t4;
53
- if ($[8] !== route.pageId || $[9] !== route.type) {
54
- t4 = route.type === "page-info" && /* @__PURE__ */ jsx(PageInfoSidebar, { pageId: route.pageId });
55
- $[8] = route.pageId;
56
- $[9] = route.type;
57
- $[10] = t4;
58
- } else t4 = $[10];
59
- let t5;
60
- if ($[11] !== route.type) {
61
- t5 = route.type === "page-editor" && /* @__PURE__ */ jsx(PageEditorSidebar, {});
62
- $[11] = route.type;
63
- $[12] = t5;
64
- } else t5 = $[12];
65
- let t6;
66
- if ($[13] !== isAddBlockSidebarOpen) {
67
- t6 = isAddBlockSidebarOpen && /* @__PURE__ */ jsx("div", {
38
+ if ($[7] !== isAddBlockSidebarOpen) {
39
+ t4 = isAddBlockSidebarOpen && /* @__PURE__ */ jsx("div", {
68
40
  className: "absolute inset-0 z-20",
69
41
  style: { background: "rgba(0, 0, 0, 0.66)" },
70
- onClick: _temp4
42
+ onClick: _temp3
71
43
  });
72
- $[13] = isAddBlockSidebarOpen;
73
- $[14] = t6;
74
- } else t6 = $[14];
75
- let t7;
76
- if ($[15] !== t3 || $[16] !== t4 || $[17] !== t5 || $[18] !== t6) {
77
- t7 = /* @__PURE__ */ jsxs("aside", {
44
+ $[7] = isAddBlockSidebarOpen;
45
+ $[8] = t4;
46
+ } else t4 = $[8];
47
+ let t5;
48
+ if ($[9] !== t3 || $[10] !== t4) {
49
+ t5 = /* @__PURE__ */ jsxs("aside", {
78
50
  className: "bg-background relative flex shrink-0 flex-col border-l-2",
79
51
  style: t2,
80
- children: [
81
- t3,
82
- t4,
83
- t5,
84
- t6
85
- ]
52
+ children: [t3, t4]
86
53
  });
87
- $[15] = t3;
88
- $[16] = t4;
89
- $[17] = t5;
90
- $[18] = t6;
91
- $[19] = t7;
92
- } else t7 = $[19];
93
- return t7;
54
+ $[9] = t3;
55
+ $[10] = t4;
56
+ $[11] = t5;
57
+ } else t5 = $[11];
58
+ return t5;
94
59
  };
95
60
  function _temp(state) {
96
61
  return state.context.selection;
97
62
  }
98
63
  function _temp2(state_0) {
99
- return state_0.context.isAgentChatSidebarOpen;
100
- }
101
- function _temp3(state_1) {
102
- return state_1.context.isAddBlockSidebarOpen;
64
+ return state_0.context.isAddBlockSidebarOpen;
103
65
  }
104
- function _temp4() {
66
+ function _temp3() {
105
67
  return previewStore.send({ type: "closeAddBlockSidebar" });
106
68
  }
107
69
 
@@ -29,8 +29,6 @@ const previewStore = createStore({
29
29
  isPageEditorSidebarOpen: false,
30
30
  isAddBlockSidebarOpen: false,
31
31
  addBlockSource: null,
32
- isAgentChatSidebarOpen: false,
33
- agentChatPageScaffoldContext: null,
34
32
  isCreatePageModalOpen: false,
35
33
  editingPageId: null,
36
34
  isDraftSwitchDialogOpen: false,
@@ -40,7 +38,6 @@ const previewStore = createStore({
40
38
  peekedPagePathname: null,
41
39
  skipPeekedBlockExitAnimation: false,
42
40
  selection: null,
43
- pendingAgentBlockFocus: null,
44
41
  iframeElement: null,
45
42
  previewSource: "draft"
46
43
  },
@@ -117,8 +114,7 @@ const previewStore = createStore({
117
114
  }),
118
115
  setSelection: (context, event) => ({
119
116
  ...context,
120
- selection: event.selection,
121
- pendingAgentBlockFocus: null
117
+ selection: event.selection
122
118
  }),
123
119
  setFocusedBlock: (context, event) => ({
124
120
  ...context,
@@ -126,40 +122,17 @@ const previewStore = createStore({
126
122
  type: "block",
127
123
  blockId: event.blockId
128
124
  },
129
- pendingAgentBlockFocus: null,
130
125
  peekedBlock: null,
131
126
  peekedBlockPosition: null,
132
127
  isAddBlockSidebarOpen: false
133
128
  }),
134
- focusAgentBlock: (context, event) => ({
135
- ...context,
136
- selection: {
137
- type: "block",
138
- blockId: event.blockId
139
- },
140
- pendingAgentBlockFocus: {
141
- blockId: event.blockId,
142
- requestId: (context.pendingAgentBlockFocus?.requestId ?? 0) + 1
143
- },
144
- peekedBlock: null,
145
- peekedBlockPosition: null,
146
- isAddBlockSidebarOpen: false
147
- }),
148
- clearPendingAgentBlockFocus: (context, event) => {
149
- if (context.pendingAgentBlockFocus?.requestId !== event.requestId) return context;
150
- return {
151
- ...context,
152
- pendingAgentBlockFocus: null
153
- };
154
- },
155
129
  selectItem: (context, event) => ({
156
130
  ...context,
157
131
  selection: {
158
132
  type: "item",
159
133
  blockId: event.blockId,
160
134
  itemId: event.itemId
161
- },
162
- pendingAgentBlockFocus: null
135
+ }
163
136
  }),
164
137
  selectBlockField: (context, event) => ({
165
138
  ...context,
@@ -168,8 +141,7 @@ const previewStore = createStore({
168
141
  blockId: event.blockId,
169
142
  fieldName: event.fieldName,
170
143
  fieldType: event.fieldType
171
- },
172
- pendingAgentBlockFocus: null
144
+ }
173
145
  }),
174
146
  selectItemField: (context, event) => ({
175
147
  ...context,
@@ -179,8 +151,7 @@ const previewStore = createStore({
179
151
  itemId: event.itemId,
180
152
  fieldName: event.fieldName,
181
153
  fieldType: event.fieldType
182
- },
183
- pendingAgentBlockFocus: null
154
+ }
184
155
  }),
185
156
  selectParent: (context) => {
186
157
  const sel = context.selection;
@@ -211,13 +182,11 @@ const previewStore = createStore({
211
182
  },
212
183
  clearSelection: (context) => ({
213
184
  ...context,
214
- selection: null,
215
- pendingAgentBlockFocus: null
185
+ selection: null
216
186
  }),
217
187
  setPeekedPage: (context, event) => ({
218
188
  ...context,
219
189
  selection: null,
220
- pendingAgentBlockFocus: null,
221
190
  peekedPagePathname: event.pathname
222
191
  }),
223
192
  clearPeekedPage: (context) => ({
@@ -244,7 +213,6 @@ const previewStore = createStore({
244
213
  type: "block",
245
214
  blockId: event.blockId
246
215
  },
247
- pendingAgentBlockFocus: null,
248
216
  isAddBlockSidebarOpen: false,
249
217
  peekedBlock: null,
250
218
  peekedBlockPosition: null,
@@ -273,28 +241,6 @@ const previewStore = createStore({
273
241
  ...context,
274
242
  isPageEditorSidebarOpen: false
275
243
  }),
276
- openAgentChatSidebar: (context, event, enqueue) => {
277
- const pageScaffoldContext = event?.pageScaffoldContext;
278
- if (context.isAgentChatSidebarOpen && !pageScaffoldContext) return context;
279
- enqueue.effect(() => trackClientEvent("agent_chat_opened"));
280
- return {
281
- ...context,
282
- isAgentChatSidebarOpen: true,
283
- agentChatPageScaffoldContext: pageScaffoldContext ? {
284
- id: Date.now(),
285
- nickname: pageScaffoldContext.nickname,
286
- fullPath: pageScaffoldContext.fullPath
287
- } : context.agentChatPageScaffoldContext
288
- };
289
- },
290
- closeAgentChatSidebar: (context) => ({
291
- ...context,
292
- isAgentChatSidebarOpen: false
293
- }),
294
- clearAgentChatPageScaffoldContext: (context) => ({
295
- ...context,
296
- agentChatPageScaffoldContext: null
297
- }),
298
244
  openCreatePageModal: (context) => ({
299
245
  ...context,
300
246
  isCreatePageModalOpen: true