camox 0.75.0 → 0.76.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 (72) hide show
  1. package/dist/core/editing/createEditableBlock.js +1077 -1681
  2. package/dist/core/editing/fieldSlot.js +251 -0
  3. package/dist/core/editing/useFieldSlot.js +159 -0
  4. package/dist/core/layoutContext.d.ts +2 -0
  5. package/dist/core/layoutContext.js +27 -1
  6. package/dist/features/canvas/CanvasPageFrame.js +2 -2
  7. package/dist/features/canvas/CanvasPreviewPageSlot.js +1 -1
  8. package/dist/features/canvas/canvasCameraController.js +595 -0
  9. package/dist/features/canvas/useCanvasCamera.js +141 -587
  10. package/dist/features/canvas/useCanvasFrame.js +1 -1
  11. package/dist/features/page/DerivedPageContent.js +4 -8
  12. package/dist/features/preview/components/AssetLightbox.js +6 -65
  13. package/dist/features/preview/components/CanvasPreview.js +2 -2
  14. package/dist/features/preview/components/Frame.js +3 -3
  15. package/dist/features/preview/components/ItemFieldsEditor.js +376 -460
  16. package/dist/features/preview/components/Overlays.js +4 -9
  17. package/dist/features/preview/components/PreviewPanel.js +3 -3
  18. package/dist/features/preview/components/RemovedBlockPlaceholder.js +2 -2
  19. package/dist/features/preview/components/SelectionEditor.js +285 -339
  20. package/dist/features/preview/components/ZoomableImage.js +105 -0
  21. package/dist/features/preview/components/contentFieldSchema.js +3 -1
  22. package/dist/features/preview/components/useFieldWriter.js +30 -51
  23. package/dist/features/preview/components/useRecordView.js +3 -3
  24. package/dist/features/preview/overlayMessages.js +20 -58
  25. package/dist/features/preview/previewStore.js +6 -123
  26. package/dist/features/preview/repeatableItemPath.js +47 -0
  27. package/dist/features/provider/AuthenticatedCamoxProvider.js +75 -63
  28. package/dist/features/renderer/RendererApp.js +6 -6
  29. package/dist/features/renderer/RendererFrames.js +2 -2
  30. package/dist/features/renderer/rendererHost.js +1 -1
  31. package/dist/features/routes/pageRuntime.d.ts +8 -12
  32. package/dist/features/routes/pageRuntime.js +26 -106
  33. package/dist/features/runtime/pageApp.js +1 -1
  34. package/dist/features/runtime/pageRead.js +105 -0
  35. package/dist/features/runtime/reader.d.ts +25 -0
  36. package/dist/features/runtime/reader.js +142 -0
  37. package/dist/features/runtime/runtime.d.ts +9 -3
  38. package/dist/features/runtime/runtime.js +608 -776
  39. package/dist/features/sdkBundle/buildSdkBundle.d.ts +5 -0
  40. package/dist/features/sdkBundle/buildSdkBundle.js +9 -3
  41. package/dist/features/studio/components/ChatWidget.js +137 -121
  42. package/dist/features/studio/components/ClearThread.js +121 -0
  43. package/dist/features/studio/components/DeleteDraftDialog.js +67 -65
  44. package/dist/features/studio/components/DraftBar.js +60 -49
  45. package/dist/features/studio/components/DraftNotices.js +149 -0
  46. package/dist/features/studio/components/DraftsControl.js +217 -180
  47. package/dist/features/studio/components/DraftsSheet.js +446 -0
  48. package/dist/features/studio/components/PublishedTab.js +511 -0
  49. package/dist/features/studio/components/ReviewDraftDialog.js +104 -89
  50. package/dist/features/studio/components/SheetTable.js +46 -0
  51. package/dist/features/studio/components/Specialists.js +1 -1
  52. package/dist/features/studio/components/ThreadMessages.js +227 -176
  53. package/dist/features/studio/draftLabel.js +15 -1
  54. package/dist/features/studio/draftNotice.js +1 -0
  55. package/dist/features/studio/showInCanvas.js +9 -19
  56. package/dist/features/studio/studioStore.js +5 -5
  57. package/dist/features/studio/useArchiveDraft.js +60 -0
  58. package/dist/features/studio/useEditorSelection.js +8 -19
  59. package/dist/features/studio/useRestoreDraft.js +70 -0
  60. package/dist/features/studio/viewSwitch.js +19 -11
  61. package/dist/lib/draft-scope.d.ts +1 -1
  62. package/dist/lib/draft-scope.js +6 -3
  63. package/dist/lib/queries.js +12 -1
  64. package/dist/lib/studio-reads.js +22 -0
  65. package/dist/lib/use-project-room.js +19 -13
  66. package/dist/lib/use-thread.js +1 -1
  67. package/dist/package.js +1 -1
  68. package/dist/studio.css +1 -1
  69. package/package.json +4 -4
  70. package/dist/core/hooks/useFieldSelection.js +0 -67
  71. package/dist/core/hooks/useIsEditable.js +0 -21
  72. package/dist/core/hooks/useOverlayMessage.js +0 -70
@@ -1,20 +1,15 @@
1
+ import { slotId, slotOf } from "../../../core/editing/fieldSlot.js";
1
2
  import { previewStore, selectionForOwner } from "../previewStore.js";
2
3
  import { useEditingFrame } from "../editingFrame.js";
3
- import { overlayFieldId, recordFieldId } from "../overlayMessages.js";
4
4
  import { c } from "react/compiler-runtime";
5
5
  import * as React from "react";
6
6
  import { useSelector } from "@xstate/store-react";
7
7
 
8
8
  //#region src/features/preview/components/Overlays.tsx
9
- /** The field ID of a selected String field; only those are focused in the page. */
9
+ /** The overlay id of a selected String field; only those are focused in the page. */
10
10
  function stringFieldId(selection) {
11
- if (!selection) return null;
12
- switch (selection.type) {
13
- case "block-field": return selection.fieldType === "String" ? overlayFieldId(selection.blockId, selection.fieldName) : null;
14
- case "item-field": return selection.fieldType === "String" ? overlayFieldId(selection.blockId, selection.fieldName, { itemId: selection.itemId }) : null;
15
- case "record-field": return selection.recordFieldType === "String" ? recordFieldId(selection, selection.recordFieldName) : null;
16
- default: return null;
17
- }
11
+ const slot = slotOf(selection);
12
+ return slot?.type === "String" ? slotId(slot) : null;
18
13
  }
19
14
  const Overlays = (t0) => {
20
15
  const $ = c(7);
@@ -3,16 +3,16 @@ import { ArtifactStudioContext } from "../../../core/hooks/useArtifactHost.js";
3
3
  import { cn } from "../../../lib/utils.js";
4
4
  import { previewStore } from "../previewStore.js";
5
5
  import { useEditingFrameClaim, useEditingOwner } from "../editingFrame.js";
6
- import { EditableSurfaceContext } from "../../../core/hooks/useIsEditable.js";
7
- import { CanvasWorkspaceContext } from "../../canvas/canvasZoom.js";
6
+ import { Frame, useFrame } from "./Frame.js";
8
7
  import { PreviewEditingOwnerContext } from "../previewSelection.js";
8
+ import { EditableSurfaceContext } from "../../../core/editing/useFieldSlot.js";
9
+ import { CanvasWorkspaceContext } from "../../canvas/canvasZoom.js";
9
10
  import { previewPageIframeProps, usePreviewPageFrame } from "../previewPageFrame.js";
10
11
  import { adoptCanvasDocument, pauseCanvasDocument } from "../../canvas/canvasFrameDocument.js";
11
12
  import { forwardCanvasWheel, useCanvasFrameInput } from "../../canvas/useCanvasFrameInput.js";
12
13
  import { useActionShortcuts } from "../../provider/useAdminShortcuts.js";
13
14
  import { guardStrayCaret } from "../strayCaretGuard.js";
14
15
  import { useBlockActionsShortcuts } from "./BlockActionsPopover.js";
15
- import { Frame, useFrame } from "./Frame.js";
16
16
  import { FieldOverlayStyles } from "./FieldOverlayStyles.js";
17
17
  import { MobilePreviewDrawer } from "./MobilePreviewDrawer.js";
18
18
  import { Overlays } from "./Overlays.js";
@@ -1,6 +1,6 @@
1
- import { useIsEditable } from "../../../core/hooks/useIsEditable.js";
2
- import { useStudioNotice } from "../studioNotice.js";
3
1
  import { useApplyContentEdit } from "../../../core/editing/contentEdits.js";
2
+ import { useIsEditable } from "../../../core/editing/useFieldSlot.js";
3
+ import { useStudioNotice } from "../studioNotice.js";
4
4
  import * as React from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Button } from "@camox/ui/button";