camox 0.43.0 → 0.45.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 (412) hide show
  1. package/bin/camox.mjs +9 -1
  2. package/dist/components/AuthGate.js +0 -6
  3. package/dist/components/DeviceSelector.js +96 -0
  4. package/dist/components/PlatformLabel.js +20 -24
  5. package/dist/core/components/lexical/HighlightNode.js +1 -1
  6. package/dist/core/components/lexical/InlineContentEditable.js +15 -19
  7. package/dist/core/components/lexical/InlineLexicalEditor.js +54 -74
  8. package/dist/core/components/lexical/InlineStylesPlugin.js +57 -41
  9. package/dist/core/components/lexical/MaxLengthPlugin.js +59 -0
  10. package/dist/core/components/lexical/SelectionBroadcaster.js +55 -56
  11. package/dist/core/components/lexical/SidebarLexicalEditor.js +327 -234
  12. package/dist/core/components/lexical/SummaryToggleGuard.js +42 -0
  13. package/dist/core/components/lexical/TextLinkPopover.js +169 -180
  14. package/dist/core/createApp.d.ts +254 -299
  15. package/dist/core/createApp.js +123 -29
  16. package/dist/core/createBlock.d.ts +5 -5
  17. package/dist/core/createBlock.js +399 -152
  18. package/dist/core/createCollection.d.ts +55 -0
  19. package/dist/core/createCollection.js +93 -0
  20. package/dist/core/createLayout.d.ts +197 -61
  21. package/dist/core/createLayout.js +114 -56
  22. package/dist/core/defineDocument.d.ts +3 -5
  23. package/dist/core/derivedRoutes.js +49 -1
  24. package/dist/core/dom.d.ts +13 -4
  25. package/dist/core/dom.js +44 -1
  26. package/dist/core/editing/BlockEditingRuntime.d.ts +16 -0
  27. package/dist/core/editing/BlockEditingRuntime.js +6 -15
  28. package/dist/core/editing/CompleteBlockEditingRuntime.js +28 -23
  29. package/dist/core/editing/createEditableBlock.d.ts +820 -565
  30. package/dist/core/editing/createEditableBlock.js +2153 -971
  31. package/dist/core/editing/referenceWrites.js +51 -0
  32. package/dist/core/editing/useLatestRecord.js +90 -0
  33. package/dist/core/hooks/useArtifactHost.js +139 -0
  34. package/dist/core/hooks/useFieldSelection.js +43 -18
  35. package/dist/core/hooks/useIsEditable.js +12 -10
  36. package/dist/core/hooks/useOverlayMessage.js +15 -19
  37. package/dist/core/lib/artifact.d.ts +21 -0
  38. package/dist/core/lib/artifact.js +154 -0
  39. package/dist/core/lib/artifactColors.js +123 -0
  40. package/dist/core/lib/artifactData.d.ts +1 -0
  41. package/dist/core/lib/artifactData.js +131 -0
  42. package/dist/core/lib/artifactHost.js +205 -0
  43. package/dist/core/lib/artifactRuntime.js +36 -0
  44. package/dist/core/lib/artifactTheme.js +57 -0
  45. package/dist/core/lib/contentType.d.ts +304 -103
  46. package/dist/core/lib/contentType.js +207 -168
  47. package/dist/core/lib/fieldTypes.js +4 -0
  48. package/dist/core/lib/iconTypes.d.ts +13 -0
  49. package/dist/core/lib/icons.d.ts +6 -0
  50. package/dist/core/lib/icons.js +126 -0
  51. package/dist/core/lib/imagePlaceholder.js +177 -0
  52. package/dist/core/lib/imageTransform.js +1 -1
  53. package/dist/core/lib/lexicalReact.d.ts +3 -1
  54. package/dist/core/lib/lexicalState.js +7 -7
  55. package/dist/core/lib/modifierFormats.js +1 -1
  56. package/dist/core/lib/previewPaused.js +9 -0
  57. package/dist/core/lib/recordScope.js +316 -0
  58. package/dist/core/lib/reference.d.ts +81 -0
  59. package/dist/core/lib/reference.js +29 -0
  60. package/dist/core/lib/textLinks.js +7 -5
  61. package/dist/core/lib/textStyles.d.ts +6 -8
  62. package/dist/core/lib/textStyles.js +5 -5
  63. package/dist/core/notFound.d.ts +7 -0
  64. package/dist/core/notFound.js +11 -0
  65. package/dist/core/pageDestinations.js +6 -3
  66. package/dist/core/recordItem.js +34 -0
  67. package/dist/core/requestContext.d.ts +26 -0
  68. package/dist/core/requestContext.js +20 -0
  69. package/dist/features/canvas/CamoxCanvas.js +1734 -0
  70. package/dist/features/canvas/CanvasBlockFrame.js +353 -0
  71. package/dist/features/canvas/CanvasBlockHeader.js +55 -0
  72. package/dist/features/canvas/CanvasLoadingScreen.js +35 -0
  73. package/dist/features/canvas/CanvasOverlays.js +254 -0
  74. package/dist/features/canvas/CanvasPageEdge.js +87 -0
  75. package/dist/features/canvas/CanvasPageFrame.js +335 -0
  76. package/dist/features/canvas/CanvasPageHeader.js +125 -0
  77. package/dist/features/canvas/CanvasPreviewPageSlot.js +103 -0
  78. package/dist/features/canvas/CanvasShelfMarker.js +255 -0
  79. package/dist/features/canvas/DerivedPagePathInput.js +238 -0
  80. package/dist/features/canvas/canvasCamera.js +229 -0
  81. package/dist/features/canvas/canvasFlight.js +104 -0
  82. package/dist/features/canvas/canvasFrameCapture.js +364 -0
  83. package/dist/features/canvas/canvasFrameDocument.js +317 -0
  84. package/dist/features/canvas/canvasFrameMode.js +53 -0
  85. package/dist/features/canvas/canvasInsertionSeams.js +44 -0
  86. package/dist/features/canvas/canvasItems.js +120 -0
  87. package/dist/features/canvas/canvasOverlayGeometry.js +240 -0
  88. package/dist/features/canvas/canvasPages.js +79 -0
  89. package/dist/features/canvas/canvasScreenSpace.js +26 -0
  90. package/dist/features/canvas/canvasSelection.js +18 -0
  91. package/dist/features/canvas/canvasStore.js +149 -0
  92. package/dist/features/canvas/canvasThumbnails.js +304 -0
  93. package/dist/features/canvas/canvasZoom.js +10 -0
  94. package/dist/features/canvas/sidebar/CanvasInspector.js +202 -0
  95. package/dist/features/canvas/sidebar/CanvasNavigator.js +226 -0
  96. package/dist/features/canvas/sidebar/CanvasSidebar.js +60 -0
  97. package/dist/features/canvas/sidebar/CanvasSidebarFrame.js +48 -0
  98. package/dist/features/canvas/sidebar/CanvasSidebarSkeleton.js +39 -0
  99. package/dist/features/canvas/sidebar/CatalogBlockInspector.js +189 -0
  100. package/dist/features/canvas/sidebar/CuratedPageInspector.js +69 -0
  101. package/dist/features/canvas/sidebar/DerivedPageInspector.js +37 -0
  102. package/dist/features/canvas/sidebar/LayoutPageBlocks.js +78 -0
  103. package/dist/features/canvas/sidebar/LayoutPageOverview.js +71 -0
  104. package/dist/features/canvas/sidebar/PageInspector.js +157 -0
  105. package/dist/features/canvas/sidebar/PageInspectorSkeleton.js +90 -0
  106. package/dist/features/canvas/sidebar/PageOverview.js +27 -0
  107. package/dist/features/canvas/sidebar/SingletonPageInspector.js +31 -0
  108. package/dist/features/canvas/useCanvasCamera.js +803 -0
  109. package/dist/features/canvas/useCanvasFrame.js +149 -0
  110. package/dist/features/canvas/useCanvasFrameInput.js +97 -0
  111. package/dist/features/canvas/useCanvasNearness.js +57 -0
  112. package/dist/features/canvas/useDiscoveredPreviewPaths.js +62 -0
  113. package/dist/features/content/CamoxContent.d.ts +2 -5
  114. package/dist/features/content/CamoxContent.js +174 -271
  115. package/dist/features/content/CollectionItemSheetContext.js +106 -0
  116. package/dist/features/content/ContentAssets.js +315 -0
  117. package/dist/features/content/ContentCollection.js +663 -0
  118. package/dist/features/content/collection-form.js +58 -0
  119. package/dist/features/content/components/AssetCard.js +101 -69
  120. package/dist/features/content/components/AssetCardSkeleton.js +4 -8
  121. package/dist/features/content/components/ContentSidebar.js +129 -18
  122. package/dist/features/content/components/ContentSidebarGroup.js +37 -0
  123. package/dist/features/content/components/DeleteCollectionItemButton.js +202 -0
  124. package/dist/features/content/components/MissingFromLocale.js +282 -0
  125. package/dist/features/content/components/UploadDropZone.js +27 -31
  126. package/dist/features/content/components/UploadProgressDrawer.js +90 -98
  127. package/dist/features/navigation/navigation.d.ts +66 -20
  128. package/dist/features/navigation/navigation.js +257 -90
  129. package/dist/features/og/defaultFonts.js +8 -8
  130. package/dist/features/og/geist-variable-ttf-base64.js +1 -1
  131. package/dist/features/og/imageResponse.d.ts +8 -0
  132. package/dist/features/og/imageResponse.js +26 -0
  133. package/dist/features/page/CuratedPageContent.js +167 -0
  134. package/dist/features/page/DerivedPageContent.js +26 -30
  135. package/dist/features/page/SharedLayoutContent.js +25 -27
  136. package/dist/features/preview/CamoxPreview.d.ts +23 -61
  137. package/dist/features/preview/CamoxPreview.js +811 -507
  138. package/dist/features/preview/EditablePageContent.js +1 -1
  139. package/dist/features/preview/EditablePageExperience.js +16 -22
  140. package/dist/features/preview/components/AddBlockDialog.js +270 -0
  141. package/dist/features/preview/components/AssetFieldEditor.js +173 -154
  142. package/dist/features/preview/components/AssetLightbox.js +194 -136
  143. package/dist/features/preview/components/AssetPickerModal.js +153 -170
  144. package/dist/features/preview/components/BlockActionsPopover.js +150 -149
  145. package/dist/features/preview/components/BlockErrorBoundary.js +8 -12
  146. package/dist/features/preview/components/BlockThumbnail.js +176 -100
  147. package/dist/features/preview/components/CanvasPreview.js +243 -0
  148. package/dist/features/preview/components/CreatePageModal.js +128 -137
  149. package/dist/features/preview/components/DebouncedFieldEditor.js +29 -33
  150. package/dist/features/preview/components/DerivedLayoutDialog.js +46 -29
  151. package/dist/features/preview/components/DrillRow.js +150 -0
  152. package/dist/features/preview/components/FieldOverlayStyles.js +33 -10
  153. package/dist/features/preview/components/FieldToolbar.js +166 -116
  154. package/dist/features/preview/components/Frame.js +108 -20
  155. package/dist/features/preview/components/IconFieldEditor.js +227 -0
  156. package/dist/features/preview/components/ItemFieldsEditor.js +238 -205
  157. package/dist/features/preview/components/LinkFieldEditor.js +135 -139
  158. package/dist/features/preview/components/Metadata.js +22 -30
  159. package/dist/features/preview/components/MobilePreviewDrawer.js +89 -108
  160. package/dist/features/preview/components/MultipleAssetFieldEditor.js +334 -246
  161. package/dist/features/preview/components/OverlayTracker.js +10 -42
  162. package/dist/features/preview/components/Overlays.js +81 -69
  163. package/dist/features/preview/components/PageInfo.js +1748 -0
  164. package/dist/features/preview/components/PageInfoSkeleton.js +51 -0
  165. package/dist/features/preview/components/PageLocationFieldset.js +112 -116
  166. package/dist/features/preview/components/PageNavigatorHeader.js +24 -0
  167. package/dist/features/preview/components/PageNicknameField.js +22 -26
  168. package/dist/features/preview/components/PagePicker.js +145 -147
  169. package/dist/features/preview/components/PageTree.js +525 -532
  170. package/dist/features/preview/components/PreviewActivation.js +28 -32
  171. package/dist/features/preview/components/PreviewPanel.js +620 -319
  172. package/dist/features/preview/components/PreviewToolbar.js +111 -340
  173. package/dist/features/preview/components/RecordCard.js +80 -0
  174. package/dist/features/preview/components/RecordCombobox.js +178 -0
  175. package/dist/features/preview/components/ReferenceFieldEditor.js +149 -0
  176. package/dist/features/preview/components/ReferenceListFieldEditor.js +432 -0
  177. package/dist/features/preview/components/RemovedBlockPlaceholder.js +95 -0
  178. package/dist/features/preview/components/RepeatableItemsList.js +125 -138
  179. package/dist/features/preview/components/SelectionEditor.js +993 -0
  180. package/dist/features/preview/components/ShikiMarkdown.js +14 -18
  181. package/dist/features/preview/components/SidebarSection.js +52 -64
  182. package/dist/features/preview/components/StudioEditingFallback.js +56 -0
  183. package/dist/features/preview/components/UnlinkAssetButton.js +104 -107
  184. package/dist/features/preview/components/blockGridNavigation.js +15 -0
  185. package/dist/features/preview/components/contentFieldSchema.js +8 -0
  186. package/dist/features/preview/components/useFieldWriter.js +200 -0
  187. package/dist/features/preview/components/useRecordView.js +383 -0
  188. package/dist/features/preview/components/useRepeatableItemActions.js +35 -37
  189. package/dist/features/preview/components/useUpdateBlockPosition.js +37 -37
  190. package/dist/features/preview/editingFrame.js +197 -0
  191. package/dist/features/preview/overlayHighlights.js +27 -0
  192. package/dist/features/preview/overlayMessages.js +72 -1
  193. package/dist/features/preview/pageRecord.js +189 -0
  194. package/dist/features/preview/previewConstants.js +6 -2
  195. package/dist/features/preview/previewPageFrame.js +95 -0
  196. package/dist/features/preview/previewPreparation.js +7 -0
  197. package/dist/features/preview/previewSelection.js +33 -59
  198. package/dist/features/preview/previewStore.js +225 -123
  199. package/dist/features/preview/referencePickerFocus.js +29 -0
  200. package/dist/features/preview/repeatableItemTargets.js +56 -0
  201. package/dist/features/preview/selectionReveal.js +21 -0
  202. package/dist/features/preview/usePreviewViewportActions.js +114 -0
  203. package/dist/features/preview/viewportContinuity.js +109 -0
  204. package/dist/features/provider/AuthenticatedCamoxProvider.js +69 -44
  205. package/dist/features/provider/CamoxProvider.d.ts +3 -6
  206. package/dist/features/provider/CamoxProvider.js +38 -50
  207. package/dist/features/provider/CoreCamoxProvider.js +71 -23
  208. package/dist/features/provider/LocalhostPreviewProvider.js +73 -73
  209. package/dist/features/provider/PreviewSignInPage.js +54 -0
  210. package/dist/features/provider/components/CamoxAppContext.js +11 -11
  211. package/dist/features/provider/components/CommandPalette.js +87 -143
  212. package/dist/features/provider/useAdminShortcuts.js +7 -11
  213. package/dist/features/routes/pageRuntime.d.ts +44 -4
  214. package/dist/features/routes/pageRuntime.js +244 -137
  215. package/dist/features/runtime/RuntimeChrome.js +117 -115
  216. package/dist/features/runtime/alternates.js +64 -0
  217. package/dist/features/runtime/analytics.d.ts +7 -0
  218. package/dist/features/runtime/analytics.js +66 -0
  219. package/dist/features/runtime/artifactSources.js +87 -0
  220. package/dist/features/runtime/editingFallback.js +20 -0
  221. package/dist/features/runtime/linkPrefetch.js +97 -0
  222. package/dist/features/runtime/livePages.js +62 -0
  223. package/dist/features/runtime/llmsTxt.js +40 -0
  224. package/dist/features/runtime/loopbackFetch.js +18 -0
  225. package/dist/features/runtime/navigationAccessibility.js +51 -0
  226. package/dist/features/runtime/navigationTarget.js +23 -2
  227. package/dist/features/runtime/pageApp.js +216 -141
  228. package/dist/features/runtime/pageBlockTypes.js +20 -0
  229. package/dist/features/runtime/pageClient.d.ts +2 -4
  230. package/dist/features/runtime/pageClient.js +18 -3
  231. package/dist/features/runtime/pageNavigation.js +254 -32
  232. package/dist/features/runtime/pageServer.d.ts +2 -4
  233. package/dist/features/runtime/pageServer.js +8 -1
  234. package/dist/features/runtime/pageViewport.js +7 -0
  235. package/dist/features/runtime/runtime.d.ts +60 -23
  236. package/dist/features/runtime/runtime.js +779 -166
  237. package/dist/features/runtime/runtimeChromeLoader.js +58 -0
  238. package/dist/features/runtime/runtimeRoutes.d.ts +19 -0
  239. package/dist/features/runtime/runtimeRoutes.js +25 -0
  240. package/dist/features/runtime/scrollRestoration.js +133 -0
  241. package/dist/features/runtime/studioApp.d.ts +4 -3
  242. package/dist/features/runtime/studioApp.js +5 -9
  243. package/dist/features/runtime/studioClient.d.ts +2 -4
  244. package/dist/features/runtime/studioClient.js +12 -3
  245. package/dist/features/runtime/studioServer.d.ts +2 -4
  246. package/dist/features/runtime/studioServer.js +6 -1
  247. package/dist/features/runtime/worker.d.ts +6 -0
  248. package/dist/features/runtime/worker.js +23 -0
  249. package/dist/features/runtime/workerRequest.js +44 -0
  250. package/dist/features/studio/CamoxStudio.d.ts +2 -6
  251. package/dist/features/studio/CamoxStudio.js +34 -49
  252. package/dist/features/studio/FollowAgentProvider.js +338 -0
  253. package/dist/features/studio/components/ChatSidebar.js +356 -0
  254. package/dist/features/studio/components/DraftsControl.js +676 -0
  255. package/dist/features/studio/components/FaviconDialog.js +318 -0
  256. package/dist/features/studio/components/LocalePicker.js +785 -0
  257. package/dist/features/studio/components/Navbar.js +123 -103
  258. package/dist/features/studio/components/ProjectMenu.js +239 -260
  259. package/dist/features/studio/components/RenameDraftDialog.js +206 -0
  260. package/dist/features/studio/components/ReviewDraftSheet.js +1472 -0
  261. package/dist/features/studio/components/ThreadComposer.js +157 -0
  262. package/dist/features/studio/components/ThreadMarkdown.js +113 -0
  263. package/dist/features/studio/components/ThreadMessages.js +270 -0
  264. package/dist/features/studio/components/UserButton.js +34 -23
  265. package/dist/features/studio/draftLabel.js +33 -0
  266. package/dist/features/studio/draftNotice.js +13 -0
  267. package/dist/features/studio/followAgent.js +250 -0
  268. package/dist/features/studio/followAgentContext.js +7 -0
  269. package/dist/features/studio/localeOptions.js +118 -0
  270. package/dist/features/studio/localeSwitch.js +19 -0
  271. package/dist/features/studio/routes.js +48 -1
  272. package/dist/features/studio/studioStore.js +64 -1
  273. package/dist/features/studio/useTheme.js +24 -27
  274. package/dist/features/vite/artifactRuntimeMinification.js +36 -0
  275. package/dist/features/vite/auth.js +1 -50
  276. package/dist/features/vite/blockBoilerplate.js +6 -5
  277. package/dist/features/vite/blockChunks.js +31 -0
  278. package/dist/features/vite/bundlerLogs.js +17 -0
  279. package/dist/features/vite/definitionsSync.js +158 -226
  280. package/dist/features/vite/devAuthentication.js +4 -16
  281. package/dist/features/vite/devSignIn.js +87 -0
  282. package/dist/features/vite/iconGeneration.js +16 -0
  283. package/dist/features/vite/layoutGeneration.js +11 -1
  284. package/dist/features/vite/publishSeededContent.js +30 -0
  285. package/dist/features/vite/routeGeneration.js +6 -7
  286. package/dist/features/vite/runtimeDev.js +80 -99
  287. package/dist/features/vite/vite.d.ts +53 -31
  288. package/dist/features/vite/vite.js +230 -116
  289. package/dist/features/vite/workerBuild.js +39 -0
  290. package/dist/hooks/use-debounced-field.js +116 -47
  291. package/dist/hooks/use-file-upload.js +114 -67
  292. package/dist/hooks/use-marquee-selection.js +32 -36
  293. package/dist/hooks/use-page-destinations.js +69 -37
  294. package/dist/lib/api-client-server.d.ts +5 -0
  295. package/dist/lib/api-client-server.js +10 -4
  296. package/dist/lib/api-client.d.ts +6 -0
  297. package/dist/lib/api-client.js +51 -16
  298. package/dist/lib/api-socket.js +17 -0
  299. package/dist/lib/auth-page-styles.js +39 -0
  300. package/dist/lib/auth.js +139 -60
  301. package/dist/lib/collection-cache.js +23 -0
  302. package/dist/lib/draft-scope.d.ts +4 -0
  303. package/dist/lib/draft-scope.js +222 -0
  304. package/dist/lib/html.js +12 -0
  305. package/dist/lib/link-pages.js +154 -0
  306. package/dist/lib/locale-path.d.ts +22 -0
  307. package/dist/lib/locale-path.js +57 -0
  308. package/dist/lib/normalized-data.js +252 -152
  309. package/dist/lib/preview-handoff.js +13 -0
  310. package/dist/lib/queries.d.ts +11 -0
  311. package/dist/lib/queries.js +71 -131
  312. package/dist/lib/studio-reads.d.ts +14 -0
  313. package/dist/lib/studio-reads.js +574 -0
  314. package/dist/lib/use-project-room.js +50 -47
  315. package/dist/lib/use-thread.js +310 -0
  316. package/dist/lib/utils.js +25 -29
  317. package/dist/lib/view-locale-context.js +22 -0
  318. package/dist/lib/view-locale.js +46 -0
  319. package/dist/package.js +5 -0
  320. package/dist/studio-overlays.css +41 -147
  321. package/dist/studio.css +2 -2
  322. package/package.json +70 -72
  323. package/skills/camox/SKILL.md +16 -5
  324. package/skills/camox/references/artifacts.md +179 -0
  325. package/skills/camox/references/block-definitions.md +98 -55
  326. package/skills/camox/references/cli-common.md +18 -6
  327. package/skills/camox/references/cli-content.md +92 -58
  328. package/skills/camox/references/cli-publishing.md +26 -0
  329. package/skills/camox/references/dom-integrations.md +27 -0
  330. package/skills/camox/references/field-styling.md +7 -7
  331. package/skills/camox/references/layout-definitions.md +16 -14
  332. package/skills/camox/references/localization.md +56 -0
  333. package/skills/camox/references/routed-layouts.md +133 -15
  334. package/skills/camox-expand/SKILL.md +69 -0
  335. package/skills/camox-expand/references/jobs.md +39 -0
  336. package/skills/camoxify/SKILL.md +38 -2
  337. package/dist/core/components/AddBlockControlBar.js +0 -78
  338. package/dist/core/hooks/useRequireDraftSource.js +0 -23
  339. package/dist/features/metadata/sitemap.d.ts +0 -8
  340. package/dist/features/metadata/sitemap.js +0 -17
  341. package/dist/features/og/imageResponse.node.d.ts +0 -12
  342. package/dist/features/og/imageResponse.node.js +0 -49
  343. package/dist/features/og/imageResponse.workerd.d.ts +0 -12
  344. package/dist/features/og/imageResponse.workerd.js +0 -40
  345. package/dist/features/page/PublishedPageContent.js +0 -205
  346. package/dist/features/page/PublishedPageExperience.js +0 -23
  347. package/dist/features/preview/DerivedPreview.js +0 -134
  348. package/dist/features/preview/commentsEnabled.js +0 -8
  349. package/dist/features/preview/components/AddBlockSidebar.js +0 -381
  350. package/dist/features/preview/components/AttachedComments.js +0 -194
  351. package/dist/features/preview/components/CommentHeader.js +0 -122
  352. package/dist/features/preview/components/CommentSidebar.js +0 -29
  353. package/dist/features/preview/components/CommentTargetQuote.js +0 -166
  354. package/dist/features/preview/components/DerivedLayoutSidebar.d.ts +0 -5
  355. package/dist/features/preview/components/DerivedLayoutSidebar.js +0 -179
  356. package/dist/features/preview/components/DerivedPageInfoSidebar.js +0 -69
  357. package/dist/features/preview/components/LeftSidebar.js +0 -68
  358. package/dist/features/preview/components/PageEditorSidebar.js +0 -563
  359. package/dist/features/preview/components/PageInfoSidebar.js +0 -1551
  360. package/dist/features/preview/components/PageNavigatorSidebar.js +0 -78
  361. package/dist/features/preview/components/PageStatusBadge.js +0 -97
  362. package/dist/features/preview/components/PeekedBlock.js +0 -217
  363. package/dist/features/preview/components/PreviewComments.js +0 -56
  364. package/dist/features/preview/components/PreviewToolbarSpacer.js +0 -43
  365. package/dist/features/preview/components/PublicationRow.js +0 -422
  366. package/dist/features/preview/components/PublishDialog.js +0 -194
  367. package/dist/features/preview/components/RightSidebar.js +0 -59
  368. package/dist/features/preview/previewCommentsStore.js +0 -115
  369. package/dist/features/preview/publication.js +0 -81
  370. package/dist/features/runtime/SharedChromeContext.js +0 -7
  371. package/dist/features/studio/components/EnvironmentMenu.js +0 -413
  372. package/dist/features/vite/appGeneration.js +0 -89
  373. package/dist/lib/view-queries.js +0 -28
  374. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/Matches.d.ts +0 -114
  375. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/RouterProvider.d.ts +0 -25
  376. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/config.d.ts +0 -1
  377. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/defer.d.ts +0 -1
  378. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/fileRoute.d.ts +0 -20
  379. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/global.d.ts +0 -8
  380. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/hash-scroll.d.ts +0 -1
  381. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/index.d.ts +0 -18
  382. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/link.d.ts +0 -161
  383. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/load-matches.d.ts +0 -6
  384. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/location.d.ts +0 -54
  385. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/lru-cache.d.ts +0 -8
  386. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/manifest.d.ts +0 -32
  387. 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
  388. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/not-found.d.ts +0 -1
  389. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/redirect.d.ts +0 -49
  390. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/rewrite.d.ts +0 -1
  391. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/root.d.ts +0 -6
  392. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/route.d.ts +0 -343
  393. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/routeInfo.d.ts +0 -48
  394. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/router.d.ts +0 -695
  395. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/scroll-restoration.d.ts +0 -1
  396. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/searchMiddleware.d.ts +0 -1
  397. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/searchParams.d.ts +0 -5
  398. 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
  399. 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
  400. 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
  401. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/stores.d.ts +0 -69
  402. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/structuralSharing.d.ts +0 -1
  403. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/typePrimitives.d.ts +0 -1
  404. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useLoaderData.d.ts +0 -1
  405. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useLoaderDeps.d.ts +0 -1
  406. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useNavigate.d.ts +0 -10
  407. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useParams.d.ts +0 -1
  408. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useRouteContext.d.ts +0 -1
  409. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useSearch.d.ts +0 -1
  410. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/utils.d.ts +0 -28
  411. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/validators.d.ts +0 -49
  412. package/skills/camox/references/cli-environments.md +0 -37
@@ -1,1551 +0,0 @@
1
- import { useNavigate } from "../../navigation/navigation.js";
2
- import { useProjectSlug } from "../../../lib/auth.js";
3
- import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
4
- import { blockQueries, layoutQueries, pageMutations, pageQueries, projectQueries } from "../../../lib/queries.js";
5
- import { cn } from "../../../lib/utils.js";
6
- import { areCommentsEnabled } from "../commentsEnabled.js";
7
- import { PageLocationFieldset } from "./PageLocationFieldset.js";
8
- import { PageNicknameField } from "./PageNicknameField.js";
9
- import { UploadDropZone } from "../../content/components/UploadDropZone.js";
10
- import { useDebouncedField } from "../../../hooks/use-debounced-field.js";
11
- import { DebouncedFieldEditor } from "./DebouncedFieldEditor.js";
12
- import { Metadata, MetadataRow, formatRelativeTime } from "./Metadata.js";
13
- import { AttachedComments } from "./AttachedComments.js";
14
- import { ShikiMarkdown } from "./ShikiMarkdown.js";
15
- import { c } from "react/compiler-runtime";
16
- import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
17
- import * as React from "react";
18
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
19
- import { Button } from "@camox/ui/button";
20
- import { Globe, Info, Pencil, Trash2, Upload } from "lucide-react";
21
- import { Alert, AlertDescription, AlertTitle } from "@camox/ui/alert";
22
- import { Spinner } from "@camox/ui/spinner";
23
- import { toast } from "@camox/ui/toaster";
24
- import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@camox/ui/dialog";
25
- import { Label } from "@camox/ui/label";
26
- import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@camox/ui/select";
27
- import { useForm } from "@tanstack/react-form";
28
- import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText } from "@camox/ui/input-group";
29
- import { Input } from "@camox/ui/input";
30
- import { Tooltip, TooltipContent, TooltipTrigger } from "@camox/ui/tooltip";
31
- import { Switch } from "@camox/ui/switch";
32
-
33
- //#region src/features/preview/components/PageInfoSidebar.tsx
34
- const usePageMetadataData = (pageId) => {
35
- const $ = c(32);
36
- if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
37
- for (let $i = 0; $i < 32; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
38
- $[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
39
- }
40
- const projectSlug = useProjectSlug();
41
- const camoxApp = useCamoxApp();
42
- let t0;
43
- if ($[1] !== pageId) {
44
- t0 = pageQueries.getById(pageId);
45
- $[1] = pageId;
46
- $[2] = t0;
47
- } else t0 = $[2];
48
- const { data: page } = useQuery(t0);
49
- let t1;
50
- if ($[3] !== projectSlug) {
51
- t1 = projectQueries.getBySlug(projectSlug);
52
- $[3] = projectSlug;
53
- $[4] = t1;
54
- } else t1 = $[4];
55
- const { data: project } = useQuery(t1);
56
- let t2;
57
- if ($[5] !== project?.id) {
58
- t2 = pageQueries.list(project?.id ?? 0);
59
- $[5] = project?.id;
60
- $[6] = t2;
61
- } else t2 = $[6];
62
- const t3 = !!project;
63
- let t4;
64
- if ($[7] !== t2 || $[8] !== t3) {
65
- t4 = {
66
- ...t2,
67
- enabled: t3
68
- };
69
- $[7] = t2;
70
- $[8] = t3;
71
- $[9] = t4;
72
- } else t4 = $[9];
73
- const { data: pages } = useQuery(t4);
74
- let t5;
75
- if ($[10] !== project?.id) {
76
- t5 = layoutQueries.list(project?.id ?? 0);
77
- $[10] = project?.id;
78
- $[11] = t5;
79
- } else t5 = $[11];
80
- const t6 = !!project;
81
- let t7;
82
- if ($[12] !== t5 || $[13] !== t6) {
83
- t7 = {
84
- ...t5,
85
- enabled: t6
86
- };
87
- $[12] = t5;
88
- $[13] = t6;
89
- $[14] = t7;
90
- } else t7 = $[14];
91
- const { data: allLayouts } = useQuery(t7);
92
- let t8;
93
- if ($[15] !== allLayouts || $[16] !== camoxApp) {
94
- t8 = allLayouts?.filter((layout) => camoxApp.getLayoutById(layout.layoutId)?._internal.kind === "curated");
95
- $[15] = allLayouts;
96
- $[16] = camoxApp;
97
- $[17] = t8;
98
- } else t8 = $[17];
99
- const layouts = t8;
100
- let pageLayoutRecord;
101
- let t9;
102
- if ($[18] !== allLayouts || $[19] !== camoxApp || $[20] !== page || $[21] !== project?.name) {
103
- pageLayoutRecord = allLayouts?.find((l) => l.id === page?.layoutId);
104
- const layoutDef = pageLayoutRecord ? camoxApp.getLayoutById(pageLayoutRecord.layoutId) : void 0;
105
- t9 = layoutDef && page ? layoutDef._internal.buildMetaTitle({
106
- pageMetaTitle: page.metaTitle ?? "",
107
- projectName: project?.name ?? "",
108
- pageFullPath: page.fullPath
109
- }) : page?.metaTitle ?? "";
110
- $[18] = allLayouts;
111
- $[19] = camoxApp;
112
- $[20] = page;
113
- $[21] = project?.name;
114
- $[22] = pageLayoutRecord;
115
- $[23] = t9;
116
- } else {
117
- pageLayoutRecord = $[22];
118
- t9 = $[23];
119
- }
120
- const metaTitle = t9;
121
- let t10;
122
- if ($[24] !== camoxApp || $[25] !== layouts || $[26] !== metaTitle || $[27] !== page || $[28] !== pageLayoutRecord || $[29] !== pages || $[30] !== project) {
123
- t10 = {
124
- page,
125
- project,
126
- pages,
127
- layouts,
128
- pageLayoutRecord,
129
- metaTitle,
130
- camoxApp
131
- };
132
- $[24] = camoxApp;
133
- $[25] = layouts;
134
- $[26] = metaTitle;
135
- $[27] = page;
136
- $[28] = pageLayoutRecord;
137
- $[29] = pages;
138
- $[30] = project;
139
- $[31] = t10;
140
- } else t10 = $[31];
141
- return t10;
142
- };
143
- const PageInfoSidebar = (t0) => {
144
- const $ = c(69);
145
- if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
146
- for (let $i = 0; $i < 69; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
147
- $[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
148
- }
149
- const { pageId, scrollable: t1, aboutOnly: t2 } = t0;
150
- const scrollable = t1 === void 0 ? true : t1;
151
- const aboutOnly = t2 === void 0 ? false : t2;
152
- const data = usePageMetadataData(pageId);
153
- const { page, metaTitle } = data;
154
- const [isStructureModalOpen, setIsStructureModalOpen] = React.useState(false);
155
- const [isSeoModalOpen, setIsSeoModalOpen] = React.useState(false);
156
- const [isMarkdownModalOpen, setIsMarkdownModalOpen] = React.useState(false);
157
- if (!page) {
158
- let t3;
159
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
160
- t3 = /* @__PURE__ */ jsxs("div", {
161
- className: "text-muted-foreground flex flex-1 items-center justify-center px-2 text-sm",
162
- children: [/* @__PURE__ */ jsx(Spinner, { className: "mr-2 size-3.5" }), " Loading page info..."]
163
- });
164
- $[1] = t3;
165
- } else t3 = $[1];
166
- return t3;
167
- }
168
- const t3 = scrollable && "flex-1 overflow-auto";
169
- let t4;
170
- if ($[2] !== t3) {
171
- t4 = cn("space-y-4 p-2 pt-4", t3);
172
- $[2] = t3;
173
- $[3] = t4;
174
- } else t4 = $[3];
175
- let t5;
176
- if ($[4] !== aboutOnly) {
177
- t5 = !aboutOnly && /* @__PURE__ */ jsx("p", {
178
- className: "text-base font-semibold",
179
- children: "About this page"
180
- });
181
- $[4] = aboutOnly;
182
- $[5] = t5;
183
- } else t5 = $[5];
184
- let t6;
185
- if ($[6] !== data) {
186
- t6 = /* @__PURE__ */ jsx(PageNicknameSidebarEditor, { data });
187
- $[6] = data;
188
- $[7] = t6;
189
- } else t6 = $[7];
190
- let t7;
191
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
192
- t7 = /* @__PURE__ */ jsx(Label, { children: "Page path" });
193
- $[8] = t7;
194
- } else t7 = $[8];
195
- let t8;
196
- if ($[9] !== page.fullPath) {
197
- t8 = /* @__PURE__ */ jsx(InputGroupText, {
198
- className: "min-w-0 flex-1 px-2 py-1.5 font-mono font-normal break-all",
199
- children: page.fullPath
200
- });
201
- $[9] = page.fullPath;
202
- $[10] = t8;
203
- } else t8 = $[10];
204
- let t9;
205
- if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
206
- t9 = () => setIsStructureModalOpen(true);
207
- $[11] = t9;
208
- } else t9 = $[11];
209
- let t10;
210
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
211
- t10 = /* @__PURE__ */ jsx(InputGroupAddon, {
212
- align: "inline-end",
213
- children: /* @__PURE__ */ jsx(InputGroupButton, {
214
- type: "button",
215
- variant: "ghost",
216
- size: "icon-xs",
217
- onClick: t9,
218
- "aria-label": "Edit page structure",
219
- children: /* @__PURE__ */ jsx(Pencil, {})
220
- })
221
- });
222
- $[12] = t10;
223
- } else t10 = $[12];
224
- let t11;
225
- if ($[13] !== t8) {
226
- t11 = /* @__PURE__ */ jsxs("div", {
227
- className: "space-y-2",
228
- children: [t7, /* @__PURE__ */ jsxs(InputGroup, {
229
- className: "px-1",
230
- children: [t8, t10]
231
- })]
232
- });
233
- $[13] = t8;
234
- $[14] = t11;
235
- } else t11 = $[14];
236
- let t12;
237
- if ($[15] !== data) {
238
- t12 = /* @__PURE__ */ jsx(PageLayoutSidebarSelect, { data });
239
- $[15] = data;
240
- $[16] = t12;
241
- } else t12 = $[16];
242
- let t13;
243
- if ($[17] !== t11 || $[18] !== t12 || $[19] !== t5 || $[20] !== t6) {
244
- t13 = /* @__PURE__ */ jsxs("section", {
245
- className: "space-y-4",
246
- children: [
247
- t5,
248
- t6,
249
- t11,
250
- t12
251
- ]
252
- });
253
- $[17] = t11;
254
- $[18] = t12;
255
- $[19] = t5;
256
- $[20] = t6;
257
- $[21] = t13;
258
- } else t13 = $[21];
259
- let t14;
260
- if ($[22] !== aboutOnly) {
261
- t14 = !aboutOnly && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
262
- className: "space-y-2",
263
- children: [/* @__PURE__ */ jsx(Label, { children: "SEO" }), /* @__PURE__ */ jsx(Button, {
264
- type: "button",
265
- variant: "outline",
266
- className: "w-full",
267
- onClick: () => setIsSeoModalOpen(true),
268
- children: "Manage SEO metadata"
269
- })]
270
- }), /* @__PURE__ */ jsxs("div", {
271
- className: "space-y-2",
272
- children: [/* @__PURE__ */ jsx(Label, { children: "Markdown" }), /* @__PURE__ */ jsx(Button, {
273
- type: "button",
274
- variant: "outline",
275
- className: "w-full",
276
- onClick: () => setIsMarkdownModalOpen(true),
277
- children: "View page markdown"
278
- })]
279
- })] });
280
- $[22] = aboutOnly;
281
- $[23] = t14;
282
- } else t14 = $[23];
283
- let t15;
284
- if ($[24] !== page.createdAt) {
285
- t15 = formatRelativeTime(page.createdAt);
286
- $[24] = page.createdAt;
287
- $[25] = t15;
288
- } else t15 = $[25];
289
- let t16;
290
- if ($[26] !== t15) {
291
- t16 = /* @__PURE__ */ jsx(MetadataRow, {
292
- label: "Created",
293
- children: t15
294
- });
295
- $[26] = t15;
296
- $[27] = t16;
297
- } else t16 = $[27];
298
- const t17 = page.createdBy ?? "Unknown";
299
- let t18;
300
- if ($[28] !== t17) {
301
- t18 = /* @__PURE__ */ jsx(MetadataRow, {
302
- label: "Created by",
303
- children: t17
304
- });
305
- $[28] = t17;
306
- $[29] = t18;
307
- } else t18 = $[29];
308
- let t19;
309
- if ($[30] !== page.updatedAt) {
310
- t19 = formatRelativeTime(page.updatedAt);
311
- $[30] = page.updatedAt;
312
- $[31] = t19;
313
- } else t19 = $[31];
314
- let t20;
315
- if ($[32] !== t19) {
316
- t20 = /* @__PURE__ */ jsx(MetadataRow, {
317
- label: "Updated",
318
- children: t19
319
- });
320
- $[32] = t19;
321
- $[33] = t20;
322
- } else t20 = $[33];
323
- let t21;
324
- if ($[34] !== page.publishedAt) {
325
- t21 = page.publishedAt == null ? "Never" : formatRelativeTime(page.publishedAt);
326
- $[34] = page.publishedAt;
327
- $[35] = t21;
328
- } else t21 = $[35];
329
- let t22;
330
- if ($[36] !== t21) {
331
- t22 = /* @__PURE__ */ jsx(MetadataRow, {
332
- label: "Published",
333
- children: t21
334
- });
335
- $[36] = t21;
336
- $[37] = t22;
337
- } else t22 = $[37];
338
- let t23;
339
- if ($[38] !== page.publishedAt || $[39] !== page.publishedBy) {
340
- t23 = page.publishedAt != null && /* @__PURE__ */ jsx(MetadataRow, {
341
- label: "Published by",
342
- children: page.publishedBy ?? "Unknown"
343
- });
344
- $[38] = page.publishedAt;
345
- $[39] = page.publishedBy;
346
- $[40] = t23;
347
- } else t23 = $[40];
348
- let t24;
349
- if ($[41] !== t16 || $[42] !== t18 || $[43] !== t20 || $[44] !== t22 || $[45] !== t23) {
350
- t24 = /* @__PURE__ */ jsxs(Metadata, { children: [
351
- t16,
352
- t18,
353
- t20,
354
- t22,
355
- t23
356
- ] });
357
- $[41] = t16;
358
- $[42] = t18;
359
- $[43] = t20;
360
- $[44] = t22;
361
- $[45] = t23;
362
- $[46] = t24;
363
- } else t24 = $[46];
364
- let t25;
365
- if ($[47] !== pageId) {
366
- t25 = areCommentsEnabled() && /* @__PURE__ */ jsx("div", {
367
- className: "-mx-2",
368
- children: /* @__PURE__ */ jsx(AttachedComments, { pageId })
369
- });
370
- $[47] = pageId;
371
- $[48] = t25;
372
- } else t25 = $[48];
373
- let t26;
374
- if ($[49] !== t13 || $[50] !== t14 || $[51] !== t24 || $[52] !== t25 || $[53] !== t4) {
375
- t26 = /* @__PURE__ */ jsxs("div", {
376
- className: t4,
377
- children: [
378
- t13,
379
- t14,
380
- t24,
381
- t25
382
- ]
383
- });
384
- $[49] = t13;
385
- $[50] = t14;
386
- $[51] = t24;
387
- $[52] = t25;
388
- $[53] = t4;
389
- $[54] = t26;
390
- } else t26 = $[54];
391
- let t27;
392
- if ($[55] !== isStructureModalOpen || $[56] !== page.id) {
393
- t27 = /* @__PURE__ */ jsx(PageStructureModal, {
394
- open: isStructureModalOpen,
395
- onOpenChange: setIsStructureModalOpen,
396
- pageId: page.id
397
- });
398
- $[55] = isStructureModalOpen;
399
- $[56] = page.id;
400
- $[57] = t27;
401
- } else t27 = $[57];
402
- let t28;
403
- if ($[58] !== aboutOnly || $[59] !== isMarkdownModalOpen || $[60] !== isSeoModalOpen || $[61] !== metaTitle || $[62] !== page.id || $[63] !== page.metaDescription) {
404
- t28 = !aboutOnly && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PageSeoModal, {
405
- open: isSeoModalOpen,
406
- onOpenChange: setIsSeoModalOpen,
407
- pageId: page.id
408
- }), /* @__PURE__ */ jsx(PageMarkdownModal, {
409
- open: isMarkdownModalOpen,
410
- onOpenChange: setIsMarkdownModalOpen,
411
- pageId: page.id,
412
- metaTitle,
413
- metaDescription: page.metaDescription ?? ""
414
- })] });
415
- $[58] = aboutOnly;
416
- $[59] = isMarkdownModalOpen;
417
- $[60] = isSeoModalOpen;
418
- $[61] = metaTitle;
419
- $[62] = page.id;
420
- $[63] = page.metaDescription;
421
- $[64] = t28;
422
- } else t28 = $[64];
423
- let t29;
424
- if ($[65] !== t26 || $[66] !== t27 || $[67] !== t28) {
425
- t29 = /* @__PURE__ */ jsxs(Fragment, { children: [
426
- t26,
427
- t27,
428
- t28
429
- ] });
430
- $[65] = t26;
431
- $[66] = t27;
432
- $[67] = t28;
433
- $[68] = t29;
434
- } else t29 = $[68];
435
- return t29;
436
- };
437
- const PageNicknameSidebarEditor = (t0) => {
438
- const $ = c(21);
439
- if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
440
- for (let $i = 0; $i < 21; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
441
- $[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
442
- }
443
- const { data } = t0;
444
- const { page } = data;
445
- let t1;
446
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
447
- t1 = pageMutations.update();
448
- $[1] = t1;
449
- } else t1 = $[1];
450
- const updatePage = useMutation(t1);
451
- const inputId = React.useId();
452
- let t2;
453
- if ($[2] !== page || $[3] !== updatePage) {
454
- t2 = (value) => {
455
- if (!page) return;
456
- const nickname = value.trim();
457
- if (nickname === page.nickname) return;
458
- if (!nickname) {
459
- toast.error("Page nickname is required");
460
- return;
461
- }
462
- updatePage.mutate({
463
- id: page.id,
464
- nickname,
465
- pathSegment: page.pathSegment,
466
- parentPageId: page.parentPageId
467
- }, { onError: _temp });
468
- };
469
- $[2] = page;
470
- $[3] = updatePage;
471
- $[4] = t2;
472
- } else t2 = $[4];
473
- const saveNickname = t2;
474
- const { value: value_0, setValue, onFocus, onBlur } = useDebouncedField(page?.nickname ?? "", saveNickname);
475
- if (!page) return null;
476
- let t3;
477
- if ($[5] !== inputId) {
478
- t3 = /* @__PURE__ */ jsx(Label, {
479
- htmlFor: inputId,
480
- children: "Page nickname"
481
- });
482
- $[5] = inputId;
483
- $[6] = t3;
484
- } else t3 = $[6];
485
- let t4;
486
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
487
- t4 = /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx(Info, { className: "text-muted-foreground size-3.5" }) }), /* @__PURE__ */ jsx(TooltipContent, { children: "A short internal name. Does not affect SEO." })] });
488
- $[7] = t4;
489
- } else t4 = $[7];
490
- let t5;
491
- if ($[8] !== t3) {
492
- t5 = /* @__PURE__ */ jsxs("div", {
493
- className: "flex items-center gap-1.5",
494
- children: [t3, t4]
495
- });
496
- $[8] = t3;
497
- $[9] = t5;
498
- } else t5 = $[9];
499
- let t6;
500
- if ($[10] !== setValue) {
501
- t6 = (e) => setValue(e.target.value);
502
- $[10] = setValue;
503
- $[11] = t6;
504
- } else t6 = $[11];
505
- let t7;
506
- if ($[12] !== inputId || $[13] !== onBlur || $[14] !== onFocus || $[15] !== t6 || $[16] !== value_0) {
507
- t7 = /* @__PURE__ */ jsx(Input, {
508
- id: inputId,
509
- value: value_0,
510
- onChange: t6,
511
- onFocus,
512
- onBlur,
513
- placeholder: "e.g. Home, Pricing, About",
514
- maxLength: 80
515
- });
516
- $[12] = inputId;
517
- $[13] = onBlur;
518
- $[14] = onFocus;
519
- $[15] = t6;
520
- $[16] = value_0;
521
- $[17] = t7;
522
- } else t7 = $[17];
523
- let t8;
524
- if ($[18] !== t5 || $[19] !== t7) {
525
- t8 = /* @__PURE__ */ jsxs("div", {
526
- className: "space-y-2",
527
- children: [t5, t7]
528
- });
529
- $[18] = t5;
530
- $[19] = t7;
531
- $[20] = t8;
532
- } else t8 = $[20];
533
- return t8;
534
- };
535
- const PageLayoutSidebarSelect = (t0) => {
536
- const $ = c(29);
537
- if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
538
- for (let $i = 0; $i < 29; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
539
- $[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
540
- }
541
- const { data } = t0;
542
- const { page, layouts, camoxApp } = data;
543
- let t1;
544
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
545
- t1 = pageMutations.setLayout();
546
- $[1] = t1;
547
- } else t1 = $[1];
548
- const setLayout = useMutation(t1);
549
- if (!page || !layouts || layouts.length === 0) return null;
550
- let t2;
551
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
552
- t2 = /* @__PURE__ */ jsx(Label, { children: "Layout" });
553
- $[2] = t2;
554
- } else t2 = $[2];
555
- let t3;
556
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
557
- t3 = /* @__PURE__ */ jsxs("div", {
558
- className: "flex items-center gap-1.5",
559
- children: [t2, /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx(Info, { className: "text-muted-foreground size-3.5" }) }), /* @__PURE__ */ jsx(TooltipContent, {
560
- className: "max-w-xs",
561
- children: "A layout wraps page content in shared structure, like navbars and footers, and controls how metadata is generated."
562
- })] })]
563
- });
564
- $[3] = t3;
565
- } else t3 = $[3];
566
- const t4 = page.layoutId ? String(page.layoutId) : "";
567
- let t5;
568
- if ($[4] !== page.id || $[5] !== page.layoutId || $[6] !== setLayout) {
569
- t5 = (value) => {
570
- const layoutId = Number(value);
571
- if (layoutId === page.layoutId) return;
572
- setLayout.mutate({
573
- id: page.id,
574
- layoutId
575
- }, { onError: _temp2 });
576
- };
577
- $[4] = page.id;
578
- $[5] = page.layoutId;
579
- $[6] = setLayout;
580
- $[7] = t5;
581
- } else t5 = $[7];
582
- let t6;
583
- if ($[8] !== camoxApp || $[9] !== layouts) {
584
- let t7;
585
- if ($[11] !== camoxApp) {
586
- t7 = (t) => ({
587
- value: String(t.id),
588
- label: camoxApp.getLayoutById(t.layoutId)?._internal.title ?? t.layoutId
589
- });
590
- $[11] = camoxApp;
591
- $[12] = t7;
592
- } else t7 = $[12];
593
- t6 = layouts.map(t7);
594
- $[8] = camoxApp;
595
- $[9] = layouts;
596
- $[10] = t6;
597
- } else t6 = $[10];
598
- let t7;
599
- if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
600
- t7 = /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select a layout" });
601
- $[13] = t7;
602
- } else t7 = $[13];
603
- let t8;
604
- if ($[14] !== setLayout.isPending) {
605
- t8 = /* @__PURE__ */ jsx(SelectTrigger, {
606
- disabled: setLayout.isPending,
607
- className: "w-full",
608
- children: t7
609
- });
610
- $[14] = setLayout.isPending;
611
- $[15] = t8;
612
- } else t8 = $[15];
613
- let t9;
614
- if ($[16] !== camoxApp || $[17] !== layouts) {
615
- let t10;
616
- if ($[19] !== camoxApp) {
617
- t10 = (t_0) => /* @__PURE__ */ jsx(SelectItem, {
618
- value: String(t_0.id),
619
- children: camoxApp.getLayoutById(t_0.layoutId)?._internal.title ?? t_0.layoutId
620
- }, t_0.id);
621
- $[19] = camoxApp;
622
- $[20] = t10;
623
- } else t10 = $[20];
624
- t9 = layouts.map(t10);
625
- $[16] = camoxApp;
626
- $[17] = layouts;
627
- $[18] = t9;
628
- } else t9 = $[18];
629
- let t10;
630
- if ($[21] !== t9) {
631
- t10 = /* @__PURE__ */ jsx(SelectContent, { children: t9 });
632
- $[21] = t9;
633
- $[22] = t10;
634
- } else t10 = $[22];
635
- let t11;
636
- if ($[23] !== t10 || $[24] !== t4 || $[25] !== t5 || $[26] !== t6 || $[27] !== t8) {
637
- t11 = /* @__PURE__ */ jsxs("div", {
638
- className: "space-y-2",
639
- children: [t3, /* @__PURE__ */ jsxs(Select, {
640
- value: t4,
641
- onValueChange: t5,
642
- items: t6,
643
- children: [t8, t10]
644
- })]
645
- });
646
- $[23] = t10;
647
- $[24] = t4;
648
- $[25] = t5;
649
- $[26] = t6;
650
- $[27] = t8;
651
- $[28] = t11;
652
- } else t11 = $[28];
653
- return t11;
654
- };
655
- const PageStructureModal = (t0) => {
656
- const $ = c(10);
657
- if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
658
- for (let $i = 0; $i < 10; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
659
- $[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
660
- }
661
- const { open, onOpenChange, pageId } = t0;
662
- const data = usePageMetadataData(pageId);
663
- const { page } = data;
664
- let t1;
665
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
666
- t1 = /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: "Page page" }), /* @__PURE__ */ jsx(DialogDescription, { children: "Update the URL path for this page." })] });
667
- $[1] = t1;
668
- } else t1 = $[1];
669
- let t2;
670
- if ($[2] !== data || $[3] !== onOpenChange || $[4] !== page) {
671
- t2 = /* @__PURE__ */ jsxs(DialogContent, {
672
- className: "max-h-[90vh] overflow-y-auto sm:max-w-2xl",
673
- children: [t1, page ? /* @__PURE__ */ jsx(PageStructureEditor, {
674
- data,
675
- includeNickname: false,
676
- includeLayout: false,
677
- onSaved: () => onOpenChange(false)
678
- }) : /* @__PURE__ */ jsxs("div", {
679
- className: "text-muted-foreground flex items-center gap-2 py-6 text-sm",
680
- children: [/* @__PURE__ */ jsx(Spinner, { className: "size-3.5" }), " Loading..."]
681
- })]
682
- });
683
- $[2] = data;
684
- $[3] = onOpenChange;
685
- $[4] = page;
686
- $[5] = t2;
687
- } else t2 = $[5];
688
- let t3;
689
- if ($[6] !== onOpenChange || $[7] !== open || $[8] !== t2) {
690
- t3 = /* @__PURE__ */ jsx(Dialog, {
691
- open,
692
- onOpenChange,
693
- children: t2
694
- });
695
- $[6] = onOpenChange;
696
- $[7] = open;
697
- $[8] = t2;
698
- $[9] = t3;
699
- } else t3 = $[9];
700
- return t3;
701
- };
702
- const PageStructureEditor = ({ data, includeNickname = true, includeLayout = true, onSaved }) => {
703
- const { page, project, pages, layouts, camoxApp } = data;
704
- const updatePage = useMutation(pageMutations.update());
705
- const setLayout = useMutation(pageMutations.setLayout());
706
- const navigate = useNavigate();
707
- const form = useForm({
708
- defaultValues: {
709
- nickname: page?.nickname ?? "",
710
- pathSegment: page?.pathSegment ?? "",
711
- parentPageId: page?.parentPageId ?? void 0,
712
- layoutId: page?.layoutId ?? 0
713
- },
714
- onSubmit: async (values) => {
715
- if (!page) return;
716
- try {
717
- const nickname = values.value.nickname.trim();
718
- if (!nickname) {
719
- toast.error("Page nickname is required");
720
- return;
721
- }
722
- const { fullPath } = await updatePage.mutateAsync({
723
- id: page.id,
724
- nickname,
725
- pathSegment: values.value.pathSegment,
726
- parentPageId: values.value.parentPageId
727
- });
728
- if (includeLayout && values.value.layoutId) await setLayout.mutateAsync({
729
- id: page.id,
730
- layoutId: values.value.layoutId
731
- });
732
- toast.success(`Updated ${nickname} page`);
733
- form.reset();
734
- onSaved?.();
735
- await navigate({ to: fullPath });
736
- } catch (error) {
737
- console.error("Failed to update page:", error);
738
- toast.error("Could not update page");
739
- }
740
- }
741
- });
742
- React.useEffect(() => {
743
- if (!page) return;
744
- form.reset({
745
- nickname: page.nickname,
746
- pathSegment: page.pathSegment,
747
- parentPageId: page.parentPageId ?? void 0,
748
- layoutId: page.layoutId ?? 0
749
- });
750
- }, [page?.id]);
751
- if (!page || !project) return null;
752
- const isRootPage = page.fullPath === "/";
753
- return /* @__PURE__ */ jsxs("form", {
754
- onSubmit: (e) => {
755
- e.preventDefault();
756
- e.stopPropagation();
757
- form.handleSubmit();
758
- },
759
- className: "space-y-4",
760
- children: [
761
- includeNickname && /* @__PURE__ */ jsx(form.Field, {
762
- name: "nickname",
763
- children: (field) => /* @__PURE__ */ jsx(PageNicknameField, {
764
- value: field.state.value,
765
- onChange: field.handleChange
766
- })
767
- }),
768
- isRootPage ? /* @__PURE__ */ jsxs(Alert, { children: [
769
- /* @__PURE__ */ jsx(Info, { className: "size-4" }),
770
- /* @__PURE__ */ jsx(AlertTitle, { children: "Homepage" }),
771
- /* @__PURE__ */ jsx(AlertDescription, { children: "You can't change the path of the home page." })
772
- ] }) : /* @__PURE__ */ jsx(form.Field, {
773
- name: "parentPageId",
774
- children: (parentField) => /* @__PURE__ */ jsx(form.Field, {
775
- name: "pathSegment",
776
- children: (pathField) => /* @__PURE__ */ jsx(PageLocationFieldset, {
777
- parentPageId: parentField.state.value,
778
- onParentPageIdChange: parentField.handleChange,
779
- pathSegment: pathField.state.value,
780
- onPathSegmentChange: pathField.handleChange,
781
- pages,
782
- excludePageId: page.id
783
- })
784
- })
785
- }),
786
- includeLayout && layouts && layouts.length > 0 && /* @__PURE__ */ jsx(form.Field, {
787
- name: "layoutId",
788
- children: (field_0) => /* @__PURE__ */ jsxs("div", {
789
- className: "space-y-2",
790
- children: [/* @__PURE__ */ jsx(Label, { children: "Layout" }), /* @__PURE__ */ jsxs(Select, {
791
- value: field_0.state.value ? String(field_0.state.value) : "",
792
- onValueChange: (value) => field_0.handleChange(Number(value)),
793
- items: layouts.map((t) => ({
794
- value: String(t.id),
795
- label: camoxApp.getLayoutById(t.layoutId)?._internal.title ?? t.layoutId
796
- })),
797
- children: [/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select a layout" }) }), /* @__PURE__ */ jsx(SelectContent, { children: layouts.map((t_0) => /* @__PURE__ */ jsx(SelectItem, {
798
- value: String(t_0.id),
799
- children: camoxApp.getLayoutById(t_0.layoutId)?._internal.title ?? t_0.layoutId
800
- }, t_0.id)) })]
801
- })]
802
- })
803
- }),
804
- /* @__PURE__ */ jsx(form.Subscribe, {
805
- selector: (s) => ({
806
- isSubmitting: s.isSubmitting,
807
- isPristine: s.isPristine
808
- }),
809
- children: ({ isSubmitting, isPristine }) => /* @__PURE__ */ jsxs(Button, {
810
- type: "submit",
811
- disabled: isSubmitting || isPristine,
812
- children: [
813
- isSubmitting && /* @__PURE__ */ jsx(Spinner, {}),
814
- "Save changes",
815
- isSubmitting && "..."
816
- ]
817
- })
818
- })
819
- ]
820
- });
821
- };
822
- const PageSeoModal = (t0) => {
823
- const $ = c(8);
824
- if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
825
- for (let $i = 0; $i < 8; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
826
- $[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
827
- }
828
- const { open, onOpenChange, pageId } = t0;
829
- let t1;
830
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
831
- t1 = /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: "SEO metadata" }), /* @__PURE__ */ jsx(DialogDescription, { children: "Control how this page appears in search and social previews." })] });
832
- $[1] = t1;
833
- } else t1 = $[1];
834
- let t2;
835
- if ($[2] !== pageId) {
836
- t2 = /* @__PURE__ */ jsxs(DialogContent, {
837
- className: "max-h-[90vh] overflow-y-auto sm:max-w-3xl",
838
- children: [t1, /* @__PURE__ */ jsx(PageSeoContent, { pageId })]
839
- });
840
- $[2] = pageId;
841
- $[3] = t2;
842
- } else t2 = $[3];
843
- let t3;
844
- if ($[4] !== onOpenChange || $[5] !== open || $[6] !== t2) {
845
- t3 = /* @__PURE__ */ jsx(Dialog, {
846
- open,
847
- onOpenChange,
848
- children: t2
849
- });
850
- $[4] = onOpenChange;
851
- $[5] = open;
852
- $[6] = t2;
853
- $[7] = t3;
854
- } else t3 = $[7];
855
- return t3;
856
- };
857
- const PageSeoContent = (t0) => {
858
- const $ = c(6);
859
- if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
860
- for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
861
- $[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
862
- }
863
- const { pageId } = t0;
864
- const { page, metaTitle, pageLayoutRecord, project } = usePageMetadataData(pageId);
865
- let t1;
866
- if ($[1] !== metaTitle || $[2] !== page || $[3] !== pageLayoutRecord?.layoutId || $[4] !== project?.name) {
867
- t1 = page ? /* @__PURE__ */ jsx(PageSeoEditor, {
868
- page,
869
- metaTitle,
870
- layoutId: pageLayoutRecord?.layoutId,
871
- projectName: project?.name
872
- }) : /* @__PURE__ */ jsxs("div", {
873
- className: "text-muted-foreground flex items-center gap-2 py-6 text-sm",
874
- children: [/* @__PURE__ */ jsx(Spinner, { className: "size-3.5" }), " Loading..."]
875
- });
876
- $[1] = metaTitle;
877
- $[2] = page;
878
- $[3] = pageLayoutRecord?.layoutId;
879
- $[4] = project?.name;
880
- $[5] = t1;
881
- } else t1 = $[5];
882
- return t1;
883
- };
884
- const PageSeoEditor = (t0) => {
885
- const $ = c(43);
886
- if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
887
- for (let $i = 0; $i < 43; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
888
- $[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
889
- }
890
- const { page, metaTitle, layoutId, projectName } = t0;
891
- let t1;
892
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
893
- t1 = pageMutations.setAiSeo();
894
- $[1] = t1;
895
- } else t1 = $[1];
896
- const setAiSeo = useMutation(t1);
897
- let t2;
898
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
899
- t2 = pageMutations.setMetaTitle();
900
- $[2] = t2;
901
- } else t2 = $[2];
902
- const setMetaTitle = useMutation(t2);
903
- let t3;
904
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
905
- t3 = pageMutations.setMetaDescription();
906
- $[3] = t3;
907
- } else t3 = $[3];
908
- const setMetaDescription = useMutation(t3);
909
- const t4 = page.aiSeoEnabled !== false;
910
- let t5;
911
- if ($[4] !== page.id || $[5] !== setAiSeo) {
912
- t5 = (checked) => {
913
- setAiSeo.mutate({
914
- id: page.id,
915
- enabled: checked
916
- });
917
- };
918
- $[4] = page.id;
919
- $[5] = setAiSeo;
920
- $[6] = t5;
921
- } else t5 = $[6];
922
- let t6;
923
- if ($[7] !== t4 || $[8] !== t5) {
924
- t6 = /* @__PURE__ */ jsx(Switch, {
925
- id: "ai-seo",
926
- checked: t4,
927
- onCheckedChange: t5
928
- });
929
- $[7] = t4;
930
- $[8] = t5;
931
- $[9] = t6;
932
- } else t6 = $[9];
933
- let t7;
934
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
935
- t7 = /* @__PURE__ */ jsx(Label, {
936
- htmlFor: "ai-seo",
937
- children: "AI metadata"
938
- });
939
- $[10] = t7;
940
- } else t7 = $[10];
941
- let t8;
942
- if ($[11] !== t6) {
943
- t8 = /* @__PURE__ */ jsxs("div", {
944
- className: "flex items-center gap-2",
945
- children: [t6, t7]
946
- });
947
- $[11] = t6;
948
- $[12] = t8;
949
- } else t8 = $[12];
950
- const t9 = page.metaTitle ?? "";
951
- const t10 = page.aiSeoEnabled !== false;
952
- let t11;
953
- if ($[13] !== page.id || $[14] !== setMetaTitle) {
954
- t11 = (value) => setMetaTitle.mutate({
955
- id: page.id,
956
- metaTitle: value
957
- });
958
- $[13] = page.id;
959
- $[14] = setMetaTitle;
960
- $[15] = t11;
961
- } else t11 = $[15];
962
- let t12;
963
- if ($[16] !== t10 || $[17] !== t11 || $[18] !== t9) {
964
- t12 = /* @__PURE__ */ jsx(DebouncedFieldEditor, {
965
- label: "Page title",
966
- placeholder: "Page title...",
967
- initialValue: t9,
968
- disabled: t10,
969
- onSave: t11
970
- });
971
- $[16] = t10;
972
- $[17] = t11;
973
- $[18] = t9;
974
- $[19] = t12;
975
- } else t12 = $[19];
976
- const t13 = page.metaDescription ?? "";
977
- const t14 = page.aiSeoEnabled !== false;
978
- let t15;
979
- if ($[20] !== page.id || $[21] !== setMetaDescription) {
980
- t15 = (value_0) => setMetaDescription.mutate({
981
- id: page.id,
982
- metaDescription: value_0
983
- });
984
- $[20] = page.id;
985
- $[21] = setMetaDescription;
986
- $[22] = t15;
987
- } else t15 = $[22];
988
- let t16;
989
- if ($[23] !== t13 || $[24] !== t14 || $[25] !== t15) {
990
- t16 = /* @__PURE__ */ jsx(DebouncedFieldEditor, {
991
- label: "Page description",
992
- placeholder: "Page description...",
993
- initialValue: t13,
994
- disabled: t14,
995
- rows: 2,
996
- onSave: t15
997
- });
998
- $[23] = t13;
999
- $[24] = t14;
1000
- $[25] = t15;
1001
- $[26] = t16;
1002
- } else t16 = $[26];
1003
- const t17 = page.metaDescription ?? "";
1004
- let t18;
1005
- if ($[27] !== metaTitle || $[28] !== page || $[29] !== t17) {
1006
- t18 = /* @__PURE__ */ jsx(SearchEnginePreview, {
1007
- page,
1008
- metaTitle,
1009
- metaDescription: t17
1010
- });
1011
- $[27] = metaTitle;
1012
- $[28] = page;
1013
- $[29] = t17;
1014
- $[30] = t18;
1015
- } else t18 = $[30];
1016
- const t19 = page.metaDescription ?? "";
1017
- let t20;
1018
- if ($[31] !== layoutId || $[32] !== metaTitle || $[33] !== page || $[34] !== projectName || $[35] !== t19) {
1019
- t20 = /* @__PURE__ */ jsx(SocialPreviewSection, {
1020
- page,
1021
- metaTitle,
1022
- metaDescription: t19,
1023
- layoutId,
1024
- projectName
1025
- });
1026
- $[31] = layoutId;
1027
- $[32] = metaTitle;
1028
- $[33] = page;
1029
- $[34] = projectName;
1030
- $[35] = t19;
1031
- $[36] = t20;
1032
- } else t20 = $[36];
1033
- let t21;
1034
- if ($[37] !== t12 || $[38] !== t16 || $[39] !== t18 || $[40] !== t20 || $[41] !== t8) {
1035
- t21 = /* @__PURE__ */ jsxs("div", {
1036
- className: "space-y-4",
1037
- children: [
1038
- t8,
1039
- t12,
1040
- t16,
1041
- t18,
1042
- t20
1043
- ]
1044
- });
1045
- $[37] = t12;
1046
- $[38] = t16;
1047
- $[39] = t18;
1048
- $[40] = t20;
1049
- $[41] = t8;
1050
- $[42] = t21;
1051
- } else t21 = $[42];
1052
- return t21;
1053
- };
1054
- const PageMarkdownModal = (t0) => {
1055
- const $ = c(10);
1056
- if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
1057
- for (let $i = 0; $i < 10; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1058
- $[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
1059
- }
1060
- const { open, onOpenChange, pageId, metaTitle, metaDescription } = t0;
1061
- let t1;
1062
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1063
- t1 = /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: "Markdown content" }), /* @__PURE__ */ jsx(DialogDescription, { children: "How your content will be served to AI agents." })] });
1064
- $[1] = t1;
1065
- } else t1 = $[1];
1066
- let t2;
1067
- if ($[2] !== metaDescription || $[3] !== metaTitle || $[4] !== pageId) {
1068
- t2 = /* @__PURE__ */ jsxs(DialogContent, {
1069
- className: "max-h-[90vh] overflow-y-auto sm:max-w-4xl",
1070
- children: [t1, /* @__PURE__ */ jsx(PageMarkdownPreview, {
1071
- pageId,
1072
- metaTitle,
1073
- metaDescription
1074
- })]
1075
- });
1076
- $[2] = metaDescription;
1077
- $[3] = metaTitle;
1078
- $[4] = pageId;
1079
- $[5] = t2;
1080
- } else t2 = $[5];
1081
- let t3;
1082
- if ($[6] !== onOpenChange || $[7] !== open || $[8] !== t2) {
1083
- t3 = /* @__PURE__ */ jsx(Dialog, {
1084
- open,
1085
- onOpenChange,
1086
- children: t2
1087
- });
1088
- $[6] = onOpenChange;
1089
- $[7] = open;
1090
- $[8] = t2;
1091
- $[9] = t3;
1092
- } else t3 = $[9];
1093
- return t3;
1094
- };
1095
- const PageMarkdownContent = (t0) => {
1096
- const $ = c(6);
1097
- if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
1098
- for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1099
- $[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
1100
- }
1101
- const { pageId } = t0;
1102
- const { page, metaTitle } = usePageMetadataData(pageId);
1103
- if (!page) {
1104
- let t1;
1105
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1106
- t1 = /* @__PURE__ */ jsx(Spinner, { className: "size-4" });
1107
- $[1] = t1;
1108
- } else t1 = $[1];
1109
- return t1;
1110
- }
1111
- const t1 = page.metaDescription ?? "";
1112
- let t2;
1113
- if ($[2] !== metaTitle || $[3] !== pageId || $[4] !== t1) {
1114
- t2 = /* @__PURE__ */ jsx(PageMarkdownPreview, {
1115
- pageId,
1116
- metaTitle,
1117
- metaDescription: t1
1118
- });
1119
- $[2] = metaTitle;
1120
- $[3] = pageId;
1121
- $[4] = t1;
1122
- $[5] = t2;
1123
- } else t2 = $[5];
1124
- return t2;
1125
- };
1126
- function truncateText(text, maxLen) {
1127
- if (text.length <= maxLen) return text;
1128
- return text.slice(0, maxLen) + "...";
1129
- }
1130
- const SearchEnginePreview = (t0) => {
1131
- const $ = c(17);
1132
- if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
1133
- for (let $i = 0; $i < 17; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1134
- $[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
1135
- }
1136
- const { page, metaTitle, metaDescription } = t0;
1137
- const url = `${typeof window !== "undefined" ? window.location.origin : ""}${page.fullPath}`;
1138
- let t1;
1139
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1140
- t1 = /* @__PURE__ */ jsx(Label, { children: "Search engine preview" });
1141
- $[1] = t1;
1142
- } else t1 = $[1];
1143
- let t2;
1144
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1145
- t2 = /* @__PURE__ */ jsxs("div", {
1146
- className: "flex items-center gap-1.5",
1147
- children: [t1, /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
1148
- delay: 50,
1149
- render: /* @__PURE__ */ jsx(Info, { className: "text-muted-foreground size-3.5" })
1150
- }), /* @__PURE__ */ jsx(TooltipContent, { children: "Titles are cropped after 60 characters and descriptions after 155, like on Google Search results." })] })]
1151
- });
1152
- $[2] = t2;
1153
- } else t2 = $[2];
1154
- let t3;
1155
- if ($[3] !== url) {
1156
- t3 = /* @__PURE__ */ jsx("p", {
1157
- className: "text-muted-foreground truncate text-xs",
1158
- children: url
1159
- });
1160
- $[3] = url;
1161
- $[4] = t3;
1162
- } else t3 = $[4];
1163
- const t4 = metaTitle || "Untitled";
1164
- let t5;
1165
- if ($[5] !== t4) {
1166
- t5 = truncateText(t4, 60);
1167
- $[5] = t4;
1168
- $[6] = t5;
1169
- } else t5 = $[6];
1170
- let t6;
1171
- if ($[7] !== t5) {
1172
- t6 = /* @__PURE__ */ jsx("p", {
1173
- className: "text-base font-medium text-blue-600 dark:text-blue-400",
1174
- children: t5
1175
- });
1176
- $[7] = t5;
1177
- $[8] = t6;
1178
- } else t6 = $[8];
1179
- const t7 = metaDescription || "No description";
1180
- let t8;
1181
- if ($[9] !== t7) {
1182
- t8 = truncateText(t7, 155);
1183
- $[9] = t7;
1184
- $[10] = t8;
1185
- } else t8 = $[10];
1186
- let t9;
1187
- if ($[11] !== t8) {
1188
- t9 = /* @__PURE__ */ jsx("p", {
1189
- className: "text-muted-foreground line-clamp-2 text-xs",
1190
- children: t8
1191
- });
1192
- $[11] = t8;
1193
- $[12] = t9;
1194
- } else t9 = $[12];
1195
- let t10;
1196
- if ($[13] !== t3 || $[14] !== t6 || $[15] !== t9) {
1197
- t10 = /* @__PURE__ */ jsxs("div", {
1198
- className: "space-y-1 pt-2",
1199
- children: [t2, /* @__PURE__ */ jsxs("div", {
1200
- className: "border-border space-y-0.5 rounded-lg border p-3",
1201
- children: [
1202
- t3,
1203
- t6,
1204
- t9
1205
- ]
1206
- })]
1207
- });
1208
- $[13] = t3;
1209
- $[14] = t6;
1210
- $[15] = t9;
1211
- $[16] = t10;
1212
- } else t10 = $[16];
1213
- return t10;
1214
- };
1215
- const SocialPreviewSection = (t0) => {
1216
- const $ = c(60);
1217
- if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
1218
- for (let $i = 0; $i < 60; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1219
- $[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
1220
- }
1221
- const { page, metaTitle, metaDescription, layoutId, projectName } = t0;
1222
- const pageMetaTitle = page.metaTitle ?? page.pathSegment;
1223
- let t1;
1224
- if ($[1] !== layoutId || $[2] !== page.metaDescription || $[3] !== pageMetaTitle || $[4] !== projectName) {
1225
- t1 = new URLSearchParams({
1226
- ...layoutId && { layoutId },
1227
- title: pageMetaTitle,
1228
- ...page.metaDescription && { description: page.metaDescription },
1229
- ...projectName && { projectName }
1230
- }).toString();
1231
- $[1] = layoutId;
1232
- $[2] = page.metaDescription;
1233
- $[3] = pageMetaTitle;
1234
- $[4] = projectName;
1235
- $[5] = t1;
1236
- } else t1 = $[5];
1237
- const generatedOgImage = `/og?${t1}`;
1238
- const ogImage = page.customOgImageUrl ?? generatedOgImage;
1239
- const url = `${typeof window !== "undefined" ? window.location.origin : ""}${page.fullPath}`;
1240
- const fileInputRef = React.useRef(null);
1241
- const queryClient = useQueryClient();
1242
- let t2;
1243
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
1244
- t2 = pageMutations.uploadCustomOgImage();
1245
- $[6] = t2;
1246
- } else t2 = $[6];
1247
- let t3;
1248
- if ($[7] !== page.id || $[8] !== queryClient) {
1249
- t3 = {
1250
- ...t2,
1251
- onSuccess: () => {
1252
- queryClient.invalidateQueries({ queryKey: pageQueries.getById(page.id).queryKey });
1253
- },
1254
- onError: _temp6
1255
- };
1256
- $[7] = page.id;
1257
- $[8] = queryClient;
1258
- $[9] = t3;
1259
- } else t3 = $[9];
1260
- const uploadCustomOgImage = useMutation(t3);
1261
- let t4;
1262
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
1263
- t4 = pageMutations.deleteCustomOgImage();
1264
- $[10] = t4;
1265
- } else t4 = $[10];
1266
- let t5;
1267
- if ($[11] !== page.id || $[12] !== queryClient) {
1268
- t5 = {
1269
- ...t4,
1270
- onSuccess: () => {
1271
- queryClient.invalidateQueries({ queryKey: pageQueries.getById(page.id).queryKey });
1272
- },
1273
- onError: _temp7
1274
- };
1275
- $[11] = page.id;
1276
- $[12] = queryClient;
1277
- $[13] = t5;
1278
- } else t5 = $[13];
1279
- const deleteCustomOgImage = useMutation(t5);
1280
- const hasCustomImage = !!page.customOgImageUrl;
1281
- const isBusy = uploadCustomOgImage.isPending || deleteCustomOgImage.isPending;
1282
- let t6;
1283
- if ($[14] !== page.id || $[15] !== uploadCustomOgImage) {
1284
- t6 = (files) => {
1285
- const file = files[0];
1286
- if (file) uploadCustomOgImage.mutate({
1287
- pageId: page.id,
1288
- file
1289
- });
1290
- };
1291
- $[14] = page.id;
1292
- $[15] = uploadCustomOgImage;
1293
- $[16] = t6;
1294
- } else t6 = $[16];
1295
- const handleFiles = t6;
1296
- let t7;
1297
- if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
1298
- t7 = /* @__PURE__ */ jsx(Label, { children: "Social preview" });
1299
- $[17] = t7;
1300
- } else t7 = $[17];
1301
- let t8;
1302
- if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
1303
- t8 = () => fileInputRef.current?.click();
1304
- $[18] = t8;
1305
- } else t8 = $[18];
1306
- let t9;
1307
- if ($[19] !== uploadCustomOgImage.isPending) {
1308
- t9 = uploadCustomOgImage.isPending ? /* @__PURE__ */ jsx(Spinner, {}) : /* @__PURE__ */ jsx(Upload, { className: "size-3.5" });
1309
- $[19] = uploadCustomOgImage.isPending;
1310
- $[20] = t9;
1311
- } else t9 = $[20];
1312
- const t10 = hasCustomImage ? "Replace custom image" : "Upload custom image";
1313
- let t11;
1314
- if ($[21] !== isBusy || $[22] !== t10 || $[23] !== t9) {
1315
- t11 = /* @__PURE__ */ jsxs(Button, {
1316
- type: "button",
1317
- variant: "secondary",
1318
- size: "sm",
1319
- disabled: isBusy,
1320
- onClick: t8,
1321
- children: [t9, t10]
1322
- });
1323
- $[21] = isBusy;
1324
- $[22] = t10;
1325
- $[23] = t9;
1326
- $[24] = t11;
1327
- } else t11 = $[24];
1328
- let t12;
1329
- if ($[25] !== deleteCustomOgImage || $[26] !== hasCustomImage || $[27] !== isBusy || $[28] !== page.id) {
1330
- t12 = hasCustomImage && /* @__PURE__ */ jsxs(Button, {
1331
- type: "button",
1332
- variant: "ghost",
1333
- disabled: isBusy,
1334
- onClick: () => deleteCustomOgImage.mutate({ pageId: page.id }),
1335
- "aria-label": "Remove custom image",
1336
- children: [
1337
- deleteCustomOgImage.isPending ? /* @__PURE__ */ jsx(Spinner, { className: "text-muted-foreground" }) : /* @__PURE__ */ jsx(Trash2, { className: "text-muted-foreground" }),
1338
- " ",
1339
- "Clear"
1340
- ]
1341
- });
1342
- $[25] = deleteCustomOgImage;
1343
- $[26] = hasCustomImage;
1344
- $[27] = isBusy;
1345
- $[28] = page.id;
1346
- $[29] = t12;
1347
- } else t12 = $[29];
1348
- let t13;
1349
- if ($[30] !== handleFiles) {
1350
- t13 = /* @__PURE__ */ jsx("input", {
1351
- type: "file",
1352
- ref: fileInputRef,
1353
- className: "hidden",
1354
- accept: "image/jpeg,image/png,image/gif,image/webp",
1355
- onChange: (e) => {
1356
- if (e.target.files) handleFiles(e.target.files);
1357
- e.target.value = "";
1358
- }
1359
- });
1360
- $[30] = handleFiles;
1361
- $[31] = t13;
1362
- } else t13 = $[31];
1363
- let t14;
1364
- if ($[32] !== t11 || $[33] !== t12 || $[34] !== t13) {
1365
- t14 = /* @__PURE__ */ jsxs("div", {
1366
- className: "flex items-center gap-2",
1367
- children: [
1368
- t11,
1369
- t12,
1370
- t13
1371
- ]
1372
- });
1373
- $[32] = t11;
1374
- $[33] = t12;
1375
- $[34] = t13;
1376
- $[35] = t14;
1377
- } else t14 = $[35];
1378
- const t15 = hasCustomImage ? "Drop image to replace" : "Drop image to upload";
1379
- let t16;
1380
- if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
1381
- t16 = { aspectRatio: "1200 / 630" };
1382
- $[36] = t16;
1383
- } else t16 = $[36];
1384
- let t17;
1385
- if ($[37] !== ogImage) {
1386
- t17 = /* @__PURE__ */ jsx("img", {
1387
- src: ogImage,
1388
- alt: "",
1389
- className: "w-full object-cover",
1390
- style: t16
1391
- });
1392
- $[37] = ogImage;
1393
- $[38] = t17;
1394
- } else t17 = $[38];
1395
- let t18;
1396
- if ($[39] !== handleFiles || $[40] !== t15 || $[41] !== t17) {
1397
- t18 = /* @__PURE__ */ jsx(UploadDropZone, {
1398
- onDrop: handleFiles,
1399
- label: t15,
1400
- className: "block",
1401
- children: t17
1402
- });
1403
- $[39] = handleFiles;
1404
- $[40] = t15;
1405
- $[41] = t17;
1406
- $[42] = t18;
1407
- } else t18 = $[42];
1408
- const t19 = metaTitle || "Untitled";
1409
- let t20;
1410
- if ($[43] !== t19) {
1411
- t20 = /* @__PURE__ */ jsx("p", {
1412
- className: "text-foreground truncate text-sm font-semibold",
1413
- children: t19
1414
- });
1415
- $[43] = t19;
1416
- $[44] = t20;
1417
- } else t20 = $[44];
1418
- const t21 = metaDescription || "No description";
1419
- let t22;
1420
- if ($[45] !== t21) {
1421
- t22 = /* @__PURE__ */ jsx("p", {
1422
- className: "text-muted-foreground line-clamp-2 text-xs",
1423
- children: t21
1424
- });
1425
- $[45] = t21;
1426
- $[46] = t22;
1427
- } else t22 = $[46];
1428
- let t23;
1429
- if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
1430
- t23 = /* @__PURE__ */ jsx(Globe, { className: "size-3 shrink-0" });
1431
- $[47] = t23;
1432
- } else t23 = $[47];
1433
- let t24;
1434
- if ($[48] !== url) {
1435
- t24 = /* @__PURE__ */ jsx("div", {
1436
- className: "pt-1.5",
1437
- children: /* @__PURE__ */ jsxs("p", {
1438
- className: "text-muted-foreground flex items-center gap-1 text-xs",
1439
- children: [t23, /* @__PURE__ */ jsx("span", {
1440
- className: "truncate",
1441
- children: url
1442
- })]
1443
- })
1444
- });
1445
- $[48] = url;
1446
- $[49] = t24;
1447
- } else t24 = $[49];
1448
- let t25;
1449
- if ($[50] !== t20 || $[51] !== t22 || $[52] !== t24) {
1450
- t25 = /* @__PURE__ */ jsxs("div", {
1451
- className: "space-y-1.5 border-t px-3 py-2.5",
1452
- children: [
1453
- t20,
1454
- t22,
1455
- t24
1456
- ]
1457
- });
1458
- $[50] = t20;
1459
- $[51] = t22;
1460
- $[52] = t24;
1461
- $[53] = t25;
1462
- } else t25 = $[53];
1463
- let t26;
1464
- if ($[54] !== t18 || $[55] !== t25) {
1465
- t26 = /* @__PURE__ */ jsxs("div", {
1466
- className: "border-border max-w-xl overflow-hidden rounded-lg border",
1467
- children: [t18, t25]
1468
- });
1469
- $[54] = t18;
1470
- $[55] = t25;
1471
- $[56] = t26;
1472
- } else t26 = $[56];
1473
- let t27;
1474
- if ($[57] !== t14 || $[58] !== t26) {
1475
- t27 = /* @__PURE__ */ jsxs("div", {
1476
- className: "space-y-2 pt-2",
1477
- children: [
1478
- t7,
1479
- t14,
1480
- t26
1481
- ]
1482
- });
1483
- $[57] = t14;
1484
- $[58] = t26;
1485
- $[59] = t27;
1486
- } else t27 = $[59];
1487
- return t27;
1488
- };
1489
- const PageMarkdownPreview = (t0) => {
1490
- const $ = c(9);
1491
- if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
1492
- for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1493
- $[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
1494
- }
1495
- const { pageId, metaTitle, metaDescription } = t0;
1496
- let t1;
1497
- if ($[1] !== pageId) {
1498
- t1 = blockQueries.getPageMarkdown(pageId);
1499
- $[1] = pageId;
1500
- $[2] = t1;
1501
- } else t1 = $[2];
1502
- const { data: markdown } = useQuery(t1);
1503
- if (markdown === void 0) {
1504
- let t2;
1505
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
1506
- t2 = /* @__PURE__ */ jsxs("div", {
1507
- className: "text-muted-foreground flex items-center gap-2 py-2 text-sm",
1508
- children: [/* @__PURE__ */ jsx(Spinner, { className: "size-3.5" }), "Loading..."]
1509
- });
1510
- $[3] = t2;
1511
- } else t2 = $[3];
1512
- return t2;
1513
- }
1514
- const t2 = `title: "${metaTitle}"`;
1515
- const t3 = `description: "${metaDescription}"`;
1516
- let frontmatterLines;
1517
- if ($[4] !== t2 || $[5] !== t3) {
1518
- frontmatterLines = [
1519
- "---",
1520
- t2,
1521
- t3
1522
- ];
1523
- frontmatterLines.push("---");
1524
- $[4] = t2;
1525
- $[5] = t3;
1526
- $[6] = frontmatterLines;
1527
- } else frontmatterLines = $[6];
1528
- const fullMarkdown = frontmatterLines.join("\n") + "\n\n" + (markdown ?? "");
1529
- let t4;
1530
- if ($[7] !== fullMarkdown) {
1531
- t4 = /* @__PURE__ */ jsx(ShikiMarkdown, { code: fullMarkdown });
1532
- $[7] = fullMarkdown;
1533
- $[8] = t4;
1534
- } else t4 = $[8];
1535
- return t4;
1536
- };
1537
- function _temp() {
1538
- toast.error("Could not update page");
1539
- }
1540
- function _temp2() {
1541
- toast.error("Could not update page layout");
1542
- }
1543
- function _temp6(error) {
1544
- toast.error(error.message || "Could not upload image");
1545
- }
1546
- function _temp7() {
1547
- toast.error("Could not remove image");
1548
- }
1549
-
1550
- //#endregion
1551
- export { PageInfoSidebar, PageMarkdownContent, PageSeoContent };