camox 0.41.0 → 0.42.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 (60) hide show
  1. package/dist/core/components/lexical/SidebarLexicalEditor.js +42 -39
  2. package/dist/core/createApp.d.ts +16 -2
  3. package/dist/core/createBlock.js +11 -25
  4. package/dist/core/editing/BlockEditingRuntime.js +4 -4
  5. package/dist/core/editing/CompleteBlockEditingRuntime.js +5 -5
  6. package/dist/core/editing/createEditableBlock.d.ts +8 -1
  7. package/dist/core/editing/createEditableBlock.js +684 -644
  8. package/dist/core/hooks/useIsEditable.js +4 -7
  9. package/dist/core/hooks/useOverlayState.js +11 -0
  10. package/dist/core/hooks/useRequireDraftSource.js +7 -11
  11. package/dist/core/lib/fieldTypes.js +5 -5
  12. package/dist/core/lib/lexicalState.js +17 -1
  13. package/dist/features/preview/CamoxPreview.js +123 -137
  14. package/dist/features/preview/DerivedPreview.js +6 -9
  15. package/dist/features/preview/commentsEnabled.js +8 -0
  16. package/dist/features/preview/components/AddBlockSidebar.js +79 -89
  17. package/dist/features/preview/components/AssetLightbox.js +4 -11
  18. package/dist/features/preview/components/AttachedComments.js +194 -0
  19. package/dist/features/preview/components/BlockActionsPopover.js +19 -70
  20. package/dist/features/preview/components/CommentHeader.js +122 -0
  21. package/dist/features/preview/components/CommentSidebar.js +29 -0
  22. package/dist/features/preview/components/CommentTargetQuote.js +166 -0
  23. package/dist/features/preview/components/CreatePageModal.js +2 -8
  24. package/dist/features/preview/components/DerivedLayoutSidebar.js +4 -7
  25. package/dist/features/preview/components/ItemFieldsEditor.js +275 -204
  26. package/dist/features/preview/components/LeftSidebar.js +18 -18
  27. package/dist/features/preview/components/LinkFieldEditor.js +3 -4
  28. package/dist/features/preview/components/MobilePreviewDrawer.js +3 -3
  29. package/dist/features/preview/components/OverlayTracker.js +14 -20
  30. package/dist/features/preview/components/Overlays.js +28 -40
  31. package/dist/features/preview/components/PageEditorSidebar.js +231 -241
  32. package/dist/features/preview/components/PageInfoSidebar.js +126 -157
  33. package/dist/features/preview/components/PagePicker.js +13 -8
  34. package/dist/features/preview/components/PageTree.js +255 -319
  35. package/dist/features/preview/components/PreviewComments.js +56 -0
  36. package/dist/features/preview/components/PreviewPanel.js +149 -107
  37. package/dist/features/preview/components/PreviewToolbar.js +292 -246
  38. package/dist/features/preview/components/PreviewToolbarSpacer.js +43 -0
  39. package/dist/features/preview/components/PublicationRow.js +11 -24
  40. package/dist/features/preview/components/RightSidebar.js +14 -11
  41. package/dist/features/preview/components/SidebarSection.js +121 -0
  42. package/dist/features/preview/previewCommentsStore.js +115 -0
  43. package/dist/features/preview/previewSelection.js +75 -0
  44. package/dist/features/preview/previewStore.js +32 -63
  45. package/dist/features/provider/AuthenticatedCamoxProvider.js +46 -34
  46. package/dist/features/provider/components/CommandPalette.js +142 -58
  47. package/dist/features/provider/useAdminShortcuts.js +20 -8
  48. package/dist/features/routes/pageRuntime.js +0 -6
  49. package/dist/features/runtime/RuntimeChrome.js +102 -87
  50. package/dist/features/studio/CamoxStudio.js +30 -50
  51. package/dist/features/studio/components/UserButton.js +4 -4
  52. package/dist/features/vite/runtimeDev.js +4 -1
  53. package/dist/features/vite/vite.d.ts +3 -2
  54. package/dist/features/vite/vite.js +9 -5
  55. package/dist/hooks/use-file-upload.js +0 -2
  56. package/dist/studio.css +1 -1
  57. package/package.json +5 -7
  58. package/dist/features/preview/components/DraftSwitchDialog.js +0 -66
  59. package/dist/lib/telemetry-client.js +0 -66
  60. package/dist/lib/telemetry.js +0 -26
@@ -0,0 +1,56 @@
1
+ import { previewStore, selectIsCommentMode } from "../previewStore.js";
2
+ import { previewCommentsStore } from "../previewCommentsStore.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import * as React from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { useSelector } from "@xstate/store-react";
7
+ import { createPortal } from "react-dom";
8
+
9
+ //#region src/features/preview/components/PreviewComments.tsx
10
+ const commentCursor = `url("data:image/svg+xml,${encodeURIComponent("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 32 32\"><path d=\"M16 1a15 15 0 0 1 0 30H1V16A15 15 0 0 1 16 1Z\" fill=\"oklch(69.6% 0.17 162.48)\" stroke=\"white\" stroke-width=\"2\"/></svg>")}") 1 23, crosshair`;
11
+ /** Comment mode lifecycle and cursor. Editable components handle selection and clicks. */
12
+ function PreviewComments() {
13
+ const $ = c(5);
14
+ if ($[0] !== "d824232b82365a442ae6220ec1d54f5b3bfeb17d2c1560e70b52c59208d222b1") {
15
+ for (let $i = 0; $i < 5; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
16
+ $[0] = "d824232b82365a442ae6220ec1d54f5b3bfeb17d2c1560e70b52c59208d222b1";
17
+ }
18
+ const iframe = useSelector(previewStore, _temp);
19
+ const commenting = useSelector(previewStore, selectIsCommentMode);
20
+ const doc = iframe?.contentDocument;
21
+ let t0;
22
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
23
+ t0 = [];
24
+ $[1] = t0;
25
+ } else t0 = $[1];
26
+ React.useEffect(_temp3, t0);
27
+ if (!doc || !commenting) return null;
28
+ let t1;
29
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
30
+ t1 = /* @__PURE__ */ jsx("style", { children: `html, html * { cursor: ${commentCursor} !important; }` });
31
+ $[2] = t1;
32
+ } else t1 = $[2];
33
+ let t2;
34
+ if ($[3] !== doc.head) {
35
+ t2 = createPortal(t1, doc.head);
36
+ $[3] = doc.head;
37
+ $[4] = t2;
38
+ } else t2 = $[4];
39
+ return t2;
40
+ }
41
+ function _temp3() {
42
+ return _temp2;
43
+ }
44
+ function _temp2() {
45
+ previewStore.send({
46
+ type: "setCommentMode",
47
+ enabled: false
48
+ });
49
+ previewCommentsStore.send({ type: "clearSelection" });
50
+ }
51
+ function _temp(state) {
52
+ return state.context.iframeElement;
53
+ }
54
+
55
+ //#endregion
56
+ export { PreviewComments };
@@ -1,14 +1,17 @@
1
1
  import { actionsStore } from "../../provider/actionsStore.js";
2
2
  import { checkIfInputFocused, cn } from "../../../lib/utils.js";
3
3
  import { SharedChromeContext } from "../../runtime/SharedChromeContext.js";
4
- import { previewStore } from "../previewStore.js";
4
+ import { areCommentsEnabled } from "../commentsEnabled.js";
5
+ import { previewStore, selectIsCommentMode, selectIsEditMode } from "../previewStore.js";
5
6
  import { useBlockActionsShortcuts } from "./BlockActionsPopover.js";
7
+ import { PreviewPageContext } from "../previewSelection.js";
6
8
  import { FieldOverlayStyles } from "./FieldOverlayStyles.js";
7
9
  import { FieldToolbar } from "./FieldToolbar.js";
8
10
  import { Frame, useFrame } from "./Frame.js";
9
11
  import { MobilePreviewDrawer } from "./MobilePreviewDrawer.js";
10
12
  import { Overlays } from "./Overlays.js";
11
13
  import { OverlayTracker } from "./OverlayTracker.js";
14
+ import { PreviewComments } from "./PreviewComments.js";
12
15
  import { PreviewToolbar } from "./PreviewToolbar.js";
13
16
  import { c } from "react/compiler-runtime";
14
17
  import * as React from "react";
@@ -19,9 +22,9 @@ import { PanelContent } from "@camox/ui/panel";
19
22
  //#region src/features/preview/components/PreviewPanel.tsx
20
23
  const PreviewFrame = (t0) => {
21
24
  const $ = c(9);
22
- if ($[0] !== "d1fef758f47859e4d6ac1a8436e009a46839990f032b83d1c6b20b946ff84297") {
25
+ if ($[0] !== "2ff281df7470ab1480710764847a6828eb3009ff64e2feadae4454d04b90f99e") {
23
26
  for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
24
- $[0] = "d1fef758f47859e4d6ac1a8436e009a46839990f032b83d1c6b20b946ff84297";
27
+ $[0] = "2ff281df7470ab1480710764847a6828eb3009ff64e2feadae4454d04b90f99e";
25
28
  }
26
29
  const { children, style, className, onIframeReady } = t0;
27
30
  let t1;
@@ -62,9 +65,9 @@ const PreviewFrame = (t0) => {
62
65
  };
63
66
  const KeyDownForwarder = () => {
64
67
  const $ = c(5);
65
- if ($[0] !== "d1fef758f47859e4d6ac1a8436e009a46839990f032b83d1c6b20b946ff84297") {
68
+ if ($[0] !== "2ff281df7470ab1480710764847a6828eb3009ff64e2feadae4454d04b90f99e") {
66
69
  for (let $i = 0; $i < 5; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
67
- $[0] = "d1fef758f47859e4d6ac1a8436e009a46839990f032b83d1c6b20b946ff84297";
70
+ $[0] = "2ff281df7470ab1480710764847a6828eb3009ff64e2feadae4454d04b90f99e";
68
71
  }
69
72
  const { window: iframeWindow } = useFrame();
70
73
  const actions = useSelector(actionsStore, _temp);
@@ -78,7 +81,7 @@ const KeyDownForwarder = () => {
78
81
  if (!action.shortcut) return false;
79
82
  if (!action.checkIfAvailable()) return false;
80
83
  if (checkIfInputFocused(iframeWindow.document)) {
81
- if (!action.shortcut.withMeta && !action.shortcut.withAlt) return false;
84
+ if (action.shortcut.key !== "Escape" && !action.shortcut.withMeta && !action.shortcut.withAlt) return false;
82
85
  if (action.shortcut.key === "Backspace") return false;
83
86
  }
84
87
  const { key, withMeta, withAlt, withShift } = action.shortcut;
@@ -86,15 +89,27 @@ const KeyDownForwarder = () => {
86
89
  });
87
90
  if (matchingAction) {
88
91
  e.preventDefault();
92
+ e.stopPropagation();
93
+ if (e.key === "Escape" && checkIfInputFocused(iframeWindow.document)) iframeWindow.document.activeElement.blur();
89
94
  iframeWindow.parent.postMessage({
90
95
  type: "executeAction",
91
96
  actionId: matchingAction.id
92
97
  }, "*");
93
98
  }
94
99
  };
95
- iframeWindow.addEventListener("keydown", handleKeyDown);
100
+ const handleCapturedKeyDown = (event) => {
101
+ if (event.key === "Escape") return;
102
+ handleKeyDown(event);
103
+ };
104
+ const handleEscape = (event_0) => {
105
+ if (event_0.key !== "Escape" || event_0.defaultPrevented) return;
106
+ handleKeyDown(event_0);
107
+ };
108
+ iframeWindow.addEventListener("keydown", handleCapturedKeyDown, true);
109
+ iframeWindow.addEventListener("keydown", handleEscape);
96
110
  return () => {
97
- iframeWindow.removeEventListener("keydown", handleKeyDown);
111
+ iframeWindow.removeEventListener("keydown", handleCapturedKeyDown, true);
112
+ iframeWindow.removeEventListener("keydown", handleEscape);
98
113
  };
99
114
  };
100
115
  t1 = [iframeWindow, actions];
@@ -115,82 +130,102 @@ const viewportClassName = {
115
130
  };
116
131
  function CuratedBlockShortcuts() {
117
132
  const $ = c(1);
118
- if ($[0] !== "d1fef758f47859e4d6ac1a8436e009a46839990f032b83d1c6b20b946ff84297") {
133
+ if ($[0] !== "2ff281df7470ab1480710764847a6828eb3009ff64e2feadae4454d04b90f99e") {
119
134
  for (let $i = 0; $i < 1; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
120
- $[0] = "d1fef758f47859e4d6ac1a8436e009a46839990f032b83d1c6b20b946ff84297";
135
+ $[0] = "2ff281df7470ab1480710764847a6828eb3009ff64e2feadae4454d04b90f99e";
121
136
  }
122
137
  useBlockActionsShortcuts();
123
138
  return null;
124
139
  }
125
140
  const PreviewPanel = (t0) => {
126
- const $ = c(26);
127
- if ($[0] !== "d1fef758f47859e4d6ac1a8436e009a46839990f032b83d1c6b20b946ff84297") {
128
- for (let $i = 0; $i < 26; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
129
- $[0] = "d1fef758f47859e4d6ac1a8436e009a46839990f032b83d1c6b20b946ff84297";
141
+ const $ = c(34);
142
+ if ($[0] !== "2ff281df7470ab1480710764847a6828eb3009ff64e2feadae4454d04b90f99e") {
143
+ for (let $i = 0; $i < 34; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
144
+ $[0] = "2ff281df7470ab1480710764847a6828eb3009ff64e2feadae4454d04b90f99e";
130
145
  }
131
146
  const { children, isMobileExperience: t1, page, projectName: t2, toolbarProps } = t0;
132
147
  const isMobileExperience = t1 === void 0 ? false : t1;
133
148
  const projectName = t2 === void 0 ? "Project" : t2;
134
149
  const sharedChrome = React.useContext(SharedChromeContext);
150
+ const t3 = page?.id ?? null;
151
+ let t4;
152
+ if ($[1] !== children || $[2] !== t3) {
153
+ t4 = /* @__PURE__ */ jsx(PreviewPageContext, {
154
+ value: t3,
155
+ children
156
+ });
157
+ $[1] = children;
158
+ $[2] = t3;
159
+ $[3] = t4;
160
+ } else t4 = $[3];
161
+ const previewContent = t4;
135
162
  const iframeElement = useSelector(previewStore, _temp2);
136
163
  const handleIframeReady = _temp3;
137
164
  const viewportMode = useSelector(previewStore, _temp4);
138
- const isEditMode = useSelector(previewStore, _temp5);
139
- const isToolbarHidden = useSelector(previewStore, _temp6);
140
- let t3;
141
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
142
- t3 = [];
143
- $[1] = t3;
144
- } else t3 = $[1];
145
- React.useEffect(_temp16, t3);
165
+ const isEditMode = useSelector(previewStore, selectIsEditMode);
166
+ const isCommentMode = useSelector(previewStore, selectIsCommentMode);
167
+ const isToolbarHidden = useSelector(previewStore, _temp5);
168
+ let t5;
169
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
170
+ t5 = [];
171
+ $[4] = t5;
172
+ } else t5 = $[4];
173
+ React.useEffect(_temp15, t5);
146
174
  if (isMobileExperience) {
147
- let t4;
148
- if ($[2] !== children) {
149
- t4 = /* @__PURE__ */ jsx("div", {
175
+ let t6;
176
+ if ($[5] !== previewContent) {
177
+ t6 = /* @__PURE__ */ jsx("div", {
150
178
  className: "relative min-h-0 flex-1",
151
179
  children: /* @__PURE__ */ jsx(PreviewFrame, {
152
180
  className: "h-full w-full",
153
181
  onIframeReady: handleIframeReady,
154
- children
182
+ children: previewContent
155
183
  })
156
184
  });
157
- $[2] = children;
158
- $[3] = t4;
159
- } else t4 = $[3];
160
- let t5;
161
- if ($[4] !== isToolbarHidden || $[5] !== page || $[6] !== projectName || $[7] !== sharedChrome || $[8] !== toolbarProps) {
162
- t5 = !isToolbarHidden && (page ? /* @__PURE__ */ jsx(MobilePreviewDrawer, {
185
+ $[5] = previewContent;
186
+ $[6] = t6;
187
+ } else t6 = $[6];
188
+ let t7;
189
+ if ($[7] !== isToolbarHidden || $[8] !== page || $[9] !== projectName || $[10] !== sharedChrome || $[11] !== toolbarProps) {
190
+ t7 = !isToolbarHidden && (page ? /* @__PURE__ */ jsx(MobilePreviewDrawer, {
163
191
  page,
164
192
  projectName
165
193
  }) : !sharedChrome && /* @__PURE__ */ jsx(PreviewToolbar, { ...toolbarProps }));
166
- $[4] = isToolbarHidden;
167
- $[5] = page;
168
- $[6] = projectName;
169
- $[7] = sharedChrome;
170
- $[8] = toolbarProps;
171
- $[9] = t5;
172
- } else t5 = $[9];
173
- let t6;
174
- if ($[10] !== t4 || $[11] !== t5) {
175
- t6 = /* @__PURE__ */ jsxs(PanelContent, {
194
+ $[7] = isToolbarHidden;
195
+ $[8] = page;
196
+ $[9] = projectName;
197
+ $[10] = sharedChrome;
198
+ $[11] = toolbarProps;
199
+ $[12] = t7;
200
+ } else t7 = $[12];
201
+ let t8;
202
+ if ($[13] !== t6 || $[14] !== t7) {
203
+ t8 = /* @__PURE__ */ jsxs(PanelContent, {
176
204
  className: "flex min-h-0 flex-col overflow-hidden bg-black",
177
- children: [t4, t5]
205
+ children: [t6, t7]
178
206
  });
179
- $[10] = t4;
180
- $[11] = t5;
181
- $[12] = t6;
182
- } else t6 = $[12];
183
- return t6;
207
+ $[13] = t6;
208
+ $[14] = t7;
209
+ $[15] = t8;
210
+ } else t8 = $[15];
211
+ return t8;
184
212
  }
185
- let t4;
186
- if ($[13] !== page) {
187
- t4 = page && /* @__PURE__ */ jsx(CuratedBlockShortcuts, {});
188
- $[13] = page;
189
- $[14] = t4;
190
- } else t4 = $[14];
191
- let t5;
192
- if ($[15] !== children || $[16] !== iframeElement || $[17] !== isEditMode || $[18] !== page || $[19] !== sharedChrome || $[20] !== toolbarProps || $[21] !== viewportMode) {
193
- t5 = /* @__PURE__ */ jsx(PanelContent, {
213
+ let t6;
214
+ if ($[16] !== isCommentMode || $[17] !== page) {
215
+ t6 = page && !isCommentMode && /* @__PURE__ */ jsx(CuratedBlockShortcuts, {});
216
+ $[16] = isCommentMode;
217
+ $[17] = page;
218
+ $[18] = t6;
219
+ } else t6 = $[18];
220
+ let t7;
221
+ if ($[19] !== page) {
222
+ t7 = areCommentsEnabled() && page && /* @__PURE__ */ jsx(PreviewComments, {}, page.id);
223
+ $[19] = page;
224
+ $[20] = t7;
225
+ } else t7 = $[20];
226
+ let t8;
227
+ if ($[21] !== iframeElement || $[22] !== isCommentMode || $[23] !== isEditMode || $[24] !== page || $[25] !== previewContent || $[26] !== sharedChrome || $[27] !== toolbarProps || $[28] !== viewportMode) {
228
+ t8 = /* @__PURE__ */ jsx(PanelContent, {
194
229
  className: "relative overflow-hidden bg-black",
195
230
  children: /* @__PURE__ */ jsx("div", {
196
231
  className: "absolute inset-0",
@@ -198,13 +233,13 @@ const PreviewPanel = (t0) => {
198
233
  /* @__PURE__ */ jsx(PreviewFrame, {
199
234
  className: "checkered h-full w-full",
200
235
  onIframeReady: handleIframeReady,
201
- children
236
+ children: previewContent
202
237
  }),
203
- isEditMode && /* @__PURE__ */ jsx(Overlays, {
238
+ isEditMode && !isCommentMode && /* @__PURE__ */ jsx(Overlays, {
204
239
  iframeElement,
205
240
  canAddBlocks: !!page
206
241
  }),
207
- isEditMode && /* @__PURE__ */ jsx(FieldToolbar, {}),
242
+ isEditMode && !isCommentMode && /* @__PURE__ */ jsx(FieldToolbar, {}),
208
243
  !sharedChrome && /* @__PURE__ */ jsx(PreviewToolbar, { ...toolbarProps })
209
244
  ] }) : /* @__PURE__ */ jsxs("div", {
210
245
  className: cn("checkered flex h-full justify-center", isEditMode ? "items-start" : "items-center"),
@@ -214,35 +249,41 @@ const PreviewPanel = (t0) => {
214
249
  children: [/* @__PURE__ */ jsx(PreviewFrame, {
215
250
  className: "overflow-auto",
216
251
  onIframeReady: handleIframeReady,
217
- children
218
- }), isEditMode && /* @__PURE__ */ jsx(Overlays, {
252
+ children: previewContent
253
+ }), isEditMode && !isCommentMode && /* @__PURE__ */ jsx(Overlays, {
219
254
  iframeElement,
220
255
  canAddBlocks: !!page
221
256
  })]
222
257
  }),
223
- isEditMode && /* @__PURE__ */ jsx(FieldToolbar, {}),
258
+ isEditMode && !isCommentMode && /* @__PURE__ */ jsx(FieldToolbar, {}),
224
259
  !sharedChrome && /* @__PURE__ */ jsx(PreviewToolbar, { ...toolbarProps })
225
260
  ]
226
261
  })
227
262
  })
228
263
  });
229
- $[15] = children;
230
- $[16] = iframeElement;
231
- $[17] = isEditMode;
232
- $[18] = page;
233
- $[19] = sharedChrome;
234
- $[20] = toolbarProps;
235
- $[21] = viewportMode;
236
- $[22] = t5;
237
- } else t5 = $[22];
238
- let t6;
239
- if ($[23] !== t4 || $[24] !== t5) {
240
- t6 = /* @__PURE__ */ jsxs(Fragment, { children: [t4, t5] });
241
- $[23] = t4;
242
- $[24] = t5;
243
- $[25] = t6;
244
- } else t6 = $[25];
245
- return t6;
264
+ $[21] = iframeElement;
265
+ $[22] = isCommentMode;
266
+ $[23] = isEditMode;
267
+ $[24] = page;
268
+ $[25] = previewContent;
269
+ $[26] = sharedChrome;
270
+ $[27] = toolbarProps;
271
+ $[28] = viewportMode;
272
+ $[29] = t8;
273
+ } else t8 = $[29];
274
+ let t9;
275
+ if ($[30] !== t6 || $[31] !== t7 || $[32] !== t8) {
276
+ t9 = /* @__PURE__ */ jsxs(Fragment, { children: [
277
+ t6,
278
+ t7,
279
+ t8
280
+ ] });
281
+ $[30] = t6;
282
+ $[31] = t7;
283
+ $[32] = t8;
284
+ $[33] = t9;
285
+ } else t9 = $[33];
286
+ return t9;
246
287
  };
247
288
  function _temp(state) {
248
289
  return state.context.actions;
@@ -260,54 +301,55 @@ function _temp4(state_0) {
260
301
  return state_0.context.viewportMode;
261
302
  }
262
303
  function _temp5(state_1) {
263
- return state_1.context.isEditMode;
304
+ return state_1.context.isToolbarHidden;
264
305
  }
265
- function _temp6(state_2) {
266
- return state_2.context.isToolbarHidden;
267
- }
268
- function _temp7() {
306
+ function _temp6() {
269
307
  return true;
270
308
  }
271
- function _temp8() {
309
+ function _temp7() {
272
310
  return previewStore.send({ type: "cycleViewportMode" });
273
311
  }
274
- function _temp9() {
312
+ function _temp8() {
275
313
  return true;
276
314
  }
277
- function _temp0() {
315
+ function _temp9() {
278
316
  return previewStore.send({
279
317
  type: "setViewportMode",
280
318
  mode: "full"
281
319
  });
282
320
  }
283
- function _temp1() {
321
+ function _temp0() {
284
322
  return true;
285
323
  }
286
- function _temp10() {
324
+ function _temp1() {
287
325
  return previewStore.send({
288
326
  type: "setViewportMode",
289
327
  mode: "tablet"
290
328
  });
291
329
  }
292
- function _temp11() {
330
+ function _temp10() {
293
331
  return true;
294
332
  }
295
- function _temp12() {
333
+ function _temp11() {
296
334
  return previewStore.send({
297
335
  type: "setViewportMode",
298
336
  mode: "mobile"
299
337
  });
300
338
  }
301
- function _temp13() {
339
+ function _temp12() {
302
340
  return true;
303
341
  }
304
- function _temp14() {
342
+ function _temp13() {
343
+ previewStore.send({
344
+ type: "setCommentMode",
345
+ enabled: false
346
+ });
305
347
  previewStore.send({ type: "clearSelection" });
306
348
  }
307
- function _temp15(a) {
349
+ function _temp14(a) {
308
350
  return a.id;
309
351
  }
310
- function _temp16() {
352
+ function _temp15() {
311
353
  const actions = [
312
354
  {
313
355
  id: "cycle-viewport-mode",
@@ -318,8 +360,8 @@ function _temp16() {
318
360
  "Device preview"
319
361
  ],
320
362
  groupLabel: "Preview",
321
- checkIfAvailable: _temp7,
322
- execute: _temp8,
363
+ checkIfAvailable: _temp6,
364
+ execute: _temp7,
323
365
  shortcut: { key: "m" }
324
366
  },
325
367
  {
@@ -331,16 +373,16 @@ function _temp16() {
331
373
  "Full width preview"
332
374
  ],
333
375
  groupLabel: "Preview",
334
- checkIfAvailable: _temp9,
335
- execute: _temp0
376
+ checkIfAvailable: _temp8,
377
+ execute: _temp9
336
378
  },
337
379
  {
338
380
  id: "set-viewport-tablet",
339
381
  label: "Set tablet viewport",
340
382
  aliases: ["Tablet preview", "Responsive preview"],
341
383
  groupLabel: "Preview",
342
- checkIfAvailable: _temp1,
343
- execute: _temp10
384
+ checkIfAvailable: _temp0,
385
+ execute: _temp1
344
386
  },
345
387
  {
346
388
  id: "set-viewport-mobile",
@@ -351,16 +393,16 @@ function _temp16() {
351
393
  "Responsive preview"
352
394
  ],
353
395
  groupLabel: "Preview",
354
- checkIfAvailable: _temp11,
355
- execute: _temp12
396
+ checkIfAvailable: _temp10,
397
+ execute: _temp11
356
398
  },
357
399
  {
358
400
  id: "clear-selection",
359
401
  label: "Clear selection",
360
402
  aliases: ["Deselect", "Unselect"],
361
403
  groupLabel: "Preview",
362
- checkIfAvailable: _temp13,
363
- execute: _temp14,
404
+ checkIfAvailable: _temp12,
405
+ execute: _temp13,
364
406
  shortcut: { key: "Escape" }
365
407
  }
366
408
  ];
@@ -371,7 +413,7 @@ function _temp16() {
371
413
  return () => {
372
414
  actionsStore.send({
373
415
  type: "unregisterManyActions",
374
- ids: actions.map(_temp15)
416
+ ids: actions.map(_temp14)
375
417
  });
376
418
  };
377
419
  }