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.
- package/dist/core/createApp.d.ts +19 -6
- package/dist/core/createApp.js +7 -2
- package/dist/core/createBlock.js +54 -43
- package/dist/core/createCollection.d.ts +25 -7
- package/dist/core/createCollection.js +28 -9
- package/dist/core/createLayout.d.ts +98 -71
- package/dist/core/createLayout.js +10 -16
- package/dist/core/derivedRoutes.js +1 -1
- package/dist/core/editing/BlockEditingRuntime.d.ts +3 -2
- package/dist/core/editing/CompleteBlockEditingRuntime.js +2 -1
- package/dist/core/editing/createEditableBlock.d.ts +59 -19
- package/dist/core/editing/createEditableBlock.js +162 -151
- package/dist/core/editing/useLatestRecord.js +7 -7
- package/dist/core/layoutContext.d.ts +55 -0
- package/dist/core/layoutContext.js +66 -0
- package/dist/core/lib/contentType.d.ts +91 -4
- package/dist/core/lib/contentType.js +84 -7
- package/dist/core/lib/recordScope.js +19 -17
- package/dist/core/lib/reference.d.ts +6 -2
- package/dist/core/recordItem.js +55 -2
- package/dist/core/requestContext.d.ts +18 -0
- package/dist/core/structuredData.d.ts +126 -0
- package/dist/core/structuredData.js +40 -0
- package/dist/features/canvas/canvasCamera.js +1 -1
- package/dist/features/canvas/sidebar/CanvasInspector.js +1 -1
- package/dist/features/canvas/sidebar/CanvasSidebarFrame.js +1 -1
- package/dist/features/content/ContentAssets.js +84 -88
- package/dist/features/content/ContentCollection.js +13 -7
- package/dist/features/content/collection-form.js +6 -2
- package/dist/features/content/components/MissingFromLocale.js +1 -1
- package/dist/features/og/pageImage.js +89 -0
- package/dist/features/page/CuratedPageContent.js +45 -32
- package/dist/features/page/DerivedPageContent.js +49 -22
- package/dist/features/page/SharedLayoutContent.js +26 -22
- package/dist/features/preview/CamoxPreview.js +41 -27
- package/dist/features/preview/EditablePageExperience.js +17 -9
- package/dist/features/preview/components/AddBlockSheet.js +1 -0
- package/dist/features/preview/components/BlockActionsPopover.js +19 -41
- package/dist/features/preview/components/FieldToolbar.js +1 -1
- package/dist/features/preview/components/MobilePreviewDrawer.js +6 -9
- package/dist/features/preview/components/PageInfo.js +244 -264
- package/dist/features/preview/components/PageTree.js +63 -53
- package/dist/features/preview/components/PreviewPanel.js +10 -64
- package/dist/features/preview/components/PreviewToolbar.js +1 -1
- package/dist/features/preview/components/RecordCard.js +50 -34
- package/dist/features/preview/components/RecordCombobox.js +12 -5
- package/dist/features/preview/components/ReferenceFieldEditor.js +4 -2
- package/dist/features/preview/components/ReferenceListFieldEditor.js +24 -19
- package/dist/features/preview/components/RepeatableItemsList.js +62 -46
- package/dist/features/preview/components/SelectionEditor.js +3 -2
- package/dist/features/preview/components/useFieldWriter.js +2 -4
- package/dist/features/preview/components/useRecordView.js +2 -2
- package/dist/features/preview/entityName.js +11 -0
- package/dist/features/preview/pageRecord.js +17 -18
- package/dist/features/preview/previewConstants.js +2 -8
- package/dist/features/preview/usePreviewViewportActions.js +1 -1
- package/dist/features/provider/AuthenticatedCamoxProvider.js +1 -1
- package/dist/features/provider/components/CommandPalette.js +2 -5
- package/dist/features/provider/signInShortcut.js +1 -2
- package/dist/features/provider/useAdminShortcuts.js +47 -53
- package/dist/features/routes/pageRuntime.d.ts +17 -2
- package/dist/features/routes/pageRuntime.js +61 -57
- package/dist/features/runtime/RuntimeChrome.js +1 -1
- package/dist/features/runtime/breadcrumbs.js +68 -0
- package/dist/features/runtime/livePages.js +3 -2
- package/dist/features/runtime/pageGraph.js +92 -0
- package/dist/features/runtime/projectLogo.js +110 -0
- package/dist/features/runtime/publicCache.js +83 -0
- package/dist/features/runtime/runtime.d.ts +24 -9
- package/dist/features/runtime/runtime.js +447 -130
- package/dist/features/runtime/runtimeRoutes.d.ts +1 -0
- package/dist/features/runtime/runtimeRoutes.js +1 -0
- package/dist/features/runtime/structuredData.js +213 -0
- package/dist/features/runtime/worker.d.ts +5 -1
- package/dist/features/runtime/worker.js +20 -3
- package/dist/features/settings/AnalyticsSettings.js +622 -0
- package/dist/features/settings/CamoxSettings.js +95 -0
- package/dist/features/settings/FaviconSettings.js +254 -0
- package/dist/features/settings/ProjectNameSettings.js +145 -0
- package/dist/features/settings/SettingsPart.js +73 -0
- package/dist/features/settings/SocialProfilesSettings.js +245 -0
- package/dist/features/settings/useProjectMutation.js +61 -0
- package/dist/features/studio/components/ChatSidebar.js +5 -5
- package/dist/features/studio/components/DraftsControl.js +136 -131
- package/dist/features/studio/components/LocalePicker.js +178 -174
- package/dist/features/studio/components/Navbar.js +107 -66
- package/dist/features/studio/components/ProjectMenu.js +85 -110
- package/dist/features/studio/components/ReviewDraftSheet.js +1046 -990
- package/dist/features/studio/components/ThreadMessages.js +2 -2
- package/dist/features/studio/components/UserButton.js +1 -1
- package/dist/features/studio/routes.js +3 -1
- package/dist/features/studio/showInCanvas.js +129 -0
- package/dist/features/vite/blockBoilerplate.js +3 -2
- package/dist/features/vite/definitionsSync.js +4 -5
- package/dist/features/vite/layoutGeneration.js +3 -2
- package/dist/features/vite/runtimeDev.js +32 -17
- package/dist/features/vite/staticAssetHeaders.js +52 -0
- package/dist/features/vite/vite.d.ts +1 -1
- package/dist/features/vite/vite.js +17 -4
- package/dist/lib/api-client-server.d.ts +1 -1
- package/dist/lib/api-client.d.ts +2 -1
- package/dist/lib/draft-scope.d.ts +1 -0
- package/dist/lib/locale-path.d.ts +3 -11
- package/dist/lib/locale-path.js +3 -27
- package/dist/lib/queries.d.ts +4 -0
- package/dist/lib/queries.js +8 -1
- package/dist/lib/shortcuts.js +29 -0
- package/dist/lib/studio-reads.d.ts +1 -0
- package/dist/lib/studio-reads.js +3 -1
- package/dist/lib/utils.js +1 -104
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +6 -4
- package/skills/camox/references/block-definitions.md +105 -25
- package/skills/camox/references/layout-definitions.md +53 -17
- package/skills/camox/references/routed-layouts.md +17 -14
- 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
|
|
9
|
+
export { INPUT_BASE_STYLES, INPUT_FOCUS_STYLES, checkIfInputFocused, cn };
|
package/dist/package.js
CHANGED