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
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { reads, useStudioCache } from "../../../lib/studio-reads.js";
|
|
2
|
+
import { collectionMutations } from "../../../lib/queries.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { useMutation } from "@tanstack/react-query";
|
|
7
|
+
import { Button } from "@camox/ui/button";
|
|
8
|
+
import { Trash2Icon } from "lucide-react";
|
|
9
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@camox/ui/alert-dialog";
|
|
10
|
+
|
|
11
|
+
//#region src/features/content/components/DeleteCollectionItemButton.tsx
|
|
12
|
+
function DeleteCollectionItemButton(t0) {
|
|
13
|
+
const $ = c(48);
|
|
14
|
+
const { projectUuid, collectionId, id, label, compact: t1, disabled: t2, onDeleted } = t0;
|
|
15
|
+
const compact = t1 === void 0 ? false : t1;
|
|
16
|
+
const disabled = t2 === void 0 ? false : t2;
|
|
17
|
+
const studioCache = useStudioCache();
|
|
18
|
+
const [target, setTarget] = useState(null);
|
|
19
|
+
let t3;
|
|
20
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
21
|
+
t3 = collectionMutations.delete();
|
|
22
|
+
$[0] = t3;
|
|
23
|
+
} else t3 = $[0];
|
|
24
|
+
const deletion = useMutation(t3);
|
|
25
|
+
let t4;
|
|
26
|
+
if ($[1] !== collectionId || $[2] !== deletion || $[3] !== id || $[4] !== onDeleted || $[5] !== projectUuid || $[6] !== studioCache || $[7] !== target) {
|
|
27
|
+
t4 = async () => {
|
|
28
|
+
if (!target || deletion.isPending) return;
|
|
29
|
+
try {
|
|
30
|
+
await deletion.mutateAsync({
|
|
31
|
+
projectUuid,
|
|
32
|
+
collectionId,
|
|
33
|
+
id
|
|
34
|
+
});
|
|
35
|
+
} catch {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
setTarget(null);
|
|
39
|
+
await onDeleted?.();
|
|
40
|
+
studioCache.remove(reads.record({
|
|
41
|
+
projectUuid,
|
|
42
|
+
collectionId,
|
|
43
|
+
id
|
|
44
|
+
}));
|
|
45
|
+
await studioCache.invalidate(reads.records({
|
|
46
|
+
projectUuid,
|
|
47
|
+
collectionId
|
|
48
|
+
}));
|
|
49
|
+
};
|
|
50
|
+
$[1] = collectionId;
|
|
51
|
+
$[2] = deletion;
|
|
52
|
+
$[3] = id;
|
|
53
|
+
$[4] = onDeleted;
|
|
54
|
+
$[5] = projectUuid;
|
|
55
|
+
$[6] = studioCache;
|
|
56
|
+
$[7] = target;
|
|
57
|
+
$[8] = t4;
|
|
58
|
+
} else t4 = $[8];
|
|
59
|
+
const confirmDelete = t4;
|
|
60
|
+
const t5 = !!target;
|
|
61
|
+
let t6;
|
|
62
|
+
if ($[9] !== deletion || $[10] !== label) {
|
|
63
|
+
t6 = (open) => {
|
|
64
|
+
if (deletion.isPending) return;
|
|
65
|
+
deletion.reset();
|
|
66
|
+
setTarget(open ? { label: label || "Untitled item" } : null);
|
|
67
|
+
};
|
|
68
|
+
$[9] = deletion;
|
|
69
|
+
$[10] = label;
|
|
70
|
+
$[11] = t6;
|
|
71
|
+
} else t6 = $[11];
|
|
72
|
+
const t7 = compact ? "ghost" : "destructive";
|
|
73
|
+
const t8 = compact ? "icon-sm" : "default";
|
|
74
|
+
const t9 = compact ? `Delete ${label || "Untitled item"}` : void 0;
|
|
75
|
+
const t10 = compact ? "text-destructive mr-2 shrink-0 group-focus-within:opacity-100 group-hover:opacity-100 [@media(hover:hover)]:opacity-0" : "ml-auto";
|
|
76
|
+
let t11;
|
|
77
|
+
if ($[12] !== disabled || $[13] !== t10 || $[14] !== t7 || $[15] !== t8 || $[16] !== t9) {
|
|
78
|
+
t11 = /* @__PURE__ */ jsx(Button, {
|
|
79
|
+
type: "button",
|
|
80
|
+
variant: t7,
|
|
81
|
+
size: t8,
|
|
82
|
+
disabled,
|
|
83
|
+
"aria-label": t9,
|
|
84
|
+
className: t10
|
|
85
|
+
});
|
|
86
|
+
$[12] = disabled;
|
|
87
|
+
$[13] = t10;
|
|
88
|
+
$[14] = t7;
|
|
89
|
+
$[15] = t8;
|
|
90
|
+
$[16] = t9;
|
|
91
|
+
$[17] = t11;
|
|
92
|
+
} else t11 = $[17];
|
|
93
|
+
let t12;
|
|
94
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
95
|
+
t12 = /* @__PURE__ */ jsx(Trash2Icon, { "aria-hidden": true });
|
|
96
|
+
$[18] = t12;
|
|
97
|
+
} else t12 = $[18];
|
|
98
|
+
const t13 = !compact && "Delete item";
|
|
99
|
+
let t14;
|
|
100
|
+
if ($[19] !== t11 || $[20] !== t13) {
|
|
101
|
+
t14 = /* @__PURE__ */ jsxs(AlertDialogTrigger, {
|
|
102
|
+
render: t11,
|
|
103
|
+
children: [t12, t13]
|
|
104
|
+
});
|
|
105
|
+
$[19] = t11;
|
|
106
|
+
$[20] = t13;
|
|
107
|
+
$[21] = t14;
|
|
108
|
+
} else t14 = $[21];
|
|
109
|
+
let t15;
|
|
110
|
+
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
111
|
+
t15 = /* @__PURE__ */ jsx(AlertDialogTitle, { children: "Delete item?" });
|
|
112
|
+
$[22] = t15;
|
|
113
|
+
} else t15 = $[22];
|
|
114
|
+
const t16 = target?.label;
|
|
115
|
+
let t17;
|
|
116
|
+
if ($[23] !== t16) {
|
|
117
|
+
t17 = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [t15, /* @__PURE__ */ jsxs(AlertDialogDescription, { children: [
|
|
118
|
+
"Delete “",
|
|
119
|
+
t16,
|
|
120
|
+
"”? This cannot be undone. Media-library files will be kept."
|
|
121
|
+
] })] });
|
|
122
|
+
$[23] = t16;
|
|
123
|
+
$[24] = t17;
|
|
124
|
+
} else t17 = $[24];
|
|
125
|
+
let t18;
|
|
126
|
+
if ($[25] !== deletion.error || $[26] !== deletion.isError) {
|
|
127
|
+
t18 = deletion.isError && /* @__PURE__ */ jsx("p", {
|
|
128
|
+
role: "alert",
|
|
129
|
+
className: "text-destructive text-sm",
|
|
130
|
+
children: deletion.error.message
|
|
131
|
+
});
|
|
132
|
+
$[25] = deletion.error;
|
|
133
|
+
$[26] = deletion.isError;
|
|
134
|
+
$[27] = t18;
|
|
135
|
+
} else t18 = $[27];
|
|
136
|
+
let t19;
|
|
137
|
+
if ($[28] !== deletion.isPending) {
|
|
138
|
+
t19 = /* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
139
|
+
disabled: deletion.isPending,
|
|
140
|
+
children: "Cancel"
|
|
141
|
+
});
|
|
142
|
+
$[28] = deletion.isPending;
|
|
143
|
+
$[29] = t19;
|
|
144
|
+
} else t19 = $[29];
|
|
145
|
+
let t20;
|
|
146
|
+
if ($[30] !== confirmDelete) {
|
|
147
|
+
t20 = () => void confirmDelete();
|
|
148
|
+
$[30] = confirmDelete;
|
|
149
|
+
$[31] = t20;
|
|
150
|
+
} else t20 = $[31];
|
|
151
|
+
const t21 = deletion.isPending ? "Deleting…" : "Delete item";
|
|
152
|
+
let t22;
|
|
153
|
+
if ($[32] !== deletion.isPending || $[33] !== t20 || $[34] !== t21) {
|
|
154
|
+
t22 = /* @__PURE__ */ jsx(AlertDialogAction, {
|
|
155
|
+
type: "button",
|
|
156
|
+
variant: "destructive",
|
|
157
|
+
disabled: deletion.isPending,
|
|
158
|
+
onClick: t20,
|
|
159
|
+
children: t21
|
|
160
|
+
});
|
|
161
|
+
$[32] = deletion.isPending;
|
|
162
|
+
$[33] = t20;
|
|
163
|
+
$[34] = t21;
|
|
164
|
+
$[35] = t22;
|
|
165
|
+
} else t22 = $[35];
|
|
166
|
+
let t23;
|
|
167
|
+
if ($[36] !== t19 || $[37] !== t22) {
|
|
168
|
+
t23 = /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [t19, t22] });
|
|
169
|
+
$[36] = t19;
|
|
170
|
+
$[37] = t22;
|
|
171
|
+
$[38] = t23;
|
|
172
|
+
} else t23 = $[38];
|
|
173
|
+
let t24;
|
|
174
|
+
if ($[39] !== t17 || $[40] !== t18 || $[41] !== t23) {
|
|
175
|
+
t24 = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [
|
|
176
|
+
t17,
|
|
177
|
+
t18,
|
|
178
|
+
t23
|
|
179
|
+
] });
|
|
180
|
+
$[39] = t17;
|
|
181
|
+
$[40] = t18;
|
|
182
|
+
$[41] = t23;
|
|
183
|
+
$[42] = t24;
|
|
184
|
+
} else t24 = $[42];
|
|
185
|
+
let t25;
|
|
186
|
+
if ($[43] !== t14 || $[44] !== t24 || $[45] !== t5 || $[46] !== t6) {
|
|
187
|
+
t25 = /* @__PURE__ */ jsxs(AlertDialog, {
|
|
188
|
+
open: t5,
|
|
189
|
+
onOpenChange: t6,
|
|
190
|
+
children: [t14, t24]
|
|
191
|
+
});
|
|
192
|
+
$[43] = t14;
|
|
193
|
+
$[44] = t24;
|
|
194
|
+
$[45] = t5;
|
|
195
|
+
$[46] = t6;
|
|
196
|
+
$[47] = t25;
|
|
197
|
+
} else t25 = $[47];
|
|
198
|
+
return t25;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
//#endregion
|
|
202
|
+
export { DeleteCollectionItemButton };
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { useProjectUuid } from "../../../lib/auth.js";
|
|
2
|
+
import { useViewLocale } from "../../../lib/view-locale-context.js";
|
|
3
|
+
import { reads, useReadQuery, useStudioCache } from "../../../lib/studio-reads.js";
|
|
4
|
+
import { localeMutations } from "../../../lib/queries.js";
|
|
5
|
+
import { ContentSidebarGroup } from "./ContentSidebarGroup.js";
|
|
6
|
+
import { localeLabel } from "../../studio/localeOptions.js";
|
|
7
|
+
import { c } from "react/compiler-runtime";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { useMutation } from "@tanstack/react-query";
|
|
10
|
+
import { Button } from "@camox/ui/button";
|
|
11
|
+
import { Undo2Icon } from "lucide-react";
|
|
12
|
+
import { toast } from "@camox/ui/toaster";
|
|
13
|
+
|
|
14
|
+
//#region src/features/content/components/MissingFromLocale.tsx
|
|
15
|
+
/**
|
|
16
|
+
* The pages and collection records deleted from the language viewed, which Camox no longer
|
|
17
|
+
* translates into it, each with an action adding it back (GLOSSARY: Exclusion). Records show
|
|
18
|
+
* under their collection, while collections show. The default language misses nothing.
|
|
19
|
+
*/
|
|
20
|
+
const MissingFromLocaleGroup = (t0) => {
|
|
21
|
+
const $ = c(27);
|
|
22
|
+
const { collections } = t0;
|
|
23
|
+
const { locale } = useViewLocale();
|
|
24
|
+
const projectUuid = useProjectUuid();
|
|
25
|
+
let t1;
|
|
26
|
+
if ($[0] !== projectUuid) {
|
|
27
|
+
t1 = reads.project({ projectUuid });
|
|
28
|
+
$[0] = projectUuid;
|
|
29
|
+
$[1] = t1;
|
|
30
|
+
} else t1 = $[1];
|
|
31
|
+
const t2 = !!projectUuid && !locale.isDefault;
|
|
32
|
+
let t3;
|
|
33
|
+
if ($[2] !== t2) {
|
|
34
|
+
t3 = { enabled: t2 };
|
|
35
|
+
$[2] = t2;
|
|
36
|
+
$[3] = t3;
|
|
37
|
+
} else t3 = $[3];
|
|
38
|
+
const projectId = useReadQuery(t1, t3).data?.id;
|
|
39
|
+
let t4;
|
|
40
|
+
if ($[4] !== projectId) {
|
|
41
|
+
t4 = reads.missingFromLocale({ projectId: projectId ?? 0 });
|
|
42
|
+
$[4] = projectId;
|
|
43
|
+
$[5] = t4;
|
|
44
|
+
} else t4 = $[5];
|
|
45
|
+
const t5 = !!projectId && !locale.isDefault;
|
|
46
|
+
let t6;
|
|
47
|
+
if ($[6] !== t5) {
|
|
48
|
+
t6 = { enabled: t5 };
|
|
49
|
+
$[6] = t5;
|
|
50
|
+
$[7] = t6;
|
|
51
|
+
} else t6 = $[7];
|
|
52
|
+
const missing = useReadQuery(t4, t6);
|
|
53
|
+
if (locale.isDefault || !projectId || !missing.data) return null;
|
|
54
|
+
let T0;
|
|
55
|
+
let t7;
|
|
56
|
+
let t8;
|
|
57
|
+
let t9;
|
|
58
|
+
if ($[8] !== collections || $[9] !== locale.tag || $[10] !== missing.data || $[11] !== projectId || $[12] !== projectUuid) {
|
|
59
|
+
t9 = Symbol.for("react.early_return_sentinel");
|
|
60
|
+
bb0: {
|
|
61
|
+
const groups = missingGroups(missing.data, collections);
|
|
62
|
+
if (groups.length === 0) {
|
|
63
|
+
t9 = null;
|
|
64
|
+
break bb0;
|
|
65
|
+
}
|
|
66
|
+
let t10;
|
|
67
|
+
if ($[17] !== locale.tag) {
|
|
68
|
+
t10 = localeLabel(locale.tag);
|
|
69
|
+
$[17] = locale.tag;
|
|
70
|
+
$[18] = t10;
|
|
71
|
+
} else t10 = $[18];
|
|
72
|
+
const language = t10;
|
|
73
|
+
T0 = ContentSidebarGroup;
|
|
74
|
+
t7 = `Missing from ${language}`;
|
|
75
|
+
let t11;
|
|
76
|
+
if ($[19] !== language || $[20] !== projectId || $[21] !== projectUuid) {
|
|
77
|
+
t11 = (group) => /* @__PURE__ */ jsxs("ul", {
|
|
78
|
+
"aria-label": group.title,
|
|
79
|
+
className: "flex flex-col",
|
|
80
|
+
children: [/* @__PURE__ */ jsx("li", {
|
|
81
|
+
className: "text-muted-foreground px-2 pt-1 text-xs",
|
|
82
|
+
children: group.title
|
|
83
|
+
}), group.entries.map((entry) => /* @__PURE__ */ jsx(MissingEntry, {
|
|
84
|
+
projectId,
|
|
85
|
+
projectUuid,
|
|
86
|
+
language,
|
|
87
|
+
entry
|
|
88
|
+
}, entry.id))]
|
|
89
|
+
}, group.title);
|
|
90
|
+
$[19] = language;
|
|
91
|
+
$[20] = projectId;
|
|
92
|
+
$[21] = projectUuid;
|
|
93
|
+
$[22] = t11;
|
|
94
|
+
} else t11 = $[22];
|
|
95
|
+
t8 = groups.map(t11);
|
|
96
|
+
}
|
|
97
|
+
$[8] = collections;
|
|
98
|
+
$[9] = locale.tag;
|
|
99
|
+
$[10] = missing.data;
|
|
100
|
+
$[11] = projectId;
|
|
101
|
+
$[12] = projectUuid;
|
|
102
|
+
$[13] = T0;
|
|
103
|
+
$[14] = t7;
|
|
104
|
+
$[15] = t8;
|
|
105
|
+
$[16] = t9;
|
|
106
|
+
} else {
|
|
107
|
+
T0 = $[13];
|
|
108
|
+
t7 = $[14];
|
|
109
|
+
t8 = $[15];
|
|
110
|
+
t9 = $[16];
|
|
111
|
+
}
|
|
112
|
+
if (t9 !== Symbol.for("react.early_return_sentinel")) return t9;
|
|
113
|
+
let t10;
|
|
114
|
+
if ($[23] !== T0 || $[24] !== t7 || $[25] !== t8) {
|
|
115
|
+
t10 = /* @__PURE__ */ jsx(T0, {
|
|
116
|
+
title: t7,
|
|
117
|
+
children: t8
|
|
118
|
+
});
|
|
119
|
+
$[23] = T0;
|
|
120
|
+
$[24] = t7;
|
|
121
|
+
$[25] = t8;
|
|
122
|
+
$[26] = t10;
|
|
123
|
+
} else t10 = $[26];
|
|
124
|
+
return t10;
|
|
125
|
+
};
|
|
126
|
+
/** What's missing, pages first, then records under each collection shown, in its order. */
|
|
127
|
+
function missingGroups(missing, collections) {
|
|
128
|
+
const groups = [];
|
|
129
|
+
if (missing.pages.length > 0) groups.push({
|
|
130
|
+
title: "Pages",
|
|
131
|
+
entries: missing.pages.map((page) => ({
|
|
132
|
+
entity: "page",
|
|
133
|
+
id: page.id,
|
|
134
|
+
name: page.nickname || page.fullPath,
|
|
135
|
+
detail: page.fullPath
|
|
136
|
+
}))
|
|
137
|
+
});
|
|
138
|
+
for (const collection of collections) {
|
|
139
|
+
const records = missing.records.filter((record) => record.collectionId === collection.collectionId);
|
|
140
|
+
if (records.length === 0) continue;
|
|
141
|
+
groups.push({
|
|
142
|
+
title: collection.title,
|
|
143
|
+
entries: records.map((record) => ({
|
|
144
|
+
entity: "record",
|
|
145
|
+
id: record.id,
|
|
146
|
+
collectionId: record.collectionId,
|
|
147
|
+
name: record.label || "Untitled item"
|
|
148
|
+
}))
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
return groups;
|
|
152
|
+
}
|
|
153
|
+
const MissingEntry = (t0) => {
|
|
154
|
+
const $ = c(35);
|
|
155
|
+
const { projectId, projectUuid, language, entry } = t0;
|
|
156
|
+
const cache = useStudioCache();
|
|
157
|
+
let t1;
|
|
158
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
159
|
+
t1 = localeMutations.addBack();
|
|
160
|
+
$[0] = t1;
|
|
161
|
+
} else t1 = $[0];
|
|
162
|
+
let t2;
|
|
163
|
+
if ($[1] !== cache || $[2] !== entry.collectionId || $[3] !== entry.name || $[4] !== language || $[5] !== projectId || $[6] !== projectUuid) {
|
|
164
|
+
t2 = () => {
|
|
165
|
+
toast.success(`Added “${entry.name}” back to ${language}`, { description: "Camox is translating it." });
|
|
166
|
+
cache.invalidate(reads.missingFromLocale({ projectId }));
|
|
167
|
+
if (entry.collectionId) cache.invalidate(reads.records({
|
|
168
|
+
projectUuid,
|
|
169
|
+
collectionId: entry.collectionId
|
|
170
|
+
}));
|
|
171
|
+
else cache.invalidate(reads.pageList({ projectUuid }));
|
|
172
|
+
};
|
|
173
|
+
$[1] = cache;
|
|
174
|
+
$[2] = entry.collectionId;
|
|
175
|
+
$[3] = entry.name;
|
|
176
|
+
$[4] = language;
|
|
177
|
+
$[5] = projectId;
|
|
178
|
+
$[6] = projectUuid;
|
|
179
|
+
$[7] = t2;
|
|
180
|
+
} else t2 = $[7];
|
|
181
|
+
let t3;
|
|
182
|
+
if ($[8] !== entry.name) {
|
|
183
|
+
t3 = (error) => toast.error(error.message || `Could not add “${entry.name}” back`);
|
|
184
|
+
$[8] = entry.name;
|
|
185
|
+
$[9] = t3;
|
|
186
|
+
} else t3 = $[9];
|
|
187
|
+
let t4;
|
|
188
|
+
if ($[10] !== t2 || $[11] !== t3) {
|
|
189
|
+
t4 = {
|
|
190
|
+
...t1,
|
|
191
|
+
onSuccess: t2,
|
|
192
|
+
onError: t3
|
|
193
|
+
};
|
|
194
|
+
$[10] = t2;
|
|
195
|
+
$[11] = t3;
|
|
196
|
+
$[12] = t4;
|
|
197
|
+
} else t4 = $[12];
|
|
198
|
+
const addBack = useMutation(t4);
|
|
199
|
+
let t5;
|
|
200
|
+
if ($[13] !== entry.name) {
|
|
201
|
+
t5 = /* @__PURE__ */ jsx("span", {
|
|
202
|
+
className: "truncate",
|
|
203
|
+
title: entry.name,
|
|
204
|
+
children: entry.name
|
|
205
|
+
});
|
|
206
|
+
$[13] = entry.name;
|
|
207
|
+
$[14] = t5;
|
|
208
|
+
} else t5 = $[14];
|
|
209
|
+
let t6;
|
|
210
|
+
if ($[15] !== entry.detail || $[16] !== entry.name) {
|
|
211
|
+
t6 = entry.detail && entry.detail !== entry.name && /* @__PURE__ */ jsx("span", {
|
|
212
|
+
className: "text-muted-foreground truncate text-xs",
|
|
213
|
+
title: entry.detail,
|
|
214
|
+
children: entry.detail
|
|
215
|
+
});
|
|
216
|
+
$[15] = entry.detail;
|
|
217
|
+
$[16] = entry.name;
|
|
218
|
+
$[17] = t6;
|
|
219
|
+
} else t6 = $[17];
|
|
220
|
+
let t7;
|
|
221
|
+
if ($[18] !== t5 || $[19] !== t6) {
|
|
222
|
+
t7 = /* @__PURE__ */ jsxs("span", {
|
|
223
|
+
className: "flex min-w-0 flex-1 flex-col",
|
|
224
|
+
children: [t5, t6]
|
|
225
|
+
});
|
|
226
|
+
$[18] = t5;
|
|
227
|
+
$[19] = t6;
|
|
228
|
+
$[20] = t7;
|
|
229
|
+
} else t7 = $[20];
|
|
230
|
+
const t8 = `Add ${entry.name} back to ${language}`;
|
|
231
|
+
const t9 = `Add back to ${language}`;
|
|
232
|
+
let t10;
|
|
233
|
+
if ($[21] !== addBack || $[22] !== entry.entity || $[23] !== entry.id || $[24] !== projectId) {
|
|
234
|
+
t10 = () => addBack.mutate({
|
|
235
|
+
projectId,
|
|
236
|
+
entity: entry.entity,
|
|
237
|
+
id: entry.id
|
|
238
|
+
});
|
|
239
|
+
$[21] = addBack;
|
|
240
|
+
$[22] = entry.entity;
|
|
241
|
+
$[23] = entry.id;
|
|
242
|
+
$[24] = projectId;
|
|
243
|
+
$[25] = t10;
|
|
244
|
+
} else t10 = $[25];
|
|
245
|
+
let t11;
|
|
246
|
+
if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
247
|
+
t11 = /* @__PURE__ */ jsx(Undo2Icon, { "aria-hidden": true });
|
|
248
|
+
$[26] = t11;
|
|
249
|
+
} else t11 = $[26];
|
|
250
|
+
let t12;
|
|
251
|
+
if ($[27] !== addBack.isPending || $[28] !== t10 || $[29] !== t8 || $[30] !== t9) {
|
|
252
|
+
t12 = /* @__PURE__ */ jsx(Button, {
|
|
253
|
+
type: "button",
|
|
254
|
+
variant: "ghost",
|
|
255
|
+
size: "icon-xs",
|
|
256
|
+
"aria-label": t8,
|
|
257
|
+
title: t9,
|
|
258
|
+
disabled: addBack.isPending,
|
|
259
|
+
onClick: t10,
|
|
260
|
+
children: t11
|
|
261
|
+
});
|
|
262
|
+
$[27] = addBack.isPending;
|
|
263
|
+
$[28] = t10;
|
|
264
|
+
$[29] = t8;
|
|
265
|
+
$[30] = t9;
|
|
266
|
+
$[31] = t12;
|
|
267
|
+
} else t12 = $[31];
|
|
268
|
+
let t13;
|
|
269
|
+
if ($[32] !== t12 || $[33] !== t7) {
|
|
270
|
+
t13 = /* @__PURE__ */ jsxs("li", {
|
|
271
|
+
className: "flex items-center gap-1 rounded-md py-0.5 pr-1 pl-2 text-sm",
|
|
272
|
+
children: [t7, t12]
|
|
273
|
+
});
|
|
274
|
+
$[32] = t12;
|
|
275
|
+
$[33] = t7;
|
|
276
|
+
$[34] = t13;
|
|
277
|
+
} else t13 = $[34];
|
|
278
|
+
return t13;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
//#endregion
|
|
282
|
+
export { MissingFromLocaleGroup };
|
|
@@ -6,40 +6,36 @@ import { Upload } from "lucide-react";
|
|
|
6
6
|
|
|
7
7
|
//#region src/features/content/components/UploadDropZone.tsx
|
|
8
8
|
function UploadDropZone(t0) {
|
|
9
|
-
const $ = c(
|
|
10
|
-
if ($[0] !== "e31ae4b0282f0aa7fc6688fbbc94a646974a560b3692e1092a971e6f3bb3f86a") {
|
|
11
|
-
for (let $i = 0; $i < 15; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
12
|
-
$[0] = "e31ae4b0282f0aa7fc6688fbbc94a646974a560b3692e1092a971e6f3bb3f86a";
|
|
13
|
-
}
|
|
9
|
+
const $ = c(14);
|
|
14
10
|
const { onDrop, children, className, label: t1 } = t0;
|
|
15
11
|
const label = t1 === void 0 ? "Drop files to upload" : t1;
|
|
16
12
|
const [isDragging, setIsDragging] = useState(false);
|
|
17
13
|
const dragCounter = useRef(0);
|
|
18
14
|
let t2;
|
|
19
|
-
if ($[
|
|
15
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
20
16
|
t2 = (e) => {
|
|
21
17
|
e.preventDefault();
|
|
22
18
|
e.stopPropagation();
|
|
23
19
|
dragCounter.current = dragCounter.current + 1;
|
|
24
20
|
if (dragCounter.current === 1) setIsDragging(true);
|
|
25
21
|
};
|
|
26
|
-
$[
|
|
27
|
-
} else t2 = $[
|
|
22
|
+
$[0] = t2;
|
|
23
|
+
} else t2 = $[0];
|
|
28
24
|
const handleDragEnter = t2;
|
|
29
25
|
let t3;
|
|
30
|
-
if ($[
|
|
26
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
31
27
|
t3 = (e_0) => {
|
|
32
28
|
e_0.preventDefault();
|
|
33
29
|
e_0.stopPropagation();
|
|
34
30
|
dragCounter.current = dragCounter.current - 1;
|
|
35
31
|
if (dragCounter.current === 0) setIsDragging(false);
|
|
36
32
|
};
|
|
37
|
-
$[
|
|
38
|
-
} else t3 = $[
|
|
33
|
+
$[1] = t3;
|
|
34
|
+
} else t3 = $[1];
|
|
39
35
|
const handleDragLeave = t3;
|
|
40
36
|
const handleDragOver = _temp;
|
|
41
37
|
let t4;
|
|
42
|
-
if ($[
|
|
38
|
+
if ($[2] !== onDrop) {
|
|
43
39
|
t4 = (e_2) => {
|
|
44
40
|
e_2.preventDefault();
|
|
45
41
|
e_2.stopPropagation();
|
|
@@ -47,18 +43,18 @@ function UploadDropZone(t0) {
|
|
|
47
43
|
setIsDragging(false);
|
|
48
44
|
if (e_2.dataTransfer.files.length > 0) onDrop(e_2.dataTransfer.files);
|
|
49
45
|
};
|
|
50
|
-
$[
|
|
51
|
-
$[
|
|
52
|
-
} else t4 = $[
|
|
46
|
+
$[2] = onDrop;
|
|
47
|
+
$[3] = t4;
|
|
48
|
+
} else t4 = $[3];
|
|
53
49
|
const handleDrop = t4;
|
|
54
50
|
let t5;
|
|
55
|
-
if ($[
|
|
51
|
+
if ($[4] !== className) {
|
|
56
52
|
t5 = cn("relative min-h-full", className);
|
|
57
|
-
$[
|
|
58
|
-
$[
|
|
59
|
-
} else t5 = $[
|
|
53
|
+
$[4] = className;
|
|
54
|
+
$[5] = t5;
|
|
55
|
+
} else t5 = $[5];
|
|
60
56
|
let t6;
|
|
61
|
-
if ($[
|
|
57
|
+
if ($[6] !== isDragging || $[7] !== label) {
|
|
62
58
|
t6 = isDragging && /* @__PURE__ */ jsx("div", {
|
|
63
59
|
className: "bg-background absolute inset-0 z-40 flex flex-col items-center justify-center gap-2 p-4",
|
|
64
60
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -69,12 +65,12 @@ function UploadDropZone(t0) {
|
|
|
69
65
|
})]
|
|
70
66
|
})
|
|
71
67
|
});
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
} else t6 = $[
|
|
68
|
+
$[6] = isDragging;
|
|
69
|
+
$[7] = label;
|
|
70
|
+
$[8] = t6;
|
|
71
|
+
} else t6 = $[8];
|
|
76
72
|
let t7;
|
|
77
|
-
if ($[
|
|
73
|
+
if ($[9] !== children || $[10] !== handleDrop || $[11] !== t5 || $[12] !== t6) {
|
|
78
74
|
t7 = /* @__PURE__ */ jsxs("div", {
|
|
79
75
|
className: t5,
|
|
80
76
|
onDragEnter: handleDragEnter,
|
|
@@ -83,12 +79,12 @@ function UploadDropZone(t0) {
|
|
|
83
79
|
onDrop: handleDrop,
|
|
84
80
|
children: [children, t6]
|
|
85
81
|
});
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
91
|
-
} else t7 = $[
|
|
82
|
+
$[9] = children;
|
|
83
|
+
$[10] = handleDrop;
|
|
84
|
+
$[11] = t5;
|
|
85
|
+
$[12] = t6;
|
|
86
|
+
$[13] = t7;
|
|
87
|
+
} else t7 = $[13];
|
|
92
88
|
return t7;
|
|
93
89
|
}
|
|
94
90
|
function _temp(e_1) {
|