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,331 +0,0 @@
1
- import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
2
- import { blockQueries, commentMutations, commentQueries } from "../../../lib/queries.js";
3
- import { areCommentsEnabled } from "../commentsEnabled.js";
4
- import { previewStore } from "../previewStore.js";
5
- import { getCommentTargetFieldType, previewCommentsStore, revealCommentTarget } from "../previewCommentsStore.js";
6
- import { usePageComments } from "../usePageComments.js";
7
- import { CommentHeader } from "./CommentHeader.js";
8
- import { CommentTargetQuote } from "./CommentTargetQuote.js";
9
- import { SendFeedbackDialog } from "./SendFeedbackDialog.js";
10
- import { SidebarSection, SidebarSectionContent, SidebarSectionHeader } from "./SidebarSection.js";
11
- import { c } from "react/compiler-runtime";
12
- import { useMutation, useQueryClient } from "@tanstack/react-query";
13
- import * as React from "react";
14
- import { jsx, jsxs } from "react/jsx-runtime";
15
- import { useSelector } from "@xstate/store-react";
16
- import { COMMENT_MESSAGE_MAX_LENGTH } from "@camox/api-contract";
17
- import { Button } from "@camox/ui/button";
18
- import { Archive, ArrowUp, CornerLeftUp, Eye, X } from "lucide-react";
19
- import { toast } from "@camox/ui/toaster";
20
- import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupTextarea } from "@camox/ui/input-group";
21
- import { ButtonGroup } from "@camox/ui/button-group";
22
-
23
- //#region src/features/preview/components/AttachedComments.tsx
24
- function resizeComposer(element) {
25
- element.style.height = "auto";
26
- element.style.height = `${element.scrollHeight}px`;
27
- }
28
- function editorTarget({ blockId, itemId, fieldName }) {
29
- if (blockId == null) return { kind: "page" };
30
- if (itemId != null) {
31
- if (fieldName != null) return {
32
- kind: "item-field",
33
- blockId,
34
- itemId,
35
- fieldName
36
- };
37
- return {
38
- kind: "item",
39
- blockId,
40
- itemId
41
- };
42
- }
43
- if (fieldName != null) return {
44
- kind: "block-field",
45
- blockId,
46
- fieldName
47
- };
48
- return {
49
- kind: "block",
50
- blockId
51
- };
52
- }
53
- /** Gate before mounting queries, mutations, or composers. */
54
- function AttachedComments(props) {
55
- const $ = c(3);
56
- if ($[0] !== "8254f8bf23ff0138d71d56295c89e5b6eb791bb39cd29713ed38f79fecd96403") {
57
- for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
58
- $[0] = "8254f8bf23ff0138d71d56295c89e5b6eb791bb39cd29713ed38f79fecd96403";
59
- }
60
- if (!areCommentsEnabled() || props.pageId == null) return null;
61
- let t0;
62
- if ($[1] !== props) {
63
- t0 = /* @__PURE__ */ jsx(EnabledAttachedComments, {
64
- ...props,
65
- pageId: props.pageId
66
- });
67
- $[1] = props;
68
- $[2] = t0;
69
- } else t0 = $[2];
70
- return t0;
71
- }
72
- /** Shared comment list and composer for editors and the Feedback sidebar. */
73
- function EnabledAttachedComments({ pageId, blockId, itemId, fieldName, allPageComments = false }) {
74
- const camoxApp = useCamoxApp();
75
- const queryClient = useQueryClient();
76
- const commentsQuery = usePageComments(pageId);
77
- const { draft, activeId, focusTarget } = useSelector(previewCommentsStore, (state) => state.context);
78
- const target = editorTarget({
79
- blockId,
80
- itemId,
81
- fieldName
82
- });
83
- const matches = (entry) => entry.pageId === pageId && (allPageComments || entry.target != null && entry.target.kind === target.kind && (!("blockId" in entry.target) || entry.target.blockId === blockId) && (!("itemId" in entry.target) || entry.target.itemId === itemId) && (!("fieldName" in entry.target) || entry.target.fieldName === fieldName));
84
- const attached = (commentsQuery.data ?? []).filter(matches);
85
- const visible = attached.filter((comment) => !comment.resolved);
86
- const currentDraft = draft && matches(draft) ? draft : null;
87
- const selected = attached.find((comment_0) => comment_0.id === activeId);
88
- const textarea = React.useRef(null);
89
- const activeComment = React.useRef(null);
90
- const draftTarget = currentDraft?.target;
91
- const message = currentDraft?.message ?? "";
92
- const submitting = React.useRef(false);
93
- const setResolved = useMutation({
94
- ...commentMutations.setResolved(),
95
- onSuccess: (comment_1, submitted) => {
96
- const queryKey = commentQueries.list(submitted.pageId).queryKey;
97
- queryClient.setQueryData(queryKey, (comments) => comments?.map((entry_0) => entry_0.id === comment_1.id ? comment_1 : entry_0));
98
- queryClient.invalidateQueries({ queryKey });
99
- },
100
- onError: () => toast.error("Could not update feedback. Please try again.")
101
- });
102
- const createComment = useMutation({
103
- ...commentMutations.create(),
104
- onSuccess: (comment_2, submitted_0) => {
105
- const queryKey_0 = commentQueries.list(submitted_0.pageId).queryKey;
106
- queryClient.setQueryData(queryKey_0, (comments_0) => {
107
- if (!comments_0) return void 0;
108
- return [...comments_0.filter((entry_1) => entry_1.id !== comment_2.id), comment_2].sort((a, b) => a.createdAt - b.createdAt || a.id.localeCompare(b.id));
109
- });
110
- queryClient.invalidateQueries({ queryKey: queryKey_0 });
111
- previewCommentsStore.send({
112
- type: "postSucceeded",
113
- draft: submitted_0
114
- });
115
- },
116
- onSettled: () => {
117
- submitting.current = false;
118
- }
119
- });
120
- const selectComment = async (id, target_0) => {
121
- previewCommentsStore.send({
122
- type: "selectComment",
123
- id
124
- });
125
- if (target_0.kind === "page") {
126
- revealCommentTarget(target_0);
127
- return;
128
- }
129
- try {
130
- const bundle = await queryClient.fetchQuery(blockQueries.get(target_0.blockId));
131
- if (previewCommentsStore.getSnapshot().context.activeId !== id) return;
132
- if ("itemId" in target_0 && !bundle.repeatableItems.some((item) => item.id === target_0.itemId)) {
133
- toast.error("This feedback target is no longer available.");
134
- return;
135
- }
136
- const fieldType = getCommentTargetFieldType(target_0, bundle, camoxApp);
137
- if ("fieldName" in target_0 && !fieldType) {
138
- toast.error("This feedback field is no longer available.");
139
- return;
140
- }
141
- revealCommentTarget(target_0, fieldType);
142
- } catch {
143
- toast.error("This feedback target is no longer available.");
144
- }
145
- };
146
- React.useLayoutEffect(() => {
147
- if (textarea.current) resizeComposer(textarea.current);
148
- }, [message, pageId]);
149
- React.useEffect(() => {
150
- const element = textarea.current;
151
- if (!element) return;
152
- let width = element.clientWidth;
153
- const observer = new ResizeObserver(() => {
154
- if (element.clientWidth === width) return;
155
- width = element.clientWidth;
156
- resizeComposer(element);
157
- });
158
- observer.observe(element);
159
- return () => observer.disconnect();
160
- }, [pageId]);
161
- const submit = () => {
162
- if (!areCommentsEnabled() || !currentDraft || !message.trim() || submitting.current) return;
163
- submitting.current = true;
164
- createComment.mutate(currentDraft);
165
- };
166
- React.useEffect(() => {
167
- if (!draftTarget || focusTarget !== draftTarget || !textarea.current) return;
168
- textarea.current?.scrollIntoView({ block: "nearest" });
169
- textarea.current?.focus({ preventScroll: true });
170
- previewCommentsStore.send({ type: "composerFocused" });
171
- }, [draftTarget, focusTarget]);
172
- React.useEffect(() => {
173
- if (!selected) return;
174
- activeComment.current?.scrollIntoView({ block: "nearest" });
175
- }, [selected]);
176
- return /* @__PURE__ */ jsxs(SidebarSection, {
177
- "aria-label": allPageComments ? "Feedback" : blockId == null ? "Page comments" : fieldName ? `Comments on ${fieldName}` : itemId == null ? "Block comments" : "Item comments",
178
- divider: allPageComments ? "none" : "top",
179
- children: [allPageComments ? /* @__PURE__ */ jsxs("div", {
180
- className: "flex items-center justify-between gap-2",
181
- children: [/* @__PURE__ */ jsx("h2", {
182
- className: "text-base font-semibold",
183
- children: "Feedback"
184
- }), /* @__PURE__ */ jsx(Button, {
185
- type: "button",
186
- variant: "ghost",
187
- size: "icon-sm",
188
- "aria-label": "End comment mode",
189
- onClick: () => previewStore.send({
190
- type: "setCommentMode",
191
- enabled: false
192
- }),
193
- children: /* @__PURE__ */ jsx(X, { className: "text-muted-foreground" })
194
- })]
195
- }) : /* @__PURE__ */ jsx(SidebarSectionHeader, { children: "Feedback" }), /* @__PURE__ */ jsxs(SidebarSectionContent, { children: [
196
- commentsQuery.isPending && /* @__PURE__ */ jsx("p", {
197
- className: "text-muted-foreground text-sm",
198
- children: "Loading feedback…"
199
- }),
200
- commentsQuery.isError && /* @__PURE__ */ jsxs("div", {
201
- role: "alert",
202
- className: "text-sm",
203
- children: [
204
- "Could not load feedback.",
205
- " ",
206
- /* @__PURE__ */ jsx(Button, {
207
- type: "button",
208
- variant: "link",
209
- onClick: () => void commentsQuery.refetch(),
210
- children: "Retry"
211
- })
212
- ]
213
- }),
214
- allPageComments && commentsQuery.isSuccess && visible.length === 0 && /* @__PURE__ */ jsxs("p", {
215
- className: "text-muted-foreground text-sm",
216
- children: [attached.length === 0 ? "No feedback yet." : "No unresolved feedback.", " Select something on the page to comment on it."]
217
- }),
218
- visible.map((comment_3) => /* @__PURE__ */ jsxs("div", {
219
- ref: comment_3.id === activeId ? activeComment : void 0,
220
- className: "rounded-md p-1",
221
- children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(CommentHeader, {
222
- author: comment_3.author,
223
- createdAt: comment_3.createdAt
224
- }), /* @__PURE__ */ jsxs("div", {
225
- className: "pl-8",
226
- children: [allPageComments && (comment_3.target ? /* @__PURE__ */ jsx(CommentTargetQuote, {
227
- pageId,
228
- target: comment_3.target
229
- }) : /* @__PURE__ */ jsx("p", {
230
- className: "text-muted-foreground text-sm",
231
- children: "Target no longer available"
232
- })), /* @__PURE__ */ jsx("p", {
233
- className: "text-sm wrap-break-word whitespace-pre-wrap",
234
- children: comment_3.message
235
- })]
236
- })] }), /* @__PURE__ */ jsxs(ButtonGroup, {
237
- className: "mt-2 ml-8",
238
- "aria-label": "Comment actions",
239
- children: [
240
- allPageComments && /* @__PURE__ */ jsxs(Button, {
241
- type: "button",
242
- variant: "outline",
243
- size: "sm",
244
- disabled: comment_3.target == null,
245
- onClick: () => {
246
- if (comment_3.target) selectComment(comment_3.id, comment_3.target);
247
- },
248
- children: [/* @__PURE__ */ jsx(Eye, { className: "text-muted-foreground" }), "View"]
249
- }),
250
- !allPageComments && /* @__PURE__ */ jsxs(Button, {
251
- type: "button",
252
- variant: "outline",
253
- size: "sm",
254
- onClick: () => previewStore.send({
255
- type: "setCommentMode",
256
- enabled: true
257
- }),
258
- children: [/* @__PURE__ */ jsx(CornerLeftUp, { className: "text-muted-foreground" }), "See all"]
259
- }),
260
- /* @__PURE__ */ jsxs(Button, {
261
- type: "button",
262
- variant: "outline",
263
- size: "sm",
264
- "aria-label": "Archive comment",
265
- disabled: setResolved.isPending,
266
- onClick: () => {
267
- setResolved.mutate({
268
- pageId,
269
- id: comment_3.id,
270
- resolved: true
271
- });
272
- },
273
- children: [/* @__PURE__ */ jsx(Archive, { className: "text-muted-foreground" }), "Archive"]
274
- })
275
- ]
276
- })]
277
- }, comment_3.id)),
278
- allPageComments && /* @__PURE__ */ jsx(SendFeedbackDialog, {
279
- pageId,
280
- disabled: visible.length === 0
281
- }, pageId),
282
- !allPageComments && /* @__PURE__ */ jsxs(InputGroup, { children: [/* @__PURE__ */ jsx(InputGroupTextarea, {
283
- ref: textarea,
284
- "aria-label": "Comment text",
285
- placeholder: "Add a comment",
286
- className: "block field-sizing-fixed min-h-0 flex-none overflow-hidden leading-6",
287
- rows: 1,
288
- value: message,
289
- maxLength: COMMENT_MESSAGE_MAX_LENGTH,
290
- onKeyDown: (event) => {
291
- if (event.key !== "Enter" || event.shiftKey || event.nativeEvent.isComposing) return;
292
- event.preventDefault();
293
- event.stopPropagation();
294
- submit();
295
- },
296
- onChange: (event_0) => {
297
- if (!currentDraft) previewCommentsStore.send({
298
- type: "startComment",
299
- pageId,
300
- target
301
- });
302
- previewCommentsStore.send({
303
- type: "setMessage",
304
- message: event_0.target.value
305
- });
306
- }
307
- }), /* @__PURE__ */ jsx(InputGroupAddon, {
308
- align: "block-end",
309
- className: "justify-end",
310
- children: /* @__PURE__ */ jsx(InputGroupButton, {
311
- type: "button",
312
- size: "icon-sm",
313
- variant: "default",
314
- className: "rounded-full",
315
- "aria-label": "Post comment",
316
- disabled: !message.trim() || createComment.isPending,
317
- onClick: submit,
318
- children: /* @__PURE__ */ jsx(ArrowUp, { size: 16 })
319
- })
320
- })] }),
321
- createComment.isError && currentDraft?.id === createComment.variables?.id && /* @__PURE__ */ jsx("p", {
322
- role: "alert",
323
- className: "text-destructive text-sm",
324
- children: "Could not post feedback. Your draft is saved here; try posting again."
325
- })
326
- ] })]
327
- });
328
- }
329
-
330
- //#endregion
331
- export { AttachedComments };
@@ -1,122 +0,0 @@
1
- import { c } from "react/compiler-runtime";
2
- import * as React from "react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- import { Avatar, AvatarFallback, AvatarImage } from "@camox/ui/avatar";
5
-
6
- //#region src/features/preview/components/CommentHeader.tsx
7
- function CommentHeader(t0) {
8
- const $ = c(27);
9
- if ($[0] !== "7228323105605d4be0594558d7e4fb389f5d49bc9cb13e6a90c0c2fc6f9ff60f") {
10
- for (let $i = 0; $i < 27; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
11
- $[0] = "7228323105605d4be0594558d7e4fb389f5d49bc9cb13e6a90c0c2fc6f9ff60f";
12
- }
13
- const { author, createdAt } = t0;
14
- const [now, setNow] = React.useState(Date.now);
15
- let t1;
16
- let t2;
17
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
18
- t1 = () => {
19
- const timer = window.setInterval(() => setNow(Date.now()), 6e4);
20
- return () => window.clearInterval(timer);
21
- };
22
- t2 = [];
23
- $[1] = t1;
24
- $[2] = t2;
25
- } else {
26
- t1 = $[1];
27
- t2 = $[2];
28
- }
29
- React.useEffect(t1, t2);
30
- const minutes = Math.max(0, Math.floor((now - createdAt) / 6e4));
31
- const age = minutes < 1 ? "now" : minutes < 60 ? `${minutes}m` : minutes < 1440 ? `${Math.floor(minutes / 60)}h` : `${Math.floor(minutes / 1440)}d`;
32
- let t3;
33
- if ($[3] !== author.name) {
34
- t3 = author.name.trim().split(/\s+/).map(_temp).join("").slice(0, 2).toUpperCase();
35
- $[3] = author.name;
36
- $[4] = t3;
37
- } else t3 = $[4];
38
- const initials = t3;
39
- let t4;
40
- if ($[5] !== author.image || $[6] !== author.name) {
41
- t4 = author.image && /* @__PURE__ */ jsx(AvatarImage, {
42
- src: author.image,
43
- alt: author.name
44
- });
45
- $[5] = author.image;
46
- $[6] = author.name;
47
- $[7] = t4;
48
- } else t4 = $[7];
49
- let t5;
50
- if ($[8] !== initials) {
51
- t5 = /* @__PURE__ */ jsx(AvatarFallback, { children: initials });
52
- $[8] = initials;
53
- $[9] = t5;
54
- } else t5 = $[9];
55
- let t6;
56
- if ($[10] !== t4 || $[11] !== t5) {
57
- t6 = /* @__PURE__ */ jsxs(Avatar, {
58
- size: "sm",
59
- children: [t4, t5]
60
- });
61
- $[10] = t4;
62
- $[11] = t5;
63
- $[12] = t6;
64
- } else t6 = $[12];
65
- let t7;
66
- if ($[13] !== author.name) {
67
- t7 = /* @__PURE__ */ jsx("span", {
68
- className: "truncate text-sm font-medium",
69
- title: author.name,
70
- children: author.name
71
- });
72
- $[13] = author.name;
73
- $[14] = t7;
74
- } else t7 = $[14];
75
- let t8;
76
- if ($[15] !== createdAt) {
77
- t8 = new Date(createdAt).toISOString();
78
- $[15] = createdAt;
79
- $[16] = t8;
80
- } else t8 = $[16];
81
- let t9;
82
- if ($[17] !== createdAt) {
83
- t9 = new Date(createdAt).toLocaleString();
84
- $[17] = createdAt;
85
- $[18] = t9;
86
- } else t9 = $[18];
87
- let t10;
88
- if ($[19] !== age || $[20] !== t8 || $[21] !== t9) {
89
- t10 = /* @__PURE__ */ jsx("time", {
90
- className: "text-muted-foreground shrink-0 text-xs",
91
- dateTime: t8,
92
- title: t9,
93
- children: age
94
- });
95
- $[19] = age;
96
- $[20] = t8;
97
- $[21] = t9;
98
- $[22] = t10;
99
- } else t10 = $[22];
100
- let t11;
101
- if ($[23] !== t10 || $[24] !== t6 || $[25] !== t7) {
102
- t11 = /* @__PURE__ */ jsxs("header", {
103
- className: "mb-2 flex min-w-0 items-center gap-2",
104
- children: [
105
- t6,
106
- t7,
107
- t10
108
- ]
109
- });
110
- $[23] = t10;
111
- $[24] = t6;
112
- $[25] = t7;
113
- $[26] = t11;
114
- } else t11 = $[26];
115
- return t11;
116
- }
117
- function _temp(part) {
118
- return part[0];
119
- }
120
-
121
- //#endregion
122
- export { CommentHeader };
@@ -1,29 +0,0 @@
1
- import { AttachedComments } from "./AttachedComments.js";
2
- import { c } from "react/compiler-runtime";
3
- import { jsx } from "react/jsx-runtime";
4
-
5
- //#region src/features/preview/components/CommentSidebar.tsx
6
- function CommentSidebar(t0) {
7
- const $ = c(3);
8
- if ($[0] !== "d6df60b689386423d40951e6785b3daf7545c90c2ab947b318a4d6c91e5fdf67") {
9
- for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
10
- $[0] = "d6df60b689386423d40951e6785b3daf7545c90c2ab947b318a4d6c91e5fdf67";
11
- }
12
- const { pageId } = t0;
13
- let t1;
14
- if ($[1] !== pageId) {
15
- t1 = /* @__PURE__ */ jsx("div", {
16
- className: "min-h-0 flex-1 overflow-auto",
17
- children: /* @__PURE__ */ jsx(AttachedComments, {
18
- pageId,
19
- allPageComments: true
20
- })
21
- });
22
- $[1] = pageId;
23
- $[2] = t1;
24
- } else t1 = $[2];
25
- return t1;
26
- }
27
-
28
- //#endregion
29
- export { CommentSidebar };
@@ -1,167 +0,0 @@
1
- import { isLexicalState, lexicalStateToPlainText } from "../../../core/lib/lexicalState.js";
2
- import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
3
- import { blockQueries, pageQueries } from "../../../lib/queries.js";
4
- import { getCommentTargetFieldType } from "../previewCommentsStore.js";
5
- import { c } from "react/compiler-runtime";
6
- import { useQuery } from "@tanstack/react-query";
7
- import { jsx } from "react/jsx-runtime";
8
-
9
- //#region src/features/preview/components/CommentTargetQuote.tsx
10
- function Quote(t0) {
11
- const $ = c(3);
12
- if ($[0] !== "3d839e9320d85d713ee71a099780efa90c475e3bad1d5b3892ff6d87762000ab") {
13
- for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
14
- $[0] = "3d839e9320d85d713ee71a099780efa90c475e3bad1d5b3892ff6d87762000ab";
15
- }
16
- const { children } = t0;
17
- let t1;
18
- if ($[1] !== children) {
19
- t1 = /* @__PURE__ */ jsx("blockquote", {
20
- className: "text-muted-foreground my-2 border-l-2 border-yellow-600 pl-2 text-sm wrap-break-word whitespace-pre-wrap",
21
- children
22
- });
23
- $[1] = children;
24
- $[2] = t1;
25
- } else t1 = $[2];
26
- return t1;
27
- }
28
- function PageQuote(t0) {
29
- const $ = c(5);
30
- if ($[0] !== "3d839e9320d85d713ee71a099780efa90c475e3bad1d5b3892ff6d87762000ab") {
31
- for (let $i = 0; $i < 5; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
32
- $[0] = "3d839e9320d85d713ee71a099780efa90c475e3bad1d5b3892ff6d87762000ab";
33
- }
34
- const { pageId } = t0;
35
- let t1;
36
- if ($[1] !== pageId) {
37
- t1 = pageQueries.getById(pageId);
38
- $[1] = pageId;
39
- $[2] = t1;
40
- } else t1 = $[2];
41
- const { data: page, isPending } = useQuery(t1);
42
- const t2 = page?.nickname || (isPending ? "Loading…" : "Page unavailable");
43
- let t3;
44
- if ($[3] !== t2) {
45
- t3 = /* @__PURE__ */ jsx(Quote, { children: t2 });
46
- $[3] = t2;
47
- $[4] = t3;
48
- } else t3 = $[4];
49
- return t3;
50
- }
51
- function BlockQuote(t0) {
52
- const $ = c(19);
53
- if ($[0] !== "3d839e9320d85d713ee71a099780efa90c475e3bad1d5b3892ff6d87762000ab") {
54
- for (let $i = 0; $i < 19; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
55
- $[0] = "3d839e9320d85d713ee71a099780efa90c475e3bad1d5b3892ff6d87762000ab";
56
- }
57
- const { target } = t0;
58
- const app = useCamoxApp();
59
- let t1;
60
- if ($[1] !== target.blockId) {
61
- t1 = blockQueries.get(target.blockId);
62
- $[1] = target.blockId;
63
- $[2] = t1;
64
- } else t1 = $[2];
65
- const { data: bundle, isPending } = useQuery(t1);
66
- if (!bundle) {
67
- const t2 = isPending ? "Loading…" : "Content unavailable";
68
- let t3;
69
- if ($[3] !== t2) {
70
- t3 = /* @__PURE__ */ jsx(Quote, { children: t2 });
71
- $[3] = t2;
72
- $[4] = t3;
73
- } else t3 = $[4];
74
- return t3;
75
- }
76
- let t2;
77
- if ($[5] !== bundle.block || $[6] !== bundle.repeatableItems || $[7] !== target) {
78
- t2 = "itemId" in target ? bundle.repeatableItems.find((item) => item.id === target.itemId) : bundle.block;
79
- $[5] = bundle.block;
80
- $[6] = bundle.repeatableItems;
81
- $[7] = target;
82
- $[8] = t2;
83
- } else t2 = $[8];
84
- const subject = t2;
85
- if (!subject) {
86
- let t3;
87
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
88
- t3 = /* @__PURE__ */ jsx(Quote, { children: "Content unavailable" });
89
- $[9] = t3;
90
- } else t3 = $[9];
91
- return t3;
92
- }
93
- if ("fieldName" in target) {
94
- const fieldType = getCommentTargetFieldType(target, bundle, app);
95
- const value = subject.content[target.fieldName];
96
- if (fieldType === "String") {
97
- if (typeof value === "string" || isLexicalState(value)) {
98
- let t3;
99
- if ($[10] !== value) {
100
- t3 = lexicalStateToPlainText(value) || "Empty text";
101
- $[10] = value;
102
- $[11] = t3;
103
- } else t3 = $[11];
104
- let t4;
105
- if ($[12] !== t3) {
106
- t4 = /* @__PURE__ */ jsx(Quote, { children: t3 });
107
- $[12] = t3;
108
- $[13] = t4;
109
- } else t4 = $[13];
110
- return t4;
111
- }
112
- if (value == null) {
113
- let t3;
114
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
115
- t3 = /* @__PURE__ */ jsx(Quote, { children: "Empty text" });
116
- $[14] = t3;
117
- } else t3 = $[14];
118
- return t3;
119
- }
120
- }
121
- if (fieldType === "Link" && value && typeof value === "object" && "text" in value && typeof value.text === "string") {
122
- const t3 = value.text || "Empty link text";
123
- let t4;
124
- if ($[15] !== t3) {
125
- t4 = /* @__PURE__ */ jsx(Quote, { children: t3 });
126
- $[15] = t3;
127
- $[16] = t4;
128
- } else t4 = $[16];
129
- return t4;
130
- }
131
- }
132
- const t3 = subject.summary || ("itemId" in target ? "Untitled item" : "Untitled block");
133
- let t4;
134
- if ($[17] !== t3) {
135
- t4 = /* @__PURE__ */ jsx(Quote, { children: t3 });
136
- $[17] = t3;
137
- $[18] = t4;
138
- } else t4 = $[18];
139
- return t4;
140
- }
141
- function CommentTargetQuote(t0) {
142
- const $ = c(5);
143
- if ($[0] !== "3d839e9320d85d713ee71a099780efa90c475e3bad1d5b3892ff6d87762000ab") {
144
- for (let $i = 0; $i < 5; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
145
- $[0] = "3d839e9320d85d713ee71a099780efa90c475e3bad1d5b3892ff6d87762000ab";
146
- }
147
- const { pageId, target } = t0;
148
- if (target.kind === "page") {
149
- let t1;
150
- if ($[1] !== pageId) {
151
- t1 = /* @__PURE__ */ jsx(PageQuote, { pageId });
152
- $[1] = pageId;
153
- $[2] = t1;
154
- } else t1 = $[2];
155
- return t1;
156
- }
157
- let t1;
158
- if ($[3] !== target) {
159
- t1 = /* @__PURE__ */ jsx(BlockQuote, { target });
160
- $[3] = target;
161
- $[4] = t1;
162
- } else t1 = $[4];
163
- return t1;
164
- }
165
-
166
- //#endregion
167
- export { CommentTargetQuote };
@@ -1,5 +0,0 @@
1
- import { PageRenderInput } from "../../runtime/runtime.js";
2
- //#region src/features/preview/components/DerivedLayoutSidebar.d.ts
3
- type DerivedLayoutStructure = NonNullable<PageRenderInput["derived"]>["layout"];
4
- //#endregion
5
- export { DerivedLayoutStructure };