camox 0.41.1 → 0.42.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.
Files changed (49) hide show
  1. package/dist/core/components/lexical/SidebarLexicalEditor.js +42 -39
  2. package/dist/core/createApp.d.ts +18 -4
  3. package/dist/core/createLayout.d.ts +1 -1
  4. package/dist/core/editing/createEditableBlock.d.ts +8 -1
  5. package/dist/core/editing/createEditableBlock.js +636 -459
  6. package/dist/core/hooks/useOverlayState.js +11 -0
  7. package/dist/core/lib/fieldTypes.js +5 -5
  8. package/dist/core/lib/lexicalState.js +17 -1
  9. package/dist/features/preview/CamoxPreview.js +80 -73
  10. package/dist/features/preview/commentsEnabled.js +8 -0
  11. package/dist/features/preview/components/AddBlockSidebar.js +79 -89
  12. package/dist/features/preview/components/AssetLightbox.js +4 -11
  13. package/dist/features/preview/components/AttachedComments.js +194 -0
  14. package/dist/features/preview/components/BlockActionsPopover.js +13 -64
  15. package/dist/features/preview/components/CommentHeader.js +122 -0
  16. package/dist/features/preview/components/CommentSidebar.js +29 -0
  17. package/dist/features/preview/components/CommentTargetQuote.js +166 -0
  18. package/dist/features/preview/components/CreatePageModal.js +2 -8
  19. package/dist/features/preview/components/ItemFieldsEditor.js +275 -204
  20. package/dist/features/preview/components/LeftSidebar.js +18 -18
  21. package/dist/features/preview/components/OverlayTracker.js +14 -20
  22. package/dist/features/preview/components/Overlays.js +26 -35
  23. package/dist/features/preview/components/PageEditorSidebar.js +89 -90
  24. package/dist/features/preview/components/PageInfoSidebar.js +126 -157
  25. package/dist/features/preview/components/PagePicker.js +13 -8
  26. package/dist/features/preview/components/PageTree.js +158 -156
  27. package/dist/features/preview/components/PreviewComments.js +56 -0
  28. package/dist/features/preview/components/PreviewPanel.js +122 -78
  29. package/dist/features/preview/components/PreviewToolbar.js +280 -231
  30. package/dist/features/preview/components/PublicationRow.js +4 -11
  31. package/dist/features/preview/components/RightSidebar.js +14 -11
  32. package/dist/features/preview/components/SidebarSection.js +121 -0
  33. package/dist/features/preview/previewCommentsStore.js +115 -0
  34. package/dist/features/preview/previewSelection.js +75 -0
  35. package/dist/features/preview/previewStore.js +19 -39
  36. package/dist/features/provider/AuthenticatedCamoxProvider.js +46 -34
  37. package/dist/features/provider/components/CommandPalette.js +142 -58
  38. package/dist/features/provider/useAdminShortcuts.js +19 -8
  39. package/dist/features/routes/pageRuntime.js +0 -6
  40. package/dist/features/runtime/RuntimeChrome.js +40 -37
  41. package/dist/features/studio/CamoxStudio.js +30 -50
  42. package/dist/features/vite/runtimeDev.js +4 -1
  43. package/dist/features/vite/vite.d.ts +3 -2
  44. package/dist/features/vite/vite.js +9 -5
  45. package/dist/hooks/use-file-upload.js +0 -2
  46. package/dist/studio.css +1 -1
  47. package/package.json +5 -7
  48. package/dist/lib/telemetry-client.js +0 -66
  49. package/dist/lib/telemetry.js +0 -26
@@ -27,9 +27,9 @@ import { $createTextNode, $getSelection, $isRangeSelection, $setSelection, COMMA
27
27
  //#region src/core/components/lexical/SidebarLexicalEditor.tsx
28
28
  function EnterAsLineBreakHandler() {
29
29
  const $ = c(4);
30
- if ($[0] !== "63fce41aab52cd282d26a73e81de9225d7bcf44f37fcaae7c81941ba12aafa05") {
30
+ if ($[0] !== "9099d61d0971934e0ec89e67af10f91e79fcdfcb9a97e7101baf2650b116b54c") {
31
31
  for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
32
- $[0] = "63fce41aab52cd282d26a73e81de9225d7bcf44f37fcaae7c81941ba12aafa05";
32
+ $[0] = "9099d61d0971934e0ec89e67af10f91e79fcdfcb9a97e7101baf2650b116b54c";
33
33
  }
34
34
  const [editor] = useLexicalComposerContext();
35
35
  let t0;
@@ -53,9 +53,9 @@ function EnterAsLineBreakHandler() {
53
53
  }
54
54
  function ExternalStateSync(t0) {
55
55
  const $ = c(6);
56
- if ($[0] !== "63fce41aab52cd282d26a73e81de9225d7bcf44f37fcaae7c81941ba12aafa05") {
56
+ if ($[0] !== "9099d61d0971934e0ec89e67af10f91e79fcdfcb9a97e7101baf2650b116b54c") {
57
57
  for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
58
- $[0] = "63fce41aab52cd282d26a73e81de9225d7bcf44f37fcaae7c81941ba12aafa05";
58
+ $[0] = "9099d61d0971934e0ec89e67af10f91e79fcdfcb9a97e7101baf2650b116b54c";
59
59
  }
60
60
  const { value, isSyncingRef } = t0;
61
61
  const [editor] = useLexicalComposerContext();
@@ -91,9 +91,9 @@ function ExternalStateSync(t0) {
91
91
  }
92
92
  function SidebarFloatingTextToolbar() {
93
93
  const $ = c(72);
94
- if ($[0] !== "63fce41aab52cd282d26a73e81de9225d7bcf44f37fcaae7c81941ba12aafa05") {
94
+ if ($[0] !== "9099d61d0971934e0ec89e67af10f91e79fcdfcb9a97e7101baf2650b116b54c") {
95
95
  for (let $i = 0; $i < 72; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
96
- $[0] = "63fce41aab52cd282d26a73e81de9225d7bcf44f37fcaae7c81941ba12aafa05";
96
+ $[0] = "9099d61d0971934e0ec89e67af10f91e79fcdfcb9a97e7101baf2650b116b54c";
97
97
  }
98
98
  const [editor] = useLexicalComposerContext();
99
99
  const [open, setOpen] = React.useState(false);
@@ -518,9 +518,9 @@ function _temp(event_0) {
518
518
  }
519
519
  function PasteUrlAsLinkHandler() {
520
520
  const $ = c(4);
521
- if ($[0] !== "63fce41aab52cd282d26a73e81de9225d7bcf44f37fcaae7c81941ba12aafa05") {
521
+ if ($[0] !== "9099d61d0971934e0ec89e67af10f91e79fcdfcb9a97e7101baf2650b116b54c") {
522
522
  for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
523
- $[0] = "63fce41aab52cd282d26a73e81de9225d7bcf44f37fcaae7c81941ba12aafa05";
523
+ $[0] = "9099d61d0971934e0ec89e67af10f91e79fcdfcb9a97e7101baf2650b116b54c";
524
524
  }
525
525
  const [editor] = useLexicalComposerContext();
526
526
  let t0;
@@ -571,43 +571,46 @@ function SidebarLexicalEditor({ id, value, onChange, onFocus, onBlur }) {
571
571
  timerRef.current = window.setTimeout(flushChange, 300);
572
572
  }, [flushChange]);
573
573
  React.useEffect(() => flushChange, [flushChange]);
574
- return /* @__PURE__ */ jsxs(LexicalComposer, {
575
- initialConfig: config,
576
- children: [
577
- /* @__PURE__ */ jsx(RichTextPlugin, {
578
- contentEditable: /* @__PURE__ */ jsx(ContentEditable, {
579
- id,
580
- className: cn(INPUT_BASE_STYLES, INPUT_FOCUS_STYLES, "flex min-h-[80px] w-full px-3 py-2"),
581
- onFocus,
582
- onBlur: () => {
583
- flushChange();
584
- onBlur?.();
585
- }
574
+ return /* @__PURE__ */ jsx("div", {
575
+ className: "w-full min-w-0",
576
+ children: /* @__PURE__ */ jsxs(LexicalComposer, {
577
+ initialConfig: config,
578
+ children: [
579
+ /* @__PURE__ */ jsx(RichTextPlugin, {
580
+ contentEditable: /* @__PURE__ */ jsx(ContentEditable, {
581
+ id,
582
+ className: cn(INPUT_BASE_STYLES, INPUT_FOCUS_STYLES, "flex min-h-[80px] w-full px-3 py-2"),
583
+ onFocus,
584
+ onBlur: () => {
585
+ flushChange();
586
+ onBlur?.();
587
+ }
588
+ }),
589
+ ErrorBoundary: LexicalErrorBoundary
590
+ }),
591
+ /* @__PURE__ */ jsx(OnChangePlugin, {
592
+ onChange: handleChange,
593
+ ignoreSelectionChange: true
586
594
  }),
587
- ErrorBoundary: LexicalErrorBoundary
588
- }),
589
- /* @__PURE__ */ jsx(OnChangePlugin, {
590
- onChange: handleChange,
591
- ignoreSelectionChange: true
592
- }),
593
- /* @__PURE__ */ jsx(HistoryPlugin, {}),
594
- /* @__PURE__ */ jsx(LinkPlugin, {}),
595
- /* @__PURE__ */ jsx(ExternalStateSync, {
596
- value,
597
- isSyncingRef
598
- }),
599
- /* @__PURE__ */ jsx(EnterAsLineBreakHandler, {}),
600
- /* @__PURE__ */ jsx(PasteUrlAsLinkHandler, {}),
601
- /* @__PURE__ */ jsx(SidebarFloatingTextToolbar, {}),
602
- /* @__PURE__ */ jsx(InlineStylesPlugin, {})
603
- ]
595
+ /* @__PURE__ */ jsx(HistoryPlugin, {}),
596
+ /* @__PURE__ */ jsx(LinkPlugin, {}),
597
+ /* @__PURE__ */ jsx(ExternalStateSync, {
598
+ value,
599
+ isSyncingRef
600
+ }),
601
+ /* @__PURE__ */ jsx(EnterAsLineBreakHandler, {}),
602
+ /* @__PURE__ */ jsx(PasteUrlAsLinkHandler, {}),
603
+ /* @__PURE__ */ jsx(SidebarFloatingTextToolbar, {}),
604
+ /* @__PURE__ */ jsx(InlineStylesPlugin, {})
605
+ ]
606
+ })
604
607
  });
605
608
  }
606
609
  function LexicalErrorBoundary(t0) {
607
610
  const $ = c(3);
608
- if ($[0] !== "63fce41aab52cd282d26a73e81de9225d7bcf44f37fcaae7c81941ba12aafa05") {
611
+ if ($[0] !== "9099d61d0971934e0ec89e67af10f91e79fcdfcb9a97e7101baf2650b116b54c") {
609
612
  for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
610
- $[0] = "63fce41aab52cd282d26a73e81de9225d7bcf44f37fcaae7c81941ba12aafa05";
613
+ $[0] = "9099d61d0971934e0ec89e67af10f91e79fcdfcb9a97e7101baf2650b116b54c";
611
614
  }
612
615
  const { children } = t0;
613
616
  let t1;
@@ -21,9 +21,10 @@ declare function createApp({
21
21
  children
22
22
  }: {
23
23
  children: (props: {
24
+ "data-camox-comment-block-id"?: number;
24
25
  ref: (element: HTMLElement | null) => void;
25
26
  style: React.CSSProperties;
26
- onClick: (e: React.MouseEvent) => void;
27
+ onClickCapture: (e: React.MouseEvent) => void;
27
28
  onMouseEnter: () => void;
28
29
  onMouseLeave: () => void;
29
30
  }) => React.ReactNode;
@@ -45,6 +46,7 @@ declare function createApp({
45
46
  "data-camox-overlay-mode"?: string;
46
47
  onMouseEnter?: (() => void) | undefined;
47
48
  onMouseLeave?: (() => void) | undefined;
49
+ onClickCapture?: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
48
50
  }, data: {
49
51
  text: string;
50
52
  }) => React.ReactNode;
@@ -86,6 +88,7 @@ declare function createApp({
86
88
  "data-camox-overlay-mode"?: string;
87
89
  onMouseEnter?: (() => void) | undefined;
88
90
  onMouseLeave?: (() => void) | undefined;
91
+ onClickCapture?: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
89
92
  }, data: {
90
93
  text: string;
91
94
  href: string;
@@ -148,6 +151,7 @@ declare function createApp({
148
151
  "data-camox-overlay-mode"?: string;
149
152
  onMouseEnter?: (() => void) | undefined;
150
153
  onMouseLeave?: (() => void) | undefined;
154
+ onClickCapture?: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
151
155
  }, data: {
152
156
  text: string;
153
157
  }) => React.ReactNode;
@@ -175,6 +179,7 @@ declare function createApp({
175
179
  "data-camox-overlay-mode"?: string;
176
180
  onMouseEnter?: (() => void) | undefined;
177
181
  onMouseLeave?: (() => void) | undefined;
182
+ onClickCapture?: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
178
183
  }, data: {
179
184
  text: string;
180
185
  href: string;
@@ -272,6 +277,7 @@ declare function createApp({
272
277
  "data-camox-overlay-mode"?: string;
273
278
  onMouseEnter?: (() => void) | undefined;
274
279
  onMouseLeave?: (() => void) | undefined;
280
+ onClickCapture?: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
275
281
  }, data: {
276
282
  text: string;
277
283
  }) => React.ReactNode;
@@ -299,6 +305,7 @@ declare function createApp({
299
305
  "data-camox-overlay-mode"?: string;
300
306
  onMouseEnter?: (() => void) | undefined;
301
307
  onMouseLeave?: (() => void) | undefined;
308
+ onClickCapture?: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
302
309
  }, data: {
303
310
  text: string;
304
311
  href: string;
@@ -422,9 +429,10 @@ declare function createApp({
422
429
  children
423
430
  }: {
424
431
  children: (props: {
432
+ "data-camox-comment-block-id"?: number;
425
433
  ref: (element: HTMLElement | null) => void;
426
434
  style: React.CSSProperties;
427
- onClick: (e: React.MouseEvent) => void;
435
+ onClickCapture: (e: React.MouseEvent) => void;
428
436
  onMouseEnter: () => void;
429
437
  onMouseLeave: () => void;
430
438
  }) => React.ReactNode;
@@ -446,6 +454,7 @@ declare function createApp({
446
454
  "data-camox-overlay-mode"?: string;
447
455
  onMouseEnter?: (() => void) | undefined;
448
456
  onMouseLeave?: (() => void) | undefined;
457
+ onClickCapture?: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
449
458
  }, data: {
450
459
  text: string;
451
460
  }) => React.ReactNode;
@@ -487,6 +496,7 @@ declare function createApp({
487
496
  "data-camox-overlay-mode"?: string;
488
497
  onMouseEnter?: (() => void) | undefined;
489
498
  onMouseLeave?: (() => void) | undefined;
499
+ onClickCapture?: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
490
500
  }, data: {
491
501
  text: string;
492
502
  href: string;
@@ -549,6 +559,7 @@ declare function createApp({
549
559
  "data-camox-overlay-mode"?: string;
550
560
  onMouseEnter?: (() => void) | undefined;
551
561
  onMouseLeave?: (() => void) | undefined;
562
+ onClickCapture?: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
552
563
  }, data: {
553
564
  text: string;
554
565
  }) => React.ReactNode;
@@ -576,6 +587,7 @@ declare function createApp({
576
587
  "data-camox-overlay-mode"?: string;
577
588
  onMouseEnter?: (() => void) | undefined;
578
589
  onMouseLeave?: (() => void) | undefined;
590
+ onClickCapture?: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
579
591
  }, data: {
580
592
  text: string;
581
593
  href: string;
@@ -673,6 +685,7 @@ declare function createApp({
673
685
  "data-camox-overlay-mode"?: string;
674
686
  onMouseEnter?: (() => void) | undefined;
675
687
  onMouseLeave?: (() => void) | undefined;
688
+ onClickCapture?: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
676
689
  }, data: {
677
690
  text: string;
678
691
  }) => React.ReactNode;
@@ -700,6 +713,7 @@ declare function createApp({
700
713
  "data-camox-overlay-mode"?: string;
701
714
  onMouseEnter?: (() => void) | undefined;
702
715
  onMouseLeave?: (() => void) | undefined;
716
+ onClickCapture?: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
703
717
  }, data: {
704
718
  text: string;
705
719
  href: string;
@@ -830,7 +844,7 @@ declare function createApp({
830
844
  useData(): unknown;
831
845
  _internal: {
832
846
  id: string;
833
- kind: "curated" | "derived";
847
+ kind: "derived" | "curated";
834
848
  loader: ((context: {
835
849
  params: Record<string, string>;
836
850
  }) => unknown) | undefined;
@@ -905,7 +919,7 @@ declare function createApp({
905
919
  useData(): unknown;
906
920
  _internal: {
907
921
  id: string;
908
- kind: "curated" | "derived";
922
+ kind: "derived" | "curated";
909
923
  loader: ((context: {
910
924
  params: Record<string, string>;
911
925
  }) => unknown) | undefined;
@@ -84,7 +84,7 @@ declare function createLayoutDefinition<const TBefore extends readonly LayoutBlo
84
84
  useData(): unknown;
85
85
  _internal: {
86
86
  id: string;
87
- kind: "curated" | "derived";
87
+ kind: "derived" | "curated";
88
88
  loader: ((context: {
89
89
  params: Record<string, string>;
90
90
  }) => unknown) | undefined;
@@ -115,9 +115,10 @@ declare function createEditableBlock<TSchemaShape extends Record<string, TSchema
115
115
  children
116
116
  }: {
117
117
  children: (props: {
118
+ "data-camox-comment-block-id"?: number;
118
119
  ref: (element: HTMLElement | null) => void;
119
120
  style: React.CSSProperties;
120
- onClick: (e: React.MouseEvent) => void;
121
+ onClickCapture: (e: React.MouseEvent) => void;
121
122
  onMouseEnter: () => void;
122
123
  onMouseLeave: () => void;
123
124
  }) => React.ReactNode;
@@ -171,6 +172,7 @@ declare function createEditableBlock<TSchemaShape extends Record<string, TSchema
171
172
  "data-camox-overlay-mode"?: string;
172
173
  onMouseEnter?: () => void;
173
174
  onMouseLeave?: () => void;
175
+ onClickCapture?: (event: React.MouseEvent<HTMLElement>) => void;
174
176
  }, data: {
175
177
  /** Raw markdown source. Use `props.children` for rendered content. */text: string;
176
178
  }) => React.ReactNode;
@@ -260,6 +262,7 @@ declare function createEditableBlock<TSchemaShape extends Record<string, TSchema
260
262
  "data-camox-overlay-mode"?: string;
261
263
  onMouseEnter?: () => void;
262
264
  onMouseLeave?: () => void;
265
+ onClickCapture?: (event: React.MouseEvent<HTMLElement>) => void;
263
266
  }, data: {
264
267
  text: string;
265
268
  href: string;
@@ -530,6 +533,7 @@ declare function createEditableBlock<TSchemaShape extends Record<string, TSchema
530
533
  "data-camox-overlay-mode"?: string;
531
534
  onMouseEnter?: () => void;
532
535
  onMouseLeave?: () => void;
536
+ onClickCapture?: (event: React.MouseEvent<HTMLElement>) => void;
533
537
  }, data: {
534
538
  /** Raw markdown source. Use `props.children` for rendered content. */text: string;
535
539
  }) => React.ReactNode;
@@ -629,6 +633,7 @@ declare function createEditableBlock<TSchemaShape extends Record<string, TSchema
629
633
  "data-camox-overlay-mode"?: string;
630
634
  onMouseEnter?: () => void;
631
635
  onMouseLeave?: () => void;
636
+ onClickCapture?: (event: React.MouseEvent<HTMLElement>) => void;
632
637
  }, data: {
633
638
  text: string;
634
639
  href: string;
@@ -1254,6 +1259,7 @@ declare function createEditableBlock<TSchemaShape extends Record<string, TSchema
1254
1259
  "data-camox-overlay-mode"?: string;
1255
1260
  onMouseEnter?: () => void;
1256
1261
  onMouseLeave?: () => void;
1262
+ onClickCapture?: (event: React.MouseEvent<HTMLElement>) => void;
1257
1263
  }, data: {
1258
1264
  /** Raw markdown source. Use `props.children` for rendered content. */text: string;
1259
1265
  }) => React.ReactNode;
@@ -1281,6 +1287,7 @@ declare function createEditableBlock<TSchemaShape extends Record<string, TSchema
1281
1287
  "data-camox-overlay-mode"?: string;
1282
1288
  onMouseEnter?: () => void;
1283
1289
  onMouseLeave?: () => void;
1290
+ onClickCapture?: (event: React.MouseEvent<HTMLElement>) => void;
1284
1291
  }, data: {
1285
1292
  text: string;
1286
1293
  href: string;