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,29 +1,38 @@
|
|
|
1
|
-
import { useLocation, useNavigate } from "../navigation/navigation.js";
|
|
2
1
|
import { actionsStore } from "../provider/actionsStore.js";
|
|
3
|
-
import { useIsAuthenticated,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { useIsAuthenticated, useProjectUuid } from "../../lib/auth.js";
|
|
3
|
+
import { parseLocalePath } from "../../lib/locale-path.js";
|
|
4
|
+
import { useCurrentDraftId, withoutDraft } from "../../lib/draft-scope.js";
|
|
5
|
+
import { useViewLocale } from "../../lib/view-locale-context.js";
|
|
6
|
+
import { useLocation, useNavigate } from "../navigation/navigation.js";
|
|
7
7
|
import { useCamoxApp } from "../provider/components/CamoxAppContext.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { NormalizedDataProvider, usePageBlocks } from "../../lib/normalized-data.js";
|
|
9
|
+
import { reads, useRead, useStudioCache } from "../../lib/studio-reads.js";
|
|
10
|
+
import { BlockErrorBoundary } from "./components/BlockErrorBoundary.js";
|
|
11
|
+
import { CollectionItemSheetProvider } from "../content/CollectionItemSheetContext.js";
|
|
10
12
|
import { cn } from "../../lib/utils.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
13
|
+
import { ContentCollectionItemSheet } from "../content/ContentCollection.js";
|
|
14
|
+
import { usePageDestinations } from "../../hooks/use-page-destinations.js";
|
|
15
|
+
import { useLocalePath, useLocalizedPath } from "../../lib/view-locale.js";
|
|
16
|
+
import { canvasStore } from "../canvas/canvasStore.js";
|
|
17
|
+
import { SHOW_WHOLE_CANVAS_SHORTCUT, TOGGLE_CANVAS_SHORTCUT } from "./previewConstants.js";
|
|
18
|
+
import { CanvasSidebarSkeleton } from "../canvas/sidebar/CanvasSidebarSkeleton.js";
|
|
19
|
+
import { DerivedPageContent } from "../page/DerivedPageContent.js";
|
|
20
|
+
import { STUDIO_CANVAS_PATH } from "../studio/routes.js";
|
|
21
|
+
import { studioStore } from "../studio/studioStore.js";
|
|
22
|
+
import { previewStore, selectIsCanvasShown } from "./previewStore.js";
|
|
23
|
+
import { AddBlockDialog } from "./components/AddBlockDialog.js";
|
|
24
|
+
import { CanvasPreview, prefetchCanvas } from "./components/CanvasPreview.js";
|
|
14
25
|
import { CreatePageModal } from "./components/CreatePageModal.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { PeekedBlock } from "./components/PeekedBlock.js";
|
|
26
|
+
import { PreviewEditingOwnerContext } from "./previewSelection.js";
|
|
27
|
+
import { PageRecordContext, getPageRecord, useDerivedPageResult, useFollowPageRecord } from "./pageRecord.js";
|
|
18
28
|
import { PreviewPanel } from "./components/PreviewPanel.js";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
29
|
+
import { RemovedBlockPlaceholder } from "./components/RemovedBlockPlaceholder.js";
|
|
30
|
+
import { usePreviewViewportActions } from "./usePreviewViewportActions.js";
|
|
21
31
|
import { c } from "react/compiler-runtime";
|
|
22
|
-
import { useQueryClient, useSuspenseQuery } from "@tanstack/react-query";
|
|
23
32
|
import * as React from "react";
|
|
24
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
25
33
|
import { useSelector } from "@xstate/store-react";
|
|
26
|
-
import {
|
|
34
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
35
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
27
36
|
|
|
28
37
|
//#region src/features/preview/CamoxPreview.tsx
|
|
29
38
|
const MOBILE_STUDIO_QUERY = "(max-width: 767px)";
|
|
@@ -36,402 +45,679 @@ function getMobileStudioSnapshot() {
|
|
|
36
45
|
return window.matchMedia(MOBILE_STUDIO_QUERY).matches;
|
|
37
46
|
}
|
|
38
47
|
function useIsMobileStudio() {
|
|
39
|
-
const $ = c(1);
|
|
40
|
-
if ($[0] !== "2d1a4df08feec350ec60cc84fec5c50c421655f0e335816baf3bbe36ccd11082") {
|
|
41
|
-
for (let $i = 0; $i < 1; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
42
|
-
$[0] = "2d1a4df08feec350ec60cc84fec5c50c421655f0e335816baf3bbe36ccd11082";
|
|
43
|
-
}
|
|
44
48
|
return React.useSyncExternalStore(subscribeToMobileStudio, getMobileStudioSnapshot, _temp);
|
|
45
49
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Fetches the current page being previewed, with live updates for authenticated users.
|
|
48
|
-
*
|
|
49
|
-
* Data for the current route is guaranteed in queryClient cache from the loader's
|
|
50
|
-
* ensureQueryData. Live updates are gated by useProjectRoom only running in
|
|
51
|
-
* AuthenticatedCamoxProvider — unauthenticated users get SSR data that never refetches.
|
|
52
|
-
*/
|
|
53
|
-
/**
|
|
54
|
-
* Lightweight queryFn for client-side refetches — only fetches structural data.
|
|
55
|
-
* Used after initial SSR load when block caches are already populated.
|
|
56
|
-
*
|
|
57
|
-
* Source is threaded from the studio's source select (previewStore). Each
|
|
58
|
-
* source has its own cache slot, so toggling Draft↔Live is instant once both
|
|
59
|
-
* have been seeded. Public visitors never invalidate (no project room) so
|
|
60
|
-
* this query function doesn't run for them — they stay on the SSR-seeded
|
|
61
|
-
* 'live' data.
|
|
62
|
-
*/
|
|
63
50
|
function _temp() {
|
|
64
51
|
return false;
|
|
65
52
|
}
|
|
66
|
-
|
|
67
|
-
return () => getApiClient().pages.getStructure({
|
|
68
|
-
path,
|
|
69
|
-
projectSlug,
|
|
70
|
-
source
|
|
71
|
-
});
|
|
72
|
-
}
|
|
53
|
+
/** The page the Preview shows: as the server rendered it, then following edits. */
|
|
73
54
|
function usePreviewedPage() {
|
|
74
|
-
const $ = c(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
$[0] = "2d1a4df08feec350ec60cc84fec5c50c421655f0e335816baf3bbe36ccd11082";
|
|
78
|
-
}
|
|
79
|
-
const { pathname } = useLocation();
|
|
80
|
-
const projectSlug = useProjectSlug();
|
|
81
|
-
const previewSource = useSelector(previewStore, selectPreviewSource);
|
|
55
|
+
const $ = c(3);
|
|
56
|
+
const pathname = useLocalePath();
|
|
57
|
+
const projectUuid = useProjectUuid();
|
|
82
58
|
let t0;
|
|
83
|
-
if ($[
|
|
84
|
-
t0 =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
$[5] = previewSource;
|
|
94
|
-
$[6] = projectSlug;
|
|
95
|
-
$[7] = t1;
|
|
96
|
-
} else t1 = $[7];
|
|
97
|
-
let t2;
|
|
98
|
-
if ($[8] !== t0 || $[9] !== t1) {
|
|
99
|
-
t2 = {
|
|
100
|
-
queryKey: t0,
|
|
101
|
-
queryFn: t1,
|
|
102
|
-
staleTime: Infinity
|
|
103
|
-
};
|
|
104
|
-
$[8] = t0;
|
|
105
|
-
$[9] = t1;
|
|
106
|
-
$[10] = t2;
|
|
107
|
-
} else t2 = $[10];
|
|
108
|
-
const { data: currentPage } = useSuspenseQuery(t2);
|
|
109
|
-
return currentPage;
|
|
59
|
+
if ($[0] !== pathname || $[1] !== projectUuid) {
|
|
60
|
+
t0 = reads.pageStructure({
|
|
61
|
+
path: pathname,
|
|
62
|
+
projectUuid
|
|
63
|
+
});
|
|
64
|
+
$[0] = pathname;
|
|
65
|
+
$[1] = projectUuid;
|
|
66
|
+
$[2] = t0;
|
|
67
|
+
} else t0 = $[2];
|
|
68
|
+
return useRead(t0);
|
|
110
69
|
}
|
|
111
70
|
const BlockRenderer = (t0) => {
|
|
112
|
-
const $ = c(
|
|
113
|
-
if ($[0] !== "2d1a4df08feec350ec60cc84fec5c50c421655f0e335816baf3bbe36ccd11082") {
|
|
114
|
-
for (let $i = 0; $i < 23; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
115
|
-
$[0] = "2d1a4df08feec350ec60cc84fec5c50c421655f0e335816baf3bbe36ccd11082";
|
|
116
|
-
}
|
|
71
|
+
const $ = c(28);
|
|
117
72
|
const { blockId, mode, showAddBlockTop, showAddBlockBottom } = t0;
|
|
118
|
-
const previewSource = useSelector(previewStore, selectPreviewSource);
|
|
119
73
|
let t1;
|
|
120
|
-
if ($[
|
|
121
|
-
t1 =
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const { data } = useSuspenseQuery(t1);
|
|
74
|
+
if ($[0] !== blockId) {
|
|
75
|
+
t1 = reads.blockBundle(blockId);
|
|
76
|
+
$[0] = blockId;
|
|
77
|
+
$[1] = t1;
|
|
78
|
+
} else t1 = $[1];
|
|
79
|
+
const data = useRead(t1);
|
|
127
80
|
const camoxApp = useCamoxApp();
|
|
128
81
|
let t2;
|
|
129
|
-
if ($[
|
|
82
|
+
if ($[2] !== camoxApp || $[3] !== data.block.type) {
|
|
130
83
|
t2 = camoxApp.getBlockById(data.block.type);
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
} else t2 = $[
|
|
84
|
+
$[2] = camoxApp;
|
|
85
|
+
$[3] = data.block.type;
|
|
86
|
+
$[4] = t2;
|
|
87
|
+
} else t2 = $[4];
|
|
135
88
|
const blockDef = t2;
|
|
136
|
-
if (!blockDef)
|
|
89
|
+
if (!blockDef) {
|
|
90
|
+
let t3;
|
|
91
|
+
if ($[5] !== blockId || $[6] !== data.block.type || $[7] !== mode) {
|
|
92
|
+
t3 = /* @__PURE__ */ jsx(RemovedBlockPlaceholder, {
|
|
93
|
+
blockId,
|
|
94
|
+
type: data.block.type,
|
|
95
|
+
mode
|
|
96
|
+
});
|
|
97
|
+
$[5] = blockId;
|
|
98
|
+
$[6] = data.block.type;
|
|
99
|
+
$[7] = mode;
|
|
100
|
+
$[8] = t3;
|
|
101
|
+
} else t3 = $[8];
|
|
102
|
+
return t3;
|
|
103
|
+
}
|
|
137
104
|
const t3 = data.files;
|
|
138
105
|
const t4 = data.repeatableItems;
|
|
106
|
+
let t5;
|
|
107
|
+
if ($[9] !== data.block) {
|
|
108
|
+
t5 = [data.block];
|
|
109
|
+
$[9] = data.block;
|
|
110
|
+
$[10] = t5;
|
|
111
|
+
} else t5 = $[10];
|
|
139
112
|
const T0 = blockDef._internal.Component;
|
|
140
|
-
const
|
|
141
|
-
const
|
|
142
|
-
const
|
|
143
|
-
const
|
|
144
|
-
const
|
|
145
|
-
let t10;
|
|
146
|
-
if ($[7] !== data.block.id || $[8] !== data.block.type || $[9] !== t7 || $[10] !== t8 || $[11] !== t9) {
|
|
147
|
-
t10 = {
|
|
148
|
-
_id: t5,
|
|
149
|
-
type: t6,
|
|
150
|
-
content: t7,
|
|
151
|
-
settings: t8,
|
|
152
|
-
position: t9
|
|
153
|
-
};
|
|
154
|
-
$[7] = data.block.id;
|
|
155
|
-
$[8] = data.block.type;
|
|
156
|
-
$[9] = t7;
|
|
157
|
-
$[10] = t8;
|
|
158
|
-
$[11] = t9;
|
|
159
|
-
$[12] = t10;
|
|
160
|
-
} else t10 = $[12];
|
|
113
|
+
const t6 = data.block.id;
|
|
114
|
+
const t7 = data.block.type;
|
|
115
|
+
const t8 = data.block.content;
|
|
116
|
+
const t9 = data.block.settings;
|
|
117
|
+
const t10 = String(data.block.position);
|
|
161
118
|
let t11;
|
|
162
|
-
if ($[
|
|
163
|
-
t11 =
|
|
164
|
-
|
|
119
|
+
if ($[11] !== data.block.id || $[12] !== data.block.type || $[13] !== t10 || $[14] !== t8 || $[15] !== t9) {
|
|
120
|
+
t11 = {
|
|
121
|
+
_id: t6,
|
|
122
|
+
type: t7,
|
|
123
|
+
content: t8,
|
|
124
|
+
settings: t9,
|
|
125
|
+
position: t10
|
|
126
|
+
};
|
|
127
|
+
$[11] = data.block.id;
|
|
128
|
+
$[12] = data.block.type;
|
|
129
|
+
$[13] = t10;
|
|
130
|
+
$[14] = t8;
|
|
131
|
+
$[15] = t9;
|
|
132
|
+
$[16] = t11;
|
|
133
|
+
} else t11 = $[16];
|
|
134
|
+
let t12;
|
|
135
|
+
if ($[17] !== blockDef._internal.Component || $[18] !== mode || $[19] !== showAddBlockBottom || $[20] !== showAddBlockTop || $[21] !== t11) {
|
|
136
|
+
t12 = /* @__PURE__ */ jsx(T0, {
|
|
137
|
+
blockData: t11,
|
|
165
138
|
mode,
|
|
166
139
|
showAddBlockTop,
|
|
167
140
|
showAddBlockBottom
|
|
168
141
|
});
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[17] = t10;
|
|
174
|
-
$[18] = t11;
|
|
175
|
-
} else t11 = $[18];
|
|
176
|
-
let t12;
|
|
177
|
-
if ($[19] !== data.files || $[20] !== data.repeatableItems || $[21] !== t11) {
|
|
178
|
-
t12 = /* @__PURE__ */ jsx(NormalizedDataProvider, {
|
|
179
|
-
files: t3,
|
|
180
|
-
repeatableItems: t4,
|
|
181
|
-
children: t11
|
|
182
|
-
});
|
|
183
|
-
$[19] = data.files;
|
|
184
|
-
$[20] = data.repeatableItems;
|
|
142
|
+
$[17] = blockDef._internal.Component;
|
|
143
|
+
$[18] = mode;
|
|
144
|
+
$[19] = showAddBlockBottom;
|
|
145
|
+
$[20] = showAddBlockTop;
|
|
185
146
|
$[21] = t11;
|
|
186
147
|
$[22] = t12;
|
|
187
148
|
} else t12 = $[22];
|
|
188
|
-
|
|
149
|
+
let t13;
|
|
150
|
+
if ($[23] !== data.files || $[24] !== data.repeatableItems || $[25] !== t12 || $[26] !== t5) {
|
|
151
|
+
t13 = /* @__PURE__ */ jsx(NormalizedDataProvider, {
|
|
152
|
+
files: t3,
|
|
153
|
+
repeatableItems: t4,
|
|
154
|
+
blocks: t5,
|
|
155
|
+
children: t12
|
|
156
|
+
});
|
|
157
|
+
$[23] = data.files;
|
|
158
|
+
$[24] = data.repeatableItems;
|
|
159
|
+
$[25] = t12;
|
|
160
|
+
$[26] = t5;
|
|
161
|
+
$[27] = t13;
|
|
162
|
+
} else t13 = $[27];
|
|
163
|
+
return t13;
|
|
189
164
|
};
|
|
190
165
|
const PageContent = () => {
|
|
166
|
+
const $ = c(30);
|
|
191
167
|
const pageData = usePreviewedPage();
|
|
192
|
-
const { pageBlocks, beforeBlocks, afterBlocks, layoutFiles, layoutItems } = usePageBlocks(pageData
|
|
193
|
-
const peekedBlockPosition = useSelector(previewStore, (state) => state.context.peekedBlockPosition);
|
|
194
|
-
const displayedPositionRef = React.useRef(null);
|
|
195
|
-
if (peekedBlockPosition !== null) displayedPositionRef.current = peekedBlockPosition;
|
|
196
|
-
const effectivePosition = peekedBlockPosition ?? displayedPositionRef.current;
|
|
197
|
-
const onExitComplete = React.useCallback(() => {
|
|
198
|
-
displayedPositionRef.current = null;
|
|
199
|
-
}, []);
|
|
168
|
+
const { pageBlocks, beforeBlocks, afterBlocks, layoutFiles, layoutItems } = usePageBlocks(pageData);
|
|
200
169
|
const camoxApp = useCamoxApp();
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
170
|
+
let layout;
|
|
171
|
+
let layoutBlocksMap;
|
|
172
|
+
let t0;
|
|
173
|
+
if ($[0] !== afterBlocks || $[1] !== beforeBlocks || $[2] !== camoxApp || $[3] !== pageBlocks || $[4] !== pageData) {
|
|
174
|
+
layout = pageData.layout ? camoxApp.getLayoutById(pageData.layout.layoutId) : void 0;
|
|
175
|
+
let t1;
|
|
176
|
+
bb0: {
|
|
177
|
+
if (!pageData.layout) {
|
|
178
|
+
t1 = null;
|
|
179
|
+
break bb0;
|
|
180
|
+
}
|
|
181
|
+
let blocks;
|
|
182
|
+
if ($[8] !== afterBlocks || $[9] !== beforeBlocks) {
|
|
183
|
+
const allLayoutBlocks = [...beforeBlocks, ...afterBlocks];
|
|
184
|
+
blocks = {};
|
|
185
|
+
for (const block of allLayoutBlocks) blocks[block.type] = {
|
|
186
|
+
_id: block.id,
|
|
187
|
+
type: block.type,
|
|
188
|
+
content: block.content,
|
|
189
|
+
settings: block.settings,
|
|
190
|
+
position: String(block.position)
|
|
191
|
+
};
|
|
192
|
+
$[8] = afterBlocks;
|
|
193
|
+
$[9] = beforeBlocks;
|
|
194
|
+
$[10] = blocks;
|
|
195
|
+
} else blocks = $[10];
|
|
196
|
+
t1 = blocks;
|
|
197
|
+
}
|
|
198
|
+
layoutBlocksMap = t1;
|
|
199
|
+
t0 = pageBlocks.map((blockData, index) => /* @__PURE__ */ jsx(BlockErrorBoundary, {
|
|
229
200
|
blockId: blockData.id,
|
|
230
201
|
blockType: blockData.type,
|
|
231
202
|
children: /* @__PURE__ */ jsx(BlockRenderer, {
|
|
232
203
|
blockId: blockData.id,
|
|
233
204
|
mode: "site",
|
|
234
|
-
showAddBlockTop: index === 0 ? layout?._internal.blockDefinitions.some(
|
|
205
|
+
showAddBlockTop: index === 0 ? layout?._internal.blockDefinitions.some(_temp2) ?? false : true,
|
|
235
206
|
showAddBlockBottom: true
|
|
236
207
|
})
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
|
|
208
|
+
}, blockData.id));
|
|
209
|
+
$[0] = afterBlocks;
|
|
210
|
+
$[1] = beforeBlocks;
|
|
211
|
+
$[2] = camoxApp;
|
|
212
|
+
$[3] = pageBlocks;
|
|
213
|
+
$[4] = pageData;
|
|
214
|
+
$[5] = layout;
|
|
215
|
+
$[6] = layoutBlocksMap;
|
|
216
|
+
$[7] = t0;
|
|
217
|
+
} else {
|
|
218
|
+
layout = $[5];
|
|
219
|
+
layoutBlocksMap = $[6];
|
|
220
|
+
t0 = $[7];
|
|
221
|
+
}
|
|
222
|
+
let t1;
|
|
223
|
+
if ($[11] !== t0) {
|
|
224
|
+
t1 = /* @__PURE__ */ jsx(Fragment, { children: t0 });
|
|
225
|
+
$[11] = t0;
|
|
226
|
+
$[12] = t1;
|
|
227
|
+
} else t1 = $[12];
|
|
228
|
+
const pageBlocksContent = t1;
|
|
240
229
|
if (layout && layoutBlocksMap) {
|
|
241
230
|
const LayoutComponent = layout._internal.component;
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
231
|
+
let t2;
|
|
232
|
+
if ($[13] !== afterBlocks || $[14] !== beforeBlocks) {
|
|
233
|
+
t2 = [...beforeBlocks, ...afterBlocks];
|
|
234
|
+
$[13] = afterBlocks;
|
|
235
|
+
$[14] = beforeBlocks;
|
|
236
|
+
$[15] = t2;
|
|
237
|
+
} else t2 = $[15];
|
|
238
|
+
let t3;
|
|
239
|
+
if ($[16] !== LayoutComponent || $[17] !== pageBlocksContent) {
|
|
240
|
+
t3 = /* @__PURE__ */ jsx(LayoutComponent, { children: pageBlocksContent });
|
|
241
|
+
$[16] = LayoutComponent;
|
|
242
|
+
$[17] = pageBlocksContent;
|
|
243
|
+
$[18] = t3;
|
|
244
|
+
} else t3 = $[18];
|
|
245
|
+
let t4;
|
|
246
|
+
if ($[19] !== layout._internal.Provider || $[20] !== layoutBlocksMap || $[21] !== t3) {
|
|
247
|
+
t4 = /* @__PURE__ */ jsx(layout._internal.Provider, {
|
|
246
248
|
layoutBlocks: layoutBlocksMap,
|
|
247
|
-
children:
|
|
248
|
-
})
|
|
249
|
-
|
|
249
|
+
children: t3
|
|
250
|
+
});
|
|
251
|
+
$[19] = layout._internal.Provider;
|
|
252
|
+
$[20] = layoutBlocksMap;
|
|
253
|
+
$[21] = t3;
|
|
254
|
+
$[22] = t4;
|
|
255
|
+
} else t4 = $[22];
|
|
256
|
+
let t5;
|
|
257
|
+
if ($[23] !== layoutFiles || $[24] !== layoutItems || $[25] !== t2 || $[26] !== t4) {
|
|
258
|
+
t5 = /* @__PURE__ */ jsx(NormalizedDataProvider, {
|
|
259
|
+
files: layoutFiles,
|
|
260
|
+
repeatableItems: layoutItems,
|
|
261
|
+
blocks: t2,
|
|
262
|
+
children: t4
|
|
263
|
+
});
|
|
264
|
+
$[23] = layoutFiles;
|
|
265
|
+
$[24] = layoutItems;
|
|
266
|
+
$[25] = t2;
|
|
267
|
+
$[26] = t4;
|
|
268
|
+
$[27] = t5;
|
|
269
|
+
} else t5 = $[27];
|
|
270
|
+
return t5;
|
|
250
271
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
272
|
+
let t2;
|
|
273
|
+
if ($[28] !== pageBlocksContent) {
|
|
274
|
+
t2 = /* @__PURE__ */ jsx("main", {
|
|
275
|
+
className: "flex min-h-screen flex-col",
|
|
276
|
+
children: pageBlocksContent
|
|
277
|
+
});
|
|
278
|
+
$[28] = pageBlocksContent;
|
|
279
|
+
$[29] = t2;
|
|
280
|
+
} else t2 = $[29];
|
|
281
|
+
return t2;
|
|
255
282
|
};
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
283
|
+
/**
|
|
284
|
+
* The read of the page the Preview shows: a curated page's structure, or a layout page's layout. A
|
|
285
|
+
* Canvas-only location, opened first, has no page to show.
|
|
286
|
+
*/
|
|
287
|
+
function pageRead(projectUuid, pathname, derived) {
|
|
288
|
+
if (pathname === void 0) return null;
|
|
289
|
+
if (derived) return reads.layoutStructure({
|
|
290
|
+
projectUuid,
|
|
291
|
+
layoutId: derived.layoutId
|
|
292
|
+
});
|
|
293
|
+
return reads.pageStructure({
|
|
294
|
+
path: pathname,
|
|
295
|
+
projectUuid
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function useRefreshMemberRead(read) {
|
|
299
|
+
const $ = c(13);
|
|
262
300
|
const isAuthenticated = useIsAuthenticated();
|
|
263
|
-
const
|
|
264
|
-
const
|
|
265
|
-
|
|
301
|
+
const studioCache = useStudioCache();
|
|
302
|
+
const draftId = useCurrentDraftId();
|
|
303
|
+
let t0;
|
|
304
|
+
if ($[0] !== draftId || $[1] !== read || $[2] !== studioCache) {
|
|
305
|
+
t0 = read ? JSON.stringify(studioCache.options(read, { in: draftId }).queryKey) : null;
|
|
306
|
+
$[0] = draftId;
|
|
307
|
+
$[1] = read;
|
|
308
|
+
$[2] = studioCache;
|
|
309
|
+
$[3] = t0;
|
|
310
|
+
} else t0 = $[3];
|
|
311
|
+
const identity = t0;
|
|
312
|
+
let t1;
|
|
313
|
+
if ($[4] !== isAuthenticated || $[5] !== read || $[6] !== studioCache) {
|
|
314
|
+
t1 = () => {
|
|
315
|
+
if (!isAuthenticated || !read) return;
|
|
316
|
+
studioCache.reload(read).catch(_temp3);
|
|
317
|
+
};
|
|
318
|
+
$[4] = isAuthenticated;
|
|
319
|
+
$[5] = read;
|
|
320
|
+
$[6] = studioCache;
|
|
321
|
+
$[7] = t1;
|
|
322
|
+
} else t1 = $[7];
|
|
323
|
+
const reload = React.useEffectEvent(t1);
|
|
324
|
+
let t2;
|
|
325
|
+
if ($[8] !== reload) {
|
|
326
|
+
t2 = () => reload();
|
|
327
|
+
$[8] = reload;
|
|
328
|
+
$[9] = t2;
|
|
329
|
+
} else t2 = $[9];
|
|
330
|
+
let t3;
|
|
331
|
+
if ($[10] !== identity || $[11] !== isAuthenticated) {
|
|
332
|
+
t3 = [identity, isAuthenticated];
|
|
333
|
+
$[10] = identity;
|
|
334
|
+
$[11] = isAuthenticated;
|
|
335
|
+
$[12] = t3;
|
|
336
|
+
} else t3 = $[12];
|
|
337
|
+
React.useEffect(t2, t3);
|
|
338
|
+
}
|
|
339
|
+
function _temp3() {}
|
|
340
|
+
/**
|
|
341
|
+
* The page the Preview shows: the current one, or on a Canvas-only location,
|
|
342
|
+
* which has none, the last one. The Canvas keeps showing that page in its slot
|
|
343
|
+
* when nothing is selected, so it stays mounted rather than flash as it remounts.
|
|
344
|
+
*/
|
|
345
|
+
function useShownPage(location, derived, canvasOnly) {
|
|
346
|
+
const $ = c(3);
|
|
347
|
+
const [last, setLast] = React.useState(null);
|
|
348
|
+
if (canvasOnly) return last;
|
|
349
|
+
if (!!last && last.location.href === location.href && last.location.pathname === location.pathname && last.derived === derived) return last;
|
|
350
|
+
let t0;
|
|
351
|
+
if ($[0] !== derived || $[1] !== location) {
|
|
352
|
+
t0 = {
|
|
353
|
+
location,
|
|
354
|
+
derived
|
|
355
|
+
};
|
|
356
|
+
$[0] = derived;
|
|
357
|
+
$[1] = location;
|
|
358
|
+
$[2] = t0;
|
|
359
|
+
} else t0 = $[2];
|
|
360
|
+
const current = t0;
|
|
361
|
+
setLast(current);
|
|
362
|
+
return current;
|
|
363
|
+
}
|
|
364
|
+
/** Remembers where the Website Section is, so that going back to it from the Studio lands there. */
|
|
365
|
+
function useRememberWebsiteLocation(location) {
|
|
366
|
+
const $ = c(5);
|
|
367
|
+
const { locale, locales } = useViewLocale();
|
|
266
368
|
let t0;
|
|
267
369
|
let t1;
|
|
268
|
-
if ($[
|
|
370
|
+
if ($[0] !== locale.tag || $[1] !== locales || $[2] !== location) {
|
|
269
371
|
t0 = () => {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
layout: data.layout,
|
|
282
|
-
projectName: data.projectName,
|
|
283
|
-
project: data.project
|
|
284
|
-
});
|
|
285
|
-
}).catch(_temp2);
|
|
286
|
-
return () => {
|
|
287
|
-
cancelled = true;
|
|
288
|
-
};
|
|
372
|
+
const { pathname, search, hash } = location;
|
|
373
|
+
const url = new URL(withoutDraft(new URL(`${pathname}${search}`, "http://camox.local").href));
|
|
374
|
+
studioStore.send({
|
|
375
|
+
type: "rememberWebsiteLocation",
|
|
376
|
+
location: {
|
|
377
|
+
locale: locale.tag,
|
|
378
|
+
path: parseLocalePath(pathname, locales).path,
|
|
379
|
+
search: url.search,
|
|
380
|
+
hash
|
|
381
|
+
}
|
|
382
|
+
});
|
|
289
383
|
};
|
|
290
384
|
t1 = [
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
queryClient
|
|
385
|
+
location,
|
|
386
|
+
locale.tag,
|
|
387
|
+
locales
|
|
295
388
|
];
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[6] = t1;
|
|
389
|
+
$[0] = locale.tag;
|
|
390
|
+
$[1] = locales;
|
|
391
|
+
$[2] = location;
|
|
392
|
+
$[3] = t0;
|
|
393
|
+
$[4] = t1;
|
|
302
394
|
} else {
|
|
303
|
-
t0 = $[
|
|
304
|
-
t1 = $[
|
|
395
|
+
t0 = $[3];
|
|
396
|
+
t1 = $[4];
|
|
305
397
|
}
|
|
306
398
|
React.useEffect(t0, t1);
|
|
307
399
|
}
|
|
308
|
-
function _temp2() {}
|
|
309
400
|
const CamoxPreview = (t0) => {
|
|
310
|
-
const $ = c(
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
const
|
|
316
|
-
const
|
|
317
|
-
|
|
401
|
+
const $ = c(36);
|
|
402
|
+
const { children, runtimeBasePath, derived, canvasOnly } = t0;
|
|
403
|
+
const camoxApp = useCamoxApp();
|
|
404
|
+
const location = useLocation();
|
|
405
|
+
useRememberWebsiteLocation(location);
|
|
406
|
+
const shown = useShownPage(location, derived, !!canvasOnly);
|
|
407
|
+
const pathname = shown?.location.pathname;
|
|
408
|
+
const shownDerived = shown?.derived;
|
|
409
|
+
const projectUuid = useProjectUuid();
|
|
410
|
+
const { locales } = useViewLocale();
|
|
318
411
|
let t1;
|
|
319
|
-
if ($[1] !==
|
|
320
|
-
t1 =
|
|
412
|
+
if ($[0] !== locales || $[1] !== pathname || $[2] !== projectUuid || $[3] !== shownDerived) {
|
|
413
|
+
t1 = pageRead(projectUuid, pathname === void 0 ? void 0 : parseLocalePath(pathname, locales).path, shownDerived);
|
|
414
|
+
$[0] = locales;
|
|
415
|
+
$[1] = pathname;
|
|
416
|
+
$[2] = projectUuid;
|
|
417
|
+
$[3] = shownDerived;
|
|
418
|
+
$[4] = t1;
|
|
419
|
+
} else t1 = $[4];
|
|
420
|
+
const shownRead = t1;
|
|
421
|
+
const data = useRead(shownRead);
|
|
422
|
+
useRefreshMemberRead(shownRead);
|
|
423
|
+
const t2 = runtimeBasePath ?? "";
|
|
424
|
+
const t3 = pathname ?? location.pathname;
|
|
425
|
+
let t4;
|
|
426
|
+
if ($[5] !== shownDerived) {
|
|
427
|
+
t4 = shownDerived ? { result: shownDerived.result } : void 0;
|
|
428
|
+
$[5] = shownDerived;
|
|
429
|
+
$[6] = t4;
|
|
430
|
+
} else t4 = $[6];
|
|
431
|
+
let t5;
|
|
432
|
+
if ($[7] !== projectUuid || $[8] !== t2 || $[9] !== t3 || $[10] !== t4) {
|
|
433
|
+
t5 = {
|
|
434
|
+
projectUuid,
|
|
435
|
+
runtimeBasePath: t2,
|
|
436
|
+
pathname: t3,
|
|
437
|
+
loaded: t4
|
|
438
|
+
};
|
|
439
|
+
$[7] = projectUuid;
|
|
440
|
+
$[8] = t2;
|
|
441
|
+
$[9] = t3;
|
|
442
|
+
$[10] = t4;
|
|
443
|
+
$[11] = t5;
|
|
444
|
+
} else t5 = $[11];
|
|
445
|
+
const derivedResult = useDerivedPageResult(t5);
|
|
446
|
+
let t6;
|
|
447
|
+
if ($[12] !== derivedResult) {
|
|
448
|
+
t6 = getPageRecord(derivedResult);
|
|
449
|
+
$[12] = derivedResult;
|
|
450
|
+
$[13] = t6;
|
|
451
|
+
} else t6 = $[13];
|
|
452
|
+
const pageRecord = t6;
|
|
453
|
+
const t7 = runtimeBasePath ?? "";
|
|
454
|
+
const t8 = shownDerived?.layoutId;
|
|
455
|
+
let t9;
|
|
456
|
+
if ($[14] !== pageRecord || $[15] !== projectUuid || $[16] !== t7 || $[17] !== t8) {
|
|
457
|
+
t9 = {
|
|
458
|
+
projectUuid,
|
|
459
|
+
runtimeBasePath: t7,
|
|
460
|
+
layoutId: t8,
|
|
461
|
+
record: pageRecord
|
|
462
|
+
};
|
|
463
|
+
$[14] = pageRecord;
|
|
464
|
+
$[15] = projectUuid;
|
|
465
|
+
$[16] = t7;
|
|
466
|
+
$[17] = t8;
|
|
467
|
+
$[18] = t9;
|
|
468
|
+
} else t9 = $[18];
|
|
469
|
+
useFollowPageRecord(t9);
|
|
470
|
+
const pageData = data && "page" in data ? data : void 0;
|
|
471
|
+
const layout = data && !("page" in data) ? data : void 0;
|
|
472
|
+
const t10 = shown?.location;
|
|
473
|
+
let t11;
|
|
474
|
+
if ($[19] !== camoxApp || $[20] !== children || $[21] !== derivedResult || $[22] !== layout || $[23] !== shown || $[24] !== shownDerived) {
|
|
475
|
+
t11 = shownDerived && layout ? /* @__PURE__ */ jsx(DerivedPageContent, {
|
|
476
|
+
camoxApp,
|
|
477
|
+
derived: {
|
|
478
|
+
...shownDerived,
|
|
479
|
+
layout,
|
|
480
|
+
result: derivedResult
|
|
481
|
+
}
|
|
482
|
+
}) : shown ? children : null;
|
|
483
|
+
$[19] = camoxApp;
|
|
484
|
+
$[20] = children;
|
|
485
|
+
$[21] = derivedResult;
|
|
486
|
+
$[22] = layout;
|
|
487
|
+
$[23] = shown;
|
|
488
|
+
$[24] = shownDerived;
|
|
489
|
+
$[25] = t11;
|
|
490
|
+
} else t11 = $[25];
|
|
491
|
+
let t12;
|
|
492
|
+
if ($[26] !== canvasOnly || $[27] !== layout || $[28] !== pageData || $[29] !== runtimeBasePath || $[30] !== t10 || $[31] !== t11) {
|
|
493
|
+
t12 = /* @__PURE__ */ jsx(PreviewShell, {
|
|
321
494
|
pageData,
|
|
322
|
-
|
|
495
|
+
derivedLayout: layout,
|
|
496
|
+
pageLocation: t10,
|
|
497
|
+
canvasOnly,
|
|
498
|
+
runtimeBasePath,
|
|
499
|
+
children: t11
|
|
500
|
+
});
|
|
501
|
+
$[26] = canvasOnly;
|
|
502
|
+
$[27] = layout;
|
|
503
|
+
$[28] = pageData;
|
|
504
|
+
$[29] = runtimeBasePath;
|
|
505
|
+
$[30] = t10;
|
|
506
|
+
$[31] = t11;
|
|
507
|
+
$[32] = t12;
|
|
508
|
+
} else t12 = $[32];
|
|
509
|
+
let t13;
|
|
510
|
+
if ($[33] !== derivedResult || $[34] !== t12) {
|
|
511
|
+
t13 = /* @__PURE__ */ jsx(PageRecordContext, {
|
|
512
|
+
value: derivedResult,
|
|
513
|
+
children: t12
|
|
323
514
|
});
|
|
324
|
-
$[
|
|
325
|
-
$[
|
|
326
|
-
$[
|
|
327
|
-
} else
|
|
328
|
-
return
|
|
515
|
+
$[33] = derivedResult;
|
|
516
|
+
$[34] = t12;
|
|
517
|
+
$[35] = t13;
|
|
518
|
+
} else t13 = $[35];
|
|
519
|
+
return t13;
|
|
329
520
|
};
|
|
521
|
+
/**
|
|
522
|
+
* A Canvas-only location only exists on the Canvas. Opening one
|
|
523
|
+
* shows the Canvas, while hiding the Canvas, or a Studio without the Canvas,
|
|
524
|
+
* goes back to the last page shown, or home without one, so Preview always shows a real Page.
|
|
525
|
+
*/
|
|
526
|
+
function useCanvasOnlyLocation(canvasOnly, isCanvasShown, isMobileStudio, lastPage) {
|
|
527
|
+
const $ = c(10);
|
|
528
|
+
const navigate = useNavigate();
|
|
529
|
+
const wasCanvasShown = React.useRef(isCanvasShown);
|
|
530
|
+
const localized = useLocalizedPath();
|
|
531
|
+
let t0;
|
|
532
|
+
if ($[0] !== lastPage || $[1] !== localized) {
|
|
533
|
+
t0 = lastPage ? `${lastPage.pathname}${lastPage.search}${lastPage.hash}` : localized("/");
|
|
534
|
+
$[0] = lastPage;
|
|
535
|
+
$[1] = localized;
|
|
536
|
+
$[2] = t0;
|
|
537
|
+
} else t0 = $[2];
|
|
538
|
+
const lastPageHref = t0;
|
|
539
|
+
let t1;
|
|
540
|
+
let t2;
|
|
541
|
+
if ($[3] !== canvasOnly || $[4] !== isCanvasShown || $[5] !== isMobileStudio || $[6] !== lastPageHref || $[7] !== navigate) {
|
|
542
|
+
t1 = () => {
|
|
543
|
+
const left = wasCanvasShown.current && !isCanvasShown;
|
|
544
|
+
wasCanvasShown.current = isCanvasShown;
|
|
545
|
+
if (!canvasOnly || isCanvasShown) return;
|
|
546
|
+
if (isMobileStudio || left) {
|
|
547
|
+
navigate({
|
|
548
|
+
to: lastPageHref,
|
|
549
|
+
replace: true
|
|
550
|
+
});
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
previewStore.send({ type: "showCanvas" });
|
|
554
|
+
};
|
|
555
|
+
t2 = [
|
|
556
|
+
canvasOnly,
|
|
557
|
+
isCanvasShown,
|
|
558
|
+
isMobileStudio,
|
|
559
|
+
navigate,
|
|
560
|
+
lastPageHref
|
|
561
|
+
];
|
|
562
|
+
$[3] = canvasOnly;
|
|
563
|
+
$[4] = isCanvasShown;
|
|
564
|
+
$[5] = isMobileStudio;
|
|
565
|
+
$[6] = lastPageHref;
|
|
566
|
+
$[7] = navigate;
|
|
567
|
+
$[8] = t1;
|
|
568
|
+
$[9] = t2;
|
|
569
|
+
} else {
|
|
570
|
+
t1 = $[8];
|
|
571
|
+
t2 = $[9];
|
|
572
|
+
}
|
|
573
|
+
React.useEffect(t1, t2);
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Once the signed-in Studio is idle, loads what showing the Canvas waits for: its code, and
|
|
577
|
+
* the project and page list it lays out. The first show then skips most of its loading.
|
|
578
|
+
*/
|
|
579
|
+
function usePrefetchCanvas(enabled, projectUuid) {
|
|
580
|
+
const $ = c(6);
|
|
581
|
+
const queryClient = useQueryClient();
|
|
582
|
+
const studioCache = useStudioCache();
|
|
583
|
+
let t0;
|
|
584
|
+
let t1;
|
|
585
|
+
if ($[0] !== enabled || $[1] !== projectUuid || $[2] !== queryClient || $[3] !== studioCache) {
|
|
586
|
+
t0 = () => {
|
|
587
|
+
if (!enabled) return;
|
|
588
|
+
const prefetch = async () => {
|
|
589
|
+
prefetchCanvas();
|
|
590
|
+
await queryClient.prefetchQuery(studioCache.options(reads.project({ projectUuid })));
|
|
591
|
+
await queryClient.prefetchQuery(studioCache.options(reads.pageList({ projectUuid })));
|
|
592
|
+
};
|
|
593
|
+
if (typeof window.requestIdleCallback === "function") {
|
|
594
|
+
const id = window.requestIdleCallback(() => void prefetch(), { timeout: 5e3 });
|
|
595
|
+
return () => window.cancelIdleCallback(id);
|
|
596
|
+
}
|
|
597
|
+
const id_0 = window.setTimeout(() => void prefetch(), 2e3);
|
|
598
|
+
return () => window.clearTimeout(id_0);
|
|
599
|
+
};
|
|
600
|
+
t1 = [
|
|
601
|
+
enabled,
|
|
602
|
+
projectUuid,
|
|
603
|
+
queryClient,
|
|
604
|
+
studioCache
|
|
605
|
+
];
|
|
606
|
+
$[0] = enabled;
|
|
607
|
+
$[1] = projectUuid;
|
|
608
|
+
$[2] = queryClient;
|
|
609
|
+
$[3] = studioCache;
|
|
610
|
+
$[4] = t0;
|
|
611
|
+
$[5] = t1;
|
|
612
|
+
} else {
|
|
613
|
+
t0 = $[4];
|
|
614
|
+
t1 = $[5];
|
|
615
|
+
}
|
|
616
|
+
React.useEffect(t0, t1);
|
|
617
|
+
}
|
|
330
618
|
/** Studio chrome is shared; only curated previews require a Camox page record. */
|
|
331
619
|
const PreviewShell = (t0) => {
|
|
332
|
-
const $ = c(
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
$[0] = "2d1a4df08feec350ec60cc84fec5c50c421655f0e335816baf3bbe36ccd11082";
|
|
336
|
-
}
|
|
337
|
-
const { children, pageData, hasLiveVersion: t1, derivedLayoutId, derivedLayout } = t0;
|
|
338
|
-
const hasLiveVersion = t1 === void 0 ? false : t1;
|
|
620
|
+
const $ = c(49);
|
|
621
|
+
const { children, pageData, derivedLayout, pageLocation, canvasOnly, runtimeBasePath: t1 } = t0;
|
|
622
|
+
const runtimeBasePath = t1 === void 0 ? "" : t1;
|
|
339
623
|
const isAuthenticated = useIsAuthenticated();
|
|
624
|
+
const projectUuid = useProjectUuid();
|
|
340
625
|
const isMobileStudio = useIsMobileStudio();
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
const
|
|
346
|
-
const
|
|
626
|
+
const isCanvasShown = useSelector(previewStore, selectIsCanvasShown);
|
|
627
|
+
usePreviewViewportActions();
|
|
628
|
+
const isCanvasEnabled = !isMobileStudio && isCanvasShown;
|
|
629
|
+
usePrefetchCanvas(isAuthenticated && !isMobileStudio, projectUuid);
|
|
630
|
+
const { pathname } = useLocation();
|
|
631
|
+
const pageId = canvasOnly ? void 0 : pageData?.page.id;
|
|
632
|
+
const layoutId = canvasOnly ? void 0 : derivedLayout?.layoutId;
|
|
347
633
|
let t2;
|
|
634
|
+
bb0: {
|
|
635
|
+
if (pageId != null) {
|
|
636
|
+
let t3;
|
|
637
|
+
if ($[0] !== pageId) {
|
|
638
|
+
t3 = {
|
|
639
|
+
kind: "page",
|
|
640
|
+
pageId
|
|
641
|
+
};
|
|
642
|
+
$[0] = pageId;
|
|
643
|
+
$[1] = t3;
|
|
644
|
+
} else t3 = $[1];
|
|
645
|
+
t2 = t3;
|
|
646
|
+
break bb0;
|
|
647
|
+
}
|
|
648
|
+
if (layoutId != null) {
|
|
649
|
+
let t3;
|
|
650
|
+
if ($[2] !== layoutId) {
|
|
651
|
+
t3 = {
|
|
652
|
+
kind: "layout",
|
|
653
|
+
layoutId
|
|
654
|
+
};
|
|
655
|
+
$[2] = layoutId;
|
|
656
|
+
$[3] = t3;
|
|
657
|
+
} else t3 = $[3];
|
|
658
|
+
t2 = t3;
|
|
659
|
+
break bb0;
|
|
660
|
+
}
|
|
661
|
+
t2 = null;
|
|
662
|
+
}
|
|
663
|
+
const editingOwner = t2;
|
|
348
664
|
let t3;
|
|
349
|
-
|
|
350
|
-
|
|
665
|
+
let t4;
|
|
666
|
+
if ($[4] !== isMobileStudio) {
|
|
667
|
+
t3 = () => {
|
|
351
668
|
if (!isMobileStudio) return;
|
|
352
|
-
previewStore.send({ type: "
|
|
353
|
-
previewStore.send({ type: "
|
|
669
|
+
previewStore.send({ type: "hideCanvas" });
|
|
670
|
+
previewStore.send({ type: "closeAddBlockDialog" });
|
|
354
671
|
};
|
|
355
|
-
|
|
356
|
-
$[
|
|
357
|
-
$[
|
|
358
|
-
$[
|
|
672
|
+
t4 = [isMobileStudio];
|
|
673
|
+
$[4] = isMobileStudio;
|
|
674
|
+
$[5] = t3;
|
|
675
|
+
$[6] = t4;
|
|
359
676
|
} else {
|
|
360
|
-
|
|
361
|
-
|
|
677
|
+
t3 = $[5];
|
|
678
|
+
t4 = $[6];
|
|
362
679
|
}
|
|
363
|
-
React.useEffect(
|
|
364
|
-
|
|
680
|
+
React.useEffect(t3, t4);
|
|
681
|
+
useCanvasOnlyLocation(!!canvasOnly && isAuthenticated, isCanvasShown, isMobileStudio, pageLocation);
|
|
365
682
|
let t5;
|
|
366
|
-
|
|
367
|
-
|
|
683
|
+
let t6;
|
|
684
|
+
if ($[7] !== isAuthenticated || $[8] !== isCanvasShown || $[9] !== isMobileStudio) {
|
|
685
|
+
t5 = () => {
|
|
368
686
|
const actions = [
|
|
369
687
|
{
|
|
370
|
-
id: "
|
|
371
|
-
label: "
|
|
688
|
+
id: "hide-canvas",
|
|
689
|
+
label: "Hide canvas",
|
|
372
690
|
aliases: [
|
|
691
|
+
"Preview",
|
|
692
|
+
"Exit edit mode",
|
|
373
693
|
"Hide Camox Studio",
|
|
374
|
-
"Hide studio"
|
|
375
|
-
"Preview only",
|
|
376
|
-
"View mode"
|
|
694
|
+
"Hide studio"
|
|
377
695
|
],
|
|
378
|
-
groupLabel: "
|
|
379
|
-
checkIfAvailable: () => isAuthenticated &&
|
|
380
|
-
execute:
|
|
381
|
-
shortcut:
|
|
696
|
+
groupLabel: "Website",
|
|
697
|
+
checkIfAvailable: () => isAuthenticated && isCanvasShown,
|
|
698
|
+
execute: _temp4,
|
|
699
|
+
shortcut: TOGGLE_CANVAS_SHORTCUT
|
|
382
700
|
},
|
|
383
701
|
{
|
|
384
|
-
id: "
|
|
385
|
-
label: "
|
|
702
|
+
id: "show-canvas",
|
|
703
|
+
label: "Show canvas",
|
|
386
704
|
aliases: [
|
|
705
|
+
"Edit mode",
|
|
387
706
|
"Show Camox Studio",
|
|
388
|
-
"Show studio"
|
|
389
|
-
"Edit mode"
|
|
390
|
-
],
|
|
391
|
-
groupLabel: "Preview",
|
|
392
|
-
checkIfAvailable: () => isAuthenticated && !isEditMode && !isMobileStudio,
|
|
393
|
-
execute: _temp6,
|
|
394
|
-
shortcut: EDIT_MODE_SHORTCUT
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
id: "preview-live-content",
|
|
398
|
-
label: "Preview live content",
|
|
399
|
-
aliases: [
|
|
400
|
-
"Live",
|
|
401
|
-
"View live",
|
|
402
|
-
"Published content"
|
|
403
|
-
],
|
|
404
|
-
groupLabel: "Preview",
|
|
405
|
-
checkIfAvailable: () => isAuthenticated && previewSource === "draft" && hasLiveCheckpoint,
|
|
406
|
-
execute: _temp7,
|
|
407
|
-
shortcut: {
|
|
408
|
-
key: "d",
|
|
409
|
-
withAlt: true
|
|
410
|
-
}
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
id: "preview-draft-content",
|
|
414
|
-
label: "Preview draft content",
|
|
415
|
-
aliases: [
|
|
416
|
-
"Draft",
|
|
417
|
-
"View draft",
|
|
418
|
-
"Unpublished content"
|
|
707
|
+
"Show studio"
|
|
419
708
|
],
|
|
420
|
-
groupLabel: "
|
|
421
|
-
checkIfAvailable: () => isAuthenticated &&
|
|
422
|
-
execute:
|
|
423
|
-
shortcut:
|
|
424
|
-
key: "d",
|
|
425
|
-
withAlt: true
|
|
426
|
-
}
|
|
709
|
+
groupLabel: "Website",
|
|
710
|
+
checkIfAvailable: () => isAuthenticated && !isCanvasShown && !isMobileStudio,
|
|
711
|
+
execute: _temp5,
|
|
712
|
+
shortcut: TOGGLE_CANVAS_SHORTCUT
|
|
427
713
|
},
|
|
428
714
|
{
|
|
429
715
|
id: "clear-selection",
|
|
430
716
|
label: "Clear selection",
|
|
431
717
|
aliases: ["Deselect", "Unselect"],
|
|
432
|
-
groupLabel: "
|
|
433
|
-
checkIfAvailable:
|
|
434
|
-
execute:
|
|
718
|
+
groupLabel: "Website",
|
|
719
|
+
checkIfAvailable: _temp6,
|
|
720
|
+
execute: _temp7,
|
|
435
721
|
shortcut: { key: "Escape" }
|
|
436
722
|
}
|
|
437
723
|
];
|
|
@@ -442,184 +728,215 @@ const PreviewShell = (t0) => {
|
|
|
442
728
|
return () => {
|
|
443
729
|
actionsStore.send({
|
|
444
730
|
type: "unregisterManyActions",
|
|
445
|
-
ids: actions.map(
|
|
731
|
+
ids: actions.map(_temp8)
|
|
446
732
|
});
|
|
447
733
|
};
|
|
448
734
|
};
|
|
449
|
-
|
|
450
|
-
|
|
735
|
+
t6 = [
|
|
736
|
+
isCanvasShown,
|
|
451
737
|
isAuthenticated,
|
|
452
|
-
isMobileStudio
|
|
453
|
-
previewSource,
|
|
454
|
-
hasLiveCheckpoint
|
|
738
|
+
isMobileStudio
|
|
455
739
|
];
|
|
456
|
-
$[
|
|
457
|
-
$[
|
|
458
|
-
$[
|
|
459
|
-
$[7] = isMobileStudio;
|
|
460
|
-
$[8] = previewSource;
|
|
461
|
-
$[9] = t4;
|
|
740
|
+
$[7] = isAuthenticated;
|
|
741
|
+
$[8] = isCanvasShown;
|
|
742
|
+
$[9] = isMobileStudio;
|
|
462
743
|
$[10] = t5;
|
|
744
|
+
$[11] = t6;
|
|
463
745
|
} else {
|
|
464
|
-
t4 = $[9];
|
|
465
746
|
t5 = $[10];
|
|
747
|
+
t6 = $[11];
|
|
466
748
|
}
|
|
467
|
-
React.useEffect(
|
|
749
|
+
React.useEffect(t5, t6);
|
|
468
750
|
if (!isAuthenticated) {
|
|
469
|
-
let
|
|
470
|
-
if ($[
|
|
471
|
-
|
|
472
|
-
$[
|
|
473
|
-
$[
|
|
474
|
-
} else
|
|
475
|
-
return
|
|
751
|
+
let t7;
|
|
752
|
+
if ($[12] !== children) {
|
|
753
|
+
t7 = /* @__PURE__ */ jsx(Fragment, { children });
|
|
754
|
+
$[12] = children;
|
|
755
|
+
$[13] = t7;
|
|
756
|
+
} else t7 = $[13];
|
|
757
|
+
return t7;
|
|
476
758
|
}
|
|
477
|
-
const
|
|
478
|
-
const t7 = !isEditMode && "bg-black";
|
|
759
|
+
const t7 = !isCanvasShown && "bg-black";
|
|
479
760
|
let t8;
|
|
480
|
-
if ($[
|
|
481
|
-
t8 = cn("bg-background flex flex-col overflow-hidden",
|
|
482
|
-
$[13] = t6;
|
|
761
|
+
if ($[14] !== t7) {
|
|
762
|
+
t8 = cn("bg-background relative flex h-full min-h-0 flex-1 flex-col overflow-hidden", t7);
|
|
483
763
|
$[14] = t7;
|
|
484
764
|
$[15] = t8;
|
|
485
765
|
} else t8 = $[15];
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
})]
|
|
495
|
-
});
|
|
496
|
-
$[16] = isAddBlockSidebarOpen;
|
|
497
|
-
$[17] = isMobileStudio;
|
|
498
|
-
$[18] = isToolbarHidden;
|
|
499
|
-
$[19] = pageData;
|
|
500
|
-
$[20] = sharedChrome;
|
|
501
|
-
$[21] = t9;
|
|
502
|
-
} else t9 = $[21];
|
|
503
|
-
let t10;
|
|
504
|
-
if ($[22] !== derivedLayout || $[23] !== derivedLayoutId || $[24] !== isEditMode || $[25] !== isMobileStudio || $[26] !== pageData) {
|
|
505
|
-
t10 = !isMobileStudio && (pageData || derivedLayoutId) && /* @__PURE__ */ jsx("div", {
|
|
506
|
-
className: isEditMode ? "contents" : "hidden",
|
|
507
|
-
children: /* @__PURE__ */ jsx(LeftSidebar, {
|
|
508
|
-
page: pageData?.page,
|
|
509
|
-
derivedLayout
|
|
510
|
-
})
|
|
766
|
+
const t9 = pageLocation?.pathname;
|
|
767
|
+
const t10 = !canvasOnly;
|
|
768
|
+
const t11 = !!derivedLayout;
|
|
769
|
+
let t12;
|
|
770
|
+
if ($[16] !== t10 || $[17] !== t11) {
|
|
771
|
+
t12 = /* @__PURE__ */ jsx(CanvasSidebarSkeleton, {
|
|
772
|
+
page: t10,
|
|
773
|
+
layoutPage: t11
|
|
511
774
|
});
|
|
512
|
-
$[
|
|
513
|
-
$[
|
|
514
|
-
$[
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
const
|
|
520
|
-
const t12 = pageData?.projectName;
|
|
521
|
-
const t13 = pageData?.page.id;
|
|
522
|
-
const t14 = pageData?.page.status;
|
|
523
|
-
let t15;
|
|
524
|
-
if ($[28] !== hasLiveCheckpoint || $[29] !== t13 || $[30] !== t14) {
|
|
525
|
-
t15 = {
|
|
526
|
-
pageId: t13,
|
|
527
|
-
pageStatus: t14,
|
|
528
|
-
hasLiveVersion: hasLiveCheckpoint
|
|
529
|
-
};
|
|
530
|
-
$[28] = hasLiveCheckpoint;
|
|
531
|
-
$[29] = t13;
|
|
532
|
-
$[30] = t14;
|
|
533
|
-
$[31] = t15;
|
|
534
|
-
} else t15 = $[31];
|
|
535
|
-
let t16;
|
|
536
|
-
if ($[32] !== isEditMode || $[33] !== isMobileStudio) {
|
|
537
|
-
t16 = !isMobileStudio && isEditMode && /* @__PURE__ */ jsx(PreviewToolbarSpacer, {});
|
|
538
|
-
$[32] = isEditMode;
|
|
539
|
-
$[33] = isMobileStudio;
|
|
540
|
-
$[34] = t16;
|
|
541
|
-
} else t16 = $[34];
|
|
775
|
+
$[16] = t10;
|
|
776
|
+
$[17] = t11;
|
|
777
|
+
$[18] = t12;
|
|
778
|
+
} else t12 = $[18];
|
|
779
|
+
const t13 = !isCanvasEnabled;
|
|
780
|
+
const t14 = pageData?.page;
|
|
781
|
+
const t15 = derivedLayout?.layoutId;
|
|
782
|
+
const t16 = pageData?.projectName;
|
|
542
783
|
let t17;
|
|
543
|
-
if ($[
|
|
544
|
-
t17 = /* @__PURE__ */
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
784
|
+
if ($[19] !== children || $[20] !== isMobileStudio || $[21] !== pageLocation || $[22] !== t13 || $[23] !== t14 || $[24] !== t15 || $[25] !== t16) {
|
|
785
|
+
t17 = /* @__PURE__ */ jsx("div", {
|
|
786
|
+
className: "flex min-h-0 flex-1 flex-row items-stretch",
|
|
787
|
+
children: /* @__PURE__ */ jsx(PreviewPanel, {
|
|
788
|
+
active: t13,
|
|
789
|
+
isMobileExperience: isMobileStudio,
|
|
790
|
+
page: t14,
|
|
791
|
+
layoutId: t15,
|
|
792
|
+
pageLocation,
|
|
793
|
+
projectName: t16,
|
|
794
|
+
children
|
|
795
|
+
})
|
|
550
796
|
});
|
|
551
|
-
$[
|
|
552
|
-
$[
|
|
553
|
-
$[
|
|
554
|
-
$[
|
|
555
|
-
$[
|
|
556
|
-
$[
|
|
557
|
-
$[
|
|
558
|
-
|
|
797
|
+
$[19] = children;
|
|
798
|
+
$[20] = isMobileStudio;
|
|
799
|
+
$[21] = pageLocation;
|
|
800
|
+
$[22] = t13;
|
|
801
|
+
$[23] = t14;
|
|
802
|
+
$[24] = t15;
|
|
803
|
+
$[25] = t16;
|
|
804
|
+
$[26] = t17;
|
|
805
|
+
} else t17 = $[26];
|
|
559
806
|
let t18;
|
|
560
|
-
if ($[
|
|
561
|
-
t18 =
|
|
562
|
-
|
|
563
|
-
|
|
807
|
+
if ($[27] !== isCanvasEnabled || $[28] !== pathname || $[29] !== runtimeBasePath || $[30] !== t12 || $[31] !== t17 || $[32] !== t9) {
|
|
808
|
+
t18 = /* @__PURE__ */ jsx(CanvasPreview, {
|
|
809
|
+
enabled: isCanvasEnabled,
|
|
810
|
+
pathname,
|
|
811
|
+
pagePathname: t9,
|
|
812
|
+
runtimeBasePath,
|
|
813
|
+
placeholder: t12,
|
|
814
|
+
children: t17
|
|
564
815
|
});
|
|
565
|
-
$[
|
|
566
|
-
$[
|
|
567
|
-
$[
|
|
568
|
-
$[
|
|
569
|
-
$[
|
|
570
|
-
|
|
816
|
+
$[27] = isCanvasEnabled;
|
|
817
|
+
$[28] = pathname;
|
|
818
|
+
$[29] = runtimeBasePath;
|
|
819
|
+
$[30] = t12;
|
|
820
|
+
$[31] = t17;
|
|
821
|
+
$[32] = t9;
|
|
822
|
+
$[33] = t18;
|
|
823
|
+
} else t18 = $[33];
|
|
571
824
|
let t19;
|
|
572
|
-
if ($[
|
|
573
|
-
t19 = /* @__PURE__ */ jsxs(
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
t18
|
|
579
|
-
]
|
|
580
|
-
});
|
|
581
|
-
$[47] = t10;
|
|
582
|
-
$[48] = t17;
|
|
583
|
-
$[49] = t18;
|
|
584
|
-
$[50] = t19;
|
|
585
|
-
} else t19 = $[50];
|
|
825
|
+
if ($[34] !== isCanvasEnabled || $[35] !== pageId) {
|
|
826
|
+
t19 = !isCanvasEnabled && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CreatePageModal, {}), pageId != null && /* @__PURE__ */ jsx(AddBlockDialog, {})] });
|
|
827
|
+
$[34] = isCanvasEnabled;
|
|
828
|
+
$[35] = pageId;
|
|
829
|
+
$[36] = t19;
|
|
830
|
+
} else t19 = $[36];
|
|
586
831
|
let t20;
|
|
587
|
-
if ($[
|
|
588
|
-
t20 =
|
|
589
|
-
$[51] = isEditMode;
|
|
590
|
-
$[52] = isMobileStudio;
|
|
591
|
-
$[53] = t20;
|
|
592
|
-
} else t20 = $[53];
|
|
593
|
-
let t21;
|
|
594
|
-
if ($[54] !== t19 || $[55] !== t20 || $[56] !== t8 || $[57] !== t9) {
|
|
595
|
-
t21 = /* @__PURE__ */ jsxs("div", {
|
|
832
|
+
if ($[37] !== t18 || $[38] !== t19 || $[39] !== t8) {
|
|
833
|
+
t20 = /* @__PURE__ */ jsxs("div", {
|
|
596
834
|
className: t8,
|
|
597
|
-
children: [
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
835
|
+
children: [t18, t19]
|
|
836
|
+
});
|
|
837
|
+
$[37] = t18;
|
|
838
|
+
$[38] = t19;
|
|
839
|
+
$[39] = t8;
|
|
840
|
+
$[40] = t20;
|
|
841
|
+
} else t20 = $[40];
|
|
842
|
+
let t21;
|
|
843
|
+
if ($[41] !== editingOwner || $[42] !== t20) {
|
|
844
|
+
t21 = /* @__PURE__ */ jsx(PreviewEditingOwnerContext, {
|
|
845
|
+
value: editingOwner,
|
|
846
|
+
children: t20
|
|
602
847
|
});
|
|
603
|
-
$[
|
|
604
|
-
$[
|
|
605
|
-
$[
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
848
|
+
$[41] = editingOwner;
|
|
849
|
+
$[42] = t20;
|
|
850
|
+
$[43] = t21;
|
|
851
|
+
} else t21 = $[43];
|
|
852
|
+
let t22;
|
|
853
|
+
if ($[44] !== projectUuid) {
|
|
854
|
+
t22 = /* @__PURE__ */ jsx(ContentCollectionItemSheet, { projectUuid });
|
|
855
|
+
$[44] = projectUuid;
|
|
856
|
+
$[45] = t22;
|
|
857
|
+
} else t22 = $[45];
|
|
858
|
+
let t23;
|
|
859
|
+
if ($[46] !== t21 || $[47] !== t22) {
|
|
860
|
+
t23 = /* @__PURE__ */ jsxs(CollectionItemSheetProvider, {
|
|
861
|
+
onRouteTargetClose: _temp9,
|
|
862
|
+
children: [t21, t22]
|
|
863
|
+
});
|
|
864
|
+
$[46] = t21;
|
|
865
|
+
$[47] = t22;
|
|
866
|
+
$[48] = t23;
|
|
867
|
+
} else t23 = $[48];
|
|
868
|
+
return t23;
|
|
610
869
|
};
|
|
611
|
-
|
|
870
|
+
/** Zooms out to the whole Canvas, from anywhere in the site or the Studio. */
|
|
871
|
+
function useShowCanvasAction() {
|
|
612
872
|
const $ = c(6);
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
873
|
+
const navigate = useNavigate();
|
|
874
|
+
const pathname = useLocalePath();
|
|
875
|
+
const localized = useLocalizedPath();
|
|
876
|
+
const isMobileStudio = useIsMobileStudio();
|
|
877
|
+
let t0;
|
|
878
|
+
let t1;
|
|
879
|
+
if ($[0] !== isMobileStudio || $[1] !== localized || $[2] !== navigate || $[3] !== pathname) {
|
|
880
|
+
t0 = () => {
|
|
881
|
+
const actions = [{
|
|
882
|
+
id: "show-whole-canvas",
|
|
883
|
+
label: "Show whole canvas",
|
|
884
|
+
aliases: [
|
|
885
|
+
"Canvas",
|
|
886
|
+
"Zoom out",
|
|
887
|
+
"Canvas overview",
|
|
888
|
+
"Back to the canvas"
|
|
889
|
+
],
|
|
890
|
+
groupLabel: "Navigation",
|
|
891
|
+
checkIfAvailable: () => !isMobileStudio,
|
|
892
|
+
execute: () => {
|
|
893
|
+
previewStore.send({ type: "showCanvas" });
|
|
894
|
+
if (pathname !== "/camox/canvas") navigate({ to: localized(STUDIO_CANVAS_PATH) });
|
|
895
|
+
canvasStore.send({ type: "requestOverview" });
|
|
896
|
+
},
|
|
897
|
+
shortcut: SHOW_WHOLE_CANVAS_SHORTCUT
|
|
898
|
+
}];
|
|
899
|
+
actionsStore.send({
|
|
900
|
+
type: "registerManyActions",
|
|
901
|
+
actions
|
|
902
|
+
});
|
|
903
|
+
return () => {
|
|
904
|
+
actionsStore.send({
|
|
905
|
+
type: "unregisterManyActions",
|
|
906
|
+
ids: actions.map(_temp10)
|
|
907
|
+
});
|
|
908
|
+
};
|
|
909
|
+
};
|
|
910
|
+
t1 = [
|
|
911
|
+
localized,
|
|
912
|
+
navigate,
|
|
913
|
+
pathname,
|
|
914
|
+
isMobileStudio
|
|
915
|
+
];
|
|
916
|
+
$[0] = isMobileStudio;
|
|
917
|
+
$[1] = localized;
|
|
918
|
+
$[2] = navigate;
|
|
919
|
+
$[3] = pathname;
|
|
920
|
+
$[4] = t0;
|
|
921
|
+
$[5] = t1;
|
|
922
|
+
} else {
|
|
923
|
+
t0 = $[4];
|
|
924
|
+
t1 = $[5];
|
|
616
925
|
}
|
|
926
|
+
React.useEffect(t0, t1);
|
|
927
|
+
}
|
|
928
|
+
function _temp10(a) {
|
|
929
|
+
return a.id;
|
|
930
|
+
}
|
|
931
|
+
function usePreviewPagesActions() {
|
|
932
|
+
const $ = c(6);
|
|
617
933
|
const navigate = useNavigate();
|
|
618
|
-
const
|
|
934
|
+
const pathname = useLocalePath();
|
|
935
|
+
const localized = useLocalizedPath();
|
|
619
936
|
const pages = usePageDestinations();
|
|
620
937
|
let t0;
|
|
621
938
|
let t1;
|
|
622
|
-
if ($[1] !== navigate || $[2] !== pages || $[3] !== pathname) {
|
|
939
|
+
if ($[0] !== localized || $[1] !== navigate || $[2] !== pages || $[3] !== pathname) {
|
|
623
940
|
t0 = () => {
|
|
624
941
|
const currentPage = pages.find((p) => p.kind === "curated" && p.fullPath === pathname);
|
|
625
942
|
const actions = [
|
|
@@ -627,7 +944,7 @@ function usePreviewPagesActions() {
|
|
|
627
944
|
id: "create-page",
|
|
628
945
|
label: "Create page",
|
|
629
946
|
aliases: ["New page", "Add page"],
|
|
630
|
-
groupLabel: "
|
|
947
|
+
groupLabel: "Website",
|
|
631
948
|
checkIfAvailable: _temp11,
|
|
632
949
|
execute: _temp12
|
|
633
950
|
},
|
|
@@ -639,7 +956,7 @@ function usePreviewPagesActions() {
|
|
|
639
956
|
"Edit page settings",
|
|
640
957
|
"Page metadata"
|
|
641
958
|
],
|
|
642
|
-
groupLabel: "
|
|
959
|
+
groupLabel: "Website",
|
|
643
960
|
checkIfAvailable: () => currentPage?.kind === "curated",
|
|
644
961
|
execute: () => {
|
|
645
962
|
if (currentPage?.kind !== "curated") return;
|
|
@@ -657,7 +974,7 @@ function usePreviewPagesActions() {
|
|
|
657
974
|
"Navigate page",
|
|
658
975
|
"Switch page"
|
|
659
976
|
],
|
|
660
|
-
groupLabel: "
|
|
977
|
+
groupLabel: "Website",
|
|
661
978
|
checkIfAvailable: () => pages.length > 0,
|
|
662
979
|
hasChildren: true,
|
|
663
980
|
execute: _temp13
|
|
@@ -667,9 +984,9 @@ function usePreviewPagesActions() {
|
|
|
667
984
|
parentActionId: "go-to-page",
|
|
668
985
|
label: `Go to "${page.title}"`,
|
|
669
986
|
aliases: [page.fullPath],
|
|
670
|
-
groupLabel: "
|
|
987
|
+
groupLabel: "Website",
|
|
671
988
|
checkIfAvailable: _temp14,
|
|
672
|
-
execute: () => navigate({ to: page.fullPath })
|
|
989
|
+
execute: () => navigate({ to: localized(page.fullPath) })
|
|
673
990
|
}))
|
|
674
991
|
];
|
|
675
992
|
actionsStore.send({
|
|
@@ -684,10 +1001,12 @@ function usePreviewPagesActions() {
|
|
|
684
1001
|
};
|
|
685
1002
|
};
|
|
686
1003
|
t1 = [
|
|
1004
|
+
localized,
|
|
687
1005
|
navigate,
|
|
688
1006
|
pages,
|
|
689
1007
|
pathname
|
|
690
1008
|
];
|
|
1009
|
+
$[0] = localized;
|
|
691
1010
|
$[1] = navigate;
|
|
692
1011
|
$[2] = pages;
|
|
693
1012
|
$[3] = pathname;
|
|
@@ -712,40 +1031,25 @@ function _temp12() {
|
|
|
712
1031
|
function _temp11() {
|
|
713
1032
|
return true;
|
|
714
1033
|
}
|
|
715
|
-
function
|
|
716
|
-
return
|
|
1034
|
+
function _temp2(b) {
|
|
1035
|
+
return b.slot === "before";
|
|
717
1036
|
}
|
|
718
|
-
function _temp4(
|
|
719
|
-
return
|
|
1037
|
+
function _temp4() {
|
|
1038
|
+
return previewStore.send({ type: "hideCanvas" });
|
|
720
1039
|
}
|
|
721
1040
|
function _temp5() {
|
|
722
|
-
return previewStore.send({ type: "
|
|
1041
|
+
return previewStore.send({ type: "showCanvas" });
|
|
723
1042
|
}
|
|
724
1043
|
function _temp6() {
|
|
725
|
-
return previewStore.send({ type: "enterEditMode" });
|
|
726
|
-
}
|
|
727
|
-
function _temp7() {
|
|
728
|
-
return previewStore.send({ type: "viewLivePage" });
|
|
729
|
-
}
|
|
730
|
-
function _temp8() {
|
|
731
|
-
return previewStore.send({ type: "viewDraftPage" });
|
|
732
|
-
}
|
|
733
|
-
function _temp9() {
|
|
734
1044
|
return true;
|
|
735
1045
|
}
|
|
736
|
-
function
|
|
737
|
-
previewStore.send({
|
|
738
|
-
type: "setCommentMode",
|
|
739
|
-
enabled: false
|
|
740
|
-
});
|
|
741
|
-
previewStore.send({ type: "clearSelection" });
|
|
1046
|
+
function _temp7() {
|
|
1047
|
+
return previewStore.send({ type: "clearSelection" });
|
|
742
1048
|
}
|
|
743
|
-
function
|
|
1049
|
+
function _temp8(a) {
|
|
744
1050
|
return a.id;
|
|
745
1051
|
}
|
|
746
|
-
function
|
|
747
|
-
return previewStore.send({ type: "closeAddBlockSidebar" });
|
|
748
|
-
}
|
|
1052
|
+
function _temp9() {}
|
|
749
1053
|
|
|
750
1054
|
//#endregion
|
|
751
|
-
export { CamoxPreview, PageContent, PreviewShell, usePreviewPagesActions, usePreviewedPage };
|
|
1055
|
+
export { CamoxPreview, PageContent, PreviewShell, usePreviewPagesActions, usePreviewedPage, useShowCanvasAction };
|