camox 0.43.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/camox.mjs +9 -1
- 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 +57 -41
- package/dist/core/components/lexical/MaxLengthPlugin.js +59 -0
- package/dist/core/components/lexical/SelectionBroadcaster.js +55 -56
- package/dist/core/components/lexical/SidebarLexicalEditor.js +327 -234
- package/dist/core/components/lexical/SummaryToggleGuard.js +42 -0
- package/dist/core/components/lexical/TextLinkPopover.js +169 -180
- package/dist/core/createApp.d.ts +254 -299
- package/dist/core/createApp.js +123 -29
- package/dist/core/createBlock.d.ts +5 -5
- package/dist/core/createBlock.js +399 -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 +820 -565
- package/dist/core/editing/createEditableBlock.js +2153 -971
- 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 +304 -103
- package/dist/core/lib/contentType.js +207 -168
- package/dist/core/lib/fieldTypes.js +4 -0
- package/dist/core/lib/iconTypes.d.ts +13 -0
- package/dist/core/lib/icons.d.ts +6 -0
- package/dist/core/lib/icons.js +126 -0
- 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 +7 -7
- package/dist/core/lib/modifierFormats.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 +6 -8
- package/dist/core/lib/textStyles.js +5 -5
- 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 +1734 -0
- package/dist/features/canvas/CanvasBlockFrame.js +353 -0
- package/dist/features/canvas/CanvasBlockHeader.js +55 -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 +335 -0
- package/dist/features/canvas/CanvasPageHeader.js +125 -0
- package/dist/features/canvas/CanvasPreviewPageSlot.js +103 -0
- package/dist/features/canvas/CanvasShelfMarker.js +255 -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 +317 -0
- package/dist/features/canvas/canvasFrameMode.js +53 -0
- package/dist/features/canvas/canvasInsertionSeams.js +44 -0
- package/dist/features/canvas/canvasItems.js +120 -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 +149 -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 +226 -0
- package/dist/features/canvas/sidebar/CanvasSidebar.js +60 -0
- package/dist/features/canvas/sidebar/CanvasSidebarFrame.js +48 -0
- package/dist/features/canvas/sidebar/CanvasSidebarSkeleton.js +39 -0
- package/dist/features/canvas/sidebar/CatalogBlockInspector.js +189 -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 +803 -0
- package/dist/features/canvas/useCanvasFrame.js +149 -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 +101 -69
- 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 +811 -507
- package/dist/features/preview/EditablePageContent.js +1 -1
- package/dist/features/preview/EditablePageExperience.js +16 -22
- package/dist/features/preview/components/AddBlockDialog.js +270 -0
- package/dist/features/preview/components/AssetFieldEditor.js +173 -154
- package/dist/features/preview/components/AssetLightbox.js +194 -136
- 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 +176 -100
- 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 +46 -29
- package/dist/features/preview/components/DrillRow.js +150 -0
- package/dist/features/preview/components/FieldOverlayStyles.js +33 -10
- package/dist/features/preview/components/FieldToolbar.js +166 -116
- package/dist/features/preview/components/Frame.js +108 -20
- package/dist/features/preview/components/IconFieldEditor.js +227 -0
- package/dist/features/preview/components/ItemFieldsEditor.js +238 -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 +10 -42
- 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 +145 -147
- 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 +111 -340
- 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 +27 -0
- 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 +33 -59
- 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 +71 -23
- package/dist/features/provider/LocalhostPreviewProvider.js +73 -73
- package/dist/features/provider/PreviewSignInPage.js +54 -0
- package/dist/features/provider/components/CamoxAppContext.js +11 -11
- package/dist/features/provider/components/CommandPalette.js +87 -143
- 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 +216 -141
- 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 +8 -1
- package/dist/features/runtime/pageViewport.js +7 -0
- package/dist/features/runtime/runtime.d.ts +60 -23
- package/dist/features/runtime/runtime.js +779 -166
- 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 +338 -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 +250 -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 +48 -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/auth.js +1 -50
- 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 +16 -0
- 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 +53 -31
- package/dist/features/vite/vite.js +230 -116
- 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 +139 -60
- 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 +13 -0
- package/dist/lib/queries.d.ts +11 -0
- package/dist/lib/queries.js +71 -131
- package/dist/lib/studio-reads.d.ts +14 -0
- package/dist/lib/studio-reads.js +574 -0
- package/dist/lib/use-project-room.js +50 -47
- 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 -147
- package/dist/studio.css +2 -2
- package/package.json +70 -72
- package/skills/camox/SKILL.md +16 -5
- package/skills/camox/references/artifacts.md +179 -0
- package/skills/camox/references/block-definitions.md +98 -55
- package/skills/camox/references/cli-common.md +18 -6
- package/skills/camox/references/cli-content.md +92 -58
- 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 +7 -7
- 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 +69 -0
- package/skills/camox-expand/references/jobs.md +39 -0
- package/skills/camoxify/SKILL.md +38 -2
- 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 -194
- 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 -166
- 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/previewCommentsStore.js +0 -115
- package/dist/features/preview/publication.js +0 -81
- package/dist/features/runtime/SharedChromeContext.js +0 -7
- package/dist/features/studio/components/EnvironmentMenu.js +0 -413
- 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
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { previewStore } from "./previewStore.js";
|
|
2
|
-
import { createStore } from "@xstate/store-react";
|
|
3
|
-
|
|
4
|
-
//#region src/features/preview/previewCommentsStore.ts
|
|
5
|
-
function revealCommentTarget(target) {
|
|
6
|
-
previewStore.send({
|
|
7
|
-
type: "setCommentMode",
|
|
8
|
-
enabled: false
|
|
9
|
-
});
|
|
10
|
-
previewStore.send({ type: "closeAddBlockSidebar" });
|
|
11
|
-
previewStore.send({ type: "clearPeekedBlock" });
|
|
12
|
-
if (target.blockId == null) {
|
|
13
|
-
previewStore.send({
|
|
14
|
-
type: "setSelection",
|
|
15
|
-
selection: null
|
|
16
|
-
});
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
if (target.fieldName != null) {
|
|
20
|
-
previewStore.send({
|
|
21
|
-
type: "setSelection",
|
|
22
|
-
selection: target.itemId == null ? {
|
|
23
|
-
type: "block-field",
|
|
24
|
-
blockId: target.blockId,
|
|
25
|
-
fieldName: target.fieldName,
|
|
26
|
-
fieldType: target.fieldType ?? "String"
|
|
27
|
-
} : {
|
|
28
|
-
type: "item-field",
|
|
29
|
-
blockId: target.blockId,
|
|
30
|
-
itemId: target.itemId,
|
|
31
|
-
fieldName: target.fieldName,
|
|
32
|
-
fieldType: target.fieldType ?? "String"
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
previewStore.send({
|
|
38
|
-
type: "setSelection",
|
|
39
|
-
selection: target.itemId == null ? {
|
|
40
|
-
type: "block",
|
|
41
|
-
blockId: target.blockId
|
|
42
|
-
} : {
|
|
43
|
-
type: "item",
|
|
44
|
-
blockId: target.blockId,
|
|
45
|
-
itemId: target.itemId
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
/** UI prototype only: comments live in memory, scoped to their originating page. */
|
|
50
|
-
const previewCommentsStore = createStore({
|
|
51
|
-
context: {
|
|
52
|
-
comments: [],
|
|
53
|
-
draft: null,
|
|
54
|
-
activeId: null,
|
|
55
|
-
focusTarget: null
|
|
56
|
-
},
|
|
57
|
-
on: {
|
|
58
|
-
startComment: (context, event) => ({
|
|
59
|
-
...context,
|
|
60
|
-
draft: {
|
|
61
|
-
pageId: event.pageId,
|
|
62
|
-
target: event.target,
|
|
63
|
-
message: ""
|
|
64
|
-
},
|
|
65
|
-
activeId: null,
|
|
66
|
-
focusTarget: event.focusComposer ? event.target : null
|
|
67
|
-
}),
|
|
68
|
-
composerFocused: (context) => ({
|
|
69
|
-
...context,
|
|
70
|
-
focusTarget: null
|
|
71
|
-
}),
|
|
72
|
-
setMessage: (context, event) => ({
|
|
73
|
-
...context,
|
|
74
|
-
draft: context.draft ? {
|
|
75
|
-
...context.draft,
|
|
76
|
-
message: event.message
|
|
77
|
-
} : null
|
|
78
|
-
}),
|
|
79
|
-
postComment: (context, event) => {
|
|
80
|
-
const draft = context.draft;
|
|
81
|
-
if (!draft?.message.trim()) return context;
|
|
82
|
-
return {
|
|
83
|
-
...context,
|
|
84
|
-
comments: [...context.comments, {
|
|
85
|
-
...draft,
|
|
86
|
-
id: event.id,
|
|
87
|
-
message: draft.message.trim(),
|
|
88
|
-
author: event.author,
|
|
89
|
-
createdAt: event.createdAt
|
|
90
|
-
}],
|
|
91
|
-
draft: null,
|
|
92
|
-
activeId: event.id,
|
|
93
|
-
focusTarget: null
|
|
94
|
-
};
|
|
95
|
-
},
|
|
96
|
-
selectComment: (context, event) => ({
|
|
97
|
-
...context,
|
|
98
|
-
activeId: event.id
|
|
99
|
-
}),
|
|
100
|
-
cancelDraft: (context) => ({
|
|
101
|
-
...context,
|
|
102
|
-
draft: null,
|
|
103
|
-
focusTarget: null
|
|
104
|
-
}),
|
|
105
|
-
clearSelection: (context) => ({
|
|
106
|
-
...context,
|
|
107
|
-
draft: null,
|
|
108
|
-
activeId: null,
|
|
109
|
-
focusTarget: null
|
|
110
|
-
})
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
//#endregion
|
|
115
|
-
export { previewCommentsStore, revealCommentTarget };
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
//#region src/features/preview/publication.ts
|
|
2
|
-
/** Scope and impact are shared by all publishing entry points. Only expose choices
|
|
3
|
-
* the backend can execute: a page and its optional layout, or a whole layout.
|
|
4
|
-
* Synced-block dependencies will need backend planning/execution support here,
|
|
5
|
-
* not a separate publishing UI or a sequence of independent block requests.
|
|
6
|
-
*/
|
|
7
|
-
function buildPublicationPlan(target) {
|
|
8
|
-
if (target.kind === "layout" && target.layout.kind === "singleton") return {
|
|
9
|
-
title: "Publish page content",
|
|
10
|
-
description: `Publishes the editable blocks on ${target.name}. The route and application data are controlled by code, not publishing.`,
|
|
11
|
-
items: [{
|
|
12
|
-
key: `layout:${target.layout.id}`,
|
|
13
|
-
label: `${target.name} blocks`,
|
|
14
|
-
impact: "Updates this page’s before and after blocks. Synced block changes also apply wherever those blocks are used.",
|
|
15
|
-
optional: false
|
|
16
|
-
}]
|
|
17
|
-
};
|
|
18
|
-
if (target.kind === "layout") return {
|
|
19
|
-
title: target.layout.status === "modified" ? "Publish changes" : "Publish layout",
|
|
20
|
-
description: `Publishes ${target.name} on every page using this layout. Generated content and external data are not published by this action.`,
|
|
21
|
-
items: [{
|
|
22
|
-
key: `layout:${target.layout.id}`,
|
|
23
|
-
label: `${target.name} layout blocks`,
|
|
24
|
-
impact: "Updates the before and after blocks on every page using this layout, including all derived URLs.",
|
|
25
|
-
optional: false
|
|
26
|
-
}]
|
|
27
|
-
};
|
|
28
|
-
const { page } = target;
|
|
29
|
-
const items = [{
|
|
30
|
-
key: `page:${page.id}`,
|
|
31
|
-
label: page.fullPath,
|
|
32
|
-
impact: page.status === "draft" ? "Makes this page live with its current draft content." : "Updates this page with its latest draft content.",
|
|
33
|
-
optional: false
|
|
34
|
-
}];
|
|
35
|
-
const reason = page.modifiedReason;
|
|
36
|
-
if (reason && (reason.reason === "layout" || reason.reason === "both")) {
|
|
37
|
-
const others = Math.max(0, reason.affectedPagesCount - 1);
|
|
38
|
-
items.push({
|
|
39
|
-
key: `layout:${reason.layoutId}`,
|
|
40
|
-
label: `${reason.layoutHandle} layout blocks`,
|
|
41
|
-
impact: others === 0 ? "Updates shared blocks on this page. Affects no other pages." : `Updates shared blocks on this page and ${others} other ${others === 1 ? "page" : "pages"}.`,
|
|
42
|
-
optional: true
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
return {
|
|
46
|
-
title: page.status === "modified" ? "Publish changes" : "Publish page",
|
|
47
|
-
description: page.status === "draft" ? `This page will go live at ${page.fullPath}.` : `Visitors at ${page.fullPath} will see your latest changes.`,
|
|
48
|
-
items
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function getPublicationCapabilities(target, source) {
|
|
52
|
-
if (!target) return {
|
|
53
|
-
publish: false,
|
|
54
|
-
unpublish: false,
|
|
55
|
-
discard: false
|
|
56
|
-
};
|
|
57
|
-
const record = target.kind === "page" ? target.page : target.layout;
|
|
58
|
-
return {
|
|
59
|
-
publish: record.status !== "published" && source === "draft",
|
|
60
|
-
unpublish: record.livePublishedCheckpointId != null && !(target.kind === "page" && target.page.fullPath === "/"),
|
|
61
|
-
discard: target.kind === "page" && record.status === "modified"
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
function getPublicationRequest(target, includedKeys) {
|
|
65
|
-
if (target.kind === "layout") return {
|
|
66
|
-
kind: "layout",
|
|
67
|
-
input: { id: target.layout.id }
|
|
68
|
-
};
|
|
69
|
-
const optionalLayout = buildPublicationPlan(target).items.find((item) => item.optional);
|
|
70
|
-
const alsoPublishLayout = optionalLayout && includedKeys.includes(optionalLayout.key);
|
|
71
|
-
return {
|
|
72
|
-
kind: "page",
|
|
73
|
-
input: {
|
|
74
|
-
id: target.page.id,
|
|
75
|
-
...alsoPublishLayout ? { alsoPublishLayout: true } : {}
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
//#endregion
|
|
81
|
-
export { buildPublicationPlan, getPublicationCapabilities, getPublicationRequest };
|
|
@@ -1,413 +0,0 @@
|
|
|
1
|
-
import { AuthContext } from "../../../lib/auth.js";
|
|
2
|
-
import { environmentMutations, environmentQueries, projectQueries } from "../../../lib/queries.js";
|
|
3
|
-
import { c } from "react/compiler-runtime";
|
|
4
|
-
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { Button } from "@camox/ui/button";
|
|
8
|
-
import { AlertCircle, ChevronDown, Download, Upload } from "lucide-react";
|
|
9
|
-
import { Alert, AlertDescription } from "@camox/ui/alert";
|
|
10
|
-
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@camox/ui/alert-dialog";
|
|
11
|
-
import { Badge } from "@camox/ui/badge";
|
|
12
|
-
import { Popover, PopoverContent, PopoverTrigger } from "@camox/ui/popover";
|
|
13
|
-
import { Separator } from "@camox/ui/separator";
|
|
14
|
-
import { Spinner } from "@camox/ui/spinner";
|
|
15
|
-
import { toast } from "@camox/ui/toaster";
|
|
16
|
-
|
|
17
|
-
//#region src/features/studio/components/EnvironmentMenu.tsx
|
|
18
|
-
const PRODUCTION_ENV = "production";
|
|
19
|
-
/**
|
|
20
|
-
* Renders the first incompatibility reason as a single-sentence explanation.
|
|
21
|
-
* Mirrors the framings used in the plan: "Cannot push because block type X
|
|
22
|
-
* exists in dev but not in production. Deploy your code to production…".
|
|
23
|
-
*/
|
|
24
|
-
function formatReason(reason, direction) {
|
|
25
|
-
const isPush = direction === "push";
|
|
26
|
-
const sourceLabel = isPush ? "your dev environment" : "production";
|
|
27
|
-
const targetLabel = isPush ? "production" : "your dev environment";
|
|
28
|
-
const remedy = isPush ? "Deploy your code to production to register it, then try again." : "Run your dev project locally to register it, then try again.";
|
|
29
|
-
switch (reason.kind) {
|
|
30
|
-
case "block-definition-missing-in-source": return `Block type "${reason.blockId}" exists in ${targetLabel} but not in ${sourceLabel}.`;
|
|
31
|
-
case "block-definition-missing-in-target": return `Block type "${reason.blockId}" exists in ${sourceLabel} but not in ${targetLabel}. ${remedy}`;
|
|
32
|
-
case "block-definition-schema-mismatch": return `Block type "${reason.blockId}" has a different "${reason.field}" between envs. Sync block definitions and try again.`;
|
|
33
|
-
case "layout-kind-mismatch": return `Layout "${reason.layoutId}" has a different kind between environments. Sync layout definitions and try again.`;
|
|
34
|
-
case "layout-missing-in-source": return `Layout "${reason.layoutId}" exists in ${targetLabel} but not in ${sourceLabel}.`;
|
|
35
|
-
case "layout-missing-in-target": return `Layout "${reason.layoutId}" exists in ${sourceLabel} but not in ${targetLabel}. ${remedy}`;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
const EnvironmentMenu = () => {
|
|
39
|
-
const $ = c(84);
|
|
40
|
-
if ($[0] !== "5eec2ee2385ce7d4417564ed3e8ad71e1d521ff3c557dea4a4ca42288fb12d99") {
|
|
41
|
-
for (let $i = 0; $i < 84; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
42
|
-
$[0] = "5eec2ee2385ce7d4417564ed3e8ad71e1d521ff3c557dea4a4ca42288fb12d99";
|
|
43
|
-
}
|
|
44
|
-
const [open, setOpen] = React.useState(false);
|
|
45
|
-
const [pendingDirection, setPendingDirection] = React.useState(null);
|
|
46
|
-
const authCtx = React.useContext(AuthContext);
|
|
47
|
-
const queryClient = useQueryClient();
|
|
48
|
-
let t0;
|
|
49
|
-
if ($[1] !== authCtx?.projectSlug) {
|
|
50
|
-
t0 = projectQueries.getBySlug(authCtx?.projectSlug ?? "");
|
|
51
|
-
$[1] = authCtx?.projectSlug;
|
|
52
|
-
$[2] = t0;
|
|
53
|
-
} else t0 = $[2];
|
|
54
|
-
const t1 = !!authCtx?.projectSlug;
|
|
55
|
-
let t2;
|
|
56
|
-
if ($[3] !== t0 || $[4] !== t1) {
|
|
57
|
-
t2 = {
|
|
58
|
-
...t0,
|
|
59
|
-
enabled: t1
|
|
60
|
-
};
|
|
61
|
-
$[3] = t0;
|
|
62
|
-
$[4] = t1;
|
|
63
|
-
$[5] = t2;
|
|
64
|
-
} else t2 = $[5];
|
|
65
|
-
const projectId = useQuery(t2).data?.id;
|
|
66
|
-
const environmentName = authCtx?.environmentName;
|
|
67
|
-
const isProduction = environmentName === PRODUCTION_ENV;
|
|
68
|
-
const canReplicate = !!projectId && !!environmentName && !isProduction;
|
|
69
|
-
let t3;
|
|
70
|
-
if ($[6] !== environmentName || $[7] !== projectId) {
|
|
71
|
-
t3 = environmentQueries.checkCompatibility(projectId ?? 0, environmentName ?? "", PRODUCTION_ENV);
|
|
72
|
-
$[6] = environmentName;
|
|
73
|
-
$[7] = projectId;
|
|
74
|
-
$[8] = t3;
|
|
75
|
-
} else t3 = $[8];
|
|
76
|
-
const t4 = open && canReplicate;
|
|
77
|
-
let t5;
|
|
78
|
-
if ($[9] !== t3 || $[10] !== t4) {
|
|
79
|
-
t5 = {
|
|
80
|
-
...t3,
|
|
81
|
-
enabled: t4
|
|
82
|
-
};
|
|
83
|
-
$[9] = t3;
|
|
84
|
-
$[10] = t4;
|
|
85
|
-
$[11] = t5;
|
|
86
|
-
} else t5 = $[11];
|
|
87
|
-
const pushCheck = useQuery(t5);
|
|
88
|
-
let t6;
|
|
89
|
-
if ($[12] !== environmentName || $[13] !== projectId) {
|
|
90
|
-
t6 = environmentQueries.checkCompatibility(projectId ?? 0, PRODUCTION_ENV, environmentName ?? "");
|
|
91
|
-
$[12] = environmentName;
|
|
92
|
-
$[13] = projectId;
|
|
93
|
-
$[14] = t6;
|
|
94
|
-
} else t6 = $[14];
|
|
95
|
-
const t7 = open && canReplicate;
|
|
96
|
-
let t8;
|
|
97
|
-
if ($[15] !== t6 || $[16] !== t7) {
|
|
98
|
-
t8 = {
|
|
99
|
-
...t6,
|
|
100
|
-
enabled: t7
|
|
101
|
-
};
|
|
102
|
-
$[15] = t6;
|
|
103
|
-
$[16] = t7;
|
|
104
|
-
$[17] = t8;
|
|
105
|
-
} else t8 = $[17];
|
|
106
|
-
const pullCheck = useQuery(t8);
|
|
107
|
-
let t9;
|
|
108
|
-
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
109
|
-
t9 = environmentMutations.replicate();
|
|
110
|
-
$[18] = t9;
|
|
111
|
-
} else t9 = $[18];
|
|
112
|
-
let t10;
|
|
113
|
-
if ($[19] !== queryClient) {
|
|
114
|
-
t10 = (data, variables) => {
|
|
115
|
-
const verb = variables.targetEnvName === PRODUCTION_ENV ? "Pushed to production" : "Pulled from production";
|
|
116
|
-
const { pages, blocks, files } = data.copied;
|
|
117
|
-
toast.success(`${verb} — ${pages} pages, ${blocks} blocks, ${files} files`);
|
|
118
|
-
queryClient.invalidateQueries({ queryKey: ["camox"] });
|
|
119
|
-
setPendingDirection(null);
|
|
120
|
-
setOpen(false);
|
|
121
|
-
};
|
|
122
|
-
$[19] = queryClient;
|
|
123
|
-
$[20] = t10;
|
|
124
|
-
} else t10 = $[20];
|
|
125
|
-
let t11;
|
|
126
|
-
if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
|
|
127
|
-
t11 = (error) => {
|
|
128
|
-
console.error("Failed to replicate environment:", error);
|
|
129
|
-
toast.error("Could not replicate environment");
|
|
130
|
-
setPendingDirection(null);
|
|
131
|
-
};
|
|
132
|
-
$[21] = t11;
|
|
133
|
-
} else t11 = $[21];
|
|
134
|
-
let t12;
|
|
135
|
-
if ($[22] !== t10) {
|
|
136
|
-
t12 = {
|
|
137
|
-
...t9,
|
|
138
|
-
onSuccess: t10,
|
|
139
|
-
onError: t11
|
|
140
|
-
};
|
|
141
|
-
$[22] = t10;
|
|
142
|
-
$[23] = t12;
|
|
143
|
-
} else t12 = $[23];
|
|
144
|
-
const replicate = useMutation(t12);
|
|
145
|
-
if (!authCtx?.environmentName) return null;
|
|
146
|
-
const label = isProduction ? "PROD" : "DEV";
|
|
147
|
-
const badgeClassName = isProduction ? "bg-green-100 text-green-800 border border-green-300 hover:bg-green-100 dark:bg-green-900 dark:text-green-300 dark:border-green-700 dark:hover:bg-green-900 font-mono text-xs" : "bg-yellow-100 text-yellow-800 border border-yellow-300 hover:bg-yellow-100 dark:bg-yellow-900 dark:text-yellow-300 dark:border-yellow-700 dark:hover:bg-yellow-900 font-mono text-xs";
|
|
148
|
-
let t13;
|
|
149
|
-
if ($[24] !== canReplicate || $[25] !== environmentName || $[26] !== pendingDirection || $[27] !== projectId || $[28] !== replicate) {
|
|
150
|
-
t13 = () => {
|
|
151
|
-
if (!pendingDirection || !canReplicate || !environmentName || !projectId) return;
|
|
152
|
-
const sourceEnvName = pendingDirection === "push" ? environmentName : PRODUCTION_ENV;
|
|
153
|
-
const targetEnvName = pendingDirection === "push" ? PRODUCTION_ENV : environmentName;
|
|
154
|
-
replicate.mutate({
|
|
155
|
-
projectId,
|
|
156
|
-
sourceEnvName,
|
|
157
|
-
targetEnvName
|
|
158
|
-
});
|
|
159
|
-
};
|
|
160
|
-
$[24] = canReplicate;
|
|
161
|
-
$[25] = environmentName;
|
|
162
|
-
$[26] = pendingDirection;
|
|
163
|
-
$[27] = projectId;
|
|
164
|
-
$[28] = replicate;
|
|
165
|
-
$[29] = t13;
|
|
166
|
-
} else t13 = $[29];
|
|
167
|
-
const handleConfirm = t13;
|
|
168
|
-
const pushReason = pushCheck.data && !pushCheck.data.compatible ? pushCheck.data.reasons[0] : null;
|
|
169
|
-
const pullReason = pullCheck.data && !pullCheck.data.compatible ? pullCheck.data.reasons[0] : null;
|
|
170
|
-
let t14;
|
|
171
|
-
if ($[30] !== pullReason || $[31] !== pushReason) {
|
|
172
|
-
t14 = pushReason ? formatReason(pushReason, "push") : pullReason ? formatReason(pullReason, "pull") : null;
|
|
173
|
-
$[30] = pullReason;
|
|
174
|
-
$[31] = pushReason;
|
|
175
|
-
$[32] = t14;
|
|
176
|
-
} else t14 = $[32];
|
|
177
|
-
const firstCompatibilityError = t14;
|
|
178
|
-
let t15;
|
|
179
|
-
if ($[33] !== pullCheck || $[34] !== pushCheck || $[35] !== replicate.isPending) {
|
|
180
|
-
t15 = (direction) => {
|
|
181
|
-
const check = direction === "push" ? pushCheck : pullCheck;
|
|
182
|
-
const checking = check.isLoading;
|
|
183
|
-
const compatible = check.data?.compatible ?? false;
|
|
184
|
-
const Icon = direction === "push" ? Upload : Download;
|
|
185
|
-
const actionLabel = direction === "push" ? "Push to production" : "Pull from production";
|
|
186
|
-
return /* @__PURE__ */ jsxs(Button, {
|
|
187
|
-
variant: "outline",
|
|
188
|
-
size: "sm",
|
|
189
|
-
className: "w-full justify-start gap-2",
|
|
190
|
-
disabled: checking || !compatible || replicate.isPending,
|
|
191
|
-
onClick: () => setPendingDirection(direction),
|
|
192
|
-
children: [checking ? /* @__PURE__ */ jsx(Spinner, { className: "text-muted-foreground" }) : /* @__PURE__ */ jsx(Icon, { className: "text-muted-foreground size-4" }), /* @__PURE__ */ jsx("span", { children: actionLabel })]
|
|
193
|
-
});
|
|
194
|
-
};
|
|
195
|
-
$[33] = pullCheck;
|
|
196
|
-
$[34] = pushCheck;
|
|
197
|
-
$[35] = replicate.isPending;
|
|
198
|
-
$[36] = t15;
|
|
199
|
-
} else t15 = $[36];
|
|
200
|
-
const renderActionButton = t15;
|
|
201
|
-
let t16;
|
|
202
|
-
if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
|
|
203
|
-
t16 = /* @__PURE__ */ jsx(Button, {
|
|
204
|
-
variant: "ghost",
|
|
205
|
-
className: "gap-2"
|
|
206
|
-
});
|
|
207
|
-
$[37] = t16;
|
|
208
|
-
} else t16 = $[37];
|
|
209
|
-
let t17;
|
|
210
|
-
if ($[38] !== badgeClassName || $[39] !== label) {
|
|
211
|
-
t17 = /* @__PURE__ */ jsx(Badge, {
|
|
212
|
-
variant: "secondary",
|
|
213
|
-
className: badgeClassName,
|
|
214
|
-
children: label
|
|
215
|
-
});
|
|
216
|
-
$[38] = badgeClassName;
|
|
217
|
-
$[39] = label;
|
|
218
|
-
$[40] = t17;
|
|
219
|
-
} else t17 = $[40];
|
|
220
|
-
let t18;
|
|
221
|
-
if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
|
|
222
|
-
t18 = /* @__PURE__ */ jsx(ChevronDown, { className: "shrink-0 opacity-50" });
|
|
223
|
-
$[41] = t18;
|
|
224
|
-
} else t18 = $[41];
|
|
225
|
-
let t19;
|
|
226
|
-
if ($[42] !== t17) {
|
|
227
|
-
t19 = /* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
228
|
-
render: t16,
|
|
229
|
-
children: [t17, t18]
|
|
230
|
-
});
|
|
231
|
-
$[42] = t17;
|
|
232
|
-
$[43] = t19;
|
|
233
|
-
} else t19 = $[43];
|
|
234
|
-
let t20;
|
|
235
|
-
if ($[44] !== firstCompatibilityError || $[45] !== isProduction || $[46] !== renderActionButton) {
|
|
236
|
-
t20 = /* @__PURE__ */ jsx(PopoverContent, {
|
|
237
|
-
className: "w-96 p-0",
|
|
238
|
-
align: "start",
|
|
239
|
-
side: "bottom",
|
|
240
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
241
|
-
className: "flex flex-col gap-3 py-4",
|
|
242
|
-
children: isProduction ? /* @__PURE__ */ jsx("p", {
|
|
243
|
-
className: "px-4 text-sm",
|
|
244
|
-
children: "You are viewing the production environment."
|
|
245
|
-
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
246
|
-
/* @__PURE__ */ jsx("p", {
|
|
247
|
-
className: "px-4 text-sm",
|
|
248
|
-
children: "This environment is your personal space to iterate on content and data structures. It doesn't affect production data."
|
|
249
|
-
}),
|
|
250
|
-
/* @__PURE__ */ jsx(Separator, {}),
|
|
251
|
-
/* @__PURE__ */ jsx("p", {
|
|
252
|
-
className: "text-muted-foreground px-4 text-xs font-medium",
|
|
253
|
-
children: "Transfer data across environments"
|
|
254
|
-
}),
|
|
255
|
-
/* @__PURE__ */ jsxs("div", {
|
|
256
|
-
className: "flex flex-col gap-2 px-4",
|
|
257
|
-
children: [
|
|
258
|
-
renderActionButton("push"),
|
|
259
|
-
renderActionButton("pull"),
|
|
260
|
-
firstCompatibilityError ? /* @__PURE__ */ jsxs(Alert, {
|
|
261
|
-
variant: "destructive",
|
|
262
|
-
className: "mt-1",
|
|
263
|
-
children: [/* @__PURE__ */ jsx(AlertCircle, { className: "size-4" }), /* @__PURE__ */ jsx(AlertDescription, { children: firstCompatibilityError })]
|
|
264
|
-
}) : null
|
|
265
|
-
]
|
|
266
|
-
})
|
|
267
|
-
] })
|
|
268
|
-
})
|
|
269
|
-
});
|
|
270
|
-
$[44] = firstCompatibilityError;
|
|
271
|
-
$[45] = isProduction;
|
|
272
|
-
$[46] = renderActionButton;
|
|
273
|
-
$[47] = t20;
|
|
274
|
-
} else t20 = $[47];
|
|
275
|
-
let t21;
|
|
276
|
-
if ($[48] !== open || $[49] !== t19 || $[50] !== t20) {
|
|
277
|
-
t21 = /* @__PURE__ */ jsxs(Popover, {
|
|
278
|
-
open,
|
|
279
|
-
onOpenChange: setOpen,
|
|
280
|
-
children: [t19, t20]
|
|
281
|
-
});
|
|
282
|
-
$[48] = open;
|
|
283
|
-
$[49] = t19;
|
|
284
|
-
$[50] = t20;
|
|
285
|
-
$[51] = t21;
|
|
286
|
-
} else t21 = $[51];
|
|
287
|
-
const t22 = !!pendingDirection;
|
|
288
|
-
let t23;
|
|
289
|
-
if ($[52] !== replicate.isPending) {
|
|
290
|
-
t23 = (o) => {
|
|
291
|
-
if (!o && !replicate.isPending) setPendingDirection(null);
|
|
292
|
-
};
|
|
293
|
-
$[52] = replicate.isPending;
|
|
294
|
-
$[53] = t23;
|
|
295
|
-
} else t23 = $[53];
|
|
296
|
-
const t24 = pendingDirection === "push" ? "Push to production?" : "Pull from production?";
|
|
297
|
-
let t25;
|
|
298
|
-
if ($[54] !== t24) {
|
|
299
|
-
t25 = /* @__PURE__ */ jsx(AlertDialogTitle, { children: t24 });
|
|
300
|
-
$[54] = t24;
|
|
301
|
-
$[55] = t25;
|
|
302
|
-
} else t25 = $[55];
|
|
303
|
-
let t26;
|
|
304
|
-
if ($[56] !== environmentName || $[57] !== pendingDirection) {
|
|
305
|
-
t26 = /* @__PURE__ */ jsx(AlertDialogDescription, { children: pendingDirection === "push" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
306
|
-
"This will replace all content in",
|
|
307
|
-
" ",
|
|
308
|
-
/* @__PURE__ */ jsx("span", {
|
|
309
|
-
className: "font-mono font-semibold",
|
|
310
|
-
children: "production"
|
|
311
|
-
}),
|
|
312
|
-
" with the current",
|
|
313
|
-
" ",
|
|
314
|
-
/* @__PURE__ */ jsx("span", {
|
|
315
|
-
className: "font-mono font-semibold",
|
|
316
|
-
children: environmentName
|
|
317
|
-
}),
|
|
318
|
-
" environment. This action cannot be undone."
|
|
319
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
320
|
-
"This will replace all content in your",
|
|
321
|
-
" ",
|
|
322
|
-
/* @__PURE__ */ jsx("span", {
|
|
323
|
-
className: "font-mono font-semibold",
|
|
324
|
-
children: environmentName
|
|
325
|
-
}),
|
|
326
|
-
" environment with ",
|
|
327
|
-
/* @__PURE__ */ jsx("span", {
|
|
328
|
-
className: "font-mono font-semibold",
|
|
329
|
-
children: "production"
|
|
330
|
-
}),
|
|
331
|
-
". This action cannot be undone."
|
|
332
|
-
] }) });
|
|
333
|
-
$[56] = environmentName;
|
|
334
|
-
$[57] = pendingDirection;
|
|
335
|
-
$[58] = t26;
|
|
336
|
-
} else t26 = $[58];
|
|
337
|
-
let t27;
|
|
338
|
-
if ($[59] !== t25 || $[60] !== t26) {
|
|
339
|
-
t27 = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [t25, t26] });
|
|
340
|
-
$[59] = t25;
|
|
341
|
-
$[60] = t26;
|
|
342
|
-
$[61] = t27;
|
|
343
|
-
} else t27 = $[61];
|
|
344
|
-
let t28;
|
|
345
|
-
if ($[62] !== replicate.isPending) {
|
|
346
|
-
t28 = /* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
347
|
-
variant: "outline",
|
|
348
|
-
size: "default",
|
|
349
|
-
disabled: replicate.isPending,
|
|
350
|
-
children: "Cancel"
|
|
351
|
-
});
|
|
352
|
-
$[62] = replicate.isPending;
|
|
353
|
-
$[63] = t28;
|
|
354
|
-
} else t28 = $[63];
|
|
355
|
-
let t29;
|
|
356
|
-
if ($[64] !== replicate.isPending) {
|
|
357
|
-
t29 = replicate.isPending ? /* @__PURE__ */ jsx(Spinner, {}) : null;
|
|
358
|
-
$[64] = replicate.isPending;
|
|
359
|
-
$[65] = t29;
|
|
360
|
-
} else t29 = $[65];
|
|
361
|
-
const t30 = pendingDirection === "push" ? "Push" : "Pull";
|
|
362
|
-
let t31;
|
|
363
|
-
if ($[66] !== handleConfirm || $[67] !== replicate.isPending || $[68] !== t29 || $[69] !== t30) {
|
|
364
|
-
t31 = /* @__PURE__ */ jsxs(AlertDialogAction, {
|
|
365
|
-
variant: "destructive",
|
|
366
|
-
onClick: handleConfirm,
|
|
367
|
-
disabled: replicate.isPending,
|
|
368
|
-
children: [t29, t30]
|
|
369
|
-
});
|
|
370
|
-
$[66] = handleConfirm;
|
|
371
|
-
$[67] = replicate.isPending;
|
|
372
|
-
$[68] = t29;
|
|
373
|
-
$[69] = t30;
|
|
374
|
-
$[70] = t31;
|
|
375
|
-
} else t31 = $[70];
|
|
376
|
-
let t32;
|
|
377
|
-
if ($[71] !== t28 || $[72] !== t31) {
|
|
378
|
-
t32 = /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [t28, t31] });
|
|
379
|
-
$[71] = t28;
|
|
380
|
-
$[72] = t31;
|
|
381
|
-
$[73] = t32;
|
|
382
|
-
} else t32 = $[73];
|
|
383
|
-
let t33;
|
|
384
|
-
if ($[74] !== t27 || $[75] !== t32) {
|
|
385
|
-
t33 = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [t27, t32] });
|
|
386
|
-
$[74] = t27;
|
|
387
|
-
$[75] = t32;
|
|
388
|
-
$[76] = t33;
|
|
389
|
-
} else t33 = $[76];
|
|
390
|
-
let t34;
|
|
391
|
-
if ($[77] !== t22 || $[78] !== t23 || $[79] !== t33) {
|
|
392
|
-
t34 = /* @__PURE__ */ jsx(AlertDialog, {
|
|
393
|
-
open: t22,
|
|
394
|
-
onOpenChange: t23,
|
|
395
|
-
children: t33
|
|
396
|
-
});
|
|
397
|
-
$[77] = t22;
|
|
398
|
-
$[78] = t23;
|
|
399
|
-
$[79] = t33;
|
|
400
|
-
$[80] = t34;
|
|
401
|
-
} else t34 = $[80];
|
|
402
|
-
let t35;
|
|
403
|
-
if ($[81] !== t21 || $[82] !== t34) {
|
|
404
|
-
t35 = /* @__PURE__ */ jsxs(Fragment, { children: [t21, t34] });
|
|
405
|
-
$[81] = t21;
|
|
406
|
-
$[82] = t34;
|
|
407
|
-
$[83] = t35;
|
|
408
|
-
} else t35 = $[83];
|
|
409
|
-
return t35;
|
|
410
|
-
};
|
|
411
|
-
|
|
412
|
-
//#endregion
|
|
413
|
-
export { EnvironmentMenu };
|