@boxcc/maildeno-editor 0.0.0-stage → 0.4.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +479 -0
  2. package/README.md +442 -2
  3. package/dist/DatePicker-AdfGW0Tw.js +5347 -0
  4. package/dist/DatePicker-aNFlsoOb.js +5347 -0
  5. package/dist/Dialog-By0JLN8s.js +6294 -0
  6. package/dist/HealthIndicator-BLID6Ty0.js +1216 -0
  7. package/dist/HealthIndicator-DfzqzPNw.js +1217 -0
  8. package/dist/PopperContent-N2nAEFeH.js +2538 -0
  9. package/dist/PopperContent-eLmz1Gjd.js +2578 -0
  10. package/dist/PreviewCanvas-D3SpILsV.js +534 -0
  11. package/dist/PreviewCanvas-PtW1UL1J.js +534 -0
  12. package/dist/RichTextEditor-D6DQqbJg.js +12218 -0
  13. package/dist/RichTextEditor-DDEfKPZm.js +12217 -0
  14. package/dist/RowPreviewChildren-BGnilx-K.js +4 -0
  15. package/dist/RowPreviewChildren-CalQWx1C.js +4 -0
  16. package/dist/RowPreviewLegacyComponent-Df_1HTly.js +403 -0
  17. package/dist/RowPreviewLegacyComponent-NECG3wpn.js +403 -0
  18. package/dist/RowPreviewRow-C2XAe5Xs.js +81 -0
  19. package/dist/RowPreviewRow-DG4AdMrv.js +81 -0
  20. package/dist/SavedRowsPanel-2JBfYdxN.js +492 -0
  21. package/dist/SavedRowsPanel-B6_VHQZm.js +493 -0
  22. package/dist/_plugin-vue_export-helper-Dj7HTbfw.js +8 -0
  23. package/dist/adapters/errors.d.ts +59 -0
  24. package/dist/adapters/localStorageAdapter.d.ts +6 -0
  25. package/dist/adapters/types.d.ts +151 -0
  26. package/dist/babel-DV7WPQI0.js +10043 -0
  27. package/dist/blocks/registry.d.ts +23 -0
  28. package/dist/blocks/types.d.ts +73 -0
  29. package/dist/borderRadius-CkSa1lQ9.js +75 -0
  30. package/dist/components/features/emailBuilder/EmailEditor.vue.d.ts +183 -0
  31. package/dist/composables/emailBuilder/export/logic/espLogicWrapper.d.ts +76 -0
  32. package/dist/composables/emailBuilder/persistence/useEmailBuilderPersistence.d.ts +38 -0
  33. package/dist/composables/emailBuilder/transform/pipeline/optimize.d.ts +100 -0
  34. package/dist/composables/system/useColorScheme.d.ts +16 -0
  35. package/dist/element-DQw3HLit.js +21540 -0
  36. package/dist/element.d.ts +6 -0
  37. package/dist/element.js +5 -0
  38. package/dist/esp/registry.d.ts +33 -0
  39. package/dist/estree-DY9POgc0.js +8195 -0
  40. package/dist/html-wb0gSX1o.js +7273 -0
  41. package/dist/index.d.ts +17 -0
  42. package/dist/index.js +15032 -0
  43. package/dist/init.d.ts +180 -0
  44. package/dist/init.js +143 -0
  45. package/dist/maildeno-editor.css +2 -0
  46. package/dist/merge-tags/registry.d.ts +33 -0
  47. package/dist/mergeTagDefinitions-Cler19nv.js +27 -0
  48. package/dist/standalone-DHvJ30Td.js +3554 -0
  49. package/dist/theme.d.ts +206 -0
  50. package/dist/types/assistant.d.ts +56 -0
  51. package/dist/useEmailBuilder-2yCUzRx2.js +4934 -0
  52. package/dist/useEmailBuilder-D3uV7dwL.js +4934 -0
  53. package/dist/useToast-D1GgDMqQ.js +194 -0
  54. package/dist/utils/border.d.ts +15 -0
  55. package/dist/utils/borderRadius.d.ts +10 -0
  56. package/dist/vue.runtime.esm-bundler-D2AjRP90.js +6117 -0
  57. package/package.json +100 -4
@@ -0,0 +1,151 @@
1
+ /**
2
+ * The storage adapter interface. This is the actual product boundary — see
3
+ * the project README's "Positioning" section: the editor is MIT-licensed
4
+ * and fully functional against createLocalStorageAdapter() below, with zero
5
+ * backend. A hosted adapter (implementing the same interface against a real
6
+ * API) is a separate package, not part of this one.
7
+ *
8
+ * Deliberately does NOT cover useEmailBuilderPersistence's autosave draft —
9
+ * that's a single-slot, 30-day-TTL crash-recovery buffer that's always
10
+ * localStorage regardless of which adapter is active (explicitly designed
11
+ * to be cleared once a "real" save happens through this interface, not a
12
+ * replacement for it). Confirmed still wired and working via Header.vue's
13
+ * initFromStorage() call — untouched by this batch.
14
+ */
15
+ export interface TemplateSnapshot {
16
+ rows: Record<string, any>[];
17
+ canvasStyles: Record<string, any>;
18
+ name?: string;
19
+ tags?: string[];
20
+ updatedAt?: string;
21
+ }
22
+ /** One entry in the saved-templates list. Deliberately a summary, not a full
23
+ * TemplateSnapshot — listing shouldn't require loading every template's rows,
24
+ * which for a cloud adapter would mean fetching entire documents just to
25
+ * render a list. Selecting one calls loadTemplate(id) for the real content. */
26
+ export interface TemplateSummary {
27
+ templateId: string;
28
+ name?: string;
29
+ updatedAt?: string;
30
+ }
31
+ /**
32
+ * One entry in the version-history panel. A summary for the same reason
33
+ * TemplateSummary is: rendering a list of fifty versions shouldn't mean
34
+ * downloading fifty full documents. getTemplateVersion(id) fetches content
35
+ * for the one the user actually restores.
36
+ */
37
+ export interface TemplateVersionSummary {
38
+ versionId: string;
39
+ createdAt: string;
40
+ /** Optional human label ("Before redesign"). Falls back to a relative
41
+ * timestamp in the panel when absent. */
42
+ label?: string;
43
+ /** Pinned. Kept versions are excluded from deleteAllTemplateVersions and
44
+ * are the ones a host's retention policy should spare. The editor only
45
+ * reads and toggles this; what "spared" means is the host's business. */
46
+ kept?: boolean;
47
+ /** Free-form attribution, shown verbatim if present. Deliberately a
48
+ * string, not a user object — the editor has no user model and shouldn't
49
+ * grow one just to render a name. */
50
+ author?: string;
51
+ }
52
+ export interface SavedRow {
53
+ id: string;
54
+ name: string;
55
+ createdAt: string;
56
+ row: Record<string, any>;
57
+ }
58
+ export interface EditorStorageAdapter {
59
+ loadTemplate(templateId?: string): Promise<TemplateSnapshot | null>;
60
+ saveTemplate(snapshot: TemplateSnapshot, templateId?: string): Promise<{
61
+ templateId: string;
62
+ }>;
63
+ /**
64
+ * Lists saved templates for the saved-templates panel.
65
+ *
66
+ * Optional on purpose: adding it as a required method would break every
67
+ * adapter already written against this interface. When absent, the panel
68
+ * says so rather than appearing broken — the same capability-gating used
69
+ * for onSendTestEmail, where a feature that can't be backed simply isn't
70
+ * offered.
71
+ */
72
+ listTemplates(): Promise<TemplateSummary[]>;
73
+ /** Optional, and only surfaced in the panel when implemented. */
74
+ deleteTemplate(templateId: string): Promise<void>;
75
+ /**
76
+ * ── Version history ──────────────────────────────────────────────────
77
+ *
78
+ * All five are optional, like listTemplates above, and gated the same
79
+ * way: the panel is only reachable when `versions` is set on the editor,
80
+ * and each control within it only appears when its method exists. An
81
+ * adapter can therefore support listing and restoring without supporting
82
+ * deletion, and the UI reflects exactly that.
83
+ *
84
+ * Note the asymmetry with saveTemplate: nothing here creates a version.
85
+ * When a save produces a new version is a policy question — every save,
86
+ * on a timer, on explicit request — and the host already owns saveTemplate,
87
+ * so it can decide there. Putting version creation in this interface would
88
+ * force one policy on every host.
89
+ */
90
+ listTemplateVersions(templateId: string): Promise<TemplateVersionSummary[]>;
91
+ /** Full content for one version, in the same shape as loadTemplate. */
92
+ getTemplateVersion(templateId: string, versionId: string): Promise<TemplateSnapshot | null>;
93
+ deleteTemplateVersion(templateId: string, versionId: string): Promise<void>;
94
+ /** Bulk delete. Kept versions survive — see TemplateVersionSummary.kept.
95
+ * The panel's confirm copy says so, so an implementation that deletes
96
+ * kept versions too would contradict what the user was told. */
97
+ deleteAllTemplateVersions(templateId: string): Promise<void>;
98
+ setTemplateVersionKept(templateId: string, versionId: string, kept: boolean): Promise<void>;
99
+ listSavedRows(): Promise<SavedRow[]>;
100
+ /**
101
+ * A second, read-only row library shown in its own tab beside the user's
102
+ * own rows — an organisation's shared blocks, a starter set, whatever the
103
+ * host curates.
104
+ *
105
+ * Optional, and the tab only appears when it is implemented, so a host with
106
+ * one row library sees exactly the panel it has today. The built-in
107
+ * localStorage adapter deliberately does NOT implement it: "shared across
108
+ * an organisation" has no meaning in a single browser's storage, and
109
+ * faking it would demonstrate a feature that cannot work.
110
+ *
111
+ * Read-only by construction. There is no saveSystemSavedRow /
112
+ * deleteSystemSavedRow / renameSystemSavedRow, so the panel renders this
113
+ * tab without rename or delete controls. Who may curate a shared library is
114
+ * a permissions question the host answers in its own admin UI — the editor
115
+ * has no user model to answer it with, and inventing one to grey out a
116
+ * button would be the wrong boundary.
117
+ *
118
+ * cloneSavedRowForCanvas must resolve ids from BOTH libraries. It is the
119
+ * single synchronous entry point used when a row is dragged onto the
120
+ * canvas, and the drag doesn't know which tab the row came from.
121
+ */
122
+ listSystemSavedRows(): Promise<SavedRow[]>;
123
+ saveSavedRow(row: Record<string, any>, name: string): Promise<SavedRow | null>;
124
+ deleteSavedRow(id: string): Promise<void>;
125
+ renameSavedRow(id: string, name: string): Promise<void>;
126
+ cloneSavedRowForCanvas(id: string): Record<string, any> | null;
127
+ uploadImage(file: File): Promise<string>;
128
+ }
129
+ /**
130
+ * What a host actually passes as `storageAdapter`.
131
+ *
132
+ * Every method is optional. Anything you leave out falls back to the
133
+ * built-in localStorage adapter, so you can override only the parts you
134
+ * care about:
135
+ *
136
+ * ```ts
137
+ * // Upload images to your own storage; keep everything else local.
138
+ * init({ storageAdapter: { uploadImage: (file) => uploadToS3(file) } });
139
+ * ```
140
+ *
141
+ * Internally the editor always works with a complete `EditorStorageAdapter`
142
+ * — `provideStorageAdapter` merges your partial over the defaults — so no
143
+ * call site has to guard against a missing method.
144
+ *
145
+ * One thing worth knowing: the fallback is per-method, not per-area. If you
146
+ * implement `saveTemplate` against your own backend but leave
147
+ * `listTemplates` out, the saved-templates panel will list whatever is in
148
+ * localStorage rather than your backend. The editor warns about that
149
+ * specific mismatch in development.
150
+ */
151
+ export type PartialStorageAdapter = Partial<EditorStorageAdapter>;