hivewrite-sdk 1.2.1 → 1.2.2
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/README.md +3 -1
- package/bundle.min.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -123,7 +123,7 @@ Initializes and mounts the editor.
|
|
|
123
123
|
| `branding` | `object` | No | Custom white-labeling options (`primaryColor`, `secondaryColor`, `accentColor`, `logoUrl`, `customCSS`) |
|
|
124
124
|
| `mergeTags` | `array` | No | Array of `{ label, value }` for dynamic content |
|
|
125
125
|
| `portalTarget` | `string` | No | `'window'` (default) or `'container'`. Controls where dialogs render. |
|
|
126
|
-
| `autosave` | `number` | No | Autosave interval in seconds (e.g. `120`). Fires `onAutoSave` on that interval only when the design changed since it was loaded or last saved. Requires `callbacks.onAutoSave`. |
|
|
126
|
+
| `autosave` | `number` | No | Autosave interval in seconds (e.g. `120`). Fires `onAutoSave` on that interval only when the design changed since it was loaded or last saved, and only after the design has a template id. A new, never-saved design is not autosaved, so discarding it does not create a template. Requires `callbacks.onAutoSave`. |
|
|
127
127
|
| `warnings` | `object` | No | Optional warning settings. `{ placeholderImages: false }` disables the placeholder-image confirmation on manual save (defaults to `true`). |
|
|
128
128
|
| `callbacks` | `object` | No | Event hooks for SDK actions |
|
|
129
129
|
|
|
@@ -321,6 +321,8 @@ Both save callbacks receive:
|
|
|
321
321
|
2. `user_id` — the id passed to `init()`.
|
|
322
322
|
3. `context` — `{ design, html, source, templateId, version, user_id }`, where `html` is the final generated email HTML and `source` is `"manual"` or `"autosave"`.
|
|
323
323
|
|
|
324
|
+
Autosave only runs for an existing template. A new design has no template id until the first manual save, so `onAutoSave` is not called and discarding an unsaved draft does not create a template. After the manual save returns a `templateId`, later edits can be autosaved normally.
|
|
325
|
+
|
|
324
326
|
Return (or resolve with) the result of your backend request. The editor **waits** for it and only shows a successful save when `success` is not `false`. Thrown errors and rejected promises are reported to the user as failures.
|
|
325
327
|
|
|
326
328
|
```javascript
|