camox 0.51.0 → 0.52.1

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.
Files changed (91) hide show
  1. package/dist/core/createApp.d.ts +1 -0
  2. package/dist/core/createApp.js +1 -0
  3. package/dist/core/editing/contentEdits.js +78 -0
  4. package/dist/core/editing/createEditableBlock.js +277 -311
  5. package/dist/core/lib/contentType.js +2 -2
  6. package/dist/core/recordItem.js +3 -3
  7. package/dist/features/canvas/CamoxCanvas.js +15 -15
  8. package/dist/features/canvas/CanvasLoadingScreen.js +15 -11
  9. package/dist/features/canvas/CanvasPageFrame.js +81 -87
  10. package/dist/features/canvas/CanvasPreviewPageSlot.js +1 -1
  11. package/dist/features/canvas/DerivedPagePathInput.js +12 -12
  12. package/dist/features/canvas/canvasOverlayGeometry.js +1 -1
  13. package/dist/features/canvas/canvasStore.js +2 -2
  14. package/dist/features/canvas/sidebar/CuratedPageInspector.js +1 -1
  15. package/dist/features/canvas/sidebar/LayoutPageBlocks.js +23 -31
  16. package/dist/features/canvas/useCanvasCamera.js +1 -1
  17. package/dist/features/canvas/useDiscoveredPreviewPaths.js +16 -9
  18. package/dist/features/page/CuratedPageContent.js +1 -1
  19. package/dist/features/preview/CamoxPreview.d.ts +8 -4
  20. package/dist/features/preview/CamoxPreview.js +257 -442
  21. package/dist/features/preview/EditablePageContent.js +244 -2
  22. package/dist/features/preview/EditablePageExperience.js +2 -4
  23. package/dist/features/preview/components/AddBlockSheet.js +55 -15
  24. package/dist/features/preview/components/BlockActionsPopover.js +12 -16
  25. package/dist/features/preview/components/BlockPeek.js +66 -0
  26. package/dist/features/preview/components/BlockThumbnail.js +134 -119
  27. package/dist/features/preview/components/CanvasPreview.js +1 -1
  28. package/dist/features/preview/components/CreatePageModal.js +150 -156
  29. package/dist/features/preview/components/Frame.js +27 -4
  30. package/dist/features/preview/components/MobilePreviewDrawer.js +1 -1
  31. package/dist/features/preview/components/PageInfo.js +161 -126
  32. package/dist/features/preview/components/PagePicker.js +2 -2
  33. package/dist/features/preview/components/PageTree.js +174 -190
  34. package/dist/features/preview/components/PreviewPanel.js +3 -3
  35. package/dist/features/preview/components/ReferenceFieldEditor.js +4 -4
  36. package/dist/features/preview/components/ReferenceListFieldEditor.js +4 -4
  37. package/dist/features/preview/components/RemovedBlockPlaceholder.js +37 -70
  38. package/dist/features/preview/components/RepeatableItemsList.js +1 -1
  39. package/dist/features/preview/components/SelectionEditor.js +248 -256
  40. package/dist/features/preview/components/StudioEditingFallback.js +22 -26
  41. package/dist/features/preview/components/useFieldWriter.js +19 -19
  42. package/dist/features/preview/components/useRecordView.js +105 -147
  43. package/dist/features/preview/components/useRepeatableItemActions.js +0 -2
  44. package/dist/features/preview/pageRecord.js +30 -24
  45. package/dist/features/preview/previewStore.js +2 -0
  46. package/dist/features/preview/studioNotice.js +20 -0
  47. package/dist/features/provider/AuthenticatedCamoxProvider.js +46 -30
  48. package/dist/features/renderer/RendererApp.js +542 -0
  49. package/dist/features/renderer/RendererFrames.js +450 -0
  50. package/dist/features/renderer/definitionAnswers.js +26 -0
  51. package/dist/features/renderer/protocol.js +35 -0
  52. package/dist/features/renderer/rendererHost.js +249 -0
  53. package/dist/features/renderer/studioConnection.js +186 -0
  54. package/dist/features/routes/pageRuntime.js +7 -2
  55. package/dist/features/runtime/RuntimeChrome.js +2 -5
  56. package/dist/features/runtime/assetPrefix.js +14 -0
  57. package/dist/features/runtime/breadcrumbs.js +1 -1
  58. package/dist/features/runtime/editingFallback.js +4 -8
  59. package/dist/features/runtime/livePages.js +1 -1
  60. package/dist/features/runtime/pageApp.js +57 -83
  61. package/dist/features/runtime/pageClient.js +1 -1
  62. package/dist/features/runtime/pageNavigation.js +3 -2
  63. package/dist/features/runtime/publicCache.js +15 -3
  64. package/dist/features/runtime/publishingDraft.js +23 -0
  65. package/dist/features/runtime/rendererClient.d.ts +8 -0
  66. package/dist/features/runtime/rendererClient.js +77 -0
  67. package/dist/features/runtime/runtime.d.ts +9 -0
  68. package/dist/features/runtime/runtime.js +36 -17
  69. package/dist/features/runtime/runtimeRoutes.d.ts +2 -0
  70. package/dist/features/runtime/runtimeRoutes.js +2 -0
  71. package/dist/features/runtime/worker.d.ts +10 -1
  72. package/dist/features/runtime/worker.js +20 -7
  73. package/dist/features/studio/FollowAgentProvider.js +10 -10
  74. package/dist/features/studio/components/ProjectMenu.js +1 -1
  75. package/dist/features/studio/components/ReviewDraftSheet.js +242 -138
  76. package/dist/features/studio/components/ThreadMessages.js +100 -65
  77. package/dist/features/studio/components/UserButton.js +1 -1
  78. package/dist/features/vite/definitionsSync.js +1 -1
  79. package/dist/features/vite/hostedChecks.js +127 -0
  80. package/dist/features/vite/runtimeDev.js +26 -0
  81. package/dist/features/vite/vite.js +33 -5
  82. package/dist/hooks/use-page-destinations.js +10 -10
  83. package/dist/lib/revisions.js +20 -0
  84. package/dist/lib/studio-definitions.js +160 -0
  85. package/dist/lib/studio-reads.js +65 -21
  86. package/dist/lib/use-project-room.js +16 -10
  87. package/dist/package.js +1 -1
  88. package/dist/studio.css +1 -1
  89. package/package.json +8 -4
  90. package/skills/camox/SKILL.md +4 -0
  91. package/skills/camox/references/artifacts.md +1 -1
@@ -1,19 +1,24 @@
1
1
  import { useProjectUuid } from "../../lib/auth.js";
2
- import { useCamoxApp } from "../provider/components/CamoxAppContext.js";
3
2
  import { reads, useReadQueries } from "../../lib/studio-reads.js";
3
+ import { useLayoutDefinitions } from "../../lib/studio-definitions.js";
4
+ import { routeSegments } from "../../core/derivedRoutes.js";
4
5
  import { c } from "react/compiler-runtime";
5
6
 
6
7
  //#region src/features/canvas/useDiscoveredPreviewPaths.ts
7
- /** Each derived layout's first discovered page, keyed by layout id. */
8
+ /**
9
+ * Each derived layout's first discovered page, keyed by layout id. Only a layout with params
10
+ * needs one. Whether it discovers pages is its code's to say: the runtime runs it, and answers
11
+ * no page for a layout without routes.
12
+ */
8
13
  function useDiscoveredPreviewPaths(runtimeBasePath) {
9
14
  const $ = c(11);
10
15
  const projectUuid = useProjectUuid();
11
- const t0 = useCamoxApp();
16
+ const t0 = useLayoutDefinitions();
12
17
  let ids;
13
18
  let t1;
14
19
  let t2;
15
20
  if ($[0] !== projectUuid || $[1] !== runtimeBasePath || $[2] !== t0) {
16
- ids = t0.getLayouts().filter(_temp).map(_temp2);
21
+ ids = t0.filter(_temp2).map(_temp3);
17
22
  t1 = useReadQueries;
18
23
  let t3;
19
24
  if ($[6] !== projectUuid || $[7] !== runtimeBasePath) {
@@ -49,13 +54,15 @@ function useDiscoveredPreviewPaths(runtimeBasePath) {
49
54
  } else t3 = $[10];
50
55
  return t1(t2, t3);
51
56
  }
52
- function _temp2(t0) {
53
- const { _internal: t1 } = t0;
54
- const { id } = t1;
57
+ function _temp3(t0) {
58
+ const { id } = t0;
55
59
  return id;
56
60
  }
57
- function _temp(layout) {
58
- return layout._internal.kind === "derived" && layout._internal.routes;
61
+ function _temp2(layout) {
62
+ return layout.kind === "derived" && routeSegments(layout.id).some(_temp);
63
+ }
64
+ function _temp(segment) {
65
+ return segment.startsWith("$");
59
66
  }
60
67
 
61
68
  //#endregion
@@ -4,8 +4,8 @@ import { useCamoxApp } from "../provider/components/CamoxAppContext.js";
4
4
  import { NormalizedDataProvider, usePageBlocks } from "../../lib/normalized-data.js";
5
5
  import { reads, useRead } from "../../lib/studio-reads.js";
6
6
  import { BlockErrorBoundary } from "../preview/components/BlockErrorBoundary.js";
7
- import { curatedLayoutContext } from "../../core/layoutContext.js";
8
7
  import { useLocalePath } from "../../lib/view-locale.js";
8
+ import { curatedLayoutContext } from "../../core/layoutContext.js";
9
9
  import { SharedLayoutContent } from "./SharedLayoutContent.js";
10
10
  import { c } from "react/compiler-runtime";
11
11
  import * as React from "react";
@@ -6,15 +6,17 @@ import * as React from "react";
6
6
  //#region src/features/preview/CamoxPreview.d.ts
7
7
  /** The page the Preview shows: as the server rendered it, then following edits. */
8
8
  export declare function usePreviewedPage(): PageStructure;
9
- export declare const PageContent: () => React.JSX.Element;
10
- export declare const CamoxPreview: ({ children, runtimeBasePath, derived, canvasOnly }: {
11
- children: React.ReactNode;
9
+ /**
10
+ * The signed-in Website Section. The studio never renders the page itself: the renderer frame,
11
+ * which runs the shown draft's code, renders it into the Preview's slot.
12
+ */
13
+ export declare const CamoxPreview: ({ runtimeBasePath, derived, canvasOnly }: {
12
14
  runtimeBasePath?: string;
13
15
  derived?: PageRenderInput["derived"];
14
16
  canvasOnly?: PageRenderInput["canvasOnly"];
15
17
  }) => React.JSX.Element;
16
18
  /** Studio chrome is shared; only curated previews require a Camox page record. */
17
- export declare const PreviewShell: ({ children, pageData, derivedLayout, pageLocation, canvasOnly, runtimeBasePath }: {
19
+ export declare const PreviewShell: ({ children, pageData, derivedLayout, pageLocation, canvasOnly, runtimeBasePath, pageShown }: {
18
20
  children: React.ReactNode;
19
21
  pageData?: ReturnType<typeof usePreviewedPage>;
20
22
  derivedLayout?: LayoutStructure;
@@ -22,6 +24,8 @@ export declare const PreviewShell: ({ children, pageData, derivedLayout, pageLoc
22
24
  pageLocation?: LocationState;
23
25
  canvasOnly?: PageRenderInput["canvasOnly"];
24
26
  runtimeBasePath?: string;
27
+ /** Whether the Preview's page showed: until then, a loading screen covers the Preview. */
28
+ pageShown?: boolean;
25
29
  }) => React.JSX.Element;
26
30
  /** Zooms out to the whole Canvas, from anywhere in the site or the Studio. */
27
31
  export declare function useShowCanvasAction(): void;