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
package/dist/core/createBlock.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { artifactFrameProps, artifactStandInProps, isArtifactSource } from "./lib/artifact.js";
|
|
2
|
+
import { artifactData } from "./lib/artifactData.js";
|
|
3
|
+
import { resolveBlockFields, resolveToMarkdown } from "./lib/contentType.js";
|
|
4
|
+
import { useProjectUuid } from "../lib/auth.js";
|
|
5
|
+
import { useLocation, useNavigate } from "../features/navigation/navigation.js";
|
|
6
|
+
import { useOptionalCamoxApp } from "../features/provider/components/CamoxAppContext.js";
|
|
7
|
+
import { isItemMarker, queryResultIds, resolveAssetValue, useNormalizedData } from "../lib/normalized-data.js";
|
|
8
|
+
import { useLinkPages } from "../lib/link-pages.js";
|
|
5
9
|
import { useBlockEditingRuntime } from "./editing/BlockEditingRuntime.js";
|
|
6
|
-
import {
|
|
10
|
+
import { ArtifactStudioContext, ArtifactsRunContext, useArtifactHost, useInitialArtifactData } from "./hooks/useArtifactHost.js";
|
|
11
|
+
import { IconSvg } from "./lib/icons.js";
|
|
12
|
+
import { renderImagePlaceholder } from "./lib/imagePlaceholder.js";
|
|
7
13
|
import { buildImageSrcSet, getDefaultImageSizes, getDefaultImageWidth, transformImageUrl } from "./lib/imageTransform.js";
|
|
8
14
|
import { markdownToReactNodes } from "./lib/lexicalReact.js";
|
|
15
|
+
import { resolveReference, resolveReferenceList } from "./lib/reference.js";
|
|
9
16
|
import { c } from "react/compiler-runtime";
|
|
10
|
-
import { Type as Type$1 } from "@sinclair/typebox";
|
|
11
|
-
import { useQuery } from "@tanstack/react-query";
|
|
12
|
-
import { generateKeyBetween } from "fractional-indexing";
|
|
13
17
|
import * as React from "react";
|
|
14
|
-
import {
|
|
18
|
+
import { isQueryBacked } from "@camox/api-contract";
|
|
19
|
+
import { Type } from "@sinclair/typebox";
|
|
20
|
+
import { generateKeyBetween } from "fractional-indexing";
|
|
21
|
+
import { jsx } from "react/jsx-runtime";
|
|
15
22
|
|
|
16
23
|
//#region src/core/createBlock.tsx
|
|
17
24
|
const ASSET_LIST_SELF_KEY = "__camox_asset_self__";
|
|
@@ -23,7 +30,10 @@ function normalizeLinkValue(value) {
|
|
|
23
30
|
};
|
|
24
31
|
}
|
|
25
32
|
function resolveLinkHref(link, pages, pathname) {
|
|
26
|
-
if (link.type === "page")
|
|
33
|
+
if (link.type === "page") {
|
|
34
|
+
if (!pages) return pathname;
|
|
35
|
+
return pages.find((page) => page.id === link.pageId)?.fullPath ?? null;
|
|
36
|
+
}
|
|
27
37
|
if (!link.href || link.href.startsWith("#")) return `${pathname}${link.href ?? ""}`;
|
|
28
38
|
return link.href;
|
|
29
39
|
}
|
|
@@ -70,7 +80,7 @@ function buildPeekItems(properties, blockId, parentItemId, content, items, count
|
|
|
70
80
|
const markers = [];
|
|
71
81
|
let previousPosition = null;
|
|
72
82
|
for (let index = 0; index < defaultCount; index += 1) {
|
|
73
|
-
const id =
|
|
83
|
+
const id = `peek_${++counter.value}`;
|
|
74
84
|
const itemContent = {};
|
|
75
85
|
for (const [key, itemProperty] of Object.entries(property.items.properties)) {
|
|
76
86
|
if (itemProperty.type === "array" && itemProperty.items?.properties) continue;
|
|
@@ -88,7 +98,10 @@ function buildPeekItems(properties, blockId, parentItemId, content, items, count
|
|
|
88
98
|
summary: "",
|
|
89
99
|
position,
|
|
90
100
|
createdAt: 0,
|
|
91
|
-
updatedAt: 0
|
|
101
|
+
updatedAt: 0,
|
|
102
|
+
projectId: null,
|
|
103
|
+
sharedContentType: null,
|
|
104
|
+
references: {}
|
|
92
105
|
});
|
|
93
106
|
markers.push({ _itemId: id });
|
|
94
107
|
const nestedContent = {};
|
|
@@ -103,8 +116,9 @@ function buildPeekItems(properties, blockId, parentItemId, content, items, count
|
|
|
103
116
|
}
|
|
104
117
|
}
|
|
105
118
|
function createViewBlock(options) {
|
|
106
|
-
const
|
|
107
|
-
const
|
|
119
|
+
const fields = resolveBlockFields(options);
|
|
120
|
+
const typeboxSchema = Type.Object(fields.content);
|
|
121
|
+
const settingsTypeboxSchema = fields.settings ? Type.Object(fields.settings) : null;
|
|
108
122
|
const contentDefaults = collectDefaults(typeboxSchema.properties);
|
|
109
123
|
const settingsDefaults = settingsTypeboxSchema ? collectDefaults(settingsTypeboxSchema.properties) : {};
|
|
110
124
|
const repeatableDefaults = {};
|
|
@@ -131,19 +145,26 @@ function createViewBlock(options) {
|
|
|
131
145
|
children
|
|
132
146
|
});
|
|
133
147
|
const value = useValue(name);
|
|
134
|
-
const
|
|
135
|
-
const {
|
|
136
|
-
const { data: pages } = useQuery({
|
|
137
|
-
...viewPageQueries.list(project?.id ?? 0),
|
|
138
|
-
enabled: !!project
|
|
139
|
-
});
|
|
148
|
+
const pages = useLinkPages(useProjectUuid());
|
|
149
|
+
const pathname = useLocation({ select: (location) => location.pathname });
|
|
140
150
|
return children({ children: markdownToReactNodes(value, {
|
|
141
151
|
pages,
|
|
142
|
-
fallbackHref:
|
|
152
|
+
fallbackHref: pathname,
|
|
143
153
|
textStyle,
|
|
144
154
|
linkStyle
|
|
145
155
|
}) }, { text: value });
|
|
146
156
|
};
|
|
157
|
+
const Icon = ({ name, ...props }) => {
|
|
158
|
+
const editingRuntime = useBlockEditingRuntime();
|
|
159
|
+
if (editingRuntime) return editingRuntime.renderPrimitive(options, "Icon", {
|
|
160
|
+
name,
|
|
161
|
+
...props
|
|
162
|
+
});
|
|
163
|
+
return /* @__PURE__ */ jsx(IconSvg, {
|
|
164
|
+
iconId: useValue(name),
|
|
165
|
+
...props
|
|
166
|
+
});
|
|
167
|
+
};
|
|
147
168
|
const Embed = ({ name, children }) => {
|
|
148
169
|
const editingRuntime = useBlockEditingRuntime();
|
|
149
170
|
if (editingRuntime) return editingRuntime.renderPrimitive(options, "Embed", {
|
|
@@ -154,6 +175,85 @@ function createViewBlock(options) {
|
|
|
154
175
|
const value = typeof rawValue === "string" ? rawValue : "";
|
|
155
176
|
return children({ src: value }, { url: value });
|
|
156
177
|
};
|
|
178
|
+
const Artifact = ({ name, children }) => {
|
|
179
|
+
const editingRuntime = useBlockEditingRuntime();
|
|
180
|
+
if (editingRuntime) return editingRuntime.renderPrimitive(options, "Artifact", {
|
|
181
|
+
name,
|
|
182
|
+
children
|
|
183
|
+
});
|
|
184
|
+
const value = useValue(name);
|
|
185
|
+
const data = useArtifactData(name);
|
|
186
|
+
const hostProps = useArtifactHost({
|
|
187
|
+
studio: React.use(ArtifactStudioContext),
|
|
188
|
+
data,
|
|
189
|
+
size: useFieldSchema(name)?.size,
|
|
190
|
+
navigate: useNavigate()
|
|
191
|
+
});
|
|
192
|
+
const initialData = useInitialArtifactData(value, data);
|
|
193
|
+
const fontLinks = useOptionalCamoxApp()?.getArtifactFontLinks();
|
|
194
|
+
const runs = React.use(ArtifactsRunContext);
|
|
195
|
+
if (!isArtifactSource(value)) return null;
|
|
196
|
+
return children({
|
|
197
|
+
...runs ? artifactFrameProps(value, {
|
|
198
|
+
fontLinks,
|
|
199
|
+
data: initialData
|
|
200
|
+
}) : artifactStandInProps(value),
|
|
201
|
+
...hostProps
|
|
202
|
+
});
|
|
203
|
+
};
|
|
204
|
+
function useArtifactData(name) {
|
|
205
|
+
const $ = c(13);
|
|
206
|
+
const block = React.use(Context);
|
|
207
|
+
const item = React.use(RepeaterContext);
|
|
208
|
+
const { filesMap } = useNormalizedData();
|
|
209
|
+
const pages = useLinkPages(useProjectUuid());
|
|
210
|
+
let t0;
|
|
211
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
212
|
+
t0 = { select: _temp2 };
|
|
213
|
+
$[0] = t0;
|
|
214
|
+
} else t0 = $[0];
|
|
215
|
+
const pathname = useLocation(t0);
|
|
216
|
+
if (!block) throw new Error("Artifact must be used within a Block Component");
|
|
217
|
+
const field = item ? item.itemSchema?.[name] : typeboxSchema.properties[name];
|
|
218
|
+
let t1;
|
|
219
|
+
if ($[1] !== block || $[2] !== field || $[3] !== filesMap || $[4] !== item || $[5] !== pages || $[6] !== pathname) {
|
|
220
|
+
const owner = item ? {
|
|
221
|
+
content: item.itemContent,
|
|
222
|
+
settings: item.itemSettings
|
|
223
|
+
} : {
|
|
224
|
+
content: block.content,
|
|
225
|
+
settings: block.settings
|
|
226
|
+
};
|
|
227
|
+
let t2;
|
|
228
|
+
if ($[8] !== pages || $[9] !== pathname) {
|
|
229
|
+
t2 = (link) => resolveLinkHref(normalizeLinkValue(link), pages, pathname) ?? pathname;
|
|
230
|
+
$[8] = pages;
|
|
231
|
+
$[9] = pathname;
|
|
232
|
+
$[10] = t2;
|
|
233
|
+
} else t2 = $[10];
|
|
234
|
+
let t3;
|
|
235
|
+
if ($[11] !== filesMap) {
|
|
236
|
+
t3 = (value) => resolveAssetValue(value, filesMap);
|
|
237
|
+
$[11] = filesMap;
|
|
238
|
+
$[12] = t3;
|
|
239
|
+
} else t3 = $[12];
|
|
240
|
+
t1 = artifactData(field, owner, {
|
|
241
|
+
linkHref: t2,
|
|
242
|
+
asset: t3
|
|
243
|
+
});
|
|
244
|
+
$[1] = block;
|
|
245
|
+
$[2] = field;
|
|
246
|
+
$[3] = filesMap;
|
|
247
|
+
$[4] = item;
|
|
248
|
+
$[5] = pages;
|
|
249
|
+
$[6] = pathname;
|
|
250
|
+
$[7] = t1;
|
|
251
|
+
} else t1 = $[7];
|
|
252
|
+
return t1;
|
|
253
|
+
}
|
|
254
|
+
function _temp2(location) {
|
|
255
|
+
return location.pathname;
|
|
256
|
+
}
|
|
157
257
|
const Link = ({ name, children }) => {
|
|
158
258
|
const editingRuntime = useBlockEditingRuntime();
|
|
159
259
|
if (editingRuntime) return editingRuntime.renderPrimitive(options, "Link", {
|
|
@@ -161,13 +261,8 @@ function createViewBlock(options) {
|
|
|
161
261
|
children
|
|
162
262
|
});
|
|
163
263
|
const value = normalizeLinkValue(useValue(name) ?? {});
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
const { data: pages } = useQuery({
|
|
167
|
-
...viewPageQueries.list(project?.id ?? 0),
|
|
168
|
-
enabled: !!project
|
|
169
|
-
});
|
|
170
|
-
const href = resolveLinkHref(value, pages, useLocation({ select: (location) => location.pathname }));
|
|
264
|
+
const href = resolveLinkHref(value, useLinkPages(useProjectUuid()), useLocation({ select: (location) => location.pathname }));
|
|
265
|
+
if (href == null) return value.text;
|
|
171
266
|
return children({
|
|
172
267
|
to: href,
|
|
173
268
|
target: value.newTab ? "_blank" : void 0,
|
|
@@ -180,23 +275,19 @@ function createViewBlock(options) {
|
|
|
180
275
|
});
|
|
181
276
|
};
|
|
182
277
|
function useAsset(name) {
|
|
183
|
-
const $ = c(
|
|
184
|
-
if ($[0] !== "2482501ae16e686c6c2d84727ab607bf02513a6bcdd7de7e2f7f973cc1690267") {
|
|
185
|
-
for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
186
|
-
$[0] = "2482501ae16e686c6c2d84727ab607bf02513a6bcdd7de7e2f7f973cc1690267";
|
|
187
|
-
}
|
|
278
|
+
const $ = c(3);
|
|
188
279
|
const block = React.use(Context);
|
|
189
280
|
const item = React.use(RepeaterContext);
|
|
190
281
|
const { filesMap } = useNormalizedData();
|
|
191
282
|
if (!block) throw new Error("Asset must be used within a Block Component");
|
|
192
283
|
const raw = item ? item.itemContent[name] : block.content[name];
|
|
193
284
|
let t0;
|
|
194
|
-
if ($[
|
|
195
|
-
t0 =
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
199
|
-
} else t0 = $[
|
|
285
|
+
if ($[0] !== filesMap || $[1] !== raw) {
|
|
286
|
+
t0 = resolveAssetValue(raw, filesMap);
|
|
287
|
+
$[0] = filesMap;
|
|
288
|
+
$[1] = raw;
|
|
289
|
+
$[2] = t0;
|
|
290
|
+
} else t0 = $[2];
|
|
200
291
|
const resolved = t0;
|
|
201
292
|
const fallback = item ? repeatableDefaults[item.arrayFieldName]?.[String(name)] : contentDefaults[String(name)];
|
|
202
293
|
return resolved ?? fallback;
|
|
@@ -208,7 +299,7 @@ function createViewBlock(options) {
|
|
|
208
299
|
children
|
|
209
300
|
});
|
|
210
301
|
const value = useAsset(name);
|
|
211
|
-
return children({
|
|
302
|
+
return renderImagePlaceholder(value, children({
|
|
212
303
|
src: transformImageUrl(value.url, {
|
|
213
304
|
width: getDefaultImageWidth(),
|
|
214
305
|
mimeType: value.mimeType,
|
|
@@ -217,7 +308,7 @@ function createViewBlock(options) {
|
|
|
217
308
|
srcSet: buildImageSrcSet(value.url, value.mimeType, value.size),
|
|
218
309
|
sizes: getDefaultImageSizes(),
|
|
219
310
|
alt: value.alt
|
|
220
|
-
}, value);
|
|
311
|
+
}, value));
|
|
221
312
|
};
|
|
222
313
|
const File = ({ name, children }) => {
|
|
223
314
|
const editingRuntime = useBlockEditingRuntime();
|
|
@@ -231,6 +322,172 @@ function createViewBlock(options) {
|
|
|
231
322
|
download: value.filename
|
|
232
323
|
}, value);
|
|
233
324
|
};
|
|
325
|
+
const ReferencePrimitive = (t0) => {
|
|
326
|
+
const $ = c(6);
|
|
327
|
+
let Primitive;
|
|
328
|
+
let props;
|
|
329
|
+
if ($[0] !== t0) {
|
|
330
|
+
({primitive: Primitive, ...props} = t0);
|
|
331
|
+
$[0] = t0;
|
|
332
|
+
$[1] = Primitive;
|
|
333
|
+
$[2] = props;
|
|
334
|
+
} else {
|
|
335
|
+
Primitive = $[1];
|
|
336
|
+
props = $[2];
|
|
337
|
+
}
|
|
338
|
+
if (useValue(props.name) == null) return null;
|
|
339
|
+
let t1;
|
|
340
|
+
if ($[3] !== Primitive || $[4] !== props) {
|
|
341
|
+
t1 = /* @__PURE__ */ jsx(Primitive, { ...props });
|
|
342
|
+
$[3] = Primitive;
|
|
343
|
+
$[4] = props;
|
|
344
|
+
$[5] = t1;
|
|
345
|
+
} else t1 = $[5];
|
|
346
|
+
return t1;
|
|
347
|
+
};
|
|
348
|
+
const ReferenceImage = (props) => {
|
|
349
|
+
const $ = c(2);
|
|
350
|
+
let t0;
|
|
351
|
+
if ($[0] !== props) {
|
|
352
|
+
t0 = /* @__PURE__ */ jsx(ReferencePrimitive, {
|
|
353
|
+
primitive: Image,
|
|
354
|
+
...props
|
|
355
|
+
});
|
|
356
|
+
$[0] = props;
|
|
357
|
+
$[1] = t0;
|
|
358
|
+
} else t0 = $[1];
|
|
359
|
+
return t0;
|
|
360
|
+
};
|
|
361
|
+
const ReferenceFile = (props) => {
|
|
362
|
+
const $ = c(2);
|
|
363
|
+
let t0;
|
|
364
|
+
if ($[0] !== props) {
|
|
365
|
+
t0 = /* @__PURE__ */ jsx(ReferencePrimitive, {
|
|
366
|
+
primitive: File,
|
|
367
|
+
...props
|
|
368
|
+
});
|
|
369
|
+
$[0] = props;
|
|
370
|
+
$[1] = t0;
|
|
371
|
+
} else t0 = $[1];
|
|
372
|
+
return t0;
|
|
373
|
+
};
|
|
374
|
+
const ReferenceEmbed = (props) => {
|
|
375
|
+
const $ = c(2);
|
|
376
|
+
let t0;
|
|
377
|
+
if ($[0] !== props) {
|
|
378
|
+
t0 = /* @__PURE__ */ jsx(ReferencePrimitive, {
|
|
379
|
+
primitive: Embed,
|
|
380
|
+
...props
|
|
381
|
+
});
|
|
382
|
+
$[0] = props;
|
|
383
|
+
$[1] = t0;
|
|
384
|
+
} else t0 = $[1];
|
|
385
|
+
return t0;
|
|
386
|
+
};
|
|
387
|
+
function useFieldSchema(name) {
|
|
388
|
+
const block = React.use(Context);
|
|
389
|
+
const item = React.use(RepeaterContext);
|
|
390
|
+
if (item) return item.itemSchema?.[name];
|
|
391
|
+
return (block?.sourceSchema ?? typeboxSchema.properties)[name];
|
|
392
|
+
}
|
|
393
|
+
const Reference = ({ name, children }) => {
|
|
394
|
+
const editingRuntime = useBlockEditingRuntime();
|
|
395
|
+
if (editingRuntime) return editingRuntime.renderPrimitive(options, "Reference", {
|
|
396
|
+
name,
|
|
397
|
+
children
|
|
398
|
+
});
|
|
399
|
+
const block = React.use(Context);
|
|
400
|
+
const { recordsMap } = useNormalizedData();
|
|
401
|
+
if (!block) throw new Error("Reference must be used within a Block Component");
|
|
402
|
+
const schema = useFieldSchema(name);
|
|
403
|
+
const record = resolveReference(useValue(name), schema.collectionId, recordsMap);
|
|
404
|
+
if (!record) return null;
|
|
405
|
+
return /* @__PURE__ */ jsx(RecordScope, {
|
|
406
|
+
block,
|
|
407
|
+
schema,
|
|
408
|
+
record,
|
|
409
|
+
children
|
|
410
|
+
});
|
|
411
|
+
};
|
|
412
|
+
const ReferenceList = ({ name, children }) => {
|
|
413
|
+
const editingRuntime = useBlockEditingRuntime();
|
|
414
|
+
if (editingRuntime) return editingRuntime.renderPrimitive(options, "ReferenceList", {
|
|
415
|
+
name,
|
|
416
|
+
children
|
|
417
|
+
});
|
|
418
|
+
const block = React.use(Context);
|
|
419
|
+
const item = React.use(RepeaterContext);
|
|
420
|
+
const normalizedData = useNormalizedData();
|
|
421
|
+
if (!block) throw new Error("ReferenceList must be used within a Block Component");
|
|
422
|
+
const schema = useFieldSchema(name);
|
|
423
|
+
const stored = useValue(name);
|
|
424
|
+
const ids = isQueryBacked(schema) ? queryResultIds(normalizedData, {
|
|
425
|
+
blockId: block.blockId,
|
|
426
|
+
itemId: item?.itemId
|
|
427
|
+
}, name) : stored;
|
|
428
|
+
const { recordsMap } = normalizedData;
|
|
429
|
+
return resolveReferenceList(ids, schema.collectionId, recordsMap).map((record) => /* @__PURE__ */ jsx(RecordScope, {
|
|
430
|
+
block,
|
|
431
|
+
schema,
|
|
432
|
+
record,
|
|
433
|
+
children
|
|
434
|
+
}, record.id));
|
|
435
|
+
};
|
|
436
|
+
const RecordScope = (t0) => {
|
|
437
|
+
const $ = c(13);
|
|
438
|
+
const { block, schema, record, children } = t0;
|
|
439
|
+
const hop = block.recordHop ? 2 : 1;
|
|
440
|
+
let t1;
|
|
441
|
+
if ($[0] !== block || $[1] !== hop || $[2] !== record.content || $[3] !== schema.referenceSchema.properties) {
|
|
442
|
+
t1 = {
|
|
443
|
+
...block,
|
|
444
|
+
content: record.content,
|
|
445
|
+
sourceSchema: schema.referenceSchema.properties,
|
|
446
|
+
recordHop: hop
|
|
447
|
+
};
|
|
448
|
+
$[0] = block;
|
|
449
|
+
$[1] = hop;
|
|
450
|
+
$[2] = record.content;
|
|
451
|
+
$[3] = schema.referenceSchema.properties;
|
|
452
|
+
$[4] = t1;
|
|
453
|
+
} else t1 = $[4];
|
|
454
|
+
let t2;
|
|
455
|
+
if ($[5] !== children || $[6] !== hop || $[7] !== record.id || $[8] !== record.label) {
|
|
456
|
+
t2 = children({
|
|
457
|
+
id: record.id,
|
|
458
|
+
label: record.label,
|
|
459
|
+
Field,
|
|
460
|
+
Image: ReferenceImage,
|
|
461
|
+
File: ReferenceFile,
|
|
462
|
+
Embed: ReferenceEmbed,
|
|
463
|
+
ImageList,
|
|
464
|
+
FileList,
|
|
465
|
+
...hop === 1 ? {
|
|
466
|
+
Reference,
|
|
467
|
+
ReferenceList
|
|
468
|
+
} : {}
|
|
469
|
+
});
|
|
470
|
+
$[5] = children;
|
|
471
|
+
$[6] = hop;
|
|
472
|
+
$[7] = record.id;
|
|
473
|
+
$[8] = record.label;
|
|
474
|
+
$[9] = t2;
|
|
475
|
+
} else t2 = $[9];
|
|
476
|
+
let t3;
|
|
477
|
+
if ($[10] !== t1 || $[11] !== t2) {
|
|
478
|
+
t3 = /* @__PURE__ */ jsx(RepeaterContext.Provider, {
|
|
479
|
+
value: null,
|
|
480
|
+
children: /* @__PURE__ */ jsx(Context.Provider, {
|
|
481
|
+
value: t1,
|
|
482
|
+
children: t2
|
|
483
|
+
})
|
|
484
|
+
});
|
|
485
|
+
$[10] = t1;
|
|
486
|
+
$[11] = t2;
|
|
487
|
+
$[12] = t3;
|
|
488
|
+
} else t3 = $[12];
|
|
489
|
+
return t3;
|
|
490
|
+
};
|
|
234
491
|
const AssetList = ({ name, children, primitive }) => {
|
|
235
492
|
const editingRuntime = useBlockEditingRuntime();
|
|
236
493
|
if (editingRuntime) return editingRuntime.renderPrimitive(options, primitive, {
|
|
@@ -242,18 +499,18 @@ function createViewBlock(options) {
|
|
|
242
499
|
const { filesMap } = useNormalizedData();
|
|
243
500
|
if (!block) throw new Error("ImageList/FileList must be used within a Block Component");
|
|
244
501
|
const fieldName = String(name);
|
|
245
|
-
const schema = parent ? typeboxSchema.properties[parent.arrayFieldName]?.items?.properties?.[fieldName] : typeboxSchema.properties[fieldName];
|
|
502
|
+
const schema = parent ? typeboxSchema.properties[parent.arrayFieldName]?.items?.properties?.[fieldName] : (block.sourceSchema ?? typeboxSchema.properties)[fieldName];
|
|
246
503
|
const fieldType = schema?.fieldType;
|
|
247
|
-
if (fieldType !== "ImageList" && fieldType !== "FileList") throw new Error(`"${fieldName}" is not
|
|
504
|
+
if (fieldType !== "ImageList" && fieldType !== "FileList") throw new Error(`"${fieldName}" is not an imageList or fileList field`);
|
|
248
505
|
const source = parent ? parent.itemContent[fieldName] : block.content[fieldName];
|
|
249
506
|
let values = Array.isArray(source) ? source : [];
|
|
250
507
|
if (values.length === 0 && schema.defaultItems > 0 && schema.items?.default) values = Array.from({ length: schema.defaultItems }, () => schema.items.default);
|
|
251
508
|
const Single = fieldType === "ImageList" ? Image : File;
|
|
252
|
-
return values.map((value) =>
|
|
509
|
+
return values.map((value) => resolveAssetValue(value, filesMap)).filter(Boolean).map((value, index) => /* @__PURE__ */ jsx(RepeaterContext.Provider, {
|
|
253
510
|
value: {
|
|
254
511
|
arrayFieldName: fieldName,
|
|
255
512
|
containerItemId: parent?.itemId ?? parent?.containerItemId,
|
|
256
|
-
itemContent: { [ASSET_LIST_SELF_KEY]:
|
|
513
|
+
itemContent: { [ASSET_LIST_SELF_KEY]: value },
|
|
257
514
|
itemSettings: {}
|
|
258
515
|
},
|
|
259
516
|
children: /* @__PURE__ */ jsx(Single, {
|
|
@@ -263,37 +520,29 @@ function createViewBlock(options) {
|
|
|
263
520
|
}, index));
|
|
264
521
|
};
|
|
265
522
|
const ImageList = (props) => {
|
|
266
|
-
const $ = c(
|
|
267
|
-
if ($[0] !== "2482501ae16e686c6c2d84727ab607bf02513a6bcdd7de7e2f7f973cc1690267") {
|
|
268
|
-
for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
269
|
-
$[0] = "2482501ae16e686c6c2d84727ab607bf02513a6bcdd7de7e2f7f973cc1690267";
|
|
270
|
-
}
|
|
523
|
+
const $ = c(2);
|
|
271
524
|
let t0;
|
|
272
|
-
if ($[
|
|
525
|
+
if ($[0] !== props) {
|
|
273
526
|
t0 = /* @__PURE__ */ jsx(AssetList, {
|
|
274
527
|
...props,
|
|
275
528
|
primitive: "ImageList"
|
|
276
529
|
});
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
} else t0 = $[
|
|
530
|
+
$[0] = props;
|
|
531
|
+
$[1] = t0;
|
|
532
|
+
} else t0 = $[1];
|
|
280
533
|
return t0;
|
|
281
534
|
};
|
|
282
535
|
const FileList = (props) => {
|
|
283
|
-
const $ = c(
|
|
284
|
-
if ($[0] !== "2482501ae16e686c6c2d84727ab607bf02513a6bcdd7de7e2f7f973cc1690267") {
|
|
285
|
-
for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
286
|
-
$[0] = "2482501ae16e686c6c2d84727ab607bf02513a6bcdd7de7e2f7f973cc1690267";
|
|
287
|
-
}
|
|
536
|
+
const $ = c(2);
|
|
288
537
|
let t0;
|
|
289
|
-
if ($[
|
|
538
|
+
if ($[0] !== props) {
|
|
290
539
|
t0 = /* @__PURE__ */ jsx(AssetList, {
|
|
291
540
|
...props,
|
|
292
541
|
primitive: "FileList"
|
|
293
542
|
});
|
|
294
|
-
$[
|
|
295
|
-
$[
|
|
296
|
-
} else t0 = $[
|
|
543
|
+
$[0] = props;
|
|
544
|
+
$[1] = t0;
|
|
545
|
+
} else t0 = $[1];
|
|
297
546
|
return t0;
|
|
298
547
|
};
|
|
299
548
|
const Repeater = ({ name, children }) => {
|
|
@@ -309,26 +558,31 @@ function createViewBlock(options) {
|
|
|
309
558
|
const fieldName = String(name);
|
|
310
559
|
const source = parent ? parent.itemContent[fieldName] : block.content[fieldName];
|
|
311
560
|
if (!Array.isArray(source)) throw new Error(`Field "${fieldName}" is not an array`);
|
|
312
|
-
|
|
313
|
-
|
|
561
|
+
const itemSchema = (parent ? parent.itemSchema?.[fieldName] : typeboxSchema.properties[fieldName])?.items?.properties;
|
|
562
|
+
return source.map((item) => isItemMarker(item) ? itemsMap.get(item._itemId) ?? null : item).filter(Boolean).map((item, index) => {
|
|
563
|
+
const databaseItem = item.content !== void 0 && item.id != null;
|
|
314
564
|
const itemContent = {
|
|
315
565
|
...repeatableDefaults[fieldName],
|
|
316
|
-
...databaseItem ?
|
|
566
|
+
...databaseItem ? item.content : item
|
|
317
567
|
};
|
|
318
568
|
const itemSettings = {
|
|
319
569
|
...repeatableSettingsDefaults[fieldName],
|
|
320
|
-
...databaseItem ?
|
|
570
|
+
...databaseItem ? item.settings : null
|
|
321
571
|
};
|
|
322
|
-
const itemId = databaseItem ?
|
|
572
|
+
const itemId = databaseItem ? item.id : void 0;
|
|
323
573
|
const api = {
|
|
324
574
|
Field,
|
|
575
|
+
Icon,
|
|
325
576
|
Link,
|
|
326
577
|
Embed,
|
|
578
|
+
Artifact,
|
|
327
579
|
Image,
|
|
328
580
|
File,
|
|
329
581
|
ImageList,
|
|
330
582
|
FileList,
|
|
331
583
|
Repeater,
|
|
584
|
+
Reference,
|
|
585
|
+
ReferenceList,
|
|
332
586
|
useSetting: (settingName) => itemSettings[settingName]
|
|
333
587
|
};
|
|
334
588
|
return /* @__PURE__ */ jsx(RepeaterContext.Provider, {
|
|
@@ -337,7 +591,8 @@ function createViewBlock(options) {
|
|
|
337
591
|
containerItemId: itemId ?? parent?.containerItemId,
|
|
338
592
|
itemContent,
|
|
339
593
|
itemId,
|
|
340
|
-
itemSettings
|
|
594
|
+
itemSettings,
|
|
595
|
+
itemSchema
|
|
341
596
|
},
|
|
342
597
|
children: children(api, index)
|
|
343
598
|
}, itemId ?? index);
|
|
@@ -351,149 +606,137 @@ function createViewBlock(options) {
|
|
|
351
606
|
return context.settings[name];
|
|
352
607
|
};
|
|
353
608
|
const Detached = (t0) => {
|
|
354
|
-
const $ = c(
|
|
355
|
-
if ($[0] !== "2482501ae16e686c6c2d84727ab607bf02513a6bcdd7de7e2f7f973cc1690267") {
|
|
356
|
-
for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
357
|
-
$[0] = "2482501ae16e686c6c2d84727ab607bf02513a6bcdd7de7e2f7f973cc1690267";
|
|
358
|
-
}
|
|
609
|
+
const $ = c(5);
|
|
359
610
|
const { children } = t0;
|
|
360
611
|
const editingRuntime = useBlockEditingRuntime();
|
|
361
612
|
if (editingRuntime) {
|
|
362
613
|
let t1;
|
|
363
|
-
if ($[
|
|
614
|
+
if ($[0] !== children || $[1] !== editingRuntime) {
|
|
364
615
|
t1 = editingRuntime.renderPrimitive(options, "Detached", { children });
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
$[
|
|
368
|
-
} else t1 = $[
|
|
616
|
+
$[0] = children;
|
|
617
|
+
$[1] = editingRuntime;
|
|
618
|
+
$[2] = t1;
|
|
619
|
+
} else t1 = $[2];
|
|
369
620
|
return t1;
|
|
370
621
|
}
|
|
371
622
|
let t1;
|
|
372
|
-
if ($[
|
|
623
|
+
if ($[3] !== children) {
|
|
373
624
|
t1 = children({
|
|
374
|
-
ref:
|
|
625
|
+
ref: _temp4,
|
|
375
626
|
style: { opacity: 1 },
|
|
376
|
-
onClick:
|
|
377
|
-
onMouseEnter:
|
|
378
|
-
onMouseLeave:
|
|
627
|
+
onClick: _temp5,
|
|
628
|
+
onMouseEnter: _temp6,
|
|
629
|
+
onMouseLeave: _temp7
|
|
379
630
|
});
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
} else t1 = $[
|
|
631
|
+
$[3] = children;
|
|
632
|
+
$[4] = t1;
|
|
633
|
+
} else t1 = $[4];
|
|
383
634
|
return t1;
|
|
384
635
|
};
|
|
385
636
|
const Component = (props) => {
|
|
386
|
-
const $ = c(
|
|
387
|
-
if ($[0] !== "2482501ae16e686c6c2d84727ab607bf02513a6bcdd7de7e2f7f973cc1690267") {
|
|
388
|
-
for (let $i = 0; $i < 23; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
389
|
-
$[0] = "2482501ae16e686c6c2d84727ab607bf02513a6bcdd7de7e2f7f973cc1690267";
|
|
390
|
-
}
|
|
637
|
+
const $ = c(22);
|
|
391
638
|
const editingRuntime = useBlockEditingRuntime();
|
|
392
639
|
if (editingRuntime) {
|
|
393
640
|
let t0;
|
|
394
|
-
if ($[
|
|
641
|
+
if ($[0] !== editingRuntime || $[1] !== props) {
|
|
395
642
|
t0 = editingRuntime.renderBlock(options, props);
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
399
|
-
} else t0 = $[
|
|
643
|
+
$[0] = editingRuntime;
|
|
644
|
+
$[1] = props;
|
|
645
|
+
$[2] = t0;
|
|
646
|
+
} else t0 = $[2];
|
|
400
647
|
return t0;
|
|
401
648
|
}
|
|
402
649
|
const { blockData, mode } = props;
|
|
403
650
|
let mergedContent;
|
|
404
651
|
let normalizedContent;
|
|
405
|
-
if ($[
|
|
652
|
+
if ($[3] !== blockData.content) {
|
|
406
653
|
mergedContent = {
|
|
407
654
|
...contentDefaults,
|
|
408
655
|
...blockData.content
|
|
409
656
|
};
|
|
410
657
|
normalizedContent = { ...mergedContent };
|
|
411
|
-
for (const [key, value] of Object.entries(normalizedContent)) if (Array.isArray(value) && value[0]?.content !== void 0) normalizedContent[key] = value.map(
|
|
412
|
-
$[
|
|
413
|
-
$[
|
|
414
|
-
$[
|
|
658
|
+
for (const [key, value] of Object.entries(normalizedContent)) if (Array.isArray(value) && value[0]?.content !== void 0) normalizedContent[key] = value.map(_temp8);
|
|
659
|
+
$[3] = blockData.content;
|
|
660
|
+
$[4] = mergedContent;
|
|
661
|
+
$[5] = normalizedContent;
|
|
415
662
|
} else {
|
|
416
|
-
mergedContent = $[
|
|
417
|
-
normalizedContent = $[
|
|
663
|
+
mergedContent = $[4];
|
|
664
|
+
normalizedContent = $[5];
|
|
418
665
|
}
|
|
419
666
|
const AuthoredComponent = options.component;
|
|
420
667
|
let t0;
|
|
421
|
-
if ($[
|
|
668
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
422
669
|
t0 = {
|
|
423
670
|
position: "relative",
|
|
424
|
-
scrollMargin: "5rem"
|
|
425
|
-
background: "var(--background)"
|
|
671
|
+
scrollMargin: "5rem"
|
|
426
672
|
};
|
|
427
|
-
$[
|
|
428
|
-
} else t0 = $[
|
|
673
|
+
$[6] = t0;
|
|
674
|
+
} else t0 = $[6];
|
|
429
675
|
let t1;
|
|
430
|
-
if ($[
|
|
676
|
+
if ($[7] !== blockData.settings) {
|
|
431
677
|
t1 = {
|
|
432
678
|
...settingsDefaults,
|
|
433
679
|
...blockData.settings
|
|
434
680
|
};
|
|
435
|
-
$[
|
|
436
|
-
$[
|
|
437
|
-
} else t1 = $[
|
|
681
|
+
$[7] = blockData.settings;
|
|
682
|
+
$[8] = t1;
|
|
683
|
+
} else t1 = $[8];
|
|
438
684
|
let t2;
|
|
439
|
-
if ($[
|
|
685
|
+
if ($[9] !== blockData._id || $[10] !== mergedContent || $[11] !== mode || $[12] !== t1) {
|
|
440
686
|
t2 = {
|
|
441
687
|
blockId: blockData._id,
|
|
442
688
|
content: mergedContent,
|
|
443
689
|
settings: t1,
|
|
444
690
|
mode
|
|
445
691
|
};
|
|
446
|
-
$[
|
|
447
|
-
$[
|
|
448
|
-
$[
|
|
449
|
-
$[
|
|
450
|
-
$[
|
|
451
|
-
} else t2 = $[
|
|
692
|
+
$[9] = blockData._id;
|
|
693
|
+
$[10] = mergedContent;
|
|
694
|
+
$[11] = mode;
|
|
695
|
+
$[12] = t1;
|
|
696
|
+
$[13] = t2;
|
|
697
|
+
} else t2 = $[13];
|
|
452
698
|
let t3;
|
|
453
|
-
if ($[
|
|
699
|
+
if ($[14] !== normalizedContent) {
|
|
454
700
|
t3 = /* @__PURE__ */ jsx(AuthoredComponent, { content: normalizedContent });
|
|
455
|
-
$[
|
|
456
|
-
$[
|
|
457
|
-
} else t3 = $[
|
|
701
|
+
$[14] = normalizedContent;
|
|
702
|
+
$[15] = t3;
|
|
703
|
+
} else t3 = $[15];
|
|
458
704
|
let t4;
|
|
459
|
-
if ($[
|
|
705
|
+
if ($[16] !== t2 || $[17] !== t3) {
|
|
460
706
|
t4 = /* @__PURE__ */ jsx(Context.Provider, {
|
|
461
707
|
value: t2,
|
|
462
708
|
children: t3
|
|
463
709
|
});
|
|
464
|
-
$[
|
|
465
|
-
$[
|
|
466
|
-
$[
|
|
467
|
-
} else t4 = $[
|
|
710
|
+
$[16] = t2;
|
|
711
|
+
$[17] = t3;
|
|
712
|
+
$[18] = t4;
|
|
713
|
+
} else t4 = $[18];
|
|
468
714
|
let t5;
|
|
469
|
-
if ($[20]
|
|
470
|
-
t5 = /* @__PURE__ */ jsx("div", {
|
|
471
|
-
$[20] = t5;
|
|
472
|
-
} else t5 = $[20];
|
|
473
|
-
let t6;
|
|
474
|
-
if ($[21] !== t4) {
|
|
475
|
-
t6 = /* @__PURE__ */ jsxs("div", {
|
|
715
|
+
if ($[19] !== blockData._id || $[20] !== t4) {
|
|
716
|
+
t5 = /* @__PURE__ */ jsx("div", {
|
|
476
717
|
className: "group visual-editing-block",
|
|
718
|
+
"data-camox-viewport-block": blockData._id,
|
|
477
719
|
style: t0,
|
|
478
|
-
children:
|
|
720
|
+
children: t4
|
|
479
721
|
});
|
|
480
|
-
$[
|
|
481
|
-
$[
|
|
482
|
-
|
|
483
|
-
|
|
722
|
+
$[19] = blockData._id;
|
|
723
|
+
$[20] = t4;
|
|
724
|
+
$[21] = t5;
|
|
725
|
+
} else t5 = $[21];
|
|
726
|
+
return t5;
|
|
484
727
|
};
|
|
485
728
|
const contentSchema = {
|
|
486
729
|
type: "object",
|
|
487
730
|
title: options.title,
|
|
488
731
|
description: options.description,
|
|
489
732
|
properties: typeboxSchema.properties,
|
|
490
|
-
required: Object.keys(
|
|
491
|
-
toMarkdown: resolveToMarkdown(options.toMarkdown,
|
|
733
|
+
required: Object.keys(fields.content),
|
|
734
|
+
toMarkdown: resolveToMarkdown(options.toMarkdown, fields.settings, "block", fields.content)
|
|
492
735
|
};
|
|
493
736
|
const settingsSchema = settingsTypeboxSchema ? {
|
|
494
737
|
type: "object",
|
|
495
738
|
properties: settingsTypeboxSchema.properties,
|
|
496
|
-
required: Object.keys(
|
|
739
|
+
required: Object.keys(fields.settings ?? {})
|
|
497
740
|
} : void 0;
|
|
498
741
|
const getInitialBundle = () => {
|
|
499
742
|
const content = { ...contentDefaults };
|
|
@@ -518,14 +761,18 @@ function createViewBlock(options) {
|
|
|
518
761
|
};
|
|
519
762
|
return {
|
|
520
763
|
Detached,
|
|
764
|
+
Icon,
|
|
521
765
|
Field,
|
|
522
766
|
Embed,
|
|
767
|
+
Artifact,
|
|
523
768
|
Link,
|
|
524
769
|
Image,
|
|
525
770
|
File,
|
|
526
771
|
ImageList,
|
|
527
772
|
FileList,
|
|
528
773
|
Repeater,
|
|
774
|
+
Reference,
|
|
775
|
+
ReferenceList,
|
|
529
776
|
useSetting,
|
|
530
777
|
_internal: {
|
|
531
778
|
Component,
|
|
@@ -552,16 +799,16 @@ function createViewBlock(options) {
|
|
|
552
799
|
getPeekBundle: () => {
|
|
553
800
|
const content = { ...contentDefaults };
|
|
554
801
|
const repeatableItems = [];
|
|
555
|
-
buildPeekItems(typeboxSchema.properties,
|
|
802
|
+
buildPeekItems(typeboxSchema.properties, "peek", null, content, repeatableItems, { value: 0 });
|
|
556
803
|
return {
|
|
557
804
|
block: {
|
|
558
|
-
id:
|
|
805
|
+
id: "peek",
|
|
559
806
|
pageId: null,
|
|
560
807
|
layoutId: null,
|
|
561
808
|
type: options.id,
|
|
562
809
|
content,
|
|
563
810
|
settings: settingsDefaults,
|
|
564
|
-
|
|
811
|
+
slot: null,
|
|
565
812
|
summary: "",
|
|
566
813
|
position: "",
|
|
567
814
|
createdAt: 0,
|
|
@@ -575,13 +822,13 @@ function createViewBlock(options) {
|
|
|
575
822
|
};
|
|
576
823
|
}
|
|
577
824
|
const createBlock = createViewBlock;
|
|
578
|
-
function _temp() {}
|
|
579
|
-
function _temp2() {}
|
|
580
|
-
function _temp3() {}
|
|
581
825
|
function _temp4() {}
|
|
582
|
-
function _temp5(
|
|
826
|
+
function _temp5() {}
|
|
827
|
+
function _temp6() {}
|
|
828
|
+
function _temp7() {}
|
|
829
|
+
function _temp8(item) {
|
|
583
830
|
return item.content;
|
|
584
831
|
}
|
|
585
832
|
|
|
586
833
|
//#endregion
|
|
587
|
-
export {
|
|
834
|
+
export { createBlock };
|