@panphora/clayjs 1.2.0 → 1.4.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 +7 -3
- package/THIRD-PARTY-NOTICES.md +10 -0
- package/dist/clay.standalone.js +22539 -14260
- package/entries/clay-data.js +1 -1
- package/entries/sap.js +1 -1
- package/package.json +7 -2
- package/packed-contract.json +17 -0
- package/src/attrs/save-freeze.js +10 -18
- package/src/core/admin-contenteditable.js +8 -6
- package/src/core/admin-inputs.js +23 -13
- package/src/core/admin-onclick.js +5 -0
- package/src/core/is-edit-mode.js +7 -2
- package/src/core/persist.js +5 -10
- package/src/core/save-core.js +35 -0
- package/src/core/save.js +13 -1
- package/src/core/snapshot.js +186 -14
- package/src/core/source-map.js +1025 -0
- package/src/core/unsaved-warning.js +3 -0
- package/src/dom/dom-helpers.js +5 -1
- package/src/lib/content-dom.js +108 -0
- package/src/lib/mutation.js +26 -3
- package/src/lib/region-capabilities.js +69 -0
- package/src/lib/region-policy.js +18 -13
- package/src/loader-logic.js +27 -5
- package/src/loader.js +6 -0
- package/src/plugins/ai-edit.js +625 -0
- package/src/plugins/demo.js +3 -0
- package/src/plugins/sortable.js +6 -1
- package/src/plugins/source.js +410 -0
- package/src/plugins/wire.js +248 -47
- package/src/sync/live-sync.js +106 -42
- package/src/sync/presence.js +303 -0
- package/src/sync/section-notice.js +230 -0
- package/src/sync/splice-merge.js +7 -10
- package/src/sync/stream.js +190 -0
- package/src/vendor/control-serialize.vendor.js +10 -6
- package/src/vendor/hyper-morph.vendor.js +2 -2
- package/src/vendor/hyper-undo.vendor.js +1 -1
- package/src/vendor/hypercms.vendor.js +438 -45
- package/src/vendor/parse5.vendor.js +3 -0
- package/src/vendor/quickcrop.vendor.js +1 -1
- package/src/vendor/richclay.vendor.js +22 -15
package/README.md
CHANGED
|
@@ -51,13 +51,14 @@ query params on the script URL:
|
|
|
51
51
|
<script src="https://clayjs.com/v1/clay.js?plugins=sync,cms&exclude=indicator"></script>
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
- `?plugins=` — add optional plugins: `sync`, `cms`, `undo`, `sortable`, `indicator`, `quickcrop`, `upload`, `wire`, `demo`.
|
|
54
|
+
- `?plugins=` — add optional plugins: `sync`, `cms`, `undo`, `sortable`, `indicator`, `quickcrop`, `upload`, `wire`, `ai-edit`, `demo`.
|
|
55
55
|
Only `richclay` loads by default, and only in edit mode. `cms` brings `quickcrop` with it, because
|
|
56
56
|
the CMS uses it for `data-hcms-crop` image fields.
|
|
57
57
|
- `?exclude=` — drop a plugin that would otherwise load (a default, or one another plugin pulled in).
|
|
58
58
|
- `?editmode=false` — force view mode (URL param wins over everything else).
|
|
59
59
|
|
|
60
|
-
Edit mode is decided in this order: the `?editmode` param, then `
|
|
60
|
+
Edit mode is decided in this order: the `?editmode` param, then a `viewonly` attribute
|
|
61
|
+
on `<html>` (a page that never saves itself), then `window.clayEditMode`,
|
|
61
62
|
then a save token stamped on `<html>` by the host, then the platform's owner cookie. Hosts
|
|
62
63
|
and save tokens are covered in [the reference](https://github.com/panphora/clayjs/blob/main/docs/reference.md) and on
|
|
63
64
|
[clayjs.com/docs](https://clayjs.com/docs#editmode).
|
|
@@ -133,7 +134,10 @@ attribute:
|
|
|
133
134
|
```
|
|
134
135
|
|
|
135
136
|
Tokens: `no-save`, `no-snapshot`, `no-trigger-autosave`, `no-dirty`, `no-watch`, `no-undo`,
|
|
136
|
-
`freeze`.
|
|
137
|
+
`no-data`, `editor-ui`, `freeze`. `no-data` excludes a subtree from content-aware reads without
|
|
138
|
+
changing save, watch, snapshot, or undo behavior. `editor-ui` combines `no-data`, `no-save`,
|
|
139
|
+
`no-snapshot`, `no-watch`, and `no-undo` for live editing controls. Native DOM queries still see
|
|
140
|
+
both markers. Add `autosave` to `<html>` to save automatically on change.
|
|
137
141
|
|
|
138
142
|
`no-trigger-autosave` and `no-dirty` are the pair worth getting right. Both are saved in full and
|
|
139
143
|
neither starts an autosave. The difference is whether their content is *work*: a
|
package/THIRD-PARTY-NOTICES.md
CHANGED
|
@@ -22,6 +22,16 @@ or carry third-party code, and keep their original licenses.
|
|
|
22
22
|
- (c) Cure53 and other contributors
|
|
23
23
|
- https://github.com/cure53/DOMPurify
|
|
24
24
|
|
|
25
|
+
## parse5 7.3.0 (MIT)
|
|
26
|
+
|
|
27
|
+
- File: src/vendor/parse5.vendor.js (the `parse` export only, bundled by
|
|
28
|
+
scripts/build-parse5-vendor.mjs)
|
|
29
|
+
- Used by the `source` plugin, which needs a spec-conformant parse that reports byte
|
|
30
|
+
offsets. No browser exposes one: DOMParser builds the same tree and reports no
|
|
31
|
+
offsets at all.
|
|
32
|
+
- Copyright (c) 2013-2019 Ivan Nikulin and contributors
|
|
33
|
+
- https://github.com/inikulin/parse5
|
|
34
|
+
|
|
25
35
|
## Prism 1.29.0 (MIT)
|
|
26
36
|
|
|
27
37
|
- File: website/prism.min.js (core + markup, css, clike, javascript, bash), used
|