hyperclayjs 1.1.2 → 1.3.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 (40) hide show
  1. package/README.md +44 -59
  2. package/communication/behaviorCollector.js +8 -1
  3. package/communication/sendMessage.js +8 -2
  4. package/communication/uploadFile.js +8 -2
  5. package/core/adminSystem.js +3 -0
  6. package/core/autosave.js +95 -0
  7. package/core/editmodeSystem.js +10 -8
  8. package/core/enablePersistentFormInputValues.js +8 -1
  9. package/core/optionVisibilityRuleGenerator.js +9 -1
  10. package/core/savePage.js +28 -71
  11. package/core/savePageCore.js +7 -14
  12. package/custom-attributes/ajaxElements.js +4 -0
  13. package/custom-attributes/domHelpers.js +9 -0
  14. package/custom-attributes/events.js +3 -0
  15. package/custom-attributes/inputHelpers.js +3 -0
  16. package/custom-attributes/sortable.js +9 -1
  17. package/dom-utilities/All.js +4 -7
  18. package/dom-utilities/getDataFromForm.js +9 -2
  19. package/dom-utilities/insertStyleTag.js +9 -2
  20. package/dom-utilities/onDomReady.js +8 -2
  21. package/dom-utilities/onLoad.js +8 -2
  22. package/hyperclay.js +109 -673
  23. package/module-dependency-graph.json +193 -137
  24. package/package.json +3 -3
  25. package/string-utilities/copy-to-clipboard.js +3 -7
  26. package/string-utilities/emmet-html.js +8 -2
  27. package/string-utilities/query.js +8 -1
  28. package/string-utilities/slugify.js +4 -7
  29. package/ui/info.js +9 -1
  30. package/ui/prompts.js +19 -12
  31. package/ui/theModal.js +4 -4
  32. package/ui/toast-hyperclay.js +21 -0
  33. package/ui/toast.js +4 -7
  34. package/utilities/cookie.js +4 -7
  35. package/utilities/debounce.js +10 -4
  36. package/utilities/mutation.js +5 -0
  37. package/utilities/nearest.js +6 -1
  38. package/utilities/throttle.js +8 -2
  39. package/vendor/idiomorph.min.js +9 -1
  40. package/README.template.md +0 -276
@@ -1,5 +1,5 @@
1
1
  // easily convert a form into a JS object
2
- export default function getDataFromForm(container) {
2
+ function getDataFromForm(container) {
3
3
  const formData = {};
4
4
 
5
5
  // Helper function to process a single element
@@ -57,4 +57,11 @@ export default function getDataFromForm(container) {
57
57
  }
58
58
 
59
59
  return formData;
60
- }
60
+ }
61
+
62
+ // Self-export to window and hyperclay
63
+ window.getDataFromForm = getDataFromForm;
64
+ window.hyperclay = window.hyperclay || {};
65
+ window.hyperclay.getDataFromForm = getDataFromForm;
66
+
67
+ export default getDataFromForm;
@@ -1,4 +1,4 @@
1
- export default function insertStyleTag(href) {
1
+ function insertStyleTag(href) {
2
2
  // First check if there's already a link with this exact href
3
3
  if (document.querySelector(`link[href="${href}"]`)) {
4
4
  return;
@@ -25,4 +25,11 @@ export default function insertStyleTag(href) {
25
25
  link.rel = 'stylesheet';
26
26
  link.href = href;
27
27
  document.head.appendChild(link);
28
- }
28
+ }
29
+
30
+ // Self-export to window and hyperclay
31
+ window.insertStyleTag = insertStyleTag;
32
+ window.hyperclay = window.hyperclay || {};
33
+ window.hyperclay.insertStyleTag = insertStyleTag;
34
+
35
+ export default insertStyleTag;
@@ -1,7 +1,13 @@
1
- export default function onDomReady (callback) {
1
+ function onDomReady (callback) {
2
2
  if (document.readyState === 'loading') {
3
3
  document.addEventListener('DOMContentLoaded', callback);
4
4
  } else {
5
5
  callback();
6
6
  }
7
- }
7
+ }
8
+
9
+ // Self-export to hyperclay only
10
+ window.hyperclay = window.hyperclay || {};
11
+ window.hyperclay.onDomReady = onDomReady;
12
+
13
+ export default onDomReady;
@@ -1,7 +1,13 @@
1
- export default function onLoad (callback) {
1
+ function onLoad (callback) {
2
2
  if (document.readyState === "complete") {
3
3
  callback();
4
4
  } else {
5
5
  window.addEventListener("load", callback);
6
6
  }
7
- }
7
+ }
8
+
9
+ // Self-export to hyperclay only
10
+ window.hyperclay = window.hyperclay || {};
11
+ window.hyperclay.onLoad = onLoad;
12
+
13
+ export default onLoad;