camox 0.47.0 → 0.51.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 (117) hide show
  1. package/dist/core/createApp.d.ts +19 -6
  2. package/dist/core/createApp.js +7 -2
  3. package/dist/core/createBlock.js +54 -43
  4. package/dist/core/createCollection.d.ts +25 -7
  5. package/dist/core/createCollection.js +28 -9
  6. package/dist/core/createLayout.d.ts +98 -71
  7. package/dist/core/createLayout.js +10 -16
  8. package/dist/core/derivedRoutes.js +1 -1
  9. package/dist/core/editing/BlockEditingRuntime.d.ts +3 -2
  10. package/dist/core/editing/CompleteBlockEditingRuntime.js +2 -1
  11. package/dist/core/editing/createEditableBlock.d.ts +59 -19
  12. package/dist/core/editing/createEditableBlock.js +162 -151
  13. package/dist/core/editing/useLatestRecord.js +7 -7
  14. package/dist/core/layoutContext.d.ts +55 -0
  15. package/dist/core/layoutContext.js +66 -0
  16. package/dist/core/lib/contentType.d.ts +91 -4
  17. package/dist/core/lib/contentType.js +84 -7
  18. package/dist/core/lib/recordScope.js +19 -17
  19. package/dist/core/lib/reference.d.ts +6 -2
  20. package/dist/core/recordItem.js +55 -2
  21. package/dist/core/requestContext.d.ts +18 -0
  22. package/dist/core/structuredData.d.ts +126 -0
  23. package/dist/core/structuredData.js +40 -0
  24. package/dist/features/canvas/canvasCamera.js +1 -1
  25. package/dist/features/canvas/sidebar/CanvasInspector.js +1 -1
  26. package/dist/features/canvas/sidebar/CanvasSidebarFrame.js +1 -1
  27. package/dist/features/content/ContentAssets.js +84 -88
  28. package/dist/features/content/ContentCollection.js +13 -7
  29. package/dist/features/content/collection-form.js +6 -2
  30. package/dist/features/content/components/MissingFromLocale.js +1 -1
  31. package/dist/features/og/pageImage.js +89 -0
  32. package/dist/features/page/CuratedPageContent.js +45 -32
  33. package/dist/features/page/DerivedPageContent.js +49 -22
  34. package/dist/features/page/SharedLayoutContent.js +26 -22
  35. package/dist/features/preview/CamoxPreview.js +41 -27
  36. package/dist/features/preview/EditablePageExperience.js +17 -9
  37. package/dist/features/preview/components/AddBlockSheet.js +1 -0
  38. package/dist/features/preview/components/BlockActionsPopover.js +19 -41
  39. package/dist/features/preview/components/FieldToolbar.js +1 -1
  40. package/dist/features/preview/components/MobilePreviewDrawer.js +6 -9
  41. package/dist/features/preview/components/PageInfo.js +244 -264
  42. package/dist/features/preview/components/PageTree.js +63 -53
  43. package/dist/features/preview/components/PreviewPanel.js +10 -64
  44. package/dist/features/preview/components/PreviewToolbar.js +1 -1
  45. package/dist/features/preview/components/RecordCard.js +50 -34
  46. package/dist/features/preview/components/RecordCombobox.js +12 -5
  47. package/dist/features/preview/components/ReferenceFieldEditor.js +4 -2
  48. package/dist/features/preview/components/ReferenceListFieldEditor.js +24 -19
  49. package/dist/features/preview/components/RepeatableItemsList.js +62 -46
  50. package/dist/features/preview/components/SelectionEditor.js +3 -2
  51. package/dist/features/preview/components/useFieldWriter.js +2 -4
  52. package/dist/features/preview/components/useRecordView.js +2 -2
  53. package/dist/features/preview/entityName.js +11 -0
  54. package/dist/features/preview/pageRecord.js +17 -18
  55. package/dist/features/preview/previewConstants.js +2 -8
  56. package/dist/features/preview/usePreviewViewportActions.js +1 -1
  57. package/dist/features/provider/AuthenticatedCamoxProvider.js +1 -1
  58. package/dist/features/provider/components/CommandPalette.js +2 -5
  59. package/dist/features/provider/signInShortcut.js +1 -2
  60. package/dist/features/provider/useAdminShortcuts.js +47 -53
  61. package/dist/features/routes/pageRuntime.d.ts +17 -2
  62. package/dist/features/routes/pageRuntime.js +61 -57
  63. package/dist/features/runtime/RuntimeChrome.js +1 -1
  64. package/dist/features/runtime/breadcrumbs.js +68 -0
  65. package/dist/features/runtime/livePages.js +3 -2
  66. package/dist/features/runtime/pageGraph.js +92 -0
  67. package/dist/features/runtime/projectLogo.js +110 -0
  68. package/dist/features/runtime/publicCache.js +83 -0
  69. package/dist/features/runtime/runtime.d.ts +24 -9
  70. package/dist/features/runtime/runtime.js +447 -130
  71. package/dist/features/runtime/runtimeRoutes.d.ts +1 -0
  72. package/dist/features/runtime/runtimeRoutes.js +1 -0
  73. package/dist/features/runtime/structuredData.js +213 -0
  74. package/dist/features/runtime/worker.d.ts +5 -1
  75. package/dist/features/runtime/worker.js +20 -3
  76. package/dist/features/settings/AnalyticsSettings.js +622 -0
  77. package/dist/features/settings/CamoxSettings.js +95 -0
  78. package/dist/features/settings/FaviconSettings.js +254 -0
  79. package/dist/features/settings/ProjectNameSettings.js +145 -0
  80. package/dist/features/settings/SettingsPart.js +73 -0
  81. package/dist/features/settings/SocialProfilesSettings.js +245 -0
  82. package/dist/features/settings/useProjectMutation.js +61 -0
  83. package/dist/features/studio/components/ChatSidebar.js +5 -5
  84. package/dist/features/studio/components/DraftsControl.js +136 -131
  85. package/dist/features/studio/components/LocalePicker.js +178 -174
  86. package/dist/features/studio/components/Navbar.js +107 -66
  87. package/dist/features/studio/components/ProjectMenu.js +85 -110
  88. package/dist/features/studio/components/ReviewDraftSheet.js +1046 -990
  89. package/dist/features/studio/components/ThreadMessages.js +2 -2
  90. package/dist/features/studio/components/UserButton.js +1 -1
  91. package/dist/features/studio/routes.js +3 -1
  92. package/dist/features/studio/showInCanvas.js +129 -0
  93. package/dist/features/vite/blockBoilerplate.js +3 -2
  94. package/dist/features/vite/definitionsSync.js +4 -5
  95. package/dist/features/vite/layoutGeneration.js +3 -2
  96. package/dist/features/vite/runtimeDev.js +32 -17
  97. package/dist/features/vite/staticAssetHeaders.js +52 -0
  98. package/dist/features/vite/vite.d.ts +1 -1
  99. package/dist/features/vite/vite.js +17 -4
  100. package/dist/lib/api-client-server.d.ts +1 -1
  101. package/dist/lib/api-client.d.ts +2 -1
  102. package/dist/lib/draft-scope.d.ts +1 -0
  103. package/dist/lib/locale-path.d.ts +3 -11
  104. package/dist/lib/locale-path.js +3 -27
  105. package/dist/lib/queries.d.ts +4 -0
  106. package/dist/lib/queries.js +8 -1
  107. package/dist/lib/shortcuts.js +29 -0
  108. package/dist/lib/studio-reads.d.ts +1 -0
  109. package/dist/lib/studio-reads.js +3 -1
  110. package/dist/lib/utils.js +1 -104
  111. package/dist/package.js +1 -1
  112. package/dist/studio.css +1 -1
  113. package/package.json +6 -4
  114. package/skills/camox/references/block-definitions.md +105 -25
  115. package/skills/camox/references/layout-definitions.md +53 -17
  116. package/skills/camox/references/routed-layouts.md +17 -14
  117. package/dist/features/studio/components/FaviconDialog.js +0 -318
package/dist/lib/utils.js CHANGED
@@ -1,112 +1,9 @@
1
- import { PlatformLabel } from "../components/PlatformLabel.js";
2
- import { c } from "react/compiler-runtime";
3
- import { jsx } from "react/jsx-runtime";
4
- import { Kbd } from "@camox/ui/kbd";
5
1
  import { INPUT_BASE_STYLES, INPUT_FOCUS_STYLES, cn } from "@camox/ui/utils";
6
2
 
7
3
  //#region src/lib/utils.tsx
8
4
  function checkIfInputFocused(document = window.document) {
9
5
  return document.activeElement?.tagName === "INPUT" || document.activeElement?.tagName === "TEXTAREA" || (document.activeElement?.getAttribute("contenteditable") ?? "false") === "true";
10
6
  }
11
- /**
12
- * Formats an action shortcut into a keyboard shortcut display component.
13
- * Automatically detects the platform and uses the appropriate modifier keys.
14
- *
15
- * @param shortcut - The shortcut configuration from an Action
16
- * @returns React element displaying the keyboard shortcut
17
- *
18
- * @example
19
- * ```tsx
20
- * formatShortcut({ key: "e", withMeta: true }) // Returns <KbdGroup><Kbd>⌘</Kbd><Kbd>E</Kbd></KbdGroup>
21
- * formatShortcut({ key: "l" }) // Returns <Kbd>L</Kbd>
22
- * ```
23
- */
24
- function formatShortcut(shortcut) {
25
- if (!shortcut) return null;
26
- return /* @__PURE__ */ jsx(Shortcut, { shortcut });
27
- }
28
- function Shortcut(t0) {
29
- const $ = c(14);
30
- const { shortcut } = t0;
31
- let t1;
32
- bb0: {
33
- if (shortcut.key === "Enter") {
34
- t1 = "↵";
35
- break bb0;
36
- }
37
- if (shortcut.key === "Escape") {
38
- t1 = "Esc";
39
- break bb0;
40
- }
41
- if (shortcut.key === "Backspace") {
42
- t1 = "⌫";
43
- break bb0;
44
- }
45
- if (shortcut.key === "ArrowUp") {
46
- t1 = "↑";
47
- break bb0;
48
- }
49
- if (shortcut.key === "ArrowDown") {
50
- t1 = "↓";
51
- break bb0;
52
- }
53
- if (shortcut.key === "ArrowLeft") {
54
- t1 = "←";
55
- break bb0;
56
- }
57
- if (shortcut.key === "ArrowRight") {
58
- t1 = "→";
59
- break bb0;
60
- }
61
- let t2;
62
- if ($[0] !== shortcut.key) {
63
- t2 = shortcut.key.toUpperCase();
64
- $[0] = shortcut.key;
65
- $[1] = t2;
66
- } else t2 = $[1];
67
- t1 = t2;
68
- }
69
- const formattedKey = t1;
70
- let t2;
71
- if ($[2] !== formattedKey || $[3] !== shortcut.withAlt || $[4] !== shortcut.withMeta || $[5] !== shortcut.withShift) {
72
- t2 = (mac) => {
73
- const modifiers = [];
74
- if (shortcut.withMeta) modifiers.push(mac ? "⌘" : "Ctrl");
75
- if (shortcut.withAlt) modifiers.push(mac ? "⌥" : "Alt");
76
- if (shortcut.withShift) modifiers.push(mac ? "⇧" : "Shift");
77
- return `${modifiers.join()} ${formattedKey}`.trim();
78
- };
79
- $[2] = formattedKey;
80
- $[3] = shortcut.withAlt;
81
- $[4] = shortcut.withMeta;
82
- $[5] = shortcut.withShift;
83
- $[6] = t2;
84
- } else t2 = $[6];
85
- const label = t2;
86
- let t3;
87
- if ($[7] !== label) {
88
- t3 = label(true);
89
- $[7] = label;
90
- $[8] = t3;
91
- } else t3 = $[8];
92
- let t4;
93
- if ($[9] !== label) {
94
- t4 = label(false);
95
- $[9] = label;
96
- $[10] = t4;
97
- } else t4 = $[10];
98
- let t5;
99
- if ($[11] !== t3 || $[12] !== t4) {
100
- t5 = /* @__PURE__ */ jsx(Kbd, { children: /* @__PURE__ */ jsx(PlatformLabel, {
101
- mac: t3,
102
- other: t4
103
- }) });
104
- $[11] = t3;
105
- $[12] = t4;
106
- $[13] = t5;
107
- } else t5 = $[13];
108
- return t5;
109
- }
110
7
 
111
8
  //#endregion
112
- export { INPUT_BASE_STYLES, INPUT_FOCUS_STYLES, checkIfInputFocused, cn, formatShortcut };
9
+ export { INPUT_BASE_STYLES, INPUT_FOCUS_STYLES, checkIfInputFocused, cn };
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.47.0";
2
+ var version = "0.51.0";
3
3
 
4
4
  //#endregion
5
5
  export { version };