camox 0.77.0 → 0.79.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/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 +756 -0
- package/dist/features/memory/VoiceGroup.js +350 -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} +214 -218
- package/dist/features/studio/components/DraftsControl.js +174 -202
- package/dist/features/studio/components/DraftsSheet.js +102 -94
- 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/features/vite/vite.js +1 -0
- package/dist/lib/queries.js +11 -1
- package/dist/lib/studio-reads.d.ts +1 -0
- package/dist/lib/studio-reads.js +12 -0
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +5 -5
- 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) {
|
|
@@ -4,7 +4,7 @@ import { actionsStore } from "../../provider/actionsStore.js";
|
|
|
4
4
|
import { cn } from "../../../lib/utils.js";
|
|
5
5
|
import { usePageDestinations } from "../../../hooks/use-page-destinations.js";
|
|
6
6
|
import { useLocalePath, useLocalizedPath } from "../../../lib/view-locale.js";
|
|
7
|
-
import { STUDIO_BASE_PATH, STUDIO_CONTENT_PATH, STUDIO_SETTINGS_PATH } from "../routes.js";
|
|
7
|
+
import { STUDIO_BASE_PATH, STUDIO_CONTENT_PATH, STUDIO_MEMORY_PATH, STUDIO_SETTINGS_PATH } from "../routes.js";
|
|
8
8
|
import { studioStore } from "../studioStore.js";
|
|
9
9
|
import { UserButton } from "./UserButton.js";
|
|
10
10
|
import { ConnectAgent } from "./ConnectAgent.js";
|
|
@@ -16,28 +16,43 @@ import * as React from "react";
|
|
|
16
16
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
17
17
|
import { useSelector } from "@xstate/store-react";
|
|
18
18
|
import { buttonVariants } from "@camox/ui/button";
|
|
19
|
-
import { Database, Globe } from "lucide-react";
|
|
19
|
+
import { Brain, Database, Globe } from "lucide-react";
|
|
20
20
|
|
|
21
21
|
//#region src/features/studio/components/Navbar.tsx
|
|
22
|
-
const links = [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
const links = [
|
|
23
|
+
{
|
|
24
|
+
to: "/",
|
|
25
|
+
title: "Website",
|
|
26
|
+
isWebsite: true,
|
|
27
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Globe, {}), "Website"] }),
|
|
28
|
+
icon: "Globe",
|
|
29
|
+
aliases: ["Website"]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
to: STUDIO_MEMORY_PATH,
|
|
33
|
+
title: "Memory",
|
|
34
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Brain, {}), "Memory"] }),
|
|
35
|
+
icon: "Brain",
|
|
36
|
+
aliases: [
|
|
37
|
+
"Memory",
|
|
38
|
+
"Memories",
|
|
39
|
+
"Remember"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
to: STUDIO_CONTENT_PATH,
|
|
44
|
+
title: "Content",
|
|
45
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Database, {}), "Content"] }),
|
|
46
|
+
icon: "FileText",
|
|
47
|
+
aliases: [
|
|
48
|
+
"Content",
|
|
49
|
+
"Pages",
|
|
50
|
+
"CMS"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
];
|
|
40
54
|
const getNavbarLinks = () => links;
|
|
55
|
+
const WEBSITE_LINK = links.find((link) => link.isWebsite);
|
|
41
56
|
/**
|
|
42
57
|
* Where a navbar link goes. The Website goes back where it was last, Canvas included. In another
|
|
43
58
|
* locale since, a Studio location stays, while a page, whose path may differ there, goes home.
|
|
@@ -48,11 +63,25 @@ function navbarHref(link, last, locale, localized) {
|
|
|
48
63
|
if (last.path.startsWith(`${"/camox"}/`)) return localized(last.path);
|
|
49
64
|
return localized(link.to);
|
|
50
65
|
}
|
|
66
|
+
/** Where the Website link goes now: where the website was last, Canvas included. */
|
|
67
|
+
function useWebsiteHref() {
|
|
68
|
+
const $ = c(3);
|
|
69
|
+
const localized = useLocalizedPath();
|
|
70
|
+
const { locale } = useViewLocale();
|
|
71
|
+
let t0;
|
|
72
|
+
if ($[0] !== locale.tag || $[1] !== localized) {
|
|
73
|
+
t0 = () => navbarHref(WEBSITE_LINK, studioStore.getSnapshot().context.websiteLocation, locale.tag, localized);
|
|
74
|
+
$[0] = locale.tag;
|
|
75
|
+
$[1] = localized;
|
|
76
|
+
$[2] = t0;
|
|
77
|
+
} else t0 = $[2];
|
|
78
|
+
return t0;
|
|
79
|
+
}
|
|
51
80
|
/** Whether `pathname` is in the studio section at `sectionPath`. */
|
|
52
81
|
const isInSection = (sectionPath, pathname) => pathname === sectionPath || pathname.startsWith(`${sectionPath}/`);
|
|
53
82
|
const isSettingsNavbarPath = (pathname) => isInSection(STUDIO_SETTINGS_PATH, pathname);
|
|
54
83
|
const Navbar = (t0) => {
|
|
55
|
-
const $ = c(
|
|
84
|
+
const $ = c(28);
|
|
56
85
|
const { isWebsite: t1, recordPage } = t0;
|
|
57
86
|
const isWebsite = t1 === void 0 ? false : t1;
|
|
58
87
|
const pages = usePageDestinations();
|
|
@@ -68,43 +97,51 @@ const Navbar = (t0) => {
|
|
|
68
97
|
} else t2 = $[1];
|
|
69
98
|
const isSettings = t2;
|
|
70
99
|
let t3;
|
|
71
|
-
if ($[2]
|
|
72
|
-
t3 =
|
|
73
|
-
$[2] =
|
|
74
|
-
|
|
100
|
+
if ($[2] !== pathname) {
|
|
101
|
+
t3 = isInSection(STUDIO_MEMORY_PATH, pathname);
|
|
102
|
+
$[2] = pathname;
|
|
103
|
+
$[3] = t3;
|
|
104
|
+
} else t3 = $[3];
|
|
105
|
+
const isMemory = t3;
|
|
75
106
|
let t4;
|
|
76
|
-
if ($[
|
|
77
|
-
t4 = /* @__PURE__ */ jsx(
|
|
78
|
-
$[3] = isSettings;
|
|
107
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
108
|
+
t4 = /* @__PURE__ */ jsx(ProjectMenu, {});
|
|
79
109
|
$[4] = t4;
|
|
80
110
|
} else t4 = $[4];
|
|
81
111
|
let t5;
|
|
82
|
-
if ($[5] !== isSettings
|
|
83
|
-
t5 = /* @__PURE__ */ jsx(
|
|
112
|
+
if ($[5] !== isSettings) {
|
|
113
|
+
t5 = /* @__PURE__ */ jsx(DraftPicker, { disabled: isSettings });
|
|
114
|
+
$[5] = isSettings;
|
|
115
|
+
$[6] = t5;
|
|
116
|
+
} else t5 = $[6];
|
|
117
|
+
const t6 = isSettings || isMemory;
|
|
118
|
+
let t7;
|
|
119
|
+
if ($[7] !== recordPage || $[8] !== t6) {
|
|
120
|
+
t7 = /* @__PURE__ */ jsx(LocalePicker, {
|
|
84
121
|
recordPage,
|
|
85
|
-
disabled:
|
|
122
|
+
disabled: t6
|
|
86
123
|
});
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
} else
|
|
91
|
-
let
|
|
92
|
-
if ($[
|
|
93
|
-
|
|
124
|
+
$[7] = recordPage;
|
|
125
|
+
$[8] = t6;
|
|
126
|
+
$[9] = t7;
|
|
127
|
+
} else t7 = $[9];
|
|
128
|
+
let t8;
|
|
129
|
+
if ($[10] !== t5 || $[11] !== t7) {
|
|
130
|
+
t8 = /* @__PURE__ */ jsxs("div", {
|
|
94
131
|
className: "flex items-center gap-1",
|
|
95
132
|
children: [
|
|
96
|
-
t3,
|
|
97
133
|
t4,
|
|
98
|
-
t5
|
|
134
|
+
t5,
|
|
135
|
+
t7
|
|
99
136
|
]
|
|
100
137
|
});
|
|
101
|
-
$[
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
104
|
-
} else
|
|
105
|
-
let
|
|
106
|
-
if ($[
|
|
107
|
-
|
|
138
|
+
$[10] = t5;
|
|
139
|
+
$[11] = t7;
|
|
140
|
+
$[12] = t8;
|
|
141
|
+
} else t8 = $[12];
|
|
142
|
+
let t9;
|
|
143
|
+
if ($[13] !== isWebsite || $[14] !== last || $[15] !== locale || $[16] !== localized || $[17] !== pages || $[18] !== pathname) {
|
|
144
|
+
t9 = getNavbarLinks().map((link) => {
|
|
108
145
|
const isActive = link.isWebsite ? isWebsite || !!pages?.some((page) => page.fullPath === pathname) : isInSection(link.to, pathname);
|
|
109
146
|
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link$1, {
|
|
110
147
|
to: navbarHref(link, last, locale.tag, localized),
|
|
@@ -114,51 +151,51 @@ const Navbar = (t0) => {
|
|
|
114
151
|
children: link.children
|
|
115
152
|
}) }, link.to);
|
|
116
153
|
});
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
} else
|
|
125
|
-
let
|
|
126
|
-
if ($[
|
|
127
|
-
|
|
154
|
+
$[13] = isWebsite;
|
|
155
|
+
$[14] = last;
|
|
156
|
+
$[15] = locale;
|
|
157
|
+
$[16] = localized;
|
|
158
|
+
$[17] = pages;
|
|
159
|
+
$[18] = pathname;
|
|
160
|
+
$[19] = t9;
|
|
161
|
+
} else t9 = $[19];
|
|
162
|
+
let t10;
|
|
163
|
+
if ($[20] !== t9) {
|
|
164
|
+
t10 = /* @__PURE__ */ jsx("ul", {
|
|
128
165
|
className: "flex items-center gap-1",
|
|
129
|
-
children:
|
|
166
|
+
children: t9
|
|
130
167
|
});
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
} else
|
|
134
|
-
let
|
|
135
|
-
if ($[
|
|
136
|
-
|
|
168
|
+
$[20] = t9;
|
|
169
|
+
$[21] = t10;
|
|
170
|
+
} else t10 = $[21];
|
|
171
|
+
let t11;
|
|
172
|
+
if ($[22] !== t10 || $[23] !== t8) {
|
|
173
|
+
t11 = /* @__PURE__ */ jsxs("div", {
|
|
137
174
|
className: "flex flex-row gap-2",
|
|
138
|
-
children: [
|
|
175
|
+
children: [t8, t10]
|
|
139
176
|
});
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
} else
|
|
144
|
-
let
|
|
145
|
-
if ($[
|
|
146
|
-
|
|
177
|
+
$[22] = t10;
|
|
178
|
+
$[23] = t8;
|
|
179
|
+
$[24] = t11;
|
|
180
|
+
} else t11 = $[24];
|
|
181
|
+
let t12;
|
|
182
|
+
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
183
|
+
t12 = /* @__PURE__ */ jsxs("div", {
|
|
147
184
|
className: "flex items-center gap-2",
|
|
148
185
|
children: [/* @__PURE__ */ jsx(ConnectAgent, {}), /* @__PURE__ */ jsx(UserButton, {})]
|
|
149
186
|
});
|
|
150
|
-
$[
|
|
151
|
-
} else
|
|
152
|
-
let
|
|
153
|
-
if ($[
|
|
154
|
-
|
|
187
|
+
$[25] = t12;
|
|
188
|
+
} else t12 = $[25];
|
|
189
|
+
let t13;
|
|
190
|
+
if ($[26] !== t11) {
|
|
191
|
+
t13 = /* @__PURE__ */ jsxs("nav", {
|
|
155
192
|
className: "bg-background relative flex items-center justify-between gap-4 border-b px-2 py-2",
|
|
156
|
-
children: [
|
|
193
|
+
children: [t11, t12]
|
|
157
194
|
});
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
} else
|
|
161
|
-
return
|
|
195
|
+
$[26] = t11;
|
|
196
|
+
$[27] = t13;
|
|
197
|
+
} else t13 = $[27];
|
|
198
|
+
return t13;
|
|
162
199
|
};
|
|
163
200
|
function useNavbarActions() {
|
|
164
201
|
const $ = c(5);
|
|
@@ -240,4 +277,4 @@ function _temp(state) {
|
|
|
240
277
|
}
|
|
241
278
|
|
|
242
279
|
//#endregion
|
|
243
|
-
export { Navbar, useNavbarActions };
|
|
280
|
+
export { Navbar, useNavbarActions, useWebsiteHref };
|
|
@@ -17,45 +17,46 @@ import { Spinner } from "@camox/ui/spinner";
|
|
|
17
17
|
|
|
18
18
|
//#region src/features/studio/components/PublishedTab.tsx
|
|
19
19
|
/**
|
|
20
|
-
* The Publications (ADR 0045), the latest first. Opening one shows its
|
|
21
|
-
* read-only: how a member finds out why Live changed. Reverting one takes
|
|
22
|
-
* draft it starts, once `onEntered` closed the sheet.
|
|
20
|
+
* The Publications (ADR 0045), the latest first, or the one `opening` names. Opening one shows its
|
|
21
|
+
* overview and its thread, read-only: how a member finds out why Live changed. Reverting one takes
|
|
22
|
+
* the member into the draft it starts, once `onEntered` closed the sheet.
|
|
23
23
|
*/
|
|
24
24
|
function PublishedTab(t0) {
|
|
25
25
|
const $ = c(7);
|
|
26
|
-
const { projectId, onEntered } = t0;
|
|
27
|
-
const
|
|
26
|
+
const { projectId, opening: t1, onEntered } = t0;
|
|
27
|
+
const opening = t1 === void 0 ? null : t1;
|
|
28
|
+
const [opened, setOpened] = React.useState(opening);
|
|
28
29
|
if (opened) {
|
|
29
|
-
let t1;
|
|
30
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
31
|
-
t1 = () => setOpened(null);
|
|
32
|
-
$[0] = t1;
|
|
33
|
-
} else t1 = $[0];
|
|
34
30
|
let t2;
|
|
31
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
32
|
+
t2 = () => setOpened(null);
|
|
33
|
+
$[0] = t2;
|
|
34
|
+
} else t2 = $[0];
|
|
35
|
+
let t3;
|
|
35
36
|
if ($[1] !== onEntered || $[2] !== opened || $[3] !== projectId) {
|
|
36
|
-
|
|
37
|
+
t3 = /* @__PURE__ */ jsx(PublicationView, {
|
|
37
38
|
projectId,
|
|
38
39
|
id: opened,
|
|
39
|
-
onBack:
|
|
40
|
+
onBack: t2,
|
|
40
41
|
onEntered
|
|
41
42
|
});
|
|
42
43
|
$[1] = onEntered;
|
|
43
44
|
$[2] = opened;
|
|
44
45
|
$[3] = projectId;
|
|
45
|
-
$[4] =
|
|
46
|
-
} else
|
|
47
|
-
return
|
|
46
|
+
$[4] = t3;
|
|
47
|
+
} else t3 = $[4];
|
|
48
|
+
return t3;
|
|
48
49
|
}
|
|
49
|
-
let
|
|
50
|
+
let t2;
|
|
50
51
|
if ($[5] !== projectId) {
|
|
51
|
-
|
|
52
|
+
t2 = /* @__PURE__ */ jsx(PublicationList, {
|
|
52
53
|
projectId,
|
|
53
54
|
onOpen: setOpened
|
|
54
55
|
});
|
|
55
56
|
$[5] = projectId;
|
|
56
|
-
$[6] =
|
|
57
|
-
} else
|
|
58
|
-
return
|
|
57
|
+
$[6] = t2;
|
|
58
|
+
} else t2 = $[6];
|
|
59
|
+
return t2;
|
|
59
60
|
}
|
|
60
61
|
function PublicationList(t0) {
|
|
61
62
|
const $ = c(16);
|
|
@@ -3,6 +3,8 @@ const STUDIO_ROUTE_SEGMENT = "camox";
|
|
|
3
3
|
const STUDIO_BASE_PATH = `/${STUDIO_ROUTE_SEGMENT}`;
|
|
4
4
|
const STUDIO_CONTENT_PATH = `${STUDIO_BASE_PATH}/content`;
|
|
5
5
|
const STUDIO_ASSETS_PATH = `${STUDIO_CONTENT_PATH}/assets`;
|
|
6
|
+
/** The Memory Section, where members see and correct what Camox's agent remembers. */
|
|
7
|
+
const STUDIO_MEMORY_PATH = `${STUDIO_BASE_PATH}/memory`;
|
|
6
8
|
/** The Settings Section, where members change Project Settings. */
|
|
7
9
|
const STUDIO_SETTINGS_PATH = `${STUDIO_BASE_PATH}/settings`;
|
|
8
10
|
const collectionContentPath = (collectionId) => `${STUDIO_CONTENT_PATH}/collections/${encodeURIComponent(collectionId)}`;
|
|
@@ -32,4 +34,4 @@ function matchCollectionContentPath(pathname) {
|
|
|
32
34
|
const STUDIO_CANVAS_PATH = `${STUDIO_BASE_PATH}/canvas`;
|
|
33
35
|
|
|
34
36
|
//#endregion
|
|
35
|
-
export { STUDIO_ASSETS_PATH, STUDIO_BASE_PATH, STUDIO_CANVAS_PATH, STUDIO_CONTENT_PATH, STUDIO_ROUTE_SEGMENT, STUDIO_SETTINGS_PATH, collectionContentPath, editCollectionItemPath, matchCollectionContentPath };
|
|
37
|
+
export { STUDIO_ASSETS_PATH, STUDIO_BASE_PATH, STUDIO_CANVAS_PATH, STUDIO_CONTENT_PATH, STUDIO_MEMORY_PATH, STUDIO_ROUTE_SEGMENT, STUDIO_SETTINGS_PATH, collectionContentPath, editCollectionItemPath, matchCollectionContentPath };
|
|
@@ -5,8 +5,9 @@ const studioStore = createStore({
|
|
|
5
5
|
context: {
|
|
6
6
|
isCommandPaletteOpen: false,
|
|
7
7
|
commandPalettePages: [],
|
|
8
|
-
|
|
8
|
+
isDraftReviewOpen: false,
|
|
9
9
|
isDraftsSheetOpen: false,
|
|
10
|
+
draftsSheetPublication: null,
|
|
10
11
|
localeDialog: null,
|
|
11
12
|
websiteLocation: null,
|
|
12
13
|
agentMessages: [],
|
|
@@ -46,28 +47,30 @@ const studioStore = createStore({
|
|
|
46
47
|
commandPalettePages: context.commandPalettePages.slice(0, -1)
|
|
47
48
|
};
|
|
48
49
|
},
|
|
49
|
-
|
|
50
|
+
openDraftReview: (context) => {
|
|
50
51
|
return {
|
|
51
52
|
...context,
|
|
52
|
-
|
|
53
|
+
isDraftReviewOpen: true
|
|
53
54
|
};
|
|
54
55
|
},
|
|
55
|
-
|
|
56
|
+
closeDraftReview: (context) => {
|
|
56
57
|
return {
|
|
57
58
|
...context,
|
|
58
|
-
|
|
59
|
+
isDraftReviewOpen: false
|
|
59
60
|
};
|
|
60
61
|
},
|
|
61
|
-
openDraftsSheet: (context) => {
|
|
62
|
+
openDraftsSheet: (context, event) => {
|
|
62
63
|
return {
|
|
63
64
|
...context,
|
|
64
|
-
isDraftsSheetOpen: true
|
|
65
|
+
isDraftsSheetOpen: true,
|
|
66
|
+
draftsSheetPublication: event.publicationId ?? null
|
|
65
67
|
};
|
|
66
68
|
},
|
|
67
69
|
closeDraftsSheet: (context) => {
|
|
68
70
|
return {
|
|
69
71
|
...context,
|
|
70
|
-
isDraftsSheetOpen: false
|
|
72
|
+
isDraftsSheetOpen: false,
|
|
73
|
+
draftsSheetPublication: null
|
|
71
74
|
};
|
|
72
75
|
},
|
|
73
76
|
openLocaleDialog: (context, event) => {
|
|
@@ -86,7 +89,7 @@ const studioStore = createStore({
|
|
|
86
89
|
const id = context.agentMessagesSent + 1;
|
|
87
90
|
return {
|
|
88
91
|
...context,
|
|
89
|
-
|
|
92
|
+
isDraftReviewOpen: false,
|
|
90
93
|
agentMessages: [...context.agentMessages, {
|
|
91
94
|
text: event.text,
|
|
92
95
|
id
|