@burdenoff/microfe-headshotmarketing 2026.1030.13 → 2026.1030.14
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/generated/wspace-operations.d.ts +33 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +30 -0
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +427 -2
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/headshotmarketing/pages/content/AIGeneratedBadge.d.ts +12 -0
- package/dist/headshotmarketing/pages/content/AIGeneratedBadge.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/content/AIGeneratedBadge.js +30 -0
- package/dist/headshotmarketing/pages/content/AIGeneratedBadge.js.map +1 -0
- package/dist/headshotmarketing/pages/content/AIToolsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/content/AIToolsPage.js +51 -50
- package/dist/headshotmarketing/pages/content/AIToolsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentCreationPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentCreationPage.js +409 -408
- package/dist/headshotmarketing/pages/content/ContentCreationPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentDetailsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentDetailsPage.js +158 -104
- package/dist/headshotmarketing/pages/content/ContentDetailsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentItemActions.d.ts +5 -0
- package/dist/headshotmarketing/pages/content/ContentItemActions.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentItemActions.js +103 -34
- package/dist/headshotmarketing/pages/content/ContentItemActions.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentLibraryCard.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentLibraryCard.js +102 -102
- package/dist/headshotmarketing/pages/content/ContentLibraryCard.js.map +1 -1
- package/dist/headshotmarketing/types/index.d.ts +17 -0
- package/dist/headshotmarketing/types/index.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/contentLibrary.d.ts +6 -0
- package/dist/headshotmarketing/utils/contentLibrary.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/contentLibrary.js +17 -11
- package/dist/headshotmarketing/utils/contentLibrary.js.map +1 -1
- package/dist/headshotmarketing/utils/contentMapper.d.ts +13 -1
- package/dist/headshotmarketing/utils/contentMapper.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/contentMapper.js +26 -13
- package/dist/headshotmarketing/utils/contentMapper.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
import { useHeadshotmarketingContentItemDetailQuery as e, useHeadshotmarketingCreateContentItemMutation as t, useRunHeadshotmarketingEditorAiToolMutation as n, useUpdateHeadshotmarketingContentItemMutation as ee } from "../../../generated/wspace-operations.js";
|
|
2
2
|
import { useHeadshotMarketing as te } from "../../context/HeadshotMarketingContext.js";
|
|
3
3
|
import { cn as r } from "../../utils/helpers.js";
|
|
4
|
-
import { HeadshotmarketingAiToolCategory as i, HeadshotmarketingContentItemStatus as
|
|
5
|
-
import { PageLayout as
|
|
6
|
-
import { EmptyState as
|
|
7
|
-
import { QueryStateBoundary as
|
|
8
|
-
import { TagChipsInput as
|
|
9
|
-
import { useAssetUpload as
|
|
4
|
+
import { HeadshotmarketingAiToolCategory as i, HeadshotmarketingContentItemStatus as ne } from "../../../generated/wspace-types.js";
|
|
5
|
+
import { PageLayout as re } from "../../components/PageLayout.js";
|
|
6
|
+
import { EmptyState as ie } from "../../components/EmptyState.js";
|
|
7
|
+
import { QueryStateBoundary as ae } from "../../components/QueryStateBoundary.js";
|
|
8
|
+
import { TagChipsInput as oe } from "../../components/TagChipsInput.js";
|
|
9
|
+
import { useAssetUpload as se } from "../../hooks/useAssetUpload.js";
|
|
10
10
|
import "../../components/index.js";
|
|
11
|
-
import { useHeadshotmarketingBootstrap as
|
|
12
|
-
import { toResultStrings as
|
|
13
|
-
import { CONTENT_STATUS_OPTIONS as
|
|
14
|
-
import { sanitizeContentHtml as
|
|
15
|
-
import { useEffect as
|
|
16
|
-
import { ArrowLeft as
|
|
17
|
-
import { useParams as
|
|
18
|
-
import { gql as
|
|
19
|
-
import { useMutation as
|
|
20
|
-
import { Fragment as
|
|
21
|
-
import { EmphasisPanel as
|
|
11
|
+
import { useHeadshotmarketingBootstrap as ce } from "../../hooks/useHeadshotmarketingBootstrap.js";
|
|
12
|
+
import { toResultStrings as le } from "../../utils/aiToolOutput.js";
|
|
13
|
+
import { CONTENT_STATUS_OPTIONS as ue, EDITOR_TYPE_TO_CONTENT_TYPE as de, buildContentUpdateInput as fe, buildEditorAIPrompt as pe, contentTypeLabel as me, editorTypeForContentType as he, mergeGeneratedCopy as ge, toContentEditorDraft as _e, withAIAssistExecution as ve } from "../../utils/contentLibrary.js";
|
|
14
|
+
import { sanitizeContentHtml as ye } from "../../utils/sanitizeContentHtml.js";
|
|
15
|
+
import { useEffect as be, useLayoutEffect as xe, useMemo as a, useRef as Se, useState as o } from "react";
|
|
16
|
+
import { ArrowLeft as Ce, ArrowUpRight as we, Bold as Te, CalendarClock as Ee, Check as s, Code2 as De, Edit3 as Oe, Eye as ke, FileText as Ae, Globe as c, Heading1 as je, Heading2 as Me, Image as Ne, Italic as Pe, Link2 as Fe, List as Ie, ListOrdered as Le, ListPlus as Re, Loader2 as l, Mail as u, Megaphone as d, Quote as ze, Replace as Be, Save as Ve, Search as He, Send as Ue, Settings2 as We, Share2 as f, Sparkles as Ge, Underline as Ke, Wand2 as qe } from "lucide-react";
|
|
17
|
+
import { useParams as Je } from "react-router";
|
|
18
|
+
import { gql as p } from "@apollo/client";
|
|
19
|
+
import { useMutation as Ye } from "@apollo/client/react";
|
|
20
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
21
|
+
import { EmphasisPanel as Xe, PagePurpose as Ze } from "@burdenoff/fe-libs/ui";
|
|
22
22
|
//#region src/headshotmarketing/pages/content/ContentCreationPage.tsx
|
|
23
|
-
var
|
|
23
|
+
var Qe = [
|
|
24
24
|
{
|
|
25
25
|
id: "blog",
|
|
26
26
|
label: "Blog Post",
|
|
27
|
-
icon:
|
|
27
|
+
icon: Ae,
|
|
28
28
|
description: "Long-form articles and guides",
|
|
29
29
|
color: "text-status-info-text bg-status-info-bg"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
id: "social",
|
|
33
33
|
label: "Social Post",
|
|
34
|
-
icon:
|
|
34
|
+
icon: f,
|
|
35
35
|
description: "Posts for social platforms",
|
|
36
36
|
color: "text-status-success-text bg-status-success-bg"
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
id: "email",
|
|
40
40
|
label: "Email",
|
|
41
|
-
icon:
|
|
41
|
+
icon: u,
|
|
42
42
|
description: "Email campaigns and newsletters",
|
|
43
43
|
color: "text-action-primary-bg bg-[var(--color-accent-soft)]"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
id: "landing",
|
|
47
47
|
label: "Landing Page",
|
|
48
|
-
icon:
|
|
48
|
+
icon: c,
|
|
49
49
|
description: "Conversion-focused pages",
|
|
50
50
|
color: "text-status-warning-text bg-status-warning-bg"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
id: "ad",
|
|
54
54
|
label: "Ad Copy",
|
|
55
|
-
icon:
|
|
55
|
+
icon: d,
|
|
56
56
|
description: "Advertising copy for campaigns",
|
|
57
57
|
color: "text-status-error-text bg-status-error-bg"
|
|
58
58
|
}
|
|
59
|
-
],
|
|
59
|
+
], $e = [
|
|
60
60
|
{
|
|
61
61
|
id: "t1",
|
|
62
62
|
name: "How-To Guide",
|
|
@@ -93,7 +93,7 @@ var Ye = [
|
|
|
93
93
|
category: "ad",
|
|
94
94
|
description: "Google Ads copy template"
|
|
95
95
|
}
|
|
96
|
-
],
|
|
96
|
+
], et = p`
|
|
97
97
|
mutation HeadshotmarketingPublishContentItem(
|
|
98
98
|
$id: ID!
|
|
99
99
|
$input: HeadshotmarketingUpdateContentItemInput!
|
|
@@ -104,22 +104,22 @@ var Ye = [
|
|
|
104
104
|
publishedAt
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
`,
|
|
107
|
+
`, tt = new Set([
|
|
108
108
|
i.ContentGeneration,
|
|
109
109
|
i.Copywriting,
|
|
110
110
|
i.Summarization,
|
|
111
111
|
i.SeoOptimization
|
|
112
112
|
]);
|
|
113
|
-
function
|
|
113
|
+
function nt(e) {
|
|
114
114
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function rt(e) {
|
|
117
117
|
return e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function it(e) {
|
|
120
120
|
return e.replace(/<[^>]*>/g, " ").replace(/ /g, " ").replace(/\s+/g, " ").trim().length;
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function at(e) {
|
|
123
123
|
let t = (e.metaTitle.trim() || e.title.trim()).length, n = e.metaDescription.trim().length;
|
|
124
124
|
return [
|
|
125
125
|
{
|
|
@@ -160,249 +160,250 @@ function nt(e) {
|
|
|
160
160
|
}
|
|
161
161
|
];
|
|
162
162
|
}
|
|
163
|
-
var
|
|
163
|
+
var _ = "inline-flex h-9 min-w-9 items-center justify-center gap-1 rounded-md px-2 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60", v = "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", ot = "prose prose-sm max-w-none text-text-primary [&_h1]:text-xl [&_h1]:font-bold [&_h2]:text-lg [&_h2]:font-semibold [&_a]:text-primary [&_a]:underline [&_img]:max-w-full [&_img]:h-auto [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5 [&_blockquote]:border-l-2 [&_blockquote]:border-border-strong [&_blockquote]:pl-3 [&_blockquote]:text-text-secondary [&_pre]:rounded-md [&_pre]:bg-bg-sunken [&_pre]:p-3 [&_pre]:font-mono [&_pre]:text-xs [&_pre]:whitespace-pre-wrap", y = ({ onClick: e, label: t, disabled: n, children: ee }) => /* @__PURE__ */ h("button", {
|
|
164
164
|
type: "button",
|
|
165
165
|
onMouseDown: (e) => e.preventDefault(),
|
|
166
166
|
onClick: e,
|
|
167
167
|
disabled: n,
|
|
168
168
|
"aria-label": t,
|
|
169
169
|
title: t,
|
|
170
|
-
className:
|
|
170
|
+
className: _,
|
|
171
171
|
children: ee
|
|
172
|
-
}),
|
|
172
|
+
}), b = () => /* @__PURE__ */ h("span", {
|
|
173
173
|
className: "mx-0.5 h-5 w-px bg-border-subtle",
|
|
174
174
|
"aria-hidden": "true"
|
|
175
|
-
}),
|
|
176
|
-
let { navigate: i, basePath:
|
|
177
|
-
variables: { id:
|
|
178
|
-
skip: !
|
|
175
|
+
}), x = () => {
|
|
176
|
+
let { navigate: i, basePath: c } = te(), { contentId: u } = Je(), d = !!u, { data: f, refetch: p } = ce(), _ = e({
|
|
177
|
+
variables: { id: u ?? "" },
|
|
178
|
+
skip: !d,
|
|
179
179
|
fetchPolicy: "network-only"
|
|
180
|
-
}), [
|
|
181
|
-
|
|
182
|
-
if (!
|
|
183
|
-
let e =
|
|
184
|
-
yt(e.type), xt(e.templateId), St(e.title), Ct(e.summary), wt(e.tags), Tt(
|
|
180
|
+
}), [x, { loading: S, error: st }] = t(), [ct, { loading: lt, error: ut }] = ee(), [dt, { loading: C }] = n(), [ft, { loading: pt, error: mt }] = Ye(et), { uploadFile: ht, uploading: gt, error: _t } = se("/HeadshotMarketing/Content"), w = Se(null), vt = Se(null), [T, yt] = o(null), [bt, xt] = o(null), [E, St] = o(""), [D, Ct] = o(""), [O, wt] = o([]), [k, Tt] = o(""), [Et, Dt] = o(""), [Ot, kt] = o(!1), [At, jt] = o(""), [A, Mt] = o(""), [j, Nt] = o(""), [M, Pt] = o(""), [N, Ft] = o("settings"), [P, It] = o("edit"), [Lt, F] = o(null), [I, Rt] = o(!1), [zt, Bt] = o(null), [Vt, Ht] = o({}), [Ut, Wt] = o(""), [L, Gt] = o(""), [Kt, qt] = o(!0), [Jt, R] = o([]), [Yt, z] = o(null), [Xt, Zt] = o(null), [Qt, $t] = o(null), [en, tn] = o(null), B = _.data?.headshotmarketingContentItem ?? null;
|
|
181
|
+
be(() => {
|
|
182
|
+
if (!d || I || !B) return;
|
|
183
|
+
let e = _e(B);
|
|
184
|
+
yt(e.type), xt(e.templateId), St(e.title), Ct(e.summary), wt(e.tags), Tt(ye(e.body)), Dt(e.slug), kt(!0), jt(e.campaignId), Mt(e.scheduledAt), Nt(e.metaTitle), Pt(e.metaDescription), Bt(e.status), Ht(e.metadata), Rt(!0);
|
|
185
185
|
}, [
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
186
|
+
d,
|
|
187
|
+
I,
|
|
188
|
+
B
|
|
189
189
|
]);
|
|
190
|
-
let
|
|
191
|
-
if (!
|
|
192
|
-
let e = new Date(
|
|
190
|
+
let nn = a(() => f?.headshotmarketingCampaigns.items ?? [], [f]), V = a(() => (f?.headshotmarketingAITools.items ?? []).filter((e) => e.isEnabled && tt.has(e.category)), [f]), H = he(T), U = Qe.find((e) => e.id === H), W = U?.label ?? me(T), rn = H ? $e.filter((e) => e.category === H) : $e, G = Ot ? Et : rt(E), K = a(() => {
|
|
191
|
+
if (!A) return null;
|
|
192
|
+
let e = new Date(A);
|
|
193
193
|
return Number.isNaN(e.getTime()) ? null : e.toISOString();
|
|
194
|
-
}, [
|
|
195
|
-
title:
|
|
196
|
-
metaTitle:
|
|
197
|
-
metaDescription:
|
|
198
|
-
slug:
|
|
199
|
-
bodyChars:
|
|
200
|
-
tagCount:
|
|
194
|
+
}, [A]), q = K ? new Date(K).getTime() > Date.now() : !1, J = a(() => it(k), [k]), an = a(() => at({
|
|
195
|
+
title: E,
|
|
196
|
+
metaTitle: j,
|
|
197
|
+
metaDescription: M,
|
|
198
|
+
slug: G,
|
|
199
|
+
bodyChars: J,
|
|
200
|
+
tagCount: O.length
|
|
201
201
|
}), [
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
]),
|
|
209
|
-
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
let e =
|
|
213
|
-
e && e.innerHTML !==
|
|
202
|
+
E,
|
|
203
|
+
j,
|
|
204
|
+
M,
|
|
205
|
+
G,
|
|
206
|
+
J,
|
|
207
|
+
O.length
|
|
208
|
+
]), Y = an.reduce((e, t) => t.passed ? e + t.weight : e, 0), X = Y >= 80 ? "success" : Y >= 50 ? "warning" : "error", on = () => {
|
|
209
|
+
w.current && Tt(w.current.innerHTML);
|
|
210
|
+
}, sn = Se(k);
|
|
211
|
+
sn.current = k, xe(() => {
|
|
212
|
+
let e = w.current;
|
|
213
|
+
e && e.innerHTML !== sn.current && (e.innerHTML = sn.current);
|
|
214
214
|
}, [
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
215
|
+
P,
|
|
216
|
+
T,
|
|
217
|
+
I
|
|
218
218
|
]);
|
|
219
|
-
let
|
|
220
|
-
Tt(e),
|
|
221
|
-
},
|
|
222
|
-
let n =
|
|
223
|
-
n && (n.focus(), document.execCommand(e, !1, t),
|
|
224
|
-
},
|
|
219
|
+
let cn = (e) => {
|
|
220
|
+
Tt(e), w.current && (w.current.innerHTML = e);
|
|
221
|
+
}, Z = (e, t) => {
|
|
222
|
+
let n = w.current;
|
|
223
|
+
n && (n.focus(), document.execCommand(e, !1, t), on());
|
|
224
|
+
}, ln = () => {
|
|
225
225
|
let e = window.prompt("Link URL", "https://");
|
|
226
|
-
e &&
|
|
227
|
-
},
|
|
226
|
+
e && Z("createLink", e);
|
|
227
|
+
}, un = (e) => {
|
|
228
228
|
let t = e.target.files?.[0];
|
|
229
229
|
e.target.value = "", t && ht(t).then((e) => {
|
|
230
|
-
let t =
|
|
231
|
-
t && (t.innerHTML += `<img src="${
|
|
230
|
+
let t = w.current;
|
|
231
|
+
t && (t.innerHTML += `<img src="${nt(e.url)}" alt="${nt(e.name)}" style="max-width:100%;height:auto" />`, on());
|
|
232
232
|
}).catch(() => {});
|
|
233
|
-
},
|
|
234
|
-
if (!
|
|
235
|
-
|
|
233
|
+
}, dn = async (e) => {
|
|
234
|
+
if (!T) {
|
|
235
|
+
F("Select a content type.");
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
|
-
if (!
|
|
239
|
-
|
|
238
|
+
if (!E.trim()) {
|
|
239
|
+
F("Content title is required.");
|
|
240
240
|
return;
|
|
241
241
|
}
|
|
242
|
-
|
|
243
|
-
let t =
|
|
244
|
-
metaTitle:
|
|
245
|
-
metaDescription:
|
|
242
|
+
F(null);
|
|
243
|
+
let t = j.trim() || M.trim() ? {
|
|
244
|
+
metaTitle: j.trim() || null,
|
|
245
|
+
metaDescription: M.trim() || null
|
|
246
246
|
} : null, n = {
|
|
247
|
-
title:
|
|
248
|
-
slug:
|
|
249
|
-
summary:
|
|
250
|
-
body:
|
|
251
|
-
type:
|
|
252
|
-
tags:
|
|
253
|
-
campaignId:
|
|
254
|
-
scheduledAt:
|
|
247
|
+
title: E.trim(),
|
|
248
|
+
slug: G.trim() || null,
|
|
249
|
+
summary: D.trim() || null,
|
|
250
|
+
body: k || null,
|
|
251
|
+
type: T,
|
|
252
|
+
tags: O,
|
|
253
|
+
campaignId: At || null,
|
|
254
|
+
scheduledAt: K,
|
|
255
255
|
metadata: {
|
|
256
256
|
templateId: bt,
|
|
257
257
|
seo: t
|
|
258
|
-
}
|
|
258
|
+
},
|
|
259
|
+
...en ? { aiToolExecutionId: en } : {}
|
|
259
260
|
};
|
|
260
|
-
if (
|
|
261
|
-
let t = e && !
|
|
261
|
+
if (d && u) {
|
|
262
|
+
let t = e && !q;
|
|
262
263
|
try {
|
|
263
|
-
await
|
|
264
|
-
id:
|
|
265
|
-
input:
|
|
266
|
-
type:
|
|
267
|
-
title:
|
|
268
|
-
slug:
|
|
269
|
-
summary:
|
|
270
|
-
body:
|
|
271
|
-
tags:
|
|
272
|
-
campaignId:
|
|
273
|
-
scheduledIso:
|
|
274
|
-
metaTitle:
|
|
275
|
-
metaDescription:
|
|
264
|
+
await ct({ variables: {
|
|
265
|
+
id: u,
|
|
266
|
+
input: ve(fe({
|
|
267
|
+
type: T,
|
|
268
|
+
title: E,
|
|
269
|
+
slug: G,
|
|
270
|
+
summary: D,
|
|
271
|
+
body: k,
|
|
272
|
+
tags: O,
|
|
273
|
+
campaignId: At,
|
|
274
|
+
scheduledIso: K,
|
|
275
|
+
metaTitle: j,
|
|
276
|
+
metaDescription: M,
|
|
276
277
|
templateId: bt
|
|
277
|
-
},
|
|
278
|
-
} }),
|
|
278
|
+
}, Vt, t ? ne.Published : void 0), en)
|
|
279
|
+
} }), p(), i(c + "/content/" + u);
|
|
279
280
|
} catch (e) {
|
|
280
|
-
|
|
281
|
+
F(e instanceof Error ? e.message : "Failed to save content item.");
|
|
281
282
|
}
|
|
282
283
|
return;
|
|
283
284
|
}
|
|
284
285
|
try {
|
|
285
|
-
let t = (await
|
|
286
|
-
e && !
|
|
286
|
+
let t = (await x({ variables: { input: n } })).data?.headshotmarketingCreateContentItem.id;
|
|
287
|
+
e && !q && t && await ft({ variables: {
|
|
287
288
|
id: t,
|
|
288
|
-
input: { status:
|
|
289
|
-
} }),
|
|
289
|
+
input: { status: ne.Published }
|
|
290
|
+
} }), p(), i(c + "/content");
|
|
290
291
|
} catch (e) {
|
|
291
|
-
|
|
292
|
+
F(e instanceof Error ? e.message : "Failed to save content item.");
|
|
292
293
|
}
|
|
293
|
-
},
|
|
294
|
-
if (!(!$ || !
|
|
295
|
-
|
|
294
|
+
}, Q = S || pt || lt, fn = Lt ?? st?.message ?? mt?.message ?? ut?.message ?? _t ?? null, pn = q ? "Schedule" : "Publish", mn = q ? Ee : Ue, hn = zt === ne.Published, gn = !d || !hn, _n = ue.find((e) => e.value === zt)?.label ?? "Draft", $ = V.find((e) => e.id === Ut) ?? V[0] ?? null, vn = async () => {
|
|
295
|
+
if (!(!$ || !L.trim())) {
|
|
296
|
+
z(null), Zt(null);
|
|
296
297
|
try {
|
|
297
|
-
let e = (await
|
|
298
|
+
let e = (await dt({ variables: { input: {
|
|
298
299
|
toolId: $.id,
|
|
299
|
-
input: { prompt:
|
|
300
|
-
instruction:
|
|
301
|
-
title:
|
|
302
|
-
bodyHtml:
|
|
303
|
-
includeDraft:
|
|
304
|
-
contentTypeLabel:
|
|
300
|
+
input: { prompt: pe({
|
|
301
|
+
instruction: L,
|
|
302
|
+
title: E,
|
|
303
|
+
bodyHtml: k,
|
|
304
|
+
includeDraft: Kt,
|
|
305
|
+
contentTypeLabel: W
|
|
305
306
|
}) },
|
|
306
307
|
metadata: {
|
|
307
308
|
source: "content-editor",
|
|
308
309
|
provider: $.provider,
|
|
309
|
-
contentId:
|
|
310
|
+
contentId: u ?? null
|
|
310
311
|
}
|
|
311
312
|
} } })).data?.headshotmarketingExecuteAITool;
|
|
312
313
|
if (!e) throw Error("No response from the tool.");
|
|
313
314
|
if (e.status === "FAILED") {
|
|
314
|
-
|
|
315
|
+
R([]), z(e.errorMessage ?? "The tool failed to generate a result. Please try again.");
|
|
315
316
|
return;
|
|
316
317
|
}
|
|
317
|
-
let t =
|
|
318
|
-
|
|
318
|
+
let t = le(e.output).filter((e) => e.trim());
|
|
319
|
+
R(t), $t(e.id), t.length === 0 && z("The tool returned no copy. Try a more specific request.");
|
|
319
320
|
} catch (e) {
|
|
320
|
-
|
|
321
|
+
R([]), z(e instanceof Error ? e.message : "Generation failed.");
|
|
321
322
|
}
|
|
322
323
|
}
|
|
323
|
-
},
|
|
324
|
-
|
|
324
|
+
}, yn = (e, t, n) => {
|
|
325
|
+
cn(ge(k, t, n)), It("edit"), Zt(e), Qt && tn(Qt);
|
|
325
326
|
};
|
|
326
|
-
if (
|
|
327
|
-
let e = !
|
|
328
|
-
return /* @__PURE__ */
|
|
327
|
+
if (d && !I) {
|
|
328
|
+
let e = !_.loading && !_.error && !B;
|
|
329
|
+
return /* @__PURE__ */ h(re, {
|
|
329
330
|
title: "Edit content",
|
|
330
|
-
children: /* @__PURE__ */
|
|
331
|
-
loading:
|
|
332
|
-
error:
|
|
333
|
-
onRetry: () => void
|
|
334
|
-
hasData: !!
|
|
335
|
-
children: e && /* @__PURE__ */
|
|
331
|
+
children: /* @__PURE__ */ h(ae, {
|
|
332
|
+
loading: _.loading,
|
|
333
|
+
error: _.error,
|
|
334
|
+
onRetry: () => void _.refetch(),
|
|
335
|
+
hasData: !!B || e,
|
|
336
|
+
children: e && /* @__PURE__ */ h(ie, {
|
|
336
337
|
illustration: "empty-files",
|
|
337
338
|
title: "Content not found",
|
|
338
339
|
description: "This content item doesn't exist or has been removed.",
|
|
339
|
-
action: /* @__PURE__ */
|
|
340
|
+
action: /* @__PURE__ */ g("button", {
|
|
340
341
|
type: "button",
|
|
341
|
-
onClick: () => i(
|
|
342
|
+
onClick: () => i(c + "/content"),
|
|
342
343
|
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
|
|
343
|
-
children: [/* @__PURE__ */
|
|
344
|
+
children: [/* @__PURE__ */ h(Ce, { className: "h-4 w-4" }), "Back to Content"]
|
|
344
345
|
})
|
|
345
346
|
})
|
|
346
347
|
})
|
|
347
348
|
});
|
|
348
349
|
}
|
|
349
|
-
let
|
|
350
|
+
let bn = [
|
|
350
351
|
{
|
|
351
352
|
key: "settings",
|
|
352
353
|
label: "Settings",
|
|
353
|
-
icon:
|
|
354
|
+
icon: We
|
|
354
355
|
},
|
|
355
356
|
{
|
|
356
357
|
key: "seo",
|
|
357
358
|
label: "SEO",
|
|
358
|
-
icon:
|
|
359
|
+
icon: He
|
|
359
360
|
},
|
|
360
361
|
{
|
|
361
362
|
key: "ai",
|
|
362
363
|
label: "AI Assist",
|
|
363
|
-
icon:
|
|
364
|
+
icon: Ge
|
|
364
365
|
}
|
|
365
366
|
];
|
|
366
|
-
return /* @__PURE__ */
|
|
367
|
-
title:
|
|
368
|
-
description:
|
|
369
|
-
actions: /* @__PURE__ */
|
|
367
|
+
return /* @__PURE__ */ g(re, {
|
|
368
|
+
title: d ? `Edit ${W}` : T ? `New ${W}` : "Content Creation",
|
|
369
|
+
description: d ? "Update the copy, settings and status of this content item" : "Create marketing content from scratch or templates",
|
|
370
|
+
actions: /* @__PURE__ */ g("button", {
|
|
370
371
|
type: "button",
|
|
371
|
-
onClick: () => i(
|
|
372
|
+
onClick: () => i(c + (d && u ? "/content/" + u : "/content")),
|
|
372
373
|
className: "inline-flex min-h-[40px] items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
373
|
-
children: [/* @__PURE__ */
|
|
374
|
+
children: [/* @__PURE__ */ h(Ce, { className: "h-4 w-4" }), "Back"]
|
|
374
375
|
}),
|
|
375
376
|
children: [
|
|
376
|
-
/* @__PURE__ */
|
|
377
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ h(Ze, { children: d ? "Edit this piece of content: refine the copy, adjust its settings and SEO, use AI Assist to draft or rewrite sections, then save or publish." : "Create a new piece of content from scratch or from a template. Pick the format you want (blog post, email, social post, ad copy, landing page), optionally start from a proven template, then draft, refine and publish — all in one place." }),
|
|
378
|
+
/* @__PURE__ */ g(Xe, { children: [/* @__PURE__ */ h("h3", {
|
|
378
379
|
className: "text-sm font-semibold text-text-primary mb-3",
|
|
379
380
|
children: "Choose Content Type"
|
|
380
|
-
}), /* @__PURE__ */
|
|
381
|
+
}), /* @__PURE__ */ h("div", {
|
|
381
382
|
className: "grid grid-cols-2 md:grid-cols-5 gap-3",
|
|
382
|
-
children:
|
|
383
|
-
let t = e.icon, n =
|
|
384
|
-
return /* @__PURE__ */
|
|
383
|
+
children: Qe.map((e) => {
|
|
384
|
+
let t = e.icon, n = H === e.id;
|
|
385
|
+
return /* @__PURE__ */ g("button", {
|
|
385
386
|
type: "button",
|
|
386
387
|
onClick: () => {
|
|
387
|
-
let t =
|
|
388
|
-
t && yt(t),
|
|
388
|
+
let t = de[e.id];
|
|
389
|
+
t && yt(t), d || xt(null);
|
|
389
390
|
},
|
|
390
391
|
"aria-pressed": n,
|
|
391
392
|
className: r("group relative flex flex-col items-center gap-2 rounded-xl border-2 p-4 text-center transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", n ? "border-action-primary-bg bg-action-primary-bg/5 shadow-pop" : "border-border-subtle bg-bg-surface hover:border-action-primary-bg/40 hover:shadow-pop"),
|
|
392
393
|
children: [
|
|
393
|
-
n && /* @__PURE__ */
|
|
394
|
+
n && /* @__PURE__ */ h("span", {
|
|
394
395
|
className: "absolute right-2 top-2 inline-flex h-5 w-5 items-center justify-center rounded-full bg-action-primary-bg text-action-primary-text",
|
|
395
|
-
children: /* @__PURE__ */
|
|
396
|
+
children: /* @__PURE__ */ h(s, { className: "h-3 w-3" })
|
|
396
397
|
}),
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ h("div", {
|
|
398
399
|
className: r("rounded-lg p-2 transition-transform group-hover:scale-105", e.color),
|
|
399
|
-
children: /* @__PURE__ */
|
|
400
|
+
children: /* @__PURE__ */ h(t, { className: "h-5 w-5" })
|
|
400
401
|
}),
|
|
401
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ h("span", {
|
|
402
403
|
className: "text-sm font-medium text-text-primary",
|
|
403
404
|
children: e.label
|
|
404
405
|
}),
|
|
405
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ h("span", {
|
|
406
407
|
className: "text-[10px] leading-tight text-text-secondary",
|
|
407
408
|
children: e.description
|
|
408
409
|
})
|
|
@@ -410,404 +411,404 @@ var y = "inline-flex h-9 min-w-9 items-center justify-center gap-1 rounded-md px
|
|
|
410
411
|
}, e.id);
|
|
411
412
|
})
|
|
412
413
|
})] }),
|
|
413
|
-
|
|
414
|
+
T && !d && /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h3", {
|
|
414
415
|
className: "text-sm font-semibold text-text-primary mb-3",
|
|
415
416
|
children: "Select Template (Optional)"
|
|
416
|
-
}), /* @__PURE__ */
|
|
417
|
+
}), /* @__PURE__ */ h("div", {
|
|
417
418
|
className: "grid grid-cols-1 md:grid-cols-3 gap-3",
|
|
418
|
-
children:
|
|
419
|
+
children: rn.map((e) => {
|
|
419
420
|
let t = bt === e.id;
|
|
420
|
-
return /* @__PURE__ */
|
|
421
|
+
return /* @__PURE__ */ g("button", {
|
|
421
422
|
type: "button",
|
|
422
423
|
onClick: () => xt(t ? null : e.id),
|
|
423
424
|
"aria-pressed": t,
|
|
424
425
|
className: r("flex flex-col items-start rounded-xl border-2 p-4 text-left transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", t ? "border-action-primary-bg bg-action-primary-bg/5 shadow-pop" : "border-border-subtle bg-bg-surface hover:border-action-primary-bg/40"),
|
|
425
|
-
children: [/* @__PURE__ */
|
|
426
|
+
children: [/* @__PURE__ */ g("span", {
|
|
426
427
|
className: "flex w-full items-center justify-between text-sm font-medium text-text-primary",
|
|
427
|
-
children: [e.name, t && /* @__PURE__ */
|
|
428
|
-
}), /* @__PURE__ */
|
|
428
|
+
children: [e.name, t && /* @__PURE__ */ h(s, { className: "h-4 w-4 text-action-primary-bg" })]
|
|
429
|
+
}), /* @__PURE__ */ h("span", {
|
|
429
430
|
className: "mt-1 text-xs text-text-secondary",
|
|
430
431
|
children: e.description
|
|
431
432
|
})]
|
|
432
433
|
}, e.id);
|
|
433
434
|
})
|
|
434
435
|
})] }),
|
|
435
|
-
|
|
436
|
+
T && /* @__PURE__ */ g("div", {
|
|
436
437
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
437
|
-
children: [/* @__PURE__ */
|
|
438
|
+
children: [/* @__PURE__ */ g("div", {
|
|
438
439
|
className: "lg:col-span-2",
|
|
439
440
|
children: [
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
+
/* @__PURE__ */ g("div", {
|
|
441
442
|
className: "mb-3 flex items-center justify-between gap-2",
|
|
442
|
-
children: [/* @__PURE__ */
|
|
443
|
+
children: [/* @__PURE__ */ g("h3", {
|
|
443
444
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
444
|
-
children: [/* @__PURE__ */
|
|
445
|
-
}), /* @__PURE__ */
|
|
445
|
+
children: [/* @__PURE__ */ h(Oe, { className: "h-4 w-4" }), "Editor"]
|
|
446
|
+
}), /* @__PURE__ */ g("div", {
|
|
446
447
|
className: "inline-flex items-center rounded-lg border border-border-subtle p-0.5",
|
|
447
448
|
role: "tablist",
|
|
448
449
|
"aria-label": "Editor view",
|
|
449
|
-
children: [/* @__PURE__ */
|
|
450
|
+
children: [/* @__PURE__ */ g("button", {
|
|
450
451
|
type: "button",
|
|
451
452
|
role: "tab",
|
|
452
|
-
"aria-selected":
|
|
453
|
-
onClick: () =>
|
|
454
|
-
className: r("inline-flex min-h-[32px] items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors",
|
|
455
|
-
children: [/* @__PURE__ */
|
|
456
|
-
}), /* @__PURE__ */
|
|
453
|
+
"aria-selected": P === "edit",
|
|
454
|
+
onClick: () => It("edit"),
|
|
455
|
+
className: r("inline-flex min-h-[32px] items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors", P === "edit" ? "bg-action-primary-bg text-action-primary-text" : "text-text-secondary hover:text-text-primary"),
|
|
456
|
+
children: [/* @__PURE__ */ h(Oe, { className: "h-3.5 w-3.5" }), "Edit"]
|
|
457
|
+
}), /* @__PURE__ */ g("button", {
|
|
457
458
|
type: "button",
|
|
458
459
|
role: "tab",
|
|
459
|
-
"aria-selected":
|
|
460
|
-
onClick: () =>
|
|
461
|
-
className: r("inline-flex min-h-[32px] items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors",
|
|
462
|
-
children: [/* @__PURE__ */
|
|
460
|
+
"aria-selected": P === "preview",
|
|
461
|
+
onClick: () => It("preview"),
|
|
462
|
+
className: r("inline-flex min-h-[32px] items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors", P === "preview" ? "bg-action-primary-bg text-action-primary-text" : "text-text-secondary hover:text-text-primary"),
|
|
463
|
+
children: [/* @__PURE__ */ h(ke, { className: "h-3.5 w-3.5" }), "Preview"]
|
|
463
464
|
})]
|
|
464
465
|
})]
|
|
465
466
|
}),
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ g("div", {
|
|
467
468
|
className: "rounded-xl border border-border-seam bg-gloss-card shadow-pop",
|
|
468
|
-
children: [/* @__PURE__ */
|
|
469
|
+
children: [/* @__PURE__ */ h("div", {
|
|
469
470
|
className: "border-b border-border-subtle p-3",
|
|
470
|
-
children: /* @__PURE__ */
|
|
471
|
+
children: /* @__PURE__ */ h("input", {
|
|
471
472
|
type: "text",
|
|
472
|
-
value:
|
|
473
|
+
value: E,
|
|
473
474
|
onChange: (e) => St(e.target.value),
|
|
474
475
|
placeholder: "Content title",
|
|
475
476
|
"aria-label": "Content title",
|
|
476
477
|
className: "w-full bg-transparent px-1 py-1 text-lg font-semibold text-text-primary placeholder:text-text-secondary focus:outline-none"
|
|
477
478
|
})
|
|
478
|
-
}),
|
|
479
|
+
}), P === "edit" ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("div", {
|
|
479
480
|
className: "flex flex-wrap items-center gap-0.5 overflow-x-auto border-b border-border-subtle p-2",
|
|
480
481
|
children: [
|
|
481
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ h(y, {
|
|
482
483
|
label: "Bold",
|
|
483
|
-
onClick: () =>
|
|
484
|
-
children: /* @__PURE__ */
|
|
484
|
+
onClick: () => Z("bold"),
|
|
485
|
+
children: /* @__PURE__ */ h(Te, { className: "h-4 w-4" })
|
|
485
486
|
}),
|
|
486
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ h(y, {
|
|
487
488
|
label: "Italic",
|
|
488
|
-
onClick: () =>
|
|
489
|
-
children: /* @__PURE__ */
|
|
489
|
+
onClick: () => Z("italic"),
|
|
490
|
+
children: /* @__PURE__ */ h(Pe, { className: "h-4 w-4" })
|
|
490
491
|
}),
|
|
491
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ h(y, {
|
|
492
493
|
label: "Underline",
|
|
493
|
-
onClick: () =>
|
|
494
|
-
children: /* @__PURE__ */
|
|
494
|
+
onClick: () => Z("underline"),
|
|
495
|
+
children: /* @__PURE__ */ h(Ke, { className: "h-4 w-4" })
|
|
495
496
|
}),
|
|
496
|
-
/* @__PURE__ */
|
|
497
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ h(b, {}),
|
|
498
|
+
/* @__PURE__ */ h(y, {
|
|
498
499
|
label: "Heading 1",
|
|
499
|
-
onClick: () =>
|
|
500
|
-
children: /* @__PURE__ */
|
|
500
|
+
onClick: () => Z("formatBlock", "<h1>"),
|
|
501
|
+
children: /* @__PURE__ */ h(je, { className: "h-4 w-4" })
|
|
501
502
|
}),
|
|
502
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ h(y, {
|
|
503
504
|
label: "Heading 2",
|
|
504
|
-
onClick: () =>
|
|
505
|
-
children: /* @__PURE__ */
|
|
505
|
+
onClick: () => Z("formatBlock", "<h2>"),
|
|
506
|
+
children: /* @__PURE__ */ h(Me, { className: "h-4 w-4" })
|
|
506
507
|
}),
|
|
507
|
-
/* @__PURE__ */
|
|
508
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ h(b, {}),
|
|
509
|
+
/* @__PURE__ */ h(y, {
|
|
509
510
|
label: "Bulleted list",
|
|
510
|
-
onClick: () =>
|
|
511
|
-
children: /* @__PURE__ */
|
|
511
|
+
onClick: () => Z("insertUnorderedList"),
|
|
512
|
+
children: /* @__PURE__ */ h(Ie, { className: "h-4 w-4" })
|
|
512
513
|
}),
|
|
513
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ h(y, {
|
|
514
515
|
label: "Numbered list",
|
|
515
|
-
onClick: () =>
|
|
516
|
-
children: /* @__PURE__ */
|
|
516
|
+
onClick: () => Z("insertOrderedList"),
|
|
517
|
+
children: /* @__PURE__ */ h(Le, { className: "h-4 w-4" })
|
|
517
518
|
}),
|
|
518
|
-
/* @__PURE__ */
|
|
519
|
-
/* @__PURE__ */
|
|
519
|
+
/* @__PURE__ */ h(b, {}),
|
|
520
|
+
/* @__PURE__ */ h(y, {
|
|
520
521
|
label: "Quote",
|
|
521
|
-
onClick: () =>
|
|
522
|
-
children: /* @__PURE__ */
|
|
522
|
+
onClick: () => Z("formatBlock", "<blockquote>"),
|
|
523
|
+
children: /* @__PURE__ */ h(ze, { className: "h-4 w-4" })
|
|
523
524
|
}),
|
|
524
|
-
/* @__PURE__ */
|
|
525
|
+
/* @__PURE__ */ h(y, {
|
|
525
526
|
label: "Code block",
|
|
526
|
-
onClick: () =>
|
|
527
|
-
children: /* @__PURE__ */
|
|
527
|
+
onClick: () => Z("formatBlock", "<pre>"),
|
|
528
|
+
children: /* @__PURE__ */ h(De, { className: "h-4 w-4" })
|
|
528
529
|
}),
|
|
529
|
-
/* @__PURE__ */
|
|
530
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ h(b, {}),
|
|
531
|
+
/* @__PURE__ */ h(y, {
|
|
531
532
|
label: "Insert link",
|
|
532
|
-
onClick:
|
|
533
|
-
children: /* @__PURE__ */
|
|
533
|
+
onClick: ln,
|
|
534
|
+
children: /* @__PURE__ */ h(Fe, { className: "h-4 w-4" })
|
|
534
535
|
}),
|
|
535
|
-
/* @__PURE__ */
|
|
536
|
+
/* @__PURE__ */ h(y, {
|
|
536
537
|
label: "Insert image",
|
|
537
538
|
disabled: gt,
|
|
538
539
|
onClick: () => vt.current?.click(),
|
|
539
|
-
children: gt ? /* @__PURE__ */
|
|
540
|
+
children: gt ? /* @__PURE__ */ h(l, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ h(Ne, { className: "h-4 w-4" })
|
|
540
541
|
}),
|
|
541
|
-
/* @__PURE__ */
|
|
542
|
+
/* @__PURE__ */ h("input", {
|
|
542
543
|
ref: vt,
|
|
543
544
|
type: "file",
|
|
544
545
|
accept: "image/*",
|
|
545
|
-
onChange:
|
|
546
|
+
onChange: un,
|
|
546
547
|
className: "hidden",
|
|
547
548
|
"aria-hidden": "true",
|
|
548
549
|
tabIndex: -1
|
|
549
550
|
})
|
|
550
551
|
]
|
|
551
|
-
}), /* @__PURE__ */
|
|
552
|
-
ref:
|
|
552
|
+
}), /* @__PURE__ */ h("div", {
|
|
553
|
+
ref: w,
|
|
553
554
|
contentEditable: !0,
|
|
554
555
|
suppressContentEditableWarning: !0,
|
|
555
556
|
role: "textbox",
|
|
556
557
|
"aria-multiline": "true",
|
|
557
558
|
"aria-label": "Content body",
|
|
558
|
-
onInput:
|
|
559
|
+
onInput: on,
|
|
559
560
|
"data-placeholder": "Start writing your content...",
|
|
560
|
-
className: r("min-h-[420px] w-full p-4 text-sm focus:outline-none",
|
|
561
|
-
})] }) : /* @__PURE__ */
|
|
561
|
+
className: r("min-h-[420px] w-full p-4 text-sm focus:outline-none", ot, "empty:before:text-text-secondary empty:before:content-[attr(data-placeholder)]")
|
|
562
|
+
})] }) : /* @__PURE__ */ h("div", {
|
|
562
563
|
className: "min-h-[420px] p-6",
|
|
563
|
-
children:
|
|
564
|
-
className:
|
|
565
|
-
dangerouslySetInnerHTML: { __html:
|
|
566
|
-
}) : /* @__PURE__ */
|
|
564
|
+
children: k ? /* @__PURE__ */ h("div", {
|
|
565
|
+
className: ot,
|
|
566
|
+
dangerouslySetInnerHTML: { __html: ye(k) }
|
|
567
|
+
}) : /* @__PURE__ */ h("div", {
|
|
567
568
|
className: "flex min-h-[380px] items-center justify-center text-sm text-text-secondary",
|
|
568
569
|
children: "Nothing to preview yet — switch to Edit and start writing."
|
|
569
570
|
})
|
|
570
571
|
})]
|
|
571
572
|
}),
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
+
/* @__PURE__ */ g("div", {
|
|
573
574
|
className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 px-1 text-xs text-text-secondary",
|
|
574
575
|
children: [
|
|
575
|
-
/* @__PURE__ */
|
|
576
|
-
/* @__PURE__ */
|
|
576
|
+
/* @__PURE__ */ g("span", { children: [J.toLocaleString(), " characters"] }),
|
|
577
|
+
/* @__PURE__ */ h("span", {
|
|
577
578
|
"aria-hidden": "true",
|
|
578
579
|
children: "•"
|
|
579
580
|
}),
|
|
580
|
-
/* @__PURE__ */
|
|
581
|
+
/* @__PURE__ */ g("span", { children: [k ? Math.max(1, Math.ceil(J / 1e3)) : 0, " min read"] })
|
|
581
582
|
]
|
|
582
583
|
})
|
|
583
584
|
]
|
|
584
|
-
}), /* @__PURE__ */
|
|
585
|
+
}), /* @__PURE__ */ h("div", {
|
|
585
586
|
className: "lg:col-span-1",
|
|
586
|
-
children: /* @__PURE__ */
|
|
587
|
+
children: /* @__PURE__ */ g("div", {
|
|
587
588
|
className: "lg:sticky lg:top-4",
|
|
588
|
-
children: [/* @__PURE__ */
|
|
589
|
+
children: [/* @__PURE__ */ h("div", {
|
|
589
590
|
className: "mb-3 flex items-center gap-1 overflow-x-auto border-b border-border-seam",
|
|
590
591
|
role: "tablist",
|
|
591
592
|
"aria-label": "Content settings",
|
|
592
|
-
children:
|
|
593
|
-
let t = e.icon, n =
|
|
594
|
-
return /* @__PURE__ */
|
|
593
|
+
children: bn.map((e) => {
|
|
594
|
+
let t = e.icon, n = N === e.key;
|
|
595
|
+
return /* @__PURE__ */ g("button", {
|
|
595
596
|
type: "button",
|
|
596
597
|
role: "tab",
|
|
597
598
|
"aria-selected": n,
|
|
598
|
-
onClick: () =>
|
|
599
|
+
onClick: () => Ft(e.key),
|
|
599
600
|
className: r("relative inline-flex min-h-[40px] shrink-0 items-center gap-1.5 whitespace-nowrap px-3 pb-2.5 pt-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", n ? "text-text-primary" : "text-text-secondary hover:text-text-primary"),
|
|
600
601
|
children: [
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ h(t, { className: "h-4 w-4" }),
|
|
602
603
|
e.label,
|
|
603
|
-
n && /* @__PURE__ */
|
|
604
|
+
n && /* @__PURE__ */ h("span", { className: "absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-action-primary-bg" })
|
|
604
605
|
]
|
|
605
606
|
}, e.key);
|
|
606
607
|
})
|
|
607
|
-
}), /* @__PURE__ */
|
|
608
|
+
}), /* @__PURE__ */ g("div", {
|
|
608
609
|
className: "rounded-xl border border-border-seam bg-gloss-card shadow-pop p-4",
|
|
609
610
|
children: [
|
|
610
|
-
|
|
611
|
+
N === "settings" && /* @__PURE__ */ g("div", {
|
|
611
612
|
className: "space-y-4",
|
|
612
613
|
children: [
|
|
613
|
-
/* @__PURE__ */
|
|
614
|
+
/* @__PURE__ */ g("div", {
|
|
614
615
|
className: "grid grid-cols-2 gap-3",
|
|
615
|
-
children: [/* @__PURE__ */
|
|
616
|
+
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
|
|
616
617
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
617
618
|
children: "Content type"
|
|
618
|
-
}), /* @__PURE__ */
|
|
619
|
+
}), /* @__PURE__ */ g("span", {
|
|
619
620
|
className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-sm text-text-primary",
|
|
620
|
-
children: [
|
|
621
|
-
})] }), /* @__PURE__ */
|
|
621
|
+
children: [h(U ? U.icon : Ae, { className: "h-3.5 w-3.5" }), W]
|
|
622
|
+
})] }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
|
|
622
623
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
623
624
|
children: "Status"
|
|
624
|
-
}), /* @__PURE__ */
|
|
625
|
-
className: r("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm font-medium",
|
|
626
|
-
children:
|
|
625
|
+
}), /* @__PURE__ */ h("span", {
|
|
626
|
+
className: r("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm font-medium", q ? "bg-status-info-bg text-status-info-text" : "bg-status-warning-bg text-status-warning-text"),
|
|
627
|
+
children: q ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(Ee, { className: "h-3.5 w-3.5" }), "Scheduled"] }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(Oe, { className: "h-3.5 w-3.5" }), d ? _n : "Draft"] })
|
|
627
628
|
})] })]
|
|
628
629
|
}),
|
|
629
|
-
/* @__PURE__ */
|
|
630
|
-
/* @__PURE__ */
|
|
630
|
+
/* @__PURE__ */ g("div", { children: [
|
|
631
|
+
/* @__PURE__ */ h("label", {
|
|
631
632
|
htmlFor: "content-slug",
|
|
632
633
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
633
634
|
children: "Slug"
|
|
634
635
|
}),
|
|
635
|
-
/* @__PURE__ */
|
|
636
|
+
/* @__PURE__ */ h("input", {
|
|
636
637
|
id: "content-slug",
|
|
637
638
|
type: "text",
|
|
638
|
-
value:
|
|
639
|
+
value: G,
|
|
639
640
|
onChange: (e) => {
|
|
640
|
-
|
|
641
|
+
kt(!0), Dt(rt(e.target.value));
|
|
641
642
|
},
|
|
642
643
|
placeholder: "auto-generated-from-title",
|
|
643
|
-
className: r(
|
|
644
|
+
className: r(v, "font-mono text-xs")
|
|
644
645
|
}),
|
|
645
|
-
|
|
646
|
+
Ot && /* @__PURE__ */ h("button", {
|
|
646
647
|
type: "button",
|
|
647
648
|
onClick: () => {
|
|
648
|
-
|
|
649
|
+
kt(!1), Dt("");
|
|
649
650
|
},
|
|
650
651
|
className: "mt-1 text-xs text-text-secondary underline hover:text-text-primary",
|
|
651
652
|
children: "Reset to title"
|
|
652
653
|
})
|
|
653
654
|
] }),
|
|
654
|
-
/* @__PURE__ */
|
|
655
|
+
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
655
656
|
htmlFor: "content-summary",
|
|
656
657
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
657
658
|
children: "Summary"
|
|
658
|
-
}), /* @__PURE__ */
|
|
659
|
+
}), /* @__PURE__ */ h("input", {
|
|
659
660
|
id: "content-summary",
|
|
660
661
|
type: "text",
|
|
661
|
-
value:
|
|
662
|
+
value: D,
|
|
662
663
|
onChange: (e) => Ct(e.target.value),
|
|
663
664
|
placeholder: "Short summary (optional)",
|
|
664
|
-
className:
|
|
665
|
+
className: v
|
|
665
666
|
})] }),
|
|
666
|
-
/* @__PURE__ */
|
|
667
|
+
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
|
|
667
668
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
668
669
|
children: "Tags"
|
|
669
|
-
}), /* @__PURE__ */
|
|
670
|
-
value:
|
|
670
|
+
}), /* @__PURE__ */ h(oe, {
|
|
671
|
+
value: O,
|
|
671
672
|
onChange: wt,
|
|
672
673
|
placeholder: "Add a tag…"
|
|
673
674
|
})] }),
|
|
674
|
-
/* @__PURE__ */
|
|
675
|
-
/* @__PURE__ */
|
|
675
|
+
/* @__PURE__ */ g("div", { children: [
|
|
676
|
+
/* @__PURE__ */ h("label", {
|
|
676
677
|
htmlFor: "content-campaign",
|
|
677
678
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
678
679
|
children: "Campaign"
|
|
679
680
|
}),
|
|
680
|
-
/* @__PURE__ */
|
|
681
|
+
/* @__PURE__ */ g("select", {
|
|
681
682
|
id: "content-campaign",
|
|
682
|
-
value:
|
|
683
|
-
onChange: (e) =>
|
|
684
|
-
className: r(
|
|
685
|
-
children: [/* @__PURE__ */
|
|
683
|
+
value: At,
|
|
684
|
+
onChange: (e) => jt(e.target.value),
|
|
685
|
+
className: r(v, "h-10"),
|
|
686
|
+
children: [/* @__PURE__ */ h("option", {
|
|
686
687
|
value: "",
|
|
687
688
|
children: "No campaign"
|
|
688
|
-
}),
|
|
689
|
+
}), nn.map((e) => /* @__PURE__ */ h("option", {
|
|
689
690
|
value: e.id,
|
|
690
691
|
children: e.name
|
|
691
692
|
}, e.id))]
|
|
692
693
|
}),
|
|
693
|
-
|
|
694
|
+
nn.length === 0 && /* @__PURE__ */ h("p", {
|
|
694
695
|
className: "mt-1 text-xs text-text-secondary",
|
|
695
696
|
children: "No campaigns yet — create one to link content."
|
|
696
697
|
})
|
|
697
698
|
] }),
|
|
698
|
-
/* @__PURE__ */
|
|
699
|
-
/* @__PURE__ */
|
|
699
|
+
/* @__PURE__ */ g("div", { children: [
|
|
700
|
+
/* @__PURE__ */ g("label", {
|
|
700
701
|
htmlFor: "content-schedule",
|
|
701
702
|
className: "mb-1 flex items-center gap-1.5 text-xs font-medium text-text-secondary",
|
|
702
|
-
children: [/* @__PURE__ */
|
|
703
|
+
children: [/* @__PURE__ */ h(Ee, { className: "h-3.5 w-3.5" }), "Publish schedule"]
|
|
703
704
|
}),
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
+
/* @__PURE__ */ h("input", {
|
|
705
706
|
id: "content-schedule",
|
|
706
707
|
type: "datetime-local",
|
|
707
|
-
value:
|
|
708
|
-
onChange: (e) =>
|
|
709
|
-
className: r(
|
|
708
|
+
value: A,
|
|
709
|
+
onChange: (e) => Mt(e.target.value),
|
|
710
|
+
className: r(v, "h-10")
|
|
710
711
|
}),
|
|
711
|
-
|
|
712
|
+
A && !q && /* @__PURE__ */ h("p", {
|
|
712
713
|
className: "mt-1 text-xs text-status-warning-text",
|
|
713
714
|
children: "Pick a future time to schedule publishing."
|
|
714
715
|
}),
|
|
715
|
-
|
|
716
|
+
q && /* @__PURE__ */ h("p", {
|
|
716
717
|
className: "mt-1 text-xs text-text-secondary",
|
|
717
718
|
children: "Saved as a draft and published automatically at this time."
|
|
718
719
|
})
|
|
719
720
|
] })
|
|
720
721
|
]
|
|
721
722
|
}),
|
|
722
|
-
|
|
723
|
+
N === "seo" && /* @__PURE__ */ g("div", {
|
|
723
724
|
className: "space-y-4",
|
|
724
725
|
children: [
|
|
725
|
-
/* @__PURE__ */
|
|
726
|
+
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("div", {
|
|
726
727
|
className: "mb-1 flex items-center justify-between",
|
|
727
|
-
children: [/* @__PURE__ */
|
|
728
|
+
children: [/* @__PURE__ */ h("span", {
|
|
728
729
|
className: "text-xs font-medium text-text-secondary",
|
|
729
730
|
children: "SEO score"
|
|
730
|
-
}), /* @__PURE__ */
|
|
731
|
-
className: r("text-sm font-semibold",
|
|
732
|
-
children: [
|
|
731
|
+
}), /* @__PURE__ */ g("span", {
|
|
732
|
+
className: r("text-sm font-semibold", X === "success" && "text-status-success-text", X === "warning" && "text-status-warning-text", X === "error" && "text-status-error-text"),
|
|
733
|
+
children: [Y, "/100"]
|
|
733
734
|
})]
|
|
734
|
-
}), /* @__PURE__ */
|
|
735
|
+
}), /* @__PURE__ */ h("div", {
|
|
735
736
|
className: "h-2 w-full overflow-hidden rounded-full bg-bg-sunken",
|
|
736
|
-
children: /* @__PURE__ */
|
|
737
|
-
className: r("h-full rounded-full transition-all",
|
|
738
|
-
style: { width: `${
|
|
737
|
+
children: /* @__PURE__ */ h("div", {
|
|
738
|
+
className: r("h-full rounded-full transition-all", X === "success" && "bg-status-success-text", X === "warning" && "bg-status-warning-text", X === "error" && "bg-status-error-text"),
|
|
739
|
+
style: { width: `${Y}%` }
|
|
739
740
|
})
|
|
740
741
|
})] }),
|
|
741
|
-
/* @__PURE__ */
|
|
742
|
-
/* @__PURE__ */
|
|
742
|
+
/* @__PURE__ */ g("div", { children: [
|
|
743
|
+
/* @__PURE__ */ h("label", {
|
|
743
744
|
htmlFor: "content-meta-title",
|
|
744
745
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
745
746
|
children: "Meta title"
|
|
746
747
|
}),
|
|
747
|
-
/* @__PURE__ */
|
|
748
|
+
/* @__PURE__ */ h("input", {
|
|
748
749
|
id: "content-meta-title",
|
|
749
750
|
type: "text",
|
|
750
|
-
value:
|
|
751
|
-
onChange: (e) =>
|
|
752
|
-
placeholder:
|
|
751
|
+
value: j,
|
|
752
|
+
onChange: (e) => Nt(e.target.value),
|
|
753
|
+
placeholder: E || "Page title for search results",
|
|
753
754
|
maxLength: 70,
|
|
754
|
-
className:
|
|
755
|
+
className: v
|
|
755
756
|
}),
|
|
756
|
-
/* @__PURE__ */
|
|
757
|
+
/* @__PURE__ */ g("p", {
|
|
757
758
|
className: "mt-1 text-right text-xs text-text-secondary",
|
|
758
|
-
children: [(
|
|
759
|
+
children: [(j || E).length, "/60"]
|
|
759
760
|
})
|
|
760
761
|
] }),
|
|
761
|
-
/* @__PURE__ */
|
|
762
|
-
/* @__PURE__ */
|
|
762
|
+
/* @__PURE__ */ g("div", { children: [
|
|
763
|
+
/* @__PURE__ */ h("label", {
|
|
763
764
|
htmlFor: "content-meta-desc",
|
|
764
765
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
765
766
|
children: "Meta description"
|
|
766
767
|
}),
|
|
767
|
-
/* @__PURE__ */
|
|
768
|
+
/* @__PURE__ */ h("textarea", {
|
|
768
769
|
id: "content-meta-desc",
|
|
769
|
-
value:
|
|
770
|
-
onChange: (e) =>
|
|
770
|
+
value: M,
|
|
771
|
+
onChange: (e) => Pt(e.target.value),
|
|
771
772
|
placeholder: "Description shown in search results",
|
|
772
773
|
rows: 3,
|
|
773
774
|
maxLength: 200,
|
|
774
|
-
className: r(
|
|
775
|
+
className: r(v, "resize-none")
|
|
775
776
|
}),
|
|
776
|
-
/* @__PURE__ */
|
|
777
|
+
/* @__PURE__ */ g("p", {
|
|
777
778
|
className: "mt-1 text-right text-xs text-text-secondary",
|
|
778
|
-
children: [
|
|
779
|
+
children: [M.length, "/160"]
|
|
779
780
|
})
|
|
780
781
|
] }),
|
|
781
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
|
|
782
783
|
className: "mb-1.5 block text-xs font-medium text-text-secondary",
|
|
783
784
|
children: "Search preview"
|
|
784
|
-
}), /* @__PURE__ */
|
|
785
|
+
}), /* @__PURE__ */ g("div", {
|
|
785
786
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-3",
|
|
786
787
|
children: [
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ h("p", {
|
|
788
789
|
className: "truncate text-xs text-status-success-text",
|
|
789
|
-
children:
|
|
790
|
+
children: G ? `/${G}` : "/your-content-slug"
|
|
790
791
|
}),
|
|
791
|
-
/* @__PURE__ */
|
|
792
|
+
/* @__PURE__ */ h("p", {
|
|
792
793
|
className: "mt-0.5 truncate text-sm font-medium text-primary",
|
|
793
|
-
children:
|
|
794
|
+
children: j || E || "Untitled content"
|
|
794
795
|
}),
|
|
795
|
-
/* @__PURE__ */
|
|
796
|
+
/* @__PURE__ */ h("p", {
|
|
796
797
|
className: "mt-0.5 line-clamp-2 text-xs text-text-secondary",
|
|
797
|
-
children:
|
|
798
|
+
children: M || D || "Add a meta description to control how this appears in search results."
|
|
798
799
|
})
|
|
799
800
|
]
|
|
800
801
|
})] }),
|
|
801
|
-
/* @__PURE__ */
|
|
802
|
+
/* @__PURE__ */ h("ul", {
|
|
802
803
|
className: "space-y-1.5",
|
|
803
|
-
children:
|
|
804
|
+
children: an.map((e) => /* @__PURE__ */ g("li", {
|
|
804
805
|
className: "flex items-start gap-2 text-xs",
|
|
805
|
-
children: [/* @__PURE__ */
|
|
806
|
+
children: [/* @__PURE__ */ h("span", {
|
|
806
807
|
className: r("mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full", e.passed ? "bg-status-success-bg text-status-success-text" : "bg-bg-sunken text-text-secondary"),
|
|
807
|
-
children: e.passed ? /* @__PURE__ */
|
|
808
|
-
}), /* @__PURE__ */
|
|
808
|
+
children: e.passed ? /* @__PURE__ */ h(s, { className: "h-3 w-3" }) : /* @__PURE__ */ h("span", { className: "h-1.5 w-1.5 rounded-full bg-current" })
|
|
809
|
+
}), /* @__PURE__ */ g("span", {
|
|
809
810
|
className: e.passed ? "text-text-primary" : "text-text-secondary",
|
|
810
|
-
children: [e.label, !e.passed && /* @__PURE__ */
|
|
811
|
+
children: [e.label, !e.passed && /* @__PURE__ */ g("span", {
|
|
811
812
|
className: "text-text-secondary",
|
|
812
813
|
children: [
|
|
813
814
|
" ",
|
|
@@ -820,106 +821,106 @@ var y = "inline-flex h-9 min-w-9 items-center justify-center gap-1 rounded-md px
|
|
|
820
821
|
})
|
|
821
822
|
]
|
|
822
823
|
}),
|
|
823
|
-
|
|
824
|
+
N === "ai" && /* @__PURE__ */ g("div", {
|
|
824
825
|
className: "space-y-3",
|
|
825
826
|
children: [
|
|
826
|
-
/* @__PURE__ */
|
|
827
|
+
/* @__PURE__ */ g("div", {
|
|
827
828
|
className: "flex items-start gap-2 rounded-lg border border-border-subtle bg-bg-surface p-3",
|
|
828
|
-
children: [/* @__PURE__ */
|
|
829
|
+
children: [/* @__PURE__ */ h(Ge, { className: "mt-0.5 h-4 w-4 shrink-0 text-action-primary-bg" }), /* @__PURE__ */ h("p", {
|
|
829
830
|
className: "text-xs text-text-secondary",
|
|
830
831
|
children: "Draft, rewrite and optimize copy with your workspace AI tools, then insert the result straight into the editor."
|
|
831
832
|
})]
|
|
832
833
|
}),
|
|
833
|
-
|
|
834
|
+
V.length > 0 && $ ? /* @__PURE__ */ g("div", {
|
|
834
835
|
className: "space-y-3",
|
|
835
836
|
children: [
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */
|
|
837
|
+
/* @__PURE__ */ g("div", { children: [
|
|
838
|
+
/* @__PURE__ */ h("label", {
|
|
838
839
|
htmlFor: "content-ai-tool",
|
|
839
840
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
840
841
|
children: "AI tool"
|
|
841
842
|
}),
|
|
842
|
-
/* @__PURE__ */
|
|
843
|
+
/* @__PURE__ */ h("select", {
|
|
843
844
|
id: "content-ai-tool",
|
|
844
845
|
value: $.id,
|
|
845
846
|
onChange: (e) => {
|
|
846
|
-
|
|
847
|
+
Wt(e.target.value), R([]), z(null);
|
|
847
848
|
},
|
|
848
|
-
className: r(
|
|
849
|
-
children:
|
|
849
|
+
className: r(v, "h-10"),
|
|
850
|
+
children: V.map((e) => /* @__PURE__ */ h("option", {
|
|
850
851
|
value: e.id,
|
|
851
852
|
children: e.name
|
|
852
853
|
}, e.id))
|
|
853
854
|
}),
|
|
854
|
-
$.description && /* @__PURE__ */
|
|
855
|
+
$.description && /* @__PURE__ */ h("p", {
|
|
855
856
|
className: "mt-1 text-xs text-text-secondary",
|
|
856
857
|
children: $.description
|
|
857
858
|
})
|
|
858
859
|
] }),
|
|
859
|
-
/* @__PURE__ */
|
|
860
|
+
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
860
861
|
htmlFor: "content-ai-instruction",
|
|
861
862
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
862
863
|
children: "What should it write?"
|
|
863
|
-
}), /* @__PURE__ */
|
|
864
|
+
}), /* @__PURE__ */ h("textarea", {
|
|
864
865
|
id: "content-ai-instruction",
|
|
865
|
-
value:
|
|
866
|
-
onChange: (e) =>
|
|
866
|
+
value: L,
|
|
867
|
+
onChange: (e) => Gt(e.target.value),
|
|
867
868
|
placeholder: "e.g. Write an engaging intro paragraph about spring headshot sessions",
|
|
868
869
|
rows: 3,
|
|
869
870
|
maxLength: 1e3,
|
|
870
|
-
className: r(
|
|
871
|
+
className: r(v, "resize-none")
|
|
871
872
|
})] }),
|
|
872
|
-
/* @__PURE__ */
|
|
873
|
+
/* @__PURE__ */ g("label", {
|
|
873
874
|
className: "flex items-center gap-2 text-xs text-text-secondary",
|
|
874
|
-
children: [/* @__PURE__ */
|
|
875
|
+
children: [/* @__PURE__ */ h("input", {
|
|
875
876
|
type: "checkbox",
|
|
876
|
-
checked:
|
|
877
|
-
onChange: (e) =>
|
|
877
|
+
checked: Kt,
|
|
878
|
+
onChange: (e) => qt(e.target.checked),
|
|
878
879
|
className: "h-4 w-4 rounded border-border-subtle"
|
|
879
880
|
}), "Use the title and current draft as context"]
|
|
880
881
|
}),
|
|
881
|
-
/* @__PURE__ */
|
|
882
|
+
/* @__PURE__ */ g("button", {
|
|
882
883
|
type: "button",
|
|
883
884
|
onClick: () => {
|
|
884
|
-
|
|
885
|
+
vn();
|
|
885
886
|
},
|
|
886
|
-
disabled:
|
|
887
|
+
disabled: C || !L.trim(),
|
|
887
888
|
className: "inline-flex w-full min-h-[40px] items-center justify-center gap-2 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:opacity-60",
|
|
888
|
-
children: [
|
|
889
|
+
children: [C ? /* @__PURE__ */ h(l, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ h(qe, { className: "h-4 w-4" }), C ? "Generating…" : "Generate"]
|
|
889
890
|
}),
|
|
890
|
-
|
|
891
|
+
Yt && /* @__PURE__ */ h("p", {
|
|
891
892
|
role: "alert",
|
|
892
893
|
className: "rounded-md border border-status-error-border/30 bg-status-error-bg/10 px-3 py-2 text-xs text-status-error-text",
|
|
893
|
-
children:
|
|
894
|
+
children: Yt
|
|
894
895
|
}),
|
|
895
|
-
|
|
896
|
+
Jt.length > 0 && /* @__PURE__ */ h("ul", {
|
|
896
897
|
className: "space-y-2",
|
|
897
898
|
"aria-label": "Generated suggestions",
|
|
898
|
-
children:
|
|
899
|
+
children: Jt.map((e, t) => {
|
|
899
900
|
let n = `ai-${t}`;
|
|
900
|
-
return /* @__PURE__ */
|
|
901
|
+
return /* @__PURE__ */ g("li", {
|
|
901
902
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-3",
|
|
902
|
-
children: [/* @__PURE__ */
|
|
903
|
+
children: [/* @__PURE__ */ h("p", {
|
|
903
904
|
className: "max-h-48 overflow-y-auto whitespace-pre-wrap text-xs text-text-primary",
|
|
904
905
|
children: e
|
|
905
|
-
}), /* @__PURE__ */
|
|
906
|
+
}), /* @__PURE__ */ g("div", {
|
|
906
907
|
className: "mt-2 flex flex-wrap items-center gap-2",
|
|
907
908
|
children: [
|
|
908
|
-
/* @__PURE__ */
|
|
909
|
+
/* @__PURE__ */ g("button", {
|
|
909
910
|
type: "button",
|
|
910
|
-
onClick: () =>
|
|
911
|
+
onClick: () => yn(n, e, "append"),
|
|
911
912
|
className: "inline-flex min-h-[32px] items-center gap-1.5 rounded-md border border-border-subtle px-2.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
912
|
-
children: [/* @__PURE__ */
|
|
913
|
+
children: [/* @__PURE__ */ h(Re, { className: "h-3.5 w-3.5" }), "Insert into draft"]
|
|
913
914
|
}),
|
|
914
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ g("button", {
|
|
915
916
|
type: "button",
|
|
916
|
-
onClick: () =>
|
|
917
|
+
onClick: () => yn(n, e, "replace"),
|
|
917
918
|
className: "inline-flex min-h-[32px] items-center gap-1.5 rounded-md border border-border-subtle px-2.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
918
|
-
children: [/* @__PURE__ */
|
|
919
|
+
children: [/* @__PURE__ */ h(Be, { className: "h-3.5 w-3.5" }), "Replace draft"]
|
|
919
920
|
}),
|
|
920
|
-
|
|
921
|
+
Xt === n && /* @__PURE__ */ g("span", {
|
|
921
922
|
className: "inline-flex items-center gap-1 text-xs text-status-success-text",
|
|
922
|
-
children: [/* @__PURE__ */
|
|
923
|
+
children: [/* @__PURE__ */ h(s, { className: "h-3.5 w-3.5" }), "Inserted"]
|
|
923
924
|
})
|
|
924
925
|
]
|
|
925
926
|
})]
|
|
@@ -927,18 +928,18 @@ var y = "inline-flex h-9 min-w-9 items-center justify-center gap-1 rounded-md px
|
|
|
927
928
|
})
|
|
928
929
|
})
|
|
929
930
|
]
|
|
930
|
-
}) : /* @__PURE__ */
|
|
931
|
+
}) : /* @__PURE__ */ h("div", {
|
|
931
932
|
className: "rounded-lg border border-dashed border-border-subtle p-4 text-center",
|
|
932
|
-
children: /* @__PURE__ */
|
|
933
|
+
children: /* @__PURE__ */ h("p", {
|
|
933
934
|
className: "text-xs text-text-secondary",
|
|
934
935
|
children: "No content AI tools are enabled yet."
|
|
935
936
|
})
|
|
936
937
|
}),
|
|
937
|
-
/* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ g("button", {
|
|
938
939
|
type: "button",
|
|
939
|
-
onClick: () => i(
|
|
940
|
+
onClick: () => i(c + "/content/ai-tools"),
|
|
940
941
|
className: "inline-flex w-full min-h-[40px] items-center justify-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
941
|
-
children: [/* @__PURE__ */
|
|
942
|
+
children: [/* @__PURE__ */ h(we, { className: "h-4 w-4" }), "Open AI Tools"]
|
|
942
943
|
})
|
|
943
944
|
]
|
|
944
945
|
})
|
|
@@ -947,43 +948,43 @@ var y = "inline-flex h-9 min-w-9 items-center justify-center gap-1 rounded-md px
|
|
|
947
948
|
})
|
|
948
949
|
})]
|
|
949
950
|
}),
|
|
950
|
-
|
|
951
|
+
fn && /* @__PURE__ */ h("div", {
|
|
951
952
|
className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
|
|
952
|
-
children:
|
|
953
|
+
children: fn
|
|
953
954
|
}),
|
|
954
|
-
|
|
955
|
+
T && /* @__PURE__ */ g("div", {
|
|
955
956
|
className: "flex flex-col-reverse gap-3 border-t border-border-seam pt-4 sm:flex-row sm:items-center sm:justify-between",
|
|
956
|
-
children: [/* @__PURE__ */
|
|
957
|
+
children: [/* @__PURE__ */ h("p", {
|
|
957
958
|
className: "text-xs text-text-secondary",
|
|
958
|
-
children:
|
|
959
|
-
}), /* @__PURE__ */
|
|
959
|
+
children: d ? hn ? "This item is live. Saving updates the published copy." : `Saving keeps the current status (${_n}). Publish to make it live.` : q ? "This item will be saved as a draft and published on schedule." : "New items are saved as drafts. Publish to make them live."
|
|
960
|
+
}), /* @__PURE__ */ g("div", {
|
|
960
961
|
className: "flex items-center gap-2",
|
|
961
|
-
children: [/* @__PURE__ */
|
|
962
|
+
children: [/* @__PURE__ */ g("button", {
|
|
962
963
|
type: "button",
|
|
963
964
|
onClick: () => {
|
|
964
|
-
|
|
965
|
+
dn(!1);
|
|
965
966
|
},
|
|
966
|
-
disabled:
|
|
967
|
+
disabled: Q,
|
|
967
968
|
className: "inline-flex min-h-[44px] items-center gap-2 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:opacity-60",
|
|
968
|
-
children: [(
|
|
969
|
-
}),
|
|
969
|
+
children: [(S || lt) && !pt ? /* @__PURE__ */ h(l, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ h(Ve, { className: "h-4 w-4" }), d ? "Save changes" : "Save Draft"]
|
|
970
|
+
}), gn && /* @__PURE__ */ g("button", {
|
|
970
971
|
type: "button",
|
|
971
972
|
onClick: () => {
|
|
972
|
-
|
|
973
|
+
dn(!0);
|
|
973
974
|
},
|
|
974
|
-
disabled:
|
|
975
|
+
disabled: Q,
|
|
975
976
|
className: "inline-flex min-h-[44px] items-center gap-2 rounded-md bg-action-primary-bg px-5 py-2 text-sm font-medium text-action-primary-text shadow-pop transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:opacity-60",
|
|
976
|
-
children: [pt ? /* @__PURE__ */
|
|
977
|
+
children: [pt ? /* @__PURE__ */ h(l, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ h(mn, { className: "h-4 w-4" }), Q ? "Saving…" : pn]
|
|
977
978
|
})]
|
|
978
979
|
})]
|
|
979
980
|
})
|
|
980
981
|
]
|
|
981
982
|
});
|
|
982
|
-
},
|
|
983
|
-
let { contentId: e } =
|
|
984
|
-
return /* @__PURE__ */
|
|
983
|
+
}, S = () => {
|
|
984
|
+
let { contentId: e } = Je();
|
|
985
|
+
return /* @__PURE__ */ h(x, {}, e ?? "edit");
|
|
985
986
|
};
|
|
986
987
|
//#endregion
|
|
987
|
-
export {
|
|
988
|
+
export { x as ContentCreationPage, S as ContentEditPage };
|
|
988
989
|
|
|
989
990
|
//# sourceMappingURL=ContentCreationPage.js.map
|