camox 0.76.1 → 0.78.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/lib/artifactTheme.js +43 -6
- package/dist/features/canvas/CamoxCanvas.js +187 -197
- package/dist/features/canvas/canvasCameraController.js +1 -1
- package/dist/features/canvas/canvasItems.js +40 -9
- package/dist/features/canvas/sidebar/ContentSidebarFrame.js +15 -11
- package/dist/features/canvas/useCanvasLayout.js +34 -0
- package/dist/features/memory/CamoxMemory.js +747 -0
- package/dist/features/preview/EditablePageExperience.js +2 -0
- package/dist/features/runtime/publicCache.d.ts +2 -0
- package/dist/features/runtime/publicCache.js +27 -4
- package/dist/features/runtime/runtime.d.ts +1 -1
- package/dist/features/runtime/runtime.js +34 -15
- package/dist/features/studio/FollowAgentProvider.js +1 -1
- package/dist/features/studio/components/AgentSidebar.js +22 -16
- package/dist/features/studio/components/DraftBar.js +167 -103
- package/dist/features/studio/components/{ReviewDraftDialog.js → DraftReview.js} +191 -218
- package/dist/features/studio/components/DraftsControl.js +174 -202
- package/dist/features/studio/components/DraftsSheet.js +102 -94
- package/dist/features/studio/components/LocalePicker.js +518 -134
- package/dist/features/studio/components/Navbar.js +121 -84
- package/dist/features/studio/components/PublishedTab.js +21 -20
- package/dist/features/studio/routes.js +3 -1
- package/dist/features/studio/studioStore.js +12 -9
- package/dist/features/studio/usePublishDraft.js +116 -0
- package/dist/features/studio/viewSwitch.js +10 -7
- package/dist/lib/locale-path.js +2 -2
- package/dist/lib/queries.js +12 -2
- package/dist/lib/studio-reads.js +6 -0
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +5 -5
- package/skills/camox/references/artifacts.md +7 -0
- package/LICENSE.md +0 -21
|
@@ -16,146 +16,154 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@camox/ui/tabs";
|
|
|
16
16
|
/**
|
|
17
17
|
* The drafts no longer in progress, opened from the draft picker: a tab of archived drafts to
|
|
18
18
|
* restore or delete (ADR 0046), and a tab of Publications, to read why Live changed (ADR 0045).
|
|
19
|
+
* Opened on `publicationId`, it shows that Publication.
|
|
19
20
|
*/
|
|
20
21
|
function DraftsSheet(t0) {
|
|
21
|
-
const $ = c(
|
|
22
|
-
const { projectId, open, onOpenChange } = t0;
|
|
23
|
-
|
|
22
|
+
const $ = c(39);
|
|
23
|
+
const { projectId, open, publicationId: t1, onOpenChange } = t0;
|
|
24
|
+
const publicationId = t1 === void 0 ? null : t1;
|
|
25
|
+
let t2;
|
|
24
26
|
if ($[0] !== projectId) {
|
|
25
|
-
|
|
27
|
+
t2 = reads.archivedDrafts({ projectId });
|
|
26
28
|
$[0] = projectId;
|
|
27
|
-
$[1] =
|
|
28
|
-
} else
|
|
29
|
-
let
|
|
29
|
+
$[1] = t2;
|
|
30
|
+
} else t2 = $[1];
|
|
31
|
+
let t3;
|
|
30
32
|
if ($[2] !== open) {
|
|
31
|
-
|
|
33
|
+
t3 = { enabled: open };
|
|
32
34
|
$[2] = open;
|
|
33
|
-
$[3] =
|
|
34
|
-
} else
|
|
35
|
-
const archived = useReadQuery(
|
|
36
|
-
let
|
|
35
|
+
$[3] = t3;
|
|
36
|
+
} else t3 = $[3];
|
|
37
|
+
const archived = useReadQuery(t2, t3);
|
|
38
|
+
let t4;
|
|
37
39
|
if ($[4] !== projectId) {
|
|
38
|
-
|
|
40
|
+
t4 = reads.publications({ projectId });
|
|
39
41
|
$[4] = projectId;
|
|
40
|
-
$[5] =
|
|
41
|
-
} else
|
|
42
|
-
let
|
|
42
|
+
$[5] = t4;
|
|
43
|
+
} else t4 = $[5];
|
|
44
|
+
let t5;
|
|
43
45
|
if ($[6] !== open) {
|
|
44
|
-
|
|
46
|
+
t5 = { enabled: open };
|
|
45
47
|
$[6] = open;
|
|
46
|
-
$[7] =
|
|
47
|
-
} else
|
|
48
|
-
const publications = useReadQuery(
|
|
49
|
-
let
|
|
48
|
+
$[7] = t5;
|
|
49
|
+
} else t5 = $[7];
|
|
50
|
+
const publications = useReadQuery(t4, t5);
|
|
51
|
+
let t6;
|
|
50
52
|
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
51
|
-
|
|
53
|
+
t6 = /* @__PURE__ */ jsxs(SheetHeader, {
|
|
52
54
|
className: "border-b",
|
|
53
55
|
children: [/* @__PURE__ */ jsx(SheetTitle, { children: "Drafts" }), /* @__PURE__ */ jsx(SheetDescription, { children: "Drafts set aside, to bring back or delete, and what was published." })]
|
|
54
56
|
});
|
|
55
|
-
$[8] =
|
|
56
|
-
} else
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
$[8] = t6;
|
|
58
|
+
} else t6 = $[8];
|
|
59
|
+
const t7 = publicationId ?? "archived";
|
|
60
|
+
const t8 = publicationId ? "published" : "archived";
|
|
61
|
+
const t9 = archived.data?.length;
|
|
62
|
+
let t10;
|
|
63
|
+
if ($[9] !== t9) {
|
|
64
|
+
t10 = /* @__PURE__ */ jsxs(TabsTrigger, {
|
|
61
65
|
value: "archived",
|
|
62
|
-
children: ["Archived ", /* @__PURE__ */ jsx(TabCount, { count:
|
|
66
|
+
children: ["Archived ", /* @__PURE__ */ jsx(TabCount, { count: t9 })]
|
|
63
67
|
});
|
|
64
|
-
$[9] =
|
|
65
|
-
$[10] =
|
|
66
|
-
} else
|
|
67
|
-
const
|
|
68
|
-
let
|
|
69
|
-
if ($[11] !==
|
|
70
|
-
|
|
68
|
+
$[9] = t9;
|
|
69
|
+
$[10] = t10;
|
|
70
|
+
} else t10 = $[10];
|
|
71
|
+
const t11 = publications.data?.length;
|
|
72
|
+
let t12;
|
|
73
|
+
if ($[11] !== t11) {
|
|
74
|
+
t12 = /* @__PURE__ */ jsxs(TabsTrigger, {
|
|
71
75
|
value: "published",
|
|
72
|
-
children: ["Published ", /* @__PURE__ */ jsx(TabCount, { count:
|
|
76
|
+
children: ["Published ", /* @__PURE__ */ jsx(TabCount, { count: t11 })]
|
|
73
77
|
});
|
|
74
|
-
$[11] =
|
|
75
|
-
$[12] =
|
|
76
|
-
} else
|
|
77
|
-
let
|
|
78
|
-
if ($[13] !==
|
|
79
|
-
|
|
80
|
-
$[13] =
|
|
81
|
-
$[14] =
|
|
82
|
-
$[15] =
|
|
83
|
-
} else
|
|
84
|
-
let
|
|
78
|
+
$[11] = t11;
|
|
79
|
+
$[12] = t12;
|
|
80
|
+
} else t12 = $[12];
|
|
81
|
+
let t13;
|
|
82
|
+
if ($[13] !== t10 || $[14] !== t12) {
|
|
83
|
+
t13 = /* @__PURE__ */ jsxs(TabsList, { children: [t10, t12] });
|
|
84
|
+
$[13] = t10;
|
|
85
|
+
$[14] = t12;
|
|
86
|
+
$[15] = t13;
|
|
87
|
+
} else t13 = $[15];
|
|
88
|
+
let t14;
|
|
85
89
|
if ($[16] !== onOpenChange || $[17] !== open || $[18] !== projectId) {
|
|
86
|
-
|
|
90
|
+
t14 = open && /* @__PURE__ */ jsx(ArchivedDrafts, {
|
|
87
91
|
projectId,
|
|
88
92
|
onRestored: () => onOpenChange(false)
|
|
89
93
|
});
|
|
90
94
|
$[16] = onOpenChange;
|
|
91
95
|
$[17] = open;
|
|
92
96
|
$[18] = projectId;
|
|
93
|
-
$[19] =
|
|
94
|
-
} else
|
|
95
|
-
let
|
|
96
|
-
if ($[20] !==
|
|
97
|
-
|
|
97
|
+
$[19] = t14;
|
|
98
|
+
} else t14 = $[19];
|
|
99
|
+
let t15;
|
|
100
|
+
if ($[20] !== t14) {
|
|
101
|
+
t15 = /* @__PURE__ */ jsx(TabsContent, {
|
|
98
102
|
value: "archived",
|
|
99
103
|
className: "overflow-y-auto",
|
|
100
|
-
children:
|
|
104
|
+
children: t14
|
|
101
105
|
});
|
|
102
|
-
$[20] =
|
|
103
|
-
$[21] =
|
|
104
|
-
} else
|
|
105
|
-
let
|
|
106
|
-
if ($[22] !== onOpenChange || $[23] !== open || $[24] !== projectId) {
|
|
107
|
-
|
|
106
|
+
$[20] = t14;
|
|
107
|
+
$[21] = t15;
|
|
108
|
+
} else t15 = $[21];
|
|
109
|
+
let t16;
|
|
110
|
+
if ($[22] !== onOpenChange || $[23] !== open || $[24] !== projectId || $[25] !== publicationId) {
|
|
111
|
+
t16 = open && /* @__PURE__ */ jsx(PublishedTab, {
|
|
108
112
|
projectId,
|
|
113
|
+
opening: publicationId,
|
|
109
114
|
onEntered: () => onOpenChange(false)
|
|
110
115
|
});
|
|
111
116
|
$[22] = onOpenChange;
|
|
112
117
|
$[23] = open;
|
|
113
118
|
$[24] = projectId;
|
|
114
|
-
$[25] =
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
$[25] = publicationId;
|
|
120
|
+
$[26] = t16;
|
|
121
|
+
} else t16 = $[26];
|
|
122
|
+
let t17;
|
|
123
|
+
if ($[27] !== t16) {
|
|
124
|
+
t17 = /* @__PURE__ */ jsx(TabsContent, {
|
|
119
125
|
value: "published",
|
|
120
126
|
className: "overflow-y-auto",
|
|
121
|
-
children:
|
|
127
|
+
children: t16
|
|
122
128
|
});
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
} else
|
|
126
|
-
let
|
|
127
|
-
if ($[
|
|
128
|
-
|
|
129
|
+
$[27] = t16;
|
|
130
|
+
$[28] = t17;
|
|
131
|
+
} else t17 = $[28];
|
|
132
|
+
let t18;
|
|
133
|
+
if ($[29] !== t13 || $[30] !== t15 || $[31] !== t17 || $[32] !== t7 || $[33] !== t8) {
|
|
134
|
+
t18 = /* @__PURE__ */ jsxs(SheetContent, {
|
|
129
135
|
side: "right",
|
|
130
136
|
className: "gap-0 data-[side=right]:sm:max-w-3xl",
|
|
131
|
-
children: [
|
|
132
|
-
defaultValue:
|
|
137
|
+
children: [t6, /* @__PURE__ */ jsxs(Tabs, {
|
|
138
|
+
defaultValue: t8,
|
|
133
139
|
className: "flex-1 overflow-hidden p-4",
|
|
134
140
|
children: [
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
141
|
+
t13,
|
|
142
|
+
t15,
|
|
143
|
+
t17
|
|
138
144
|
]
|
|
139
|
-
})]
|
|
145
|
+
}, t7)]
|
|
140
146
|
});
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
$[29] = t13;
|
|
148
|
+
$[30] = t15;
|
|
149
|
+
$[31] = t17;
|
|
150
|
+
$[32] = t7;
|
|
151
|
+
$[33] = t8;
|
|
152
|
+
$[34] = t18;
|
|
153
|
+
} else t18 = $[34];
|
|
154
|
+
let t19;
|
|
155
|
+
if ($[35] !== onOpenChange || $[36] !== open || $[37] !== t18) {
|
|
156
|
+
t19 = /* @__PURE__ */ jsx(Sheet, {
|
|
149
157
|
open,
|
|
150
158
|
onOpenChange,
|
|
151
|
-
children:
|
|
159
|
+
children: t18
|
|
152
160
|
});
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
} else
|
|
158
|
-
return
|
|
161
|
+
$[35] = onOpenChange;
|
|
162
|
+
$[36] = open;
|
|
163
|
+
$[37] = t18;
|
|
164
|
+
$[38] = t19;
|
|
165
|
+
} else t19 = $[38];
|
|
166
|
+
return t19;
|
|
159
167
|
}
|
|
160
168
|
/** How many items a tab holds, once they've loaded. */
|
|
161
169
|
function TabCount(t0) {
|