@panphora/clayjs 1.0.0 → 1.1.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.
- package/README.md +23 -0
- package/dist/clay.standalone.js +22030 -0
- package/entries/clay-data.js +1 -1
- package/package.json +9 -2
- package/src/core/etag.js +114 -0
- package/src/core/host-attrs.js +7 -2
- package/src/core/host-meta.js +20 -3
- package/src/core/save-conflict-notice.js +196 -0
- package/src/core/save-core.js +60 -3
- package/src/core/save.js +80 -1
- package/src/core/snapshot.js +34 -17
- package/src/lib/root-attrs.js +23 -7
- package/src/loader-logic.js +39 -0
- package/src/loader.js +11 -5
- package/src/plugins/indicator.js +13 -2
- package/src/plugins/sortable.js +5 -5
- package/src/standalone.js +98 -0
- package/src/sync/live-sync.js +42 -0
- package/src/ui/index.js +7 -0
- package/src/vendor/hypercms.vendor.js +13 -13
- package/src/lib/load-vendor-script.js +0 -57
package/README.md
CHANGED
|
@@ -62,6 +62,29 @@ then a save token stamped on `<html>` by the host, then the platform's owner coo
|
|
|
62
62
|
and save tokens are covered in [the reference](https://github.com/panphora/clayjs/blob/main/docs/reference.md) and on
|
|
63
63
|
[clayjs.com/docs](https://clayjs.com/docs#editmode).
|
|
64
64
|
|
|
65
|
+
### One file, no network
|
|
66
|
+
|
|
67
|
+
`clay.js` is a small bootstrap that fetches the modules a page asked for. For a page
|
|
68
|
+
that has to load with no connection, download the standalone build instead: every
|
|
69
|
+
module, plugin and satellite in one readable file.
|
|
70
|
+
|
|
71
|
+
```html
|
|
72
|
+
<script src="clay.standalone.js?plugins=sync"></script>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Get it from [clayjs.com/v1/clay.standalone.js](https://clayjs.com/v1/clay.standalone.js)
|
|
76
|
+
(about 1 MB; `/1.1.0/clay.standalone.js` is that exact release, and the file's first
|
|
77
|
+
line says which version it is) or from the npm tarball at `dist/clay.standalone.js`.
|
|
78
|
+
Keep it beside the HTML file and use the same query params: `plugins=` decides what
|
|
79
|
+
runs, not what downloads, and `await clay.loaded.ui` and the other satellites work
|
|
80
|
+
without tags of their own (they are always on, so clay-ui's automatic save toasts run
|
|
81
|
+
on your page unless you handle the `clay:save-*` events yourself). If the page already
|
|
82
|
+
had satellite tags, delete them: a second `sap.js` mounts a second runtime. Saving
|
|
83
|
+
still needs a host that writes the file; [HTML Clay](https://htmlclay.com) does that
|
|
84
|
+
on the machine itself, with no network.
|
|
85
|
+
The two things that still reach out, and why they fail soft, are on
|
|
86
|
+
[clayjs.com/offline](https://clayjs.com/offline).
|
|
87
|
+
|
|
65
88
|
## Readiness
|
|
66
89
|
|
|
67
90
|
The bootstrap creates `window.clay` synchronously with just a `ready` promise, then augments
|