create-email-template 0.2.0 → 0.3.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.
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
2
  import type { EmailBuilderState, EmailBuilderStore } from "./create-email-builder-store";
3
- import type { AutosaveOptions, EmailBuilderConfig, ResolvedEmailBuilderConfig, UploadImage } from "../config/types";
4
- export declare const EmailBuilderProvider: ({ config, uploadImage, autosave, children, }: {
3
+ import type { AutosaveOptions, EmailBuilderConfig, ResolvedEmailBuilderConfig, UploadFile, UploadImage } from "../config/types";
4
+ export declare const EmailBuilderProvider: ({ config, uploadImage, uploadFile, autosave, children, }: {
5
5
  config?: EmailBuilderConfig;
6
6
  uploadImage?: UploadImage;
7
+ uploadFile?: UploadFile;
7
8
  /** Opt-in: ciclo de autoguardado administrado (ver `AutosaveOptions`). */
8
9
  autosave?: AutosaveOptions;
9
10
  children: React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"email-builder-provider.d.ts","sourceRoot":"","sources":["../../src/store/email-builder-provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAKN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC1B,WAAW,EACZ,MAAM,iBAAiB,CAAC;AASzB,eAAO,MAAM,oBAAoB,GAAI,8CAKlC;IACD,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,sBAwBA,CAAC;AAEF,eAAO,MAAM,4BAA4B,QAAO,iBAQ/C,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAO,0BAQxC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,CAAC,EACpC,UAAU,CAAC,KAAK,EAAE,iBAAiB,KAAK,CAAC,KACxC,CAOF,CAAC"}
1
+ {"version":3,"file":"email-builder-provider.d.ts","sourceRoot":"","sources":["../../src/store/email-builder-provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAKN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC1B,UAAU,EACV,WAAW,EACZ,MAAM,iBAAiB,CAAC;AASzB,eAAO,MAAM,oBAAoB,GAAI,0DAMlC;IACD,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,sBA4BA,CAAC;AAEF,eAAO,MAAM,4BAA4B,QAAO,iBAQ/C,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAO,0BAQxC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,CAAC,EACpC,UAAU,CAAC,KAAK,EAAE,iBAAiB,KAAK,CAAC,KACxC,CAOF,CAAC"}
package/llms.txt CHANGED
@@ -10,6 +10,8 @@
10
10
 
11
11
  ## Quick start
12
12
  - `import "create-email-template/style.css"` is REQUIRED (scoped under .ter-theme)
13
- - `<EmailBuilderProvider config? uploadImage? autosave?><EmailBuilder /></EmailBuilderProvider>`
13
+ - `<EmailBuilderProvider config? uploadImage? uploadFile? autosave?><EmailBuilder /></EmailBuilderProvider>`
14
14
  - Hooks: useRenderEmail, useAutosaveStatus, useEmailBuilderStore, useEmailBuilderStoreInstance, useEmailBuilderConfig
15
15
  - Payload: `{ content, settings }` (render it on the back-end with create-email-renderer)
16
+ - Files: upload PDFs/DOCX in the settings dialog; they live in `settings.files` and the `downloads` block lists them
17
+ - `uploadFile(file) => Promise<string>` must return a PUBLIC url (R2/S3/your API) for real emails
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-email-template",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Reusable email template builder (blocks, canvas, options) with a zero-dependency React store and shadcn/ui",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -29,7 +29,7 @@
29
29
  "clsx": "^2.1.1",
30
30
  "lucide-react": "^1.34.0",
31
31
  "react-hot-toast": "^2.5.1",
32
- "create-email-renderer": "0.2.0"
32
+ "create-email-renderer": "0.3.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@fontsource-variable/geist": "^5.3.0",