@burdenoff/microfe-headshotmarketing 2026.1030.13 → 2026.1101.1
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 +251 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +446 -322
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +4370 -34
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js +3 -1
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/headshotmarketing/components/TrackedLinksPanel.d.ts +19 -0
- package/dist/headshotmarketing/components/TrackedLinksPanel.d.ts.map +1 -0
- package/dist/headshotmarketing/components/TrackedLinksPanel.js +246 -0
- package/dist/headshotmarketing/components/TrackedLinksPanel.js.map +1 -0
- package/dist/headshotmarketing/components/index.d.ts +1 -0
- package/dist/headshotmarketing/components/index.d.ts.map +1 -1
- package/dist/headshotmarketing/components/index.js +1 -0
- package/dist/headshotmarketing/pages/ads/AdCampaignDetailsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCampaignDetailsPage.js +245 -211
- package/dist/headshotmarketing/pages/ads/AdCampaignDetailsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCreativesPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCreativesPage.js +86 -76
- package/dist/headshotmarketing/pages/ads/AdCreativesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/AttributionPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/analytics/AttributionPage.js +249 -244
- package/dist/headshotmarketing/pages/analytics/AttributionPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/TouchpointLedgerCard.d.ts +4 -0
- package/dist/headshotmarketing/pages/analytics/TouchpointLedgerCard.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/analytics/TouchpointLedgerCard.js +196 -0
- package/dist/headshotmarketing/pages/analytics/TouchpointLedgerCard.js.map +1 -0
- 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/pages/crm/LeadCreateModal.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/crm/LeadCreateModal.js +150 -76
- package/dist/headshotmarketing/pages/crm/LeadCreateModal.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/PostsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/social-media/PostsPage.js +254 -246
- package/dist/headshotmarketing/pages/social-media/PostsPage.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/dist/headshotmarketing/utils/trackedLinks.d.ts +75 -0
- package/dist/headshotmarketing/utils/trackedLinks.d.ts.map +1 -0
- package/dist/headshotmarketing/utils/trackedLinks.js +99 -0
- package/dist/headshotmarketing/utils/trackedLinks.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,50 +1,119 @@
|
|
|
1
|
-
import { useDeleteHeadshotmarketingContentItemMutation as e } from "../../../generated/wspace-operations.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useDeleteHeadshotmarketingContentItemMutation as e, useUpdateHeadshotmarketingContentItemMutation as t } from "../../../generated/wspace-operations.js";
|
|
2
|
+
import { HeadshotmarketingContentItemStatus as n } from "../../../generated/wspace-types.js";
|
|
3
|
+
import { Modal as r } from "../../components/Modal.js";
|
|
4
|
+
import { ConfirmDeleteDialog as i } from "../../components/ConfirmDeleteDialog.js";
|
|
5
|
+
import { ActionMenu as a } from "../../components/ActionMenu.js";
|
|
4
6
|
import "../../components/index.js";
|
|
5
|
-
import { contentItemDeleteMessage as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { contentItemDeleteMessage as o, extractErrorMessage as s } from "../../utils/deleteFeedback.js";
|
|
8
|
+
import { aiBadgeDescription as c } from "./AIGeneratedBadge.js";
|
|
9
|
+
import { useState as l } from "react";
|
|
10
|
+
import { Pencil as u, Send as d, Sparkles as f, Trash2 as p } from "lucide-react";
|
|
11
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
9
12
|
//#region src/headshotmarketing/pages/content/ContentItemActions.tsx
|
|
10
|
-
var
|
|
11
|
-
let [
|
|
12
|
-
|
|
13
|
+
var _ = ({ item: _, onDeleted: v, onPublished: y, onEdit: b, align: x = "right" }) => {
|
|
14
|
+
let [S, C] = l(!1), [w, T] = l(!1), [E, D] = l(null), [O, { loading: k }] = e(), [A, { loading: j }] = t(), M = _.status !== void 0 && _.status !== "published" && _.status !== "archived", N = _.aiProvenance ?? null, P = async () => {
|
|
15
|
+
D(null);
|
|
13
16
|
try {
|
|
14
|
-
await
|
|
17
|
+
await O({ variables: { id: _.id } }), C(!1), await v();
|
|
15
18
|
} catch (e) {
|
|
16
|
-
|
|
19
|
+
D(s(e, "Failed to delete content item."));
|
|
17
20
|
}
|
|
18
|
-
},
|
|
19
|
-
|
|
21
|
+
}, F = async () => {
|
|
22
|
+
D(null);
|
|
23
|
+
try {
|
|
24
|
+
await A({ variables: {
|
|
25
|
+
id: _.id,
|
|
26
|
+
input: { status: n.Published }
|
|
27
|
+
} }), T(!1), await (y ?? v)();
|
|
28
|
+
} catch (e) {
|
|
29
|
+
D(s(e, "Failed to publish content item."));
|
|
30
|
+
}
|
|
31
|
+
}, I = [];
|
|
32
|
+
return b && I.push({
|
|
20
33
|
key: "edit",
|
|
21
34
|
label: "Edit",
|
|
22
|
-
icon: /* @__PURE__ */
|
|
23
|
-
onClick:
|
|
24
|
-
}),
|
|
35
|
+
icon: /* @__PURE__ */ h(u, { className: "h-4 w-4" }),
|
|
36
|
+
onClick: b
|
|
37
|
+
}), M && I.push({
|
|
38
|
+
key: "publish",
|
|
39
|
+
label: "Publish",
|
|
40
|
+
icon: /* @__PURE__ */ h(d, { className: "h-4 w-4" }),
|
|
41
|
+
onClick: () => {
|
|
42
|
+
D(null), T(!0);
|
|
43
|
+
}
|
|
44
|
+
}), I.push({
|
|
25
45
|
key: "delete",
|
|
26
46
|
label: "Delete",
|
|
27
47
|
danger: !0,
|
|
28
|
-
icon: /* @__PURE__ */
|
|
48
|
+
icon: /* @__PURE__ */ h(p, { className: "h-4 w-4" }),
|
|
29
49
|
onClick: () => {
|
|
30
|
-
|
|
50
|
+
D(null), C(!0);
|
|
31
51
|
}
|
|
32
|
-
}), /* @__PURE__ */
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
52
|
+
}), /* @__PURE__ */ g(m, { children: [
|
|
53
|
+
/* @__PURE__ */ h(a, {
|
|
54
|
+
id: `content-item-actions-${_.id}`,
|
|
55
|
+
align: x,
|
|
56
|
+
buttonLabel: `Actions for ${_.title}`,
|
|
57
|
+
items: I
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ g(r, {
|
|
60
|
+
open: w,
|
|
61
|
+
onClose: () => T(!1),
|
|
62
|
+
title: "Publish content item",
|
|
63
|
+
size: "sm",
|
|
64
|
+
footer: /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("button", {
|
|
65
|
+
type: "button",
|
|
66
|
+
onClick: () => T(!1),
|
|
67
|
+
disabled: j,
|
|
68
|
+
className: "inline-flex 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 disabled:opacity-60",
|
|
69
|
+
children: "Cancel"
|
|
70
|
+
}), /* @__PURE__ */ g("button", {
|
|
71
|
+
type: "button",
|
|
72
|
+
onClick: () => void F(),
|
|
73
|
+
disabled: j,
|
|
74
|
+
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 disabled:opacity-60",
|
|
75
|
+
children: [/* @__PURE__ */ h(d, { className: "h-4 w-4" }), j ? "Publishing…" : "Publish"]
|
|
76
|
+
})] }),
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ g("p", {
|
|
79
|
+
className: "text-sm text-text-secondary",
|
|
80
|
+
children: [
|
|
81
|
+
"“",
|
|
82
|
+
_.title,
|
|
83
|
+
"” will go live and be marked as published."
|
|
84
|
+
]
|
|
85
|
+
}),
|
|
86
|
+
N && /* @__PURE__ */ g("div", {
|
|
87
|
+
"data-testid": "publish-ai-disclosure",
|
|
88
|
+
className: "mt-3 flex items-start gap-2 rounded-lg border border-border-seam bg-[var(--color-accent-soft)] px-3 py-2.5 text-sm text-text-primary",
|
|
89
|
+
children: [/* @__PURE__ */ h(f, {
|
|
90
|
+
className: "mt-0.5 h-4 w-4 shrink-0 text-action-primary-bg",
|
|
91
|
+
"aria-hidden": "true"
|
|
92
|
+
}), /* @__PURE__ */ g("p", { children: [
|
|
93
|
+
"This content is marked as",
|
|
94
|
+
" ",
|
|
95
|
+
/* @__PURE__ */ h("strong", { children: c(N) }),
|
|
96
|
+
". The marking travels with the item in API responses and exports. Where you publish it to the public, keep a visible AI disclosure next to it."
|
|
97
|
+
] })]
|
|
98
|
+
}),
|
|
99
|
+
E ? /* @__PURE__ */ h("div", {
|
|
100
|
+
className: "mt-3 rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
|
|
101
|
+
children: E
|
|
102
|
+
}) : null
|
|
103
|
+
]
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ h(i, {
|
|
106
|
+
open: S,
|
|
107
|
+
onClose: () => C(!1),
|
|
108
|
+
title: "Delete content item",
|
|
109
|
+
message: o(_.title),
|
|
110
|
+
deleting: k,
|
|
111
|
+
error: E,
|
|
112
|
+
onConfirm: () => void P()
|
|
113
|
+
})
|
|
114
|
+
] });
|
|
46
115
|
};
|
|
47
116
|
//#endregion
|
|
48
|
-
export {
|
|
117
|
+
export { _ as ContentItemActionsMenu };
|
|
49
118
|
|
|
50
119
|
//# sourceMappingURL=ContentItemActions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentItemActions.js","names":[],"sources":["../../../../src/headshotmarketing/pages/content/ContentItemActions.tsx"],"sourcesContent":["/**\n * Content-item action menu\n *\n * Kebab menu
|
|
1
|
+
{"version":3,"file":"ContentItemActions.js","names":[],"sources":["../../../../src/headshotmarketing/pages/content/ContentItemActions.tsx"],"sourcesContent":["/**\n * Content-item action menu\n *\n * Kebab menu for a content-library item:\n * - Edit opens the editor route when the caller supplies `onEdit`.\n * - Publish (for items that are not live yet), wired to\n * `headshotmarketingUpdateContentItem` with status PUBLISHED. Publishing\n * always asks for confirmation; when the item is AI-generated the dialog\n * states that and reminds the publisher to keep the disclosure visible\n * where the content appears (EU AI Act Art. 50 deployer duty).\n * - Delete, wired to `headshotmarketingDeleteContentItem`, also confirmed.\n *\n * On success `onPublished()` / `onDeleted()` (the page's bootstrap refetch, or\n * a refetch-then-navigate from the detail page) is invoked. The menu owns the\n * mutations, the confirm dialogs and the error surface; `ActionMenu` stops\n * click propagation, so placing this inside an openable card never hijacks\n * the card's navigate-to-detail click.\n *\n * @module headshotmarketing/pages/content\n */\n\nimport { useState, type FC } from \"react\";\nimport { Pencil, Send, Sparkles, Trash2 } from \"lucide-react\";\nimport {\n useDeleteHeadshotmarketingContentItemMutation,\n useUpdateHeadshotmarketingContentItemMutation,\n} from \"../../../generated/wspace-operations\";\nimport { HeadshotmarketingContentItemStatus } from \"../../../generated/wspace-types\";\nimport {\n ActionMenu,\n ConfirmDeleteDialog,\n Modal,\n type ActionMenuItem,\n} from \"../../components\";\nimport {\n contentItemDeleteMessage,\n extractErrorMessage,\n} from \"../../utils/deleteFeedback\";\nimport type { ContentAIProvenance } from \"../../types\";\nimport { aiBadgeDescription } from \"./AIGeneratedBadge\";\n\nexport interface ContentItemSummary {\n id: string;\n title: string;\n status?: string;\n aiProvenance?: ContentAIProvenance | null;\n}\n\nexport const ContentItemActionsMenu: FC<{\n item: ContentItemSummary;\n onDeleted: () => void | Promise<unknown>;\n /** Invoked after a successful publish; defaults to `onDeleted` (refetch). */\n onPublished?: () => void | Promise<unknown>;\n /** When set, an \"Edit\" entry opens the content editor for this item. */\n onEdit?: () => void;\n /** Panel alignment relative to the trigger. Default \"right\". */\n align?: \"left\" | \"right\";\n}> = ({ item, onDeleted, onPublished, onEdit, align = \"right\" }) => {\n const [deleteOpen, setDeleteOpen] = useState(false);\n const [publishOpen, setPublishOpen] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [deleteContentItem, { loading: deleting }] =\n useDeleteHeadshotmarketingContentItemMutation();\n const [publishContentItem, { loading: publishing }] =\n useUpdateHeadshotmarketingContentItemMutation();\n\n const canPublish =\n item.status !== undefined &&\n item.status !== \"published\" &&\n item.status !== \"archived\";\n const provenance = item.aiProvenance ?? null;\n\n const handleDelete = async (): Promise<void> => {\n setError(null);\n try {\n await deleteContentItem({ variables: { id: item.id } });\n setDeleteOpen(false);\n await onDeleted();\n } catch (err) {\n setError(extractErrorMessage(err, \"Failed to delete content item.\"));\n }\n };\n\n const handlePublish = async (): Promise<void> => {\n setError(null);\n try {\n await publishContentItem({\n variables: {\n id: item.id,\n input: { status: HeadshotmarketingContentItemStatus.Published },\n },\n });\n setPublishOpen(false);\n await (onPublished ?? onDeleted)();\n } catch (err) {\n setError(extractErrorMessage(err, \"Failed to publish content item.\"));\n }\n };\n\n const items: ActionMenuItem[] = [];\n if (onEdit) {\n items.push({\n key: \"edit\",\n label: \"Edit\",\n icon: <Pencil className=\"h-4 w-4\" />,\n onClick: onEdit,\n });\n }\n if (canPublish) {\n items.push({\n key: \"publish\",\n label: \"Publish\",\n icon: <Send className=\"h-4 w-4\" />,\n onClick: () => {\n setError(null);\n setPublishOpen(true);\n },\n });\n }\n items.push({\n key: \"delete\",\n label: \"Delete\",\n danger: true,\n icon: <Trash2 className=\"h-4 w-4\" />,\n onClick: () => {\n setError(null);\n setDeleteOpen(true);\n },\n });\n\n return (\n <>\n <ActionMenu\n id={`content-item-actions-${item.id}`}\n align={align}\n buttonLabel={`Actions for ${item.title}`}\n items={items}\n />\n\n <Modal\n open={publishOpen}\n onClose={() => setPublishOpen(false)}\n title=\"Publish content item\"\n size=\"sm\"\n footer={\n <>\n <button\n type=\"button\"\n onClick={() => setPublishOpen(false)}\n disabled={publishing}\n className=\"inline-flex 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 disabled:opacity-60\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={() => void handlePublish()}\n disabled={publishing}\n 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 disabled:opacity-60\"\n >\n <Send className=\"h-4 w-4\" />\n {publishing ? \"Publishing…\" : \"Publish\"}\n </button>\n </>\n }\n >\n <p className=\"text-sm text-text-secondary\">\n “{item.title}” will go live and be marked as published.\n </p>\n {provenance && (\n <div\n data-testid=\"publish-ai-disclosure\"\n className=\"mt-3 flex items-start gap-2 rounded-lg border border-border-seam bg-[var(--color-accent-soft)] px-3 py-2.5 text-sm text-text-primary\"\n >\n <Sparkles\n className=\"mt-0.5 h-4 w-4 shrink-0 text-action-primary-bg\"\n aria-hidden=\"true\"\n />\n <p>\n This content is marked as{\" \"}\n <strong>{aiBadgeDescription(provenance)}</strong>. The marking\n travels with the item in API responses and exports. Where you\n publish it to the public, keep a visible AI disclosure next to it.\n </p>\n </div>\n )}\n {error ? (\n <div className=\"mt-3 rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text\">\n {error}\n </div>\n ) : null}\n </Modal>\n\n <ConfirmDeleteDialog\n open={deleteOpen}\n onClose={() => setDeleteOpen(false)}\n title=\"Delete content item\"\n message={contentItemDeleteMessage(item.title)}\n deleting={deleting}\n error={error}\n onConfirm={() => void handleDelete()}\n />\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAgD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AA;EACpC,eAAe;AAEb,GADA,EAAS,KAAK,EACd,EAAc,GAAK;;EAEtB,CAAC,EAGA,kBAAA,GAAA,EAAA,UAAA;EACE,kBAAC,GAAD;GACE,IAAI,wBAAwB,EAAK;GAC1B;GACP,aAAa,eAAe,EAAK;GAC1B;GACP,CAAA;EAEF,kBAAC,GAAD;GACE,MAAM;GACN,eAAe,EAAe,GAAM;GACpC,OAAM;GACN,MAAK;GACL,QACE,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,EAAe,GAAM;IACpC,UAAU;IACV,WAAU;cACX;IAEQ,CAAA,EACT,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,KAAK,GAAe;IACnC,UAAU;IACV,WAAU;cAJZ,CAME,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA,EAC3B,IAAa,gBAAgB,UACvB;MACR,EAAA,CAAA;aAxBP;IA2BE,kBAAC,KAAD;KAAG,WAAU;eAAb;MAA2C;MACvC,EAAK;MAAM;MACX;;IACH,KACC,kBAAC,OAAD;KACE,eAAY;KACZ,WAAU;eAFZ,CAIE,kBAAC,GAAD;MACE,WAAU;MACV,eAAY;MACZ,CAAA,EACF,kBAAC,KAAD,EAAA,UAAA;MAAG;MACyB;MAC1B,kBAAC,UAAD,EAAA,UAAS,EAAmB,EAAW,EAAU,CAAA;;MAG/C,EAAA,CAAA,CACA;;IAEP,IACC,kBAAC,OAAD;KAAK,WAAU;eACZ;KACG,CAAA,GACJ;IACE;;EAER,kBAAC,GAAD;GACE,MAAM;GACN,eAAe,EAAc,GAAM;GACnC,OAAM;GACN,SAAS,EAAyB,EAAK,MAAM;GACnC;GACH;GACP,iBAAiB,KAAK,GAAc;GACpC,CAAA;EACD,EAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentLibraryCard.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/content/ContentLibraryCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAiB,MAAM,OAAO,CAAC;AAc/C,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ContentLibraryCard.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/content/ContentLibraryCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAiB,MAAM,OAAO,CAAC;AAc/C,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,aAAa,CAAC;AAI5D,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC;IAClB,+EAA+E;IAC/E,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACrC,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1C,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAgJD,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,gBAAgB,CA0FnD,CAAC;AAMF,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,gBAAgB,CAuElD,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { cn as e, formatDate as t, getInitials as n } from "../../utils/helpers.js";
|
|
2
2
|
import { StatusBadge as r } from "../../components/StatusBadge.js";
|
|
3
3
|
import "../../components/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { AIGeneratedBadge as i } from "./AIGeneratedBadge.js";
|
|
5
|
+
import { ContentItemActionsMenu as a } from "./ContentItemActions.js";
|
|
6
|
+
import { Calendar as o, File as s, FileText as c, Gauge as l, Image as u, User as d, Video as f } from "lucide-react";
|
|
7
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
|
+
import { GlassCard as h } from "@burdenoff/fe-libs/ui";
|
|
8
9
|
//#region src/headshotmarketing/pages/content/ContentLibraryCard.tsx
|
|
9
|
-
var
|
|
10
|
-
function
|
|
10
|
+
var g = "cursor-pointer transition-shadow hover:shadow-pop focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
|
|
11
|
+
function _(e) {
|
|
11
12
|
return e ? {
|
|
12
13
|
role: "button",
|
|
13
14
|
tabIndex: 0,
|
|
@@ -17,23 +18,23 @@ function g(e) {
|
|
|
17
18
|
}
|
|
18
19
|
} : {};
|
|
19
20
|
}
|
|
20
|
-
var
|
|
21
|
-
article:
|
|
22
|
-
image:
|
|
23
|
-
video:
|
|
24
|
-
document:
|
|
25
|
-
template:
|
|
26
|
-
},
|
|
21
|
+
var v = {
|
|
22
|
+
article: c,
|
|
23
|
+
image: u,
|
|
24
|
+
video: f,
|
|
25
|
+
document: s,
|
|
26
|
+
template: c
|
|
27
|
+
}, y = {
|
|
27
28
|
article: "bg-status-info-bg text-status-info-text border-status-info-border",
|
|
28
29
|
image: "bg-[var(--color-accent-soft)] text-action-primary-bg border-border-seam",
|
|
29
30
|
video: "bg-status-warning-bg text-status-warning-text border-status-warning-border",
|
|
30
31
|
document: "bg-bg-sunken text-text-secondary border-border-subtle",
|
|
31
32
|
template: "bg-status-success-bg text-status-success-text border-status-success-border"
|
|
32
33
|
};
|
|
33
|
-
function
|
|
34
|
+
function b(e) {
|
|
34
35
|
return e >= 80 ? "bg-status-success-bg text-status-success-text border-status-success-border" : e >= 50 ? "bg-status-warning-bg text-status-warning-text border-status-warning-border" : "bg-bg-sunken text-text-secondary border-border-subtle";
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function x(e, t) {
|
|
37
38
|
return t ? {
|
|
38
39
|
label: "Scheduled",
|
|
39
40
|
value: t
|
|
@@ -45,185 +46,184 @@ function b(e, t) {
|
|
|
45
46
|
value: e.createdAt
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
+
function S(e, t) {
|
|
49
50
|
if (t && e.author === t.id) {
|
|
50
51
|
let e = [t.firstName, t.lastName].filter(Boolean).join(" ").trim();
|
|
51
52
|
return t.name || e || t.email;
|
|
52
53
|
}
|
|
53
54
|
return !e.author || e.author === "Unknown" ? "Unassigned" : null;
|
|
54
55
|
}
|
|
55
|
-
var
|
|
56
|
+
var C = ({ tag: e }) => /* @__PURE__ */ p("span", {
|
|
56
57
|
className: "inline-flex items-center rounded-md bg-bg-sunken px-2 py-0.5 text-[11px] font-medium text-text-secondary",
|
|
57
58
|
children: e
|
|
58
|
-
}),
|
|
59
|
-
className: e("inline-flex items-center gap-1 rounded-md border px-2 py-0.5 text-[11px] font-semibold tabular-nums",
|
|
59
|
+
}), w = ({ score: t, className: n }) => /* @__PURE__ */ m("span", {
|
|
60
|
+
className: e("inline-flex items-center gap-1 rounded-md border px-2 py-0.5 text-[11px] font-semibold tabular-nums", b(t), n),
|
|
60
61
|
title: `SEO score ${t}`,
|
|
61
62
|
children: [
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ p(l, { className: "h-3 w-3" }),
|
|
63
64
|
"SEO ",
|
|
64
65
|
t
|
|
65
66
|
]
|
|
66
|
-
}),
|
|
67
|
-
let i = !!(t && e.author === t.id), a =
|
|
68
|
-
return /* @__PURE__ */
|
|
67
|
+
}), T = ({ item: e, currentUser: t, showLabel: r = !0 }) => {
|
|
68
|
+
let i = !!(t && e.author === t.id), a = S(e, t), o = i ? t?.avatar : void 0;
|
|
69
|
+
return /* @__PURE__ */ m("div", {
|
|
69
70
|
className: "flex min-w-0 items-center gap-2",
|
|
70
71
|
title: a ?? e.author,
|
|
71
|
-
children: [o ? /* @__PURE__ */
|
|
72
|
+
children: [o ? /* @__PURE__ */ p("img", {
|
|
72
73
|
src: o,
|
|
73
74
|
alt: a ?? "Author",
|
|
74
75
|
className: "h-6 w-6 shrink-0 rounded-full object-cover"
|
|
75
|
-
}) : a && a !== "Unassigned" ? /* @__PURE__ */
|
|
76
|
+
}) : a && a !== "Unassigned" ? /* @__PURE__ */ p("span", {
|
|
76
77
|
className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--color-accent-soft)] text-[10px] font-semibold text-action-primary-bg",
|
|
77
78
|
children: n(a)
|
|
78
|
-
}) : /* @__PURE__ */
|
|
79
|
+
}) : /* @__PURE__ */ p("span", {
|
|
79
80
|
className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-bg-sunken text-text-secondary",
|
|
80
|
-
children: /* @__PURE__ */
|
|
81
|
-
}), r && /* @__PURE__ */
|
|
81
|
+
children: /* @__PURE__ */ p(d, { className: "h-3.5 w-3.5" })
|
|
82
|
+
}), r && /* @__PURE__ */ p("span", {
|
|
82
83
|
className: "truncate text-xs text-text-secondary",
|
|
83
84
|
children: a ?? "Team member"
|
|
84
85
|
})]
|
|
85
86
|
});
|
|
86
|
-
},
|
|
87
|
-
let
|
|
88
|
-
return /* @__PURE__ */
|
|
87
|
+
}, E = ({ item: n, scheduledAt: s, currentUser: l, onOpen: u, onDeleted: d, onEdit: f }) => {
|
|
88
|
+
let b = v[n.type] ?? c, S = n.tags ?? [], E = x(n, s), D = S.length > 0 || n.seoScore > 0 || n.aiProvenance !== null;
|
|
89
|
+
return /* @__PURE__ */ p(h, {
|
|
89
90
|
treatment: "glass",
|
|
90
|
-
className: e("p-4",
|
|
91
|
-
...
|
|
92
|
-
children: /* @__PURE__ */
|
|
91
|
+
className: e("p-4", u && g),
|
|
92
|
+
..._(u),
|
|
93
|
+
children: /* @__PURE__ */ m("div", {
|
|
93
94
|
className: "flex flex-col gap-3",
|
|
94
95
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ m("div", {
|
|
96
97
|
className: "flex items-start justify-between gap-2",
|
|
97
|
-
children: [/* @__PURE__ */
|
|
98
|
+
children: [/* @__PURE__ */ m("div", {
|
|
98
99
|
className: "flex min-w-0 items-center gap-2.5",
|
|
99
|
-
children: [/* @__PURE__ */
|
|
100
|
-
className: e("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border",
|
|
101
|
-
children: /* @__PURE__ */
|
|
102
|
-
}), /* @__PURE__ */
|
|
100
|
+
children: [/* @__PURE__ */ p("span", {
|
|
101
|
+
className: e("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border", y[n.type]),
|
|
102
|
+
children: /* @__PURE__ */ p(b, { className: "h-4 w-4" })
|
|
103
|
+
}), /* @__PURE__ */ m("div", {
|
|
103
104
|
className: "min-w-0",
|
|
104
|
-
children: [/* @__PURE__ */
|
|
105
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
105
106
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
106
107
|
children: n.title
|
|
107
|
-
}), /* @__PURE__ */
|
|
108
|
+
}), /* @__PURE__ */ p("span", {
|
|
108
109
|
className: "text-[11px] font-medium uppercase tracking-wide text-text-secondary",
|
|
109
110
|
children: n.typeLabel ?? n.type
|
|
110
111
|
})]
|
|
111
112
|
})]
|
|
112
|
-
}), /* @__PURE__ */
|
|
113
|
+
}), /* @__PURE__ */ m("div", {
|
|
113
114
|
className: "flex shrink-0 items-center gap-1",
|
|
114
|
-
children: [/* @__PURE__ */
|
|
115
|
-
item:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
onDeleted: u,
|
|
120
|
-
onEdit: d
|
|
115
|
+
children: [/* @__PURE__ */ p(r, { status: n.status }), d && /* @__PURE__ */ p(a, {
|
|
116
|
+
item: n,
|
|
117
|
+
onDeleted: d,
|
|
118
|
+
onEdit: f
|
|
121
119
|
})]
|
|
122
120
|
})]
|
|
123
121
|
}),
|
|
124
|
-
n.description && /* @__PURE__ */
|
|
122
|
+
n.description && /* @__PURE__ */ p("p", {
|
|
125
123
|
className: "line-clamp-2 text-xs text-text-secondary",
|
|
126
124
|
children: n.description
|
|
127
125
|
}),
|
|
128
|
-
|
|
126
|
+
D && /* @__PURE__ */ m("div", {
|
|
129
127
|
className: "flex flex-wrap items-center gap-1.5",
|
|
130
128
|
children: [
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
/* @__PURE__ */ p(i, { provenance: n.aiProvenance }),
|
|
130
|
+
S.slice(0, 3).map((e) => /* @__PURE__ */ p(C, { tag: e }, e)),
|
|
131
|
+
S.length > 3 && /* @__PURE__ */ m("span", {
|
|
133
132
|
className: "text-[11px] font-medium text-text-secondary",
|
|
134
|
-
children: ["+",
|
|
133
|
+
children: ["+", S.length - 3]
|
|
135
134
|
}),
|
|
136
|
-
n.seoScore > 0 && /* @__PURE__ */
|
|
135
|
+
n.seoScore > 0 && /* @__PURE__ */ p(w, {
|
|
137
136
|
score: n.seoScore,
|
|
138
137
|
className: "ml-auto"
|
|
139
138
|
})
|
|
140
139
|
]
|
|
141
140
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ m("div", {
|
|
143
142
|
className: "space-y-2 border-t border-border-subtle pt-3",
|
|
144
|
-
children: [/* @__PURE__ */
|
|
143
|
+
children: [/* @__PURE__ */ p(T, {
|
|
145
144
|
item: n,
|
|
146
|
-
currentUser:
|
|
147
|
-
}), /* @__PURE__ */
|
|
145
|
+
currentUser: l
|
|
146
|
+
}), /* @__PURE__ */ m("div", {
|
|
148
147
|
className: "flex items-center justify-between text-xs",
|
|
149
|
-
children: [/* @__PURE__ */
|
|
148
|
+
children: [/* @__PURE__ */ m("span", {
|
|
150
149
|
className: "inline-flex items-center gap-1.5 text-text-secondary",
|
|
151
|
-
children: [/* @__PURE__ */
|
|
152
|
-
}), /* @__PURE__ */
|
|
150
|
+
children: [/* @__PURE__ */ p(o, { className: "h-3.5 w-3.5" }), E.label]
|
|
151
|
+
}), /* @__PURE__ */ p("span", {
|
|
153
152
|
className: "font-medium text-text-primary",
|
|
154
|
-
children: t(
|
|
153
|
+
children: t(E.value)
|
|
155
154
|
})]
|
|
156
155
|
})]
|
|
157
156
|
})
|
|
158
157
|
]
|
|
159
158
|
})
|
|
160
159
|
});
|
|
161
|
-
},
|
|
162
|
-
let
|
|
163
|
-
return /* @__PURE__ */
|
|
160
|
+
}, D = ({ item: n, scheduledAt: o, currentUser: s, onOpen: l, onDeleted: u, onEdit: d }) => {
|
|
161
|
+
let f = v[n.type] ?? c, b = n.tags ?? [], S = x(n, o);
|
|
162
|
+
return /* @__PURE__ */ p(h, {
|
|
164
163
|
treatment: "glass",
|
|
165
|
-
className: e("p-3.5",
|
|
166
|
-
...
|
|
167
|
-
children: /* @__PURE__ */
|
|
164
|
+
className: e("p-3.5", l && g),
|
|
165
|
+
..._(l),
|
|
166
|
+
children: /* @__PURE__ */ m("div", {
|
|
168
167
|
className: "flex items-center gap-4",
|
|
169
168
|
children: [
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
className: e("flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border",
|
|
172
|
-
children: /* @__PURE__ */ f
|
|
169
|
+
/* @__PURE__ */ p("span", {
|
|
170
|
+
className: e("flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border", y[n.type]),
|
|
171
|
+
children: /* @__PURE__ */ p(f, { className: "h-5 w-5" })
|
|
173
172
|
}),
|
|
174
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ m("div", {
|
|
175
174
|
className: "min-w-0 flex-1",
|
|
176
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ m("div", {
|
|
177
176
|
className: "flex items-center gap-2",
|
|
178
|
-
children: [
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
177
|
+
children: [
|
|
178
|
+
/* @__PURE__ */ p("p", {
|
|
179
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
180
|
+
children: n.title
|
|
181
|
+
}),
|
|
182
|
+
/* @__PURE__ */ p(r, {
|
|
183
|
+
status: n.status,
|
|
184
|
+
className: "shrink-0"
|
|
185
|
+
}),
|
|
186
|
+
/* @__PURE__ */ p(i, { provenance: n.aiProvenance })
|
|
187
|
+
]
|
|
188
|
+
}), /* @__PURE__ */ m("div", {
|
|
186
189
|
className: "mt-1 flex flex-wrap items-center gap-1.5",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ p("span", {
|
|
188
191
|
className: "text-[11px] font-medium uppercase tracking-wide text-text-secondary",
|
|
189
192
|
children: n.typeLabel ?? n.type
|
|
190
|
-
}),
|
|
193
|
+
}), b.slice(0, 4).map((e) => /* @__PURE__ */ p(C, { tag: e }, e))]
|
|
191
194
|
})]
|
|
192
195
|
}),
|
|
193
|
-
n.seoScore > 0 && /* @__PURE__ */
|
|
196
|
+
n.seoScore > 0 && /* @__PURE__ */ p(w, {
|
|
194
197
|
score: n.seoScore,
|
|
195
198
|
className: "hidden sm:inline-flex"
|
|
196
199
|
}),
|
|
197
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ m("div", {
|
|
198
201
|
className: "hidden text-right md:block",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
202
|
+
children: [/* @__PURE__ */ p("p", {
|
|
200
203
|
className: "text-[11px] text-text-secondary",
|
|
201
|
-
children:
|
|
202
|
-
}), /* @__PURE__ */
|
|
204
|
+
children: S.label
|
|
205
|
+
}), /* @__PURE__ */ p("p", {
|
|
203
206
|
className: "text-xs font-medium text-text-primary",
|
|
204
|
-
children: t(
|
|
207
|
+
children: t(S.value)
|
|
205
208
|
})]
|
|
206
209
|
}),
|
|
207
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ p("div", {
|
|
208
211
|
className: "hidden w-32 lg:block",
|
|
209
|
-
children: /* @__PURE__ */
|
|
212
|
+
children: /* @__PURE__ */ p(T, {
|
|
210
213
|
item: n,
|
|
211
|
-
currentUser:
|
|
214
|
+
currentUser: s
|
|
212
215
|
})
|
|
213
216
|
}),
|
|
214
|
-
|
|
215
|
-
item:
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
},
|
|
219
|
-
onDeleted: l,
|
|
220
|
-
onEdit: u
|
|
217
|
+
u && /* @__PURE__ */ p(a, {
|
|
218
|
+
item: n,
|
|
219
|
+
onDeleted: u,
|
|
220
|
+
onEdit: d
|
|
221
221
|
})
|
|
222
222
|
]
|
|
223
223
|
})
|
|
224
224
|
});
|
|
225
225
|
};
|
|
226
226
|
//#endregion
|
|
227
|
-
export {
|
|
227
|
+
export { E as ContentLibraryCard, D as ContentLibraryRow };
|
|
228
228
|
|
|
229
229
|
//# sourceMappingURL=ContentLibraryCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentLibraryCard.js","names":[],"sources":["../../../../src/headshotmarketing/pages/content/ContentLibraryCard.tsx"],"sourcesContent":["/**\n * ContentLibraryCard / ContentLibraryRow\n *\n * Rich presentational views for a single content item in the Content Library.\n * Both surfaces render from data ALREADY fetched by the page's bootstrap query\n * (type, status, tags, SEO score, scheduled/published dates, author) — no new\n * network calls and no fabricated values (a missing SEO score or date simply\n * isn't rendered).\n *\n * Author resolution: the bootstrap payload carries only the raw `authorId`.\n * When that id matches the signed-in user we resolve it to their real name +\n * avatar (available from the shell context); otherwise we show a neutral\n * avatar rather than printing an opaque id. Full directory resolution needs a\n * dedicated members query (deferred to the backend).\n *\n * @module headshotmarketing/pages/content\n */\n\nimport type { FC, KeyboardEvent } from \"react\";\nimport {\n FileText,\n Image as ImageIcon,\n Video,\n File as FileIcon,\n User,\n Calendar,\n Gauge,\n type LucideIcon,\n} from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport { cn, formatDate, getInitials } from \"../../utils/helpers\";\nimport { StatusBadge } from \"../../components\";\nimport type { ContentItem, ContentType } from \"../../types\";\nimport { ContentItemActionsMenu } from \"./ContentItemActions\";\n\n/** Minimal shape of the signed-in user needed to resolve self-authored items. */\nexport interface ContentCardUser {\n id: string;\n email: string;\n firstName?: string;\n lastName?: string;\n name?: string;\n avatar?: string;\n}\n\nexport interface ContentCardProps {\n item: ContentItem;\n /** Raw `scheduledAt` from the bootstrap row (dropped by the shared mapper). */\n scheduledAt: string | null;\n currentUser?: ContentCardUser | null;\n /** When set, the card/row becomes an accessible button opening the detail. */\n onOpen?: () => void;\n /**\n * When set, an overflow (Delete) menu is rendered on the surface and this is\n * invoked after a successful delete (the page's bootstrap refetch). The menu\n * stops click propagation so it never triggers `onOpen`.\n */\n onDeleted?: () => void | Promise<unknown>;\n /** When set, the overflow menu offers \"Edit\" (opens the editor). */\n onEdit?: () => void;\n}\n\nconst OPENABLE_CLASS =\n \"cursor-pointer transition-shadow hover:shadow-pop focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\";\n\n/**\n * Build the interactive attributes that turn a surface into an accessible\n * activator. Kept inline so the grid card and list row open identically.\n * `className` is merged by the caller so it doesn't clobber the surface's own.\n */\nfunction openableProps(onOpen?: () => void) {\n if (!onOpen) return {};\n return {\n role: \"button\" as const,\n tabIndex: 0,\n onClick: onOpen,\n onKeyDown: (e: KeyboardEvent<HTMLDivElement>) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onOpen();\n }\n },\n };\n}\n\nconst typeIcons: Record<ContentType, LucideIcon> = {\n article: FileText,\n image: ImageIcon,\n video: Video,\n document: FileIcon,\n template: FileText,\n};\n\n/** Distinct, token-only accent per content type for an at-a-glance read. */\nconst typeBadgeStyles: Record<ContentType, string> = {\n article: \"bg-status-info-bg text-status-info-text border-status-info-border\",\n image:\n \"bg-[var(--color-accent-soft)] text-action-primary-bg border-border-seam\",\n video:\n \"bg-status-warning-bg text-status-warning-text border-status-warning-border\",\n document: \"bg-bg-sunken text-text-secondary border-border-subtle\",\n template:\n \"bg-status-success-bg text-status-success-text border-status-success-border\",\n};\n\n/** Colour the SEO pill by score band — semantic tokens only. */\nfunction seoTone(score: number): string {\n if (score >= 80)\n return \"bg-status-success-bg text-status-success-text border-status-success-border\";\n if (score >= 50)\n return \"bg-status-warning-bg text-status-warning-text border-status-warning-border\";\n return \"bg-bg-sunken text-text-secondary border-border-subtle\";\n}\n\n/** Pick the most relevant date to surface, with an honest label. */\nfunction resolveDateInfo(\n item: ContentItem,\n scheduledAt: string | null,\n): { label: string; value: string } {\n if (scheduledAt) return { label: \"Scheduled\", value: scheduledAt };\n if (item.publishedAt) return { label: \"Published\", value: item.publishedAt };\n return { label: \"Created\", value: item.createdAt };\n}\n\nfunction resolveAuthorName(\n item: ContentItem,\n currentUser?: ContentCardUser | null,\n): string | null {\n if (currentUser && item.author === currentUser.id) {\n const composed = [currentUser.firstName, currentUser.lastName]\n .filter(Boolean)\n .join(\" \")\n .trim();\n return currentUser.name || composed || currentUser.email;\n }\n if (!item.author || item.author === \"Unknown\") return \"Unassigned\";\n return null;\n}\n\nconst TagChip: FC<{ tag: string }> = ({ tag }) => (\n <span className=\"inline-flex items-center rounded-md bg-bg-sunken px-2 py-0.5 text-[11px] font-medium text-text-secondary\">\n {tag}\n </span>\n);\n\nconst SeoPill: FC<{ score: number; className?: string }> = ({\n score,\n className,\n}) => (\n <span\n className={cn(\n \"inline-flex items-center gap-1 rounded-md border px-2 py-0.5 text-[11px] font-semibold tabular-nums\",\n seoTone(score),\n className,\n )}\n title={`SEO score ${score}`}\n >\n <Gauge className=\"h-3 w-3\" />\n SEO {score}\n </span>\n);\n\nconst AuthorAvatar: FC<{\n item: ContentItem;\n currentUser?: ContentCardUser | null;\n showLabel?: boolean;\n}> = ({ item, currentUser, showLabel = true }) => {\n const isSelf = Boolean(currentUser && item.author === currentUser.id);\n const name = resolveAuthorName(item, currentUser);\n const avatarUrl = isSelf ? currentUser?.avatar : undefined;\n\n return (\n <div\n className=\"flex min-w-0 items-center gap-2\"\n title={name ?? item.author}\n >\n {avatarUrl ? (\n <img\n src={avatarUrl}\n alt={name ?? \"Author\"}\n className=\"h-6 w-6 shrink-0 rounded-full object-cover\"\n />\n ) : name && name !== \"Unassigned\" ? (\n <span className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--color-accent-soft)] text-[10px] font-semibold text-action-primary-bg\">\n {getInitials(name)}\n </span>\n ) : (\n <span className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-bg-sunken text-text-secondary\">\n <User className=\"h-3.5 w-3.5\" />\n </span>\n )}\n {showLabel && (\n <span className=\"truncate text-xs text-text-secondary\">\n {name ?? \"Team member\"}\n </span>\n )}\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Grid card\n// ---------------------------------------------------------------------------\n\nexport const ContentLibraryCard: FC<ContentCardProps> = ({\n item,\n scheduledAt,\n currentUser,\n onOpen,\n onDeleted,\n onEdit,\n}) => {\n const Icon = typeIcons[item.type] ?? FileText;\n const tags = item.tags ?? [];\n const date = resolveDateInfo(item, scheduledAt);\n const hasMetaRow = tags.length > 0 || item.seoScore > 0;\n\n return (\n <GlassCard\n treatment=\"glass\"\n className={cn(\"p-4\", onOpen && OPENABLE_CLASS)}\n {...openableProps(onOpen)}\n >\n <div className=\"flex flex-col gap-3\">\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex min-w-0 items-center gap-2.5\">\n <span\n className={cn(\n \"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border\",\n typeBadgeStyles[item.type],\n )}\n >\n <Icon className=\"h-4 w-4\" />\n </span>\n <div className=\"min-w-0\">\n <h3 className=\"truncate text-sm font-semibold text-text-primary\">\n {item.title}\n </h3>\n <span className=\"text-[11px] font-medium uppercase tracking-wide text-text-secondary\">\n {item.typeLabel ?? item.type}\n </span>\n </div>\n </div>\n <div className=\"flex shrink-0 items-center gap-1\">\n <StatusBadge status={item.status} />\n {onDeleted && (\n <ContentItemActionsMenu\n item={{ id: item.id, title: item.title }}\n onDeleted={onDeleted}\n onEdit={onEdit}\n />\n )}\n </div>\n </div>\n\n {item.description && (\n <p className=\"line-clamp-2 text-xs text-text-secondary\">\n {item.description}\n </p>\n )}\n\n {hasMetaRow && (\n <div className=\"flex flex-wrap items-center gap-1.5\">\n {tags.slice(0, 3).map((tag) => (\n <TagChip key={tag} tag={tag} />\n ))}\n {tags.length > 3 && (\n <span className=\"text-[11px] font-medium text-text-secondary\">\n +{tags.length - 3}\n </span>\n )}\n {item.seoScore > 0 && (\n <SeoPill score={item.seoScore} className=\"ml-auto\" />\n )}\n </div>\n )}\n\n <div className=\"space-y-2 border-t border-border-subtle pt-3\">\n <AuthorAvatar item={item} currentUser={currentUser} />\n <div className=\"flex items-center justify-between text-xs\">\n <span className=\"inline-flex items-center gap-1.5 text-text-secondary\">\n <Calendar className=\"h-3.5 w-3.5\" />\n {date.label}\n </span>\n <span className=\"font-medium text-text-primary\">\n {formatDate(date.value)}\n </span>\n </div>\n </div>\n </div>\n </GlassCard>\n );\n};\n\n// ---------------------------------------------------------------------------\n// List row\n// ---------------------------------------------------------------------------\n\nexport const ContentLibraryRow: FC<ContentCardProps> = ({\n item,\n scheduledAt,\n currentUser,\n onOpen,\n onDeleted,\n onEdit,\n}) => {\n const Icon = typeIcons[item.type] ?? FileText;\n const tags = item.tags ?? [];\n const date = resolveDateInfo(item, scheduledAt);\n\n return (\n <GlassCard\n treatment=\"glass\"\n className={cn(\"p-3.5\", onOpen && OPENABLE_CLASS)}\n {...openableProps(onOpen)}\n >\n <div className=\"flex items-center gap-4\">\n <span\n className={cn(\n \"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border\",\n typeBadgeStyles[item.type],\n )}\n >\n <Icon className=\"h-5 w-5\" />\n </span>\n\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2\">\n <p className=\"truncate text-sm font-medium text-text-primary\">\n {item.title}\n </p>\n <StatusBadge status={item.status} className=\"shrink-0\" />\n </div>\n <div className=\"mt-1 flex flex-wrap items-center gap-1.5\">\n <span className=\"text-[11px] font-medium uppercase tracking-wide text-text-secondary\">\n {item.typeLabel ?? item.type}\n </span>\n {tags.slice(0, 4).map((tag) => (\n <TagChip key={tag} tag={tag} />\n ))}\n </div>\n </div>\n\n {item.seoScore > 0 && (\n <SeoPill score={item.seoScore} className=\"hidden sm:inline-flex\" />\n )}\n\n <div className=\"hidden text-right md:block\">\n <p className=\"text-[11px] text-text-secondary\">{date.label}</p>\n <p className=\"text-xs font-medium text-text-primary\">\n {formatDate(date.value)}\n </p>\n </div>\n\n <div className=\"hidden w-32 lg:block\">\n <AuthorAvatar item={item} currentUser={currentUser} />\n </div>\n\n {onDeleted && (\n <ContentItemActionsMenu\n item={{ id: item.id, title: item.title }}\n onDeleted={onDeleted}\n onEdit={onEdit}\n />\n )}\n </div>\n </GlassCard>\n );\n};\n"],"mappings":";;;;;;;;AA8DA,IAAM,IACJ;AAOF,SAAS,EAAc,GAAqB;AAE1C,QADK,IACE;EACL,MAAM;EACN,UAAU;EACV,SAAS;EACT,YAAY,MAAqC;AAC/C,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,SACjC,EAAE,gBAAgB,EAClB,GAAQ;;EAGb,GAXmB,EAAE;;AAcxB,IAAM,IAA6C;CACjD,SAAS;CACT,OAAO;CACP,OAAO;CACP,UAAU;CACV,UAAU;CACX,EAGK,IAA+C;CACnD,SAAS;CACT,OACE;CACF,OACE;CACF,UAAU;CACV,UACE;CACH;AAGD,SAAS,EAAQ,GAAuB;AAKtC,QAJI,KAAS,KACJ,+EACL,KAAS,KACJ,+EACF;;AAIT,SAAS,EACP,GACA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AC,KAAD;MAAG,WAAU;gBAAmC,EAAK;MAAU,CAAA,EAC/D,kBAAC,KAAD;MAAG,WAAU;gBACV,EAAW,EAAK,MAAM;MACrB,CAAA,CACA;;IAEN,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,GAAD;MAAoB;MAAmB;MAAe,CAAA;KAClD,CAAA;IAEL,KACC,kBAAC,GAAD;KACE,MAAM;MAAE,IAAI,EAAK;MAAI,OAAO,EAAK;MAAO;KAC7B;KACH;KACR,CAAA;IAEA;;EACI,CAAA"}
|
|
1
|
+
{"version":3,"file":"ContentLibraryCard.js","names":[],"sources":["../../../../src/headshotmarketing/pages/content/ContentLibraryCard.tsx"],"sourcesContent":["/**\n * ContentLibraryCard / ContentLibraryRow\n *\n * Rich presentational views for a single content item in the Content Library.\n * Both surfaces render from data ALREADY fetched by the page's bootstrap query\n * (type, status, tags, SEO score, scheduled/published dates, author) — no new\n * network calls and no fabricated values (a missing SEO score or date simply\n * isn't rendered).\n *\n * Author resolution: the bootstrap payload carries only the raw `authorId`.\n * When that id matches the signed-in user we resolve it to their real name +\n * avatar (available from the shell context); otherwise we show a neutral\n * avatar rather than printing an opaque id. Full directory resolution needs a\n * dedicated members query (deferred to the backend).\n *\n * @module headshotmarketing/pages/content\n */\n\nimport type { FC, KeyboardEvent } from \"react\";\nimport {\n FileText,\n Image as ImageIcon,\n Video,\n File as FileIcon,\n User,\n Calendar,\n Gauge,\n type LucideIcon,\n} from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport { cn, formatDate, getInitials } from \"../../utils/helpers\";\nimport { StatusBadge } from \"../../components\";\nimport type { ContentItem, ContentType } from \"../../types\";\nimport { ContentItemActionsMenu } from \"./ContentItemActions\";\nimport { AIGeneratedBadge } from \"./AIGeneratedBadge\";\n\n/** Minimal shape of the signed-in user needed to resolve self-authored items. */\nexport interface ContentCardUser {\n id: string;\n email: string;\n firstName?: string;\n lastName?: string;\n name?: string;\n avatar?: string;\n}\n\nexport interface ContentCardProps {\n item: ContentItem;\n /** Raw `scheduledAt` from the bootstrap row (dropped by the shared mapper). */\n scheduledAt: string | null;\n currentUser?: ContentCardUser | null;\n /** When set, the card/row becomes an accessible button opening the detail. */\n onOpen?: () => void;\n /**\n * When set, an overflow (Delete) menu is rendered on the surface and this is\n * invoked after a successful delete (the page's bootstrap refetch). The menu\n * stops click propagation so it never triggers `onOpen`.\n */\n onDeleted?: () => void | Promise<unknown>;\n /** When set, the overflow menu offers \"Edit\" (opens the editor). */\n onEdit?: () => void;\n}\n\nconst OPENABLE_CLASS =\n \"cursor-pointer transition-shadow hover:shadow-pop focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\";\n\n/**\n * Build the interactive attributes that turn a surface into an accessible\n * activator. Kept inline so the grid card and list row open identically.\n * `className` is merged by the caller so it doesn't clobber the surface's own.\n */\nfunction openableProps(onOpen?: () => void) {\n if (!onOpen) return {};\n return {\n role: \"button\" as const,\n tabIndex: 0,\n onClick: onOpen,\n onKeyDown: (e: KeyboardEvent<HTMLDivElement>) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onOpen();\n }\n },\n };\n}\n\nconst typeIcons: Record<ContentType, LucideIcon> = {\n article: FileText,\n image: ImageIcon,\n video: Video,\n document: FileIcon,\n template: FileText,\n};\n\n/** Distinct, token-only accent per content type for an at-a-glance read. */\nconst typeBadgeStyles: Record<ContentType, string> = {\n article: \"bg-status-info-bg text-status-info-text border-status-info-border\",\n image:\n \"bg-[var(--color-accent-soft)] text-action-primary-bg border-border-seam\",\n video:\n \"bg-status-warning-bg text-status-warning-text border-status-warning-border\",\n document: \"bg-bg-sunken text-text-secondary border-border-subtle\",\n template:\n \"bg-status-success-bg text-status-success-text border-status-success-border\",\n};\n\n/** Colour the SEO pill by score band — semantic tokens only. */\nfunction seoTone(score: number): string {\n if (score >= 80)\n return \"bg-status-success-bg text-status-success-text border-status-success-border\";\n if (score >= 50)\n return \"bg-status-warning-bg text-status-warning-text border-status-warning-border\";\n return \"bg-bg-sunken text-text-secondary border-border-subtle\";\n}\n\n/** Pick the most relevant date to surface, with an honest label. */\nfunction resolveDateInfo(\n item: ContentItem,\n scheduledAt: string | null,\n): { label: string; value: string } {\n if (scheduledAt) return { label: \"Scheduled\", value: scheduledAt };\n if (item.publishedAt) return { label: \"Published\", value: item.publishedAt };\n return { label: \"Created\", value: item.createdAt };\n}\n\nfunction resolveAuthorName(\n item: ContentItem,\n currentUser?: ContentCardUser | null,\n): string | null {\n if (currentUser && item.author === currentUser.id) {\n const composed = [currentUser.firstName, currentUser.lastName]\n .filter(Boolean)\n .join(\" \")\n .trim();\n return currentUser.name || composed || currentUser.email;\n }\n if (!item.author || item.author === \"Unknown\") return \"Unassigned\";\n return null;\n}\n\nconst TagChip: FC<{ tag: string }> = ({ tag }) => (\n <span className=\"inline-flex items-center rounded-md bg-bg-sunken px-2 py-0.5 text-[11px] font-medium text-text-secondary\">\n {tag}\n </span>\n);\n\nconst SeoPill: FC<{ score: number; className?: string }> = ({\n score,\n className,\n}) => (\n <span\n className={cn(\n \"inline-flex items-center gap-1 rounded-md border px-2 py-0.5 text-[11px] font-semibold tabular-nums\",\n seoTone(score),\n className,\n )}\n title={`SEO score ${score}`}\n >\n <Gauge className=\"h-3 w-3\" />\n SEO {score}\n </span>\n);\n\nconst AuthorAvatar: FC<{\n item: ContentItem;\n currentUser?: ContentCardUser | null;\n showLabel?: boolean;\n}> = ({ item, currentUser, showLabel = true }) => {\n const isSelf = Boolean(currentUser && item.author === currentUser.id);\n const name = resolveAuthorName(item, currentUser);\n const avatarUrl = isSelf ? currentUser?.avatar : undefined;\n\n return (\n <div\n className=\"flex min-w-0 items-center gap-2\"\n title={name ?? item.author}\n >\n {avatarUrl ? (\n <img\n src={avatarUrl}\n alt={name ?? \"Author\"}\n className=\"h-6 w-6 shrink-0 rounded-full object-cover\"\n />\n ) : name && name !== \"Unassigned\" ? (\n <span className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--color-accent-soft)] text-[10px] font-semibold text-action-primary-bg\">\n {getInitials(name)}\n </span>\n ) : (\n <span className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-bg-sunken text-text-secondary\">\n <User className=\"h-3.5 w-3.5\" />\n </span>\n )}\n {showLabel && (\n <span className=\"truncate text-xs text-text-secondary\">\n {name ?? \"Team member\"}\n </span>\n )}\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Grid card\n// ---------------------------------------------------------------------------\n\nexport const ContentLibraryCard: FC<ContentCardProps> = ({\n item,\n scheduledAt,\n currentUser,\n onOpen,\n onDeleted,\n onEdit,\n}) => {\n const Icon = typeIcons[item.type] ?? FileText;\n const tags = item.tags ?? [];\n const date = resolveDateInfo(item, scheduledAt);\n const hasMetaRow =\n tags.length > 0 || item.seoScore > 0 || item.aiProvenance !== null;\n\n return (\n <GlassCard\n treatment=\"glass\"\n className={cn(\"p-4\", onOpen && OPENABLE_CLASS)}\n {...openableProps(onOpen)}\n >\n <div className=\"flex flex-col gap-3\">\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex min-w-0 items-center gap-2.5\">\n <span\n className={cn(\n \"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border\",\n typeBadgeStyles[item.type],\n )}\n >\n <Icon className=\"h-4 w-4\" />\n </span>\n <div className=\"min-w-0\">\n <h3 className=\"truncate text-sm font-semibold text-text-primary\">\n {item.title}\n </h3>\n <span className=\"text-[11px] font-medium uppercase tracking-wide text-text-secondary\">\n {item.typeLabel ?? item.type}\n </span>\n </div>\n </div>\n <div className=\"flex shrink-0 items-center gap-1\">\n <StatusBadge status={item.status} />\n {onDeleted && (\n <ContentItemActionsMenu\n item={item}\n onDeleted={onDeleted}\n onEdit={onEdit}\n />\n )}\n </div>\n </div>\n\n {item.description && (\n <p className=\"line-clamp-2 text-xs text-text-secondary\">\n {item.description}\n </p>\n )}\n\n {hasMetaRow && (\n <div className=\"flex flex-wrap items-center gap-1.5\">\n <AIGeneratedBadge provenance={item.aiProvenance} />\n {tags.slice(0, 3).map((tag) => (\n <TagChip key={tag} tag={tag} />\n ))}\n {tags.length > 3 && (\n <span className=\"text-[11px] font-medium text-text-secondary\">\n +{tags.length - 3}\n </span>\n )}\n {item.seoScore > 0 && (\n <SeoPill score={item.seoScore} className=\"ml-auto\" />\n )}\n </div>\n )}\n\n <div className=\"space-y-2 border-t border-border-subtle pt-3\">\n <AuthorAvatar item={item} currentUser={currentUser} />\n <div className=\"flex items-center justify-between text-xs\">\n <span className=\"inline-flex items-center gap-1.5 text-text-secondary\">\n <Calendar className=\"h-3.5 w-3.5\" />\n {date.label}\n </span>\n <span className=\"font-medium text-text-primary\">\n {formatDate(date.value)}\n </span>\n </div>\n </div>\n </div>\n </GlassCard>\n );\n};\n\n// ---------------------------------------------------------------------------\n// List row\n// ---------------------------------------------------------------------------\n\nexport const ContentLibraryRow: FC<ContentCardProps> = ({\n item,\n scheduledAt,\n currentUser,\n onOpen,\n onDeleted,\n onEdit,\n}) => {\n const Icon = typeIcons[item.type] ?? FileText;\n const tags = item.tags ?? [];\n const date = resolveDateInfo(item, scheduledAt);\n\n return (\n <GlassCard\n treatment=\"glass\"\n className={cn(\"p-3.5\", onOpen && OPENABLE_CLASS)}\n {...openableProps(onOpen)}\n >\n <div className=\"flex items-center gap-4\">\n <span\n className={cn(\n \"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border\",\n typeBadgeStyles[item.type],\n )}\n >\n <Icon className=\"h-5 w-5\" />\n </span>\n\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2\">\n <p className=\"truncate text-sm font-medium text-text-primary\">\n {item.title}\n </p>\n <StatusBadge status={item.status} className=\"shrink-0\" />\n <AIGeneratedBadge provenance={item.aiProvenance} />\n </div>\n <div className=\"mt-1 flex flex-wrap items-center gap-1.5\">\n <span className=\"text-[11px] font-medium uppercase tracking-wide text-text-secondary\">\n {item.typeLabel ?? item.type}\n </span>\n {tags.slice(0, 4).map((tag) => (\n <TagChip key={tag} tag={tag} />\n ))}\n </div>\n </div>\n\n {item.seoScore > 0 && (\n <SeoPill score={item.seoScore} className=\"hidden sm:inline-flex\" />\n )}\n\n <div className=\"hidden text-right md:block\">\n <p className=\"text-[11px] text-text-secondary\">{date.label}</p>\n <p className=\"text-xs font-medium text-text-primary\">\n {formatDate(date.value)}\n </p>\n </div>\n\n <div className=\"hidden w-32 lg:block\">\n <AuthorAvatar item={item} currentUser={currentUser} />\n </div>\n\n {onDeleted && (\n <ContentItemActionsMenu\n item={item}\n onDeleted={onDeleted}\n onEdit={onEdit}\n />\n )}\n </div>\n </GlassCard>\n );\n};\n"],"mappings":";;;;;;;;;AA+DA,IAAM,IACJ;AAOF,SAAS,EAAc,GAAqB;AAE1C,QADK,IACE;EACL,MAAM;EACN,UAAU;EACV,SAAS;EACT,YAAY,MAAqC;AAC/C,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,SACjC,EAAE,gBAAgB,EAClB,GAAQ;;EAGb,GAXmB,EAAE;;AAcxB,IAAM,IAA6C;CACjD,SAAS;CACT,OAAO;CACP,OAAO;CACP,UAAU;CACV,UAAU;CACX,EAGK,IAA+C;CACnD,SAAS;CACT,OACE;CACF,OACE;CACF,UAAU;CACV,UACE;CACH;AAGD,SAAS,EAAQ,GAAuB;AAKtC,QAJI,KAAS,KACJ,+EACL,KAAS,KACJ,+EACF;;AAIT,SAAS,EACP,GACA,GACkC;AAGlC,QAFI,IAAoB;EAAE,OAAO;EAAa,OAAO;EAAa,GAC9D,EAAK,cAAoB;EAAE,OAAO;EAAa,OAAO,EAAK;EAAa,GACrE;EAAE,OAAO;EAAW,OAAO,EAAK;EAAW;;AAGpD,SAAS,EACP,GACA,GACe;AACf,KAAI,KAAe,EAAK,WAAW,EAAY,IAAI;EACjD,IAAM,IAAW,CAAC,EAAY,WAAW,EAAY,SAAS,CAC3D,OAAO,QAAQ,CACf,KAAK,IAAI,CACT,MAAM;AACT,SAAO,EAAY,Q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A;;EACI,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeadCreateModal.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/crm/LeadCreateModal.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"LeadCreateModal.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/crm/LeadCreateModal.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAY,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAa1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAyC3C,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,iEAAiE;IACjE,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,+EAA+E;IAC/E,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAsPpD,CAAC"}
|