camox 0.34.0 → 0.35.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 (73) hide show
  1. package/dist/core/components/lexical/InlineLexicalEditor.js +1 -1
  2. package/dist/core/components/lexical/SidebarLexicalEditor.js +7 -7
  3. package/dist/core/components/lexical/TextLinkPopover.js +4 -4
  4. package/dist/core/createApp.d.ts +2 -1
  5. package/dist/core/createBlock.d.ts +5 -1451
  6. package/dist/core/createBlock.js +449 -1602
  7. package/dist/core/editing/BlockEditingRuntime.js +36 -0
  8. package/dist/core/editing/CompleteBlockEditingRuntime.js +76 -0
  9. package/dist/core/editing/createEditableBlock.d.ts +1455 -0
  10. package/dist/core/editing/createEditableBlock.js +1751 -0
  11. package/dist/core/lib/lexicalState.js +1 -1
  12. package/dist/features/agent-chat/components/AgentChatSidebar.js +1 -1
  13. package/dist/features/content/components/AssetCard.js +1 -1
  14. package/dist/features/page/PublishedPageContent.js +236 -0
  15. package/dist/features/page/PublishedPageExperience.js +23 -0
  16. package/dist/features/preview/CamoxPreview.d.ts +1 -0
  17. package/dist/features/preview/CamoxPreview.js +4 -4
  18. package/dist/features/preview/EditablePageContent.js +3 -0
  19. package/dist/features/preview/EditablePageExperience.js +24 -0
  20. package/dist/features/preview/components/AddBlockSidebar.js +3 -3
  21. package/dist/features/preview/components/AssetFieldEditor.js +1 -1
  22. package/dist/features/preview/components/AssetLightbox.js +46 -110
  23. package/dist/features/preview/components/BlockActionsPopover.js +6 -6
  24. package/dist/features/preview/components/CreatePageModal.js +4 -4
  25. package/dist/features/preview/components/DebouncedFieldEditor.js +2 -2
  26. package/dist/features/preview/components/DraftSwitchDialog.js +1 -1
  27. package/dist/features/preview/components/FieldToolbar.js +3 -3
  28. package/dist/features/preview/components/Frame.js +1 -1
  29. package/dist/features/preview/components/ItemFieldsEditor.js +3 -3
  30. package/dist/features/preview/components/LeftSidebar.js +1 -1
  31. package/dist/features/preview/components/LinkFieldEditor.js +3 -3
  32. package/dist/features/preview/components/Metadata.js +87 -0
  33. package/dist/features/preview/components/MultipleAssetFieldEditor.js +1 -1
  34. package/dist/features/preview/components/OverlayTracker.js +3 -3
  35. package/dist/features/preview/components/Overlays.js +3 -3
  36. package/dist/features/preview/components/PageEditorSidebar.js +5 -5
  37. package/dist/features/preview/components/PageInfoSidebar.js +157 -73
  38. package/dist/features/preview/components/PageLocationFieldset.js +1 -1
  39. package/dist/features/preview/components/PageNavigatorSidebar.js +4 -4
  40. package/dist/features/preview/components/PageNicknameField.js +2 -2
  41. package/dist/features/preview/components/PagePicker.js +3 -3
  42. package/dist/features/preview/components/PageTree.js +3 -3
  43. package/dist/features/preview/components/PeekedBlock.js +2 -2
  44. package/dist/features/preview/components/PreviewPanel.js +2 -2
  45. package/dist/features/preview/components/PreviewToolbar.js +2 -2
  46. package/dist/features/preview/components/PublishDialog.js +2 -2
  47. package/dist/features/preview/components/RepeatableItemsList.js +1 -1
  48. package/dist/features/preview/components/RightSidebar.js +1 -1
  49. package/dist/features/preview/components/useRepeatableItemActions.js +1 -1
  50. package/dist/features/preview/components/useUpdateBlockPosition.js +1 -1
  51. package/dist/features/provider/AuthenticatedCamoxProvider.js +63 -0
  52. package/dist/features/provider/CamoxProvider.d.ts +5 -12
  53. package/dist/features/provider/CamoxProvider.js +80 -338
  54. package/dist/features/provider/CoreCamoxProvider.js +37 -0
  55. package/dist/features/provider/LocalhostPreviewProvider.js +159 -0
  56. package/dist/features/provider/components/CommandPalette.js +1 -1
  57. package/dist/features/provider/useAdminShortcuts.js +1 -1
  58. package/dist/features/runtime/hydrationData.js +9 -0
  59. package/dist/features/runtime/pageApp.js +148 -35
  60. package/dist/features/runtime/pageClient.d.ts +1 -2
  61. package/dist/features/runtime/pageClient.js +3 -20
  62. package/dist/features/runtime/runtime.d.ts +1 -0
  63. package/dist/features/runtime/studioApp.js +76 -8
  64. package/dist/features/runtime/studioClient.d.ts +6 -0
  65. package/dist/features/runtime/studioClient.js +20 -0
  66. package/dist/features/studio/CamoxStudio.js +1 -1
  67. package/dist/features/studio/components/EnvironmentMenu.js +2 -2
  68. package/dist/features/studio/useTheme.js +1 -22
  69. package/dist/features/vite/runtimeDev.js +24 -3
  70. package/dist/features/vite/vite.js +7 -1
  71. package/dist/lib/normalized-data.js +6 -6
  72. package/dist/lib/view-queries.js +28 -0
  73. package/package.json +9 -4
@@ -0,0 +1,36 @@
1
+ import { c } from "react/compiler-runtime";
2
+ import * as React from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+
5
+ //#region src/core/editing/BlockEditingRuntime.tsx
6
+ const BlockEditingRuntimeContext = React.createContext(null);
7
+ function BlockEditingRuntimeProvider(t0) {
8
+ const $ = c(4);
9
+ if ($[0] !== "018faf594421b0a35898b0151f09f96da583a27bff230a04b3f1849452dbd5f1") {
10
+ for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
11
+ $[0] = "018faf594421b0a35898b0151f09f96da583a27bff230a04b3f1849452dbd5f1";
12
+ }
13
+ const { children, runtime } = t0;
14
+ let t1;
15
+ if ($[1] !== children || $[2] !== runtime) {
16
+ t1 = /* @__PURE__ */ jsx(BlockEditingRuntimeContext.Provider, {
17
+ value: runtime,
18
+ children
19
+ });
20
+ $[1] = children;
21
+ $[2] = runtime;
22
+ $[3] = t1;
23
+ } else t1 = $[3];
24
+ return t1;
25
+ }
26
+ function useBlockEditingRuntime() {
27
+ const $ = c(1);
28
+ if ($[0] !== "018faf594421b0a35898b0151f09f96da583a27bff230a04b3f1849452dbd5f1") {
29
+ for (let $i = 0; $i < 1; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
30
+ $[0] = "018faf594421b0a35898b0151f09f96da583a27bff230a04b3f1849452dbd5f1";
31
+ }
32
+ return React.useContext(BlockEditingRuntimeContext);
33
+ }
34
+
35
+ //#endregion
36
+ export { BlockEditingRuntimeProvider, useBlockEditingRuntime };
@@ -0,0 +1,76 @@
1
+ import { BlockEditingRuntimeProvider } from "./BlockEditingRuntime.js";
2
+ import { createEditableBlock } from "./createEditableBlock.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+
7
+ //#region src/core/editing/CompleteBlockEditingRuntime.tsx
8
+ const editableDefinitions = /* @__PURE__ */ new WeakMap();
9
+ function getEditableDefinition(options) {
10
+ let definition = editableDefinitions.get(options);
11
+ if (definition) return definition;
12
+ definition = createEditableBlock(options);
13
+ editableDefinitions.set(options, definition);
14
+ return definition;
15
+ }
16
+ function EditableBlock(t0) {
17
+ const $ = c(6);
18
+ if ($[0] !== "1831c7be6bdb574903d92ed788ce4950eb5e960930a89aedad2e2125bc6edd2a") {
19
+ for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
20
+ $[0] = "1831c7be6bdb574903d92ed788ce4950eb5e960930a89aedad2e2125bc6edd2a";
21
+ }
22
+ const { options, props } = t0;
23
+ let t1;
24
+ if ($[1] !== options) {
25
+ t1 = getEditableDefinition(options);
26
+ $[1] = options;
27
+ $[2] = t1;
28
+ } else t1 = $[2];
29
+ const Component = t1._internal.Component;
30
+ const t2 = props;
31
+ let t3;
32
+ if ($[3] !== Component || $[4] !== t2) {
33
+ t3 = /* @__PURE__ */ jsx(Component, { ...t2 });
34
+ $[3] = Component;
35
+ $[4] = t2;
36
+ $[5] = t3;
37
+ } else t3 = $[5];
38
+ return t3;
39
+ }
40
+ const completeEditingRuntime = {
41
+ getSetting(options, name) {
42
+ return getEditableDefinition(options).useSetting(name);
43
+ },
44
+ renderBlock(options, props) {
45
+ return /* @__PURE__ */ jsx(EditableBlock, {
46
+ options,
47
+ props
48
+ });
49
+ },
50
+ renderPrimitive(options, primitive, props) {
51
+ const Primitive = getEditableDefinition(options)[primitive];
52
+ if (!Primitive) throw new Error(`Unknown Camox editing primitive: ${primitive}`);
53
+ return /* @__PURE__ */ jsx(Primitive, { ...props });
54
+ }
55
+ };
56
+ function CompleteBlockEditingRuntimeProvider(t0) {
57
+ const $ = c(3);
58
+ if ($[0] !== "1831c7be6bdb574903d92ed788ce4950eb5e960930a89aedad2e2125bc6edd2a") {
59
+ for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
60
+ $[0] = "1831c7be6bdb574903d92ed788ce4950eb5e960930a89aedad2e2125bc6edd2a";
61
+ }
62
+ const { children } = t0;
63
+ let t1;
64
+ if ($[1] !== children) {
65
+ t1 = /* @__PURE__ */ jsx(BlockEditingRuntimeProvider, {
66
+ runtime: completeEditingRuntime,
67
+ children
68
+ });
69
+ $[1] = children;
70
+ $[2] = t1;
71
+ } else t1 = $[2];
72
+ return t1;
73
+ }
74
+
75
+ //#endregion
76
+ export { CompleteBlockEditingRuntimeProvider };