camox 0.45.0 → 0.46.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 (39) hide show
  1. package/dist/core/hooks/useArtifactHost.js +2 -2
  2. package/dist/features/canvas/CamoxCanvas.js +438 -771
  3. package/dist/features/canvas/CanvasPageFrame.js +1 -3
  4. package/dist/features/canvas/CanvasPreviewPageSlot.js +26 -6
  5. package/dist/features/canvas/canvasCamera.js +3 -3
  6. package/dist/features/canvas/canvasFrameDocument.js +4 -19
  7. package/dist/features/canvas/canvasItems.js +12 -102
  8. package/dist/features/canvas/canvasStore.js +3 -92
  9. package/dist/features/canvas/sidebar/CanvasNavigator.js +81 -183
  10. package/dist/features/canvas/sidebar/CanvasSidebar.js +22 -28
  11. package/dist/features/canvas/sidebar/CuratedPageInspector.js +2 -2
  12. package/dist/features/canvas/useCanvasCamera.js +0 -20
  13. package/dist/features/canvas/useCanvasFrame.js +5 -6
  14. package/dist/features/preview/CamoxPreview.js +3 -3
  15. package/dist/features/preview/components/{AddBlockDialog.js → AddBlockSheet.js} +35 -32
  16. package/dist/features/preview/components/BlockActionsPopover.js +6 -6
  17. package/dist/features/preview/components/BlockThumbnail.js +31 -33
  18. package/dist/features/preview/components/Overlays.js +1 -1
  19. package/dist/features/preview/components/PageTree.js +1 -1
  20. package/dist/features/preview/components/PreviewPanel.js +1 -1
  21. package/dist/features/preview/previewStore.js +9 -9
  22. package/dist/features/provider/CoreCamoxProvider.js +9 -6
  23. package/dist/features/routes/pageRuntime.js +8 -8
  24. package/dist/features/runtime/runtime.d.ts +2 -7
  25. package/dist/features/runtime/runtime.js +6 -19
  26. package/dist/features/studio/FollowAgentProvider.js +11 -22
  27. package/dist/features/studio/components/FaviconDialog.js +3 -3
  28. package/dist/features/studio/followAgent.js +5 -14
  29. package/dist/features/studio/routes.js +1 -23
  30. package/dist/lib/auth.js +36 -24
  31. package/dist/lib/studio-reads.js +0 -20
  32. package/dist/package.js +1 -1
  33. package/dist/studio.css +1 -1
  34. package/package.json +4 -4
  35. package/skills/camox-expand/SKILL.md +5 -4
  36. package/dist/features/canvas/CanvasBlockFrame.js +0 -353
  37. package/dist/features/canvas/CanvasBlockHeader.js +0 -55
  38. package/dist/features/canvas/CanvasShelfMarker.js +0 -255
  39. package/dist/features/canvas/sidebar/CatalogBlockInspector.js +0 -189
@@ -1,189 +0,0 @@
1
- import { useLocation, useNavigate } from "../../navigation/navigation.js";
2
- import { reads, useReadQuery } from "../../../lib/studio-reads.js";
3
- import { useLocalizedPath } from "../../../lib/view-locale.js";
4
- import { CanvasInspectorBody, CanvasInspectorHeader, CanvasInspectorTitle } from "./CanvasInspector.js";
5
- import { c } from "react/compiler-runtime";
6
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
-
8
- //#region src/features/canvas/sidebar/CatalogBlockInspector.tsx
9
- function PagesMessage(t0) {
10
- const $ = c(3);
11
- const { role, children } = t0;
12
- let t1;
13
- if ($[0] !== children || $[1] !== role) {
14
- t1 = /* @__PURE__ */ jsx("p", {
15
- role,
16
- className: "text-muted-foreground text-sm",
17
- children
18
- });
19
- $[0] = children;
20
- $[1] = role;
21
- $[2] = t1;
22
- } else t1 = $[2];
23
- return t1;
24
- }
25
- /**
26
- * The Pages holding a placement of the block. Picking one selects it through
27
- * regular navigation, so the camera flies to it.
28
- */
29
- function PlacementPages(t0) {
30
- const $ = c(19);
31
- const { block, projectId } = t0;
32
- const { search, hash } = useLocation();
33
- const localized = useLocalizedPath();
34
- const navigate = useNavigate();
35
- let t1;
36
- if ($[0] !== block._internal.id || $[1] !== projectId) {
37
- t1 = reads.pagesUsingBlock({
38
- projectId,
39
- type: block._internal.id
40
- });
41
- $[0] = block._internal.id;
42
- $[1] = projectId;
43
- $[2] = t1;
44
- } else t1 = $[2];
45
- const pages = useReadQuery(t1);
46
- if (pages.isPending) {
47
- let t2;
48
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
49
- t2 = /* @__PURE__ */ jsx(PagesMessage, {
50
- role: "status",
51
- children: "Loading pages…"
52
- });
53
- $[3] = t2;
54
- } else t2 = $[3];
55
- return t2;
56
- }
57
- if (pages.error) {
58
- let t2;
59
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
60
- t2 = /* @__PURE__ */ jsx(PagesMessage, {
61
- role: "alert",
62
- children: "Could not load the pages using this block."
63
- });
64
- $[4] = t2;
65
- } else t2 = $[4];
66
- return t2;
67
- }
68
- if (pages.data.length === 0) {
69
- let t2;
70
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
71
- t2 = /* @__PURE__ */ jsx(PagesMessage, { children: "No pages use this block yet." });
72
- $[5] = t2;
73
- } else t2 = $[5];
74
- return t2;
75
- }
76
- let t2;
77
- if ($[6] !== hash || $[7] !== localized || $[8] !== navigate || $[9] !== pages.data || $[10] !== search) {
78
- let t3;
79
- if ($[12] !== hash || $[13] !== localized || $[14] !== navigate || $[15] !== search) {
80
- t3 = (page) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("button", {
81
- type: "button",
82
- className: "hover:bg-accent focus-visible:ring-ring flex w-full min-w-0 items-baseline justify-between gap-3 rounded-md px-2 py-1.5 text-left text-sm outline-none focus-visible:ring-2",
83
- onClick: () => void navigate({ to: `${localized(page.fullPath)}${search}${hash}` }),
84
- children: [/* @__PURE__ */ jsx("span", {
85
- className: "truncate",
86
- children: page.nickname
87
- }), /* @__PURE__ */ jsx("span", {
88
- className: "text-muted-foreground truncate",
89
- children: page.fullPath
90
- })]
91
- }) }, page.id);
92
- $[12] = hash;
93
- $[13] = localized;
94
- $[14] = navigate;
95
- $[15] = search;
96
- $[16] = t3;
97
- } else t3 = $[16];
98
- t2 = pages.data.map(t3);
99
- $[6] = hash;
100
- $[7] = localized;
101
- $[8] = navigate;
102
- $[9] = pages.data;
103
- $[10] = search;
104
- $[11] = t2;
105
- } else t2 = $[11];
106
- let t3;
107
- if ($[17] !== t2) {
108
- t3 = /* @__PURE__ */ jsx("ul", {
109
- className: "-mx-2 flex flex-col gap-0.5",
110
- children: t2
111
- });
112
- $[17] = t2;
113
- $[18] = t3;
114
- } else t3 = $[18];
115
- return t3;
116
- }
117
- /** A block of the Block Catalog: its description and the Pages holding its placements. */
118
- function CatalogBlockInspector(t0) {
119
- const $ = c(17);
120
- const { block, projectId, onBack } = t0;
121
- const { title, description } = block._internal;
122
- let t1;
123
- if ($[0] !== title) {
124
- t1 = /* @__PURE__ */ jsx(CanvasInspectorTitle, { children: title });
125
- $[0] = title;
126
- $[1] = t1;
127
- } else t1 = $[1];
128
- let t2;
129
- if ($[2] !== onBack || $[3] !== t1) {
130
- t2 = /* @__PURE__ */ jsx(CanvasInspectorHeader, {
131
- onBack,
132
- children: t1
133
- });
134
- $[2] = onBack;
135
- $[3] = t1;
136
- $[4] = t2;
137
- } else t2 = $[4];
138
- let t3;
139
- if ($[5] !== description) {
140
- t3 = description && /* @__PURE__ */ jsx("p", {
141
- className: "text-muted-foreground text-sm",
142
- children: description
143
- });
144
- $[5] = description;
145
- $[6] = t3;
146
- } else t3 = $[6];
147
- let t4;
148
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
149
- t4 = /* @__PURE__ */ jsx("p", {
150
- className: "text-sm font-medium",
151
- children: "Used on"
152
- });
153
- $[7] = t4;
154
- } else t4 = $[7];
155
- let t5;
156
- if ($[8] !== block || $[9] !== projectId) {
157
- t5 = /* @__PURE__ */ jsxs("section", {
158
- className: "space-y-2",
159
- children: [t4, /* @__PURE__ */ jsx(PlacementPages, {
160
- block,
161
- projectId
162
- })]
163
- });
164
- $[8] = block;
165
- $[9] = projectId;
166
- $[10] = t5;
167
- } else t5 = $[10];
168
- let t6;
169
- if ($[11] !== t3 || $[12] !== t5) {
170
- t6 = /* @__PURE__ */ jsx(CanvasInspectorBody, { children: /* @__PURE__ */ jsxs("div", {
171
- className: "flex min-h-0 flex-1 flex-col gap-6 overflow-auto p-4",
172
- children: [t3, t5]
173
- }) });
174
- $[11] = t3;
175
- $[12] = t5;
176
- $[13] = t6;
177
- } else t6 = $[13];
178
- let t7;
179
- if ($[14] !== t2 || $[15] !== t6) {
180
- t7 = /* @__PURE__ */ jsxs(Fragment, { children: [t2, t6] });
181
- $[14] = t2;
182
- $[15] = t6;
183
- $[16] = t7;
184
- } else t7 = $[16];
185
- return t7;
186
- }
187
-
188
- //#endregion
189
- export { CatalogBlockInspector };