@bygga.dev/editor 1.9.11 → 1.9.12
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 +9 -3
- package/{TextEditor-DoE89_QB.js → TextEditor-DQ9MlOvk.js} +560 -545
- package/bygga-editor.js +1526 -1531
- package/package.json +1 -1
- package/{urls-CkV6bAHz.js → urls-DQuXPDSt.js} +180 -173
package/README.md
CHANGED
|
@@ -184,6 +184,12 @@ A missing locale label falls back to the default locale, then to the bare id. Yo
|
|
|
184
184
|
backend must later resolve every id it sees; see
|
|
185
185
|
[Sending and publishing](#sending-and-publishing).
|
|
186
186
|
|
|
187
|
+
A tag can also be a link's whole url — an unsubscribe or "view in browser" link, say:
|
|
188
|
+
type `{{unsubscribe}}` as the url in the link dialog or a button's URL field. The editor
|
|
189
|
+
keeps it as typed (it only puts `https://` in front of something that starts like a host
|
|
190
|
+
name, `www.example.com`), and the compiled email carries it in the `href` for your
|
|
191
|
+
backend to replace with the full url.
|
|
192
|
+
|
|
187
193
|
### `brand` property
|
|
188
194
|
The colours and fonts your embed permits, the look new blocks start with, values for
|
|
189
195
|
your block plugins, and which block tiles to offer — a **menu, never a rewrite of a
|
|
@@ -541,8 +547,8 @@ means no controls — same as no `ai` at all.
|
|
|
541
547
|
actions. It runs on their selection, or on the whole block when nothing is selected, one
|
|
542
548
|
paragraph at a time: each paragraph or heading is its own `run` call, all sent at once, so
|
|
543
549
|
a block keeps its paragraphs, heading level, line breaks and styling. The answers land
|
|
544
|
-
together as one undo step, around anything the author typed while waiting.
|
|
545
|
-
|
|
550
|
+
together as one undo step, around anything the author typed while waiting. While requests
|
|
551
|
+
are in flight, a ring turns around the button and it can't start another run.
|
|
546
552
|
|
|
547
553
|
### Implementing the endpoint
|
|
548
554
|
|
|
@@ -659,7 +665,7 @@ the whole flow (including the failure path):
|
|
|
659
665
|
ai: {
|
|
660
666
|
actions: ['proofread', 'rewrite', 'shorten', 'expand'],
|
|
661
667
|
run: async ({ action, text }) => {
|
|
662
|
-
await new Promise((r) => setTimeout(r,
|
|
668
|
+
await new Promise((r) => setTimeout(r, 1200)) // see the progress ring
|
|
663
669
|
if (text.includes('boom')) throw new Error('mock failure')
|
|
664
670
|
return `[${action}] ${text}`
|
|
665
671
|
},
|