camox 0.58.1 → 0.60.2
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/createBlock.js +1 -1
- package/dist/core/editing/createEditableBlock.js +2 -2
- package/dist/core/lib/recordScope.js +1 -1
- package/dist/features/canvas/CamoxCanvas.js +2 -2
- package/dist/features/canvas/CanvasOverlays.js +1 -1
- package/dist/features/canvas/sidebar/LayoutPageSeo.js +1 -1
- package/dist/features/canvas/sidebar/PageInspector.js +1 -1
- package/dist/features/content/CamoxContent.js +1 -1
- package/dist/features/content/components/MissingFromLocale.js +1 -1
- package/dist/features/page/CuratedPageContent.js +1 -1
- package/dist/features/preview/CamoxPreview.js +3 -3
- package/dist/features/preview/components/AddBlockSheet.js +1 -1
- package/dist/features/preview/components/AssetLightbox.js +1 -1
- package/dist/features/preview/components/BlockActionsPopover.js +1 -1
- package/dist/features/preview/components/CreatePageModal.js +2 -2
- package/dist/features/preview/components/FieldOverlayStyles.js +1 -1
- package/dist/features/preview/components/MobilePreviewDrawer.js +1 -1
- package/dist/features/preview/components/Overlays.js +1 -1
- package/dist/features/preview/components/PageInfo.js +1 -1
- package/dist/features/preview/components/PagePicker.js +1 -1
- package/dist/features/preview/components/PageTree.js +1 -1
- package/dist/features/preview/components/PreviewPanel.js +1 -1
- package/dist/features/preview/components/PreviewToolbar.js +1 -1
- package/dist/features/preview/components/SelectionEditor.js +2 -2
- package/dist/features/preview/components/StudioEditingFallback.js +1 -1
- package/dist/features/provider/AuthenticatedCamoxProvider.js +1 -1
- package/dist/features/provider/CamoxProvider.js +1 -1
- package/dist/features/provider/CoreCamoxProvider.js +3 -3
- package/dist/features/provider/components/CommandPalette.js +1 -1
- package/dist/features/renderer/RendererApp.js +187 -103
- package/dist/features/renderer/rendererHost.js +3 -7
- package/dist/features/routes/pageRuntime.d.ts +2 -5
- package/dist/features/routes/pageRuntime.js +1 -2
- package/dist/features/runtime/RuntimeChrome.js +1 -1
- package/dist/features/runtime/loopbackFetch.d.ts +8 -0
- package/dist/features/runtime/navigationTarget.js +1 -2
- package/dist/features/runtime/pageApp.js +1 -1
- package/dist/features/runtime/publicCache.d.ts +21 -0
- package/dist/features/runtime/publishingDraft.d.ts +4 -0
- package/dist/features/runtime/rendererClient.js +1 -1
- package/dist/features/runtime/runtime.d.ts +0 -5
- package/dist/features/runtime/runtime.js +80 -33
- package/dist/features/runtime/worker.js +4 -7
- package/dist/features/runtime/workerRequest.d.ts +8 -0
- package/dist/features/runtime/workerRuntime.d.ts +5 -0
- package/dist/features/runtime/workerRuntime.js +6 -0
- package/dist/features/sdkBundle/buildSdkBundle.d.ts +40 -0
- package/dist/features/sdkBundle/buildSdkBundle.js +323 -0
- package/dist/features/sdkBundle/localSdkBundle.d.ts +44 -0
- package/dist/features/sdkBundle/localSdkBundle.js +162 -0
- package/dist/features/sdkBundle/sdkBundle.d.ts +3 -0
- package/dist/features/sdkBundle/sdkBundle.js +4 -0
- package/dist/features/sdkBundle/sdkBundleName.d.ts +59 -0
- package/dist/features/sdkBundle/sdkBundleName.js +164 -0
- package/dist/features/sdkBundle/specifiers.d.ts +34 -0
- package/dist/features/sdkBundle/specifiers.js +146 -0
- package/dist/features/settings/FaviconSettings.js +1 -1
- package/dist/features/settings/SocialProfilesSettings.js +284 -151
- package/dist/features/studio/CamoxStudio.js +1 -1
- package/dist/features/studio/FollowAgentProvider.js +72 -13
- package/dist/features/studio/components/ChatWidget.js +86 -44
- package/dist/features/studio/components/DraftsControl.js +232 -201
- package/dist/features/studio/components/LocalePicker.js +2 -2
- package/dist/features/studio/components/Navbar.js +3 -3
- package/dist/features/studio/components/Patrol.js +312 -209
- package/dist/features/studio/components/ProjectMenu.js +2 -2
- package/dist/features/studio/components/ReviewDraftSheet.js +9 -15
- package/dist/features/studio/components/Squareling.js +164 -66
- package/dist/features/studio/components/ThreadComposer.js +139 -69
- package/dist/features/studio/components/ThreadMessages.js +216 -64
- package/dist/features/studio/components/UserButton.js +2 -2
- package/dist/features/studio/draftLabel.js +1 -2
- package/dist/features/studio/draftNotice.js +0 -1
- package/dist/features/studio/editorWhereContext.js +11 -0
- package/dist/features/studio/showInCanvas.js +1 -1
- package/dist/features/studio/useEditorSelection.js +135 -0
- package/dist/features/vite/definitionsSync.js +14 -60
- package/dist/features/vite/devSignIn.js +1 -1
- package/dist/features/vite/hostedChecks.js +1 -1
- package/dist/features/vite/runtimeDev.js +2 -2
- package/dist/features/vite/sdkBundleBuild.js +74 -0
- package/dist/features/vite/staticAssetHeaders.js +7 -4
- package/dist/features/vite/vite.d.ts +8 -7
- package/dist/features/vite/vite.js +67 -28
- package/dist/lib/api-client-server.js +25 -8
- package/dist/lib/api-client.js +2 -6
- package/dist/lib/auth.js +25 -59
- package/dist/lib/draft-scope.js +5 -25
- package/dist/lib/preview-handoff.js +1 -1
- package/dist/lib/server-auth-cookie.js +23 -11
- package/dist/lib/stored-auth-cookies.js +76 -0
- package/dist/lib/studio-reads.js +1 -1
- package/dist/lib/use-thread.js +40 -40
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +17 -4
- package/skills/camox/references/block-definitions.md +1 -1
- package/dist/features/vite/publishSeededContent.js +0 -30
- package/skills/camox-cli/SKILL.md +0 -15
- package/skills/camox-cli/references/cli-common.md +0 -58
- package/skills/camox-cli/references/cli-content.md +0 -181
- package/skills/camox-cli/references/cli-publishing.md +0 -26
|
@@ -4,9 +4,13 @@ import { c } from "react/compiler-runtime";
|
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Button } from "@camox/ui/button";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { GripVertical, Plus, Trash2 } from "lucide-react";
|
|
8
|
+
import { DndContext, KeyboardSensor, PointerSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
|
|
9
|
+
import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
|
|
10
|
+
import { SortableContext, arrayMove, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
11
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
9
12
|
import { Spinner } from "@camox/ui/spinner";
|
|
13
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "@camox/ui/input-group";
|
|
10
14
|
import { socialProfileUrlSchema } from "@camox/api-contract/projects";
|
|
11
15
|
|
|
12
16
|
//#region src/features/settings/SocialProfilesSettings.tsx
|
|
@@ -16,69 +20,67 @@ const row = (url) => ({
|
|
|
16
20
|
url
|
|
17
21
|
});
|
|
18
22
|
function SocialProfilesSettings(t0) {
|
|
19
|
-
const $ = c(
|
|
23
|
+
const $ = c(36);
|
|
20
24
|
const { project } = t0;
|
|
21
25
|
let t1;
|
|
22
|
-
if ($[0] !== project) {
|
|
26
|
+
if ($[0] !== project.socialProfiles) {
|
|
23
27
|
t1 = () => project.socialProfiles.map(row);
|
|
24
|
-
$[0] = project;
|
|
28
|
+
$[0] = project.socialProfiles;
|
|
25
29
|
$[1] = t1;
|
|
26
30
|
} else t1 = $[1];
|
|
27
31
|
const [rows, setRows] = React.useState(t1);
|
|
28
32
|
const [showErrors, setShowErrors] = React.useState(false);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
t3 = {
|
|
39
|
-
success: "Social profiles updated",
|
|
40
|
-
failure: "Could not save the social profiles",
|
|
41
|
-
onSuccess: () => {
|
|
42
|
-
setRows(filled);
|
|
43
|
-
setShowErrors(false);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
$[4] = filled;
|
|
47
|
-
$[5] = t3;
|
|
48
|
-
} else t3 = $[5];
|
|
49
|
-
const save = useProjectMutation(project, "updateSocialProfiles", t3);
|
|
33
|
+
const filled = rows.map(_temp).filter(_temp2);
|
|
34
|
+
const save = useProjectMutation(project, "updateSocialProfiles", {
|
|
35
|
+
success: "Social profiles updated",
|
|
36
|
+
failure: "Could not save the social profiles",
|
|
37
|
+
onSuccess: () => {
|
|
38
|
+
setRows(filled);
|
|
39
|
+
setShowErrors(false);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
50
42
|
const errorOf = _temp3;
|
|
51
|
-
let
|
|
52
|
-
if ($[
|
|
53
|
-
|
|
43
|
+
let t2;
|
|
44
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
45
|
+
t2 = (key, url_0) => setRows((current) => current.map((entry_0) => entry_0.key === key ? {
|
|
54
46
|
...entry_0,
|
|
55
47
|
url: url_0
|
|
56
48
|
} : entry_0));
|
|
57
|
-
$[
|
|
58
|
-
} else
|
|
59
|
-
const update =
|
|
49
|
+
$[2] = t2;
|
|
50
|
+
} else t2 = $[2];
|
|
51
|
+
const update = t2;
|
|
52
|
+
let t3;
|
|
53
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
54
|
+
t3 = (key_0) => setRows((current_0) => current_0.filter((entry_1) => entry_1.key !== key_0));
|
|
55
|
+
$[3] = t3;
|
|
56
|
+
} else t3 = $[3];
|
|
57
|
+
const remove = t3;
|
|
58
|
+
let t4;
|
|
59
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
60
|
+
t4 = { coordinateGetter: sortableKeyboardCoordinates };
|
|
61
|
+
$[4] = t4;
|
|
62
|
+
} else t4 = $[4];
|
|
63
|
+
const sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, t4));
|
|
60
64
|
let t5;
|
|
61
|
-
if ($[
|
|
62
|
-
t5 = (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
66
|
+
t5 = (t6) => {
|
|
67
|
+
const { active, over } = t6;
|
|
68
|
+
if (!over || active.id === over.id) return;
|
|
69
|
+
setRows((current_1) => {
|
|
70
|
+
const from = current_1.findIndex((entry_2) => entry_2.key === active.id);
|
|
71
|
+
const to = current_1.findIndex((entry_3) => entry_3.key === over.id);
|
|
72
|
+
return from === -1 || to === -1 ? current_1 : arrayMove(current_1, from, to);
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
$[5] = t5;
|
|
76
|
+
} else t5 = $[5];
|
|
77
|
+
const handleDragEnd = t5;
|
|
78
|
+
const hasChanges = filled.length !== project.socialProfiles.length || filled.some((entry_4, index) => entry_4.url !== project.socialProfiles[index]);
|
|
66
79
|
let t6;
|
|
67
|
-
if ($[8]
|
|
68
|
-
t6 = (
|
|
69
|
-
const next = [...current_1];
|
|
70
|
-
const [moved] = next.splice(index, 1);
|
|
71
|
-
next.splice(index + by, 0, moved);
|
|
72
|
-
return next;
|
|
73
|
-
});
|
|
74
|
-
$[8] = t6;
|
|
75
|
-
} else t6 = $[8];
|
|
76
|
-
const move = t6;
|
|
77
|
-
let t7;
|
|
78
|
-
if ($[9] !== filled || $[10] !== project || $[11] !== save) {
|
|
79
|
-
t7 = (event) => {
|
|
80
|
+
if ($[6] !== errorOf || $[7] !== filled || $[8] !== project.id || $[9] !== save) {
|
|
81
|
+
t6 = (event) => {
|
|
80
82
|
event.preventDefault();
|
|
81
|
-
if (filled.some((
|
|
83
|
+
if (filled.some((entry_5) => errorOf(entry_5.url))) {
|
|
82
84
|
setShowErrors(true);
|
|
83
85
|
return;
|
|
84
86
|
}
|
|
@@ -87,145 +89,123 @@ function SocialProfilesSettings(t0) {
|
|
|
87
89
|
socialProfiles: filled.map(_temp4)
|
|
88
90
|
});
|
|
89
91
|
};
|
|
90
|
-
$[
|
|
91
|
-
$[
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
variant: "ghost",
|
|
119
|
-
size: "icon",
|
|
120
|
-
"aria-label": "Move up",
|
|
121
|
-
disabled: index_0 === 0 || save.isPending,
|
|
122
|
-
onClick: () => move(index_0, -1),
|
|
123
|
-
children: /* @__PURE__ */ jsx(ArrowUp, {})
|
|
124
|
-
}),
|
|
125
|
-
/* @__PURE__ */ jsx(Button, {
|
|
126
|
-
type: "button",
|
|
127
|
-
variant: "ghost",
|
|
128
|
-
size: "icon",
|
|
129
|
-
"aria-label": "Move down",
|
|
130
|
-
disabled: index_0 === rows.length - 1 || save.isPending,
|
|
131
|
-
onClick: () => move(index_0, 1),
|
|
132
|
-
children: /* @__PURE__ */ jsx(ArrowDown, {})
|
|
133
|
-
}),
|
|
134
|
-
/* @__PURE__ */ jsx(Button, {
|
|
135
|
-
type: "button",
|
|
136
|
-
variant: "ghost",
|
|
137
|
-
size: "icon",
|
|
138
|
-
"aria-label": "Remove",
|
|
139
|
-
disabled: save.isPending,
|
|
140
|
-
onClick: () => remove(entry_4.key),
|
|
141
|
-
children: /* @__PURE__ */ jsx(Trash2, {})
|
|
142
|
-
})
|
|
143
|
-
]
|
|
144
|
-
}), error && /* @__PURE__ */ jsx("p", {
|
|
145
|
-
className: "text-destructive text-xs",
|
|
146
|
-
children: error
|
|
147
|
-
})]
|
|
148
|
-
}, entry_4.key);
|
|
92
|
+
$[6] = errorOf;
|
|
93
|
+
$[7] = filled;
|
|
94
|
+
$[8] = project.id;
|
|
95
|
+
$[9] = save;
|
|
96
|
+
$[10] = t6;
|
|
97
|
+
} else t6 = $[10];
|
|
98
|
+
const submit = t6;
|
|
99
|
+
let t7;
|
|
100
|
+
if ($[11] !== errorOf || $[12] !== handleDragEnd || $[13] !== remove || $[14] !== rows || $[15] !== save.isPending || $[16] !== sensors || $[17] !== showErrors || $[18] !== update) {
|
|
101
|
+
t7 = rows.length > 0 && /* @__PURE__ */ jsx(DndContext, {
|
|
102
|
+
sensors,
|
|
103
|
+
collisionDetection: closestCenter,
|
|
104
|
+
onDragEnd: handleDragEnd,
|
|
105
|
+
modifiers: [restrictToVerticalAxis],
|
|
106
|
+
children: /* @__PURE__ */ jsx(SortableContext, {
|
|
107
|
+
items: rows.map(_temp5),
|
|
108
|
+
strategy: verticalListSortingStrategy,
|
|
109
|
+
children: /* @__PURE__ */ jsx("ol", {
|
|
110
|
+
className: "flex flex-col gap-2",
|
|
111
|
+
children: rows.map((entry_8, index_0) => /* @__PURE__ */ jsx(SortableProfileRow, {
|
|
112
|
+
entry: entry_8,
|
|
113
|
+
index: index_0,
|
|
114
|
+
error: showErrors && entry_8.url.trim() ? errorOf(entry_8.url) : void 0,
|
|
115
|
+
disabled: save.isPending,
|
|
116
|
+
onChange: (url_1) => update(entry_8.key, url_1),
|
|
117
|
+
onRemove: () => remove(entry_8.key)
|
|
118
|
+
}, entry_8.key))
|
|
119
|
+
})
|
|
149
120
|
})
|
|
150
121
|
});
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
|
|
122
|
+
$[11] = errorOf;
|
|
123
|
+
$[12] = handleDragEnd;
|
|
124
|
+
$[13] = remove;
|
|
125
|
+
$[14] = rows;
|
|
126
|
+
$[15] = save.isPending;
|
|
127
|
+
$[16] = sensors;
|
|
128
|
+
$[17] = showErrors;
|
|
129
|
+
$[18] = update;
|
|
130
|
+
$[19] = t7;
|
|
131
|
+
} else t7 = $[19];
|
|
132
|
+
const t8 = !hasChanges || save.isPending;
|
|
156
133
|
let t9;
|
|
157
|
-
if ($[
|
|
134
|
+
if ($[20] !== save.isPending) {
|
|
158
135
|
t9 = save.isPending && /* @__PURE__ */ jsx(Spinner, {});
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
} else t9 = $[
|
|
136
|
+
$[20] = save.isPending;
|
|
137
|
+
$[21] = t9;
|
|
138
|
+
} else t9 = $[21];
|
|
162
139
|
let t10;
|
|
163
|
-
if ($[
|
|
140
|
+
if ($[22] !== t8 || $[23] !== t9) {
|
|
164
141
|
t10 = /* @__PURE__ */ jsxs(Button, {
|
|
165
142
|
type: "submit",
|
|
166
|
-
disabled:
|
|
143
|
+
disabled: t8,
|
|
167
144
|
children: [t9, "Save"]
|
|
168
145
|
});
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
} else t10 = $[
|
|
146
|
+
$[22] = t8;
|
|
147
|
+
$[23] = t9;
|
|
148
|
+
$[24] = t10;
|
|
149
|
+
} else t10 = $[24];
|
|
173
150
|
let t11;
|
|
174
151
|
let t12;
|
|
175
|
-
if ($[
|
|
176
|
-
t11 = () => setRows(
|
|
152
|
+
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
153
|
+
t11 = () => setRows(_temp6);
|
|
177
154
|
t12 = /* @__PURE__ */ jsx(Plus, {});
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
155
|
+
$[25] = t11;
|
|
156
|
+
$[26] = t12;
|
|
180
157
|
} else {
|
|
181
|
-
t11 = $[
|
|
182
|
-
t12 = $[
|
|
158
|
+
t11 = $[25];
|
|
159
|
+
t12 = $[26];
|
|
183
160
|
}
|
|
184
161
|
let t13;
|
|
185
|
-
if ($[
|
|
162
|
+
if ($[27] !== save.isPending) {
|
|
186
163
|
t13 = /* @__PURE__ */ jsxs(Button, {
|
|
187
164
|
type: "button",
|
|
188
|
-
variant: "
|
|
165
|
+
variant: "outline",
|
|
189
166
|
disabled: save.isPending,
|
|
190
167
|
onClick: t11,
|
|
191
168
|
children: [t12, "Add profile"]
|
|
192
169
|
});
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
} else t13 = $[
|
|
170
|
+
$[27] = save.isPending;
|
|
171
|
+
$[28] = t13;
|
|
172
|
+
} else t13 = $[28];
|
|
196
173
|
let t14;
|
|
197
|
-
if ($[
|
|
174
|
+
if ($[29] !== t10 || $[30] !== t13) {
|
|
198
175
|
t14 = /* @__PURE__ */ jsxs("div", {
|
|
199
176
|
className: "flex flex-wrap gap-2",
|
|
200
177
|
children: [t10, t13]
|
|
201
178
|
});
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
} else t14 = $[
|
|
179
|
+
$[29] = t10;
|
|
180
|
+
$[30] = t13;
|
|
181
|
+
$[31] = t14;
|
|
182
|
+
} else t14 = $[31];
|
|
206
183
|
let t15;
|
|
207
|
-
if ($[
|
|
184
|
+
if ($[32] !== submit || $[33] !== t14 || $[34] !== t7) {
|
|
208
185
|
t15 = /* @__PURE__ */ jsx(SettingsPart, {
|
|
209
186
|
title: "Social profiles",
|
|
210
187
|
description: "The project's accounts elsewhere, such as on LinkedIn, X or GitHub. Search engines and AI answer engines use them to tie the website to your organization.",
|
|
211
188
|
children: /* @__PURE__ */ jsxs("form", {
|
|
212
189
|
onSubmit: submit,
|
|
213
190
|
className: "flex flex-col gap-4",
|
|
214
|
-
children: [
|
|
191
|
+
children: [t7, t14]
|
|
215
192
|
})
|
|
216
193
|
});
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
} else t15 = $[
|
|
194
|
+
$[32] = submit;
|
|
195
|
+
$[33] = t14;
|
|
196
|
+
$[34] = t7;
|
|
197
|
+
$[35] = t15;
|
|
198
|
+
} else t15 = $[35];
|
|
222
199
|
return t15;
|
|
223
200
|
}
|
|
224
|
-
function
|
|
201
|
+
function _temp6(current_2) {
|
|
225
202
|
return [...current_2, row("")];
|
|
226
203
|
}
|
|
227
|
-
function
|
|
228
|
-
return
|
|
204
|
+
function _temp5(entry_7) {
|
|
205
|
+
return entry_7.key;
|
|
206
|
+
}
|
|
207
|
+
function _temp4(entry_6) {
|
|
208
|
+
return entry_6.url;
|
|
229
209
|
}
|
|
230
210
|
function _temp3(url) {
|
|
231
211
|
const result = socialProfileUrlSchema.safeParse(url.trim());
|
|
@@ -240,6 +220,159 @@ function _temp(entry) {
|
|
|
240
220
|
url: entry.url.trim()
|
|
241
221
|
};
|
|
242
222
|
}
|
|
223
|
+
function SortableProfileRow(t0) {
|
|
224
|
+
const $ = c(41);
|
|
225
|
+
const { entry, index, error, disabled, onChange, onRemove } = t0;
|
|
226
|
+
let t1;
|
|
227
|
+
if ($[0] !== disabled || $[1] !== entry.key) {
|
|
228
|
+
t1 = {
|
|
229
|
+
id: entry.key,
|
|
230
|
+
disabled
|
|
231
|
+
};
|
|
232
|
+
$[0] = disabled;
|
|
233
|
+
$[1] = entry.key;
|
|
234
|
+
$[2] = t1;
|
|
235
|
+
} else t1 = $[2];
|
|
236
|
+
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable(t1);
|
|
237
|
+
let t2;
|
|
238
|
+
if ($[3] !== transform) {
|
|
239
|
+
t2 = CSS.Transform.toString(transform);
|
|
240
|
+
$[3] = transform;
|
|
241
|
+
$[4] = t2;
|
|
242
|
+
} else t2 = $[4];
|
|
243
|
+
const t3 = isDragging ? .5 : 1;
|
|
244
|
+
let t4;
|
|
245
|
+
if ($[5] !== t2 || $[6] !== t3 || $[7] !== transition) {
|
|
246
|
+
t4 = {
|
|
247
|
+
transform: t2,
|
|
248
|
+
transition,
|
|
249
|
+
opacity: t3
|
|
250
|
+
};
|
|
251
|
+
$[5] = t2;
|
|
252
|
+
$[6] = t3;
|
|
253
|
+
$[7] = transition;
|
|
254
|
+
$[8] = t4;
|
|
255
|
+
} else t4 = $[8];
|
|
256
|
+
const t5 = `Reorder profile ${index + 1}`;
|
|
257
|
+
let t6;
|
|
258
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
259
|
+
t6 = /* @__PURE__ */ jsx(GripVertical, {});
|
|
260
|
+
$[9] = t6;
|
|
261
|
+
} else t6 = $[9];
|
|
262
|
+
let t7;
|
|
263
|
+
if ($[10] !== attributes || $[11] !== disabled || $[12] !== listeners || $[13] !== t5) {
|
|
264
|
+
t7 = /* @__PURE__ */ jsx(Button, {
|
|
265
|
+
type: "button",
|
|
266
|
+
variant: "ghost",
|
|
267
|
+
size: "icon-sm",
|
|
268
|
+
"aria-label": t5,
|
|
269
|
+
className: "text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing",
|
|
270
|
+
disabled,
|
|
271
|
+
...attributes,
|
|
272
|
+
...listeners,
|
|
273
|
+
children: t6
|
|
274
|
+
});
|
|
275
|
+
$[10] = attributes;
|
|
276
|
+
$[11] = disabled;
|
|
277
|
+
$[12] = listeners;
|
|
278
|
+
$[13] = t5;
|
|
279
|
+
$[14] = t7;
|
|
280
|
+
} else t7 = $[14];
|
|
281
|
+
const t8 = disabled || void 0;
|
|
282
|
+
const t9 = `Profile ${index + 1}`;
|
|
283
|
+
const t10 = error ? true : void 0;
|
|
284
|
+
let t11;
|
|
285
|
+
if ($[15] !== onChange) {
|
|
286
|
+
t11 = (event) => onChange(event.target.value);
|
|
287
|
+
$[15] = onChange;
|
|
288
|
+
$[16] = t11;
|
|
289
|
+
} else t11 = $[16];
|
|
290
|
+
let t12;
|
|
291
|
+
if ($[17] !== disabled || $[18] !== entry.url || $[19] !== t10 || $[20] !== t11 || $[21] !== t9) {
|
|
292
|
+
t12 = /* @__PURE__ */ jsx(InputGroupInput, {
|
|
293
|
+
type: "url",
|
|
294
|
+
value: entry.url,
|
|
295
|
+
placeholder: "https://www.linkedin.com/company/…",
|
|
296
|
+
"aria-label": t9,
|
|
297
|
+
"aria-invalid": t10,
|
|
298
|
+
disabled,
|
|
299
|
+
onChange: t11
|
|
300
|
+
});
|
|
301
|
+
$[17] = disabled;
|
|
302
|
+
$[18] = entry.url;
|
|
303
|
+
$[19] = t10;
|
|
304
|
+
$[20] = t11;
|
|
305
|
+
$[21] = t9;
|
|
306
|
+
$[22] = t12;
|
|
307
|
+
} else t12 = $[22];
|
|
308
|
+
let t13;
|
|
309
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
310
|
+
t13 = /* @__PURE__ */ jsx(Trash2, {});
|
|
311
|
+
$[23] = t13;
|
|
312
|
+
} else t13 = $[23];
|
|
313
|
+
let t14;
|
|
314
|
+
if ($[24] !== disabled || $[25] !== onRemove) {
|
|
315
|
+
t14 = /* @__PURE__ */ jsx(InputGroupAddon, {
|
|
316
|
+
align: "inline-end",
|
|
317
|
+
className: "opacity-0 group-focus-within/input-group:opacity-100 group-hover/input-group:opacity-100",
|
|
318
|
+
children: /* @__PURE__ */ jsx(InputGroupButton, {
|
|
319
|
+
size: "icon-xs",
|
|
320
|
+
"aria-label": "Remove",
|
|
321
|
+
disabled,
|
|
322
|
+
onClick: onRemove,
|
|
323
|
+
children: t13
|
|
324
|
+
})
|
|
325
|
+
});
|
|
326
|
+
$[24] = disabled;
|
|
327
|
+
$[25] = onRemove;
|
|
328
|
+
$[26] = t14;
|
|
329
|
+
} else t14 = $[26];
|
|
330
|
+
let t15;
|
|
331
|
+
if ($[27] !== t12 || $[28] !== t14 || $[29] !== t8) {
|
|
332
|
+
t15 = /* @__PURE__ */ jsxs(InputGroup, {
|
|
333
|
+
"data-disabled": t8,
|
|
334
|
+
children: [t12, t14]
|
|
335
|
+
});
|
|
336
|
+
$[27] = t12;
|
|
337
|
+
$[28] = t14;
|
|
338
|
+
$[29] = t8;
|
|
339
|
+
$[30] = t15;
|
|
340
|
+
} else t15 = $[30];
|
|
341
|
+
let t16;
|
|
342
|
+
if ($[31] !== t15 || $[32] !== t7) {
|
|
343
|
+
t16 = /* @__PURE__ */ jsxs("div", {
|
|
344
|
+
className: "flex items-center gap-1",
|
|
345
|
+
children: [t7, t15]
|
|
346
|
+
});
|
|
347
|
+
$[31] = t15;
|
|
348
|
+
$[32] = t7;
|
|
349
|
+
$[33] = t16;
|
|
350
|
+
} else t16 = $[33];
|
|
351
|
+
let t17;
|
|
352
|
+
if ($[34] !== error) {
|
|
353
|
+
t17 = error && /* @__PURE__ */ jsx("p", {
|
|
354
|
+
className: "text-destructive pl-9 text-xs",
|
|
355
|
+
children: error
|
|
356
|
+
});
|
|
357
|
+
$[34] = error;
|
|
358
|
+
$[35] = t17;
|
|
359
|
+
} else t17 = $[35];
|
|
360
|
+
let t18;
|
|
361
|
+
if ($[36] !== setNodeRef || $[37] !== t16 || $[38] !== t17 || $[39] !== t4) {
|
|
362
|
+
t18 = /* @__PURE__ */ jsxs("li", {
|
|
363
|
+
ref: setNodeRef,
|
|
364
|
+
style: t4,
|
|
365
|
+
className: "flex flex-col gap-1",
|
|
366
|
+
children: [t16, t17]
|
|
367
|
+
});
|
|
368
|
+
$[36] = setNodeRef;
|
|
369
|
+
$[37] = t16;
|
|
370
|
+
$[38] = t17;
|
|
371
|
+
$[39] = t4;
|
|
372
|
+
$[40] = t18;
|
|
373
|
+
} else t18 = $[40];
|
|
374
|
+
return t18;
|
|
375
|
+
}
|
|
243
376
|
|
|
244
377
|
//#endregion
|
|
245
378
|
export { SocialProfilesSettings };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useAuthState, useSignInRedirect } from "../../lib/auth.js";
|
|
2
1
|
import { Navigate } from "../navigation/navigation.js";
|
|
2
|
+
import { useAuthState, useSignInRedirect } from "../../lib/auth.js";
|
|
3
3
|
import { useLocalePath, useLocalizedPath } from "../../lib/view-locale.js";
|
|
4
4
|
import { STUDIO_BASE_PATH } from "./routes.js";
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { useProjectUuid } from "../../lib/auth.js";
|
|
2
1
|
import { parseLocalePath } from "../../lib/locale-path.js";
|
|
3
2
|
import { useViewLocale } from "../../lib/view-locale-context.js";
|
|
4
3
|
import { useLocation, useNavigate } from "../navigation/navigation.js";
|
|
4
|
+
import { useProjectUuid } from "../../lib/auth.js";
|
|
5
5
|
import { reads, useReadQueries, useReadQuery } from "../../lib/studio-reads.js";
|
|
6
6
|
import { useRoutableLayouts } from "../../lib/studio-definitions.js";
|
|
7
|
+
import { STUDIO_CANVAS_PATH } from "./routes.js";
|
|
7
8
|
import { FollowAgentContext } from "./followAgentContext.js";
|
|
8
9
|
import { canvasPageId, getCanvasPages } from "../canvas/canvasPages.js";
|
|
9
10
|
import { selectedCanvasPage } from "../canvas/canvasSelection.js";
|
|
10
11
|
import { useDiscoveredPreviewPaths } from "../canvas/useDiscoveredPreviewPaths.js";
|
|
12
|
+
import { EditorWhereContext } from "./editorWhereContext.js";
|
|
11
13
|
import { createFollowAgent } from "./followAgent.js";
|
|
12
14
|
import { c } from "react/compiler-runtime";
|
|
13
15
|
import * as React from "react";
|
|
@@ -99,9 +101,27 @@ function useCurrentPageBlocks(page, path) {
|
|
|
99
101
|
function _temp(id) {
|
|
100
102
|
return reads.blockBundle(id);
|
|
101
103
|
}
|
|
102
|
-
/** Where the editor is,
|
|
104
|
+
/** Where the editor is, for the agent to read, from the Page they look at, if any. */
|
|
105
|
+
function editorWhereOf(current, path, locale) {
|
|
106
|
+
if (path === "/camox/canvas") return {
|
|
107
|
+
on: "canvas",
|
|
108
|
+
locale
|
|
109
|
+
};
|
|
110
|
+
if (!current) return void 0;
|
|
111
|
+
return {
|
|
112
|
+
on: "page",
|
|
113
|
+
locale,
|
|
114
|
+
path,
|
|
115
|
+
title: current.title,
|
|
116
|
+
...current.kind === "curated" ? { pageId: current.pageId } : { layoutId: current.layoutId }
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Where the editor is, with the Studio content following locates the agent's touches with, and
|
|
121
|
+
* as the agent reads it.
|
|
122
|
+
*/
|
|
103
123
|
function useFollowWhere(runtimeBasePath) {
|
|
104
|
-
const $ = c(
|
|
124
|
+
const $ = c(44);
|
|
105
125
|
const layouts = useRoutableLayouts();
|
|
106
126
|
const projectUuid = useProjectUuid();
|
|
107
127
|
const location = useLocation();
|
|
@@ -155,7 +175,8 @@ function useFollowWhere(runtimeBasePath) {
|
|
|
155
175
|
$[17] = location.pathname;
|
|
156
176
|
$[18] = t6;
|
|
157
177
|
} else t6 = $[18];
|
|
158
|
-
const
|
|
178
|
+
const path = t6.path;
|
|
179
|
+
const blocks = useCurrentPageBlocks(current, path);
|
|
159
180
|
let t7;
|
|
160
181
|
if ($[19] !== blocks || $[20] !== canvasPages || $[21] !== current?.key || $[22] !== pageList) {
|
|
161
182
|
t7 = () => {
|
|
@@ -221,7 +242,34 @@ function useFollowWhere(runtimeBasePath) {
|
|
|
221
242
|
$[33] = t9;
|
|
222
243
|
$[34] = t11;
|
|
223
244
|
} else t11 = $[34];
|
|
224
|
-
|
|
245
|
+
const where = t11;
|
|
246
|
+
let t12;
|
|
247
|
+
if ($[35] !== current || $[36] !== locale.tag || $[37] !== path) {
|
|
248
|
+
t12 = JSON.stringify(editorWhereOf(current, path, locale.tag) ?? null);
|
|
249
|
+
$[35] = current;
|
|
250
|
+
$[36] = locale.tag;
|
|
251
|
+
$[37] = path;
|
|
252
|
+
$[38] = t12;
|
|
253
|
+
} else t12 = $[38];
|
|
254
|
+
const json = t12;
|
|
255
|
+
let t13;
|
|
256
|
+
if ($[39] !== json) {
|
|
257
|
+
t13 = JSON.parse(json) ?? void 0;
|
|
258
|
+
$[39] = json;
|
|
259
|
+
$[40] = t13;
|
|
260
|
+
} else t13 = $[40];
|
|
261
|
+
const editorWhere = t13;
|
|
262
|
+
let t14;
|
|
263
|
+
if ($[41] !== editorWhere || $[42] !== where) {
|
|
264
|
+
t14 = {
|
|
265
|
+
where,
|
|
266
|
+
editorWhere
|
|
267
|
+
};
|
|
268
|
+
$[41] = editorWhere;
|
|
269
|
+
$[42] = where;
|
|
270
|
+
$[43] = t14;
|
|
271
|
+
} else t14 = $[43];
|
|
272
|
+
return t14;
|
|
225
273
|
}
|
|
226
274
|
function _temp2(page) {
|
|
227
275
|
return [page.id, page.layoutId];
|
|
@@ -229,12 +277,13 @@ function _temp2(page) {
|
|
|
229
277
|
/**
|
|
230
278
|
* Follows the agent for the Studio session, across its pages and into the draft its Live thread
|
|
231
279
|
* starts: the Canvas or the Preview goes where the editor's runs write. Only the Website Section
|
|
232
|
-
* follows; elsewhere in the Studio, the editor stays where they are.
|
|
280
|
+
* follows; elsewhere in the Studio, the editor stays where they are. It tells the thread where
|
|
281
|
+
* the editor is too, which their messages carry to the agent.
|
|
233
282
|
*/
|
|
234
283
|
function FollowAgentProvider(t0) {
|
|
235
|
-
const $ = c(
|
|
284
|
+
const $ = c(21);
|
|
236
285
|
const { runtimeBasePath, website, children } = t0;
|
|
237
|
-
const where = useFollowWhere(runtimeBasePath);
|
|
286
|
+
const { where, editorWhere } = useFollowWhere(runtimeBasePath);
|
|
238
287
|
const navigate = useNavigate();
|
|
239
288
|
let t1;
|
|
240
289
|
if ($[0] !== navigate || $[1] !== where) {
|
|
@@ -311,16 +360,26 @@ function FollowAgentProvider(t0) {
|
|
|
311
360
|
} else t7 = $[14];
|
|
312
361
|
const value = t7;
|
|
313
362
|
let t8;
|
|
314
|
-
if ($[15] !== children || $[16] !==
|
|
315
|
-
t8 = /* @__PURE__ */ jsx(
|
|
316
|
-
value,
|
|
363
|
+
if ($[15] !== children || $[16] !== editorWhere) {
|
|
364
|
+
t8 = /* @__PURE__ */ jsx(EditorWhereContext, {
|
|
365
|
+
value: editorWhere,
|
|
317
366
|
children
|
|
318
367
|
});
|
|
319
368
|
$[15] = children;
|
|
320
|
-
$[16] =
|
|
369
|
+
$[16] = editorWhere;
|
|
321
370
|
$[17] = t8;
|
|
322
371
|
} else t8 = $[17];
|
|
323
|
-
|
|
372
|
+
let t9;
|
|
373
|
+
if ($[18] !== t8 || $[19] !== value) {
|
|
374
|
+
t9 = /* @__PURE__ */ jsx(FollowAgentContext, {
|
|
375
|
+
value,
|
|
376
|
+
children: t8
|
|
377
|
+
});
|
|
378
|
+
$[18] = t8;
|
|
379
|
+
$[19] = value;
|
|
380
|
+
$[20] = t9;
|
|
381
|
+
} else t9 = $[20];
|
|
382
|
+
return t9;
|
|
324
383
|
}
|
|
325
384
|
|
|
326
385
|
//#endregion
|