@seliseblocks/mailcraft 0.2.1 → 0.2.3
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/DOCS.md +3 -0
- package/dist/mailcraft-editor.bundle.js +61 -50
- package/dist/mailcraft-editor.bundle.js.map +3 -3
- package/package.json +1 -1
- package/src/core/editor-core.js +6 -1
- package/src/core/export.js +2 -1
- package/src/core/i18n/loaders.js +78 -0
- package/src/core/i18n/tables.js +5 -4
- package/src/core/import-html.js +18 -0
- package/src/core/theme.js +1 -1
- package/src/index.js +1 -0
- package/src/mailcraft-editor.js +46 -17
- package/src/render/canvas.js +4 -0
- package/src/render/style.js +503 -488
- package/types/index.d.ts +9 -0
package/DOCS.md
CHANGED
|
@@ -419,6 +419,8 @@ Hiding the strip collapses its row — the canvas keeps every pixel it had.
|
|
|
419
419
|
|
|
420
420
|
31 locales ship. `dir` follows the locale automatically (`locale="ar"` gives RTL) and can be overridden. While `theme` is set the host owns light/dark and the editor hides its own toggle.
|
|
421
421
|
|
|
422
|
+
Tables load lazily: in a bundled app each locale is its own code-split chunk, fetched the first time its tag is used, so you ship only the languages you render (English is always built in). The chrome shows English for the instant the chunk takes to arrive; call `loadLocale(tag)` ahead of time to have it ready before you flip the attribute. The single-file CDN bundle carries every table, so switching there is always instant.
|
|
423
|
+
|
|
422
424
|
Override any individual string:
|
|
423
425
|
|
|
424
426
|
```js
|
|
@@ -521,6 +523,7 @@ template, not to your app.
|
|
|
521
523
|
| `isReady()` | whether the custom element is registered |
|
|
522
524
|
| `MailCraftEditor` | the element class |
|
|
523
525
|
| `LOCALES`, `LOCALE_TABLES`, `createTranslator` | i18n: the shipped tags, their tables, and the translator the editor uses |
|
|
526
|
+
| `LOCALE_LOADERS`, `loadLocale(tag)` | lazy per-locale table loading — what the `locale` attribute resolves through, so a bundled app ships only the locales it uses. `loadLocale` prefetches one (e.g. before flipping `locale` at runtime) |
|
|
524
527
|
| `defineMessages(base, overrides)` | merge a shipped locale with your own overrides — the supported way to build a `.messages` value |
|
|
525
528
|
| `missingKeys(locale, base)` | keys `base` has that `locale` does not translate. What a translator has left to do |
|
|
526
529
|
| `EN`, `MESSAGE_KEYS` | the English table and every key in it — listed in [Every message key](#every-message-key) |
|