@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.
Files changed (42) hide show
  1. package/README.md +7 -3
  2. package/THIRD-PARTY-NOTICES.md +10 -0
  3. package/dist/clay.standalone.js +22539 -14260
  4. package/entries/clay-data.js +1 -1
  5. package/entries/sap.js +1 -1
  6. package/package.json +7 -2
  7. package/packed-contract.json +17 -0
  8. package/src/attrs/save-freeze.js +10 -18
  9. package/src/core/admin-contenteditable.js +8 -6
  10. package/src/core/admin-inputs.js +23 -13
  11. package/src/core/admin-onclick.js +5 -0
  12. package/src/core/is-edit-mode.js +7 -2
  13. package/src/core/persist.js +5 -10
  14. package/src/core/save-core.js +35 -0
  15. package/src/core/save.js +13 -1
  16. package/src/core/snapshot.js +186 -14
  17. package/src/core/source-map.js +1025 -0
  18. package/src/core/unsaved-warning.js +3 -0
  19. package/src/dom/dom-helpers.js +5 -1
  20. package/src/lib/content-dom.js +108 -0
  21. package/src/lib/mutation.js +26 -3
  22. package/src/lib/region-capabilities.js +69 -0
  23. package/src/lib/region-policy.js +18 -13
  24. package/src/loader-logic.js +27 -5
  25. package/src/loader.js +6 -0
  26. package/src/plugins/ai-edit.js +625 -0
  27. package/src/plugins/demo.js +3 -0
  28. package/src/plugins/sortable.js +6 -1
  29. package/src/plugins/source.js +410 -0
  30. package/src/plugins/wire.js +248 -47
  31. package/src/sync/live-sync.js +106 -42
  32. package/src/sync/presence.js +303 -0
  33. package/src/sync/section-notice.js +230 -0
  34. package/src/sync/splice-merge.js +7 -10
  35. package/src/sync/stream.js +190 -0
  36. package/src/vendor/control-serialize.vendor.js +10 -6
  37. package/src/vendor/hyper-morph.vendor.js +2 -2
  38. package/src/vendor/hyper-undo.vendor.js +1 -1
  39. package/src/vendor/hypercms.vendor.js +438 -45
  40. package/src/vendor/parse5.vendor.js +3 -0
  41. package/src/vendor/quickcrop.vendor.js +1 -1
  42. 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 `window.clayEditMode`,
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`. Add `autosave` to `<html>` to save automatically on change.
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
@@ -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