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.
- package/dist/components/AuthGate.js +0 -6
- package/dist/components/DeviceSelector.js +96 -0
- package/dist/components/PlatformLabel.js +20 -24
- package/dist/core/components/lexical/HighlightNode.js +1 -1
- package/dist/core/components/lexical/InlineContentEditable.js +15 -19
- package/dist/core/components/lexical/InlineLexicalEditor.js +54 -74
- package/dist/core/components/lexical/InlineStylesPlugin.js +53 -53
- package/dist/core/components/lexical/MaxLengthPlugin.js +59 -0
- package/dist/core/components/lexical/SelectionBroadcaster.js +53 -54
- package/dist/core/components/lexical/SidebarLexicalEditor.js +322 -229
- package/dist/core/components/lexical/SummaryToggleGuard.js +42 -0
- package/dist/core/components/lexical/TextLinkPopover.js +169 -180
- package/dist/core/createApp.d.ts +241 -312
- package/dist/core/createApp.js +123 -29
- package/dist/core/createBlock.d.ts +5 -5
- package/dist/core/createBlock.js +385 -152
- package/dist/core/createCollection.d.ts +55 -0
- package/dist/core/createCollection.js +93 -0
- package/dist/core/createLayout.d.ts +197 -61
- package/dist/core/createLayout.js +114 -56
- package/dist/core/defineDocument.d.ts +3 -5
- package/dist/core/derivedRoutes.js +49 -1
- package/dist/core/dom.d.ts +13 -4
- package/dist/core/dom.js +44 -1
- package/dist/core/editing/BlockEditingRuntime.d.ts +16 -0
- package/dist/core/editing/BlockEditingRuntime.js +6 -15
- package/dist/core/editing/CompleteBlockEditingRuntime.js +28 -23
- package/dist/core/editing/createEditableBlock.d.ts +754 -633
- package/dist/core/editing/createEditableBlock.js +2113 -1066
- package/dist/core/editing/referenceWrites.js +51 -0
- package/dist/core/editing/useLatestRecord.js +90 -0
- package/dist/core/hooks/useArtifactHost.js +139 -0
- package/dist/core/hooks/useFieldSelection.js +43 -18
- package/dist/core/hooks/useIsEditable.js +12 -10
- package/dist/core/hooks/useOverlayMessage.js +15 -19
- package/dist/core/lib/artifact.d.ts +21 -0
- package/dist/core/lib/artifact.js +154 -0
- package/dist/core/lib/artifactColors.js +123 -0
- package/dist/core/lib/artifactData.d.ts +1 -0
- package/dist/core/lib/artifactData.js +131 -0
- package/dist/core/lib/artifactHost.js +205 -0
- package/dist/core/lib/artifactRuntime.js +36 -0
- package/dist/core/lib/artifactTheme.js +57 -0
- package/dist/core/lib/contentType.d.ts +302 -106
- package/dist/core/lib/contentType.js +201 -173
- package/dist/core/lib/fieldTypes.js +3 -0
- package/dist/core/lib/iconTypes.d.ts +3 -3
- package/dist/core/lib/icons.d.ts +4 -4
- package/dist/core/lib/icons.js +40 -44
- package/dist/core/lib/imagePlaceholder.js +177 -0
- package/dist/core/lib/imageTransform.js +1 -1
- package/dist/core/lib/lexicalReact.d.ts +3 -1
- package/dist/core/lib/lexicalState.js +1 -1
- package/dist/core/lib/previewPaused.js +9 -0
- package/dist/core/lib/recordScope.js +316 -0
- package/dist/core/lib/reference.d.ts +81 -0
- package/dist/core/lib/reference.js +29 -0
- package/dist/core/lib/textLinks.js +7 -5
- package/dist/core/lib/textStyles.d.ts +5 -7
- package/dist/core/lib/textStyles.js +2 -2
- package/dist/core/notFound.d.ts +7 -0
- package/dist/core/notFound.js +11 -0
- package/dist/core/pageDestinations.js +6 -3
- package/dist/core/recordItem.js +34 -0
- package/dist/core/requestContext.d.ts +26 -0
- package/dist/core/requestContext.js +20 -0
- package/dist/features/canvas/CamoxCanvas.js +1401 -0
- package/dist/features/canvas/CanvasLoadingScreen.js +35 -0
- package/dist/features/canvas/CanvasOverlays.js +254 -0
- package/dist/features/canvas/CanvasPageEdge.js +87 -0
- package/dist/features/canvas/CanvasPageFrame.js +333 -0
- package/dist/features/canvas/CanvasPageHeader.js +125 -0
- package/dist/features/canvas/CanvasPreviewPageSlot.js +123 -0
- package/dist/features/canvas/DerivedPagePathInput.js +238 -0
- package/dist/features/canvas/canvasCamera.js +229 -0
- package/dist/features/canvas/canvasFlight.js +104 -0
- package/dist/features/canvas/canvasFrameCapture.js +364 -0
- package/dist/features/canvas/canvasFrameDocument.js +302 -0
- package/dist/features/canvas/canvasFrameMode.js +53 -0
- package/dist/features/canvas/canvasInsertionSeams.js +44 -0
- package/dist/features/canvas/canvasItems.js +30 -0
- package/dist/features/canvas/canvasOverlayGeometry.js +240 -0
- package/dist/features/canvas/canvasPages.js +79 -0
- package/dist/features/canvas/canvasScreenSpace.js +26 -0
- package/dist/features/canvas/canvasSelection.js +18 -0
- package/dist/features/canvas/canvasStore.js +60 -0
- package/dist/features/canvas/canvasThumbnails.js +304 -0
- package/dist/features/canvas/canvasZoom.js +10 -0
- package/dist/features/canvas/sidebar/CanvasInspector.js +202 -0
- package/dist/features/canvas/sidebar/CanvasNavigator.js +124 -0
- package/dist/features/canvas/sidebar/CanvasSidebar.js +54 -0
- package/dist/features/canvas/sidebar/CanvasSidebarFrame.js +48 -0
- package/dist/features/canvas/sidebar/CanvasSidebarSkeleton.js +39 -0
- package/dist/features/canvas/sidebar/CuratedPageInspector.js +69 -0
- package/dist/features/canvas/sidebar/DerivedPageInspector.js +37 -0
- package/dist/features/canvas/sidebar/LayoutPageBlocks.js +78 -0
- package/dist/features/canvas/sidebar/LayoutPageOverview.js +71 -0
- package/dist/features/canvas/sidebar/PageInspector.js +157 -0
- package/dist/features/canvas/sidebar/PageInspectorSkeleton.js +90 -0
- package/dist/features/canvas/sidebar/PageOverview.js +27 -0
- package/dist/features/canvas/sidebar/SingletonPageInspector.js +31 -0
- package/dist/features/canvas/useCanvasCamera.js +783 -0
- package/dist/features/canvas/useCanvasFrame.js +148 -0
- package/dist/features/canvas/useCanvasFrameInput.js +97 -0
- package/dist/features/canvas/useCanvasNearness.js +57 -0
- package/dist/features/canvas/useDiscoveredPreviewPaths.js +62 -0
- package/dist/features/content/CamoxContent.d.ts +2 -5
- package/dist/features/content/CamoxContent.js +174 -271
- package/dist/features/content/CollectionItemSheetContext.js +106 -0
- package/dist/features/content/ContentAssets.js +315 -0
- package/dist/features/content/ContentCollection.js +663 -0
- package/dist/features/content/collection-form.js +58 -0
- package/dist/features/content/components/AssetCard.js +80 -84
- package/dist/features/content/components/AssetCardSkeleton.js +4 -8
- package/dist/features/content/components/ContentSidebar.js +129 -18
- package/dist/features/content/components/ContentSidebarGroup.js +37 -0
- package/dist/features/content/components/DeleteCollectionItemButton.js +202 -0
- package/dist/features/content/components/MissingFromLocale.js +282 -0
- package/dist/features/content/components/UploadDropZone.js +27 -31
- package/dist/features/content/components/UploadProgressDrawer.js +90 -98
- package/dist/features/navigation/navigation.d.ts +66 -20
- package/dist/features/navigation/navigation.js +257 -90
- package/dist/features/og/defaultFonts.js +8 -8
- package/dist/features/og/geist-variable-ttf-base64.js +1 -1
- package/dist/features/og/imageResponse.d.ts +8 -0
- package/dist/features/og/imageResponse.js +26 -0
- package/dist/features/page/CuratedPageContent.js +167 -0
- package/dist/features/page/DerivedPageContent.js +26 -30
- package/dist/features/page/SharedLayoutContent.js +25 -27
- package/dist/features/preview/CamoxPreview.d.ts +23 -61
- package/dist/features/preview/CamoxPreview.js +816 -537
- package/dist/features/preview/EditablePageContent.js +1 -1
- package/dist/features/preview/EditablePageExperience.js +16 -22
- package/dist/features/preview/components/AddBlockSheet.js +273 -0
- package/dist/features/preview/components/AssetFieldEditor.js +173 -154
- package/dist/features/preview/components/AssetLightbox.js +181 -134
- package/dist/features/preview/components/AssetPickerModal.js +153 -170
- package/dist/features/preview/components/BlockActionsPopover.js +150 -149
- package/dist/features/preview/components/BlockErrorBoundary.js +8 -12
- package/dist/features/preview/components/BlockThumbnail.js +172 -98
- package/dist/features/preview/components/CanvasPreview.js +243 -0
- package/dist/features/preview/components/CreatePageModal.js +128 -137
- package/dist/features/preview/components/DebouncedFieldEditor.js +29 -33
- package/dist/features/preview/components/DerivedLayoutDialog.js +21 -19
- package/dist/features/preview/components/DrillRow.js +150 -0
- package/dist/features/preview/components/FieldOverlayStyles.js +11 -8
- package/dist/features/preview/components/FieldToolbar.js +160 -110
- package/dist/features/preview/components/Frame.js +108 -20
- package/dist/features/preview/components/IconFieldEditor.js +62 -66
- package/dist/features/preview/components/ItemFieldsEditor.js +231 -205
- package/dist/features/preview/components/LinkFieldEditor.js +135 -139
- package/dist/features/preview/components/Metadata.js +22 -30
- package/dist/features/preview/components/MobilePreviewDrawer.js +89 -108
- package/dist/features/preview/components/MultipleAssetFieldEditor.js +334 -246
- package/dist/features/preview/components/OverlayTracker.js +9 -41
- package/dist/features/preview/components/Overlays.js +81 -69
- package/dist/features/preview/components/PageInfo.js +1748 -0
- package/dist/features/preview/components/PageInfoSkeleton.js +51 -0
- package/dist/features/preview/components/PageLocationFieldset.js +112 -116
- package/dist/features/preview/components/PageNavigatorHeader.js +24 -0
- package/dist/features/preview/components/PageNicknameField.js +22 -26
- package/dist/features/preview/components/PagePicker.js +128 -130
- package/dist/features/preview/components/PageTree.js +525 -532
- package/dist/features/preview/components/PreviewActivation.js +28 -32
- package/dist/features/preview/components/PreviewPanel.js +620 -319
- package/dist/features/preview/components/PreviewToolbar.js +105 -333
- package/dist/features/preview/components/RecordCard.js +80 -0
- package/dist/features/preview/components/RecordCombobox.js +178 -0
- package/dist/features/preview/components/ReferenceFieldEditor.js +149 -0
- package/dist/features/preview/components/ReferenceListFieldEditor.js +432 -0
- package/dist/features/preview/components/RemovedBlockPlaceholder.js +95 -0
- package/dist/features/preview/components/RepeatableItemsList.js +125 -138
- package/dist/features/preview/components/SelectionEditor.js +993 -0
- package/dist/features/preview/components/ShikiMarkdown.js +14 -18
- package/dist/features/preview/components/SidebarSection.js +52 -64
- package/dist/features/preview/components/StudioEditingFallback.js +56 -0
- package/dist/features/preview/components/UnlinkAssetButton.js +104 -107
- package/dist/features/preview/components/blockGridNavigation.js +15 -0
- package/dist/features/preview/components/contentFieldSchema.js +8 -0
- package/dist/features/preview/components/useFieldWriter.js +200 -0
- package/dist/features/preview/components/useRecordView.js +383 -0
- package/dist/features/preview/components/useRepeatableItemActions.js +35 -37
- package/dist/features/preview/components/useUpdateBlockPosition.js +37 -37
- package/dist/features/preview/editingFrame.js +197 -0
- package/dist/features/preview/overlayHighlights.js +17 -44
- package/dist/features/preview/overlayMessages.js +72 -1
- package/dist/features/preview/pageRecord.js +189 -0
- package/dist/features/preview/previewConstants.js +6 -2
- package/dist/features/preview/previewPageFrame.js +95 -0
- package/dist/features/preview/previewPreparation.js +7 -0
- package/dist/features/preview/previewSelection.js +32 -63
- package/dist/features/preview/previewStore.js +225 -123
- package/dist/features/preview/referencePickerFocus.js +29 -0
- package/dist/features/preview/repeatableItemTargets.js +56 -0
- package/dist/features/preview/selectionReveal.js +21 -0
- package/dist/features/preview/usePreviewViewportActions.js +114 -0
- package/dist/features/preview/viewportContinuity.js +109 -0
- package/dist/features/provider/AuthenticatedCamoxProvider.js +69 -44
- package/dist/features/provider/CamoxProvider.d.ts +3 -6
- package/dist/features/provider/CamoxProvider.js +38 -50
- package/dist/features/provider/CoreCamoxProvider.js +69 -50
- package/dist/features/provider/LocalhostPreviewProvider.js +78 -114
- package/dist/features/provider/PreviewSignInPage.js +54 -0
- package/dist/features/provider/components/CamoxAppContext.js +11 -11
- package/dist/features/provider/components/CommandPalette.js +75 -82
- package/dist/features/provider/useAdminShortcuts.js +7 -11
- package/dist/features/routes/pageRuntime.d.ts +44 -4
- package/dist/features/routes/pageRuntime.js +244 -137
- package/dist/features/runtime/RuntimeChrome.js +117 -115
- package/dist/features/runtime/alternates.js +64 -0
- package/dist/features/runtime/analytics.d.ts +7 -0
- package/dist/features/runtime/analytics.js +66 -0
- package/dist/features/runtime/artifactSources.js +87 -0
- package/dist/features/runtime/editingFallback.js +20 -0
- package/dist/features/runtime/linkPrefetch.js +97 -0
- package/dist/features/runtime/livePages.js +62 -0
- package/dist/features/runtime/llmsTxt.js +40 -0
- package/dist/features/runtime/loopbackFetch.js +18 -0
- package/dist/features/runtime/navigationAccessibility.js +51 -0
- package/dist/features/runtime/navigationTarget.js +23 -2
- package/dist/features/runtime/pageApp.js +229 -158
- package/dist/features/runtime/pageBlockTypes.js +20 -0
- package/dist/features/runtime/pageClient.d.ts +2 -4
- package/dist/features/runtime/pageClient.js +18 -3
- package/dist/features/runtime/pageNavigation.js +254 -32
- package/dist/features/runtime/pageServer.d.ts +2 -4
- package/dist/features/runtime/pageServer.js +6 -2
- package/dist/features/runtime/pageViewport.js +7 -0
- package/dist/features/runtime/runtime.d.ts +54 -24
- package/dist/features/runtime/runtime.js +766 -191
- package/dist/features/runtime/runtimeChromeLoader.js +58 -0
- package/dist/features/runtime/runtimeRoutes.d.ts +19 -0
- package/dist/features/runtime/runtimeRoutes.js +25 -0
- package/dist/features/runtime/scrollRestoration.js +133 -0
- package/dist/features/runtime/studioApp.d.ts +4 -3
- package/dist/features/runtime/studioApp.js +5 -9
- package/dist/features/runtime/studioClient.d.ts +2 -4
- package/dist/features/runtime/studioClient.js +12 -3
- package/dist/features/runtime/studioServer.d.ts +2 -4
- package/dist/features/runtime/studioServer.js +6 -1
- package/dist/features/runtime/worker.d.ts +6 -0
- package/dist/features/runtime/worker.js +23 -0
- package/dist/features/runtime/workerRequest.js +44 -0
- package/dist/features/studio/CamoxStudio.d.ts +2 -6
- package/dist/features/studio/CamoxStudio.js +34 -49
- package/dist/features/studio/FollowAgentProvider.js +327 -0
- package/dist/features/studio/components/ChatSidebar.js +356 -0
- package/dist/features/studio/components/DraftsControl.js +676 -0
- package/dist/features/studio/components/FaviconDialog.js +318 -0
- package/dist/features/studio/components/LocalePicker.js +785 -0
- package/dist/features/studio/components/Navbar.js +123 -103
- package/dist/features/studio/components/ProjectMenu.js +239 -260
- package/dist/features/studio/components/RenameDraftDialog.js +206 -0
- package/dist/features/studio/components/ReviewDraftSheet.js +1472 -0
- package/dist/features/studio/components/ThreadComposer.js +157 -0
- package/dist/features/studio/components/ThreadMarkdown.js +113 -0
- package/dist/features/studio/components/ThreadMessages.js +270 -0
- package/dist/features/studio/components/UserButton.js +34 -23
- package/dist/features/studio/draftLabel.js +33 -0
- package/dist/features/studio/draftNotice.js +13 -0
- package/dist/features/studio/followAgent.js +241 -0
- package/dist/features/studio/followAgentContext.js +7 -0
- package/dist/features/studio/localeOptions.js +118 -0
- package/dist/features/studio/localeSwitch.js +19 -0
- package/dist/features/studio/routes.js +26 -1
- package/dist/features/studio/studioStore.js +64 -1
- package/dist/features/studio/useTheme.js +24 -27
- package/dist/features/vite/artifactRuntimeMinification.js +36 -0
- package/dist/features/vite/blockBoilerplate.js +6 -5
- package/dist/features/vite/blockChunks.js +31 -0
- package/dist/features/vite/bundlerLogs.js +17 -0
- package/dist/features/vite/definitionsSync.js +158 -226
- package/dist/features/vite/devAuthentication.js +4 -16
- package/dist/features/vite/devSignIn.js +87 -0
- package/dist/features/vite/iconGeneration.js +1 -1
- package/dist/features/vite/layoutGeneration.js +11 -1
- package/dist/features/vite/publishSeededContent.js +30 -0
- package/dist/features/vite/routeGeneration.js +6 -7
- package/dist/features/vite/runtimeDev.js +80 -99
- package/dist/features/vite/vite.d.ts +51 -31
- package/dist/features/vite/vite.js +224 -127
- package/dist/features/vite/workerBuild.js +39 -0
- package/dist/hooks/use-debounced-field.js +116 -47
- package/dist/hooks/use-file-upload.js +114 -67
- package/dist/hooks/use-marquee-selection.js +32 -36
- package/dist/hooks/use-page-destinations.js +69 -37
- package/dist/lib/api-client-server.d.ts +5 -0
- package/dist/lib/api-client-server.js +10 -4
- package/dist/lib/api-client.d.ts +6 -0
- package/dist/lib/api-client.js +51 -16
- package/dist/lib/api-socket.js +17 -0
- package/dist/lib/auth-page-styles.js +39 -0
- package/dist/lib/auth.js +129 -61
- package/dist/lib/collection-cache.js +23 -0
- package/dist/lib/draft-scope.d.ts +4 -0
- package/dist/lib/draft-scope.js +222 -0
- package/dist/lib/html.js +12 -0
- package/dist/lib/link-pages.js +154 -0
- package/dist/lib/locale-path.d.ts +22 -0
- package/dist/lib/locale-path.js +57 -0
- package/dist/lib/normalized-data.js +252 -152
- package/dist/lib/preview-handoff.js +2 -2
- package/dist/lib/queries.d.ts +11 -0
- package/dist/lib/queries.js +70 -141
- package/dist/lib/studio-reads.d.ts +14 -0
- package/dist/lib/studio-reads.js +554 -0
- package/dist/lib/use-project-room.js +50 -50
- package/dist/lib/use-thread.js +310 -0
- package/dist/lib/utils.js +25 -29
- package/dist/lib/view-locale-context.js +22 -0
- package/dist/lib/view-locale.js +46 -0
- package/dist/package.js +5 -0
- package/dist/studio-overlays.css +41 -151
- package/dist/studio.css +2 -2
- package/package.json +70 -73
- package/skills/camox/SKILL.md +16 -11
- package/skills/camox/references/artifacts.md +179 -0
- package/skills/camox/references/block-definitions.md +75 -59
- package/skills/camox/references/cli-common.md +9 -11
- package/skills/camox/references/cli-content.md +92 -69
- package/skills/camox/references/cli-publishing.md +26 -0
- package/skills/camox/references/dom-integrations.md +27 -0
- package/skills/camox/references/field-styling.md +4 -4
- package/skills/camox/references/layout-definitions.md +16 -14
- package/skills/camox/references/localization.md +56 -0
- package/skills/camox/references/routed-layouts.md +133 -15
- package/skills/camox-expand/SKILL.md +70 -0
- package/skills/camox-expand/references/jobs.md +39 -0
- package/skills/camoxify/SKILL.md +29 -7
- package/dist/core/components/AddBlockControlBar.js +0 -78
- package/dist/core/hooks/useRequireDraftSource.js +0 -23
- package/dist/features/metadata/sitemap.d.ts +0 -8
- package/dist/features/metadata/sitemap.js +0 -17
- package/dist/features/og/imageResponse.node.d.ts +0 -12
- package/dist/features/og/imageResponse.node.js +0 -49
- package/dist/features/og/imageResponse.workerd.d.ts +0 -12
- package/dist/features/og/imageResponse.workerd.js +0 -40
- package/dist/features/page/PublishedPageContent.js +0 -205
- package/dist/features/page/PublishedPageExperience.js +0 -23
- package/dist/features/preview/DerivedPreview.js +0 -134
- package/dist/features/preview/commentsEnabled.js +0 -8
- package/dist/features/preview/components/AddBlockSidebar.js +0 -381
- package/dist/features/preview/components/AttachedComments.js +0 -331
- package/dist/features/preview/components/CommentHeader.js +0 -122
- package/dist/features/preview/components/CommentSidebar.js +0 -29
- package/dist/features/preview/components/CommentTargetQuote.js +0 -167
- package/dist/features/preview/components/DerivedLayoutSidebar.d.ts +0 -5
- package/dist/features/preview/components/DerivedLayoutSidebar.js +0 -179
- package/dist/features/preview/components/DerivedPageInfoSidebar.js +0 -69
- package/dist/features/preview/components/LeftSidebar.js +0 -68
- package/dist/features/preview/components/PageEditorSidebar.js +0 -563
- package/dist/features/preview/components/PageInfoSidebar.js +0 -1551
- package/dist/features/preview/components/PageNavigatorSidebar.js +0 -78
- package/dist/features/preview/components/PageStatusBadge.js +0 -97
- package/dist/features/preview/components/PeekedBlock.js +0 -217
- package/dist/features/preview/components/PreviewComments.js +0 -56
- package/dist/features/preview/components/PreviewToolbarSpacer.js +0 -43
- package/dist/features/preview/components/PublicationRow.js +0 -422
- package/dist/features/preview/components/PublishDialog.js +0 -194
- package/dist/features/preview/components/RightSidebar.js +0 -59
- package/dist/features/preview/components/SendFeedbackDialog.js +0 -83
- package/dist/features/preview/previewCommentsStore.js +0 -135
- package/dist/features/preview/publication.js +0 -81
- package/dist/features/preview/usePageComments.js +0 -39
- package/dist/features/runtime/SharedChromeContext.js +0 -7
- package/dist/features/studio/components/EnvironmentMenu.js +0 -425
- package/dist/features/vite/appGeneration.js +0 -89
- package/dist/lib/view-queries.js +0 -28
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/Matches.d.ts +0 -114
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/RouterProvider.d.ts +0 -25
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/config.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/defer.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/fileRoute.d.ts +0 -20
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/global.d.ts +0 -8
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/hash-scroll.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/index.d.ts +0 -18
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/link.d.ts +0 -161
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/load-matches.d.ts +0 -6
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/location.d.ts +0 -54
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/lru-cache.d.ts +0 -8
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/manifest.d.ts +0 -32
- 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
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/not-found.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/redirect.d.ts +0 -49
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/rewrite.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/root.d.ts +0 -6
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/route.d.ts +0 -343
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/routeInfo.d.ts +0 -48
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/router.d.ts +0 -695
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/scroll-restoration.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/searchMiddleware.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/searchParams.d.ts +0 -5
- 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
- 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
- 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
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/stores.d.ts +0 -69
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/structuralSharing.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/typePrimitives.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useLoaderData.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useLoaderDeps.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useNavigate.d.ts +0 -10
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useParams.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useRouteContext.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useSearch.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/utils.d.ts +0 -28
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/validators.d.ts +0 -49
- package/skills/camox/references/cli-environments.md +0 -37
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { ArrowUp, Square } from "lucide-react";
|
|
5
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupTextarea } from "@camox/ui/input-group";
|
|
6
|
+
|
|
7
|
+
//#region src/features/studio/components/ThreadComposer.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Where an editor writes to the agent: Enter sends, Shift+Enter adds a line. While a run is
|
|
10
|
+
* going, sending steers it, and a Stop button sits beside Send.
|
|
11
|
+
*/
|
|
12
|
+
function ThreadComposer(t0) {
|
|
13
|
+
const $ = c(32);
|
|
14
|
+
const { onSend, onStop, running: t1, disabled: t2 } = t0;
|
|
15
|
+
const running = t1 === void 0 ? false : t1;
|
|
16
|
+
const disabled = t2 === void 0 ? false : t2;
|
|
17
|
+
const [text, setText] = useState("");
|
|
18
|
+
let t3;
|
|
19
|
+
if ($[0] !== text) {
|
|
20
|
+
t3 = text.trim();
|
|
21
|
+
$[0] = text;
|
|
22
|
+
$[1] = t3;
|
|
23
|
+
} else t3 = $[1];
|
|
24
|
+
const message = t3;
|
|
25
|
+
const canSend = !disabled && message !== "" && onSend !== void 0;
|
|
26
|
+
let t4;
|
|
27
|
+
if ($[2] !== canSend || $[3] !== message || $[4] !== onSend) {
|
|
28
|
+
t4 = () => {
|
|
29
|
+
if (!canSend) return;
|
|
30
|
+
onSend(message);
|
|
31
|
+
setText("");
|
|
32
|
+
};
|
|
33
|
+
$[2] = canSend;
|
|
34
|
+
$[3] = message;
|
|
35
|
+
$[4] = onSend;
|
|
36
|
+
$[5] = t4;
|
|
37
|
+
} else t4 = $[5];
|
|
38
|
+
const submit = t4;
|
|
39
|
+
let t5;
|
|
40
|
+
if ($[6] !== submit) {
|
|
41
|
+
t5 = (event) => {
|
|
42
|
+
event.preventDefault();
|
|
43
|
+
submit();
|
|
44
|
+
};
|
|
45
|
+
$[6] = submit;
|
|
46
|
+
$[7] = t5;
|
|
47
|
+
} else t5 = $[7];
|
|
48
|
+
let t6;
|
|
49
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
50
|
+
t6 = (event_0) => setText(event_0.target.value);
|
|
51
|
+
$[8] = t6;
|
|
52
|
+
} else t6 = $[8];
|
|
53
|
+
let t7;
|
|
54
|
+
if ($[9] !== submit) {
|
|
55
|
+
t7 = (event_1) => {
|
|
56
|
+
if (event_1.key !== "Enter" || event_1.shiftKey || event_1.nativeEvent.isComposing) return;
|
|
57
|
+
event_1.preventDefault();
|
|
58
|
+
submit();
|
|
59
|
+
};
|
|
60
|
+
$[9] = submit;
|
|
61
|
+
$[10] = t7;
|
|
62
|
+
} else t7 = $[10];
|
|
63
|
+
let t8;
|
|
64
|
+
if ($[11] !== disabled || $[12] !== t7 || $[13] !== text) {
|
|
65
|
+
t8 = /* @__PURE__ */ jsx(InputGroupTextarea, {
|
|
66
|
+
"aria-label": "Message",
|
|
67
|
+
placeholder: "Message Camox…",
|
|
68
|
+
value: text,
|
|
69
|
+
disabled,
|
|
70
|
+
onChange: t6,
|
|
71
|
+
onKeyDown: t7,
|
|
72
|
+
className: "max-h-48 min-h-14"
|
|
73
|
+
});
|
|
74
|
+
$[11] = disabled;
|
|
75
|
+
$[12] = t7;
|
|
76
|
+
$[13] = text;
|
|
77
|
+
$[14] = t8;
|
|
78
|
+
} else t8 = $[14];
|
|
79
|
+
let t9;
|
|
80
|
+
if ($[15] !== disabled || $[16] !== onStop || $[17] !== running) {
|
|
81
|
+
t9 = running && onStop && /* @__PURE__ */ jsxs(InputGroupButton, {
|
|
82
|
+
type: "button",
|
|
83
|
+
variant: "outline",
|
|
84
|
+
size: "icon-sm",
|
|
85
|
+
disabled,
|
|
86
|
+
onClick: onStop,
|
|
87
|
+
children: [/* @__PURE__ */ jsx(Square, { className: "fill-current" }), /* @__PURE__ */ jsx("span", {
|
|
88
|
+
className: "sr-only",
|
|
89
|
+
children: "Stop"
|
|
90
|
+
})]
|
|
91
|
+
});
|
|
92
|
+
$[15] = disabled;
|
|
93
|
+
$[16] = onStop;
|
|
94
|
+
$[17] = running;
|
|
95
|
+
$[18] = t9;
|
|
96
|
+
} else t9 = $[18];
|
|
97
|
+
const t10 = !canSend;
|
|
98
|
+
let t11;
|
|
99
|
+
let t12;
|
|
100
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
101
|
+
t11 = /* @__PURE__ */ jsx(ArrowUp, {});
|
|
102
|
+
t12 = /* @__PURE__ */ jsx("span", {
|
|
103
|
+
className: "sr-only",
|
|
104
|
+
children: "Send"
|
|
105
|
+
});
|
|
106
|
+
$[19] = t11;
|
|
107
|
+
$[20] = t12;
|
|
108
|
+
} else {
|
|
109
|
+
t11 = $[19];
|
|
110
|
+
t12 = $[20];
|
|
111
|
+
}
|
|
112
|
+
let t13;
|
|
113
|
+
if ($[21] !== t10) {
|
|
114
|
+
t13 = /* @__PURE__ */ jsxs(InputGroupButton, {
|
|
115
|
+
type: "submit",
|
|
116
|
+
variant: "default",
|
|
117
|
+
size: "icon-sm",
|
|
118
|
+
disabled: t10,
|
|
119
|
+
children: [t11, t12]
|
|
120
|
+
});
|
|
121
|
+
$[21] = t10;
|
|
122
|
+
$[22] = t13;
|
|
123
|
+
} else t13 = $[22];
|
|
124
|
+
let t14;
|
|
125
|
+
if ($[23] !== t13 || $[24] !== t9) {
|
|
126
|
+
t14 = /* @__PURE__ */ jsxs(InputGroupAddon, {
|
|
127
|
+
align: "block-end",
|
|
128
|
+
className: "justify-end",
|
|
129
|
+
children: [t9, t13]
|
|
130
|
+
});
|
|
131
|
+
$[23] = t13;
|
|
132
|
+
$[24] = t9;
|
|
133
|
+
$[25] = t14;
|
|
134
|
+
} else t14 = $[25];
|
|
135
|
+
let t15;
|
|
136
|
+
if ($[26] !== t14 || $[27] !== t8) {
|
|
137
|
+
t15 = /* @__PURE__ */ jsxs(InputGroup, { children: [t8, t14] });
|
|
138
|
+
$[26] = t14;
|
|
139
|
+
$[27] = t8;
|
|
140
|
+
$[28] = t15;
|
|
141
|
+
} else t15 = $[28];
|
|
142
|
+
let t16;
|
|
143
|
+
if ($[29] !== t15 || $[30] !== t5) {
|
|
144
|
+
t16 = /* @__PURE__ */ jsx("form", {
|
|
145
|
+
className: "p-2",
|
|
146
|
+
onSubmit: t5,
|
|
147
|
+
children: t15
|
|
148
|
+
});
|
|
149
|
+
$[29] = t15;
|
|
150
|
+
$[30] = t5;
|
|
151
|
+
$[31] = t16;
|
|
152
|
+
} else t16 = $[31];
|
|
153
|
+
return t16;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
//#endregion
|
|
157
|
+
export { ThreadComposer };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { isHttpTextLinkTarget, isInternalTextLinkTarget } from "../../../core/lib/textLinks.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Lexer } from "marked";
|
|
5
|
+
|
|
6
|
+
//#region src/features/studio/components/ThreadMarkdown.tsx
|
|
7
|
+
/**
|
|
8
|
+
* The agent's Markdown, rendered as React elements from `marked`'s tokens. Nothing is ever set as
|
|
9
|
+
* HTML: raw HTML in the Markdown shows as text, and only web and root-relative links are links.
|
|
10
|
+
*/
|
|
11
|
+
function ThreadMarkdown(t0) {
|
|
12
|
+
const $ = c(4);
|
|
13
|
+
const { text } = t0;
|
|
14
|
+
let t1;
|
|
15
|
+
if ($[0] !== text) {
|
|
16
|
+
t1 = blocks(Lexer.lex(text));
|
|
17
|
+
$[0] = text;
|
|
18
|
+
$[1] = t1;
|
|
19
|
+
} else t1 = $[1];
|
|
20
|
+
let t2;
|
|
21
|
+
if ($[2] !== t1) {
|
|
22
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
23
|
+
className: "flex flex-col gap-2 leading-relaxed",
|
|
24
|
+
children: t1
|
|
25
|
+
});
|
|
26
|
+
$[2] = t1;
|
|
27
|
+
$[3] = t2;
|
|
28
|
+
} else t2 = $[3];
|
|
29
|
+
return t2;
|
|
30
|
+
}
|
|
31
|
+
const blocks = (tokens) => tokens.map((token, index) => block(token, index));
|
|
32
|
+
function block(token, key) {
|
|
33
|
+
switch (token.type) {
|
|
34
|
+
case "space": return null;
|
|
35
|
+
case "paragraph": return /* @__PURE__ */ jsx("p", { children: inline(token.tokens) }, key);
|
|
36
|
+
case "heading": return /* @__PURE__ */ jsx("p", {
|
|
37
|
+
className: "font-semibold",
|
|
38
|
+
children: inline(token.tokens)
|
|
39
|
+
}, key);
|
|
40
|
+
case "list": {
|
|
41
|
+
const list = token;
|
|
42
|
+
const items = list.items.map((item, index) => /* @__PURE__ */ jsx("li", { children: item.tokens.flatMap((child, i) => listItemPart(child, i)) }, index));
|
|
43
|
+
return list.ordered ? /* @__PURE__ */ jsx("ol", {
|
|
44
|
+
className: "list-decimal pl-5",
|
|
45
|
+
start: list.start || void 0,
|
|
46
|
+
children: items
|
|
47
|
+
}, key) : /* @__PURE__ */ jsx("ul", {
|
|
48
|
+
className: "list-disc pl-5",
|
|
49
|
+
children: items
|
|
50
|
+
}, key);
|
|
51
|
+
}
|
|
52
|
+
case "code": return /* @__PURE__ */ jsx("pre", {
|
|
53
|
+
className: "bg-muted overflow-x-auto rounded-md p-2 text-xs",
|
|
54
|
+
children: /* @__PURE__ */ jsx("code", { children: token.text })
|
|
55
|
+
}, key);
|
|
56
|
+
case "blockquote": return /* @__PURE__ */ jsx("blockquote", {
|
|
57
|
+
className: "text-muted-foreground border-l-2 pl-3",
|
|
58
|
+
children: blocks(token.tokens)
|
|
59
|
+
}, key);
|
|
60
|
+
case "hr": return /* @__PURE__ */ jsx("hr", {}, key);
|
|
61
|
+
case "text": {
|
|
62
|
+
const text = token;
|
|
63
|
+
return /* @__PURE__ */ jsx("p", { children: text.tokens ? inline(text.tokens) : text.text }, key);
|
|
64
|
+
}
|
|
65
|
+
default: return /* @__PURE__ */ jsx("p", { children: token.raw.trim() }, key);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/** A list item's tight text stays inline; anything else is a block. */
|
|
69
|
+
function listItemPart(token, key) {
|
|
70
|
+
if (token.type === "text") {
|
|
71
|
+
const text = token;
|
|
72
|
+
return /* @__PURE__ */ jsx("span", { children: text.tokens ? inline(text.tokens) : text.text }, key);
|
|
73
|
+
}
|
|
74
|
+
return block(token, key);
|
|
75
|
+
}
|
|
76
|
+
const inline = (tokens = []) => tokens.map((token, key) => inlineToken(token, key));
|
|
77
|
+
function inlineToken(token, key) {
|
|
78
|
+
switch (token.type) {
|
|
79
|
+
case "strong": return /* @__PURE__ */ jsx("strong", { children: inline(token.tokens) }, key);
|
|
80
|
+
case "em": return /* @__PURE__ */ jsx("em", { children: inline(token.tokens) }, key);
|
|
81
|
+
case "del": return /* @__PURE__ */ jsx("del", { children: inline(token.tokens) }, key);
|
|
82
|
+
case "codespan": return /* @__PURE__ */ jsx("code", {
|
|
83
|
+
className: "bg-muted rounded px-1 text-xs",
|
|
84
|
+
children: token.text
|
|
85
|
+
}, key);
|
|
86
|
+
case "br": return /* @__PURE__ */ jsx("br", {}, key);
|
|
87
|
+
case "link": {
|
|
88
|
+
const link = token;
|
|
89
|
+
if (isHttpTextLinkTarget(link.href)) return /* @__PURE__ */ jsx("a", {
|
|
90
|
+
href: link.href,
|
|
91
|
+
target: "_blank",
|
|
92
|
+
rel: "noreferrer",
|
|
93
|
+
className: "underline",
|
|
94
|
+
children: inline(link.tokens)
|
|
95
|
+
}, key);
|
|
96
|
+
if (isInternalTextLinkTarget(link.href)) return /* @__PURE__ */ jsx("a", {
|
|
97
|
+
href: link.href,
|
|
98
|
+
className: "underline",
|
|
99
|
+
children: inline(link.tokens)
|
|
100
|
+
}, key);
|
|
101
|
+
return /* @__PURE__ */ jsx("span", { children: inline(link.tokens) }, key);
|
|
102
|
+
}
|
|
103
|
+
case "text":
|
|
104
|
+
case "escape": {
|
|
105
|
+
const text = token;
|
|
106
|
+
return text.tokens ? /* @__PURE__ */ jsx("span", { children: inline(text.tokens) }, key) : text.text;
|
|
107
|
+
}
|
|
108
|
+
default: return token.raw;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
//#endregion
|
|
113
|
+
export { ThreadMarkdown };
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { ThreadMarkdown } from "./ThreadMarkdown.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Avatar, AvatarFallback, AvatarImage } from "@camox/ui/avatar";
|
|
5
|
+
import { Bubble, BubbleContent } from "@camox/ui/bubble";
|
|
6
|
+
import { Message, MessageAvatar, MessageContent, MessageHeader } from "@camox/ui/message";
|
|
7
|
+
import { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport } from "@camox/ui/message-scroller";
|
|
8
|
+
|
|
9
|
+
//#region src/features/studio/components/ThreadMessages.tsx
|
|
10
|
+
/**
|
|
11
|
+
* A thread's messages, and "Working…" while a run is going or a message is still `sending`: on
|
|
12
|
+
* its way to the thread, which hasn't accepted it yet. A draft's thread is shared, so it shows
|
|
13
|
+
* senders' names too (`showSenders`). A fresh Live thread links to the draft the editor's
|
|
14
|
+
* previous one continued in (`continuedIn`).
|
|
15
|
+
*/
|
|
16
|
+
function ThreadMessages(t0) {
|
|
17
|
+
const $ = c(25);
|
|
18
|
+
const { view, sending: t1, showSenders: t2, continuedIn } = t0;
|
|
19
|
+
const sending = t1 === void 0 ? false : t1;
|
|
20
|
+
const showSenders = t2 === void 0 ? false : t2;
|
|
21
|
+
const working = view.running || sending;
|
|
22
|
+
if (view.messages.length === 0 && !working) {
|
|
23
|
+
let t3;
|
|
24
|
+
if ($[0] !== continuedIn) {
|
|
25
|
+
t3 = continuedIn && /* @__PURE__ */ jsx(ContinuedIn, { link: continuedIn });
|
|
26
|
+
$[0] = continuedIn;
|
|
27
|
+
$[1] = t3;
|
|
28
|
+
} else t3 = $[1];
|
|
29
|
+
let t4;
|
|
30
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
31
|
+
t4 = /* @__PURE__ */ jsx("p", {
|
|
32
|
+
"data-thread-empty": true,
|
|
33
|
+
className: "text-muted-foreground flex min-h-0 flex-1 items-center justify-center p-4 text-center text-sm",
|
|
34
|
+
children: "Ask Camox about your website’s content."
|
|
35
|
+
});
|
|
36
|
+
$[2] = t4;
|
|
37
|
+
} else t4 = $[2];
|
|
38
|
+
let t5;
|
|
39
|
+
if ($[3] !== t3) {
|
|
40
|
+
t5 = /* @__PURE__ */ jsxs("div", {
|
|
41
|
+
className: "flex min-h-0 flex-1 flex-col",
|
|
42
|
+
children: [t3, t4]
|
|
43
|
+
});
|
|
44
|
+
$[3] = t3;
|
|
45
|
+
$[4] = t5;
|
|
46
|
+
} else t5 = $[4];
|
|
47
|
+
return t5;
|
|
48
|
+
}
|
|
49
|
+
let t3;
|
|
50
|
+
if ($[5] !== continuedIn) {
|
|
51
|
+
t3 = continuedIn && /* @__PURE__ */ jsx(ContinuedIn, { link: continuedIn });
|
|
52
|
+
$[5] = continuedIn;
|
|
53
|
+
$[6] = t3;
|
|
54
|
+
} else t3 = $[6];
|
|
55
|
+
let t4;
|
|
56
|
+
if ($[7] !== showSenders || $[8] !== view.messages || $[9] !== working) {
|
|
57
|
+
let t5;
|
|
58
|
+
if ($[11] !== showSenders || $[12] !== view.messages.length || $[13] !== working) {
|
|
59
|
+
t5 = (message, index) => /* @__PURE__ */ jsxs(MessageScrollerItem, {
|
|
60
|
+
messageId: message.id,
|
|
61
|
+
scrollAnchor: message.from === "editor",
|
|
62
|
+
className: "flex flex-col gap-4",
|
|
63
|
+
children: [/* @__PURE__ */ jsx(ThreadMessageRow, {
|
|
64
|
+
message,
|
|
65
|
+
showSender: showSenders
|
|
66
|
+
}), working && index === view.messages.length - 1 && /* @__PURE__ */ jsx(Working, {})]
|
|
67
|
+
}, message.id);
|
|
68
|
+
$[11] = showSenders;
|
|
69
|
+
$[12] = view.messages.length;
|
|
70
|
+
$[13] = working;
|
|
71
|
+
$[14] = t5;
|
|
72
|
+
} else t5 = $[14];
|
|
73
|
+
t4 = view.messages.map(t5);
|
|
74
|
+
$[7] = showSenders;
|
|
75
|
+
$[8] = view.messages;
|
|
76
|
+
$[9] = working;
|
|
77
|
+
$[10] = t4;
|
|
78
|
+
} else t4 = $[10];
|
|
79
|
+
let t5;
|
|
80
|
+
if ($[15] !== view.messages.length || $[16] !== working) {
|
|
81
|
+
t5 = working && view.messages.length === 0 && /* @__PURE__ */ jsx(Working, {});
|
|
82
|
+
$[15] = view.messages.length;
|
|
83
|
+
$[16] = working;
|
|
84
|
+
$[17] = t5;
|
|
85
|
+
} else t5 = $[17];
|
|
86
|
+
let t6;
|
|
87
|
+
if ($[18] !== t3 || $[19] !== t4 || $[20] !== t5) {
|
|
88
|
+
t6 = /* @__PURE__ */ jsx(MessageScrollerViewport, { children: /* @__PURE__ */ jsxs(MessageScrollerContent, {
|
|
89
|
+
className: "flex flex-col gap-4 p-3",
|
|
90
|
+
children: [
|
|
91
|
+
t3,
|
|
92
|
+
t4,
|
|
93
|
+
t5
|
|
94
|
+
]
|
|
95
|
+
}) });
|
|
96
|
+
$[18] = t3;
|
|
97
|
+
$[19] = t4;
|
|
98
|
+
$[20] = t5;
|
|
99
|
+
$[21] = t6;
|
|
100
|
+
} else t6 = $[21];
|
|
101
|
+
let t7;
|
|
102
|
+
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
103
|
+
t7 = /* @__PURE__ */ jsx(MessageScrollerButton, {});
|
|
104
|
+
$[22] = t7;
|
|
105
|
+
} else t7 = $[22];
|
|
106
|
+
let t8;
|
|
107
|
+
if ($[23] !== t6) {
|
|
108
|
+
t8 = /* @__PURE__ */ jsx(MessageScrollerProvider, { children: /* @__PURE__ */ jsxs(MessageScroller, {
|
|
109
|
+
className: "min-h-0 flex-1",
|
|
110
|
+
children: [t6, t7]
|
|
111
|
+
}) });
|
|
112
|
+
$[23] = t6;
|
|
113
|
+
$[24] = t8;
|
|
114
|
+
} else t8 = $[24];
|
|
115
|
+
return t8;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Shown in the last message, not after it: the scroller only brings a message the editor just
|
|
119
|
+
* sent into view when it's appended last, and it arrives while the agent is already working.
|
|
120
|
+
*/
|
|
121
|
+
function Working() {
|
|
122
|
+
const $ = c(1);
|
|
123
|
+
let t0;
|
|
124
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
125
|
+
t0 = /* @__PURE__ */ jsx("p", {
|
|
126
|
+
role: "status",
|
|
127
|
+
className: "shimmer text-muted-foreground text-sm",
|
|
128
|
+
children: "Working…"
|
|
129
|
+
});
|
|
130
|
+
$[0] = t0;
|
|
131
|
+
} else t0 = $[0];
|
|
132
|
+
return t0;
|
|
133
|
+
}
|
|
134
|
+
function ThreadMessageRow(t0) {
|
|
135
|
+
const $ = c(17);
|
|
136
|
+
const { message, showSender } = t0;
|
|
137
|
+
if (message.from === "stopped" || message.from === "failed") {
|
|
138
|
+
const t1 = message.from === "stopped" ? `Stopped by ${message.sender.name}` : "Camox couldn’t finish this. Send your message again to retry.";
|
|
139
|
+
let t2;
|
|
140
|
+
if ($[0] !== t1) {
|
|
141
|
+
t2 = /* @__PURE__ */ jsx(Message, { children: /* @__PURE__ */ jsx(MessageContent, { children: /* @__PURE__ */ jsx("p", {
|
|
142
|
+
className: "text-muted-foreground text-sm",
|
|
143
|
+
children: t1
|
|
144
|
+
}) }) });
|
|
145
|
+
$[0] = t1;
|
|
146
|
+
$[1] = t2;
|
|
147
|
+
} else t2 = $[1];
|
|
148
|
+
return t2;
|
|
149
|
+
}
|
|
150
|
+
if (message.from === "agent") {
|
|
151
|
+
let t1;
|
|
152
|
+
if ($[2] !== message.text) {
|
|
153
|
+
t1 = /* @__PURE__ */ jsx(Message, { children: /* @__PURE__ */ jsx(MessageContent, { children: /* @__PURE__ */ jsx(ThreadMarkdown, { text: message.text }) }) });
|
|
154
|
+
$[2] = message.text;
|
|
155
|
+
$[3] = t1;
|
|
156
|
+
} else t1 = $[3];
|
|
157
|
+
return t1;
|
|
158
|
+
}
|
|
159
|
+
let t1;
|
|
160
|
+
if ($[4] !== message.sender) {
|
|
161
|
+
t1 = /* @__PURE__ */ jsx(MessageAvatar, { children: /* @__PURE__ */ jsx(SenderAvatar, { sender: message.sender }) });
|
|
162
|
+
$[4] = message.sender;
|
|
163
|
+
$[5] = t1;
|
|
164
|
+
} else t1 = $[5];
|
|
165
|
+
let t2;
|
|
166
|
+
if ($[6] !== message.sender || $[7] !== showSender) {
|
|
167
|
+
t2 = showSender && /* @__PURE__ */ jsx(MessageHeader, {
|
|
168
|
+
className: "text-muted-foreground text-xs",
|
|
169
|
+
children: message.sender.name
|
|
170
|
+
});
|
|
171
|
+
$[6] = message.sender;
|
|
172
|
+
$[7] = showSender;
|
|
173
|
+
$[8] = t2;
|
|
174
|
+
} else t2 = $[8];
|
|
175
|
+
let t3;
|
|
176
|
+
if ($[9] !== message.text) {
|
|
177
|
+
t3 = /* @__PURE__ */ jsx(Bubble, {
|
|
178
|
+
align: "end",
|
|
179
|
+
variant: "muted",
|
|
180
|
+
className: "max-w-full",
|
|
181
|
+
children: /* @__PURE__ */ jsx(BubbleContent, {
|
|
182
|
+
className: "whitespace-pre-wrap",
|
|
183
|
+
children: message.text
|
|
184
|
+
})
|
|
185
|
+
});
|
|
186
|
+
$[9] = message.text;
|
|
187
|
+
$[10] = t3;
|
|
188
|
+
} else t3 = $[10];
|
|
189
|
+
let t4;
|
|
190
|
+
if ($[11] !== t2 || $[12] !== t3) {
|
|
191
|
+
t4 = /* @__PURE__ */ jsxs(MessageContent, { children: [t2, t3] });
|
|
192
|
+
$[11] = t2;
|
|
193
|
+
$[12] = t3;
|
|
194
|
+
$[13] = t4;
|
|
195
|
+
} else t4 = $[13];
|
|
196
|
+
let t5;
|
|
197
|
+
if ($[14] !== t1 || $[15] !== t4) {
|
|
198
|
+
t5 = /* @__PURE__ */ jsxs(Message, {
|
|
199
|
+
align: "end",
|
|
200
|
+
children: [t1, t4]
|
|
201
|
+
});
|
|
202
|
+
$[14] = t1;
|
|
203
|
+
$[15] = t4;
|
|
204
|
+
$[16] = t5;
|
|
205
|
+
} else t5 = $[16];
|
|
206
|
+
return t5;
|
|
207
|
+
}
|
|
208
|
+
function ContinuedIn(t0) {
|
|
209
|
+
const $ = c(4);
|
|
210
|
+
const { link } = t0;
|
|
211
|
+
let t1;
|
|
212
|
+
if ($[0] !== link.href || $[1] !== link.label || $[2] !== link.onOpen) {
|
|
213
|
+
t1 = /* @__PURE__ */ jsxs("p", {
|
|
214
|
+
className: "text-muted-foreground px-4 pt-3 text-center text-sm",
|
|
215
|
+
children: [
|
|
216
|
+
"Continued in",
|
|
217
|
+
" ",
|
|
218
|
+
/* @__PURE__ */ jsx("a", {
|
|
219
|
+
href: link.href,
|
|
220
|
+
onClick: link.onOpen,
|
|
221
|
+
className: "text-foreground underline",
|
|
222
|
+
children: link.label
|
|
223
|
+
})
|
|
224
|
+
]
|
|
225
|
+
});
|
|
226
|
+
$[0] = link.href;
|
|
227
|
+
$[1] = link.label;
|
|
228
|
+
$[2] = link.onOpen;
|
|
229
|
+
$[3] = t1;
|
|
230
|
+
} else t1 = $[3];
|
|
231
|
+
return t1;
|
|
232
|
+
}
|
|
233
|
+
const initials = (name) => name.split(" ").map((part) => part[0]).join("").toUpperCase().slice(0, 2);
|
|
234
|
+
function SenderAvatar(t0) {
|
|
235
|
+
const $ = c(10);
|
|
236
|
+
const { sender } = t0;
|
|
237
|
+
let t1;
|
|
238
|
+
if ($[0] !== sender.image || $[1] !== sender.name) {
|
|
239
|
+
t1 = sender.image && /* @__PURE__ */ jsx(AvatarImage, {
|
|
240
|
+
src: sender.image,
|
|
241
|
+
alt: sender.name
|
|
242
|
+
});
|
|
243
|
+
$[0] = sender.image;
|
|
244
|
+
$[1] = sender.name;
|
|
245
|
+
$[2] = t1;
|
|
246
|
+
} else t1 = $[2];
|
|
247
|
+
let t2;
|
|
248
|
+
if ($[3] !== sender.name) {
|
|
249
|
+
t2 = initials(sender.name);
|
|
250
|
+
$[3] = sender.name;
|
|
251
|
+
$[4] = t2;
|
|
252
|
+
} else t2 = $[4];
|
|
253
|
+
let t3;
|
|
254
|
+
if ($[5] !== t2) {
|
|
255
|
+
t3 = /* @__PURE__ */ jsx(AvatarFallback, { children: t2 });
|
|
256
|
+
$[5] = t2;
|
|
257
|
+
$[6] = t3;
|
|
258
|
+
} else t3 = $[6];
|
|
259
|
+
let t4;
|
|
260
|
+
if ($[7] !== t1 || $[8] !== t3) {
|
|
261
|
+
t4 = /* @__PURE__ */ jsxs(Avatar, { children: [t1, t3] });
|
|
262
|
+
$[7] = t1;
|
|
263
|
+
$[8] = t3;
|
|
264
|
+
$[9] = t4;
|
|
265
|
+
} else t4 = $[9];
|
|
266
|
+
return t4;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
//#endregion
|
|
270
|
+
export { ThreadMessages };
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { useLocation, useNavigate } from "../../navigation/navigation.js";
|
|
2
1
|
import { useAuthContext, useAuthState } from "../../../lib/auth.js";
|
|
2
|
+
import { useNavigate } from "../../navigation/navigation.js";
|
|
3
|
+
import { PlatformLabel } from "../../../components/PlatformLabel.js";
|
|
4
|
+
import { useLocalePath, useLocalizedPath } from "../../../lib/view-locale.js";
|
|
3
5
|
import { STUDIO_BASE_PATH } from "../routes.js";
|
|
4
|
-
import {
|
|
6
|
+
import { studioStore } from "../studioStore.js";
|
|
7
|
+
import { previewStore, selectIsCanvasShown } from "../../preview/previewStore.js";
|
|
5
8
|
import { useApplyTheme } from "../useTheme.js";
|
|
6
9
|
import { c } from "react/compiler-runtime";
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
10
|
import { useSelector } from "@xstate/store-react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
12
|
import { Button } from "@camox/ui/button";
|
|
10
|
-
import { Check, EyeOff, LogOut, Monitor, Moon, Settings, Sun, User } from "lucide-react";
|
|
11
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
|
|
13
|
+
import { Check, Command, EyeOff, LogOut, Monitor, Moon, Settings, Sun, User } from "lucide-react";
|
|
12
14
|
import { Avatar, AvatarFallback, AvatarImage } from "@camox/ui/avatar";
|
|
15
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
|
|
13
16
|
|
|
14
17
|
//#region src/features/studio/components/UserButton.tsx
|
|
15
18
|
const UserButton = () => {
|
|
16
|
-
const $ = c(
|
|
17
|
-
if ($[0] !== "b876c985f56cb759905567177978ca8597789d0818f006e69fd4bcfb86c58f94") {
|
|
18
|
-
for (let $i = 0; $i < 5; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
19
|
-
$[0] = "b876c985f56cb759905567177978ca8597789d0818f006e69fd4bcfb86c58f94";
|
|
20
|
-
}
|
|
19
|
+
const $ = c(4);
|
|
21
20
|
const { isAuthenticated, isLoading } = useAuthState();
|
|
22
21
|
const { theme, setTheme } = useApplyTheme();
|
|
23
22
|
if (!isAuthenticated || isLoading) {
|
|
24
23
|
let t0;
|
|
25
|
-
if ($[
|
|
24
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
26
25
|
t0 = /* @__PURE__ */ jsx(Button, {
|
|
27
26
|
variant: "outline",
|
|
28
27
|
size: "icon",
|
|
29
28
|
children: /* @__PURE__ */ jsx(User, { className: "h-4 w-4" })
|
|
30
29
|
});
|
|
31
|
-
$[
|
|
32
|
-
} else t0 = $[
|
|
30
|
+
$[0] = t0;
|
|
31
|
+
} else t0 = $[0];
|
|
33
32
|
return t0;
|
|
34
33
|
}
|
|
35
34
|
let t0;
|
|
36
|
-
if ($[
|
|
35
|
+
if ($[1] !== setTheme || $[2] !== theme) {
|
|
37
36
|
t0 = /* @__PURE__ */ jsx(AuthenticatedUserButton, {
|
|
38
37
|
theme,
|
|
39
38
|
setTheme
|
|
40
39
|
});
|
|
41
|
-
$[
|
|
42
|
-
$[
|
|
43
|
-
$[
|
|
44
|
-
} else t0 = $[
|
|
40
|
+
$[1] = setTheme;
|
|
41
|
+
$[2] = theme;
|
|
42
|
+
$[3] = t0;
|
|
43
|
+
} else t0 = $[3];
|
|
45
44
|
return t0;
|
|
46
45
|
};
|
|
47
46
|
function AuthenticatedUserButton({ theme, setTheme }) {
|
|
48
47
|
const authCtx = useAuthContext();
|
|
49
48
|
const { data: session } = authCtx.authClient.useSession();
|
|
50
49
|
const authenticationUrl = authCtx.authenticationUrl;
|
|
51
|
-
const
|
|
52
|
-
const
|
|
50
|
+
const isCanvasShown = useSelector(previewStore, selectIsCanvasShown);
|
|
51
|
+
const pathname = useLocalePath();
|
|
52
|
+
const localized = useLocalizedPath();
|
|
53
53
|
const navigate = useNavigate();
|
|
54
|
-
const isPreviewPage = pathname !==
|
|
54
|
+
const isPreviewPage = pathname !== "/camox" && !pathname.startsWith(`${"/camox"}/`);
|
|
55
55
|
const hideCamoxUi = () => {
|
|
56
56
|
previewStore.send({ type: "hideToolbar" });
|
|
57
57
|
if (isPreviewPage) return;
|
|
58
|
-
navigate({ to: "/" });
|
|
58
|
+
navigate({ to: localized("/") });
|
|
59
59
|
};
|
|
60
60
|
const userName = session?.user?.name || "User";
|
|
61
61
|
const userEmail = session?.user?.email;
|
|
@@ -132,7 +132,18 @@ function AuthenticatedUserButton({ theme, setTheme }) {
|
|
|
132
132
|
]
|
|
133
133
|
})] }),
|
|
134
134
|
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
135
|
-
|
|
135
|
+
onClick: () => studioStore.send({ type: "openCommandPalette" }),
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ jsx(Command, {}),
|
|
138
|
+
/* @__PURE__ */ jsx("span", { children: "Command palette" }),
|
|
139
|
+
/* @__PURE__ */ jsx(DropdownMenuShortcut, { children: /* @__PURE__ */ jsx(PlatformLabel, {
|
|
140
|
+
mac: "⌘ K",
|
|
141
|
+
other: "Ctrl K"
|
|
142
|
+
}) })
|
|
143
|
+
]
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
146
|
+
disabled: isPreviewPage && isCanvasShown,
|
|
136
147
|
onClick: hideCamoxUi,
|
|
137
148
|
children: [/* @__PURE__ */ jsx(EyeOff, {}), /* @__PURE__ */ jsx("span", { children: "Hide Camox UI" })]
|
|
138
149
|
}),
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/features/studio/draftLabel.ts
|
|
2
|
+
const dayFormat = new Intl.DateTimeFormat(void 0, {
|
|
3
|
+
month: "short",
|
|
4
|
+
day: "numeric"
|
|
5
|
+
});
|
|
6
|
+
/**
|
|
7
|
+
* A draft's name, or for an unnamed draft its creator and creation date formatted for the
|
|
8
|
+
* viewer, e.g. "Rémi, Oct 13". A development draft is the development draft.
|
|
9
|
+
*/
|
|
10
|
+
function draftLabel(draft) {
|
|
11
|
+
if (draft.kind === "development") return "Development draft";
|
|
12
|
+
if (draft.name) return draft.name;
|
|
13
|
+
return `${draft.createdBy.name}, ${dayFormat.format(draft.createdAt)}`;
|
|
14
|
+
}
|
|
15
|
+
const relative = new Intl.RelativeTimeFormat(void 0, { numeric: "auto" });
|
|
16
|
+
const units = [
|
|
17
|
+
["year", 31536e6],
|
|
18
|
+
["month", 2592e6],
|
|
19
|
+
["week", 6048e5],
|
|
20
|
+
["day", 864e5],
|
|
21
|
+
["hour", 36e5],
|
|
22
|
+
["minute", 6e4]
|
|
23
|
+
];
|
|
24
|
+
/** How long ago a moment was, for the viewer: "3 days ago", "yesterday", "now". */
|
|
25
|
+
function timeAgo(at, now = Date.now()) {
|
|
26
|
+
const elapsed = now - at;
|
|
27
|
+
for (const [unit, size] of units) if (elapsed >= size) return relative.format(-Math.round(elapsed / size), unit);
|
|
28
|
+
return relative.format(0, "minute");
|
|
29
|
+
}
|
|
30
|
+
const plural = (count, word) => `${count} ${word}${count === 1 ? "" : "s"}`;
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { draftLabel, plural, timeAgo };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/features/studio/draftNotice.ts
|
|
2
|
+
/** What a member is told when the studio shows Live instead of the draft they opened. */
|
|
3
|
+
function draftNoticeMessage(notice) {
|
|
4
|
+
switch (notice.reason) {
|
|
5
|
+
case "missing": return "This draft doesn't exist, so you're viewing Live.";
|
|
6
|
+
case "noDevelopmentDraft": return "Your development draft doesn't exist until the dev server syncs your definitions, so you're viewing Live.";
|
|
7
|
+
case "forbidden": return "You can't open this draft, so you're viewing Live.";
|
|
8
|
+
case "ended": return `${notice.endedBy.name} ${notice.outcome} this draft, so you're viewing Live.`;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { draftNoticeMessage };
|