@skylivellc/lienzo-editor 0.13.2 → 0.14.1
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 +22 -0
- package/dist/{LienzoEditor-DO4NuwZG.js → LienzoEditor-BlEzEJMg.js} +950 -933
- package/dist/LienzoEditor-BlEzEJMg.js.map +1 -0
- package/dist/element.js +1 -1
- package/dist/index.js +1 -1
- package/dist/standalone/lienzo-editor.js +15 -15
- package/dist/standalone/lienzo-editor.js.map +1 -1
- package/dist/types/LienzoEditor.vue.d.ts +11 -1
- package/dist/types/client.d.ts +7 -0
- package/dist/types/shell/Toolbar.vue.d.ts +11 -1
- package/dist/types/state/autosave.d.ts +1 -0
- package/dist/types/state/editor.d.ts +2 -1
- package/package.json +2 -2
- package/dist/LienzoEditor-DO4NuwZG.js.map +0 -1
package/README.md
CHANGED
|
@@ -57,6 +57,28 @@ On the custom element, `endpoint` and `locale` are attributes. `messages`, `head
|
|
|
57
57
|
|
|
58
58
|
Requests send cookies for the same origin. If the page has Laravel's `XSRF-TOKEN` cookie, the editor sends it back as the `X-XSRF-TOKEN` header, so session-authenticated Laravel backends need no extra setup.
|
|
59
59
|
|
|
60
|
+
When the editor leaves the page, it sends the edits it has not saved yet. It sends writes under about 60 KB with `keepalive`, so they still arrive after the page is gone. A custom `fetch` must pass that option on. If the unsaved draft is bigger, the browser asks the user before leaving.
|
|
61
|
+
|
|
62
|
+
## Add your own controls to the toolbar
|
|
63
|
+
|
|
64
|
+
The `toolbar-start` slot puts your own controls, such as a link back to your app, at the start of the toolbar. It shows while the editor loads, when the editor fails to load, and once it is ready, so the way out never disappears.
|
|
65
|
+
|
|
66
|
+
On the custom element, `toolbar-start` is a native slot. The link stays in your page's DOM, so your CSS applies to it and your router sees the click:
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<lienzo-editor endpoint="/admin/site/1" style="display: block; height: 100vh">
|
|
70
|
+
<a slot="toolbar-start" href="/admin">Back</a>
|
|
71
|
+
</lienzo-editor>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
On the Vue component, `toolbar-start` is a named slot:
|
|
75
|
+
|
|
76
|
+
```vue
|
|
77
|
+
<LienzoEditor endpoint="/admin/site/1" style="height: 100vh">
|
|
78
|
+
<template #toolbar-start><RouterLink to="/admin">Back</RouterLink></template>
|
|
79
|
+
</LienzoEditor>
|
|
80
|
+
```
|
|
81
|
+
|
|
60
82
|
## License
|
|
61
83
|
|
|
62
84
|
MIT. The standalone file includes Vue, Zod and Lucide icons. See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
|