camox 0.44.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/dist/components/AuthGate.js +0 -6
- package/dist/components/DeviceSelector.js +96 -0
- package/dist/components/PlatformLabel.js +20 -24
- package/dist/core/components/lexical/HighlightNode.js +1 -1
- package/dist/core/components/lexical/InlineContentEditable.js +15 -19
- package/dist/core/components/lexical/InlineLexicalEditor.js +54 -74
- package/dist/core/components/lexical/InlineStylesPlugin.js +53 -53
- package/dist/core/components/lexical/MaxLengthPlugin.js +59 -0
- package/dist/core/components/lexical/SelectionBroadcaster.js +53 -54
- package/dist/core/components/lexical/SidebarLexicalEditor.js +322 -229
- package/dist/core/components/lexical/SummaryToggleGuard.js +42 -0
- package/dist/core/components/lexical/TextLinkPopover.js +169 -180
- package/dist/core/createApp.d.ts +241 -312
- package/dist/core/createApp.js +123 -29
- package/dist/core/createBlock.d.ts +5 -5
- package/dist/core/createBlock.js +385 -152
- package/dist/core/createCollection.d.ts +55 -0
- package/dist/core/createCollection.js +93 -0
- package/dist/core/createLayout.d.ts +197 -61
- package/dist/core/createLayout.js +114 -56
- package/dist/core/defineDocument.d.ts +3 -5
- package/dist/core/derivedRoutes.js +49 -1
- package/dist/core/dom.d.ts +13 -4
- package/dist/core/dom.js +44 -1
- package/dist/core/editing/BlockEditingRuntime.d.ts +16 -0
- package/dist/core/editing/BlockEditingRuntime.js +6 -15
- package/dist/core/editing/CompleteBlockEditingRuntime.js +28 -23
- package/dist/core/editing/createEditableBlock.d.ts +754 -633
- package/dist/core/editing/createEditableBlock.js +2113 -1066
- package/dist/core/editing/referenceWrites.js +51 -0
- package/dist/core/editing/useLatestRecord.js +90 -0
- package/dist/core/hooks/useArtifactHost.js +139 -0
- package/dist/core/hooks/useFieldSelection.js +43 -18
- package/dist/core/hooks/useIsEditable.js +12 -10
- package/dist/core/hooks/useOverlayMessage.js +15 -19
- package/dist/core/lib/artifact.d.ts +21 -0
- package/dist/core/lib/artifact.js +154 -0
- package/dist/core/lib/artifactColors.js +123 -0
- package/dist/core/lib/artifactData.d.ts +1 -0
- package/dist/core/lib/artifactData.js +131 -0
- package/dist/core/lib/artifactHost.js +205 -0
- package/dist/core/lib/artifactRuntime.js +36 -0
- package/dist/core/lib/artifactTheme.js +57 -0
- package/dist/core/lib/contentType.d.ts +302 -106
- package/dist/core/lib/contentType.js +201 -173
- package/dist/core/lib/fieldTypes.js +3 -0
- package/dist/core/lib/iconTypes.d.ts +3 -3
- package/dist/core/lib/icons.d.ts +4 -4
- package/dist/core/lib/icons.js +40 -44
- package/dist/core/lib/imagePlaceholder.js +177 -0
- package/dist/core/lib/imageTransform.js +1 -1
- package/dist/core/lib/lexicalReact.d.ts +3 -1
- package/dist/core/lib/lexicalState.js +1 -1
- package/dist/core/lib/previewPaused.js +9 -0
- package/dist/core/lib/recordScope.js +316 -0
- package/dist/core/lib/reference.d.ts +81 -0
- package/dist/core/lib/reference.js +29 -0
- package/dist/core/lib/textLinks.js +7 -5
- package/dist/core/lib/textStyles.d.ts +5 -7
- package/dist/core/lib/textStyles.js +2 -2
- package/dist/core/notFound.d.ts +7 -0
- package/dist/core/notFound.js +11 -0
- package/dist/core/pageDestinations.js +6 -3
- package/dist/core/recordItem.js +34 -0
- package/dist/core/requestContext.d.ts +26 -0
- package/dist/core/requestContext.js +20 -0
- package/dist/features/canvas/CamoxCanvas.js +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 +80 -84
- package/dist/features/content/components/AssetCardSkeleton.js +4 -8
- package/dist/features/content/components/ContentSidebar.js +129 -18
- package/dist/features/content/components/ContentSidebarGroup.js +37 -0
- package/dist/features/content/components/DeleteCollectionItemButton.js +202 -0
- package/dist/features/content/components/MissingFromLocale.js +282 -0
- package/dist/features/content/components/UploadDropZone.js +27 -31
- package/dist/features/content/components/UploadProgressDrawer.js +90 -98
- package/dist/features/navigation/navigation.d.ts +66 -20
- package/dist/features/navigation/navigation.js +257 -90
- package/dist/features/og/defaultFonts.js +8 -8
- package/dist/features/og/geist-variable-ttf-base64.js +1 -1
- package/dist/features/og/imageResponse.d.ts +8 -0
- package/dist/features/og/imageResponse.js +26 -0
- package/dist/features/page/CuratedPageContent.js +167 -0
- package/dist/features/page/DerivedPageContent.js +26 -30
- package/dist/features/page/SharedLayoutContent.js +25 -27
- package/dist/features/preview/CamoxPreview.d.ts +23 -61
- package/dist/features/preview/CamoxPreview.js +816 -537
- package/dist/features/preview/EditablePageContent.js +1 -1
- package/dist/features/preview/EditablePageExperience.js +16 -22
- package/dist/features/preview/components/AddBlockDialog.js +270 -0
- package/dist/features/preview/components/AssetFieldEditor.js +173 -154
- package/dist/features/preview/components/AssetLightbox.js +181 -134
- package/dist/features/preview/components/AssetPickerModal.js +153 -170
- package/dist/features/preview/components/BlockActionsPopover.js +150 -149
- package/dist/features/preview/components/BlockErrorBoundary.js +8 -12
- package/dist/features/preview/components/BlockThumbnail.js +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 +21 -19
- package/dist/features/preview/components/DrillRow.js +150 -0
- package/dist/features/preview/components/FieldOverlayStyles.js +11 -8
- package/dist/features/preview/components/FieldToolbar.js +160 -110
- package/dist/features/preview/components/Frame.js +108 -20
- package/dist/features/preview/components/IconFieldEditor.js +62 -66
- package/dist/features/preview/components/ItemFieldsEditor.js +231 -205
- package/dist/features/preview/components/LinkFieldEditor.js +135 -139
- package/dist/features/preview/components/Metadata.js +22 -30
- package/dist/features/preview/components/MobilePreviewDrawer.js +89 -108
- package/dist/features/preview/components/MultipleAssetFieldEditor.js +334 -246
- package/dist/features/preview/components/OverlayTracker.js +9 -41
- package/dist/features/preview/components/Overlays.js +81 -69
- package/dist/features/preview/components/PageInfo.js +1748 -0
- package/dist/features/preview/components/PageInfoSkeleton.js +51 -0
- package/dist/features/preview/components/PageLocationFieldset.js +112 -116
- package/dist/features/preview/components/PageNavigatorHeader.js +24 -0
- package/dist/features/preview/components/PageNicknameField.js +22 -26
- package/dist/features/preview/components/PagePicker.js +128 -130
- package/dist/features/preview/components/PageTree.js +525 -532
- package/dist/features/preview/components/PreviewActivation.js +28 -32
- package/dist/features/preview/components/PreviewPanel.js +620 -319
- package/dist/features/preview/components/PreviewToolbar.js +105 -333
- package/dist/features/preview/components/RecordCard.js +80 -0
- package/dist/features/preview/components/RecordCombobox.js +178 -0
- package/dist/features/preview/components/ReferenceFieldEditor.js +149 -0
- package/dist/features/preview/components/ReferenceListFieldEditor.js +432 -0
- package/dist/features/preview/components/RemovedBlockPlaceholder.js +95 -0
- package/dist/features/preview/components/RepeatableItemsList.js +125 -138
- package/dist/features/preview/components/SelectionEditor.js +993 -0
- package/dist/features/preview/components/ShikiMarkdown.js +14 -18
- package/dist/features/preview/components/SidebarSection.js +52 -64
- package/dist/features/preview/components/StudioEditingFallback.js +56 -0
- package/dist/features/preview/components/UnlinkAssetButton.js +104 -107
- package/dist/features/preview/components/blockGridNavigation.js +15 -0
- package/dist/features/preview/components/contentFieldSchema.js +8 -0
- package/dist/features/preview/components/useFieldWriter.js +200 -0
- package/dist/features/preview/components/useRecordView.js +383 -0
- package/dist/features/preview/components/useRepeatableItemActions.js +35 -37
- package/dist/features/preview/components/useUpdateBlockPosition.js +37 -37
- package/dist/features/preview/editingFrame.js +197 -0
- package/dist/features/preview/overlayHighlights.js +17 -44
- package/dist/features/preview/overlayMessages.js +72 -1
- package/dist/features/preview/pageRecord.js +189 -0
- package/dist/features/preview/previewConstants.js +6 -2
- package/dist/features/preview/previewPageFrame.js +95 -0
- package/dist/features/preview/previewPreparation.js +7 -0
- package/dist/features/preview/previewSelection.js +32 -63
- package/dist/features/preview/previewStore.js +225 -123
- package/dist/features/preview/referencePickerFocus.js +29 -0
- package/dist/features/preview/repeatableItemTargets.js +56 -0
- package/dist/features/preview/selectionReveal.js +21 -0
- package/dist/features/preview/usePreviewViewportActions.js +114 -0
- package/dist/features/preview/viewportContinuity.js +109 -0
- package/dist/features/provider/AuthenticatedCamoxProvider.js +69 -44
- package/dist/features/provider/CamoxProvider.d.ts +3 -6
- package/dist/features/provider/CamoxProvider.js +38 -50
- package/dist/features/provider/CoreCamoxProvider.js +66 -50
- package/dist/features/provider/LocalhostPreviewProvider.js +78 -114
- package/dist/features/provider/PreviewSignInPage.js +54 -0
- package/dist/features/provider/components/CamoxAppContext.js +11 -11
- package/dist/features/provider/components/CommandPalette.js +75 -82
- package/dist/features/provider/useAdminShortcuts.js +7 -11
- package/dist/features/routes/pageRuntime.d.ts +44 -4
- package/dist/features/routes/pageRuntime.js +244 -137
- package/dist/features/runtime/RuntimeChrome.js +117 -115
- package/dist/features/runtime/alternates.js +64 -0
- package/dist/features/runtime/analytics.d.ts +7 -0
- package/dist/features/runtime/analytics.js +66 -0
- package/dist/features/runtime/artifactSources.js +87 -0
- package/dist/features/runtime/editingFallback.js +20 -0
- package/dist/features/runtime/linkPrefetch.js +97 -0
- package/dist/features/runtime/livePages.js +62 -0
- package/dist/features/runtime/llmsTxt.js +40 -0
- package/dist/features/runtime/loopbackFetch.js +18 -0
- package/dist/features/runtime/navigationAccessibility.js +51 -0
- package/dist/features/runtime/navigationTarget.js +23 -2
- package/dist/features/runtime/pageApp.js +229 -158
- package/dist/features/runtime/pageBlockTypes.js +20 -0
- package/dist/features/runtime/pageClient.d.ts +2 -4
- package/dist/features/runtime/pageClient.js +18 -3
- package/dist/features/runtime/pageNavigation.js +254 -32
- package/dist/features/runtime/pageServer.d.ts +2 -4
- package/dist/features/runtime/pageServer.js +6 -2
- package/dist/features/runtime/pageViewport.js +7 -0
- package/dist/features/runtime/runtime.d.ts +59 -24
- package/dist/features/runtime/runtime.js +779 -191
- package/dist/features/runtime/runtimeChromeLoader.js +58 -0
- package/dist/features/runtime/runtimeRoutes.d.ts +19 -0
- package/dist/features/runtime/runtimeRoutes.js +25 -0
- package/dist/features/runtime/scrollRestoration.js +133 -0
- package/dist/features/runtime/studioApp.d.ts +4 -3
- package/dist/features/runtime/studioApp.js +5 -9
- package/dist/features/runtime/studioClient.d.ts +2 -4
- package/dist/features/runtime/studioClient.js +12 -3
- package/dist/features/runtime/studioServer.d.ts +2 -4
- package/dist/features/runtime/studioServer.js +6 -1
- package/dist/features/runtime/worker.d.ts +6 -0
- package/dist/features/runtime/worker.js +23 -0
- package/dist/features/runtime/workerRequest.js +44 -0
- package/dist/features/studio/CamoxStudio.d.ts +2 -6
- package/dist/features/studio/CamoxStudio.js +34 -49
- package/dist/features/studio/FollowAgentProvider.js +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/blockBoilerplate.js +6 -5
- package/dist/features/vite/blockChunks.js +31 -0
- package/dist/features/vite/bundlerLogs.js +17 -0
- package/dist/features/vite/definitionsSync.js +158 -226
- package/dist/features/vite/devAuthentication.js +4 -16
- package/dist/features/vite/devSignIn.js +87 -0
- package/dist/features/vite/iconGeneration.js +1 -1
- package/dist/features/vite/layoutGeneration.js +11 -1
- package/dist/features/vite/publishSeededContent.js +30 -0
- package/dist/features/vite/routeGeneration.js +6 -7
- package/dist/features/vite/runtimeDev.js +80 -99
- package/dist/features/vite/vite.d.ts +51 -31
- package/dist/features/vite/vite.js +224 -127
- package/dist/features/vite/workerBuild.js +39 -0
- package/dist/hooks/use-debounced-field.js +116 -47
- package/dist/hooks/use-file-upload.js +114 -67
- package/dist/hooks/use-marquee-selection.js +32 -36
- package/dist/hooks/use-page-destinations.js +69 -37
- package/dist/lib/api-client-server.d.ts +5 -0
- package/dist/lib/api-client-server.js +10 -4
- package/dist/lib/api-client.d.ts +6 -0
- package/dist/lib/api-client.js +51 -16
- package/dist/lib/api-socket.js +17 -0
- package/dist/lib/auth-page-styles.js +39 -0
- package/dist/lib/auth.js +117 -61
- package/dist/lib/collection-cache.js +23 -0
- package/dist/lib/draft-scope.d.ts +4 -0
- package/dist/lib/draft-scope.js +222 -0
- package/dist/lib/html.js +12 -0
- package/dist/lib/link-pages.js +154 -0
- package/dist/lib/locale-path.d.ts +22 -0
- package/dist/lib/locale-path.js +57 -0
- package/dist/lib/normalized-data.js +252 -152
- package/dist/lib/preview-handoff.js +2 -2
- package/dist/lib/queries.d.ts +11 -0
- package/dist/lib/queries.js +70 -141
- package/dist/lib/studio-reads.d.ts +14 -0
- package/dist/lib/studio-reads.js +574 -0
- package/dist/lib/use-project-room.js +50 -50
- package/dist/lib/use-thread.js +310 -0
- package/dist/lib/utils.js +25 -29
- package/dist/lib/view-locale-context.js +22 -0
- package/dist/lib/view-locale.js +46 -0
- package/dist/package.js +5 -0
- package/dist/studio-overlays.css +41 -151
- package/dist/studio.css +2 -2
- package/package.json +70 -73
- package/skills/camox/SKILL.md +16 -11
- package/skills/camox/references/artifacts.md +179 -0
- package/skills/camox/references/block-definitions.md +75 -59
- package/skills/camox/references/cli-common.md +9 -11
- package/skills/camox/references/cli-content.md +92 -69
- package/skills/camox/references/cli-publishing.md +26 -0
- package/skills/camox/references/dom-integrations.md +27 -0
- package/skills/camox/references/field-styling.md +4 -4
- package/skills/camox/references/layout-definitions.md +16 -14
- package/skills/camox/references/localization.md +56 -0
- package/skills/camox/references/routed-layouts.md +133 -15
- package/skills/camox-expand/SKILL.md +69 -0
- package/skills/camox-expand/references/jobs.md +39 -0
- package/skills/camoxify/SKILL.md +29 -7
- package/dist/core/components/AddBlockControlBar.js +0 -78
- package/dist/core/hooks/useRequireDraftSource.js +0 -23
- package/dist/features/metadata/sitemap.d.ts +0 -8
- package/dist/features/metadata/sitemap.js +0 -17
- package/dist/features/og/imageResponse.node.d.ts +0 -12
- package/dist/features/og/imageResponse.node.js +0 -49
- package/dist/features/og/imageResponse.workerd.d.ts +0 -12
- package/dist/features/og/imageResponse.workerd.js +0 -40
- package/dist/features/page/PublishedPageContent.js +0 -205
- package/dist/features/page/PublishedPageExperience.js +0 -23
- package/dist/features/preview/DerivedPreview.js +0 -134
- package/dist/features/preview/commentsEnabled.js +0 -8
- package/dist/features/preview/components/AddBlockSidebar.js +0 -381
- package/dist/features/preview/components/AttachedComments.js +0 -331
- package/dist/features/preview/components/CommentHeader.js +0 -122
- package/dist/features/preview/components/CommentSidebar.js +0 -29
- package/dist/features/preview/components/CommentTargetQuote.js +0 -167
- package/dist/features/preview/components/DerivedLayoutSidebar.d.ts +0 -5
- package/dist/features/preview/components/DerivedLayoutSidebar.js +0 -179
- package/dist/features/preview/components/DerivedPageInfoSidebar.js +0 -69
- package/dist/features/preview/components/LeftSidebar.js +0 -68
- package/dist/features/preview/components/PageEditorSidebar.js +0 -563
- package/dist/features/preview/components/PageInfoSidebar.js +0 -1551
- package/dist/features/preview/components/PageNavigatorSidebar.js +0 -78
- package/dist/features/preview/components/PageStatusBadge.js +0 -97
- package/dist/features/preview/components/PeekedBlock.js +0 -217
- package/dist/features/preview/components/PreviewComments.js +0 -56
- package/dist/features/preview/components/PreviewToolbarSpacer.js +0 -43
- package/dist/features/preview/components/PublicationRow.js +0 -422
- package/dist/features/preview/components/PublishDialog.js +0 -194
- package/dist/features/preview/components/RightSidebar.js +0 -59
- package/dist/features/preview/components/SendFeedbackDialog.js +0 -83
- package/dist/features/preview/previewCommentsStore.js +0 -135
- package/dist/features/preview/publication.js +0 -81
- package/dist/features/preview/usePageComments.js +0 -39
- package/dist/features/runtime/SharedChromeContext.js +0 -7
- package/dist/features/studio/components/EnvironmentMenu.js +0 -425
- package/dist/features/vite/appGeneration.js +0 -89
- package/dist/lib/view-queries.js +0 -28
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/Matches.d.ts +0 -114
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/RouterProvider.d.ts +0 -25
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/config.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/defer.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/fileRoute.d.ts +0 -20
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/global.d.ts +0 -8
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/hash-scroll.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/index.d.ts +0 -18
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/link.d.ts +0 -161
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/load-matches.d.ts +0 -6
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/location.d.ts +0 -54
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/lru-cache.d.ts +0 -8
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/manifest.d.ts +0 -32
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.d.ts +0 -115
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/not-found.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/redirect.d.ts +0 -49
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/rewrite.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/root.d.ts +0 -6
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/route.d.ts +0 -343
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/routeInfo.d.ts +0 -48
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/router.d.ts +0 -695
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/scroll-restoration.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/searchMiddleware.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/searchParams.d.ts +0 -5
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/RawStream.d.ts +0 -38
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/seroval-plugins.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/transformer.d.ts +0 -65
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/stores.d.ts +0 -69
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/structuralSharing.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/typePrimitives.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useLoaderData.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useLoaderDeps.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useNavigate.d.ts +0 -10
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useParams.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useRouteContext.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useSearch.d.ts +0 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/utils.d.ts +0 -28
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/validators.d.ts +0 -49
- package/skills/camox/references/cli-environments.md +0 -37
|
@@ -1,79 +1,78 @@
|
|
|
1
1
|
import { actionsStore } from "../../provider/actionsStore.js";
|
|
2
|
+
import { NavigationDisabled, NavigationLocation } from "../../navigation/navigation.js";
|
|
3
|
+
import { ArtifactStudioContext } from "../../../core/hooks/useArtifactHost.js";
|
|
2
4
|
import { checkIfInputFocused, cn } from "../../../lib/utils.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { previewStore, selectIsCommentMode, selectIsEditMode } from "../previewStore.js";
|
|
6
|
-
import { useBlockActionsShortcuts } from "./BlockActionsPopover.js";
|
|
7
|
-
import { PreviewPageContext } from "../previewSelection.js";
|
|
5
|
+
import { previewStore } from "../previewStore.js";
|
|
6
|
+
import { useEditingFrameClaim, useEditingOwner } from "../editingFrame.js";
|
|
8
7
|
import { Frame, useFrame } from "./Frame.js";
|
|
8
|
+
import { previewPageIframeProps, usePreviewPageFrame } from "../previewPageFrame.js";
|
|
9
|
+
import { EditableSurfaceContext } from "../../../core/hooks/useIsEditable.js";
|
|
10
|
+
import { adoptCanvasDocument, pauseCanvasDocument } from "../../canvas/canvasFrameDocument.js";
|
|
11
|
+
import { CanvasWorkspaceContext } from "../../canvas/canvasZoom.js";
|
|
12
|
+
import { forwardCanvasWheel, useCanvasFrameInput } from "../../canvas/useCanvasFrameInput.js";
|
|
13
|
+
import { PreviewEditingOwnerContext } from "../previewSelection.js";
|
|
14
|
+
import { useBlockActionsShortcuts } from "./BlockActionsPopover.js";
|
|
9
15
|
import { FieldOverlayStyles } from "./FieldOverlayStyles.js";
|
|
10
|
-
import { FieldToolbar } from "./FieldToolbar.js";
|
|
11
16
|
import { MobilePreviewDrawer } from "./MobilePreviewDrawer.js";
|
|
12
17
|
import { Overlays } from "./Overlays.js";
|
|
13
18
|
import { OverlayTracker } from "./OverlayTracker.js";
|
|
14
|
-
import { PreviewComments } from "./PreviewComments.js";
|
|
15
|
-
import { PreviewToolbar } from "./PreviewToolbar.js";
|
|
16
19
|
import { c } from "react/compiler-runtime";
|
|
17
20
|
import * as React from "react";
|
|
18
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
21
|
import { useSelector } from "@xstate/store-react";
|
|
22
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
20
23
|
import { PanelContent } from "@camox/ui/panel";
|
|
24
|
+
import { flushSync } from "react-dom";
|
|
21
25
|
|
|
22
26
|
//#region src/features/preview/components/PreviewPanel.tsx
|
|
23
27
|
const PreviewFrame = (t0) => {
|
|
24
|
-
const $ = c(
|
|
25
|
-
|
|
26
|
-
for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
27
|
-
$[0] = "2ff281df7470ab1480710764847a6828eb3009ff64e2feadae4454d04b90f99e";
|
|
28
|
-
}
|
|
29
|
-
const { children, style, className, onIframeReady } = t0;
|
|
28
|
+
const $ = c(8);
|
|
29
|
+
const { children, style, className, iframeProps, inCanvas, onIframeReady } = t0;
|
|
30
30
|
let t1;
|
|
31
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
32
|
+
t1 = /* @__PURE__ */ jsx(KeyDownForwarder, {});
|
|
33
|
+
$[0] = t1;
|
|
34
|
+
} else t1 = $[0];
|
|
31
35
|
let t2;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
t1 = /* @__PURE__ */ jsx(FieldOverlayStyles, {});
|
|
35
|
-
t2 = /* @__PURE__ */ jsx(KeyDownForwarder, {});
|
|
36
|
-
t3 = /* @__PURE__ */ jsx(OverlayTracker, {});
|
|
37
|
-
$[1] = t1;
|
|
38
|
-
$[2] = t2;
|
|
39
|
-
$[3] = t3;
|
|
40
|
-
} else {
|
|
41
|
-
t1 = $[1];
|
|
42
|
-
t2 = $[2];
|
|
43
|
-
t3 = $[3];
|
|
44
|
-
}
|
|
45
|
-
let t4;
|
|
46
|
-
if ($[4] !== children || $[5] !== className || $[6] !== onIframeReady || $[7] !== style) {
|
|
47
|
-
t4 = /* @__PURE__ */ jsxs(Frame, {
|
|
36
|
+
if ($[1] !== children || $[2] !== className || $[3] !== iframeProps || $[4] !== inCanvas || $[5] !== onIframeReady || $[6] !== style) {
|
|
37
|
+
t2 = /* @__PURE__ */ jsxs(Frame, {
|
|
48
38
|
className,
|
|
49
39
|
style,
|
|
40
|
+
iframeProps,
|
|
41
|
+
inCanvas,
|
|
50
42
|
onIframeReady,
|
|
51
|
-
children: [
|
|
52
|
-
children,
|
|
53
|
-
t1,
|
|
54
|
-
t2,
|
|
55
|
-
t3
|
|
56
|
-
]
|
|
43
|
+
children: [children, t1]
|
|
57
44
|
});
|
|
58
|
-
$[
|
|
59
|
-
$[
|
|
60
|
-
$[
|
|
61
|
-
$[
|
|
62
|
-
$[
|
|
63
|
-
|
|
64
|
-
|
|
45
|
+
$[1] = children;
|
|
46
|
+
$[2] = className;
|
|
47
|
+
$[3] = iframeProps;
|
|
48
|
+
$[4] = inCanvas;
|
|
49
|
+
$[5] = onIframeReady;
|
|
50
|
+
$[6] = style;
|
|
51
|
+
$[7] = t2;
|
|
52
|
+
} else t2 = $[7];
|
|
53
|
+
return t2;
|
|
54
|
+
};
|
|
55
|
+
/** Shared by the single-page preview and each canvas document. */
|
|
56
|
+
const PreviewFrameEffects = () => {
|
|
57
|
+
const $ = c(1);
|
|
58
|
+
let t0;
|
|
59
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
60
|
+
t0 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
61
|
+
/* @__PURE__ */ jsx(FieldOverlayStyles, {}),
|
|
62
|
+
/* @__PURE__ */ jsx(KeyDownForwarder, {}),
|
|
63
|
+
/* @__PURE__ */ jsx(OverlayTracker, {})
|
|
64
|
+
] });
|
|
65
|
+
$[0] = t0;
|
|
66
|
+
} else t0 = $[0];
|
|
67
|
+
return t0;
|
|
65
68
|
};
|
|
66
69
|
const KeyDownForwarder = () => {
|
|
67
|
-
const $ = c(
|
|
68
|
-
if ($[0] !== "2ff281df7470ab1480710764847a6828eb3009ff64e2feadae4454d04b90f99e") {
|
|
69
|
-
for (let $i = 0; $i < 5; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
70
|
-
$[0] = "2ff281df7470ab1480710764847a6828eb3009ff64e2feadae4454d04b90f99e";
|
|
71
|
-
}
|
|
70
|
+
const $ = c(4);
|
|
72
71
|
const { window: iframeWindow } = useFrame();
|
|
73
72
|
const actions = useSelector(actionsStore, _temp);
|
|
74
73
|
let t0;
|
|
75
74
|
let t1;
|
|
76
|
-
if ($[
|
|
75
|
+
if ($[0] !== actions || $[1] !== iframeWindow) {
|
|
77
76
|
t0 = () => {
|
|
78
77
|
if (!iframeWindow || !iframeWindow.parent || iframeWindow.parent === iframeWindow) return;
|
|
79
78
|
const handleKeyDown = (e) => {
|
|
@@ -113,310 +112,612 @@ const KeyDownForwarder = () => {
|
|
|
113
112
|
};
|
|
114
113
|
};
|
|
115
114
|
t1 = [iframeWindow, actions];
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
115
|
+
$[0] = actions;
|
|
116
|
+
$[1] = iframeWindow;
|
|
117
|
+
$[2] = t0;
|
|
118
|
+
$[3] = t1;
|
|
120
119
|
} else {
|
|
121
|
-
t0 = $[
|
|
122
|
-
t1 = $[
|
|
120
|
+
t0 = $[2];
|
|
121
|
+
t1 = $[3];
|
|
123
122
|
}
|
|
124
123
|
React.useEffect(t0, t1);
|
|
125
124
|
return null;
|
|
126
125
|
};
|
|
126
|
+
/** The preview's read-only tree is never editable, whether or not the Canvas shows. */
|
|
127
|
+
const READ_ONLY_ARTIFACT_STUDIO = {
|
|
128
|
+
editing: false,
|
|
129
|
+
canvas: false
|
|
130
|
+
};
|
|
127
131
|
const viewportClassName = {
|
|
128
132
|
tablet: "h-[1024px] w-[768px] max-h-full max-w-full",
|
|
129
133
|
mobile: "h-175 w-[393px] max-h-full max-w-full"
|
|
130
134
|
};
|
|
131
135
|
function CuratedBlockShortcuts() {
|
|
132
|
-
const $ = c(1);
|
|
133
|
-
if ($[0] !== "2ff281df7470ab1480710764847a6828eb3009ff64e2feadae4454d04b90f99e") {
|
|
134
|
-
for (let $i = 0; $i < 1; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
135
|
-
$[0] = "2ff281df7470ab1480710764847a6828eb3009ff64e2feadae4454d04b90f99e";
|
|
136
|
-
}
|
|
137
136
|
useBlockActionsShortcuts();
|
|
138
137
|
return null;
|
|
139
138
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
const
|
|
148
|
-
const
|
|
149
|
-
const
|
|
150
|
-
const
|
|
139
|
+
/**
|
|
140
|
+
* What the Preview page frame does while it shows in the Canvas, like any Canvas
|
|
141
|
+
* frame: it takes its slot's size, keeps the camera's input, activates its Page
|
|
142
|
+
* when used, pauses with the camera, and draws its editing overlays.
|
|
143
|
+
*/
|
|
144
|
+
function PreviewPageCanvasEffects(t0) {
|
|
145
|
+
const $ = c(30);
|
|
146
|
+
const { owner } = t0;
|
|
147
|
+
const { window: frameWindow, iframeElement } = useFrame();
|
|
148
|
+
const { frame, slot, inCanvas } = usePreviewPageFrame();
|
|
149
|
+
const iframeRef = React.useRef(iframeElement);
|
|
150
|
+
let t1;
|
|
151
|
+
if ($[0] !== iframeElement) {
|
|
152
|
+
t1 = () => {
|
|
153
|
+
iframeRef.current = iframeElement;
|
|
154
|
+
};
|
|
155
|
+
$[0] = iframeElement;
|
|
156
|
+
$[1] = t1;
|
|
157
|
+
} else t1 = $[1];
|
|
158
|
+
React.useLayoutEffect(t1);
|
|
159
|
+
let t2;
|
|
160
|
+
if ($[2] !== frameWindow?.document) {
|
|
161
|
+
t2 = frameWindow?.document.querySelector("[data-camox-preview-root]");
|
|
162
|
+
$[2] = frameWindow?.document;
|
|
163
|
+
$[3] = t2;
|
|
164
|
+
} else t2 = $[3];
|
|
165
|
+
const root = t2;
|
|
166
|
+
const placed = inCanvas && slot && iframeElement && root ? slot : null;
|
|
167
|
+
const viewportHeight = placed?.viewportHeight;
|
|
168
|
+
let t3;
|
|
151
169
|
let t4;
|
|
152
|
-
if ($[
|
|
153
|
-
|
|
154
|
-
|
|
170
|
+
if ($[4] !== frame || $[5] !== iframeElement || $[6] !== root || $[7] !== viewportHeight) {
|
|
171
|
+
t3 = () => {
|
|
172
|
+
if (!frame || !iframeElement || !root || viewportHeight === void 0) return;
|
|
173
|
+
const undo = adoptCanvasDocument(iframeElement, root, viewportHeight);
|
|
174
|
+
const report = () => frame.setHeight(Number.parseFloat(iframeElement.ownerDocument.defaultView.getComputedStyle(iframeElement).height));
|
|
175
|
+
report();
|
|
176
|
+
let pending = 0;
|
|
177
|
+
const resize = new ResizeObserver(() => {
|
|
178
|
+
cancelAnimationFrame(pending);
|
|
179
|
+
pending = requestAnimationFrame(report);
|
|
180
|
+
});
|
|
181
|
+
resize.observe(iframeElement);
|
|
182
|
+
return () => {
|
|
183
|
+
cancelAnimationFrame(pending);
|
|
184
|
+
resize.disconnect();
|
|
185
|
+
undo();
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
t4 = [
|
|
189
|
+
frame,
|
|
190
|
+
iframeElement,
|
|
191
|
+
root,
|
|
192
|
+
viewportHeight
|
|
193
|
+
];
|
|
194
|
+
$[4] = frame;
|
|
195
|
+
$[5] = iframeElement;
|
|
196
|
+
$[6] = root;
|
|
197
|
+
$[7] = viewportHeight;
|
|
198
|
+
$[8] = t3;
|
|
199
|
+
$[9] = t4;
|
|
200
|
+
} else {
|
|
201
|
+
t3 = $[8];
|
|
202
|
+
t4 = $[9];
|
|
203
|
+
}
|
|
204
|
+
React.useLayoutEffect(t3, t4);
|
|
205
|
+
const live = !placed || placed.mode === "live";
|
|
206
|
+
let t5;
|
|
207
|
+
let t6;
|
|
208
|
+
if ($[10] !== live || $[11] !== root) {
|
|
209
|
+
t5 = () => {
|
|
210
|
+
if (live || !root) return;
|
|
211
|
+
return pauseCanvasDocument(root.ownerDocument);
|
|
212
|
+
};
|
|
213
|
+
t6 = [live, root];
|
|
214
|
+
$[10] = live;
|
|
215
|
+
$[11] = root;
|
|
216
|
+
$[12] = t5;
|
|
217
|
+
$[13] = t6;
|
|
218
|
+
} else {
|
|
219
|
+
t5 = $[12];
|
|
220
|
+
t6 = $[13];
|
|
221
|
+
}
|
|
222
|
+
React.useEffect(t5, t6);
|
|
223
|
+
useCanvasFrameInput(iframeRef, placed ? root ?? null : null, placed?.viewport);
|
|
224
|
+
const onInteract = placed?.onInteract;
|
|
225
|
+
let t7;
|
|
226
|
+
if ($[14] !== onInteract || $[15] !== root?.ownerDocument) {
|
|
227
|
+
t7 = () => {
|
|
228
|
+
const doc = root?.ownerDocument;
|
|
229
|
+
if (!doc || !onInteract) return;
|
|
230
|
+
const preventLinkNavigation = _temp2;
|
|
231
|
+
for (const type of [
|
|
232
|
+
"pointerdown",
|
|
233
|
+
"focusin",
|
|
234
|
+
"click"
|
|
235
|
+
]) doc.addEventListener(type, onInteract, true);
|
|
236
|
+
doc.addEventListener("click", preventLinkNavigation);
|
|
237
|
+
return () => {
|
|
238
|
+
for (const type_0 of [
|
|
239
|
+
"pointerdown",
|
|
240
|
+
"focusin",
|
|
241
|
+
"click"
|
|
242
|
+
]) doc.removeEventListener(type_0, onInteract, true);
|
|
243
|
+
doc.removeEventListener("click", preventLinkNavigation);
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
$[14] = onInteract;
|
|
247
|
+
$[15] = root?.ownerDocument;
|
|
248
|
+
$[16] = t7;
|
|
249
|
+
} else t7 = $[16];
|
|
250
|
+
let t8;
|
|
251
|
+
if ($[17] !== onInteract || $[18] !== root) {
|
|
252
|
+
t8 = [root, onInteract];
|
|
253
|
+
$[17] = onInteract;
|
|
254
|
+
$[18] = root;
|
|
255
|
+
$[19] = t8;
|
|
256
|
+
} else t8 = $[19];
|
|
257
|
+
React.useEffect(t7, t8);
|
|
258
|
+
let t10;
|
|
259
|
+
let t9;
|
|
260
|
+
if ($[20] !== frame || $[21] !== iframeElement) {
|
|
261
|
+
t9 = () => {
|
|
262
|
+
if (!frame || !iframeElement) return;
|
|
263
|
+
frame.setIframe(iframeElement);
|
|
264
|
+
return () => frame.setIframe(null);
|
|
265
|
+
};
|
|
266
|
+
t10 = [frame, iframeElement];
|
|
267
|
+
$[20] = frame;
|
|
268
|
+
$[21] = iframeElement;
|
|
269
|
+
$[22] = t10;
|
|
270
|
+
$[23] = t9;
|
|
271
|
+
} else {
|
|
272
|
+
t10 = $[22];
|
|
273
|
+
t9 = $[23];
|
|
274
|
+
}
|
|
275
|
+
React.useEffect(t9, t10);
|
|
276
|
+
if (!placed) return null;
|
|
277
|
+
let t11;
|
|
278
|
+
let t12;
|
|
279
|
+
if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
|
|
280
|
+
t11 = /* @__PURE__ */ jsx(FieldOverlayStyles, {});
|
|
281
|
+
t12 = /* @__PURE__ */ jsx(OverlayTracker, {});
|
|
282
|
+
$[24] = t11;
|
|
283
|
+
$[25] = t12;
|
|
284
|
+
} else {
|
|
285
|
+
t11 = $[24];
|
|
286
|
+
t12 = $[25];
|
|
287
|
+
}
|
|
288
|
+
const t13 = owner?.kind === "page";
|
|
289
|
+
let t14;
|
|
290
|
+
if ($[26] !== iframeElement || $[27] !== owner || $[28] !== t13) {
|
|
291
|
+
t14 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
292
|
+
t11,
|
|
293
|
+
t12,
|
|
294
|
+
/* @__PURE__ */ jsx(Overlays, {
|
|
295
|
+
frame: iframeElement,
|
|
296
|
+
owner,
|
|
297
|
+
canAddBlocks: t13
|
|
298
|
+
})
|
|
299
|
+
] });
|
|
300
|
+
$[26] = iframeElement;
|
|
301
|
+
$[27] = owner;
|
|
302
|
+
$[28] = t13;
|
|
303
|
+
$[29] = t14;
|
|
304
|
+
} else t14 = $[29];
|
|
305
|
+
return t14;
|
|
306
|
+
}
|
|
307
|
+
function _temp2(event) {
|
|
308
|
+
if (event.target?.closest?.("a")) event.preventDefault();
|
|
309
|
+
}
|
|
310
|
+
const PreviewPanel = (t0) => {
|
|
311
|
+
const $ = c(80);
|
|
312
|
+
const { children, active: t1, isMobileExperience: t2, page, layoutId, pageLocation, projectName: t3 } = t0;
|
|
313
|
+
const active = t1 === void 0 ? true : t1;
|
|
314
|
+
const isMobileExperience = t2 === void 0 ? false : t2;
|
|
315
|
+
const projectName = t3 === void 0 ? "Project" : t3;
|
|
316
|
+
const t4 = page?.id;
|
|
317
|
+
let t5;
|
|
318
|
+
if ($[0] !== layoutId || $[1] !== t4) {
|
|
319
|
+
t5 = {
|
|
320
|
+
pageId: t4,
|
|
321
|
+
layoutId
|
|
322
|
+
};
|
|
323
|
+
$[0] = layoutId;
|
|
324
|
+
$[1] = t4;
|
|
325
|
+
$[2] = t5;
|
|
326
|
+
} else t5 = $[2];
|
|
327
|
+
const owner = useEditingOwner(t5);
|
|
328
|
+
const [iframe, setIframe] = React.useState(null);
|
|
329
|
+
const claim = useEditingFrameClaim(iframe, owner);
|
|
330
|
+
let t6;
|
|
331
|
+
if ($[3] !== active || $[4] !== claim) {
|
|
332
|
+
t6 = () => {
|
|
333
|
+
if (active) claim();
|
|
334
|
+
};
|
|
335
|
+
$[3] = active;
|
|
336
|
+
$[4] = claim;
|
|
337
|
+
$[5] = t6;
|
|
338
|
+
} else t6 = $[5];
|
|
339
|
+
let t7;
|
|
340
|
+
if ($[6] !== active || $[7] !== claim || $[8] !== owner) {
|
|
341
|
+
t7 = [
|
|
342
|
+
active,
|
|
343
|
+
owner,
|
|
344
|
+
claim
|
|
345
|
+
];
|
|
346
|
+
$[6] = active;
|
|
347
|
+
$[7] = claim;
|
|
348
|
+
$[8] = owner;
|
|
349
|
+
$[9] = t7;
|
|
350
|
+
} else t7 = $[9];
|
|
351
|
+
React.useLayoutEffect(t6, t7);
|
|
352
|
+
const viewportMode = useSelector(previewStore, _temp3);
|
|
353
|
+
const isToolbarHidden = useSelector(previewStore, _temp4);
|
|
354
|
+
const { frame, slot, inCanvas, revealed } = usePreviewPageFrame();
|
|
355
|
+
const placed = !isMobileExperience && inCanvas ? slot : null;
|
|
356
|
+
const underCanvas = revealed && !isMobileExperience;
|
|
357
|
+
let t8;
|
|
358
|
+
if ($[10] !== frame) {
|
|
359
|
+
t8 = (element) => frame?.setOverlays(element);
|
|
360
|
+
$[10] = frame;
|
|
361
|
+
$[11] = t8;
|
|
362
|
+
} else t8 = $[11];
|
|
363
|
+
const overlaysRef = t8;
|
|
364
|
+
const t9 = !!placed?.selected;
|
|
365
|
+
const t10 = placed?.workspace ?? null;
|
|
366
|
+
const t11 = !!placed;
|
|
367
|
+
let t12;
|
|
368
|
+
if ($[12] !== children) {
|
|
369
|
+
t12 = /* @__PURE__ */ jsx(ArtifactStudioContext, {
|
|
370
|
+
value: READ_ONLY_ARTIFACT_STUDIO,
|
|
155
371
|
children
|
|
156
372
|
});
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
373
|
+
$[12] = children;
|
|
374
|
+
$[13] = t12;
|
|
375
|
+
} else t12 = $[13];
|
|
376
|
+
let t13;
|
|
377
|
+
if ($[14] !== owner) {
|
|
378
|
+
t13 = /* @__PURE__ */ jsx(PreviewPageCanvasEffects, { owner });
|
|
379
|
+
$[14] = owner;
|
|
380
|
+
$[15] = t13;
|
|
381
|
+
} else t13 = $[15];
|
|
382
|
+
let t14;
|
|
383
|
+
if ($[16] !== t11 || $[17] !== t12 || $[18] !== t13) {
|
|
384
|
+
t14 = /* @__PURE__ */ jsxs(NavigationDisabled, {
|
|
385
|
+
disabled: t11,
|
|
386
|
+
children: [t12, t13]
|
|
387
|
+
});
|
|
388
|
+
$[16] = t11;
|
|
389
|
+
$[17] = t12;
|
|
390
|
+
$[18] = t13;
|
|
391
|
+
$[19] = t14;
|
|
392
|
+
} else t14 = $[19];
|
|
393
|
+
let t15;
|
|
394
|
+
if ($[20] !== t10 || $[21] !== t14) {
|
|
395
|
+
t15 = /* @__PURE__ */ jsx(CanvasWorkspaceContext, {
|
|
396
|
+
value: t10,
|
|
397
|
+
children: t14
|
|
398
|
+
});
|
|
399
|
+
$[20] = t10;
|
|
400
|
+
$[21] = t14;
|
|
401
|
+
$[22] = t15;
|
|
402
|
+
} else t15 = $[22];
|
|
403
|
+
let t16;
|
|
404
|
+
if ($[23] !== t15 || $[24] !== t9) {
|
|
405
|
+
t16 = /* @__PURE__ */ jsx(EditableSurfaceContext, {
|
|
406
|
+
value: t9,
|
|
407
|
+
children: t15
|
|
408
|
+
});
|
|
409
|
+
$[23] = t15;
|
|
410
|
+
$[24] = t9;
|
|
411
|
+
$[25] = t16;
|
|
412
|
+
} else t16 = $[25];
|
|
413
|
+
let t17;
|
|
414
|
+
if ($[26] !== pageLocation || $[27] !== t16) {
|
|
415
|
+
t17 = /* @__PURE__ */ jsx(NavigationLocation, {
|
|
416
|
+
location: pageLocation,
|
|
417
|
+
children: t16
|
|
418
|
+
});
|
|
419
|
+
$[26] = pageLocation;
|
|
420
|
+
$[27] = t16;
|
|
421
|
+
$[28] = t17;
|
|
422
|
+
} else t17 = $[28];
|
|
423
|
+
const pageContent = t17;
|
|
174
424
|
if (isMobileExperience) {
|
|
175
|
-
let
|
|
176
|
-
if ($[
|
|
177
|
-
|
|
425
|
+
let t18;
|
|
426
|
+
if ($[29] !== pageContent) {
|
|
427
|
+
t18 = /* @__PURE__ */ jsx("div", {
|
|
178
428
|
className: "relative min-h-0 flex-1",
|
|
179
429
|
children: /* @__PURE__ */ jsx(PreviewFrame, {
|
|
180
430
|
className: "h-full w-full",
|
|
181
|
-
onIframeReady:
|
|
182
|
-
children:
|
|
431
|
+
onIframeReady: setIframe,
|
|
432
|
+
children: pageContent
|
|
183
433
|
})
|
|
184
434
|
});
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
} else
|
|
188
|
-
let
|
|
189
|
-
if ($[
|
|
190
|
-
|
|
435
|
+
$[29] = pageContent;
|
|
436
|
+
$[30] = t18;
|
|
437
|
+
} else t18 = $[30];
|
|
438
|
+
let t19;
|
|
439
|
+
if ($[31] !== active || $[32] !== isToolbarHidden || $[33] !== page || $[34] !== projectName) {
|
|
440
|
+
t19 = active && !isToolbarHidden && page && /* @__PURE__ */ jsx(MobilePreviewDrawer, {
|
|
191
441
|
page,
|
|
192
442
|
projectName
|
|
193
|
-
})
|
|
194
|
-
$[
|
|
195
|
-
$[
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
t8 = /* @__PURE__ */ jsxs(PanelContent, {
|
|
443
|
+
});
|
|
444
|
+
$[31] = active;
|
|
445
|
+
$[32] = isToolbarHidden;
|
|
446
|
+
$[33] = page;
|
|
447
|
+
$[34] = projectName;
|
|
448
|
+
$[35] = t19;
|
|
449
|
+
} else t19 = $[35];
|
|
450
|
+
let t20;
|
|
451
|
+
if ($[36] !== t18 || $[37] !== t19) {
|
|
452
|
+
t20 = /* @__PURE__ */ jsxs(PanelContent, {
|
|
204
453
|
className: "flex min-h-0 flex-col overflow-hidden bg-black",
|
|
205
|
-
children: [
|
|
454
|
+
children: [t18, t19]
|
|
206
455
|
});
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
} else
|
|
211
|
-
|
|
456
|
+
$[36] = t18;
|
|
457
|
+
$[37] = t19;
|
|
458
|
+
$[38] = t20;
|
|
459
|
+
} else t20 = $[38];
|
|
460
|
+
let t21;
|
|
461
|
+
if ($[39] !== owner || $[40] !== t20) {
|
|
462
|
+
t21 = /* @__PURE__ */ jsx(PreviewEditingOwnerContext, {
|
|
463
|
+
value: owner,
|
|
464
|
+
children: t20
|
|
465
|
+
});
|
|
466
|
+
$[39] = owner;
|
|
467
|
+
$[40] = t20;
|
|
468
|
+
$[41] = t21;
|
|
469
|
+
} else t21 = $[41];
|
|
470
|
+
return t21;
|
|
212
471
|
}
|
|
472
|
+
const device = viewportMode !== "full" && !placed;
|
|
473
|
+
const t18 = !underCanvas && "bg-black";
|
|
474
|
+
let t19;
|
|
475
|
+
if ($[42] !== t18) {
|
|
476
|
+
t19 = cn("relative overflow-hidden", t18);
|
|
477
|
+
$[42] = t18;
|
|
478
|
+
$[43] = t19;
|
|
479
|
+
} else t19 = $[43];
|
|
480
|
+
const t20 = !placed && "inset-0";
|
|
481
|
+
const t21 = underCanvas && (!placed || placed.hidden) && "invisible";
|
|
482
|
+
const t22 = device && "checkered flex items-center justify-center";
|
|
483
|
+
let t23;
|
|
484
|
+
if ($[44] !== t20 || $[45] !== t21 || $[46] !== t22) {
|
|
485
|
+
t23 = cn("absolute", t20, t21, t22);
|
|
486
|
+
$[44] = t20;
|
|
487
|
+
$[45] = t21;
|
|
488
|
+
$[46] = t22;
|
|
489
|
+
$[47] = t23;
|
|
490
|
+
} else t23 = $[47];
|
|
491
|
+
const t24 = placed && "absolute top-0 left-0 in-data-[canvas-promoted]:will-change-transform";
|
|
492
|
+
const t25 = !placed && !device && "h-full w-full";
|
|
493
|
+
let t26;
|
|
494
|
+
if ($[48] !== device || $[49] !== t24 || $[50] !== t25 || $[51] !== viewportMode) {
|
|
495
|
+
t26 = cn(t24, t25, device && cn("relative overflow-hidden", viewportClassName[viewportMode]));
|
|
496
|
+
$[48] = device;
|
|
497
|
+
$[49] = t24;
|
|
498
|
+
$[50] = t25;
|
|
499
|
+
$[51] = viewportMode;
|
|
500
|
+
$[52] = t26;
|
|
501
|
+
} else t26 = $[52];
|
|
502
|
+
let t27;
|
|
503
|
+
if ($[53] !== placed) {
|
|
504
|
+
t27 = placed ? {
|
|
505
|
+
width: placed.width,
|
|
506
|
+
transform: `translate(calc(var(--canvas-x, 0px) + ${placed.left}px * var(--canvas-zoom, 1)), calc(var(--canvas-y, 0px) + ${placed.top}px * var(--canvas-zoom, 1))) scale(var(--canvas-zoom, 1))`,
|
|
507
|
+
transformOrigin: "0 0"
|
|
508
|
+
} : void 0;
|
|
509
|
+
$[53] = placed;
|
|
510
|
+
$[54] = t27;
|
|
511
|
+
} else t27 = $[54];
|
|
512
|
+
const t28 = !placed && !device && "checkered h-full w-full";
|
|
513
|
+
const t29 = device && "overflow-auto";
|
|
514
|
+
let t30;
|
|
515
|
+
if ($[55] !== t28 || $[56] !== t29) {
|
|
516
|
+
t30 = cn(t28, t29);
|
|
517
|
+
$[55] = t28;
|
|
518
|
+
$[56] = t29;
|
|
519
|
+
$[57] = t30;
|
|
520
|
+
} else t30 = $[57];
|
|
521
|
+
const t31 = !!placed;
|
|
522
|
+
let t32;
|
|
523
|
+
if ($[58] !== pageContent || $[59] !== t30 || $[60] !== t31) {
|
|
524
|
+
t32 = /* @__PURE__ */ jsx(PreviewFrame, {
|
|
525
|
+
className: t30,
|
|
526
|
+
iframeProps: previewPageIframeProps,
|
|
527
|
+
inCanvas: t31,
|
|
528
|
+
onIframeReady: setIframe,
|
|
529
|
+
children: pageContent
|
|
530
|
+
});
|
|
531
|
+
$[58] = pageContent;
|
|
532
|
+
$[59] = t30;
|
|
533
|
+
$[60] = t31;
|
|
534
|
+
$[61] = t32;
|
|
535
|
+
} else t32 = $[61];
|
|
536
|
+
const t33 = !placed;
|
|
537
|
+
let t34;
|
|
538
|
+
if ($[62] !== overlaysRef || $[63] !== t33) {
|
|
539
|
+
t34 = /* @__PURE__ */ jsx("div", {
|
|
540
|
+
ref: overlaysRef,
|
|
541
|
+
"data-preview-page-overlays": true,
|
|
542
|
+
className: "pointer-events-none absolute inset-0",
|
|
543
|
+
hidden: t33
|
|
544
|
+
});
|
|
545
|
+
$[62] = overlaysRef;
|
|
546
|
+
$[63] = t33;
|
|
547
|
+
$[64] = t34;
|
|
548
|
+
} else t34 = $[64];
|
|
549
|
+
let t35;
|
|
550
|
+
if ($[65] !== t26 || $[66] !== t27 || $[67] !== t32 || $[68] !== t34) {
|
|
551
|
+
t35 = /* @__PURE__ */ jsxs("div", {
|
|
552
|
+
"data-preview-page-host": true,
|
|
553
|
+
className: t26,
|
|
554
|
+
style: t27,
|
|
555
|
+
children: [t32, t34]
|
|
556
|
+
});
|
|
557
|
+
$[65] = t26;
|
|
558
|
+
$[66] = t27;
|
|
559
|
+
$[67] = t32;
|
|
560
|
+
$[68] = t34;
|
|
561
|
+
$[69] = t35;
|
|
562
|
+
} else t35 = $[69];
|
|
563
|
+
let t36;
|
|
564
|
+
if ($[70] !== placed || $[71] !== t23 || $[72] !== t35) {
|
|
565
|
+
t36 = /* @__PURE__ */ jsx(PreviewPageClip, {
|
|
566
|
+
slot: placed,
|
|
567
|
+
className: t23,
|
|
568
|
+
children: t35
|
|
569
|
+
});
|
|
570
|
+
$[70] = placed;
|
|
571
|
+
$[71] = t23;
|
|
572
|
+
$[72] = t35;
|
|
573
|
+
$[73] = t36;
|
|
574
|
+
} else t36 = $[73];
|
|
575
|
+
let t37;
|
|
576
|
+
if ($[74] !== t19 || $[75] !== t36) {
|
|
577
|
+
t37 = /* @__PURE__ */ jsx(PanelContent, {
|
|
578
|
+
className: t19,
|
|
579
|
+
children: t36
|
|
580
|
+
});
|
|
581
|
+
$[74] = t19;
|
|
582
|
+
$[75] = t36;
|
|
583
|
+
$[76] = t37;
|
|
584
|
+
} else t37 = $[76];
|
|
585
|
+
let t38;
|
|
586
|
+
if ($[77] !== owner || $[78] !== t37) {
|
|
587
|
+
t38 = /* @__PURE__ */ jsx(PreviewEditingOwnerContext, {
|
|
588
|
+
value: owner,
|
|
589
|
+
children: t37
|
|
590
|
+
});
|
|
591
|
+
$[77] = owner;
|
|
592
|
+
$[78] = t37;
|
|
593
|
+
$[79] = t38;
|
|
594
|
+
} else t38 = $[79];
|
|
595
|
+
return t38;
|
|
596
|
+
};
|
|
597
|
+
/**
|
|
598
|
+
* Fills the Preview, or clips the frame to the Canvas viewport above the Canvas
|
|
599
|
+
* row, where the camera moves it. Space + drag pans through it, and wheel input
|
|
600
|
+
* over its overlays moves the camera like over the rest of the Canvas.
|
|
601
|
+
*/
|
|
602
|
+
function PreviewPageClip(t0) {
|
|
603
|
+
const $ = c(19);
|
|
604
|
+
const { slot, className, children } = t0;
|
|
605
|
+
const ref = React.useRef(null);
|
|
606
|
+
const [rect, setRect] = React.useState(null);
|
|
607
|
+
const viewport = slot?.viewport;
|
|
608
|
+
const mirrorCamera = slot?.workspace?.mirrorCamera;
|
|
609
|
+
let t1;
|
|
610
|
+
let t2;
|
|
611
|
+
if ($[0] !== viewport) {
|
|
612
|
+
t1 = () => {
|
|
613
|
+
const clip = ref.current;
|
|
614
|
+
const parent = clip?.offsetParent;
|
|
615
|
+
if (!clip || !parent || !viewport) {
|
|
616
|
+
setRect(null);
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
const measure = () => {
|
|
620
|
+
const from = parent.getBoundingClientRect();
|
|
621
|
+
const to = viewport.getBoundingClientRect();
|
|
622
|
+
setRect({
|
|
623
|
+
left: to.left - from.left,
|
|
624
|
+
top: to.top - from.top,
|
|
625
|
+
width: to.width,
|
|
626
|
+
height: to.height
|
|
627
|
+
});
|
|
628
|
+
};
|
|
629
|
+
measure();
|
|
630
|
+
const resize = new ResizeObserver(() => flushSync(measure));
|
|
631
|
+
resize.observe(viewport);
|
|
632
|
+
resize.observe(parent);
|
|
633
|
+
return () => resize.disconnect();
|
|
634
|
+
};
|
|
635
|
+
t2 = [viewport];
|
|
636
|
+
$[0] = viewport;
|
|
637
|
+
$[1] = t1;
|
|
638
|
+
$[2] = t2;
|
|
639
|
+
} else {
|
|
640
|
+
t1 = $[1];
|
|
641
|
+
t2 = $[2];
|
|
642
|
+
}
|
|
643
|
+
React.useLayoutEffect(t1, t2);
|
|
644
|
+
let t3;
|
|
645
|
+
let t4;
|
|
646
|
+
if ($[3] !== mirrorCamera) {
|
|
647
|
+
t3 = () => {
|
|
648
|
+
const clip_0 = ref.current;
|
|
649
|
+
if (!clip_0 || !mirrorCamera) return;
|
|
650
|
+
return mirrorCamera(clip_0);
|
|
651
|
+
};
|
|
652
|
+
t4 = [mirrorCamera];
|
|
653
|
+
$[3] = mirrorCamera;
|
|
654
|
+
$[4] = t3;
|
|
655
|
+
$[5] = t4;
|
|
656
|
+
} else {
|
|
657
|
+
t3 = $[4];
|
|
658
|
+
t4 = $[5];
|
|
659
|
+
}
|
|
660
|
+
React.useLayoutEffect(t3, t4);
|
|
661
|
+
let t5;
|
|
213
662
|
let t6;
|
|
214
|
-
if ($[
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
$[
|
|
224
|
-
|
|
225
|
-
|
|
663
|
+
if ($[6] !== viewport) {
|
|
664
|
+
t5 = () => {
|
|
665
|
+
const clip_1 = ref.current;
|
|
666
|
+
if (!clip_1 || !viewport) return;
|
|
667
|
+
return forwardCanvasWheel(clip_1, viewport);
|
|
668
|
+
};
|
|
669
|
+
t6 = [viewport];
|
|
670
|
+
$[6] = viewport;
|
|
671
|
+
$[7] = t5;
|
|
672
|
+
$[8] = t6;
|
|
673
|
+
} else {
|
|
674
|
+
t5 = $[7];
|
|
675
|
+
t6 = $[8];
|
|
676
|
+
}
|
|
677
|
+
React.useEffect(t5, t6);
|
|
678
|
+
const t7 = slot && "pointer-events-none overflow-clip *:pointer-events-auto data-[canvas-pan]:**:pointer-events-none";
|
|
226
679
|
let t8;
|
|
227
|
-
if ($[
|
|
228
|
-
t8 =
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
/* @__PURE__ */ jsx(PreviewFrame, {
|
|
234
|
-
className: "checkered h-full w-full",
|
|
235
|
-
onIframeReady: handleIframeReady,
|
|
236
|
-
children: previewContent
|
|
237
|
-
}),
|
|
238
|
-
isEditMode && !isCommentMode && /* @__PURE__ */ jsx(Overlays, {
|
|
239
|
-
iframeElement,
|
|
240
|
-
canAddBlocks: !!page
|
|
241
|
-
}),
|
|
242
|
-
isEditMode && !isCommentMode && /* @__PURE__ */ jsx(FieldToolbar, {}),
|
|
243
|
-
!sharedChrome && /* @__PURE__ */ jsx(PreviewToolbar, { ...toolbarProps })
|
|
244
|
-
] }) : /* @__PURE__ */ jsxs("div", {
|
|
245
|
-
className: cn("checkered flex h-full justify-center", isEditMode ? "items-start" : "items-center"),
|
|
246
|
-
children: [
|
|
247
|
-
/* @__PURE__ */ jsxs("div", {
|
|
248
|
-
className: cn("relative overflow-hidden", viewportClassName[viewportMode], isEditMode && "mt-8"),
|
|
249
|
-
children: [/* @__PURE__ */ jsx(PreviewFrame, {
|
|
250
|
-
className: "overflow-auto",
|
|
251
|
-
onIframeReady: handleIframeReady,
|
|
252
|
-
children: previewContent
|
|
253
|
-
}), isEditMode && !isCommentMode && /* @__PURE__ */ jsx(Overlays, {
|
|
254
|
-
iframeElement,
|
|
255
|
-
canAddBlocks: !!page
|
|
256
|
-
})]
|
|
257
|
-
}),
|
|
258
|
-
isEditMode && !isCommentMode && /* @__PURE__ */ jsx(FieldToolbar, {}),
|
|
259
|
-
!sharedChrome && /* @__PURE__ */ jsx(PreviewToolbar, { ...toolbarProps })
|
|
260
|
-
]
|
|
261
|
-
})
|
|
262
|
-
})
|
|
263
|
-
});
|
|
264
|
-
$[21] = iframeElement;
|
|
265
|
-
$[22] = isCommentMode;
|
|
266
|
-
$[23] = isEditMode;
|
|
267
|
-
$[24] = page;
|
|
268
|
-
$[25] = previewContent;
|
|
269
|
-
$[26] = sharedChrome;
|
|
270
|
-
$[27] = toolbarProps;
|
|
271
|
-
$[28] = viewportMode;
|
|
272
|
-
$[29] = t8;
|
|
273
|
-
} else t8 = $[29];
|
|
680
|
+
if ($[9] !== className || $[10] !== t7) {
|
|
681
|
+
t8 = cn(className, t7);
|
|
682
|
+
$[9] = className;
|
|
683
|
+
$[10] = t7;
|
|
684
|
+
$[11] = t8;
|
|
685
|
+
} else t8 = $[11];
|
|
274
686
|
let t9;
|
|
275
|
-
if ($[
|
|
276
|
-
t9 =
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
]
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
687
|
+
if ($[12] !== rect || $[13] !== slot) {
|
|
688
|
+
t9 = slot && rect ? {
|
|
689
|
+
...rect,
|
|
690
|
+
zIndex: 1
|
|
691
|
+
} : void 0;
|
|
692
|
+
$[12] = rect;
|
|
693
|
+
$[13] = slot;
|
|
694
|
+
$[14] = t9;
|
|
695
|
+
} else t9 = $[14];
|
|
696
|
+
let t10;
|
|
697
|
+
if ($[15] !== children || $[16] !== t8 || $[17] !== t9) {
|
|
698
|
+
t10 = /* @__PURE__ */ jsx("div", {
|
|
699
|
+
ref,
|
|
700
|
+
"data-preview-page-clip": true,
|
|
701
|
+
className: t8,
|
|
702
|
+
style: t9,
|
|
703
|
+
children
|
|
704
|
+
});
|
|
705
|
+
$[15] = children;
|
|
706
|
+
$[16] = t8;
|
|
707
|
+
$[17] = t9;
|
|
708
|
+
$[18] = t10;
|
|
709
|
+
} else t10 = $[18];
|
|
710
|
+
return t10;
|
|
711
|
+
}
|
|
288
712
|
function _temp(state) {
|
|
289
713
|
return state.context.actions;
|
|
290
714
|
}
|
|
291
|
-
function
|
|
292
|
-
return state.context.
|
|
293
|
-
}
|
|
294
|
-
function _temp3(element) {
|
|
295
|
-
previewStore.send({
|
|
296
|
-
type: "setIframeElement",
|
|
297
|
-
element
|
|
298
|
-
});
|
|
715
|
+
function _temp3(state) {
|
|
716
|
+
return state.context.viewportMode;
|
|
299
717
|
}
|
|
300
718
|
function _temp4(state_0) {
|
|
301
|
-
return state_0.context.
|
|
302
|
-
}
|
|
303
|
-
function _temp5(state_1) {
|
|
304
|
-
return state_1.context.isToolbarHidden;
|
|
305
|
-
}
|
|
306
|
-
function _temp6() {
|
|
307
|
-
return true;
|
|
308
|
-
}
|
|
309
|
-
function _temp7() {
|
|
310
|
-
return previewStore.send({ type: "cycleViewportMode" });
|
|
311
|
-
}
|
|
312
|
-
function _temp8() {
|
|
313
|
-
return true;
|
|
314
|
-
}
|
|
315
|
-
function _temp9() {
|
|
316
|
-
return previewStore.send({
|
|
317
|
-
type: "setViewportMode",
|
|
318
|
-
mode: "full"
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
function _temp0() {
|
|
322
|
-
return true;
|
|
323
|
-
}
|
|
324
|
-
function _temp1() {
|
|
325
|
-
return previewStore.send({
|
|
326
|
-
type: "setViewportMode",
|
|
327
|
-
mode: "tablet"
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
function _temp10() {
|
|
331
|
-
return true;
|
|
332
|
-
}
|
|
333
|
-
function _temp11() {
|
|
334
|
-
return previewStore.send({
|
|
335
|
-
type: "setViewportMode",
|
|
336
|
-
mode: "mobile"
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
function _temp12() {
|
|
340
|
-
return true;
|
|
341
|
-
}
|
|
342
|
-
function _temp13() {
|
|
343
|
-
previewStore.send({
|
|
344
|
-
type: "setCommentMode",
|
|
345
|
-
enabled: false
|
|
346
|
-
});
|
|
347
|
-
previewStore.send({ type: "clearSelection" });
|
|
348
|
-
}
|
|
349
|
-
function _temp14(a) {
|
|
350
|
-
return a.id;
|
|
351
|
-
}
|
|
352
|
-
function _temp15() {
|
|
353
|
-
const actions = [
|
|
354
|
-
{
|
|
355
|
-
id: "cycle-viewport-mode",
|
|
356
|
-
label: "Cycle viewport mode",
|
|
357
|
-
aliases: [
|
|
358
|
-
"Responsive preview",
|
|
359
|
-
"Viewport preview",
|
|
360
|
-
"Device preview"
|
|
361
|
-
],
|
|
362
|
-
groupLabel: "Preview",
|
|
363
|
-
checkIfAvailable: _temp6,
|
|
364
|
-
execute: _temp7,
|
|
365
|
-
shortcut: { key: "m" }
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
id: "set-viewport-full",
|
|
369
|
-
label: "Set full viewport",
|
|
370
|
-
aliases: [
|
|
371
|
-
"Full preview",
|
|
372
|
-
"Desktop preview",
|
|
373
|
-
"Full width preview"
|
|
374
|
-
],
|
|
375
|
-
groupLabel: "Preview",
|
|
376
|
-
checkIfAvailable: _temp8,
|
|
377
|
-
execute: _temp9
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
id: "set-viewport-tablet",
|
|
381
|
-
label: "Set tablet viewport",
|
|
382
|
-
aliases: ["Tablet preview", "Responsive preview"],
|
|
383
|
-
groupLabel: "Preview",
|
|
384
|
-
checkIfAvailable: _temp0,
|
|
385
|
-
execute: _temp1
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
id: "set-viewport-mobile",
|
|
389
|
-
label: "Set mobile viewport",
|
|
390
|
-
aliases: [
|
|
391
|
-
"Mobile preview",
|
|
392
|
-
"Phone preview",
|
|
393
|
-
"Responsive preview"
|
|
394
|
-
],
|
|
395
|
-
groupLabel: "Preview",
|
|
396
|
-
checkIfAvailable: _temp10,
|
|
397
|
-
execute: _temp11
|
|
398
|
-
},
|
|
399
|
-
{
|
|
400
|
-
id: "clear-selection",
|
|
401
|
-
label: "Clear selection",
|
|
402
|
-
aliases: ["Deselect", "Unselect"],
|
|
403
|
-
groupLabel: "Preview",
|
|
404
|
-
checkIfAvailable: _temp12,
|
|
405
|
-
execute: _temp13,
|
|
406
|
-
shortcut: { key: "Escape" }
|
|
407
|
-
}
|
|
408
|
-
];
|
|
409
|
-
actionsStore.send({
|
|
410
|
-
type: "registerManyActions",
|
|
411
|
-
actions
|
|
412
|
-
});
|
|
413
|
-
return () => {
|
|
414
|
-
actionsStore.send({
|
|
415
|
-
type: "unregisterManyActions",
|
|
416
|
-
ids: actions.map(_temp14)
|
|
417
|
-
});
|
|
418
|
-
};
|
|
719
|
+
return state_0.context.isToolbarHidden;
|
|
419
720
|
}
|
|
420
721
|
|
|
421
722
|
//#endregion
|
|
422
|
-
export { PreviewPanel };
|
|
723
|
+
export { CuratedBlockShortcuts, PreviewFrame, PreviewFrameEffects, PreviewPanel };
|