hyperclayjs 1.2.0 → 1.3.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 +44 -57
- package/communication/behaviorCollector.js +8 -1
- package/communication/sendMessage.js +8 -2
- package/communication/uploadFile.js +8 -2
- package/core/adminSystem.js +3 -0
- package/core/autosave.js +95 -0
- package/core/editmodeSystem.js +10 -8
- package/core/enablePersistentFormInputValues.js +8 -1
- package/core/optionVisibilityRuleGenerator.js +9 -1
- package/core/savePage.js +28 -71
- package/core/savePageCore.js +7 -14
- package/custom-attributes/ajaxElements.js +4 -0
- package/custom-attributes/domHelpers.js +9 -0
- package/custom-attributes/events.js +3 -0
- package/custom-attributes/inputHelpers.js +3 -0
- package/custom-attributes/sortable.js +9 -1
- package/dom-utilities/All.js +4 -7
- package/dom-utilities/getDataFromForm.js +9 -2
- package/dom-utilities/insertStyleTag.js +9 -2
- package/dom-utilities/onDomReady.js +8 -2
- package/dom-utilities/onLoad.js +8 -2
- package/hyperclay.js +106 -692
- package/module-dependency-graph.json +175 -137
- package/package.json +3 -3
- package/string-utilities/copy-to-clipboard.js +3 -7
- package/string-utilities/emmet-html.js +8 -2
- package/string-utilities/query.js +8 -1
- package/string-utilities/slugify.js +4 -7
- package/ui/info.js +9 -1
- package/ui/prompts.js +19 -12
- package/ui/theModal.js +4 -4
- package/ui/toast-hyperclay.js +5 -9
- package/ui/toast.js +4 -7
- package/utilities/cookie.js +4 -7
- package/utilities/debounce.js +10 -4
- package/utilities/mutation.js +5 -0
- package/utilities/nearest.js +6 -1
- package/utilities/throttle.js +8 -2
- package/vendor/idiomorph.min.js +9 -1
- package/README.template.md +0 -276
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// easily convert a form into a JS object
|
|
2
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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;
|
package/dom-utilities/onLoad.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
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;
|