@fonderie/vue-courier-admin-screens 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -31,13 +31,24 @@ var import_vue = require("vue");
31
31
 
32
32
  // src/styles.ts
33
33
  var styles = {
34
- container: { padding: "24px" },
34
+ container: { padding: "8px 40px 64px", maxWidth: "1400px", boxSizing: "border-box" },
35
35
  // Two columns, always: editor left, rendered result right. Stacking the
36
36
  // preview under a long form hid it below the fold.
37
- split: { display: "grid", gridTemplateColumns: "minmax(0, 1fr) minmax(0, 1fr)", gap: "24px", alignItems: "start" },
37
+ split: {
38
+ display: "grid",
39
+ gridTemplateColumns: "minmax(0, 1fr) minmax(0, 1fr)",
40
+ gap: "24px",
41
+ alignItems: "start"
42
+ },
38
43
  column: { minWidth: "0", display: "flex", flexDirection: "column" },
39
44
  // Pinned while the form scrolls, so the preview stays in view as you edit.
40
- previewColumn: { minWidth: "0", display: "flex", flexDirection: "column", position: "sticky", top: "16px" },
45
+ previewColumn: {
46
+ minWidth: "0",
47
+ display: "flex",
48
+ flexDirection: "column",
49
+ position: "sticky",
50
+ top: "16px"
51
+ },
41
52
  saveRow: { display: "flex", alignItems: "center", gap: "12px", marginTop: "16px" },
42
53
  previewHeader: {
43
54
  display: "flex",
@@ -51,7 +62,8 @@ var styles = {
51
62
  height: "520px",
52
63
  border: "1px solid var(--fonderie-border,#e0e0e0)",
53
64
  borderRadius: "8px",
54
- background: "var(--fonderie-surface,#fff)"
65
+ background: "var(--fonderie-surface,#fff)",
66
+ boxShadow: "var(--fonderie-shadow-card,0 2px 3px 0 rgba(0,0,0,.05))"
55
67
  },
56
68
  previewText: {
57
69
  whiteSpace: "pre-wrap",
@@ -61,36 +73,117 @@ var styles = {
61
73
  fontSize: "13px",
62
74
  fontFamily: 'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace)'
63
75
  },
64
- title: { fontSize: "24px", fontWeight: 700 },
65
- subtitle: { fontSize: "16px", fontWeight: 600, marginBottom: "8px" },
66
- meta: { fontSize: "13px", color: "var(--fonderie-text-muted,#5c5c5c)", marginBottom: "16px" },
67
- status: { padding: "24px", textAlign: "center", color: "var(--fonderie-text-muted,#5c5c5c)" },
68
- error: { color: "var(--fonderie-danger,#e00)", marginBottom: "12px", fontSize: "14px" },
69
- list: { listStyle: "none", padding: "0", margin: "0" },
76
+ title: {
77
+ fontSize: "22px",
78
+ fontWeight: 600,
79
+ margin: "8px 0 4px",
80
+ letterSpacing: "var(--fonderie-tracking-display,-0.05em)",
81
+ lineHeight: 1.25
82
+ },
83
+ subtitle: {
84
+ fontSize: "15px",
85
+ fontWeight: 600,
86
+ margin: "0 0 10px",
87
+ letterSpacing: "var(--fonderie-tracking-display,-0.05em)"
88
+ },
89
+ meta: { fontSize: "13px", color: "var(--fonderie-text-muted,#5c5c5c)", marginBottom: "20px" },
90
+ status: { padding: "24px 0", color: "var(--fonderie-text-muted,#5c5c5c)", fontSize: "13.5px" },
91
+ error: {
92
+ color: "var(--fonderie-danger,#e00)",
93
+ background: "color-mix(in srgb, var(--fonderie-danger,#e00) 8%, transparent)",
94
+ borderRadius: "6px",
95
+ padding: "8px 12px",
96
+ margin: "8px 0",
97
+ fontSize: "13.5px"
98
+ },
99
+ list: {
100
+ listStyle: "none",
101
+ padding: "0",
102
+ margin: "0",
103
+ background: "var(--fonderie-surface,#fff)",
104
+ border: "1px solid var(--fonderie-border,#e0e0e0)",
105
+ borderRadius: "var(--fonderie-radius-lg,8px)",
106
+ overflow: "hidden",
107
+ boxShadow: "var(--fonderie-shadow-card,0 2px 3px 0 rgba(0,0,0,.05))"
108
+ },
70
109
  row: { borderBottom: "1px solid var(--fonderie-border-light,#f5f5f5)" },
71
110
  rowButton: {
72
111
  width: "100%",
73
112
  display: "flex",
74
113
  justifyContent: "space-between",
75
114
  alignItems: "center",
76
- padding: "12px 0",
115
+ gap: "16px",
116
+ padding: "13px 16px",
77
117
  background: "none",
78
118
  border: "none",
79
119
  cursor: "pointer",
80
- textAlign: "left"
120
+ textAlign: "left",
121
+ color: "var(--fonderie-text,#171717)",
122
+ fontFamily: "inherit"
123
+ },
124
+ type: {
125
+ fontSize: "13px",
126
+ fontWeight: 600,
127
+ flex: "1",
128
+ fontFamily: 'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace)'
129
+ },
130
+ locale: { fontSize: "12.5px", color: "var(--fonderie-text-muted,#5c5c5c)" },
131
+ active: {
132
+ display: "inline-flex",
133
+ alignItems: "center",
134
+ gap: "6px",
135
+ borderRadius: "999px",
136
+ padding: "2px 9px 2px 8px",
137
+ fontSize: "12px",
138
+ fontWeight: 600,
139
+ lineHeight: 1.5,
140
+ minWidth: "64px",
141
+ color: "var(--fonderie-accent-strong,#009767)",
142
+ background: "color-mix(in srgb, var(--fonderie-accent-strong,#009767) 13%, transparent)"
143
+ },
144
+ inactive: {
145
+ display: "inline-flex",
146
+ alignItems: "center",
147
+ gap: "6px",
148
+ borderRadius: "999px",
149
+ padding: "2px 9px 2px 8px",
150
+ fontSize: "12px",
151
+ fontWeight: 600,
152
+ lineHeight: 1.5,
153
+ minWidth: "64px",
154
+ color: "var(--fonderie-text-muted,#5c5c5c)",
155
+ background: "color-mix(in srgb, var(--fonderie-text-muted,#5c5c5c) 10%, transparent)"
156
+ },
157
+ form: {
158
+ display: "flex",
159
+ flexDirection: "column",
160
+ gap: "4px",
161
+ background: "var(--fonderie-surface,#fff)",
162
+ border: "1px solid var(--fonderie-border,#e0e0e0)",
163
+ borderRadius: "var(--fonderie-radius-lg,8px)",
164
+ padding: "6px 20px 20px",
165
+ boxShadow: "var(--fonderie-shadow-card,0 2px 3px 0 rgba(0,0,0,.05))"
166
+ },
167
+ label: { fontSize: "13px", fontWeight: 500, marginTop: "14px", marginBottom: "2px" },
168
+ input: {
169
+ height: "36px",
170
+ boxSizing: "border-box",
171
+ border: "1px solid var(--fonderie-border,#e0e0e0)",
172
+ borderRadius: "6px",
173
+ padding: "0 10px",
174
+ fontSize: "13.5px",
175
+ fontFamily: "inherit",
176
+ background: "var(--fonderie-surface,#fff)",
177
+ color: "var(--fonderie-text,#171717)"
81
178
  },
82
- type: { fontSize: "14px", fontWeight: 600, flex: "1" },
83
- locale: { fontSize: "13px", color: "var(--fonderie-text-muted,#5c5c5c)", marginRight: "16px" },
84
- active: { fontSize: "12px", color: "var(--fonderie-accent-strong,#009767)" },
85
- inactive: { fontSize: "12px", color: "var(--fonderie-text-muted,#5c5c5c)" },
86
- form: { display: "flex", flexDirection: "column", gap: "4px" },
87
- label: { fontSize: "13px", fontWeight: 600, marginTop: "12px" },
88
- input: { border: "1px solid var(--fonderie-border,#e0e0e0)", borderRadius: "8px", padding: "10px", fontSize: "14px" },
89
179
  textarea: {
90
180
  border: "1px solid var(--fonderie-border,#e0e0e0)",
91
- borderRadius: "8px",
181
+ borderRadius: "6px",
92
182
  padding: "10px",
93
- fontSize: "14px",
183
+ fontSize: "13px",
184
+ lineHeight: 1.55,
185
+ background: "var(--fonderie-surface,#fff)",
186
+ color: "var(--fonderie-text,#171717)",
94
187
  fontFamily: 'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace)'
95
188
  },
96
189
  checkboxLabel: {
@@ -101,44 +194,75 @@ var styles = {
101
194
  fontSize: "14px"
102
195
  },
103
196
  button: {
197
+ display: "inline-flex",
198
+ alignItems: "center",
199
+ height: "36px",
200
+ boxSizing: "border-box",
104
201
  backgroundColor: "var(--fonderie-text,#171717)",
105
202
  color: "var(--fonderie-surface,#fff)",
106
- padding: "10px 20px",
107
- borderRadius: "8px",
108
- border: "none",
109
- fontSize: "14px",
203
+ padding: "0 16px",
204
+ borderRadius: "6px",
205
+ border: "1px solid var(--fonderie-text,#171717)",
206
+ fontSize: "13.5px",
110
207
  fontWeight: 600,
111
- cursor: "pointer",
112
- alignSelf: "flex-start"
208
+ fontFamily: "inherit",
209
+ alignSelf: "flex-start",
210
+ cursor: "pointer"
113
211
  },
114
212
  buttonDisabled: {
115
- backgroundColor: "var(--fonderie-border,#e0e0e0)",
116
- color: "var(--fonderie-text-muted,#5c5c5c)",
117
- padding: "10px 20px",
118
- borderRadius: "8px",
119
- border: "none",
120
- fontSize: "14px",
213
+ display: "inline-flex",
214
+ alignItems: "center",
215
+ height: "36px",
216
+ boxSizing: "border-box",
217
+ backgroundColor: "var(--fonderie-text,#171717)",
218
+ color: "var(--fonderie-surface,#fff)",
219
+ padding: "0 16px",
220
+ borderRadius: "6px",
221
+ border: "1px solid var(--fonderie-text,#171717)",
222
+ fontSize: "13.5px",
121
223
  fontWeight: 600,
122
- cursor: "not-allowed",
123
- alignSelf: "flex-start"
224
+ fontFamily: "inherit",
225
+ alignSelf: "flex-start",
226
+ opacity: 0.45,
227
+ cursor: "not-allowed"
124
228
  },
125
229
  revisions: { marginTop: "32px" },
126
230
  revisionRow: {
127
231
  display: "flex",
128
232
  justifyContent: "space-between",
129
233
  alignItems: "center",
130
- padding: "8px 0",
234
+ gap: "12px",
235
+ padding: "9px 16px",
131
236
  borderBottom: "1px solid var(--fonderie-border-light,#f5f5f5)",
132
237
  fontSize: "13px"
133
238
  },
134
239
  rollbackButton: {
135
- background: "none",
240
+ display: "inline-flex",
241
+ alignItems: "center",
242
+ height: "28px",
243
+ boxSizing: "border-box",
244
+ background: "var(--fonderie-surface,#fff)",
245
+ color: "var(--fonderie-text,#171717)",
136
246
  border: "1px solid var(--fonderie-border,#e0e0e0)",
137
- borderRadius: "8px",
138
- padding: "4px 10px",
139
- fontSize: "12px",
247
+ borderRadius: "6px",
248
+ padding: "0 10px",
249
+ fontSize: "12.5px",
250
+ fontWeight: 500,
251
+ fontFamily: "inherit",
140
252
  cursor: "pointer"
141
- }
253
+ },
254
+ // Template list: matches @fonderie/vue-admin-screens' shell look with local
255
+ // values — this package sits below the admin screens and cannot import them.
256
+ listContainer: { padding: "32px 40px 64px", maxWidth: "1160px", boxSizing: "border-box" },
257
+ listTitle: {
258
+ fontSize: "22px",
259
+ fontWeight: 600,
260
+ margin: "0",
261
+ letterSpacing: "var(--fonderie-tracking-display,-0.05em)",
262
+ lineHeight: 1.25
263
+ },
264
+ hint: { fontSize: "13.5px", color: "var(--fonderie-text-muted,#5c5c5c)", margin: "4px 0 24px" },
265
+ dot: { width: "6px", height: "6px", borderRadius: "999px", background: "currentColor" }
142
266
  };
143
267
 
144
268
  // src/screens/TemplateEditorScreen.ts
@@ -391,25 +515,24 @@ var TemplateListScreen = (0, import_vue2.defineComponent)({
391
515
  },
392
516
  [
393
517
  (0, import_vue2.h)("span", { style: styles.type }, template.type),
394
- (0, import_vue2.h)("span", { style: styles.locale }, template.locale ?? "base"),
395
- (0, import_vue2.h)(
396
- "span",
397
- { style: template.active ? styles.active : styles.inactive },
398
- template.active ? "Active" : "Inactive"
399
- )
518
+ (0, import_vue2.h)("span", { style: styles.locale }, template.locale ?? "default locale"),
519
+ (0, import_vue2.h)("span", { style: template.active ? styles.active : styles.inactive }, [
520
+ (0, import_vue2.h)("span", { style: styles.dot }),
521
+ template.active ? "active" : "inactive"
522
+ ])
400
523
  ]
401
524
  )
402
525
  ]);
403
526
  }
404
- return () => {
405
- if (isLoading.value) return (0, import_vue2.h)("p", { style: styles.status }, "Loading templates\u2026");
406
- if (error.value)
407
- return (0, import_vue2.h)("p", { style: styles.error, role: "alert" }, error.value.explanation);
408
- return (0, import_vue2.h)("div", { style: styles.container }, [
409
- (0, import_vue2.h)("h1", { style: styles.title }, "Templates"),
410
- (0, import_vue2.h)("ul", { style: styles.list }, templates.value.map(renderRow))
411
- ]);
412
- };
527
+ return () => (0, import_vue2.h)("div", { style: styles.listContainer }, [
528
+ (0, import_vue2.h)("h1", { style: styles.listTitle }, "Templates"),
529
+ (0, import_vue2.h)(
530
+ "p",
531
+ { style: styles.hint },
532
+ "Every email the app sends. Open one to edit its copy and preview it live."
533
+ ),
534
+ isLoading.value ? (0, import_vue2.h)("p", { style: styles.status }, "Loading templates\u2026") : error.value ? (0, import_vue2.h)("p", { style: styles.error, role: "alert" }, error.value.explanation) : (0, import_vue2.h)("ul", { style: styles.list }, templates.value.map(renderRow))
535
+ ]);
413
536
  }
414
537
  });
415
538
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/screens/TemplateEditorScreen.ts","../src/styles.ts","../src/screens/TemplateListScreen.ts"],"sourcesContent":["export { TemplateEditorScreen, TemplateListScreen } from './screens';\n","import type {\n\tCourierAdminClient,\n\tFonderieApiError,\n\tISetTemplateInput,\n\tITemplateRevision,\n} from '@fonderie/client';\nimport {\n\tuseTemplate,\n\tuseTemplatePreview,\n\tuseTemplateRevisions,\n\tuseTemplates,\n} from '@fonderie/vue-courier-admin';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent, h, ref, watch } from 'vue';\n\nconst PREVIEW_DEBOUNCE_MS = 500;\nimport { styles } from '../styles';\n\n// Implicit variables the layout injects — an operator never supplies these, so\n// offering them as fields would just be noise.\nconst IMPLICIT = new Set(['subject', 'preheader', 'brandName']);\n\nexport const TemplateEditorScreen = defineComponent({\n\tname: 'FonderieTemplateEditorScreen',\n\tprops: {\n\t\tclient: { type: Object as PropType<CourierAdminClient>, required: true },\n\t\ttype: { type: String, required: true },\n\t\tlocale: { type: String as PropType<string | null>, default: null },\n\t},\n\temits: {\n\t\tsaved: () => true,\n\t},\n\tsetup(props, { emit }) {\n\t\tconst { template, isLoading, error, refresh } = useTemplate(\n\t\t\tprops.client,\n\t\t\tprops.type,\n\t\t\tprops.locale,\n\t\t);\n\t\t// Saves go through the list composable (which re-fetches the template list\n\t\t// after each write); mounting it adds a template-list fetch to this\n\t\t// single-template editor — acceptable for an admin dashboard. Its\n\t\t// isLoading/error track that list fetch, so the save action keeps local state.\n\t\tconst { saveTemplate } = useTemplates(props.client);\n\t\tconst { revisions, rollback } = useTemplateRevisions(props.client, props.type, props.locale);\n\t\tconst isSaving = ref(false);\n\t\tconst saveError = ref<FonderieApiError | null>(null);\n\n\t\tconst subject = ref('');\n\t\tconst html = ref('');\n\t\tconst text = ref('');\n\t\tconst active = ref(true);\n\n\t\twatch(template, (tpl) => {\n\t\t\tif (!tpl) return;\n\t\t\tsubject.value = tpl.subject ?? '';\n\t\t\thtml.value = tpl.html ?? '';\n\t\t\ttext.value = tpl.text;\n\t\t\tactive.value = tpl.active;\n\t\t});\n\n\t\tconst {\n\t\t\tpreview,\n\t\t\tisPreviewing,\n\t\t\terror: previewError,\n\t\t\trenderPreview,\n\t\t} = useTemplatePreview(props.client);\n\t\t// Sample values as JSON text rather than an object, so a half-typed value\n\t\t// does not have to parse on every keystroke.\n\t\tconst sampleJson = ref('{}');\n\t\tconst sampleError = ref<string | null>(null);\n\n\t\tasync function run() {\n\t\t\tlet data: Record<string, unknown> = {};\n\t\t\ttry {\n\t\t\t\tconst parsed: unknown = JSON.parse(sampleJson.value || '{}');\n\t\t\t\tif (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {\n\t\t\t\t\tsampleError.value = 'Sample data must be a JSON object.';\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdata = parsed as Record<string, unknown>;\n\t\t\t\tsampleError.value = null;\n\t\t\t} catch {\n\t\t\t\tsampleError.value = 'Sample data is not valid JSON.';\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst result = await renderPreview(\n\t\t\t\tprops.type,\n\t\t\t\t{\n\t\t\t\t\ttext: text.value,\n\t\t\t\t\tdata,\n\t\t\t\t\t...(subject.value ? { subject: subject.value } : {}),\n\t\t\t\t\t...(html.value ? { html: html.value } : {}),\n\t\t\t\t},\n\t\t\t\tprops.locale,\n\t\t\t);\n\t\t\t// The server reports which variables this content uses; seed the ones\n\t\t\t// with no value yet with their own name so the render shows where each\n\t\t\t// lands. Never overwrite something already typed.\n\t\t\tconst missing = result.variables.filter((v) => !IMPLICIT.has(v) && !(v in data));\n\t\t\tif (missing.length > 0) {\n\t\t\t\tsampleJson.value = JSON.stringify(\n\t\t\t\t\t{ ...data, ...Object.fromEntries(missing.map((v) => [v, v])) },\n\t\t\t\t\tnull,\n\t\t\t\t\t2,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// The preview is always live: it renders once the template loads, then\n\t\t// again PREVIEW_DEBOUNCE_MS after the last edit to the content or the sample\n\t\t// data — debounced, so typing a paragraph costs one request, not one per key.\n\t\tlet previewTimer: ReturnType<typeof setTimeout> | undefined;\n\t\twatch([template, subject, html, text, sampleJson], () => {\n\t\t\tif (!template.value) return;\n\t\t\tclearTimeout(previewTimer);\n\t\t\tpreviewTimer = setTimeout(() => void run(), PREVIEW_DEBOUNCE_MS);\n\t\t});\n\n\t\t// Saving what is already stored would only mint an identical version (the\n\t\t// server treats it as a no-op anyway), so Save waits for a real change.\n\t\tconst dirty = computed(() => {\n\t\t\tconst tpl = template.value;\n\t\t\treturn (\n\t\t\t\t!!tpl &&\n\t\t\t\t(subject.value !== (tpl.subject ?? '') ||\n\t\t\t\t\thtml.value !== (tpl.html ?? '') ||\n\t\t\t\t\ttext.value !== tpl.text ||\n\t\t\t\t\tactive.value !== tpl.active)\n\t\t\t);\n\t\t});\n\n\t\tasync function handleSubmit(event: Event) {\n\t\t\tevent.preventDefault();\n\t\t\tisSaving.value = true;\n\t\t\tsaveError.value = null;\n\t\t\ttry {\n\t\t\t\tconst input: ISetTemplateInput = { text: text.value, active: active.value };\n\t\t\t\tif (subject.value) input.subject = subject.value;\n\t\t\t\tif (html.value) input.html = html.value;\n\t\t\t\tif (template.value?.version !== undefined) input.ifVersion = template.value.version;\n\t\t\t\tawait saveTemplate(props.type, input, props.locale);\n\t\t\t\t// The list composable refreshes its own list; this screen renders the\n\t\t\t\t// single template, so re-read it too.\n\t\t\t\tawait refresh();\n\t\t\t\temit('saved');\n\t\t\t} catch (err) {\n\t\t\t\t// useTemplates normalizes every failure to FonderieApiError before throwing.\n\t\t\t\tsaveError.value = err as FonderieApiError;\n\t\t\t} finally {\n\t\t\t\tisSaving.value = false;\n\t\t\t}\n\t\t}\n\n\t\tfunction renderRevision(rev: ITemplateRevision) {\n\t\t\treturn h('li', { key: rev.version, style: styles.revisionRow }, [\n\t\t\t\th(\n\t\t\t\t\t'span',\n\t\t\t\t\t`v${rev.version} — ${rev.actor ?? 'unknown'} — ${new Date(rev.createdAt).toLocaleString()}`,\n\t\t\t\t),\n\t\t\t\th(\n\t\t\t\t\t'button',\n\t\t\t\t\t{ type: 'button', style: styles.rollbackButton, onClick: () => rollback(rev.version) },\n\t\t\t\t\t'Roll back',\n\t\t\t\t),\n\t\t\t]);\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (isLoading.value) return h('p', { style: styles.status }, 'Loading template…');\n\t\t\tif (error.value)\n\t\t\t\treturn h('p', { style: styles.error, role: 'alert' }, error.value.explanation);\n\n\t\t\treturn h('div', { style: styles.container }, [\n\t\t\t\th('h1', { style: styles.title }, props.type),\n\t\t\t\th(\n\t\t\t\t\t'p',\n\t\t\t\t\t{ style: styles.meta },\n\t\t\t\t\t`${props.locale ?? 'base'} · v${template.value?.version ?? 1}`,\n\t\t\t\t),\n\t\t\t\th('div', { style: styles.split }, [\n\t\t\t\th('div', { style: styles.column }, [\n\t\t\t\th('form', { style: styles.form, onSubmit: handleSubmit }, [\n\t\t\t\t\th('label', { style: styles.label, for: 'template-subject' }, 'Subject'),\n\t\t\t\t\th('input', {\n\t\t\t\t\t\tid: 'template-subject',\n\t\t\t\t\t\tstyle: styles.input,\n\t\t\t\t\t\tvalue: subject.value,\n\t\t\t\t\t\tonInput: (e: Event) => {\n\t\t\t\t\t\t\tsubject.value = (e.target as HTMLInputElement).value;\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\th('label', { style: styles.label, for: 'template-html' }, 'HTML body'),\n\t\t\t\t\th('textarea', {\n\t\t\t\t\t\tid: 'template-html',\n\t\t\t\t\t\tstyle: styles.textarea,\n\t\t\t\t\t\trows: 8,\n\t\t\t\t\t\tvalue: html.value,\n\t\t\t\t\t\tonInput: (e: Event) => {\n\t\t\t\t\t\t\thtml.value = (e.target as HTMLTextAreaElement).value;\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\th('label', { style: styles.label, for: 'template-text' }, 'Plain-text body'),\n\t\t\t\t\th('textarea', {\n\t\t\t\t\t\tid: 'template-text',\n\t\t\t\t\t\tstyle: styles.textarea,\n\t\t\t\t\t\trows: 4,\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tvalue: text.value,\n\t\t\t\t\t\tonInput: (e: Event) => {\n\t\t\t\t\t\t\ttext.value = (e.target as HTMLTextAreaElement).value;\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\th('label', { style: styles.checkboxLabel }, [\n\t\t\t\t\t\th('input', {\n\t\t\t\t\t\t\ttype: 'checkbox',\n\t\t\t\t\t\t\tchecked: active.value,\n\t\t\t\t\t\t\tonChange: (e: Event) => {\n\t\t\t\t\t\t\t\tactive.value = (e.target as HTMLInputElement).checked;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t'Active',\n\t\t\t\t\t]),\n\t\t\t\t\tsaveError.value\n\t\t\t\t\t\t? h('p', { style: styles.error, role: 'alert' }, saveError.value.explanation)\n\t\t\t\t\t\t: null,\n\t\t\t\t\th('div', { style: styles.saveRow }, [\n\t\t\t\t\t\th(\n\t\t\t\t\t\t\t'button',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'submit',\n\t\t\t\t\t\t\t\tdisabled: isSaving.value || !dirty.value,\n\t\t\t\t\t\t\t\tstyle: dirty.value ? styles.button : styles.buttonDisabled,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tisSaving.value ? 'Saving…' : 'Save',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t!dirty.value && !isSaving.value ? h('span', { style: styles.meta }, 'No changes to save') : null,\n\t\t\t\t\t]),\n\t\t\t\t]),\n\t\t\t\th('label', { style: styles.label, for: 'template-sample' }, 'Sample data'),\n\t\t\t\th('textarea', {\n\t\t\t\t\tid: 'template-sample',\n\t\t\t\t\tstyle: styles.textarea,\n\t\t\t\t\trows: 6,\n\t\t\t\t\tspellcheck: false,\n\t\t\t\t\tvalue: sampleJson.value,\n\t\t\t\t\tonInput: (e: Event) => {\n\t\t\t\t\t\tsampleJson.value = (e.target as HTMLTextAreaElement).value;\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tsampleError.value\n\t\t\t\t\t? h('p', { style: styles.error, role: 'alert' }, sampleError.value)\n\t\t\t\t\t: null,\n\t\t\t\t]),\n\t\t\t\th('div', { style: styles.previewColumn }, [\n\t\t\t\t\th('div', { style: styles.previewHeader }, [\n\t\t\t\t\t\th('span', { style: styles.label }, 'Preview'),\n\t\t\t\t\t\th('span', { style: styles.meta }, isPreviewing.value ? 'Rendering…' : 'Live'),\n\t\t\t\t\t]),\n\t\t\t\t\tpreviewError.value\n\t\t\t\t\t\t? h('p', { style: styles.error, role: 'alert' }, previewError.value.explanation)\n\t\t\t\t\t\t: null,\n\t\t\t\t\tpreview.value?.subject\n\t\t\t\t\t\t? h('p', { style: styles.previewSubject }, preview.value.subject)\n\t\t\t\t\t\t: null,\n\t\t\t\t\tpreview.value?.html\n\t\t\t\t\t\t? // sandbox= — no scripts, no same-origin. Operator-authored HTML\n\t\t\t\t\t\t\t// must never execute in the dashboard's origin, where the admin\n\t\t\t\t\t\t\t// token lives.\n\t\t\t\t\t\t\th('iframe', {\n\t\t\t\t\t\t\t\ttitle: 'Template preview',\n\t\t\t\t\t\t\t\tstyle: styles.previewFrame,\n\t\t\t\t\t\t\t\tsandbox: '',\n\t\t\t\t\t\t\t\tsrcdoc: preview.value.html,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t: preview.value\n\t\t\t\t\t\t\t? h('pre', { style: styles.previewText }, preview.value.text)\n\t\t\t\t\t\t\t: h('p', { style: styles.meta }, 'Nothing rendered yet.'),\n\t\t\t\t]),\n\t\t\t\t]),\n\t\t\t\trevisions.value.length > 0\n\t\t\t\t\t? h('div', { style: styles.revisions }, [\n\t\t\t\t\t\t\th('h2', { style: styles.subtitle }, 'History'),\n\t\t\t\t\t\t\th('ul', { style: styles.list }, revisions.value.map(renderRevision)),\n\t\t\t\t\t\t])\n\t\t\t\t\t: null,\n\t\t\t]);\n\t\t};\n\t},\n});\n","import type { CSSProperties } from 'vue';\n\nexport const styles: Record<string, CSSProperties> = {\n\tcontainer: { padding: '24px' },\n\t// Two columns, always: editor left, rendered result right. Stacking the\n\t// preview under a long form hid it below the fold.\n\tsplit: { display: 'grid', gridTemplateColumns: 'minmax(0, 1fr) minmax(0, 1fr)', gap: '24px', alignItems: 'start' },\n\tcolumn: { minWidth: '0', display: 'flex', flexDirection: 'column' },\n\t// Pinned while the form scrolls, so the preview stays in view as you edit.\n\tpreviewColumn: { minWidth: '0', display: 'flex', flexDirection: 'column', position: 'sticky', top: '16px' },\n\tsaveRow: { display: 'flex', alignItems: 'center', gap: '12px', marginTop: '16px' },\n\tpreviewHeader: {\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'space-between',\n\t\talignItems: 'center',\n\t\tmarginTop: '12px',\n\t},\n\tpreviewSubject: { fontSize: '14px', fontWeight: '600', margin: '8px 0' },\n\tpreviewFrame: {\n\t\twidth: '100%',\n\t\theight: '520px',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '8px',\n\t\tbackground: 'var(--fonderie-surface,#fff)',\n\t},\n\tpreviewText: {\n\t\twhiteSpace: 'pre-wrap',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '8px',\n\t\tpadding: '12px',\n\t\tfontSize: '13px',\n\t\tfontFamily: 'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace)',\n\t},\n\ttitle: { fontSize: '24px', fontWeight: 700 },\n\tsubtitle: { fontSize: '16px', fontWeight: 600, marginBottom: '8px' },\n\tmeta: { fontSize: '13px', color: 'var(--fonderie-text-muted,#5c5c5c)', marginBottom: '16px' },\n\tstatus: { padding: '24px', textAlign: 'center', color: 'var(--fonderie-text-muted,#5c5c5c)' },\n\terror: { color: 'var(--fonderie-danger,#e00)', marginBottom: '12px', fontSize: '14px' },\n\tlist: { listStyle: 'none', padding: '0', margin: '0' },\n\trow: { borderBottom: '1px solid var(--fonderie-border-light,#f5f5f5)' },\n\trowButton: {\n\t\twidth: '100%',\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'space-between',\n\t\talignItems: 'center',\n\t\tpadding: '12px 0',\n\t\tbackground: 'none',\n\t\tborder: 'none',\n\t\tcursor: 'pointer',\n\t\ttextAlign: 'left',\n\t},\n\ttype: { fontSize: '14px', fontWeight: 600, flex: '1' },\n\tlocale: { fontSize: '13px', color: 'var(--fonderie-text-muted,#5c5c5c)', marginRight: '16px' },\n\tactive: { fontSize: '12px', color: 'var(--fonderie-accent-strong,#009767)' },\n\tinactive: { fontSize: '12px', color: 'var(--fonderie-text-muted,#5c5c5c)' },\n\tform: { display: 'flex', flexDirection: 'column', gap: '4px' },\n\tlabel: { fontSize: '13px', fontWeight: 600, marginTop: '12px' },\n\tinput: { border: '1px solid var(--fonderie-border,#e0e0e0)', borderRadius: '8px', padding: '10px', fontSize: '14px' },\n\ttextarea: {\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '8px',\n\t\tpadding: '10px',\n\t\tfontSize: '14px',\n\t\tfontFamily: 'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace)',\n\t},\n\tcheckboxLabel: {\n\t\tdisplay: 'flex',\n\t\talignItems: 'center',\n\t\tgap: '8px',\n\t\tmarginTop: '12px',\n\t\tfontSize: '14px',\n\t},\n\tbutton: {\n\t\tbackgroundColor: 'var(--fonderie-text,#171717)',\n\t\tcolor: 'var(--fonderie-surface,#fff)',\n\t\tpadding: '10px 20px',\n\t\tborderRadius: '8px',\n\t\tborder: 'none',\n\t\tfontSize: '14px',\n\t\tfontWeight: 600,\n\t\tcursor: 'pointer',\n\t\talignSelf: 'flex-start',\n\t},\n\tbuttonDisabled: {\n\t\tbackgroundColor: 'var(--fonderie-border,#e0e0e0)',\n\t\tcolor: 'var(--fonderie-text-muted,#5c5c5c)',\n\t\tpadding: '10px 20px',\n\t\tborderRadius: '8px',\n\t\tborder: 'none',\n\t\tfontSize: '14px',\n\t\tfontWeight: 600,\n\t\tcursor: 'not-allowed',\n\t\talignSelf: 'flex-start',\n\t},\n\trevisions: { marginTop: '32px' },\n\trevisionRow: {\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'space-between',\n\t\talignItems: 'center',\n\t\tpadding: '8px 0',\n\t\tborderBottom: '1px solid var(--fonderie-border-light,#f5f5f5)',\n\t\tfontSize: '13px',\n\t},\n\trollbackButton: {\n\t\tbackground: 'none',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '8px',\n\t\tpadding: '4px 10px',\n\t\tfontSize: '12px',\n\t\tcursor: 'pointer',\n\t},\n};\n","import type { CourierAdminClient, ITemplateEntry } from '@fonderie/client';\nimport { useTemplates } from '@fonderie/vue-courier-admin';\nimport type { PropType } from 'vue';\nimport { defineComponent, h } from 'vue';\nimport { styles } from '../styles';\n\nexport const TemplateListScreen = defineComponent({\n\tname: 'FonderieTemplateListScreen',\n\tprops: {\n\t\tclient: { type: Object as PropType<CourierAdminClient>, required: true },\n\t},\n\temits: {\n\t\t'select-template': (_template: ITemplateEntry) => true,\n\t},\n\tsetup(props, { emit }) {\n\t\tconst { templates, isLoading, error } = useTemplates(props.client);\n\n\t\tfunction renderRow(template: ITemplateEntry) {\n\t\t\treturn h('li', { key: `${template.type}:${template.locale ?? 'base'}`, style: styles.row }, [\n\t\t\t\th(\n\t\t\t\t\t'button',\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'button',\n\t\t\t\t\t\tstyle: styles.rowButton,\n\t\t\t\t\t\tonClick: () => emit('select-template', template),\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\th('span', { style: styles.type }, template.type),\n\t\t\t\t\t\th('span', { style: styles.locale }, template.locale ?? 'base'),\n\t\t\t\t\t\th(\n\t\t\t\t\t\t\t'span',\n\t\t\t\t\t\t\t{ style: template.active ? styles.active : styles.inactive },\n\t\t\t\t\t\t\ttemplate.active ? 'Active' : 'Inactive',\n\t\t\t\t\t\t),\n\t\t\t\t\t],\n\t\t\t\t),\n\t\t\t]);\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (isLoading.value) return h('p', { style: styles.status }, 'Loading templates…');\n\t\t\tif (error.value)\n\t\t\t\treturn h('p', { style: styles.error, role: 'alert' }, error.value.explanation);\n\n\t\t\treturn h('div', { style: styles.container }, [\n\t\t\t\th('h1', { style: styles.title }, 'Templates'),\n\t\t\t\th('ul', { style: styles.list }, templates.value.map(renderRow)),\n\t\t\t]);\n\t\t};\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,+BAKO;AAEP,iBAAyD;;;ACXlD,IAAM,SAAwC;AAAA,EACpD,WAAW,EAAE,SAAS,OAAO;AAAA;AAAA;AAAA,EAG7B,OAAO,EAAE,SAAS,QAAQ,qBAAqB,iCAAiC,KAAK,QAAQ,YAAY,QAAQ;AAAA,EACjH,QAAQ,EAAE,UAAU,KAAK,SAAS,QAAQ,eAAe,SAAS;AAAA;AAAA,EAElE,eAAe,EAAE,UAAU,KAAK,SAAS,QAAQ,eAAe,UAAU,UAAU,UAAU,KAAK,OAAO;AAAA,EAC1G,SAAS,EAAE,SAAS,QAAQ,YAAY,UAAU,KAAK,QAAQ,WAAW,OAAO;AAAA,EACjF,eAAe;AAAA,IACd,SAAS;AAA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AM,EAAE,KAAK,GAAG,SAAS,IAAI,IAAI,SAAS,UAAU,MAAM,IAAI,OAAO,OAAO,IAAI,GAAG;AAAA,YAC3F;AAAA,UACC;AAAA,UACA;AAAA,YACC,MAAM;AAAA,YACN,OAAO,OAAO;AAAA,YACd,SAAS,MAAM,KAAK,mBAAmB,QAAQ;AAAA,UAChD;AAAA,UACA;AAAA,gBACC,eAAE,QAAQ,EAAE,OAAO,OAAO,KAAK,GAAG,SAAS,IAAI;AAAA,gBAC/C,eAAE,QAAQ,EAAE,OAAO,OAAO,OAAO,GAAG,SAAS,UAAU,MAAM;AAAA,gBAC7D;AAAA,cACC;AAAA,cACA,EAAE,OAAO,SAAS,SAAS,OAAO,SAAS,OAAO,SAAS;AAAA,cAC3D,SAAS,SAAS,WAAW;AAAA,YAC9B;AAAA,UACD;AAAA,QACD;AAAA,MACD,CAAC;AAAA,IACF;AAEA,WAAO,MAAM;AACZ,UAAI,UAAU,MAAO,YAAO,eAAE,KAAK,EAAE,OAAO,OAAO,OAAO,GAAG,yBAAoB;AACjF,UAAI,MAAM;AACT,mBAAO,eAAE,KAAK,EAAE,OAAO,OAAO,OAAO,MAAM,QAAQ,GAAG,MAAM,MAAM,WAAW;AAE9E,iBAAO,eAAE,OAAO,EAAE,OAAO,OAAO,UAAU,GAAG;AAAA,YAC5C,eAAE,MAAM,EAAE,OAAO,OAAO,MAAM,GAAG,WAAW;AAAA,YAC5C,eAAE,MAAM,EAAE,OAAO,OAAO,KAAK,GAAG,UAAU,MAAM,IAAI,SAAS,CAAC;AAAA,MAC/D,CAAC;AAAA,IACF;AAAA,EACD;AACD,CAAC;","names":["import_vue_courier_admin","import_vue"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/screens/TemplateEditorScreen.ts","../src/styles.ts","../src/screens/TemplateListScreen.ts"],"sourcesContent":["export { TemplateEditorScreen, TemplateListScreen } from './screens';\n","import type {\n\tCourierAdminClient,\n\tFonderieApiError,\n\tISetTemplateInput,\n\tITemplateRevision,\n} from '@fonderie/client';\nimport {\n\tuseTemplate,\n\tuseTemplatePreview,\n\tuseTemplateRevisions,\n\tuseTemplates,\n} from '@fonderie/vue-courier-admin';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent, h, ref, watch } from 'vue';\n\nconst PREVIEW_DEBOUNCE_MS = 500;\nimport { styles } from '../styles';\n\n// Implicit variables the layout injects — an operator never supplies these, so\n// offering them as fields would just be noise.\nconst IMPLICIT = new Set(['subject', 'preheader', 'brandName']);\n\nexport const TemplateEditorScreen = defineComponent({\n\tname: 'FonderieTemplateEditorScreen',\n\tprops: {\n\t\tclient: { type: Object as PropType<CourierAdminClient>, required: true },\n\t\ttype: { type: String, required: true },\n\t\tlocale: { type: String as PropType<string | null>, default: null },\n\t},\n\temits: {\n\t\tsaved: () => true,\n\t},\n\tsetup(props, { emit }) {\n\t\tconst { template, isLoading, error, refresh } = useTemplate(\n\t\t\tprops.client,\n\t\t\tprops.type,\n\t\t\tprops.locale,\n\t\t);\n\t\t// Saves go through the list composable (which re-fetches the template list\n\t\t// after each write); mounting it adds a template-list fetch to this\n\t\t// single-template editor — acceptable for an admin dashboard. Its\n\t\t// isLoading/error track that list fetch, so the save action keeps local state.\n\t\tconst { saveTemplate } = useTemplates(props.client);\n\t\tconst { revisions, rollback } = useTemplateRevisions(props.client, props.type, props.locale);\n\t\tconst isSaving = ref(false);\n\t\tconst saveError = ref<FonderieApiError | null>(null);\n\n\t\tconst subject = ref('');\n\t\tconst html = ref('');\n\t\tconst text = ref('');\n\t\tconst active = ref(true);\n\n\t\twatch(template, (tpl) => {\n\t\t\tif (!tpl) return;\n\t\t\tsubject.value = tpl.subject ?? '';\n\t\t\thtml.value = tpl.html ?? '';\n\t\t\ttext.value = tpl.text;\n\t\t\tactive.value = tpl.active;\n\t\t});\n\n\t\tconst {\n\t\t\tpreview,\n\t\t\tisPreviewing,\n\t\t\terror: previewError,\n\t\t\trenderPreview,\n\t\t} = useTemplatePreview(props.client);\n\t\t// Sample values as JSON text rather than an object, so a half-typed value\n\t\t// does not have to parse on every keystroke.\n\t\tconst sampleJson = ref('{}');\n\t\tconst sampleError = ref<string | null>(null);\n\n\t\tasync function run() {\n\t\t\tlet data: Record<string, unknown> = {};\n\t\t\ttry {\n\t\t\t\tconst parsed: unknown = JSON.parse(sampleJson.value || '{}');\n\t\t\t\tif (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {\n\t\t\t\t\tsampleError.value = 'Sample data must be a JSON object.';\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdata = parsed as Record<string, unknown>;\n\t\t\t\tsampleError.value = null;\n\t\t\t} catch {\n\t\t\t\tsampleError.value = 'Sample data is not valid JSON.';\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst result = await renderPreview(\n\t\t\t\tprops.type,\n\t\t\t\t{\n\t\t\t\t\ttext: text.value,\n\t\t\t\t\tdata,\n\t\t\t\t\t...(subject.value ? { subject: subject.value } : {}),\n\t\t\t\t\t...(html.value ? { html: html.value } : {}),\n\t\t\t\t},\n\t\t\t\tprops.locale,\n\t\t\t);\n\t\t\t// The server reports which variables this content uses; seed the ones\n\t\t\t// with no value yet with their own name so the render shows where each\n\t\t\t// lands. Never overwrite something already typed.\n\t\t\tconst missing = result.variables.filter((v) => !IMPLICIT.has(v) && !(v in data));\n\t\t\tif (missing.length > 0) {\n\t\t\t\tsampleJson.value = JSON.stringify(\n\t\t\t\t\t{ ...data, ...Object.fromEntries(missing.map((v) => [v, v])) },\n\t\t\t\t\tnull,\n\t\t\t\t\t2,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// The preview is always live: it renders once the template loads, then\n\t\t// again PREVIEW_DEBOUNCE_MS after the last edit to the content or the sample\n\t\t// data — debounced, so typing a paragraph costs one request, not one per key.\n\t\tlet previewTimer: ReturnType<typeof setTimeout> | undefined;\n\t\twatch([template, subject, html, text, sampleJson], () => {\n\t\t\tif (!template.value) return;\n\t\t\tclearTimeout(previewTimer);\n\t\t\tpreviewTimer = setTimeout(() => void run(), PREVIEW_DEBOUNCE_MS);\n\t\t});\n\n\t\t// Saving what is already stored would only mint an identical version (the\n\t\t// server treats it as a no-op anyway), so Save waits for a real change.\n\t\tconst dirty = computed(() => {\n\t\t\tconst tpl = template.value;\n\t\t\treturn (\n\t\t\t\t!!tpl &&\n\t\t\t\t(subject.value !== (tpl.subject ?? '') ||\n\t\t\t\t\thtml.value !== (tpl.html ?? '') ||\n\t\t\t\t\ttext.value !== tpl.text ||\n\t\t\t\t\tactive.value !== tpl.active)\n\t\t\t);\n\t\t});\n\n\t\tasync function handleSubmit(event: Event) {\n\t\t\tevent.preventDefault();\n\t\t\tisSaving.value = true;\n\t\t\tsaveError.value = null;\n\t\t\ttry {\n\t\t\t\tconst input: ISetTemplateInput = { text: text.value, active: active.value };\n\t\t\t\tif (subject.value) input.subject = subject.value;\n\t\t\t\tif (html.value) input.html = html.value;\n\t\t\t\tif (template.value?.version !== undefined) input.ifVersion = template.value.version;\n\t\t\t\tawait saveTemplate(props.type, input, props.locale);\n\t\t\t\t// The list composable refreshes its own list; this screen renders the\n\t\t\t\t// single template, so re-read it too.\n\t\t\t\tawait refresh();\n\t\t\t\temit('saved');\n\t\t\t} catch (err) {\n\t\t\t\t// useTemplates normalizes every failure to FonderieApiError before throwing.\n\t\t\t\tsaveError.value = err as FonderieApiError;\n\t\t\t} finally {\n\t\t\t\tisSaving.value = false;\n\t\t\t}\n\t\t}\n\n\t\tfunction renderRevision(rev: ITemplateRevision) {\n\t\t\treturn h('li', { key: rev.version, style: styles.revisionRow }, [\n\t\t\t\th(\n\t\t\t\t\t'span',\n\t\t\t\t\t`v${rev.version} — ${rev.actor ?? 'unknown'} — ${new Date(rev.createdAt).toLocaleString()}`,\n\t\t\t\t),\n\t\t\t\th(\n\t\t\t\t\t'button',\n\t\t\t\t\t{ type: 'button', style: styles.rollbackButton, onClick: () => rollback(rev.version) },\n\t\t\t\t\t'Roll back',\n\t\t\t\t),\n\t\t\t]);\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (isLoading.value) return h('p', { style: styles.status }, 'Loading template…');\n\t\t\tif (error.value)\n\t\t\t\treturn h('p', { style: styles.error, role: 'alert' }, error.value.explanation);\n\n\t\t\treturn h('div', { style: styles.container }, [\n\t\t\t\th('h1', { style: styles.title }, props.type),\n\t\t\t\th(\n\t\t\t\t\t'p',\n\t\t\t\t\t{ style: styles.meta },\n\t\t\t\t\t`${props.locale ?? 'base'} · v${template.value?.version ?? 1}`,\n\t\t\t\t),\n\t\t\t\th('div', { style: styles.split }, [\n\t\t\t\t\th('div', { style: styles.column }, [\n\t\t\t\t\t\th('form', { style: styles.form, onSubmit: handleSubmit }, [\n\t\t\t\t\t\t\th('label', { style: styles.label, for: 'template-subject' }, 'Subject'),\n\t\t\t\t\t\t\th('input', {\n\t\t\t\t\t\t\t\tid: 'template-subject',\n\t\t\t\t\t\t\t\tstyle: styles.input,\n\t\t\t\t\t\t\t\tvalue: subject.value,\n\t\t\t\t\t\t\t\tonInput: (e: Event) => {\n\t\t\t\t\t\t\t\t\tsubject.value = (e.target as HTMLInputElement).value;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\th('label', { style: styles.label, for: 'template-html' }, 'HTML body'),\n\t\t\t\t\t\t\th('textarea', {\n\t\t\t\t\t\t\t\tid: 'template-html',\n\t\t\t\t\t\t\t\tstyle: styles.textarea,\n\t\t\t\t\t\t\t\trows: 8,\n\t\t\t\t\t\t\t\tvalue: html.value,\n\t\t\t\t\t\t\t\tonInput: (e: Event) => {\n\t\t\t\t\t\t\t\t\thtml.value = (e.target as HTMLTextAreaElement).value;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\th('label', { style: styles.label, for: 'template-text' }, 'Plain-text body'),\n\t\t\t\t\t\t\th('textarea', {\n\t\t\t\t\t\t\t\tid: 'template-text',\n\t\t\t\t\t\t\t\tstyle: styles.textarea,\n\t\t\t\t\t\t\t\trows: 4,\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t\tvalue: text.value,\n\t\t\t\t\t\t\t\tonInput: (e: Event) => {\n\t\t\t\t\t\t\t\t\ttext.value = (e.target as HTMLTextAreaElement).value;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\th('label', { style: styles.checkboxLabel }, [\n\t\t\t\t\t\t\t\th('input', {\n\t\t\t\t\t\t\t\t\ttype: 'checkbox',\n\t\t\t\t\t\t\t\t\tchecked: active.value,\n\t\t\t\t\t\t\t\t\tonChange: (e: Event) => {\n\t\t\t\t\t\t\t\t\t\tactive.value = (e.target as HTMLInputElement).checked;\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t'Active',\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tsaveError.value\n\t\t\t\t\t\t\t\t? h('p', { style: styles.error, role: 'alert' }, saveError.value.explanation)\n\t\t\t\t\t\t\t\t: null,\n\t\t\t\t\t\t\th('div', { style: styles.saveRow }, [\n\t\t\t\t\t\t\t\th(\n\t\t\t\t\t\t\t\t\t'button',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'submit',\n\t\t\t\t\t\t\t\t\t\tdisabled: isSaving.value || !dirty.value,\n\t\t\t\t\t\t\t\t\t\tstyle: dirty.value ? styles.button : styles.buttonDisabled,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tisSaving.value ? 'Saving…' : 'Save',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t!dirty.value && !isSaving.value\n\t\t\t\t\t\t\t\t\t? h('span', { style: styles.meta }, 'No changes to save')\n\t\t\t\t\t\t\t\t\t: null,\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\th('label', { style: styles.label, for: 'template-sample' }, 'Sample data'),\n\t\t\t\t\t\th('textarea', {\n\t\t\t\t\t\t\tid: 'template-sample',\n\t\t\t\t\t\t\tstyle: styles.textarea,\n\t\t\t\t\t\t\trows: 6,\n\t\t\t\t\t\t\tspellcheck: false,\n\t\t\t\t\t\t\tvalue: sampleJson.value,\n\t\t\t\t\t\t\tonInput: (e: Event) => {\n\t\t\t\t\t\t\t\tsampleJson.value = (e.target as HTMLTextAreaElement).value;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tsampleError.value\n\t\t\t\t\t\t\t? h('p', { style: styles.error, role: 'alert' }, sampleError.value)\n\t\t\t\t\t\t\t: null,\n\t\t\t\t\t]),\n\t\t\t\t\th('div', { style: styles.previewColumn }, [\n\t\t\t\t\t\th('div', { style: styles.previewHeader }, [\n\t\t\t\t\t\t\th('span', { style: styles.label }, 'Preview'),\n\t\t\t\t\t\t\th('span', { style: styles.meta }, isPreviewing.value ? 'Rendering…' : 'Live'),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tpreviewError.value\n\t\t\t\t\t\t\t? h('p', { style: styles.error, role: 'alert' }, previewError.value.explanation)\n\t\t\t\t\t\t\t: null,\n\t\t\t\t\t\tpreview.value?.subject\n\t\t\t\t\t\t\t? h('p', { style: styles.previewSubject }, preview.value.subject)\n\t\t\t\t\t\t\t: null,\n\t\t\t\t\t\tpreview.value?.html\n\t\t\t\t\t\t\t? // sandbox= — no scripts, no same-origin. Operator-authored HTML\n\t\t\t\t\t\t\t\t// must never execute in the dashboard's origin, where the admin\n\t\t\t\t\t\t\t\t// token lives.\n\t\t\t\t\t\t\t\th('iframe', {\n\t\t\t\t\t\t\t\t\ttitle: 'Template preview',\n\t\t\t\t\t\t\t\t\tstyle: styles.previewFrame,\n\t\t\t\t\t\t\t\t\tsandbox: '',\n\t\t\t\t\t\t\t\t\tsrcdoc: preview.value.html,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t: preview.value\n\t\t\t\t\t\t\t\t? h('pre', { style: styles.previewText }, preview.value.text)\n\t\t\t\t\t\t\t\t: h('p', { style: styles.meta }, 'Nothing rendered yet.'),\n\t\t\t\t\t]),\n\t\t\t\t]),\n\t\t\t\trevisions.value.length > 0\n\t\t\t\t\t? h('div', { style: styles.revisions }, [\n\t\t\t\t\t\t\th('h2', { style: styles.subtitle }, 'History'),\n\t\t\t\t\t\t\th('ul', { style: styles.list }, revisions.value.map(renderRevision)),\n\t\t\t\t\t\t])\n\t\t\t\t\t: null,\n\t\t\t]);\n\t\t};\n\t},\n});\n","import type { CSSProperties } from 'vue';\n\nexport const styles: Record<string, CSSProperties> = {\n\tcontainer: { padding: '8px 40px 64px', maxWidth: '1400px', boxSizing: 'border-box' },\n\t// Two columns, always: editor left, rendered result right. Stacking the\n\t// preview under a long form hid it below the fold.\n\tsplit: {\n\t\tdisplay: 'grid',\n\t\tgridTemplateColumns: 'minmax(0, 1fr) minmax(0, 1fr)',\n\t\tgap: '24px',\n\t\talignItems: 'start',\n\t},\n\tcolumn: { minWidth: '0', display: 'flex', flexDirection: 'column' },\n\t// Pinned while the form scrolls, so the preview stays in view as you edit.\n\tpreviewColumn: {\n\t\tminWidth: '0',\n\t\tdisplay: 'flex',\n\t\tflexDirection: 'column',\n\t\tposition: 'sticky',\n\t\ttop: '16px',\n\t},\n\tsaveRow: { display: 'flex', alignItems: 'center', gap: '12px', marginTop: '16px' },\n\tpreviewHeader: {\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'space-between',\n\t\talignItems: 'center',\n\t\tmarginTop: '12px',\n\t},\n\tpreviewSubject: { fontSize: '14px', fontWeight: '600', margin: '8px 0' },\n\tpreviewFrame: {\n\t\twidth: '100%',\n\t\theight: '520px',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '8px',\n\t\tbackground: 'var(--fonderie-surface,#fff)',\n\t\tboxShadow: 'var(--fonderie-shadow-card,0 2px 3px 0 rgba(0,0,0,.05))',\n\t},\n\tpreviewText: {\n\t\twhiteSpace: 'pre-wrap',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '8px',\n\t\tpadding: '12px',\n\t\tfontSize: '13px',\n\t\tfontFamily:\n\t\t\t'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace)',\n\t},\n\ttitle: {\n\t\tfontSize: '22px',\n\t\tfontWeight: 600,\n\t\tmargin: '8px 0 4px',\n\t\tletterSpacing: 'var(--fonderie-tracking-display,-0.05em)',\n\t\tlineHeight: 1.25,\n\t},\n\tsubtitle: {\n\t\tfontSize: '15px',\n\t\tfontWeight: 600,\n\t\tmargin: '0 0 10px',\n\t\tletterSpacing: 'var(--fonderie-tracking-display,-0.05em)',\n\t},\n\tmeta: { fontSize: '13px', color: 'var(--fonderie-text-muted,#5c5c5c)', marginBottom: '20px' },\n\tstatus: { padding: '24px 0', color: 'var(--fonderie-text-muted,#5c5c5c)', fontSize: '13.5px' },\n\terror: {\n\t\tcolor: 'var(--fonderie-danger,#e00)',\n\t\tbackground: 'color-mix(in srgb, var(--fonderie-danger,#e00) 8%, transparent)',\n\t\tborderRadius: '6px',\n\t\tpadding: '8px 12px',\n\t\tmargin: '8px 0',\n\t\tfontSize: '13.5px',\n\t},\n\tlist: {\n\t\tlistStyle: 'none',\n\t\tpadding: '0',\n\t\tmargin: '0',\n\t\tbackground: 'var(--fonderie-surface,#fff)',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: 'var(--fonderie-radius-lg,8px)',\n\t\toverflow: 'hidden',\n\t\tboxShadow: 'var(--fonderie-shadow-card,0 2px 3px 0 rgba(0,0,0,.05))',\n\t},\n\trow: { borderBottom: '1px solid var(--fonderie-border-light,#f5f5f5)' },\n\trowButton: {\n\t\twidth: '100%',\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'space-between',\n\t\talignItems: 'center',\n\t\tgap: '16px',\n\t\tpadding: '13px 16px',\n\t\tbackground: 'none',\n\t\tborder: 'none',\n\t\tcursor: 'pointer',\n\t\ttextAlign: 'left',\n\t\tcolor: 'var(--fonderie-text,#171717)',\n\t\tfontFamily: 'inherit',\n\t},\n\ttype: {\n\t\tfontSize: '13px',\n\t\tfontWeight: 600,\n\t\tflex: '1',\n\t\tfontFamily:\n\t\t\t'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace)',\n\t},\n\tlocale: { fontSize: '12.5px', color: 'var(--fonderie-text-muted,#5c5c5c)' },\n\tactive: {\n\t\tdisplay: 'inline-flex',\n\t\talignItems: 'center',\n\t\tgap: '6px',\n\t\tborderRadius: '999px',\n\t\tpadding: '2px 9px 2px 8px',\n\t\tfontSize: '12px',\n\t\tfontWeight: 600,\n\t\tlineHeight: 1.5,\n\t\tminWidth: '64px',\n\t\tcolor: 'var(--fonderie-accent-strong,#009767)',\n\t\tbackground: 'color-mix(in srgb, var(--fonderie-accent-strong,#009767) 13%, transparent)',\n\t},\n\tinactive: {\n\t\tdisplay: 'inline-flex',\n\t\talignItems: 'center',\n\t\tgap: '6px',\n\t\tborderRadius: '999px',\n\t\tpadding: '2px 9px 2px 8px',\n\t\tfontSize: '12px',\n\t\tfontWeight: 600,\n\t\tlineHeight: 1.5,\n\t\tminWidth: '64px',\n\t\tcolor: 'var(--fonderie-text-muted,#5c5c5c)',\n\t\tbackground: 'color-mix(in srgb, var(--fonderie-text-muted,#5c5c5c) 10%, transparent)',\n\t},\n\tform: {\n\t\tdisplay: 'flex',\n\t\tflexDirection: 'column',\n\t\tgap: '4px',\n\t\tbackground: 'var(--fonderie-surface,#fff)',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: 'var(--fonderie-radius-lg,8px)',\n\t\tpadding: '6px 20px 20px',\n\t\tboxShadow: 'var(--fonderie-shadow-card,0 2px 3px 0 rgba(0,0,0,.05))',\n\t},\n\tlabel: { fontSize: '13px', fontWeight: 500, marginTop: '14px', marginBottom: '2px' },\n\tinput: {\n\t\theight: '36px',\n\t\tboxSizing: 'border-box',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '6px',\n\t\tpadding: '0 10px',\n\t\tfontSize: '13.5px',\n\t\tfontFamily: 'inherit',\n\t\tbackground: 'var(--fonderie-surface,#fff)',\n\t\tcolor: 'var(--fonderie-text,#171717)',\n\t},\n\ttextarea: {\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '6px',\n\t\tpadding: '10px',\n\t\tfontSize: '13px',\n\t\tlineHeight: 1.55,\n\t\tbackground: 'var(--fonderie-surface,#fff)',\n\t\tcolor: 'var(--fonderie-text,#171717)',\n\t\tfontFamily:\n\t\t\t'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace)',\n\t},\n\tcheckboxLabel: {\n\t\tdisplay: 'flex',\n\t\talignItems: 'center',\n\t\tgap: '8px',\n\t\tmarginTop: '12px',\n\t\tfontSize: '14px',\n\t},\n\tbutton: {\n\t\tdisplay: 'inline-flex',\n\t\talignItems: 'center',\n\t\theight: '36px',\n\t\tboxSizing: 'border-box',\n\t\tbackgroundColor: 'var(--fonderie-text,#171717)',\n\t\tcolor: 'var(--fonderie-surface,#fff)',\n\t\tpadding: '0 16px',\n\t\tborderRadius: '6px',\n\t\tborder: '1px solid var(--fonderie-text,#171717)',\n\t\tfontSize: '13.5px',\n\t\tfontWeight: 600,\n\t\tfontFamily: 'inherit',\n\t\talignSelf: 'flex-start',\n\t\tcursor: 'pointer',\n\t},\n\tbuttonDisabled: {\n\t\tdisplay: 'inline-flex',\n\t\talignItems: 'center',\n\t\theight: '36px',\n\t\tboxSizing: 'border-box',\n\t\tbackgroundColor: 'var(--fonderie-text,#171717)',\n\t\tcolor: 'var(--fonderie-surface,#fff)',\n\t\tpadding: '0 16px',\n\t\tborderRadius: '6px',\n\t\tborder: '1px solid var(--fonderie-text,#171717)',\n\t\tfontSize: '13.5px',\n\t\tfontWeight: 600,\n\t\tfontFamily: 'inherit',\n\t\talignSelf: 'flex-start',\n\t\topacity: 0.45,\n\t\tcursor: 'not-allowed',\n\t},\n\trevisions: { marginTop: '32px' },\n\trevisionRow: {\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'space-between',\n\t\talignItems: 'center',\n\t\tgap: '12px',\n\t\tpadding: '9px 16px',\n\t\tborderBottom: '1px solid var(--fonderie-border-light,#f5f5f5)',\n\t\tfontSize: '13px',\n\t},\n\trollbackButton: {\n\t\tdisplay: 'inline-flex',\n\t\talignItems: 'center',\n\t\theight: '28px',\n\t\tboxSizing: 'border-box',\n\t\tbackground: 'var(--fonderie-surface,#fff)',\n\t\tcolor: 'var(--fonderie-text,#171717)',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '6px',\n\t\tpadding: '0 10px',\n\t\tfontSize: '12.5px',\n\t\tfontWeight: 500,\n\t\tfontFamily: 'inherit',\n\t\tcursor: 'pointer',\n\t},\n\t// Template list: matches @fonderie/vue-admin-screens' shell look with local\n\t// values — this package sits below the admin screens and cannot import them.\n\tlistContainer: { padding: '32px 40px 64px', maxWidth: '1160px', boxSizing: 'border-box' },\n\tlistTitle: {\n\t\tfontSize: '22px',\n\t\tfontWeight: 600,\n\t\tmargin: '0',\n\t\tletterSpacing: 'var(--fonderie-tracking-display,-0.05em)',\n\t\tlineHeight: 1.25,\n\t},\n\thint: { fontSize: '13.5px', color: 'var(--fonderie-text-muted,#5c5c5c)', margin: '4px 0 24px' },\n\tdot: { width: '6px', height: '6px', borderRadius: '999px', background: 'currentColor' },\n};\n","import type { CourierAdminClient, ITemplateEntry } from '@fonderie/client';\nimport { useTemplates } from '@fonderie/vue-courier-admin';\nimport type { PropType } from 'vue';\nimport { defineComponent, h } from 'vue';\nimport { styles } from '../styles';\n\nexport const TemplateListScreen = defineComponent({\n\tname: 'FonderieTemplateListScreen',\n\tprops: {\n\t\tclient: { type: Object as PropType<CourierAdminClient>, required: true },\n\t},\n\temits: {\n\t\t'select-template': (_template: ITemplateEntry) => true,\n\t},\n\tsetup(props, { emit }) {\n\t\tconst { templates, isLoading, error } = useTemplates(props.client);\n\n\t\tfunction renderRow(template: ITemplateEntry) {\n\t\t\treturn h('li', { key: `${template.type}:${template.locale ?? 'base'}`, style: styles.row }, [\n\t\t\t\th(\n\t\t\t\t\t'button',\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'button',\n\t\t\t\t\t\tstyle: styles.rowButton,\n\t\t\t\t\t\tonClick: () => emit('select-template', template),\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\th('span', { style: styles.type }, template.type),\n\t\t\t\t\t\th('span', { style: styles.locale }, template.locale ?? 'default locale'),\n\t\t\t\t\t\th('span', { style: template.active ? styles.active : styles.inactive }, [\n\t\t\t\t\t\t\th('span', { style: styles.dot }),\n\t\t\t\t\t\t\ttemplate.active ? 'active' : 'inactive',\n\t\t\t\t\t\t]),\n\t\t\t\t\t],\n\t\t\t\t),\n\t\t\t]);\n\t\t}\n\n\t\treturn () =>\n\t\t\th('div', { style: styles.listContainer }, [\n\t\t\t\th('h1', { style: styles.listTitle }, 'Templates'),\n\t\t\t\th(\n\t\t\t\t\t'p',\n\t\t\t\t\t{ style: styles.hint },\n\t\t\t\t\t'Every email the app sends. Open one to edit its copy and preview it live.',\n\t\t\t\t),\n\t\t\t\tisLoading.value\n\t\t\t\t\t? h('p', { style: styles.status }, 'Loading templates…')\n\t\t\t\t\t: error.value\n\t\t\t\t\t\t? h('p', { style: styles.error, role: 'alert' }, error.value.explanation)\n\t\t\t\t\t\t: h('ul', { style: styles.list }, templates.value.map(renderRow)),\n\t\t\t]);\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,+BAKO;AAEP,iBAAyD;;;ACXlD,IAAM,SAAwC;AAAA,EACpD,WA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E,QAAQ,EAAE,OAAO,SAAS,SAAS,OAAO,SAAS,OAAO,SAAS,GAAG;AAAA,kBACvE,eAAE,QAAQ,EAAE,OAAO,OAAO,IAAI,CAAC;AAAA,cAC/B,SAAS,SAAS,WAAW;AAAA,YAC9B,CAAC;AAAA,UACF;AAAA,QACD;AAAA,MACD,CAAC;AAAA,IACF;AAEA,WAAO,UACN,eAAE,OAAO,EAAE,OAAO,OAAO,cAAc,GAAG;AAAA,UACzC,eAAE,MAAM,EAAE,OAAO,OAAO,UAAU,GAAG,WAAW;AAAA,UAChD;AAAA,QACC;AAAA,QACA,EAAE,OAAO,OAAO,KAAK;AAAA,QACrB;AAAA,MACD;AAAA,MACA,UAAU,YACP,eAAE,KAAK,EAAE,OAAO,OAAO,OAAO,GAAG,yBAAoB,IACrD,MAAM,YACL,eAAE,KAAK,EAAE,OAAO,OAAO,OAAO,MAAM,QAAQ,GAAG,MAAM,MAAM,WAAW,QACtE,eAAE,MAAM,EAAE,OAAO,OAAO,KAAK,GAAG,UAAU,MAAM,IAAI,SAAS,CAAC;AAAA,IACnE,CAAC;AAAA,EACH;AACD,CAAC;","names":["import_vue_courier_admin","import_vue"]}
package/dist/index.js CHANGED
@@ -9,13 +9,24 @@ import { computed, defineComponent, h, ref, watch } from "vue";
9
9
 
10
10
  // src/styles.ts
11
11
  var styles = {
12
- container: { padding: "24px" },
12
+ container: { padding: "8px 40px 64px", maxWidth: "1400px", boxSizing: "border-box" },
13
13
  // Two columns, always: editor left, rendered result right. Stacking the
14
14
  // preview under a long form hid it below the fold.
15
- split: { display: "grid", gridTemplateColumns: "minmax(0, 1fr) minmax(0, 1fr)", gap: "24px", alignItems: "start" },
15
+ split: {
16
+ display: "grid",
17
+ gridTemplateColumns: "minmax(0, 1fr) minmax(0, 1fr)",
18
+ gap: "24px",
19
+ alignItems: "start"
20
+ },
16
21
  column: { minWidth: "0", display: "flex", flexDirection: "column" },
17
22
  // Pinned while the form scrolls, so the preview stays in view as you edit.
18
- previewColumn: { minWidth: "0", display: "flex", flexDirection: "column", position: "sticky", top: "16px" },
23
+ previewColumn: {
24
+ minWidth: "0",
25
+ display: "flex",
26
+ flexDirection: "column",
27
+ position: "sticky",
28
+ top: "16px"
29
+ },
19
30
  saveRow: { display: "flex", alignItems: "center", gap: "12px", marginTop: "16px" },
20
31
  previewHeader: {
21
32
  display: "flex",
@@ -29,7 +40,8 @@ var styles = {
29
40
  height: "520px",
30
41
  border: "1px solid var(--fonderie-border,#e0e0e0)",
31
42
  borderRadius: "8px",
32
- background: "var(--fonderie-surface,#fff)"
43
+ background: "var(--fonderie-surface,#fff)",
44
+ boxShadow: "var(--fonderie-shadow-card,0 2px 3px 0 rgba(0,0,0,.05))"
33
45
  },
34
46
  previewText: {
35
47
  whiteSpace: "pre-wrap",
@@ -39,36 +51,117 @@ var styles = {
39
51
  fontSize: "13px",
40
52
  fontFamily: 'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace)'
41
53
  },
42
- title: { fontSize: "24px", fontWeight: 700 },
43
- subtitle: { fontSize: "16px", fontWeight: 600, marginBottom: "8px" },
44
- meta: { fontSize: "13px", color: "var(--fonderie-text-muted,#5c5c5c)", marginBottom: "16px" },
45
- status: { padding: "24px", textAlign: "center", color: "var(--fonderie-text-muted,#5c5c5c)" },
46
- error: { color: "var(--fonderie-danger,#e00)", marginBottom: "12px", fontSize: "14px" },
47
- list: { listStyle: "none", padding: "0", margin: "0" },
54
+ title: {
55
+ fontSize: "22px",
56
+ fontWeight: 600,
57
+ margin: "8px 0 4px",
58
+ letterSpacing: "var(--fonderie-tracking-display,-0.05em)",
59
+ lineHeight: 1.25
60
+ },
61
+ subtitle: {
62
+ fontSize: "15px",
63
+ fontWeight: 600,
64
+ margin: "0 0 10px",
65
+ letterSpacing: "var(--fonderie-tracking-display,-0.05em)"
66
+ },
67
+ meta: { fontSize: "13px", color: "var(--fonderie-text-muted,#5c5c5c)", marginBottom: "20px" },
68
+ status: { padding: "24px 0", color: "var(--fonderie-text-muted,#5c5c5c)", fontSize: "13.5px" },
69
+ error: {
70
+ color: "var(--fonderie-danger,#e00)",
71
+ background: "color-mix(in srgb, var(--fonderie-danger,#e00) 8%, transparent)",
72
+ borderRadius: "6px",
73
+ padding: "8px 12px",
74
+ margin: "8px 0",
75
+ fontSize: "13.5px"
76
+ },
77
+ list: {
78
+ listStyle: "none",
79
+ padding: "0",
80
+ margin: "0",
81
+ background: "var(--fonderie-surface,#fff)",
82
+ border: "1px solid var(--fonderie-border,#e0e0e0)",
83
+ borderRadius: "var(--fonderie-radius-lg,8px)",
84
+ overflow: "hidden",
85
+ boxShadow: "var(--fonderie-shadow-card,0 2px 3px 0 rgba(0,0,0,.05))"
86
+ },
48
87
  row: { borderBottom: "1px solid var(--fonderie-border-light,#f5f5f5)" },
49
88
  rowButton: {
50
89
  width: "100%",
51
90
  display: "flex",
52
91
  justifyContent: "space-between",
53
92
  alignItems: "center",
54
- padding: "12px 0",
93
+ gap: "16px",
94
+ padding: "13px 16px",
55
95
  background: "none",
56
96
  border: "none",
57
97
  cursor: "pointer",
58
- textAlign: "left"
98
+ textAlign: "left",
99
+ color: "var(--fonderie-text,#171717)",
100
+ fontFamily: "inherit"
101
+ },
102
+ type: {
103
+ fontSize: "13px",
104
+ fontWeight: 600,
105
+ flex: "1",
106
+ fontFamily: 'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace)'
107
+ },
108
+ locale: { fontSize: "12.5px", color: "var(--fonderie-text-muted,#5c5c5c)" },
109
+ active: {
110
+ display: "inline-flex",
111
+ alignItems: "center",
112
+ gap: "6px",
113
+ borderRadius: "999px",
114
+ padding: "2px 9px 2px 8px",
115
+ fontSize: "12px",
116
+ fontWeight: 600,
117
+ lineHeight: 1.5,
118
+ minWidth: "64px",
119
+ color: "var(--fonderie-accent-strong,#009767)",
120
+ background: "color-mix(in srgb, var(--fonderie-accent-strong,#009767) 13%, transparent)"
121
+ },
122
+ inactive: {
123
+ display: "inline-flex",
124
+ alignItems: "center",
125
+ gap: "6px",
126
+ borderRadius: "999px",
127
+ padding: "2px 9px 2px 8px",
128
+ fontSize: "12px",
129
+ fontWeight: 600,
130
+ lineHeight: 1.5,
131
+ minWidth: "64px",
132
+ color: "var(--fonderie-text-muted,#5c5c5c)",
133
+ background: "color-mix(in srgb, var(--fonderie-text-muted,#5c5c5c) 10%, transparent)"
134
+ },
135
+ form: {
136
+ display: "flex",
137
+ flexDirection: "column",
138
+ gap: "4px",
139
+ background: "var(--fonderie-surface,#fff)",
140
+ border: "1px solid var(--fonderie-border,#e0e0e0)",
141
+ borderRadius: "var(--fonderie-radius-lg,8px)",
142
+ padding: "6px 20px 20px",
143
+ boxShadow: "var(--fonderie-shadow-card,0 2px 3px 0 rgba(0,0,0,.05))"
144
+ },
145
+ label: { fontSize: "13px", fontWeight: 500, marginTop: "14px", marginBottom: "2px" },
146
+ input: {
147
+ height: "36px",
148
+ boxSizing: "border-box",
149
+ border: "1px solid var(--fonderie-border,#e0e0e0)",
150
+ borderRadius: "6px",
151
+ padding: "0 10px",
152
+ fontSize: "13.5px",
153
+ fontFamily: "inherit",
154
+ background: "var(--fonderie-surface,#fff)",
155
+ color: "var(--fonderie-text,#171717)"
59
156
  },
60
- type: { fontSize: "14px", fontWeight: 600, flex: "1" },
61
- locale: { fontSize: "13px", color: "var(--fonderie-text-muted,#5c5c5c)", marginRight: "16px" },
62
- active: { fontSize: "12px", color: "var(--fonderie-accent-strong,#009767)" },
63
- inactive: { fontSize: "12px", color: "var(--fonderie-text-muted,#5c5c5c)" },
64
- form: { display: "flex", flexDirection: "column", gap: "4px" },
65
- label: { fontSize: "13px", fontWeight: 600, marginTop: "12px" },
66
- input: { border: "1px solid var(--fonderie-border,#e0e0e0)", borderRadius: "8px", padding: "10px", fontSize: "14px" },
67
157
  textarea: {
68
158
  border: "1px solid var(--fonderie-border,#e0e0e0)",
69
- borderRadius: "8px",
159
+ borderRadius: "6px",
70
160
  padding: "10px",
71
- fontSize: "14px",
161
+ fontSize: "13px",
162
+ lineHeight: 1.55,
163
+ background: "var(--fonderie-surface,#fff)",
164
+ color: "var(--fonderie-text,#171717)",
72
165
  fontFamily: 'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace)'
73
166
  },
74
167
  checkboxLabel: {
@@ -79,44 +172,75 @@ var styles = {
79
172
  fontSize: "14px"
80
173
  },
81
174
  button: {
175
+ display: "inline-flex",
176
+ alignItems: "center",
177
+ height: "36px",
178
+ boxSizing: "border-box",
82
179
  backgroundColor: "var(--fonderie-text,#171717)",
83
180
  color: "var(--fonderie-surface,#fff)",
84
- padding: "10px 20px",
85
- borderRadius: "8px",
86
- border: "none",
87
- fontSize: "14px",
181
+ padding: "0 16px",
182
+ borderRadius: "6px",
183
+ border: "1px solid var(--fonderie-text,#171717)",
184
+ fontSize: "13.5px",
88
185
  fontWeight: 600,
89
- cursor: "pointer",
90
- alignSelf: "flex-start"
186
+ fontFamily: "inherit",
187
+ alignSelf: "flex-start",
188
+ cursor: "pointer"
91
189
  },
92
190
  buttonDisabled: {
93
- backgroundColor: "var(--fonderie-border,#e0e0e0)",
94
- color: "var(--fonderie-text-muted,#5c5c5c)",
95
- padding: "10px 20px",
96
- borderRadius: "8px",
97
- border: "none",
98
- fontSize: "14px",
191
+ display: "inline-flex",
192
+ alignItems: "center",
193
+ height: "36px",
194
+ boxSizing: "border-box",
195
+ backgroundColor: "var(--fonderie-text,#171717)",
196
+ color: "var(--fonderie-surface,#fff)",
197
+ padding: "0 16px",
198
+ borderRadius: "6px",
199
+ border: "1px solid var(--fonderie-text,#171717)",
200
+ fontSize: "13.5px",
99
201
  fontWeight: 600,
100
- cursor: "not-allowed",
101
- alignSelf: "flex-start"
202
+ fontFamily: "inherit",
203
+ alignSelf: "flex-start",
204
+ opacity: 0.45,
205
+ cursor: "not-allowed"
102
206
  },
103
207
  revisions: { marginTop: "32px" },
104
208
  revisionRow: {
105
209
  display: "flex",
106
210
  justifyContent: "space-between",
107
211
  alignItems: "center",
108
- padding: "8px 0",
212
+ gap: "12px",
213
+ padding: "9px 16px",
109
214
  borderBottom: "1px solid var(--fonderie-border-light,#f5f5f5)",
110
215
  fontSize: "13px"
111
216
  },
112
217
  rollbackButton: {
113
- background: "none",
218
+ display: "inline-flex",
219
+ alignItems: "center",
220
+ height: "28px",
221
+ boxSizing: "border-box",
222
+ background: "var(--fonderie-surface,#fff)",
223
+ color: "var(--fonderie-text,#171717)",
114
224
  border: "1px solid var(--fonderie-border,#e0e0e0)",
115
- borderRadius: "8px",
116
- padding: "4px 10px",
117
- fontSize: "12px",
225
+ borderRadius: "6px",
226
+ padding: "0 10px",
227
+ fontSize: "12.5px",
228
+ fontWeight: 500,
229
+ fontFamily: "inherit",
118
230
  cursor: "pointer"
119
- }
231
+ },
232
+ // Template list: matches @fonderie/vue-admin-screens' shell look with local
233
+ // values — this package sits below the admin screens and cannot import them.
234
+ listContainer: { padding: "32px 40px 64px", maxWidth: "1160px", boxSizing: "border-box" },
235
+ listTitle: {
236
+ fontSize: "22px",
237
+ fontWeight: 600,
238
+ margin: "0",
239
+ letterSpacing: "var(--fonderie-tracking-display,-0.05em)",
240
+ lineHeight: 1.25
241
+ },
242
+ hint: { fontSize: "13.5px", color: "var(--fonderie-text-muted,#5c5c5c)", margin: "4px 0 24px" },
243
+ dot: { width: "6px", height: "6px", borderRadius: "999px", background: "currentColor" }
120
244
  };
121
245
 
122
246
  // src/screens/TemplateEditorScreen.ts
@@ -369,25 +493,24 @@ var TemplateListScreen = defineComponent2({
369
493
  },
370
494
  [
371
495
  h2("span", { style: styles.type }, template.type),
372
- h2("span", { style: styles.locale }, template.locale ?? "base"),
373
- h2(
374
- "span",
375
- { style: template.active ? styles.active : styles.inactive },
376
- template.active ? "Active" : "Inactive"
377
- )
496
+ h2("span", { style: styles.locale }, template.locale ?? "default locale"),
497
+ h2("span", { style: template.active ? styles.active : styles.inactive }, [
498
+ h2("span", { style: styles.dot }),
499
+ template.active ? "active" : "inactive"
500
+ ])
378
501
  ]
379
502
  )
380
503
  ]);
381
504
  }
382
- return () => {
383
- if (isLoading.value) return h2("p", { style: styles.status }, "Loading templates\u2026");
384
- if (error.value)
385
- return h2("p", { style: styles.error, role: "alert" }, error.value.explanation);
386
- return h2("div", { style: styles.container }, [
387
- h2("h1", { style: styles.title }, "Templates"),
388
- h2("ul", { style: styles.list }, templates.value.map(renderRow))
389
- ]);
390
- };
505
+ return () => h2("div", { style: styles.listContainer }, [
506
+ h2("h1", { style: styles.listTitle }, "Templates"),
507
+ h2(
508
+ "p",
509
+ { style: styles.hint },
510
+ "Every email the app sends. Open one to edit its copy and preview it live."
511
+ ),
512
+ isLoading.value ? h2("p", { style: styles.status }, "Loading templates\u2026") : error.value ? h2("p", { style: styles.error, role: "alert" }, error.value.explanation) : h2("ul", { style: styles.list }, templates.value.map(renderRow))
513
+ ]);
391
514
  }
392
515
  });
393
516
  export {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/screens/TemplateEditorScreen.ts","../src/styles.ts","../src/screens/TemplateListScreen.ts"],"sourcesContent":["import type {\n\tCourierAdminClient,\n\tFonderieApiError,\n\tISetTemplateInput,\n\tITemplateRevision,\n} from '@fonderie/client';\nimport {\n\tuseTemplate,\n\tuseTemplatePreview,\n\tuseTemplateRevisions,\n\tuseTemplates,\n} from '@fonderie/vue-courier-admin';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent, h, ref, watch } from 'vue';\n\nconst PREVIEW_DEBOUNCE_MS = 500;\nimport { styles } from '../styles';\n\n// Implicit variables the layout injects — an operator never supplies these, so\n// offering them as fields would just be noise.\nconst IMPLICIT = new Set(['subject', 'preheader', 'brandName']);\n\nexport const TemplateEditorScreen = defineComponent({\n\tname: 'FonderieTemplateEditorScreen',\n\tprops: {\n\t\tclient: { type: Object as PropType<CourierAdminClient>, required: true },\n\t\ttype: { type: String, required: true },\n\t\tlocale: { type: String as PropType<string | null>, default: null },\n\t},\n\temits: {\n\t\tsaved: () => true,\n\t},\n\tsetup(props, { emit }) {\n\t\tconst { template, isLoading, error, refresh } = useTemplate(\n\t\t\tprops.client,\n\t\t\tprops.type,\n\t\t\tprops.locale,\n\t\t);\n\t\t// Saves go through the list composable (which re-fetches the template list\n\t\t// after each write); mounting it adds a template-list fetch to this\n\t\t// single-template editor — acceptable for an admin dashboard. Its\n\t\t// isLoading/error track that list fetch, so the save action keeps local state.\n\t\tconst { saveTemplate } = useTemplates(props.client);\n\t\tconst { revisions, rollback } = useTemplateRevisions(props.client, props.type, props.locale);\n\t\tconst isSaving = ref(false);\n\t\tconst saveError = ref<FonderieApiError | null>(null);\n\n\t\tconst subject = ref('');\n\t\tconst html = ref('');\n\t\tconst text = ref('');\n\t\tconst active = ref(true);\n\n\t\twatch(template, (tpl) => {\n\t\t\tif (!tpl) return;\n\t\t\tsubject.value = tpl.subject ?? '';\n\t\t\thtml.value = tpl.html ?? '';\n\t\t\ttext.value = tpl.text;\n\t\t\tactive.value = tpl.active;\n\t\t});\n\n\t\tconst {\n\t\t\tpreview,\n\t\t\tisPreviewing,\n\t\t\terror: previewError,\n\t\t\trenderPreview,\n\t\t} = useTemplatePreview(props.client);\n\t\t// Sample values as JSON text rather than an object, so a half-typed value\n\t\t// does not have to parse on every keystroke.\n\t\tconst sampleJson = ref('{}');\n\t\tconst sampleError = ref<string | null>(null);\n\n\t\tasync function run() {\n\t\t\tlet data: Record<string, unknown> = {};\n\t\t\ttry {\n\t\t\t\tconst parsed: unknown = JSON.parse(sampleJson.value || '{}');\n\t\t\t\tif (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {\n\t\t\t\t\tsampleError.value = 'Sample data must be a JSON object.';\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdata = parsed as Record<string, unknown>;\n\t\t\t\tsampleError.value = null;\n\t\t\t} catch {\n\t\t\t\tsampleError.value = 'Sample data is not valid JSON.';\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst result = await renderPreview(\n\t\t\t\tprops.type,\n\t\t\t\t{\n\t\t\t\t\ttext: text.value,\n\t\t\t\t\tdata,\n\t\t\t\t\t...(subject.value ? { subject: subject.value } : {}),\n\t\t\t\t\t...(html.value ? { html: html.value } : {}),\n\t\t\t\t},\n\t\t\t\tprops.locale,\n\t\t\t);\n\t\t\t// The server reports which variables this content uses; seed the ones\n\t\t\t// with no value yet with their own name so the render shows where each\n\t\t\t// lands. Never overwrite something already typed.\n\t\t\tconst missing = result.variables.filter((v) => !IMPLICIT.has(v) && !(v in data));\n\t\t\tif (missing.length > 0) {\n\t\t\t\tsampleJson.value = JSON.stringify(\n\t\t\t\t\t{ ...data, ...Object.fromEntries(missing.map((v) => [v, v])) },\n\t\t\t\t\tnull,\n\t\t\t\t\t2,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// The preview is always live: it renders once the template loads, then\n\t\t// again PREVIEW_DEBOUNCE_MS after the last edit to the content or the sample\n\t\t// data — debounced, so typing a paragraph costs one request, not one per key.\n\t\tlet previewTimer: ReturnType<typeof setTimeout> | undefined;\n\t\twatch([template, subject, html, text, sampleJson], () => {\n\t\t\tif (!template.value) return;\n\t\t\tclearTimeout(previewTimer);\n\t\t\tpreviewTimer = setTimeout(() => void run(), PREVIEW_DEBOUNCE_MS);\n\t\t});\n\n\t\t// Saving what is already stored would only mint an identical version (the\n\t\t// server treats it as a no-op anyway), so Save waits for a real change.\n\t\tconst dirty = computed(() => {\n\t\t\tconst tpl = template.value;\n\t\t\treturn (\n\t\t\t\t!!tpl &&\n\t\t\t\t(subject.value !== (tpl.subject ?? '') ||\n\t\t\t\t\thtml.value !== (tpl.html ?? '') ||\n\t\t\t\t\ttext.value !== tpl.text ||\n\t\t\t\t\tactive.value !== tpl.active)\n\t\t\t);\n\t\t});\n\n\t\tasync function handleSubmit(event: Event) {\n\t\t\tevent.preventDefault();\n\t\t\tisSaving.value = true;\n\t\t\tsaveError.value = null;\n\t\t\ttry {\n\t\t\t\tconst input: ISetTemplateInput = { text: text.value, active: active.value };\n\t\t\t\tif (subject.value) input.subject = subject.value;\n\t\t\t\tif (html.value) input.html = html.value;\n\t\t\t\tif (template.value?.version !== undefined) input.ifVersion = template.value.version;\n\t\t\t\tawait saveTemplate(props.type, input, props.locale);\n\t\t\t\t// The list composable refreshes its own list; this screen renders the\n\t\t\t\t// single template, so re-read it too.\n\t\t\t\tawait refresh();\n\t\t\t\temit('saved');\n\t\t\t} catch (err) {\n\t\t\t\t// useTemplates normalizes every failure to FonderieApiError before throwing.\n\t\t\t\tsaveError.value = err as FonderieApiError;\n\t\t\t} finally {\n\t\t\t\tisSaving.value = false;\n\t\t\t}\n\t\t}\n\n\t\tfunction renderRevision(rev: ITemplateRevision) {\n\t\t\treturn h('li', { key: rev.version, style: styles.revisionRow }, [\n\t\t\t\th(\n\t\t\t\t\t'span',\n\t\t\t\t\t`v${rev.version} — ${rev.actor ?? 'unknown'} — ${new Date(rev.createdAt).toLocaleString()}`,\n\t\t\t\t),\n\t\t\t\th(\n\t\t\t\t\t'button',\n\t\t\t\t\t{ type: 'button', style: styles.rollbackButton, onClick: () => rollback(rev.version) },\n\t\t\t\t\t'Roll back',\n\t\t\t\t),\n\t\t\t]);\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (isLoading.value) return h('p', { style: styles.status }, 'Loading template…');\n\t\t\tif (error.value)\n\t\t\t\treturn h('p', { style: styles.error, role: 'alert' }, error.value.explanation);\n\n\t\t\treturn h('div', { style: styles.container }, [\n\t\t\t\th('h1', { style: styles.title }, props.type),\n\t\t\t\th(\n\t\t\t\t\t'p',\n\t\t\t\t\t{ style: styles.meta },\n\t\t\t\t\t`${props.locale ?? 'base'} · v${template.value?.version ?? 1}`,\n\t\t\t\t),\n\t\t\t\th('div', { style: styles.split }, [\n\t\t\t\th('div', { style: styles.column }, [\n\t\t\t\th('form', { style: styles.form, onSubmit: handleSubmit }, [\n\t\t\t\t\th('label', { style: styles.label, for: 'template-subject' }, 'Subject'),\n\t\t\t\t\th('input', {\n\t\t\t\t\t\tid: 'template-subject',\n\t\t\t\t\t\tstyle: styles.input,\n\t\t\t\t\t\tvalue: subject.value,\n\t\t\t\t\t\tonInput: (e: Event) => {\n\t\t\t\t\t\t\tsubject.value = (e.target as HTMLInputElement).value;\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\th('label', { style: styles.label, for: 'template-html' }, 'HTML body'),\n\t\t\t\t\th('textarea', {\n\t\t\t\t\t\tid: 'template-html',\n\t\t\t\t\t\tstyle: styles.textarea,\n\t\t\t\t\t\trows: 8,\n\t\t\t\t\t\tvalue: html.value,\n\t\t\t\t\t\tonInput: (e: Event) => {\n\t\t\t\t\t\t\thtml.value = (e.target as HTMLTextAreaElement).value;\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\th('label', { style: styles.label, for: 'template-text' }, 'Plain-text body'),\n\t\t\t\t\th('textarea', {\n\t\t\t\t\t\tid: 'template-text',\n\t\t\t\t\t\tstyle: styles.textarea,\n\t\t\t\t\t\trows: 4,\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tvalue: text.value,\n\t\t\t\t\t\tonInput: (e: Event) => {\n\t\t\t\t\t\t\ttext.value = (e.target as HTMLTextAreaElement).value;\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\th('label', { style: styles.checkboxLabel }, [\n\t\t\t\t\t\th('input', {\n\t\t\t\t\t\t\ttype: 'checkbox',\n\t\t\t\t\t\t\tchecked: active.value,\n\t\t\t\t\t\t\tonChange: (e: Event) => {\n\t\t\t\t\t\t\t\tactive.value = (e.target as HTMLInputElement).checked;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t'Active',\n\t\t\t\t\t]),\n\t\t\t\t\tsaveError.value\n\t\t\t\t\t\t? h('p', { style: styles.error, role: 'alert' }, saveError.value.explanation)\n\t\t\t\t\t\t: null,\n\t\t\t\t\th('div', { style: styles.saveRow }, [\n\t\t\t\t\t\th(\n\t\t\t\t\t\t\t'button',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'submit',\n\t\t\t\t\t\t\t\tdisabled: isSaving.value || !dirty.value,\n\t\t\t\t\t\t\t\tstyle: dirty.value ? styles.button : styles.buttonDisabled,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tisSaving.value ? 'Saving…' : 'Save',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t!dirty.value && !isSaving.value ? h('span', { style: styles.meta }, 'No changes to save') : null,\n\t\t\t\t\t]),\n\t\t\t\t]),\n\t\t\t\th('label', { style: styles.label, for: 'template-sample' }, 'Sample data'),\n\t\t\t\th('textarea', {\n\t\t\t\t\tid: 'template-sample',\n\t\t\t\t\tstyle: styles.textarea,\n\t\t\t\t\trows: 6,\n\t\t\t\t\tspellcheck: false,\n\t\t\t\t\tvalue: sampleJson.value,\n\t\t\t\t\tonInput: (e: Event) => {\n\t\t\t\t\t\tsampleJson.value = (e.target as HTMLTextAreaElement).value;\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tsampleError.value\n\t\t\t\t\t? h('p', { style: styles.error, role: 'alert' }, sampleError.value)\n\t\t\t\t\t: null,\n\t\t\t\t]),\n\t\t\t\th('div', { style: styles.previewColumn }, [\n\t\t\t\t\th('div', { style: styles.previewHeader }, [\n\t\t\t\t\t\th('span', { style: styles.label }, 'Preview'),\n\t\t\t\t\t\th('span', { style: styles.meta }, isPreviewing.value ? 'Rendering…' : 'Live'),\n\t\t\t\t\t]),\n\t\t\t\t\tpreviewError.value\n\t\t\t\t\t\t? h('p', { style: styles.error, role: 'alert' }, previewError.value.explanation)\n\t\t\t\t\t\t: null,\n\t\t\t\t\tpreview.value?.subject\n\t\t\t\t\t\t? h('p', { style: styles.previewSubject }, preview.value.subject)\n\t\t\t\t\t\t: null,\n\t\t\t\t\tpreview.value?.html\n\t\t\t\t\t\t? // sandbox= — no scripts, no same-origin. Operator-authored HTML\n\t\t\t\t\t\t\t// must never execute in the dashboard's origin, where the admin\n\t\t\t\t\t\t\t// token lives.\n\t\t\t\t\t\t\th('iframe', {\n\t\t\t\t\t\t\t\ttitle: 'Template preview',\n\t\t\t\t\t\t\t\tstyle: styles.previewFrame,\n\t\t\t\t\t\t\t\tsandbox: '',\n\t\t\t\t\t\t\t\tsrcdoc: preview.value.html,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t: preview.value\n\t\t\t\t\t\t\t? h('pre', { style: styles.previewText }, preview.value.text)\n\t\t\t\t\t\t\t: h('p', { style: styles.meta }, 'Nothing rendered yet.'),\n\t\t\t\t]),\n\t\t\t\t]),\n\t\t\t\trevisions.value.length > 0\n\t\t\t\t\t? h('div', { style: styles.revisions }, [\n\t\t\t\t\t\t\th('h2', { style: styles.subtitle }, 'History'),\n\t\t\t\t\t\t\th('ul', { style: styles.list }, revisions.value.map(renderRevision)),\n\t\t\t\t\t\t])\n\t\t\t\t\t: null,\n\t\t\t]);\n\t\t};\n\t},\n});\n","import type { CSSProperties } from 'vue';\n\nexport const styles: Record<string, CSSProperties> = {\n\tcontainer: { padding: '24px' },\n\t// Two columns, always: editor left, rendered result right. Stacking the\n\t// preview under a long form hid it below the fold.\n\tsplit: { display: 'grid', gridTemplateColumns: 'minmax(0, 1fr) minmax(0, 1fr)', gap: '24px', alignItems: 'start' },\n\tcolumn: { minWidth: '0', display: 'flex', flexDirection: 'column' },\n\t// Pinned while the form scrolls, so the preview stays in view as you edit.\n\tpreviewColumn: { minWidth: '0', display: 'flex', flexDirection: 'column', position: 'sticky', top: '16px' },\n\tsaveRow: { display: 'flex', alignItems: 'center', gap: '12px', marginTop: '16px' },\n\tpreviewHeader: {\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'space-between',\n\t\talignItems: 'center',\n\t\tmarginTop: '12px',\n\t},\n\tpreviewSubject: { fontSize: '14px', fontWeight: '600', margin: '8px 0' },\n\tpreviewFrame: {\n\t\twidth: '100%',\n\t\theight: '520px',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '8px',\n\t\tbackground: 'var(--fonderie-surface,#fff)',\n\t},\n\tpreviewText: {\n\t\twhiteSpace: 'pre-wrap',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '8px',\n\t\tpadding: '12px',\n\t\tfontSize: '13px',\n\t\tfontFamily: 'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace)',\n\t},\n\ttitle: { fontSize: '24px', fontWeight: 700 },\n\tsubtitle: { fontSize: '16px', fontWeight: 600, marginBottom: '8px' },\n\tmeta: { fontSize: '13px', color: 'var(--fonderie-text-muted,#5c5c5c)', marginBottom: '16px' },\n\tstatus: { padding: '24px', textAlign: 'center', color: 'var(--fonderie-text-muted,#5c5c5c)' },\n\terror: { color: 'var(--fonderie-danger,#e00)', marginBottom: '12px', fontSize: '14px' },\n\tlist: { listStyle: 'none', padding: '0', margin: '0' },\n\trow: { borderBottom: '1px solid var(--fonderie-border-light,#f5f5f5)' },\n\trowButton: {\n\t\twidth: '100%',\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'space-between',\n\t\talignItems: 'center',\n\t\tpadding: '12px 0',\n\t\tbackground: 'none',\n\t\tborder: 'none',\n\t\tcursor: 'pointer',\n\t\ttextAlign: 'left',\n\t},\n\ttype: { fontSize: '14px', fontWeight: 600, flex: '1' },\n\tlocale: { fontSize: '13px', color: 'var(--fonderie-text-muted,#5c5c5c)', marginRight: '16px' },\n\tactive: { fontSize: '12px', color: 'var(--fonderie-accent-strong,#009767)' },\n\tinactive: { fontSize: '12px', color: 'var(--fonderie-text-muted,#5c5c5c)' },\n\tform: { display: 'flex', flexDirection: 'column', gap: '4px' },\n\tlabel: { fontSize: '13px', fontWeight: 600, marginTop: '12px' },\n\tinput: { border: '1px solid var(--fonderie-border,#e0e0e0)', borderRadius: '8px', padding: '10px', fontSize: '14px' },\n\ttextarea: {\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '8px',\n\t\tpadding: '10px',\n\t\tfontSize: '14px',\n\t\tfontFamily: 'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace)',\n\t},\n\tcheckboxLabel: {\n\t\tdisplay: 'flex',\n\t\talignItems: 'center',\n\t\tgap: '8px',\n\t\tmarginTop: '12px',\n\t\tfontSize: '14px',\n\t},\n\tbutton: {\n\t\tbackgroundColor: 'var(--fonderie-text,#171717)',\n\t\tcolor: 'var(--fonderie-surface,#fff)',\n\t\tpadding: '10px 20px',\n\t\tborderRadius: '8px',\n\t\tborder: 'none',\n\t\tfontSize: '14px',\n\t\tfontWeight: 600,\n\t\tcursor: 'pointer',\n\t\talignSelf: 'flex-start',\n\t},\n\tbuttonDisabled: {\n\t\tbackgroundColor: 'var(--fonderie-border,#e0e0e0)',\n\t\tcolor: 'var(--fonderie-text-muted,#5c5c5c)',\n\t\tpadding: '10px 20px',\n\t\tborderRadius: '8px',\n\t\tborder: 'none',\n\t\tfontSize: '14px',\n\t\tfontWeight: 600,\n\t\tcursor: 'not-allowed',\n\t\talignSelf: 'flex-start',\n\t},\n\trevisions: { marginTop: '32px' },\n\trevisionRow: {\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'space-between',\n\t\talignItems: 'center',\n\t\tpadding: '8px 0',\n\t\tborderBottom: '1px solid var(--fonderie-border-light,#f5f5f5)',\n\t\tfontSize: '13px',\n\t},\n\trollbackButton: {\n\t\tbackground: 'none',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '8px',\n\t\tpadding: '4px 10px',\n\t\tfontSize: '12px',\n\t\tcursor: 'pointer',\n\t},\n};\n","import type { CourierAdminClient, ITemplateEntry } from '@fonderie/client';\nimport { useTemplates } from '@fonderie/vue-courier-admin';\nimport type { PropType } from 'vue';\nimport { defineComponent, h } from 'vue';\nimport { styles } from '../styles';\n\nexport const TemplateListScreen = defineComponent({\n\tname: 'FonderieTemplateListScreen',\n\tprops: {\n\t\tclient: { type: Object as PropType<CourierAdminClient>, required: true },\n\t},\n\temits: {\n\t\t'select-template': (_template: ITemplateEntry) => true,\n\t},\n\tsetup(props, { emit }) {\n\t\tconst { templates, isLoading, error } = useTemplates(props.client);\n\n\t\tfunction renderRow(template: ITemplateEntry) {\n\t\t\treturn h('li', { key: `${template.type}:${template.locale ?? 'base'}`, style: styles.row }, [\n\t\t\t\th(\n\t\t\t\t\t'button',\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'button',\n\t\t\t\t\t\tstyle: styles.rowButton,\n\t\t\t\t\t\tonClick: () => emit('select-template', template),\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\th('span', { style: styles.type }, template.type),\n\t\t\t\t\t\th('span', { style: styles.locale }, template.locale ?? 'base'),\n\t\t\t\t\t\th(\n\t\t\t\t\t\t\t'span',\n\t\t\t\t\t\t\t{ style: template.active ? styles.active : styles.inactive },\n\t\t\t\t\t\t\ttemplate.active ? 'Active' : 'Inactive',\n\t\t\t\t\t\t),\n\t\t\t\t\t],\n\t\t\t\t),\n\t\t\t]);\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (isLoading.value) return h('p', { style: styles.status }, 'Loading templates…');\n\t\t\tif (error.value)\n\t\t\t\treturn h('p', { style: styles.error, role: 'alert' }, error.value.explanation);\n\n\t\t\treturn h('div', { style: styles.container }, [\n\t\t\t\th('h1', { style: styles.title }, 'Templates'),\n\t\t\t\th('ul', { style: styles.list }, templates.value.map(renderRow)),\n\t\t\t]);\n\t\t};\n\t},\n});\n"],"mappings":";AAMA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEP,SAAS,UAAU,iBAAiB,GAAG,KAAK,aAAa;;;ACXlD,IAAM,SAAwC;AAAA,E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OAAO,MAAM,GAAG,WAAW;AAAA,QAC5CA,GAAE,MAAM,EAAE,OAAO,OAAO,KAAK,GAAG,UAAU,MAAM,IAAI,SAAS,CAAC;AAAA,MAC/D,CAAC;AAAA,IACF;AAAA,EACD;AACD,CAAC;","names":["useTemplates","defineComponent","h","defineComponent","useTemplates","h"]}
1
+ {"version":3,"sources":["../src/screens/TemplateEditorScreen.ts","../src/styles.ts","../src/screens/TemplateListScreen.ts"],"sourcesContent":["import type {\n\tCourierAdminClient,\n\tFonderieApiError,\n\tISetTemplateInput,\n\tITemplateRevision,\n} from '@fonderie/client';\nimport {\n\tuseTemplate,\n\tuseTemplatePreview,\n\tuseTemplateRevisions,\n\tuseTemplates,\n} from '@fonderie/vue-courier-admin';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent, h, ref, watch } from 'vue';\n\nconst PREVIEW_DEBOUNCE_MS = 500;\nimport { styles } from '../styles';\n\n// Implicit variables the layout injects — an operator never supplies these, so\n// offering them as fields would just be noise.\nconst IMPLICIT = new Set(['subject', 'preheader', 'brandName']);\n\nexport const TemplateEditorScreen = defineComponent({\n\tname: 'FonderieTemplateEditorScreen',\n\tprops: {\n\t\tclient: { type: Object as PropType<CourierAdminClient>, required: true },\n\t\ttype: { type: String, required: true },\n\t\tlocale: { type: String as PropType<string | null>, default: null },\n\t},\n\temits: {\n\t\tsaved: () => true,\n\t},\n\tsetup(props, { emit }) {\n\t\tconst { template, isLoading, error, refresh } = useTemplate(\n\t\t\tprops.client,\n\t\t\tprops.type,\n\t\t\tprops.locale,\n\t\t);\n\t\t// Saves go through the list composable (which re-fetches the template list\n\t\t// after each write); mounting it adds a template-list fetch to this\n\t\t// single-template editor — acceptable for an admin dashboard. Its\n\t\t// isLoading/error track that list fetch, so the save action keeps local state.\n\t\tconst { saveTemplate } = useTemplates(props.client);\n\t\tconst { revisions, rollback } = useTemplateRevisions(props.client, props.type, props.locale);\n\t\tconst isSaving = ref(false);\n\t\tconst saveError = ref<FonderieApiError | null>(null);\n\n\t\tconst subject = ref('');\n\t\tconst html = ref('');\n\t\tconst text = ref('');\n\t\tconst active = ref(true);\n\n\t\twatch(template, (tpl) => {\n\t\t\tif (!tpl) return;\n\t\t\tsubject.value = tpl.subject ?? '';\n\t\t\thtml.value = tpl.html ?? '';\n\t\t\ttext.value = tpl.text;\n\t\t\tactive.value = tpl.active;\n\t\t});\n\n\t\tconst {\n\t\t\tpreview,\n\t\t\tisPreviewing,\n\t\t\terror: previewError,\n\t\t\trenderPreview,\n\t\t} = useTemplatePreview(props.client);\n\t\t// Sample values as JSON text rather than an object, so a half-typed value\n\t\t// does not have to parse on every keystroke.\n\t\tconst sampleJson = ref('{}');\n\t\tconst sampleError = ref<string | null>(null);\n\n\t\tasync function run() {\n\t\t\tlet data: Record<string, unknown> = {};\n\t\t\ttry {\n\t\t\t\tconst parsed: unknown = JSON.parse(sampleJson.value || '{}');\n\t\t\t\tif (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {\n\t\t\t\t\tsampleError.value = 'Sample data must be a JSON object.';\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdata = parsed as Record<string, unknown>;\n\t\t\t\tsampleError.value = null;\n\t\t\t} catch {\n\t\t\t\tsampleError.value = 'Sample data is not valid JSON.';\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst result = await renderPreview(\n\t\t\t\tprops.type,\n\t\t\t\t{\n\t\t\t\t\ttext: text.value,\n\t\t\t\t\tdata,\n\t\t\t\t\t...(subject.value ? { subject: subject.value } : {}),\n\t\t\t\t\t...(html.value ? { html: html.value } : {}),\n\t\t\t\t},\n\t\t\t\tprops.locale,\n\t\t\t);\n\t\t\t// The server reports which variables this content uses; seed the ones\n\t\t\t// with no value yet with their own name so the render shows where each\n\t\t\t// lands. Never overwrite something already typed.\n\t\t\tconst missing = result.variables.filter((v) => !IMPLICIT.has(v) && !(v in data));\n\t\t\tif (missing.length > 0) {\n\t\t\t\tsampleJson.value = JSON.stringify(\n\t\t\t\t\t{ ...data, ...Object.fromEntries(missing.map((v) => [v, v])) },\n\t\t\t\t\tnull,\n\t\t\t\t\t2,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// The preview is always live: it renders once the template loads, then\n\t\t// again PREVIEW_DEBOUNCE_MS after the last edit to the content or the sample\n\t\t// data — debounced, so typing a paragraph costs one request, not one per key.\n\t\tlet previewTimer: ReturnType<typeof setTimeout> | undefined;\n\t\twatch([template, subject, html, text, sampleJson], () => {\n\t\t\tif (!template.value) return;\n\t\t\tclearTimeout(previewTimer);\n\t\t\tpreviewTimer = setTimeout(() => void run(), PREVIEW_DEBOUNCE_MS);\n\t\t});\n\n\t\t// Saving what is already stored would only mint an identical version (the\n\t\t// server treats it as a no-op anyway), so Save waits for a real change.\n\t\tconst dirty = computed(() => {\n\t\t\tconst tpl = template.value;\n\t\t\treturn (\n\t\t\t\t!!tpl &&\n\t\t\t\t(subject.value !== (tpl.subject ?? '') ||\n\t\t\t\t\thtml.value !== (tpl.html ?? '') ||\n\t\t\t\t\ttext.value !== tpl.text ||\n\t\t\t\t\tactive.value !== tpl.active)\n\t\t\t);\n\t\t});\n\n\t\tasync function handleSubmit(event: Event) {\n\t\t\tevent.preventDefault();\n\t\t\tisSaving.value = true;\n\t\t\tsaveError.value = null;\n\t\t\ttry {\n\t\t\t\tconst input: ISetTemplateInput = { text: text.value, active: active.value };\n\t\t\t\tif (subject.value) input.subject = subject.value;\n\t\t\t\tif (html.value) input.html = html.value;\n\t\t\t\tif (template.value?.version !== undefined) input.ifVersion = template.value.version;\n\t\t\t\tawait saveTemplate(props.type, input, props.locale);\n\t\t\t\t// The list composable refreshes its own list; this screen renders the\n\t\t\t\t// single template, so re-read it too.\n\t\t\t\tawait refresh();\n\t\t\t\temit('saved');\n\t\t\t} catch (err) {\n\t\t\t\t// useTemplates normalizes every failure to FonderieApiError before throwing.\n\t\t\t\tsaveError.value = err as FonderieApiError;\n\t\t\t} finally {\n\t\t\t\tisSaving.value = false;\n\t\t\t}\n\t\t}\n\n\t\tfunction renderRevision(rev: ITemplateRevision) {\n\t\t\treturn h('li', { key: rev.version, style: styles.revisionRow }, [\n\t\t\t\th(\n\t\t\t\t\t'span',\n\t\t\t\t\t`v${rev.version} — ${rev.actor ?? 'unknown'} — ${new Date(rev.createdAt).toLocaleString()}`,\n\t\t\t\t),\n\t\t\t\th(\n\t\t\t\t\t'button',\n\t\t\t\t\t{ type: 'button', style: styles.rollbackButton, onClick: () => rollback(rev.version) },\n\t\t\t\t\t'Roll back',\n\t\t\t\t),\n\t\t\t]);\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (isLoading.value) return h('p', { style: styles.status }, 'Loading template…');\n\t\t\tif (error.value)\n\t\t\t\treturn h('p', { style: styles.error, role: 'alert' }, error.value.explanation);\n\n\t\t\treturn h('div', { style: styles.container }, [\n\t\t\t\th('h1', { style: styles.title }, props.type),\n\t\t\t\th(\n\t\t\t\t\t'p',\n\t\t\t\t\t{ style: styles.meta },\n\t\t\t\t\t`${props.locale ?? 'base'} · v${template.value?.version ?? 1}`,\n\t\t\t\t),\n\t\t\t\th('div', { style: styles.split }, [\n\t\t\t\t\th('div', { style: styles.column }, [\n\t\t\t\t\t\th('form', { style: styles.form, onSubmit: handleSubmit }, [\n\t\t\t\t\t\t\th('label', { style: styles.label, for: 'template-subject' }, 'Subject'),\n\t\t\t\t\t\t\th('input', {\n\t\t\t\t\t\t\t\tid: 'template-subject',\n\t\t\t\t\t\t\t\tstyle: styles.input,\n\t\t\t\t\t\t\t\tvalue: subject.value,\n\t\t\t\t\t\t\t\tonInput: (e: Event) => {\n\t\t\t\t\t\t\t\t\tsubject.value = (e.target as HTMLInputElement).value;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\th('label', { style: styles.label, for: 'template-html' }, 'HTML body'),\n\t\t\t\t\t\t\th('textarea', {\n\t\t\t\t\t\t\t\tid: 'template-html',\n\t\t\t\t\t\t\t\tstyle: styles.textarea,\n\t\t\t\t\t\t\t\trows: 8,\n\t\t\t\t\t\t\t\tvalue: html.value,\n\t\t\t\t\t\t\t\tonInput: (e: Event) => {\n\t\t\t\t\t\t\t\t\thtml.value = (e.target as HTMLTextAreaElement).value;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\th('label', { style: styles.label, for: 'template-text' }, 'Plain-text body'),\n\t\t\t\t\t\t\th('textarea', {\n\t\t\t\t\t\t\t\tid: 'template-text',\n\t\t\t\t\t\t\t\tstyle: styles.textarea,\n\t\t\t\t\t\t\t\trows: 4,\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t\tvalue: text.value,\n\t\t\t\t\t\t\t\tonInput: (e: Event) => {\n\t\t\t\t\t\t\t\t\ttext.value = (e.target as HTMLTextAreaElement).value;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\th('label', { style: styles.checkboxLabel }, [\n\t\t\t\t\t\t\t\th('input', {\n\t\t\t\t\t\t\t\t\ttype: 'checkbox',\n\t\t\t\t\t\t\t\t\tchecked: active.value,\n\t\t\t\t\t\t\t\t\tonChange: (e: Event) => {\n\t\t\t\t\t\t\t\t\t\tactive.value = (e.target as HTMLInputElement).checked;\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t'Active',\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tsaveError.value\n\t\t\t\t\t\t\t\t? h('p', { style: styles.error, role: 'alert' }, saveError.value.explanation)\n\t\t\t\t\t\t\t\t: null,\n\t\t\t\t\t\t\th('div', { style: styles.saveRow }, [\n\t\t\t\t\t\t\t\th(\n\t\t\t\t\t\t\t\t\t'button',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'submit',\n\t\t\t\t\t\t\t\t\t\tdisabled: isSaving.value || !dirty.value,\n\t\t\t\t\t\t\t\t\t\tstyle: dirty.value ? styles.button : styles.buttonDisabled,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tisSaving.value ? 'Saving…' : 'Save',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t!dirty.value && !isSaving.value\n\t\t\t\t\t\t\t\t\t? h('span', { style: styles.meta }, 'No changes to save')\n\t\t\t\t\t\t\t\t\t: null,\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\th('label', { style: styles.label, for: 'template-sample' }, 'Sample data'),\n\t\t\t\t\t\th('textarea', {\n\t\t\t\t\t\t\tid: 'template-sample',\n\t\t\t\t\t\t\tstyle: styles.textarea,\n\t\t\t\t\t\t\trows: 6,\n\t\t\t\t\t\t\tspellcheck: false,\n\t\t\t\t\t\t\tvalue: sampleJson.value,\n\t\t\t\t\t\t\tonInput: (e: Event) => {\n\t\t\t\t\t\t\t\tsampleJson.value = (e.target as HTMLTextAreaElement).value;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tsampleError.value\n\t\t\t\t\t\t\t? h('p', { style: styles.error, role: 'alert' }, sampleError.value)\n\t\t\t\t\t\t\t: null,\n\t\t\t\t\t]),\n\t\t\t\t\th('div', { style: styles.previewColumn }, [\n\t\t\t\t\t\th('div', { style: styles.previewHeader }, [\n\t\t\t\t\t\t\th('span', { style: styles.label }, 'Preview'),\n\t\t\t\t\t\t\th('span', { style: styles.meta }, isPreviewing.value ? 'Rendering…' : 'Live'),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tpreviewError.value\n\t\t\t\t\t\t\t? h('p', { style: styles.error, role: 'alert' }, previewError.value.explanation)\n\t\t\t\t\t\t\t: null,\n\t\t\t\t\t\tpreview.value?.subject\n\t\t\t\t\t\t\t? h('p', { style: styles.previewSubject }, preview.value.subject)\n\t\t\t\t\t\t\t: null,\n\t\t\t\t\t\tpreview.value?.html\n\t\t\t\t\t\t\t? // sandbox= — no scripts, no same-origin. Operator-authored HTML\n\t\t\t\t\t\t\t\t// must never execute in the dashboard's origin, where the admin\n\t\t\t\t\t\t\t\t// token lives.\n\t\t\t\t\t\t\t\th('iframe', {\n\t\t\t\t\t\t\t\t\ttitle: 'Template preview',\n\t\t\t\t\t\t\t\t\tstyle: styles.previewFrame,\n\t\t\t\t\t\t\t\t\tsandbox: '',\n\t\t\t\t\t\t\t\t\tsrcdoc: preview.value.html,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t: preview.value\n\t\t\t\t\t\t\t\t? h('pre', { style: styles.previewText }, preview.value.text)\n\t\t\t\t\t\t\t\t: h('p', { style: styles.meta }, 'Nothing rendered yet.'),\n\t\t\t\t\t]),\n\t\t\t\t]),\n\t\t\t\trevisions.value.length > 0\n\t\t\t\t\t? h('div', { style: styles.revisions }, [\n\t\t\t\t\t\t\th('h2', { style: styles.subtitle }, 'History'),\n\t\t\t\t\t\t\th('ul', { style: styles.list }, revisions.value.map(renderRevision)),\n\t\t\t\t\t\t])\n\t\t\t\t\t: null,\n\t\t\t]);\n\t\t};\n\t},\n});\n","import type { CSSProperties } from 'vue';\n\nexport const styles: Record<string, CSSProperties> = {\n\tcontainer: { padding: '8px 40px 64px', maxWidth: '1400px', boxSizing: 'border-box' },\n\t// Two columns, always: editor left, rendered result right. Stacking the\n\t// preview under a long form hid it below the fold.\n\tsplit: {\n\t\tdisplay: 'grid',\n\t\tgridTemplateColumns: 'minmax(0, 1fr) minmax(0, 1fr)',\n\t\tgap: '24px',\n\t\talignItems: 'start',\n\t},\n\tcolumn: { minWidth: '0', display: 'flex', flexDirection: 'column' },\n\t// Pinned while the form scrolls, so the preview stays in view as you edit.\n\tpreviewColumn: {\n\t\tminWidth: '0',\n\t\tdisplay: 'flex',\n\t\tflexDirection: 'column',\n\t\tposition: 'sticky',\n\t\ttop: '16px',\n\t},\n\tsaveRow: { display: 'flex', alignItems: 'center', gap: '12px', marginTop: '16px' },\n\tpreviewHeader: {\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'space-between',\n\t\talignItems: 'center',\n\t\tmarginTop: '12px',\n\t},\n\tpreviewSubject: { fontSize: '14px', fontWeight: '600', margin: '8px 0' },\n\tpreviewFrame: {\n\t\twidth: '100%',\n\t\theight: '520px',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '8px',\n\t\tbackground: 'var(--fonderie-surface,#fff)',\n\t\tboxShadow: 'var(--fonderie-shadow-card,0 2px 3px 0 rgba(0,0,0,.05))',\n\t},\n\tpreviewText: {\n\t\twhiteSpace: 'pre-wrap',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '8px',\n\t\tpadding: '12px',\n\t\tfontSize: '13px',\n\t\tfontFamily:\n\t\t\t'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace)',\n\t},\n\ttitle: {\n\t\tfontSize: '22px',\n\t\tfontWeight: 600,\n\t\tmargin: '8px 0 4px',\n\t\tletterSpacing: 'var(--fonderie-tracking-display,-0.05em)',\n\t\tlineHeight: 1.25,\n\t},\n\tsubtitle: {\n\t\tfontSize: '15px',\n\t\tfontWeight: 600,\n\t\tmargin: '0 0 10px',\n\t\tletterSpacing: 'var(--fonderie-tracking-display,-0.05em)',\n\t},\n\tmeta: { fontSize: '13px', color: 'var(--fonderie-text-muted,#5c5c5c)', marginBottom: '20px' },\n\tstatus: { padding: '24px 0', color: 'var(--fonderie-text-muted,#5c5c5c)', fontSize: '13.5px' },\n\terror: {\n\t\tcolor: 'var(--fonderie-danger,#e00)',\n\t\tbackground: 'color-mix(in srgb, var(--fonderie-danger,#e00) 8%, transparent)',\n\t\tborderRadius: '6px',\n\t\tpadding: '8px 12px',\n\t\tmargin: '8px 0',\n\t\tfontSize: '13.5px',\n\t},\n\tlist: {\n\t\tlistStyle: 'none',\n\t\tpadding: '0',\n\t\tmargin: '0',\n\t\tbackground: 'var(--fonderie-surface,#fff)',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: 'var(--fonderie-radius-lg,8px)',\n\t\toverflow: 'hidden',\n\t\tboxShadow: 'var(--fonderie-shadow-card,0 2px 3px 0 rgba(0,0,0,.05))',\n\t},\n\trow: { borderBottom: '1px solid var(--fonderie-border-light,#f5f5f5)' },\n\trowButton: {\n\t\twidth: '100%',\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'space-between',\n\t\talignItems: 'center',\n\t\tgap: '16px',\n\t\tpadding: '13px 16px',\n\t\tbackground: 'none',\n\t\tborder: 'none',\n\t\tcursor: 'pointer',\n\t\ttextAlign: 'left',\n\t\tcolor: 'var(--fonderie-text,#171717)',\n\t\tfontFamily: 'inherit',\n\t},\n\ttype: {\n\t\tfontSize: '13px',\n\t\tfontWeight: 600,\n\t\tflex: '1',\n\t\tfontFamily:\n\t\t\t'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace)',\n\t},\n\tlocale: { fontSize: '12.5px', color: 'var(--fonderie-text-muted,#5c5c5c)' },\n\tactive: {\n\t\tdisplay: 'inline-flex',\n\t\talignItems: 'center',\n\t\tgap: '6px',\n\t\tborderRadius: '999px',\n\t\tpadding: '2px 9px 2px 8px',\n\t\tfontSize: '12px',\n\t\tfontWeight: 600,\n\t\tlineHeight: 1.5,\n\t\tminWidth: '64px',\n\t\tcolor: 'var(--fonderie-accent-strong,#009767)',\n\t\tbackground: 'color-mix(in srgb, var(--fonderie-accent-strong,#009767) 13%, transparent)',\n\t},\n\tinactive: {\n\t\tdisplay: 'inline-flex',\n\t\talignItems: 'center',\n\t\tgap: '6px',\n\t\tborderRadius: '999px',\n\t\tpadding: '2px 9px 2px 8px',\n\t\tfontSize: '12px',\n\t\tfontWeight: 600,\n\t\tlineHeight: 1.5,\n\t\tminWidth: '64px',\n\t\tcolor: 'var(--fonderie-text-muted,#5c5c5c)',\n\t\tbackground: 'color-mix(in srgb, var(--fonderie-text-muted,#5c5c5c) 10%, transparent)',\n\t},\n\tform: {\n\t\tdisplay: 'flex',\n\t\tflexDirection: 'column',\n\t\tgap: '4px',\n\t\tbackground: 'var(--fonderie-surface,#fff)',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: 'var(--fonderie-radius-lg,8px)',\n\t\tpadding: '6px 20px 20px',\n\t\tboxShadow: 'var(--fonderie-shadow-card,0 2px 3px 0 rgba(0,0,0,.05))',\n\t},\n\tlabel: { fontSize: '13px', fontWeight: 500, marginTop: '14px', marginBottom: '2px' },\n\tinput: {\n\t\theight: '36px',\n\t\tboxSizing: 'border-box',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '6px',\n\t\tpadding: '0 10px',\n\t\tfontSize: '13.5px',\n\t\tfontFamily: 'inherit',\n\t\tbackground: 'var(--fonderie-surface,#fff)',\n\t\tcolor: 'var(--fonderie-text,#171717)',\n\t},\n\ttextarea: {\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '6px',\n\t\tpadding: '10px',\n\t\tfontSize: '13px',\n\t\tlineHeight: 1.55,\n\t\tbackground: 'var(--fonderie-surface,#fff)',\n\t\tcolor: 'var(--fonderie-text,#171717)',\n\t\tfontFamily:\n\t\t\t'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace)',\n\t},\n\tcheckboxLabel: {\n\t\tdisplay: 'flex',\n\t\talignItems: 'center',\n\t\tgap: '8px',\n\t\tmarginTop: '12px',\n\t\tfontSize: '14px',\n\t},\n\tbutton: {\n\t\tdisplay: 'inline-flex',\n\t\talignItems: 'center',\n\t\theight: '36px',\n\t\tboxSizing: 'border-box',\n\t\tbackgroundColor: 'var(--fonderie-text,#171717)',\n\t\tcolor: 'var(--fonderie-surface,#fff)',\n\t\tpadding: '0 16px',\n\t\tborderRadius: '6px',\n\t\tborder: '1px solid var(--fonderie-text,#171717)',\n\t\tfontSize: '13.5px',\n\t\tfontWeight: 600,\n\t\tfontFamily: 'inherit',\n\t\talignSelf: 'flex-start',\n\t\tcursor: 'pointer',\n\t},\n\tbuttonDisabled: {\n\t\tdisplay: 'inline-flex',\n\t\talignItems: 'center',\n\t\theight: '36px',\n\t\tboxSizing: 'border-box',\n\t\tbackgroundColor: 'var(--fonderie-text,#171717)',\n\t\tcolor: 'var(--fonderie-surface,#fff)',\n\t\tpadding: '0 16px',\n\t\tborderRadius: '6px',\n\t\tborder: '1px solid var(--fonderie-text,#171717)',\n\t\tfontSize: '13.5px',\n\t\tfontWeight: 600,\n\t\tfontFamily: 'inherit',\n\t\talignSelf: 'flex-start',\n\t\topacity: 0.45,\n\t\tcursor: 'not-allowed',\n\t},\n\trevisions: { marginTop: '32px' },\n\trevisionRow: {\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'space-between',\n\t\talignItems: 'center',\n\t\tgap: '12px',\n\t\tpadding: '9px 16px',\n\t\tborderBottom: '1px solid var(--fonderie-border-light,#f5f5f5)',\n\t\tfontSize: '13px',\n\t},\n\trollbackButton: {\n\t\tdisplay: 'inline-flex',\n\t\talignItems: 'center',\n\t\theight: '28px',\n\t\tboxSizing: 'border-box',\n\t\tbackground: 'var(--fonderie-surface,#fff)',\n\t\tcolor: 'var(--fonderie-text,#171717)',\n\t\tborder: '1px solid var(--fonderie-border,#e0e0e0)',\n\t\tborderRadius: '6px',\n\t\tpadding: '0 10px',\n\t\tfontSize: '12.5px',\n\t\tfontWeight: 500,\n\t\tfontFamily: 'inherit',\n\t\tcursor: 'pointer',\n\t},\n\t// Template list: matches @fonderie/vue-admin-screens' shell look with local\n\t// values — this package sits below the admin screens and cannot import them.\n\tlistContainer: { padding: '32px 40px 64px', maxWidth: '1160px', boxSizing: 'border-box' },\n\tlistTitle: {\n\t\tfontSize: '22px',\n\t\tfontWeight: 600,\n\t\tmargin: '0',\n\t\tletterSpacing: 'var(--fonderie-tracking-display,-0.05em)',\n\t\tlineHeight: 1.25,\n\t},\n\thint: { fontSize: '13.5px', color: 'var(--fonderie-text-muted,#5c5c5c)', margin: '4px 0 24px' },\n\tdot: { width: '6px', height: '6px', borderRadius: '999px', background: 'currentColor' },\n};\n","import type { CourierAdminClient, ITemplateEntry } from '@fonderie/client';\nimport { useTemplates } from '@fonderie/vue-courier-admin';\nimport type { PropType } from 'vue';\nimport { defineComponent, h } from 'vue';\nimport { styles } from '../styles';\n\nexport const TemplateListScreen = defineComponent({\n\tname: 'FonderieTemplateListScreen',\n\tprops: {\n\t\tclient: { type: Object as PropType<CourierAdminClient>, required: true },\n\t},\n\temits: {\n\t\t'select-template': (_template: ITemplateEntry) => true,\n\t},\n\tsetup(props, { emit }) {\n\t\tconst { templates, isLoading, error } = useTemplates(props.client);\n\n\t\tfunction renderRow(template: ITemplateEntry) {\n\t\t\treturn h('li', { key: `${template.type}:${template.locale ?? 'base'}`, style: styles.row }, [\n\t\t\t\th(\n\t\t\t\t\t'button',\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'button',\n\t\t\t\t\t\tstyle: styles.rowButton,\n\t\t\t\t\t\tonClick: () => emit('select-template', template),\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\th('span', { style: styles.type }, template.type),\n\t\t\t\t\t\th('span', { style: styles.locale }, template.locale ?? 'default locale'),\n\t\t\t\t\t\th('span', { style: template.active ? styles.active : styles.inactive }, [\n\t\t\t\t\t\t\th('span', { style: styles.dot }),\n\t\t\t\t\t\t\ttemplate.active ? 'active' : 'inactive',\n\t\t\t\t\t\t]),\n\t\t\t\t\t],\n\t\t\t\t),\n\t\t\t]);\n\t\t}\n\n\t\treturn () =>\n\t\t\th('div', { style: styles.listContainer }, [\n\t\t\t\th('h1', { style: styles.listTitle }, 'Templates'),\n\t\t\t\th(\n\t\t\t\t\t'p',\n\t\t\t\t\t{ style: styles.hint },\n\t\t\t\t\t'Every email the app sends. Open one to edit its copy and preview it live.',\n\t\t\t\t),\n\t\t\t\tisLoading.value\n\t\t\t\t\t? h('p', { style: styles.status }, 'Loading templates…')\n\t\t\t\t\t: error.value\n\t\t\t\t\t\t? h('p', { style: styles.error, role: 'alert' }, error.value.explanation)\n\t\t\t\t\t\t: h('ul', { style: styles.list }, templates.value.map(renderRow)),\n\t\t\t]);\n\t},\n});\n"],"mappings":";AAMA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEP,SAAS,UAAU,iBAAiB,GAAG,KAAK,aAAa;;;ACXlD,IAAM,SAAwC;AAAA,EACpD,WAAW,EAAE,SAAS,iBAAiB,UAAU,UAAU,WAAW,aAAa;AAAA;AAAA;AAAA,EAGnF,OAAO;AAAA,IACN,SAAS;AAAA,IACT,qBAAqB;AAAA,IACrB,KAAK;AAAA,IACL,YAAY;AAAA,EACb;AAAA,EACA,QAAQ,EAAE,UAAU,KAAK,SAAS,QAAQ,eAAe,SAAS;AAAA;AAAA,EAElE,eAAe;AAAA,IACd,UAAU;AAAA,IACV,SAAS;AAAA,IACT,eAAe;AAAA,IACf,UAAU;AAAA,IACV,KAAK;AAAA,EACN;AAAA,EACA,SAAS,EAAE,SAAS,QAAQ,YAAY,UAAU,KAAK,QAAQ,WAAW,OAAO;AAAA,EACjF,eAAe;AAAA,IACd,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,WAAW;AAAA,EACZ;AAAA,EACA,gBAAgB,EAAE,UAAU,QAAQ,YAAY,OAAO,QAAQ,QAAQ;AAAA,EACvE,cAAc;AAAA,IACb,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,WAAW;AAAA,EACZ;AAAA,EACA,aAAa;AAAA,IACZ,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YACC;AAAA,EACF;AAAA,EACA,OA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I,IAAI,SAAS,UAAU,MAAM,IAAI,OAAO,OAAO,IAAI,GAAG;AAAA,QAC3FA;AAAA,UACC;AAAA,UACA;AAAA,YACC,MAAM;AAAA,YACN,OAAO,OAAO;AAAA,YACd,SAAS,MAAM,KAAK,mBAAmB,QAAQ;AAAA,UAChD;AAAA,UACA;AAAA,YACCA,GAAE,QAAQ,EAAE,OAAO,OAAO,KAAK,GAAG,SAAS,IAAI;AAAA,YAC/CA,GAAE,QAAQ,EAAE,OAAO,OAAO,OAAO,GAAG,SAAS,UAAU,gBAAgB;AAAA,YACvEA,GAAE,QAAQ,EAAE,OAAO,SAAS,SAAS,OAAO,SAAS,OAAO,SAAS,GAAG;AAAA,cACvEA,GAAE,QAAQ,EAAE,OAAO,OAAO,IAAI,CAAC;AAAA,cAC/B,SAAS,SAAS,WAAW;AAAA,YAC9B,CAAC;AAAA,UACF;AAAA,QACD;AAAA,MACD,CAAC;AAAA,IACF;AAEA,WAAO,MACNA,GAAE,OAAO,EAAE,OAAO,OAAO,cAAc,GAAG;AAAA,MACzCA,GAAE,MAAM,EAAE,OAAO,OAAO,UAAU,GAAG,WAAW;AAAA,MAChDA;AAAA,QACC;AAAA,QACA,EAAE,OAAO,OAAO,KAAK;AAAA,QACrB;AAAA,MACD;AAAA,MACA,UAAU,QACPA,GAAE,KAAK,EAAE,OAAO,OAAO,OAAO,GAAG,yBAAoB,IACrD,MAAM,QACLA,GAAE,KAAK,EAAE,OAAO,OAAO,OAAO,MAAM,QAAQ,GAAG,MAAM,MAAM,WAAW,IACtEA,GAAE,MAAM,EAAE,OAAO,OAAO,KAAK,GAAG,UAAU,MAAM,IAAI,SAAS,CAAC;AAAA,IACnE,CAAC;AAAA,EACH;AACD,CAAC;","names":["useTemplates","defineComponent","h","defineComponent","useTemplates","h"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonderie/vue-courier-admin-screens",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Pre-built Vue screens for the Fonderie courier admin API — template list, template editor with revision history and rollback.",
5
5
  "keywords": [
6
6
  "fonderiejs",