camox 0.44.0 → 0.46.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 (407) hide show
  1. package/dist/components/AuthGate.js +0 -6
  2. package/dist/components/DeviceSelector.js +96 -0
  3. package/dist/components/PlatformLabel.js +20 -24
  4. package/dist/core/components/lexical/HighlightNode.js +1 -1
  5. package/dist/core/components/lexical/InlineContentEditable.js +15 -19
  6. package/dist/core/components/lexical/InlineLexicalEditor.js +54 -74
  7. package/dist/core/components/lexical/InlineStylesPlugin.js +53 -53
  8. package/dist/core/components/lexical/MaxLengthPlugin.js +59 -0
  9. package/dist/core/components/lexical/SelectionBroadcaster.js +53 -54
  10. package/dist/core/components/lexical/SidebarLexicalEditor.js +322 -229
  11. package/dist/core/components/lexical/SummaryToggleGuard.js +42 -0
  12. package/dist/core/components/lexical/TextLinkPopover.js +169 -180
  13. package/dist/core/createApp.d.ts +241 -312
  14. package/dist/core/createApp.js +123 -29
  15. package/dist/core/createBlock.d.ts +5 -5
  16. package/dist/core/createBlock.js +385 -152
  17. package/dist/core/createCollection.d.ts +55 -0
  18. package/dist/core/createCollection.js +93 -0
  19. package/dist/core/createLayout.d.ts +197 -61
  20. package/dist/core/createLayout.js +114 -56
  21. package/dist/core/defineDocument.d.ts +3 -5
  22. package/dist/core/derivedRoutes.js +49 -1
  23. package/dist/core/dom.d.ts +13 -4
  24. package/dist/core/dom.js +44 -1
  25. package/dist/core/editing/BlockEditingRuntime.d.ts +16 -0
  26. package/dist/core/editing/BlockEditingRuntime.js +6 -15
  27. package/dist/core/editing/CompleteBlockEditingRuntime.js +28 -23
  28. package/dist/core/editing/createEditableBlock.d.ts +754 -633
  29. package/dist/core/editing/createEditableBlock.js +2113 -1066
  30. package/dist/core/editing/referenceWrites.js +51 -0
  31. package/dist/core/editing/useLatestRecord.js +90 -0
  32. package/dist/core/hooks/useArtifactHost.js +139 -0
  33. package/dist/core/hooks/useFieldSelection.js +43 -18
  34. package/dist/core/hooks/useIsEditable.js +12 -10
  35. package/dist/core/hooks/useOverlayMessage.js +15 -19
  36. package/dist/core/lib/artifact.d.ts +21 -0
  37. package/dist/core/lib/artifact.js +154 -0
  38. package/dist/core/lib/artifactColors.js +123 -0
  39. package/dist/core/lib/artifactData.d.ts +1 -0
  40. package/dist/core/lib/artifactData.js +131 -0
  41. package/dist/core/lib/artifactHost.js +205 -0
  42. package/dist/core/lib/artifactRuntime.js +36 -0
  43. package/dist/core/lib/artifactTheme.js +57 -0
  44. package/dist/core/lib/contentType.d.ts +302 -106
  45. package/dist/core/lib/contentType.js +201 -173
  46. package/dist/core/lib/fieldTypes.js +3 -0
  47. package/dist/core/lib/iconTypes.d.ts +3 -3
  48. package/dist/core/lib/icons.d.ts +4 -4
  49. package/dist/core/lib/icons.js +40 -44
  50. package/dist/core/lib/imagePlaceholder.js +177 -0
  51. package/dist/core/lib/imageTransform.js +1 -1
  52. package/dist/core/lib/lexicalReact.d.ts +3 -1
  53. package/dist/core/lib/lexicalState.js +1 -1
  54. package/dist/core/lib/previewPaused.js +9 -0
  55. package/dist/core/lib/recordScope.js +316 -0
  56. package/dist/core/lib/reference.d.ts +81 -0
  57. package/dist/core/lib/reference.js +29 -0
  58. package/dist/core/lib/textLinks.js +7 -5
  59. package/dist/core/lib/textStyles.d.ts +5 -7
  60. package/dist/core/lib/textStyles.js +2 -2
  61. package/dist/core/notFound.d.ts +7 -0
  62. package/dist/core/notFound.js +11 -0
  63. package/dist/core/pageDestinations.js +6 -3
  64. package/dist/core/recordItem.js +34 -0
  65. package/dist/core/requestContext.d.ts +26 -0
  66. package/dist/core/requestContext.js +20 -0
  67. package/dist/features/canvas/CamoxCanvas.js +1401 -0
  68. package/dist/features/canvas/CanvasLoadingScreen.js +35 -0
  69. package/dist/features/canvas/CanvasOverlays.js +254 -0
  70. package/dist/features/canvas/CanvasPageEdge.js +87 -0
  71. package/dist/features/canvas/CanvasPageFrame.js +333 -0
  72. package/dist/features/canvas/CanvasPageHeader.js +125 -0
  73. package/dist/features/canvas/CanvasPreviewPageSlot.js +123 -0
  74. package/dist/features/canvas/DerivedPagePathInput.js +238 -0
  75. package/dist/features/canvas/canvasCamera.js +229 -0
  76. package/dist/features/canvas/canvasFlight.js +104 -0
  77. package/dist/features/canvas/canvasFrameCapture.js +364 -0
  78. package/dist/features/canvas/canvasFrameDocument.js +302 -0
  79. package/dist/features/canvas/canvasFrameMode.js +53 -0
  80. package/dist/features/canvas/canvasInsertionSeams.js +44 -0
  81. package/dist/features/canvas/canvasItems.js +30 -0
  82. package/dist/features/canvas/canvasOverlayGeometry.js +240 -0
  83. package/dist/features/canvas/canvasPages.js +79 -0
  84. package/dist/features/canvas/canvasScreenSpace.js +26 -0
  85. package/dist/features/canvas/canvasSelection.js +18 -0
  86. package/dist/features/canvas/canvasStore.js +60 -0
  87. package/dist/features/canvas/canvasThumbnails.js +304 -0
  88. package/dist/features/canvas/canvasZoom.js +10 -0
  89. package/dist/features/canvas/sidebar/CanvasInspector.js +202 -0
  90. package/dist/features/canvas/sidebar/CanvasNavigator.js +124 -0
  91. package/dist/features/canvas/sidebar/CanvasSidebar.js +54 -0
  92. package/dist/features/canvas/sidebar/CanvasSidebarFrame.js +48 -0
  93. package/dist/features/canvas/sidebar/CanvasSidebarSkeleton.js +39 -0
  94. package/dist/features/canvas/sidebar/CuratedPageInspector.js +69 -0
  95. package/dist/features/canvas/sidebar/DerivedPageInspector.js +37 -0
  96. package/dist/features/canvas/sidebar/LayoutPageBlocks.js +78 -0
  97. package/dist/features/canvas/sidebar/LayoutPageOverview.js +71 -0
  98. package/dist/features/canvas/sidebar/PageInspector.js +157 -0
  99. package/dist/features/canvas/sidebar/PageInspectorSkeleton.js +90 -0
  100. package/dist/features/canvas/sidebar/PageOverview.js +27 -0
  101. package/dist/features/canvas/sidebar/SingletonPageInspector.js +31 -0
  102. package/dist/features/canvas/useCanvasCamera.js +783 -0
  103. package/dist/features/canvas/useCanvasFrame.js +148 -0
  104. package/dist/features/canvas/useCanvasFrameInput.js +97 -0
  105. package/dist/features/canvas/useCanvasNearness.js +57 -0
  106. package/dist/features/canvas/useDiscoveredPreviewPaths.js +62 -0
  107. package/dist/features/content/CamoxContent.d.ts +2 -5
  108. package/dist/features/content/CamoxContent.js +174 -271
  109. package/dist/features/content/CollectionItemSheetContext.js +106 -0
  110. package/dist/features/content/ContentAssets.js +315 -0
  111. package/dist/features/content/ContentCollection.js +663 -0
  112. package/dist/features/content/collection-form.js +58 -0
  113. package/dist/features/content/components/AssetCard.js +80 -84
  114. package/dist/features/content/components/AssetCardSkeleton.js +4 -8
  115. package/dist/features/content/components/ContentSidebar.js +129 -18
  116. package/dist/features/content/components/ContentSidebarGroup.js +37 -0
  117. package/dist/features/content/components/DeleteCollectionItemButton.js +202 -0
  118. package/dist/features/content/components/MissingFromLocale.js +282 -0
  119. package/dist/features/content/components/UploadDropZone.js +27 -31
  120. package/dist/features/content/components/UploadProgressDrawer.js +90 -98
  121. package/dist/features/navigation/navigation.d.ts +66 -20
  122. package/dist/features/navigation/navigation.js +257 -90
  123. package/dist/features/og/defaultFonts.js +8 -8
  124. package/dist/features/og/geist-variable-ttf-base64.js +1 -1
  125. package/dist/features/og/imageResponse.d.ts +8 -0
  126. package/dist/features/og/imageResponse.js +26 -0
  127. package/dist/features/page/CuratedPageContent.js +167 -0
  128. package/dist/features/page/DerivedPageContent.js +26 -30
  129. package/dist/features/page/SharedLayoutContent.js +25 -27
  130. package/dist/features/preview/CamoxPreview.d.ts +23 -61
  131. package/dist/features/preview/CamoxPreview.js +816 -537
  132. package/dist/features/preview/EditablePageContent.js +1 -1
  133. package/dist/features/preview/EditablePageExperience.js +16 -22
  134. package/dist/features/preview/components/AddBlockSheet.js +273 -0
  135. package/dist/features/preview/components/AssetFieldEditor.js +173 -154
  136. package/dist/features/preview/components/AssetLightbox.js +181 -134
  137. package/dist/features/preview/components/AssetPickerModal.js +153 -170
  138. package/dist/features/preview/components/BlockActionsPopover.js +150 -149
  139. package/dist/features/preview/components/BlockErrorBoundary.js +8 -12
  140. package/dist/features/preview/components/BlockThumbnail.js +172 -98
  141. package/dist/features/preview/components/CanvasPreview.js +243 -0
  142. package/dist/features/preview/components/CreatePageModal.js +128 -137
  143. package/dist/features/preview/components/DebouncedFieldEditor.js +29 -33
  144. package/dist/features/preview/components/DerivedLayoutDialog.js +21 -19
  145. package/dist/features/preview/components/DrillRow.js +150 -0
  146. package/dist/features/preview/components/FieldOverlayStyles.js +11 -8
  147. package/dist/features/preview/components/FieldToolbar.js +160 -110
  148. package/dist/features/preview/components/Frame.js +108 -20
  149. package/dist/features/preview/components/IconFieldEditor.js +62 -66
  150. package/dist/features/preview/components/ItemFieldsEditor.js +231 -205
  151. package/dist/features/preview/components/LinkFieldEditor.js +135 -139
  152. package/dist/features/preview/components/Metadata.js +22 -30
  153. package/dist/features/preview/components/MobilePreviewDrawer.js +89 -108
  154. package/dist/features/preview/components/MultipleAssetFieldEditor.js +334 -246
  155. package/dist/features/preview/components/OverlayTracker.js +9 -41
  156. package/dist/features/preview/components/Overlays.js +81 -69
  157. package/dist/features/preview/components/PageInfo.js +1748 -0
  158. package/dist/features/preview/components/PageInfoSkeleton.js +51 -0
  159. package/dist/features/preview/components/PageLocationFieldset.js +112 -116
  160. package/dist/features/preview/components/PageNavigatorHeader.js +24 -0
  161. package/dist/features/preview/components/PageNicknameField.js +22 -26
  162. package/dist/features/preview/components/PagePicker.js +128 -130
  163. package/dist/features/preview/components/PageTree.js +525 -532
  164. package/dist/features/preview/components/PreviewActivation.js +28 -32
  165. package/dist/features/preview/components/PreviewPanel.js +620 -319
  166. package/dist/features/preview/components/PreviewToolbar.js +105 -333
  167. package/dist/features/preview/components/RecordCard.js +80 -0
  168. package/dist/features/preview/components/RecordCombobox.js +178 -0
  169. package/dist/features/preview/components/ReferenceFieldEditor.js +149 -0
  170. package/dist/features/preview/components/ReferenceListFieldEditor.js +432 -0
  171. package/dist/features/preview/components/RemovedBlockPlaceholder.js +95 -0
  172. package/dist/features/preview/components/RepeatableItemsList.js +125 -138
  173. package/dist/features/preview/components/SelectionEditor.js +993 -0
  174. package/dist/features/preview/components/ShikiMarkdown.js +14 -18
  175. package/dist/features/preview/components/SidebarSection.js +52 -64
  176. package/dist/features/preview/components/StudioEditingFallback.js +56 -0
  177. package/dist/features/preview/components/UnlinkAssetButton.js +104 -107
  178. package/dist/features/preview/components/blockGridNavigation.js +15 -0
  179. package/dist/features/preview/components/contentFieldSchema.js +8 -0
  180. package/dist/features/preview/components/useFieldWriter.js +200 -0
  181. package/dist/features/preview/components/useRecordView.js +383 -0
  182. package/dist/features/preview/components/useRepeatableItemActions.js +35 -37
  183. package/dist/features/preview/components/useUpdateBlockPosition.js +37 -37
  184. package/dist/features/preview/editingFrame.js +197 -0
  185. package/dist/features/preview/overlayHighlights.js +17 -44
  186. package/dist/features/preview/overlayMessages.js +72 -1
  187. package/dist/features/preview/pageRecord.js +189 -0
  188. package/dist/features/preview/previewConstants.js +6 -2
  189. package/dist/features/preview/previewPageFrame.js +95 -0
  190. package/dist/features/preview/previewPreparation.js +7 -0
  191. package/dist/features/preview/previewSelection.js +32 -63
  192. package/dist/features/preview/previewStore.js +225 -123
  193. package/dist/features/preview/referencePickerFocus.js +29 -0
  194. package/dist/features/preview/repeatableItemTargets.js +56 -0
  195. package/dist/features/preview/selectionReveal.js +21 -0
  196. package/dist/features/preview/usePreviewViewportActions.js +114 -0
  197. package/dist/features/preview/viewportContinuity.js +109 -0
  198. package/dist/features/provider/AuthenticatedCamoxProvider.js +69 -44
  199. package/dist/features/provider/CamoxProvider.d.ts +3 -6
  200. package/dist/features/provider/CamoxProvider.js +38 -50
  201. package/dist/features/provider/CoreCamoxProvider.js +69 -50
  202. package/dist/features/provider/LocalhostPreviewProvider.js +78 -114
  203. package/dist/features/provider/PreviewSignInPage.js +54 -0
  204. package/dist/features/provider/components/CamoxAppContext.js +11 -11
  205. package/dist/features/provider/components/CommandPalette.js +75 -82
  206. package/dist/features/provider/useAdminShortcuts.js +7 -11
  207. package/dist/features/routes/pageRuntime.d.ts +44 -4
  208. package/dist/features/routes/pageRuntime.js +244 -137
  209. package/dist/features/runtime/RuntimeChrome.js +117 -115
  210. package/dist/features/runtime/alternates.js +64 -0
  211. package/dist/features/runtime/analytics.d.ts +7 -0
  212. package/dist/features/runtime/analytics.js +66 -0
  213. package/dist/features/runtime/artifactSources.js +87 -0
  214. package/dist/features/runtime/editingFallback.js +20 -0
  215. package/dist/features/runtime/linkPrefetch.js +97 -0
  216. package/dist/features/runtime/livePages.js +62 -0
  217. package/dist/features/runtime/llmsTxt.js +40 -0
  218. package/dist/features/runtime/loopbackFetch.js +18 -0
  219. package/dist/features/runtime/navigationAccessibility.js +51 -0
  220. package/dist/features/runtime/navigationTarget.js +23 -2
  221. package/dist/features/runtime/pageApp.js +229 -158
  222. package/dist/features/runtime/pageBlockTypes.js +20 -0
  223. package/dist/features/runtime/pageClient.d.ts +2 -4
  224. package/dist/features/runtime/pageClient.js +18 -3
  225. package/dist/features/runtime/pageNavigation.js +254 -32
  226. package/dist/features/runtime/pageServer.d.ts +2 -4
  227. package/dist/features/runtime/pageServer.js +6 -2
  228. package/dist/features/runtime/pageViewport.js +7 -0
  229. package/dist/features/runtime/runtime.d.ts +54 -24
  230. package/dist/features/runtime/runtime.js +766 -191
  231. package/dist/features/runtime/runtimeChromeLoader.js +58 -0
  232. package/dist/features/runtime/runtimeRoutes.d.ts +19 -0
  233. package/dist/features/runtime/runtimeRoutes.js +25 -0
  234. package/dist/features/runtime/scrollRestoration.js +133 -0
  235. package/dist/features/runtime/studioApp.d.ts +4 -3
  236. package/dist/features/runtime/studioApp.js +5 -9
  237. package/dist/features/runtime/studioClient.d.ts +2 -4
  238. package/dist/features/runtime/studioClient.js +12 -3
  239. package/dist/features/runtime/studioServer.d.ts +2 -4
  240. package/dist/features/runtime/studioServer.js +6 -1
  241. package/dist/features/runtime/worker.d.ts +6 -0
  242. package/dist/features/runtime/worker.js +23 -0
  243. package/dist/features/runtime/workerRequest.js +44 -0
  244. package/dist/features/studio/CamoxStudio.d.ts +2 -6
  245. package/dist/features/studio/CamoxStudio.js +34 -49
  246. package/dist/features/studio/FollowAgentProvider.js +327 -0
  247. package/dist/features/studio/components/ChatSidebar.js +356 -0
  248. package/dist/features/studio/components/DraftsControl.js +676 -0
  249. package/dist/features/studio/components/FaviconDialog.js +318 -0
  250. package/dist/features/studio/components/LocalePicker.js +785 -0
  251. package/dist/features/studio/components/Navbar.js +123 -103
  252. package/dist/features/studio/components/ProjectMenu.js +239 -260
  253. package/dist/features/studio/components/RenameDraftDialog.js +206 -0
  254. package/dist/features/studio/components/ReviewDraftSheet.js +1472 -0
  255. package/dist/features/studio/components/ThreadComposer.js +157 -0
  256. package/dist/features/studio/components/ThreadMarkdown.js +113 -0
  257. package/dist/features/studio/components/ThreadMessages.js +270 -0
  258. package/dist/features/studio/components/UserButton.js +34 -23
  259. package/dist/features/studio/draftLabel.js +33 -0
  260. package/dist/features/studio/draftNotice.js +13 -0
  261. package/dist/features/studio/followAgent.js +241 -0
  262. package/dist/features/studio/followAgentContext.js +7 -0
  263. package/dist/features/studio/localeOptions.js +118 -0
  264. package/dist/features/studio/localeSwitch.js +19 -0
  265. package/dist/features/studio/routes.js +26 -1
  266. package/dist/features/studio/studioStore.js +64 -1
  267. package/dist/features/studio/useTheme.js +24 -27
  268. package/dist/features/vite/artifactRuntimeMinification.js +36 -0
  269. package/dist/features/vite/blockBoilerplate.js +6 -5
  270. package/dist/features/vite/blockChunks.js +31 -0
  271. package/dist/features/vite/bundlerLogs.js +17 -0
  272. package/dist/features/vite/definitionsSync.js +158 -226
  273. package/dist/features/vite/devAuthentication.js +4 -16
  274. package/dist/features/vite/devSignIn.js +87 -0
  275. package/dist/features/vite/iconGeneration.js +1 -1
  276. package/dist/features/vite/layoutGeneration.js +11 -1
  277. package/dist/features/vite/publishSeededContent.js +30 -0
  278. package/dist/features/vite/routeGeneration.js +6 -7
  279. package/dist/features/vite/runtimeDev.js +80 -99
  280. package/dist/features/vite/vite.d.ts +51 -31
  281. package/dist/features/vite/vite.js +224 -127
  282. package/dist/features/vite/workerBuild.js +39 -0
  283. package/dist/hooks/use-debounced-field.js +116 -47
  284. package/dist/hooks/use-file-upload.js +114 -67
  285. package/dist/hooks/use-marquee-selection.js +32 -36
  286. package/dist/hooks/use-page-destinations.js +69 -37
  287. package/dist/lib/api-client-server.d.ts +5 -0
  288. package/dist/lib/api-client-server.js +10 -4
  289. package/dist/lib/api-client.d.ts +6 -0
  290. package/dist/lib/api-client.js +51 -16
  291. package/dist/lib/api-socket.js +17 -0
  292. package/dist/lib/auth-page-styles.js +39 -0
  293. package/dist/lib/auth.js +129 -61
  294. package/dist/lib/collection-cache.js +23 -0
  295. package/dist/lib/draft-scope.d.ts +4 -0
  296. package/dist/lib/draft-scope.js +222 -0
  297. package/dist/lib/html.js +12 -0
  298. package/dist/lib/link-pages.js +154 -0
  299. package/dist/lib/locale-path.d.ts +22 -0
  300. package/dist/lib/locale-path.js +57 -0
  301. package/dist/lib/normalized-data.js +252 -152
  302. package/dist/lib/preview-handoff.js +2 -2
  303. package/dist/lib/queries.d.ts +11 -0
  304. package/dist/lib/queries.js +70 -141
  305. package/dist/lib/studio-reads.d.ts +14 -0
  306. package/dist/lib/studio-reads.js +554 -0
  307. package/dist/lib/use-project-room.js +50 -50
  308. package/dist/lib/use-thread.js +310 -0
  309. package/dist/lib/utils.js +25 -29
  310. package/dist/lib/view-locale-context.js +22 -0
  311. package/dist/lib/view-locale.js +46 -0
  312. package/dist/package.js +5 -0
  313. package/dist/studio-overlays.css +41 -151
  314. package/dist/studio.css +2 -2
  315. package/package.json +70 -73
  316. package/skills/camox/SKILL.md +16 -11
  317. package/skills/camox/references/artifacts.md +179 -0
  318. package/skills/camox/references/block-definitions.md +75 -59
  319. package/skills/camox/references/cli-common.md +9 -11
  320. package/skills/camox/references/cli-content.md +92 -69
  321. package/skills/camox/references/cli-publishing.md +26 -0
  322. package/skills/camox/references/dom-integrations.md +27 -0
  323. package/skills/camox/references/field-styling.md +4 -4
  324. package/skills/camox/references/layout-definitions.md +16 -14
  325. package/skills/camox/references/localization.md +56 -0
  326. package/skills/camox/references/routed-layouts.md +133 -15
  327. package/skills/camox-expand/SKILL.md +70 -0
  328. package/skills/camox-expand/references/jobs.md +39 -0
  329. package/skills/camoxify/SKILL.md +29 -7
  330. package/dist/core/components/AddBlockControlBar.js +0 -78
  331. package/dist/core/hooks/useRequireDraftSource.js +0 -23
  332. package/dist/features/metadata/sitemap.d.ts +0 -8
  333. package/dist/features/metadata/sitemap.js +0 -17
  334. package/dist/features/og/imageResponse.node.d.ts +0 -12
  335. package/dist/features/og/imageResponse.node.js +0 -49
  336. package/dist/features/og/imageResponse.workerd.d.ts +0 -12
  337. package/dist/features/og/imageResponse.workerd.js +0 -40
  338. package/dist/features/page/PublishedPageContent.js +0 -205
  339. package/dist/features/page/PublishedPageExperience.js +0 -23
  340. package/dist/features/preview/DerivedPreview.js +0 -134
  341. package/dist/features/preview/commentsEnabled.js +0 -8
  342. package/dist/features/preview/components/AddBlockSidebar.js +0 -381
  343. package/dist/features/preview/components/AttachedComments.js +0 -331
  344. package/dist/features/preview/components/CommentHeader.js +0 -122
  345. package/dist/features/preview/components/CommentSidebar.js +0 -29
  346. package/dist/features/preview/components/CommentTargetQuote.js +0 -167
  347. package/dist/features/preview/components/DerivedLayoutSidebar.d.ts +0 -5
  348. package/dist/features/preview/components/DerivedLayoutSidebar.js +0 -179
  349. package/dist/features/preview/components/DerivedPageInfoSidebar.js +0 -69
  350. package/dist/features/preview/components/LeftSidebar.js +0 -68
  351. package/dist/features/preview/components/PageEditorSidebar.js +0 -563
  352. package/dist/features/preview/components/PageInfoSidebar.js +0 -1551
  353. package/dist/features/preview/components/PageNavigatorSidebar.js +0 -78
  354. package/dist/features/preview/components/PageStatusBadge.js +0 -97
  355. package/dist/features/preview/components/PeekedBlock.js +0 -217
  356. package/dist/features/preview/components/PreviewComments.js +0 -56
  357. package/dist/features/preview/components/PreviewToolbarSpacer.js +0 -43
  358. package/dist/features/preview/components/PublicationRow.js +0 -422
  359. package/dist/features/preview/components/PublishDialog.js +0 -194
  360. package/dist/features/preview/components/RightSidebar.js +0 -59
  361. package/dist/features/preview/components/SendFeedbackDialog.js +0 -83
  362. package/dist/features/preview/previewCommentsStore.js +0 -135
  363. package/dist/features/preview/publication.js +0 -81
  364. package/dist/features/preview/usePageComments.js +0 -39
  365. package/dist/features/runtime/SharedChromeContext.js +0 -7
  366. package/dist/features/studio/components/EnvironmentMenu.js +0 -425
  367. package/dist/features/vite/appGeneration.js +0 -89
  368. package/dist/lib/view-queries.js +0 -28
  369. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/Matches.d.ts +0 -114
  370. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/RouterProvider.d.ts +0 -25
  371. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/config.d.ts +0 -1
  372. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/defer.d.ts +0 -1
  373. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/fileRoute.d.ts +0 -20
  374. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/global.d.ts +0 -8
  375. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/hash-scroll.d.ts +0 -1
  376. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/index.d.ts +0 -18
  377. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/link.d.ts +0 -161
  378. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/load-matches.d.ts +0 -6
  379. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/location.d.ts +0 -54
  380. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/lru-cache.d.ts +0 -8
  381. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/manifest.d.ts +0 -32
  382. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.d.ts +0 -115
  383. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/not-found.d.ts +0 -1
  384. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/redirect.d.ts +0 -49
  385. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/rewrite.d.ts +0 -1
  386. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/root.d.ts +0 -6
  387. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/route.d.ts +0 -343
  388. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/routeInfo.d.ts +0 -48
  389. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/router.d.ts +0 -695
  390. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/scroll-restoration.d.ts +0 -1
  391. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/searchMiddleware.d.ts +0 -1
  392. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/searchParams.d.ts +0 -5
  393. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/RawStream.d.ts +0 -38
  394. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/seroval-plugins.d.ts +0 -1
  395. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/transformer.d.ts +0 -65
  396. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/stores.d.ts +0 -69
  397. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/structuralSharing.d.ts +0 -1
  398. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/typePrimitives.d.ts +0 -1
  399. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useLoaderData.d.ts +0 -1
  400. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useLoaderDeps.d.ts +0 -1
  401. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useNavigate.d.ts +0 -10
  402. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useParams.d.ts +0 -1
  403. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useRouteContext.d.ts +0 -1
  404. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useSearch.d.ts +0 -1
  405. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/utils.d.ts +0 -28
  406. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/validators.d.ts +0 -49
  407. package/skills/camox/references/cli-environments.md +0 -37
@@ -1,30 +1,38 @@
1
- import { useLocation, useNavigate } from "../navigation/navigation.js";
2
1
  import { actionsStore } from "../provider/actionsStore.js";
3
- import { useIsAuthenticated, useProjectSlug } from "../../lib/auth.js";
4
- import { getApiClient } from "../../lib/api-client.js";
5
- import { NormalizedDataProvider, seedBlockCaches, usePageBlocks } from "../../lib/normalized-data.js";
6
- import { BlockErrorBoundary } from "./components/BlockErrorBoundary.js";
2
+ import { useIsAuthenticated, useProjectUuid } from "../../lib/auth.js";
3
+ import { parseLocalePath } from "../../lib/locale-path.js";
4
+ import { useCurrentDraftId, withoutDraft } from "../../lib/draft-scope.js";
5
+ import { useViewLocale } from "../../lib/view-locale-context.js";
6
+ import { useLocation, useNavigate } from "../navigation/navigation.js";
7
7
  import { useCamoxApp } from "../provider/components/CamoxAppContext.js";
8
- import { blockQueries } from "../../lib/queries.js";
9
- import { usePageDestinations } from "../../hooks/use-page-destinations.js";
8
+ import { NormalizedDataProvider, usePageBlocks } from "../../lib/normalized-data.js";
9
+ import { reads, useRead, useStudioCache } from "../../lib/studio-reads.js";
10
+ import { BlockErrorBoundary } from "./components/BlockErrorBoundary.js";
11
+ import { CollectionItemSheetProvider } from "../content/CollectionItemSheetContext.js";
10
12
  import { cn } from "../../lib/utils.js";
11
- import { SharedChromeContext } from "../runtime/SharedChromeContext.js";
12
- import { areCommentsEnabled } from "./commentsEnabled.js";
13
- import { previewStore, selectIsCommentMode, selectIsEditMode, selectPreviewSource } from "./previewStore.js";
14
- import { Navbar } from "../studio/components/Navbar.js";
13
+ import { ContentCollectionItemSheet } from "../content/ContentCollection.js";
14
+ import { usePageDestinations } from "../../hooks/use-page-destinations.js";
15
+ import { useLocalePath, useLocalizedPath } from "../../lib/view-locale.js";
16
+ import { canvasStore } from "../canvas/canvasStore.js";
17
+ import { SHOW_WHOLE_CANVAS_SHORTCUT, TOGGLE_CANVAS_SHORTCUT } from "./previewConstants.js";
18
+ import { CanvasSidebarSkeleton } from "../canvas/sidebar/CanvasSidebarSkeleton.js";
19
+ import { DerivedPageContent } from "../page/DerivedPageContent.js";
20
+ import { STUDIO_CANVAS_PATH } from "../studio/routes.js";
21
+ import { studioStore } from "../studio/studioStore.js";
22
+ import { previewStore, selectIsCanvasShown } from "./previewStore.js";
23
+ import { AddBlockSheet } from "./components/AddBlockSheet.js";
24
+ import { CanvasPreview, prefetchCanvas } from "./components/CanvasPreview.js";
15
25
  import { CreatePageModal } from "./components/CreatePageModal.js";
16
- import { EDIT_MODE_SHORTCUT } from "./previewConstants.js";
17
- import { LeftSidebar } from "./components/LeftSidebar.js";
18
- import { PeekedBlock } from "./components/PeekedBlock.js";
26
+ import { PreviewEditingOwnerContext } from "./previewSelection.js";
27
+ import { PageRecordContext, getPageRecord, useDerivedPageResult, useFollowPageRecord } from "./pageRecord.js";
19
28
  import { PreviewPanel } from "./components/PreviewPanel.js";
20
- import { PreviewToolbarSpacer } from "./components/PreviewToolbarSpacer.js";
21
- import { RightSidebar } from "./components/RightSidebar.js";
29
+ import { RemovedBlockPlaceholder } from "./components/RemovedBlockPlaceholder.js";
30
+ import { usePreviewViewportActions } from "./usePreviewViewportActions.js";
22
31
  import { c } from "react/compiler-runtime";
23
- import { useQueryClient, useSuspenseQuery } from "@tanstack/react-query";
24
32
  import * as React from "react";
25
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
26
33
  import { useSelector } from "@xstate/store-react";
27
- import { queryKeys } from "@camox/api-contract/query-keys";
34
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
35
+ import { useQueryClient } from "@tanstack/react-query";
28
36
 
29
37
  //#region src/features/preview/CamoxPreview.tsx
30
38
  const MOBILE_STUDIO_QUERY = "(max-width: 767px)";
@@ -37,422 +45,679 @@ function getMobileStudioSnapshot() {
37
45
  return window.matchMedia(MOBILE_STUDIO_QUERY).matches;
38
46
  }
39
47
  function useIsMobileStudio() {
40
- const $ = c(1);
41
- if ($[0] !== "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c") {
42
- for (let $i = 0; $i < 1; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
43
- $[0] = "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c";
44
- }
45
48
  return React.useSyncExternalStore(subscribeToMobileStudio, getMobileStudioSnapshot, _temp);
46
49
  }
47
- /**
48
- * Fetches the current page being previewed, with live updates for authenticated users.
49
- *
50
- * Data for the current route is guaranteed in queryClient cache from the loader's
51
- * ensureQueryData. Live updates are gated by useProjectRoom only running in
52
- * AuthenticatedCamoxProvider — unauthenticated users get SSR data that never refetches.
53
- */
54
- /**
55
- * Lightweight queryFn for client-side refetches — only fetches structural data.
56
- * Used after initial SSR load when block caches are already populated.
57
- *
58
- * Source is threaded from the studio's source select (previewStore). Each
59
- * source has its own cache slot, so toggling Draft↔Live is instant once both
60
- * have been seeded. Public visitors never invalidate (no project room) so
61
- * this query function doesn't run for them — they stay on the SSR-seeded
62
- * 'live' data.
63
- */
64
50
  function _temp() {
65
51
  return false;
66
52
  }
67
- function pageStructureQueryFn(path, projectSlug, source) {
68
- return () => getApiClient().pages.getStructure({
69
- path,
70
- projectSlug,
71
- source
72
- });
73
- }
53
+ /** The page the Preview shows: as the server rendered it, then following edits. */
74
54
  function usePreviewedPage() {
75
- const $ = c(11);
76
- if ($[0] !== "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c") {
77
- for (let $i = 0; $i < 11; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
78
- $[0] = "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c";
79
- }
80
- const { pathname } = useLocation();
81
- const projectSlug = useProjectSlug();
82
- const previewSource = useSelector(previewStore, selectPreviewSource);
55
+ const $ = c(3);
56
+ const pathname = useLocalePath();
57
+ const projectUuid = useProjectUuid();
83
58
  let t0;
84
- if ($[1] !== pathname || $[2] !== previewSource) {
85
- t0 = queryKeys.pages.getByPath(pathname, previewSource);
86
- $[1] = pathname;
87
- $[2] = previewSource;
88
- $[3] = t0;
89
- } else t0 = $[3];
90
- let t1;
91
- if ($[4] !== pathname || $[5] !== previewSource || $[6] !== projectSlug) {
92
- t1 = pageStructureQueryFn(pathname, projectSlug, previewSource);
93
- $[4] = pathname;
94
- $[5] = previewSource;
95
- $[6] = projectSlug;
96
- $[7] = t1;
97
- } else t1 = $[7];
98
- let t2;
99
- if ($[8] !== t0 || $[9] !== t1) {
100
- t2 = {
101
- queryKey: t0,
102
- queryFn: t1,
103
- staleTime: Infinity
104
- };
105
- $[8] = t0;
106
- $[9] = t1;
107
- $[10] = t2;
108
- } else t2 = $[10];
109
- const { data: currentPage } = useSuspenseQuery(t2);
110
- return currentPage;
59
+ if ($[0] !== pathname || $[1] !== projectUuid) {
60
+ t0 = reads.pageStructure({
61
+ path: pathname,
62
+ projectUuid
63
+ });
64
+ $[0] = pathname;
65
+ $[1] = projectUuid;
66
+ $[2] = t0;
67
+ } else t0 = $[2];
68
+ return useRead(t0);
111
69
  }
112
70
  const BlockRenderer = (t0) => {
113
- const $ = c(23);
114
- if ($[0] !== "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c") {
115
- for (let $i = 0; $i < 23; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
116
- $[0] = "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c";
117
- }
71
+ const $ = c(28);
118
72
  const { blockId, mode, showAddBlockTop, showAddBlockBottom } = t0;
119
- const previewSource = useSelector(previewStore, selectPreviewSource);
120
73
  let t1;
121
- if ($[1] !== blockId || $[2] !== previewSource) {
122
- t1 = blockQueries.get(blockId, previewSource);
123
- $[1] = blockId;
124
- $[2] = previewSource;
125
- $[3] = t1;
126
- } else t1 = $[3];
127
- const { data } = useSuspenseQuery(t1);
74
+ if ($[0] !== blockId) {
75
+ t1 = reads.blockBundle(blockId);
76
+ $[0] = blockId;
77
+ $[1] = t1;
78
+ } else t1 = $[1];
79
+ const data = useRead(t1);
128
80
  const camoxApp = useCamoxApp();
129
81
  let t2;
130
- if ($[4] !== camoxApp || $[5] !== data.block.type) {
82
+ if ($[2] !== camoxApp || $[3] !== data.block.type) {
131
83
  t2 = camoxApp.getBlockById(data.block.type);
132
- $[4] = camoxApp;
133
- $[5] = data.block.type;
134
- $[6] = t2;
135
- } else t2 = $[6];
84
+ $[2] = camoxApp;
85
+ $[3] = data.block.type;
86
+ $[4] = t2;
87
+ } else t2 = $[4];
136
88
  const blockDef = t2;
137
- if (!blockDef) return null;
89
+ if (!blockDef) {
90
+ let t3;
91
+ if ($[5] !== blockId || $[6] !== data.block.type || $[7] !== mode) {
92
+ t3 = /* @__PURE__ */ jsx(RemovedBlockPlaceholder, {
93
+ blockId,
94
+ type: data.block.type,
95
+ mode
96
+ });
97
+ $[5] = blockId;
98
+ $[6] = data.block.type;
99
+ $[7] = mode;
100
+ $[8] = t3;
101
+ } else t3 = $[8];
102
+ return t3;
103
+ }
138
104
  const t3 = data.files;
139
105
  const t4 = data.repeatableItems;
106
+ let t5;
107
+ if ($[9] !== data.block) {
108
+ t5 = [data.block];
109
+ $[9] = data.block;
110
+ $[10] = t5;
111
+ } else t5 = $[10];
140
112
  const T0 = blockDef._internal.Component;
141
- const t5 = data.block.id;
142
- const t6 = data.block.type;
143
- const t7 = data.block.content;
144
- const t8 = data.block.settings;
145
- const t9 = String(data.block.position);
146
- let t10;
147
- if ($[7] !== data.block.id || $[8] !== data.block.type || $[9] !== t7 || $[10] !== t8 || $[11] !== t9) {
148
- t10 = {
149
- _id: t5,
150
- type: t6,
151
- content: t7,
152
- settings: t8,
153
- position: t9
154
- };
155
- $[7] = data.block.id;
156
- $[8] = data.block.type;
157
- $[9] = t7;
158
- $[10] = t8;
159
- $[11] = t9;
160
- $[12] = t10;
161
- } else t10 = $[12];
113
+ const t6 = data.block.id;
114
+ const t7 = data.block.type;
115
+ const t8 = data.block.content;
116
+ const t9 = data.block.settings;
117
+ const t10 = String(data.block.position);
162
118
  let t11;
163
- if ($[13] !== blockDef._internal.Component || $[14] !== mode || $[15] !== showAddBlockBottom || $[16] !== showAddBlockTop || $[17] !== t10) {
164
- t11 = /* @__PURE__ */ jsx(T0, {
165
- blockData: t10,
119
+ if ($[11] !== data.block.id || $[12] !== data.block.type || $[13] !== t10 || $[14] !== t8 || $[15] !== t9) {
120
+ t11 = {
121
+ _id: t6,
122
+ type: t7,
123
+ content: t8,
124
+ settings: t9,
125
+ position: t10
126
+ };
127
+ $[11] = data.block.id;
128
+ $[12] = data.block.type;
129
+ $[13] = t10;
130
+ $[14] = t8;
131
+ $[15] = t9;
132
+ $[16] = t11;
133
+ } else t11 = $[16];
134
+ let t12;
135
+ if ($[17] !== blockDef._internal.Component || $[18] !== mode || $[19] !== showAddBlockBottom || $[20] !== showAddBlockTop || $[21] !== t11) {
136
+ t12 = /* @__PURE__ */ jsx(T0, {
137
+ blockData: t11,
166
138
  mode,
167
139
  showAddBlockTop,
168
140
  showAddBlockBottom
169
141
  });
170
- $[13] = blockDef._internal.Component;
171
- $[14] = mode;
172
- $[15] = showAddBlockBottom;
173
- $[16] = showAddBlockTop;
174
- $[17] = t10;
175
- $[18] = t11;
176
- } else t11 = $[18];
177
- let t12;
178
- if ($[19] !== data.files || $[20] !== data.repeatableItems || $[21] !== t11) {
179
- t12 = /* @__PURE__ */ jsx(NormalizedDataProvider, {
180
- files: t3,
181
- repeatableItems: t4,
182
- children: t11
183
- });
184
- $[19] = data.files;
185
- $[20] = data.repeatableItems;
142
+ $[17] = blockDef._internal.Component;
143
+ $[18] = mode;
144
+ $[19] = showAddBlockBottom;
145
+ $[20] = showAddBlockTop;
186
146
  $[21] = t11;
187
147
  $[22] = t12;
188
148
  } else t12 = $[22];
189
- return t12;
149
+ let t13;
150
+ if ($[23] !== data.files || $[24] !== data.repeatableItems || $[25] !== t12 || $[26] !== t5) {
151
+ t13 = /* @__PURE__ */ jsx(NormalizedDataProvider, {
152
+ files: t3,
153
+ repeatableItems: t4,
154
+ blocks: t5,
155
+ children: t12
156
+ });
157
+ $[23] = data.files;
158
+ $[24] = data.repeatableItems;
159
+ $[25] = t12;
160
+ $[26] = t5;
161
+ $[27] = t13;
162
+ } else t13 = $[27];
163
+ return t13;
190
164
  };
191
165
  const PageContent = () => {
166
+ const $ = c(30);
192
167
  const pageData = usePreviewedPage();
193
- const { pageBlocks, beforeBlocks, afterBlocks, layoutFiles, layoutItems } = usePageBlocks(pageData, useSelector(previewStore, selectPreviewSource));
194
- const peekedBlockPosition = useSelector(previewStore, (state) => state.context.peekedBlockPosition);
195
- const displayedPositionRef = React.useRef(null);
196
- if (peekedBlockPosition !== null) displayedPositionRef.current = peekedBlockPosition;
197
- const effectivePosition = peekedBlockPosition ?? displayedPositionRef.current;
198
- const onExitComplete = React.useCallback(() => {
199
- displayedPositionRef.current = null;
200
- }, []);
168
+ const { pageBlocks, beforeBlocks, afterBlocks, layoutFiles, layoutItems } = usePageBlocks(pageData);
201
169
  const camoxApp = useCamoxApp();
202
- const peekedBlockIndex = React.useMemo(() => {
203
- if (effectivePosition === "") return 0;
204
- if (effectivePosition === null) return pageBlocks.length;
205
- const afterBlockIndex = pageBlocks.findIndex((block) => String(block.position) === effectivePosition);
206
- if (afterBlockIndex === -1) return pageBlocks.length;
207
- return afterBlockIndex + 1;
208
- }, [pageBlocks, effectivePosition]);
209
- const layout = pageData.layout ? camoxApp.getLayoutById(pageData.layout.layoutId) : void 0;
210
- const layoutBlocksMap = React.useMemo(() => {
211
- if (!pageData.layout) return null;
212
- const allLayoutBlocks = [...beforeBlocks, ...afterBlocks];
213
- const blocks = {};
214
- for (const block_0 of allLayoutBlocks) blocks[block_0.type] = {
215
- _id: block_0.id,
216
- type: block_0.type,
217
- content: block_0.content,
218
- settings: block_0.settings,
219
- position: String(block_0.position)
220
- };
221
- return blocks;
222
- }, [
223
- pageData.layout,
224
- beforeBlocks,
225
- afterBlocks
226
- ]);
227
- const pageBlocksContent = /* @__PURE__ */ jsxs(Fragment, { children: [
228
- peekedBlockIndex === 0 && pageBlocks.length > 0 && /* @__PURE__ */ jsx(PeekedBlock, { onExitComplete }),
229
- pageBlocks.map((blockData, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsx(BlockErrorBoundary, {
170
+ let layout;
171
+ let layoutBlocksMap;
172
+ let t0;
173
+ if ($[0] !== afterBlocks || $[1] !== beforeBlocks || $[2] !== camoxApp || $[3] !== pageBlocks || $[4] !== pageData) {
174
+ layout = pageData.layout ? camoxApp.getLayoutById(pageData.layout.layoutId) : void 0;
175
+ let t1;
176
+ bb0: {
177
+ if (!pageData.layout) {
178
+ t1 = null;
179
+ break bb0;
180
+ }
181
+ let blocks;
182
+ if ($[8] !== afterBlocks || $[9] !== beforeBlocks) {
183
+ const allLayoutBlocks = [...beforeBlocks, ...afterBlocks];
184
+ blocks = {};
185
+ for (const block of allLayoutBlocks) blocks[block.type] = {
186
+ _id: block.id,
187
+ type: block.type,
188
+ content: block.content,
189
+ settings: block.settings,
190
+ position: String(block.position)
191
+ };
192
+ $[8] = afterBlocks;
193
+ $[9] = beforeBlocks;
194
+ $[10] = blocks;
195
+ } else blocks = $[10];
196
+ t1 = blocks;
197
+ }
198
+ layoutBlocksMap = t1;
199
+ t0 = pageBlocks.map((blockData, index) => /* @__PURE__ */ jsx(BlockErrorBoundary, {
230
200
  blockId: blockData.id,
231
201
  blockType: blockData.type,
232
202
  children: /* @__PURE__ */ jsx(BlockRenderer, {
233
203
  blockId: blockData.id,
234
204
  mode: "site",
235
- showAddBlockTop: index === 0 ? layout?._internal.blockDefinitions.some((b) => b.placement === "before") ?? false : true,
205
+ showAddBlockTop: index === 0 ? layout?._internal.blockDefinitions.some(_temp2) ?? false : true,
236
206
  showAddBlockBottom: true
237
207
  })
238
- }), index === peekedBlockIndex - 1 && /* @__PURE__ */ jsx(PeekedBlock, { onExitComplete })] }, blockData.id)),
239
- pageBlocks.length === 0 && /* @__PURE__ */ jsx(PeekedBlock, { onExitComplete })
240
- ] });
208
+ }, blockData.id));
209
+ $[0] = afterBlocks;
210
+ $[1] = beforeBlocks;
211
+ $[2] = camoxApp;
212
+ $[3] = pageBlocks;
213
+ $[4] = pageData;
214
+ $[5] = layout;
215
+ $[6] = layoutBlocksMap;
216
+ $[7] = t0;
217
+ } else {
218
+ layout = $[5];
219
+ layoutBlocksMap = $[6];
220
+ t0 = $[7];
221
+ }
222
+ let t1;
223
+ if ($[11] !== t0) {
224
+ t1 = /* @__PURE__ */ jsx(Fragment, { children: t0 });
225
+ $[11] = t0;
226
+ $[12] = t1;
227
+ } else t1 = $[12];
228
+ const pageBlocksContent = t1;
241
229
  if (layout && layoutBlocksMap) {
242
230
  const LayoutComponent = layout._internal.component;
243
- return /* @__PURE__ */ jsx(NormalizedDataProvider, {
244
- files: layoutFiles,
245
- repeatableItems: layoutItems,
246
- children: /* @__PURE__ */ jsx(layout._internal.Provider, {
231
+ let t2;
232
+ if ($[13] !== afterBlocks || $[14] !== beforeBlocks) {
233
+ t2 = [...beforeBlocks, ...afterBlocks];
234
+ $[13] = afterBlocks;
235
+ $[14] = beforeBlocks;
236
+ $[15] = t2;
237
+ } else t2 = $[15];
238
+ let t3;
239
+ if ($[16] !== LayoutComponent || $[17] !== pageBlocksContent) {
240
+ t3 = /* @__PURE__ */ jsx(LayoutComponent, { children: pageBlocksContent });
241
+ $[16] = LayoutComponent;
242
+ $[17] = pageBlocksContent;
243
+ $[18] = t3;
244
+ } else t3 = $[18];
245
+ let t4;
246
+ if ($[19] !== layout._internal.Provider || $[20] !== layoutBlocksMap || $[21] !== t3) {
247
+ t4 = /* @__PURE__ */ jsx(layout._internal.Provider, {
247
248
  layoutBlocks: layoutBlocksMap,
248
- children: /* @__PURE__ */ jsx(LayoutComponent, { children: pageBlocksContent })
249
- })
250
- });
249
+ children: t3
250
+ });
251
+ $[19] = layout._internal.Provider;
252
+ $[20] = layoutBlocksMap;
253
+ $[21] = t3;
254
+ $[22] = t4;
255
+ } else t4 = $[22];
256
+ let t5;
257
+ if ($[23] !== layoutFiles || $[24] !== layoutItems || $[25] !== t2 || $[26] !== t4) {
258
+ t5 = /* @__PURE__ */ jsx(NormalizedDataProvider, {
259
+ files: layoutFiles,
260
+ repeatableItems: layoutItems,
261
+ blocks: t2,
262
+ children: t4
263
+ });
264
+ $[23] = layoutFiles;
265
+ $[24] = layoutItems;
266
+ $[25] = t2;
267
+ $[26] = t4;
268
+ $[27] = t5;
269
+ } else t5 = $[27];
270
+ return t5;
251
271
  }
252
- return /* @__PURE__ */ jsx("main", {
253
- className: "flex min-h-screen flex-col",
254
- children: pageBlocksContent
255
- });
272
+ let t2;
273
+ if ($[28] !== pageBlocksContent) {
274
+ t2 = /* @__PURE__ */ jsx("main", {
275
+ className: "flex min-h-screen flex-col",
276
+ children: pageBlocksContent
277
+ });
278
+ $[28] = pageBlocksContent;
279
+ $[29] = t2;
280
+ } else t2 = $[29];
281
+ return t2;
256
282
  };
257
- function useHydrateDraftCache() {
258
- const $ = c(7);
259
- if ($[0] !== "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c") {
260
- for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
261
- $[0] = "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c";
262
- }
283
+ /**
284
+ * The read of the page the Preview shows: a curated page's structure, or a layout page's layout. A
285
+ * Canvas-only location, opened first, has no page to show.
286
+ */
287
+ function pageRead(projectUuid, pathname, derived) {
288
+ if (pathname === void 0) return null;
289
+ if (derived) return reads.layoutStructure({
290
+ projectUuid,
291
+ layoutId: derived.layoutId
292
+ });
293
+ return reads.pageStructure({
294
+ path: pathname,
295
+ projectUuid
296
+ });
297
+ }
298
+ function useRefreshMemberRead(read) {
299
+ const $ = c(13);
263
300
  const isAuthenticated = useIsAuthenticated();
264
- const queryClient = useQueryClient();
265
- const projectSlug = useProjectSlug();
266
- const { pathname } = useLocation();
301
+ const studioCache = useStudioCache();
302
+ const draftId = useCurrentDraftId();
303
+ let t0;
304
+ if ($[0] !== draftId || $[1] !== read || $[2] !== studioCache) {
305
+ t0 = read ? JSON.stringify(studioCache.options(read, { in: draftId }).queryKey) : null;
306
+ $[0] = draftId;
307
+ $[1] = read;
308
+ $[2] = studioCache;
309
+ $[3] = t0;
310
+ } else t0 = $[3];
311
+ const identity = t0;
312
+ let t1;
313
+ if ($[4] !== isAuthenticated || $[5] !== read || $[6] !== studioCache) {
314
+ t1 = () => {
315
+ if (!isAuthenticated || !read) return;
316
+ studioCache.reload(read).catch(_temp3);
317
+ };
318
+ $[4] = isAuthenticated;
319
+ $[5] = read;
320
+ $[6] = studioCache;
321
+ $[7] = t1;
322
+ } else t1 = $[7];
323
+ const reload = React.useEffectEvent(t1);
324
+ let t2;
325
+ if ($[8] !== reload) {
326
+ t2 = () => reload();
327
+ $[8] = reload;
328
+ $[9] = t2;
329
+ } else t2 = $[9];
330
+ let t3;
331
+ if ($[10] !== identity || $[11] !== isAuthenticated) {
332
+ t3 = [identity, isAuthenticated];
333
+ $[10] = identity;
334
+ $[11] = isAuthenticated;
335
+ $[12] = t3;
336
+ } else t3 = $[12];
337
+ React.useEffect(t2, t3);
338
+ }
339
+ function _temp3() {}
340
+ /**
341
+ * The page the Preview shows: the current one, or on a Canvas-only location,
342
+ * which has none, the last one. The Canvas keeps showing that page in its slot
343
+ * when nothing is selected, so it stays mounted rather than flash as it remounts.
344
+ */
345
+ function useShownPage(location, derived, canvasOnly) {
346
+ const $ = c(3);
347
+ const [last, setLast] = React.useState(null);
348
+ if (canvasOnly) return last;
349
+ if (!!last && last.location.href === location.href && last.location.pathname === location.pathname && last.derived === derived) return last;
350
+ let t0;
351
+ if ($[0] !== derived || $[1] !== location) {
352
+ t0 = {
353
+ location,
354
+ derived
355
+ };
356
+ $[0] = derived;
357
+ $[1] = location;
358
+ $[2] = t0;
359
+ } else t0 = $[2];
360
+ const current = t0;
361
+ setLast(current);
362
+ return current;
363
+ }
364
+ /** Remembers where the Website Section is, so that going back to it from the Studio lands there. */
365
+ function useRememberWebsiteLocation(location) {
366
+ const $ = c(5);
367
+ const { locale, locales } = useViewLocale();
267
368
  let t0;
268
369
  let t1;
269
- if ($[1] !== isAuthenticated || $[2] !== pathname || $[3] !== projectSlug || $[4] !== queryClient) {
370
+ if ($[0] !== locale.tag || $[1] !== locales || $[2] !== location) {
270
371
  t0 = () => {
271
- if (!isAuthenticated) return;
272
- let cancelled = false;
273
- getApiClient().pages.getByPath({
274
- path: pathname,
275
- projectSlug,
276
- source: "draft"
277
- }).then((data) => {
278
- if (cancelled) return;
279
- seedBlockCaches(queryClient, data, "draft");
280
- queryClient.setQueryData(queryKeys.pages.getByPath(pathname, "draft"), {
281
- page: data.page,
282
- layout: data.layout,
283
- projectName: data.projectName,
284
- project: data.project
285
- });
286
- }).catch(_temp2);
287
- return () => {
288
- cancelled = true;
289
- };
372
+ const { pathname, search, hash } = location;
373
+ const url = new URL(withoutDraft(new URL(`${pathname}${search}`, "http://camox.local").href));
374
+ studioStore.send({
375
+ type: "rememberWebsiteLocation",
376
+ location: {
377
+ locale: locale.tag,
378
+ path: parseLocalePath(pathname, locales).path,
379
+ search: url.search,
380
+ hash
381
+ }
382
+ });
290
383
  };
291
384
  t1 = [
292
- isAuthenticated,
293
- pathname,
294
- projectSlug,
295
- queryClient
385
+ location,
386
+ locale.tag,
387
+ locales
296
388
  ];
297
- $[1] = isAuthenticated;
298
- $[2] = pathname;
299
- $[3] = projectSlug;
300
- $[4] = queryClient;
301
- $[5] = t0;
302
- $[6] = t1;
389
+ $[0] = locale.tag;
390
+ $[1] = locales;
391
+ $[2] = location;
392
+ $[3] = t0;
393
+ $[4] = t1;
303
394
  } else {
304
- t0 = $[5];
305
- t1 = $[6];
395
+ t0 = $[3];
396
+ t1 = $[4];
306
397
  }
307
398
  React.useEffect(t0, t1);
308
399
  }
309
- function _temp2() {}
310
400
  const CamoxPreview = (t0) => {
311
- const $ = c(4);
312
- if ($[0] !== "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c") {
313
- for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
314
- $[0] = "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c";
315
- }
316
- const { children } = t0;
317
- const pageData = usePreviewedPage();
318
- useHydrateDraftCache();
401
+ const $ = c(36);
402
+ const { children, runtimeBasePath, derived, canvasOnly } = t0;
403
+ const camoxApp = useCamoxApp();
404
+ const location = useLocation();
405
+ useRememberWebsiteLocation(location);
406
+ const shown = useShownPage(location, derived, !!canvasOnly);
407
+ const pathname = shown?.location.pathname;
408
+ const shownDerived = shown?.derived;
409
+ const projectUuid = useProjectUuid();
410
+ const { locales } = useViewLocale();
319
411
  let t1;
320
- if ($[1] !== children || $[2] !== pageData) {
321
- t1 = /* @__PURE__ */ jsx(PreviewShell, {
412
+ if ($[0] !== locales || $[1] !== pathname || $[2] !== projectUuid || $[3] !== shownDerived) {
413
+ t1 = pageRead(projectUuid, pathname === void 0 ? void 0 : parseLocalePath(pathname, locales).path, shownDerived);
414
+ $[0] = locales;
415
+ $[1] = pathname;
416
+ $[2] = projectUuid;
417
+ $[3] = shownDerived;
418
+ $[4] = t1;
419
+ } else t1 = $[4];
420
+ const shownRead = t1;
421
+ const data = useRead(shownRead);
422
+ useRefreshMemberRead(shownRead);
423
+ const t2 = runtimeBasePath ?? "";
424
+ const t3 = pathname ?? location.pathname;
425
+ let t4;
426
+ if ($[5] !== shownDerived) {
427
+ t4 = shownDerived ? { result: shownDerived.result } : void 0;
428
+ $[5] = shownDerived;
429
+ $[6] = t4;
430
+ } else t4 = $[6];
431
+ let t5;
432
+ if ($[7] !== projectUuid || $[8] !== t2 || $[9] !== t3 || $[10] !== t4) {
433
+ t5 = {
434
+ projectUuid,
435
+ runtimeBasePath: t2,
436
+ pathname: t3,
437
+ loaded: t4
438
+ };
439
+ $[7] = projectUuid;
440
+ $[8] = t2;
441
+ $[9] = t3;
442
+ $[10] = t4;
443
+ $[11] = t5;
444
+ } else t5 = $[11];
445
+ const derivedResult = useDerivedPageResult(t5);
446
+ let t6;
447
+ if ($[12] !== derivedResult) {
448
+ t6 = getPageRecord(derivedResult);
449
+ $[12] = derivedResult;
450
+ $[13] = t6;
451
+ } else t6 = $[13];
452
+ const pageRecord = t6;
453
+ const t7 = runtimeBasePath ?? "";
454
+ const t8 = shownDerived?.layoutId;
455
+ let t9;
456
+ if ($[14] !== pageRecord || $[15] !== projectUuid || $[16] !== t7 || $[17] !== t8) {
457
+ t9 = {
458
+ projectUuid,
459
+ runtimeBasePath: t7,
460
+ layoutId: t8,
461
+ record: pageRecord
462
+ };
463
+ $[14] = pageRecord;
464
+ $[15] = projectUuid;
465
+ $[16] = t7;
466
+ $[17] = t8;
467
+ $[18] = t9;
468
+ } else t9 = $[18];
469
+ useFollowPageRecord(t9);
470
+ const pageData = data && "page" in data ? data : void 0;
471
+ const layout = data && !("page" in data) ? data : void 0;
472
+ const t10 = shown?.location;
473
+ let t11;
474
+ if ($[19] !== camoxApp || $[20] !== children || $[21] !== derivedResult || $[22] !== layout || $[23] !== shown || $[24] !== shownDerived) {
475
+ t11 = shownDerived && layout ? /* @__PURE__ */ jsx(DerivedPageContent, {
476
+ camoxApp,
477
+ derived: {
478
+ ...shownDerived,
479
+ layout,
480
+ result: derivedResult
481
+ }
482
+ }) : shown ? children : null;
483
+ $[19] = camoxApp;
484
+ $[20] = children;
485
+ $[21] = derivedResult;
486
+ $[22] = layout;
487
+ $[23] = shown;
488
+ $[24] = shownDerived;
489
+ $[25] = t11;
490
+ } else t11 = $[25];
491
+ let t12;
492
+ if ($[26] !== canvasOnly || $[27] !== layout || $[28] !== pageData || $[29] !== runtimeBasePath || $[30] !== t10 || $[31] !== t11) {
493
+ t12 = /* @__PURE__ */ jsx(PreviewShell, {
322
494
  pageData,
323
- children
495
+ derivedLayout: layout,
496
+ pageLocation: t10,
497
+ canvasOnly,
498
+ runtimeBasePath,
499
+ children: t11
500
+ });
501
+ $[26] = canvasOnly;
502
+ $[27] = layout;
503
+ $[28] = pageData;
504
+ $[29] = runtimeBasePath;
505
+ $[30] = t10;
506
+ $[31] = t11;
507
+ $[32] = t12;
508
+ } else t12 = $[32];
509
+ let t13;
510
+ if ($[33] !== derivedResult || $[34] !== t12) {
511
+ t13 = /* @__PURE__ */ jsx(PageRecordContext, {
512
+ value: derivedResult,
513
+ children: t12
324
514
  });
325
- $[1] = children;
326
- $[2] = pageData;
327
- $[3] = t1;
328
- } else t1 = $[3];
329
- return t1;
515
+ $[33] = derivedResult;
516
+ $[34] = t12;
517
+ $[35] = t13;
518
+ } else t13 = $[35];
519
+ return t13;
330
520
  };
521
+ /**
522
+ * A Canvas-only location only exists on the Canvas. Opening one
523
+ * shows the Canvas, while hiding the Canvas, or a Studio without the Canvas,
524
+ * goes back to the last page shown, or home without one, so Preview always shows a real Page.
525
+ */
526
+ function useCanvasOnlyLocation(canvasOnly, isCanvasShown, isMobileStudio, lastPage) {
527
+ const $ = c(10);
528
+ const navigate = useNavigate();
529
+ const wasCanvasShown = React.useRef(isCanvasShown);
530
+ const localized = useLocalizedPath();
531
+ let t0;
532
+ if ($[0] !== lastPage || $[1] !== localized) {
533
+ t0 = lastPage ? `${lastPage.pathname}${lastPage.search}${lastPage.hash}` : localized("/");
534
+ $[0] = lastPage;
535
+ $[1] = localized;
536
+ $[2] = t0;
537
+ } else t0 = $[2];
538
+ const lastPageHref = t0;
539
+ let t1;
540
+ let t2;
541
+ if ($[3] !== canvasOnly || $[4] !== isCanvasShown || $[5] !== isMobileStudio || $[6] !== lastPageHref || $[7] !== navigate) {
542
+ t1 = () => {
543
+ const left = wasCanvasShown.current && !isCanvasShown;
544
+ wasCanvasShown.current = isCanvasShown;
545
+ if (!canvasOnly || isCanvasShown) return;
546
+ if (isMobileStudio || left) {
547
+ navigate({
548
+ to: lastPageHref,
549
+ replace: true
550
+ });
551
+ return;
552
+ }
553
+ previewStore.send({ type: "showCanvas" });
554
+ };
555
+ t2 = [
556
+ canvasOnly,
557
+ isCanvasShown,
558
+ isMobileStudio,
559
+ navigate,
560
+ lastPageHref
561
+ ];
562
+ $[3] = canvasOnly;
563
+ $[4] = isCanvasShown;
564
+ $[5] = isMobileStudio;
565
+ $[6] = lastPageHref;
566
+ $[7] = navigate;
567
+ $[8] = t1;
568
+ $[9] = t2;
569
+ } else {
570
+ t1 = $[8];
571
+ t2 = $[9];
572
+ }
573
+ React.useEffect(t1, t2);
574
+ }
575
+ /**
576
+ * Once the signed-in Studio is idle, loads what showing the Canvas waits for: its code, and
577
+ * the project and page list it lays out. The first show then skips most of its loading.
578
+ */
579
+ function usePrefetchCanvas(enabled, projectUuid) {
580
+ const $ = c(6);
581
+ const queryClient = useQueryClient();
582
+ const studioCache = useStudioCache();
583
+ let t0;
584
+ let t1;
585
+ if ($[0] !== enabled || $[1] !== projectUuid || $[2] !== queryClient || $[3] !== studioCache) {
586
+ t0 = () => {
587
+ if (!enabled) return;
588
+ const prefetch = async () => {
589
+ prefetchCanvas();
590
+ await queryClient.prefetchQuery(studioCache.options(reads.project({ projectUuid })));
591
+ await queryClient.prefetchQuery(studioCache.options(reads.pageList({ projectUuid })));
592
+ };
593
+ if (typeof window.requestIdleCallback === "function") {
594
+ const id = window.requestIdleCallback(() => void prefetch(), { timeout: 5e3 });
595
+ return () => window.cancelIdleCallback(id);
596
+ }
597
+ const id_0 = window.setTimeout(() => void prefetch(), 2e3);
598
+ return () => window.clearTimeout(id_0);
599
+ };
600
+ t1 = [
601
+ enabled,
602
+ projectUuid,
603
+ queryClient,
604
+ studioCache
605
+ ];
606
+ $[0] = enabled;
607
+ $[1] = projectUuid;
608
+ $[2] = queryClient;
609
+ $[3] = studioCache;
610
+ $[4] = t0;
611
+ $[5] = t1;
612
+ } else {
613
+ t0 = $[4];
614
+ t1 = $[5];
615
+ }
616
+ React.useEffect(t0, t1);
617
+ }
331
618
  /** Studio chrome is shared; only curated previews require a Camox page record. */
332
619
  const PreviewShell = (t0) => {
333
- const $ = c(61);
334
- if ($[0] !== "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c") {
335
- for (let $i = 0; $i < 61; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
336
- $[0] = "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c";
337
- }
338
- const { children, pageData, hasLiveVersion: t1, derivedLayoutId, derivedLayout } = t0;
339
- const hasLiveVersion = t1 === void 0 ? false : t1;
620
+ const $ = c(49);
621
+ const { children, pageData, derivedLayout, pageLocation, canvasOnly, runtimeBasePath: t1 } = t0;
622
+ const runtimeBasePath = t1 === void 0 ? "" : t1;
340
623
  const isAuthenticated = useIsAuthenticated();
624
+ const projectUuid = useProjectUuid();
341
625
  const isMobileStudio = useIsMobileStudio();
342
- const sharedChrome = React.useContext(SharedChromeContext);
343
- const isEditMode = useSelector(previewStore, selectIsEditMode);
344
- const isCommentMode = useSelector(previewStore, selectIsCommentMode);
345
- const isToolbarHidden = useSelector(previewStore, _temp3);
346
- const isAddBlockSidebarOpen = useSelector(previewStore, _temp4);
347
- const previewSource = useSelector(previewStore, selectPreviewSource);
348
- const hasLiveCheckpoint = pageData ? pageData.page.livePublishedCheckpointId != null : hasLiveVersion;
626
+ const isCanvasShown = useSelector(previewStore, selectIsCanvasShown);
627
+ usePreviewViewportActions();
628
+ const isCanvasEnabled = !isMobileStudio && isCanvasShown;
629
+ usePrefetchCanvas(isAuthenticated && !isMobileStudio, projectUuid);
630
+ const { pathname } = useLocation();
631
+ const pageId = canvasOnly ? void 0 : pageData?.page.id;
632
+ const layoutId = canvasOnly ? void 0 : derivedLayout?.layoutId;
349
633
  let t2;
634
+ bb0: {
635
+ if (pageId != null) {
636
+ let t3;
637
+ if ($[0] !== pageId) {
638
+ t3 = {
639
+ kind: "page",
640
+ pageId
641
+ };
642
+ $[0] = pageId;
643
+ $[1] = t3;
644
+ } else t3 = $[1];
645
+ t2 = t3;
646
+ break bb0;
647
+ }
648
+ if (layoutId != null) {
649
+ let t3;
650
+ if ($[2] !== layoutId) {
651
+ t3 = {
652
+ kind: "layout",
653
+ layoutId
654
+ };
655
+ $[2] = layoutId;
656
+ $[3] = t3;
657
+ } else t3 = $[3];
658
+ t2 = t3;
659
+ break bb0;
660
+ }
661
+ t2 = null;
662
+ }
663
+ const editingOwner = t2;
350
664
  let t3;
351
- if ($[1] !== isMobileStudio) {
352
- t2 = () => {
665
+ let t4;
666
+ if ($[4] !== isMobileStudio) {
667
+ t3 = () => {
353
668
  if (!isMobileStudio) return;
354
- previewStore.send({ type: "exitEditMode" });
355
- previewStore.send({ type: "closeAddBlockSidebar" });
669
+ previewStore.send({ type: "hideCanvas" });
670
+ previewStore.send({ type: "closeAddBlockSheet" });
356
671
  };
357
- t3 = [isMobileStudio];
358
- $[1] = isMobileStudio;
359
- $[2] = t2;
360
- $[3] = t3;
672
+ t4 = [isMobileStudio];
673
+ $[4] = isMobileStudio;
674
+ $[5] = t3;
675
+ $[6] = t4;
361
676
  } else {
362
- t2 = $[2];
363
- t3 = $[3];
677
+ t3 = $[5];
678
+ t4 = $[6];
364
679
  }
365
- React.useEffect(t2, t3);
366
- let t4;
680
+ React.useEffect(t3, t4);
681
+ useCanvasOnlyLocation(!!canvasOnly && isAuthenticated, isCanvasShown, isMobileStudio, pageLocation);
367
682
  let t5;
368
- if ($[4] !== hasLiveCheckpoint || $[5] !== isAuthenticated || $[6] !== isCommentMode || $[7] !== isEditMode || $[8] !== isMobileStudio || $[9] !== pageData || $[10] !== previewSource) {
369
- t4 = () => {
683
+ let t6;
684
+ if ($[7] !== isAuthenticated || $[8] !== isCanvasShown || $[9] !== isMobileStudio) {
685
+ t5 = () => {
370
686
  const actions = [
371
687
  {
372
- id: "exit-edit-mode",
373
- label: "Exit edit mode",
688
+ id: "hide-canvas",
689
+ label: "Hide canvas",
374
690
  aliases: [
691
+ "Preview",
692
+ "Exit edit mode",
375
693
  "Hide Camox Studio",
376
- "Hide studio",
377
- "Preview only",
378
- "View mode"
694
+ "Hide studio"
379
695
  ],
380
- groupLabel: "Preview",
381
- checkIfAvailable: () => isAuthenticated && isEditMode,
382
- execute: _temp5,
383
- shortcut: EDIT_MODE_SHORTCUT
696
+ groupLabel: "Website",
697
+ checkIfAvailable: () => isAuthenticated && isCanvasShown,
698
+ execute: _temp4,
699
+ shortcut: TOGGLE_CANVAS_SHORTCUT
384
700
  },
385
701
  {
386
- id: "enter-edit-mode",
387
- label: "Enter edit mode",
702
+ id: "show-canvas",
703
+ label: "Show canvas",
388
704
  aliases: [
705
+ "Edit mode",
389
706
  "Show Camox Studio",
390
- "Show studio",
391
- "Edit mode"
392
- ],
393
- groupLabel: "Preview",
394
- checkIfAvailable: () => isAuthenticated && !isEditMode && !isMobileStudio,
395
- execute: _temp6,
396
- shortcut: EDIT_MODE_SHORTCUT
397
- },
398
- {
399
- id: "enter-comment-mode",
400
- label: "Leave feedback",
401
- aliases: [
402
- "Comment",
403
- "Comment mode",
404
- "Show feedback"
405
- ],
406
- groupLabel: "Preview",
407
- checkIfAvailable: () => isAuthenticated && !isMobileStudio && pageData != null && areCommentsEnabled() && !isCommentMode,
408
- execute: () => {
409
- if (!isEditMode) previewStore.send({ type: "enterEditMode" });
410
- previewStore.send({
411
- type: "setCommentMode",
412
- enabled: true
413
- });
414
- },
415
- shortcut: { key: "c" }
416
- },
417
- {
418
- id: "preview-live-content",
419
- label: "Preview live content",
420
- aliases: [
421
- "Live",
422
- "View live",
423
- "Published content"
707
+ "Show studio"
424
708
  ],
425
- groupLabel: "Preview",
426
- checkIfAvailable: () => isAuthenticated && previewSource === "draft" && hasLiveCheckpoint,
427
- execute: _temp7,
428
- shortcut: {
429
- key: "d",
430
- withAlt: true
431
- }
432
- },
433
- {
434
- id: "preview-draft-content",
435
- label: "Preview draft content",
436
- aliases: [
437
- "Draft",
438
- "View draft",
439
- "Unpublished content"
440
- ],
441
- groupLabel: "Preview",
442
- checkIfAvailable: () => isAuthenticated && previewSource === "live",
443
- execute: _temp8,
444
- shortcut: {
445
- key: "d",
446
- withAlt: true
447
- }
709
+ groupLabel: "Website",
710
+ checkIfAvailable: () => isAuthenticated && !isCanvasShown && !isMobileStudio,
711
+ execute: _temp5,
712
+ shortcut: TOGGLE_CANVAS_SHORTCUT
448
713
  },
449
714
  {
450
715
  id: "clear-selection",
451
716
  label: "Clear selection",
452
717
  aliases: ["Deselect", "Unselect"],
453
- groupLabel: "Preview",
454
- checkIfAvailable: _temp9,
455
- execute: _temp0,
718
+ groupLabel: "Website",
719
+ checkIfAvailable: _temp6,
720
+ execute: _temp7,
456
721
  shortcut: { key: "Escape" }
457
722
  }
458
723
  ];
@@ -463,188 +728,215 @@ const PreviewShell = (t0) => {
463
728
  return () => {
464
729
  actionsStore.send({
465
730
  type: "unregisterManyActions",
466
- ids: actions.map(_temp1)
731
+ ids: actions.map(_temp8)
467
732
  });
468
733
  };
469
734
  };
470
- t5 = [
471
- isEditMode,
472
- isCommentMode,
735
+ t6 = [
736
+ isCanvasShown,
473
737
  isAuthenticated,
474
- isMobileStudio,
475
- pageData,
476
- previewSource,
477
- hasLiveCheckpoint
738
+ isMobileStudio
478
739
  ];
479
- $[4] = hasLiveCheckpoint;
480
- $[5] = isAuthenticated;
481
- $[6] = isCommentMode;
482
- $[7] = isEditMode;
483
- $[8] = isMobileStudio;
484
- $[9] = pageData;
485
- $[10] = previewSource;
486
- $[11] = t4;
487
- $[12] = t5;
740
+ $[7] = isAuthenticated;
741
+ $[8] = isCanvasShown;
742
+ $[9] = isMobileStudio;
743
+ $[10] = t5;
744
+ $[11] = t6;
488
745
  } else {
489
- t4 = $[11];
490
- t5 = $[12];
746
+ t5 = $[10];
747
+ t6 = $[11];
491
748
  }
492
- React.useEffect(t4, t5);
749
+ React.useEffect(t5, t6);
493
750
  if (!isAuthenticated) {
494
- let t6;
495
- if ($[13] !== children) {
496
- t6 = /* @__PURE__ */ jsx(Fragment, { children });
497
- $[13] = children;
498
- $[14] = t6;
499
- } else t6 = $[14];
500
- return t6;
751
+ let t7;
752
+ if ($[12] !== children) {
753
+ t7 = /* @__PURE__ */ jsx(Fragment, { children });
754
+ $[12] = children;
755
+ $[13] = t7;
756
+ } else t7 = $[13];
757
+ return t7;
501
758
  }
502
- const t6 = sharedChrome ? "h-full" : "h-screen";
503
- const t7 = !isEditMode && "bg-black";
759
+ const t7 = !isCanvasShown && "bg-black";
504
760
  let t8;
505
- if ($[15] !== t6 || $[16] !== t7) {
506
- t8 = cn("bg-background flex flex-col overflow-hidden", t6, t7);
507
- $[15] = t6;
508
- $[16] = t7;
509
- $[17] = t8;
510
- } else t8 = $[17];
511
- let t9;
512
- if ($[18] !== isAddBlockSidebarOpen || $[19] !== isMobileStudio || $[20] !== isToolbarHidden || $[21] !== pageData || $[22] !== sharedChrome) {
513
- t9 = !sharedChrome && !isMobileStudio && !isToolbarHidden && /* @__PURE__ */ jsxs("div", {
514
- className: "relative",
515
- children: [/* @__PURE__ */ jsx(Navbar, { isPreview: true }), pageData && isAddBlockSidebarOpen && /* @__PURE__ */ jsx("div", {
516
- className: "absolute inset-0 z-20",
517
- style: { background: "rgba(0, 0, 0, 0.66)" },
518
- onClick: _temp10
519
- })]
520
- });
521
- $[18] = isAddBlockSidebarOpen;
522
- $[19] = isMobileStudio;
523
- $[20] = isToolbarHidden;
524
- $[21] = pageData;
525
- $[22] = sharedChrome;
526
- $[23] = t9;
527
- } else t9 = $[23];
528
- let t10;
529
- if ($[24] !== derivedLayout || $[25] !== derivedLayoutId || $[26] !== isEditMode || $[27] !== isMobileStudio || $[28] !== pageData) {
530
- t10 = !isMobileStudio && (pageData || derivedLayoutId) && /* @__PURE__ */ jsx("div", {
531
- className: isEditMode ? "contents" : "hidden",
532
- children: /* @__PURE__ */ jsx(LeftSidebar, {
533
- page: pageData?.page,
534
- derivedLayout
535
- })
761
+ if ($[14] !== t7) {
762
+ t8 = cn("bg-background relative flex h-full min-h-0 flex-1 flex-col overflow-hidden", t7);
763
+ $[14] = t7;
764
+ $[15] = t8;
765
+ } else t8 = $[15];
766
+ const t9 = pageLocation?.pathname;
767
+ const t10 = !canvasOnly;
768
+ const t11 = !!derivedLayout;
769
+ let t12;
770
+ if ($[16] !== t10 || $[17] !== t11) {
771
+ t12 = /* @__PURE__ */ jsx(CanvasSidebarSkeleton, {
772
+ page: t10,
773
+ layoutPage: t11
536
774
  });
537
- $[24] = derivedLayout;
538
- $[25] = derivedLayoutId;
539
- $[26] = isEditMode;
540
- $[27] = isMobileStudio;
541
- $[28] = pageData;
542
- $[29] = t10;
543
- } else t10 = $[29];
544
- const t11 = pageData?.page;
545
- const t12 = pageData?.projectName;
546
- const t13 = pageData?.page.id;
547
- const t14 = pageData?.page.status;
548
- let t15;
549
- if ($[30] !== hasLiveCheckpoint || $[31] !== t13 || $[32] !== t14) {
550
- t15 = {
551
- pageId: t13,
552
- pageStatus: t14,
553
- hasLiveVersion: hasLiveCheckpoint
554
- };
555
- $[30] = hasLiveCheckpoint;
556
- $[31] = t13;
557
- $[32] = t14;
558
- $[33] = t15;
559
- } else t15 = $[33];
560
- let t16;
561
- if ($[34] !== isEditMode || $[35] !== isMobileStudio) {
562
- t16 = !isMobileStudio && isEditMode && /* @__PURE__ */ jsx(PreviewToolbarSpacer, {});
563
- $[34] = isEditMode;
564
- $[35] = isMobileStudio;
565
- $[36] = t16;
566
- } else t16 = $[36];
775
+ $[16] = t10;
776
+ $[17] = t11;
777
+ $[18] = t12;
778
+ } else t12 = $[18];
779
+ const t13 = !isCanvasEnabled;
780
+ const t14 = pageData?.page;
781
+ const t15 = derivedLayout?.layoutId;
782
+ const t16 = pageData?.projectName;
567
783
  let t17;
568
- if ($[37] !== children || $[38] !== isMobileStudio || $[39] !== t11 || $[40] !== t12 || $[41] !== t15 || $[42] !== t16) {
569
- t17 = /* @__PURE__ */ jsxs(PreviewPanel, {
570
- isMobileExperience: isMobileStudio,
571
- page: t11,
572
- projectName: t12,
573
- toolbarProps: t15,
574
- children: [children, t16]
784
+ if ($[19] !== children || $[20] !== isMobileStudio || $[21] !== pageLocation || $[22] !== t13 || $[23] !== t14 || $[24] !== t15 || $[25] !== t16) {
785
+ t17 = /* @__PURE__ */ jsx("div", {
786
+ className: "flex min-h-0 flex-1 flex-row items-stretch",
787
+ children: /* @__PURE__ */ jsx(PreviewPanel, {
788
+ active: t13,
789
+ isMobileExperience: isMobileStudio,
790
+ page: t14,
791
+ layoutId: t15,
792
+ pageLocation,
793
+ projectName: t16,
794
+ children
795
+ })
575
796
  });
576
- $[37] = children;
577
- $[38] = isMobileStudio;
578
- $[39] = t11;
579
- $[40] = t12;
580
- $[41] = t15;
581
- $[42] = t16;
582
- $[43] = t17;
583
- } else t17 = $[43];
797
+ $[19] = children;
798
+ $[20] = isMobileStudio;
799
+ $[21] = pageLocation;
800
+ $[22] = t13;
801
+ $[23] = t14;
802
+ $[24] = t15;
803
+ $[25] = t16;
804
+ $[26] = t17;
805
+ } else t17 = $[26];
584
806
  let t18;
585
- if ($[44] !== derivedLayoutId || $[45] !== isEditMode || $[46] !== isMobileStudio || $[47] !== pageData?.page) {
586
- t18 = !isMobileStudio && isEditMode && /* @__PURE__ */ jsx(RightSidebar, {
587
- pageId: pageData?.page.id,
588
- derivedLayoutId
807
+ if ($[27] !== isCanvasEnabled || $[28] !== pathname || $[29] !== runtimeBasePath || $[30] !== t12 || $[31] !== t17 || $[32] !== t9) {
808
+ t18 = /* @__PURE__ */ jsx(CanvasPreview, {
809
+ enabled: isCanvasEnabled,
810
+ pathname,
811
+ pagePathname: t9,
812
+ runtimeBasePath,
813
+ placeholder: t12,
814
+ children: t17
589
815
  });
590
- $[44] = derivedLayoutId;
591
- $[45] = isEditMode;
592
- $[46] = isMobileStudio;
593
- $[47] = pageData?.page;
594
- $[48] = t18;
595
- } else t18 = $[48];
816
+ $[27] = isCanvasEnabled;
817
+ $[28] = pathname;
818
+ $[29] = runtimeBasePath;
819
+ $[30] = t12;
820
+ $[31] = t17;
821
+ $[32] = t9;
822
+ $[33] = t18;
823
+ } else t18 = $[33];
596
824
  let t19;
597
- if ($[49] !== t10 || $[50] !== t17 || $[51] !== t18) {
598
- t19 = /* @__PURE__ */ jsxs("div", {
599
- className: "flex h-full flex-row items-stretch",
600
- children: [
601
- t10,
602
- t17,
603
- t18
604
- ]
605
- });
606
- $[49] = t10;
607
- $[50] = t17;
608
- $[51] = t18;
609
- $[52] = t19;
610
- } else t19 = $[52];
825
+ if ($[34] !== isCanvasEnabled || $[35] !== pageId) {
826
+ t19 = !isCanvasEnabled && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CreatePageModal, {}), pageId != null && /* @__PURE__ */ jsx(AddBlockSheet, {})] });
827
+ $[34] = isCanvasEnabled;
828
+ $[35] = pageId;
829
+ $[36] = t19;
830
+ } else t19 = $[36];
611
831
  let t20;
612
- if ($[53] !== isEditMode || $[54] !== isMobileStudio) {
613
- t20 = (isMobileStudio || isEditMode) && /* @__PURE__ */ jsx(CreatePageModal, {});
614
- $[53] = isEditMode;
615
- $[54] = isMobileStudio;
616
- $[55] = t20;
617
- } else t20 = $[55];
618
- let t21;
619
- if ($[56] !== t19 || $[57] !== t20 || $[58] !== t8 || $[59] !== t9) {
620
- t21 = /* @__PURE__ */ jsxs("div", {
832
+ if ($[37] !== t18 || $[38] !== t19 || $[39] !== t8) {
833
+ t20 = /* @__PURE__ */ jsxs("div", {
621
834
  className: t8,
622
- children: [
623
- t9,
624
- t19,
625
- t20
626
- ]
835
+ children: [t18, t19]
627
836
  });
628
- $[56] = t19;
629
- $[57] = t20;
630
- $[58] = t8;
631
- $[59] = t9;
632
- $[60] = t21;
633
- } else t21 = $[60];
634
- return t21;
837
+ $[37] = t18;
838
+ $[38] = t19;
839
+ $[39] = t8;
840
+ $[40] = t20;
841
+ } else t20 = $[40];
842
+ let t21;
843
+ if ($[41] !== editingOwner || $[42] !== t20) {
844
+ t21 = /* @__PURE__ */ jsx(PreviewEditingOwnerContext, {
845
+ value: editingOwner,
846
+ children: t20
847
+ });
848
+ $[41] = editingOwner;
849
+ $[42] = t20;
850
+ $[43] = t21;
851
+ } else t21 = $[43];
852
+ let t22;
853
+ if ($[44] !== projectUuid) {
854
+ t22 = /* @__PURE__ */ jsx(ContentCollectionItemSheet, { projectUuid });
855
+ $[44] = projectUuid;
856
+ $[45] = t22;
857
+ } else t22 = $[45];
858
+ let t23;
859
+ if ($[46] !== t21 || $[47] !== t22) {
860
+ t23 = /* @__PURE__ */ jsxs(CollectionItemSheetProvider, {
861
+ onRouteTargetClose: _temp9,
862
+ children: [t21, t22]
863
+ });
864
+ $[46] = t21;
865
+ $[47] = t22;
866
+ $[48] = t23;
867
+ } else t23 = $[48];
868
+ return t23;
635
869
  };
636
- function usePreviewPagesActions() {
870
+ /** Zooms out to the whole Canvas, from anywhere in the site or the Studio. */
871
+ function useShowCanvasAction() {
637
872
  const $ = c(6);
638
- if ($[0] !== "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c") {
639
- for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
640
- $[0] = "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c";
873
+ const navigate = useNavigate();
874
+ const pathname = useLocalePath();
875
+ const localized = useLocalizedPath();
876
+ const isMobileStudio = useIsMobileStudio();
877
+ let t0;
878
+ let t1;
879
+ if ($[0] !== isMobileStudio || $[1] !== localized || $[2] !== navigate || $[3] !== pathname) {
880
+ t0 = () => {
881
+ const actions = [{
882
+ id: "show-whole-canvas",
883
+ label: "Show whole canvas",
884
+ aliases: [
885
+ "Canvas",
886
+ "Zoom out",
887
+ "Canvas overview",
888
+ "Back to the canvas"
889
+ ],
890
+ groupLabel: "Navigation",
891
+ checkIfAvailable: () => !isMobileStudio,
892
+ execute: () => {
893
+ previewStore.send({ type: "showCanvas" });
894
+ if (pathname !== "/camox/canvas") navigate({ to: localized(STUDIO_CANVAS_PATH) });
895
+ canvasStore.send({ type: "requestOverview" });
896
+ },
897
+ shortcut: SHOW_WHOLE_CANVAS_SHORTCUT
898
+ }];
899
+ actionsStore.send({
900
+ type: "registerManyActions",
901
+ actions
902
+ });
903
+ return () => {
904
+ actionsStore.send({
905
+ type: "unregisterManyActions",
906
+ ids: actions.map(_temp10)
907
+ });
908
+ };
909
+ };
910
+ t1 = [
911
+ localized,
912
+ navigate,
913
+ pathname,
914
+ isMobileStudio
915
+ ];
916
+ $[0] = isMobileStudio;
917
+ $[1] = localized;
918
+ $[2] = navigate;
919
+ $[3] = pathname;
920
+ $[4] = t0;
921
+ $[5] = t1;
922
+ } else {
923
+ t0 = $[4];
924
+ t1 = $[5];
641
925
  }
926
+ React.useEffect(t0, t1);
927
+ }
928
+ function _temp10(a) {
929
+ return a.id;
930
+ }
931
+ function usePreviewPagesActions() {
932
+ const $ = c(6);
642
933
  const navigate = useNavigate();
643
- const { pathname } = useLocation();
934
+ const pathname = useLocalePath();
935
+ const localized = useLocalizedPath();
644
936
  const pages = usePageDestinations();
645
937
  let t0;
646
938
  let t1;
647
- if ($[1] !== navigate || $[2] !== pages || $[3] !== pathname) {
939
+ if ($[0] !== localized || $[1] !== navigate || $[2] !== pages || $[3] !== pathname) {
648
940
  t0 = () => {
649
941
  const currentPage = pages.find((p) => p.kind === "curated" && p.fullPath === pathname);
650
942
  const actions = [
@@ -652,7 +944,7 @@ function usePreviewPagesActions() {
652
944
  id: "create-page",
653
945
  label: "Create page",
654
946
  aliases: ["New page", "Add page"],
655
- groupLabel: "Preview",
947
+ groupLabel: "Website",
656
948
  checkIfAvailable: _temp11,
657
949
  execute: _temp12
658
950
  },
@@ -664,7 +956,7 @@ function usePreviewPagesActions() {
664
956
  "Edit page settings",
665
957
  "Page metadata"
666
958
  ],
667
- groupLabel: "Preview",
959
+ groupLabel: "Website",
668
960
  checkIfAvailable: () => currentPage?.kind === "curated",
669
961
  execute: () => {
670
962
  if (currentPage?.kind !== "curated") return;
@@ -682,7 +974,7 @@ function usePreviewPagesActions() {
682
974
  "Navigate page",
683
975
  "Switch page"
684
976
  ],
685
- groupLabel: "Preview",
977
+ groupLabel: "Website",
686
978
  checkIfAvailable: () => pages.length > 0,
687
979
  hasChildren: true,
688
980
  execute: _temp13
@@ -692,9 +984,9 @@ function usePreviewPagesActions() {
692
984
  parentActionId: "go-to-page",
693
985
  label: `Go to "${page.title}"`,
694
986
  aliases: [page.fullPath],
695
- groupLabel: "Preview",
987
+ groupLabel: "Website",
696
988
  checkIfAvailable: _temp14,
697
- execute: () => navigate({ to: page.fullPath })
989
+ execute: () => navigate({ to: localized(page.fullPath) })
698
990
  }))
699
991
  ];
700
992
  actionsStore.send({
@@ -709,10 +1001,12 @@ function usePreviewPagesActions() {
709
1001
  };
710
1002
  };
711
1003
  t1 = [
1004
+ localized,
712
1005
  navigate,
713
1006
  pages,
714
1007
  pathname
715
1008
  ];
1009
+ $[0] = localized;
716
1010
  $[1] = navigate;
717
1011
  $[2] = pages;
718
1012
  $[3] = pathname;
@@ -737,40 +1031,25 @@ function _temp12() {
737
1031
  function _temp11() {
738
1032
  return true;
739
1033
  }
740
- function _temp3(state) {
741
- return state.context.isToolbarHidden;
1034
+ function _temp2(b) {
1035
+ return b.slot === "before";
742
1036
  }
743
- function _temp4(state_0) {
744
- return state_0.context.isAddBlockSidebarOpen;
1037
+ function _temp4() {
1038
+ return previewStore.send({ type: "hideCanvas" });
745
1039
  }
746
1040
  function _temp5() {
747
- return previewStore.send({ type: "exitEditMode" });
1041
+ return previewStore.send({ type: "showCanvas" });
748
1042
  }
749
1043
  function _temp6() {
750
- return previewStore.send({ type: "enterEditMode" });
751
- }
752
- function _temp7() {
753
- return previewStore.send({ type: "viewLivePage" });
754
- }
755
- function _temp8() {
756
- return previewStore.send({ type: "viewDraftPage" });
757
- }
758
- function _temp9() {
759
1044
  return true;
760
1045
  }
761
- function _temp0() {
762
- previewStore.send({
763
- type: "setCommentMode",
764
- enabled: false
765
- });
766
- previewStore.send({ type: "clearSelection" });
1046
+ function _temp7() {
1047
+ return previewStore.send({ type: "clearSelection" });
767
1048
  }
768
- function _temp1(a) {
1049
+ function _temp8(a) {
769
1050
  return a.id;
770
1051
  }
771
- function _temp10() {
772
- return previewStore.send({ type: "closeAddBlockSidebar" });
773
- }
1052
+ function _temp9() {}
774
1053
 
775
1054
  //#endregion
776
- export { CamoxPreview, PageContent, PreviewShell, usePreviewPagesActions, usePreviewedPage };
1055
+ export { CamoxPreview, PageContent, PreviewShell, usePreviewPagesActions, usePreviewedPage, useShowCanvasAction };