hyperclayjs 1.3.1 → 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/LICENSE +21 -0
- package/README.md +77 -45
- package/communication/behaviorCollector.js +7 -4
- package/communication/sendMessage.js +7 -4
- package/communication/uploadFile.js +8 -5
- package/core/autosave.js +5 -47
- package/core/editmodeSystem.js +8 -5
- package/core/enablePersistentFormInputValues.js +7 -4
- package/core/exportToWindow.js +14 -0
- package/core/optionVisibilityRuleGenerator.js +8 -5
- package/core/savePage.js +47 -14
- package/core/savePageCore.js +10 -7
- package/custom-attributes/domHelpers.js +7 -4
- package/custom-attributes/sortable.js +23 -16
- package/dom-utilities/All.js +9 -6
- package/dom-utilities/getDataFromForm.js +8 -5
- package/dom-utilities/insertStyleTag.js +8 -5
- package/dom-utilities/onDomReady.js +7 -4
- package/dom-utilities/onLoad.js +7 -4
- package/hyperclay.js +90 -31
- package/module-dependency-graph.json +103 -135
- package/package.json +1 -1
- package/string-utilities/copy-to-clipboard.js +7 -4
- package/string-utilities/query.js +8 -5
- package/string-utilities/slugify.js +8 -5
- package/ui/prompts.js +49 -31
- package/ui/theModal.js +50 -6
- package/ui/toast-hyperclay.js +27 -11
- package/ui/toast.js +82 -92
- package/utilities/cookie.js +8 -5
- package/utilities/debounce.js +7 -4
- package/utilities/loadVendorScript.js +57 -0
- package/utilities/mutation.js +9 -6
- package/utilities/nearest.js +7 -4
- package/utilities/throttle.js +7 -4
- package/vendor/Sortable.vendor.js +2 -0
- package/vendor/idiomorph.min.js +8 -5
- package/vendor/tailwind-play.js +16 -162
- package/vendor/tailwind-play.vendor.js +169 -0
- package/string-utilities/emmet-html.js +0 -60
- package/ui/info.js +0 -47
- package/vendor/Sortable.js +0 -3351
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
function emmet(strings, ...values) {
|
|
2
|
-
// Extract the Emmet syntax from the first string
|
|
3
|
-
let emmetSyntax = strings[0];
|
|
4
|
-
|
|
5
|
-
// Reconstruct the content from the rest of the strings and values
|
|
6
|
-
let content = '';
|
|
7
|
-
for (let i = 1; i < strings.length; i++) {
|
|
8
|
-
content += values[i - 1];
|
|
9
|
-
content += strings[i];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// Parse the tag name
|
|
13
|
-
let tagMatch = emmetSyntax.match(/^([a-zA-Z][a-zA-Z0-9]*)/);
|
|
14
|
-
let tagName = tagMatch ? tagMatch[1] : 'div'; // Default to 'div' if no tag name is provided
|
|
15
|
-
|
|
16
|
-
// Parse class names
|
|
17
|
-
let classRegex = /\.([a-zA-Z0-9_-]+)/g;
|
|
18
|
-
let classNames = [];
|
|
19
|
-
let classMatch;
|
|
20
|
-
while ((classMatch = classRegex.exec(emmetSyntax)) !== null) {
|
|
21
|
-
classNames.push(classMatch[1]);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Parse attributes
|
|
25
|
-
let attrRegex = /\[([^\]=]+)=([^\]]+)\]/g;
|
|
26
|
-
let attributes = {};
|
|
27
|
-
let attrMatch;
|
|
28
|
-
while ((attrMatch = attrRegex.exec(emmetSyntax)) !== null) {
|
|
29
|
-
attributes[attrMatch[1]] = attrMatch[2];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Build the opening tag
|
|
33
|
-
let html = `<${tagName}`;
|
|
34
|
-
|
|
35
|
-
// Add classes if any
|
|
36
|
-
if (classNames.length > 0) {
|
|
37
|
-
html += ` class="${classNames.join(' ')}"`;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Add attributes if any
|
|
41
|
-
for (let attr in attributes) {
|
|
42
|
-
html += ` ${attr}="${attributes[attr]}"`;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
html += '>';
|
|
46
|
-
|
|
47
|
-
// Add the content
|
|
48
|
-
html += content;
|
|
49
|
-
|
|
50
|
-
// Close the tag
|
|
51
|
-
html += `</${tagName}>`;
|
|
52
|
-
|
|
53
|
-
return html;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Self-export to hyperclay only
|
|
57
|
-
window.hyperclay = window.hyperclay || {};
|
|
58
|
-
window.hyperclay.emmet = emmet;
|
|
59
|
-
|
|
60
|
-
export default emmet;
|
package/ui/info.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import themodal from "./theModal.js";
|
|
2
|
-
import onDomReady from "../dom-utilities/onDomReady.js";
|
|
3
|
-
|
|
4
|
-
const CLOSE_BUTTON_SVG = `<svg class="group" viewBox="0 0 134 134" fill="none" xmlns="http://www.w3.org/2000/svg"><path class="fill-[#1D2032] group-hover:fill-[#212543]" d="M132 132.5 1 1.5h131v131Z" /><path fill-rule="evenodd" clip-rule="evenodd" d="M0 0h3v1.5h1.5V3H6v1.5h1.5V6H9v1.5h1.5V9H12v1.5h1.5V12H15v1.5h1.5V15H18v1.5h1.5V18H21v1.5h1.5V21H24v1.5h1.5V24H27v1.5h1.5V27H30v1.5h1.5V30H33v1.5h1.5V33H36v1.5h1.5V36H39v1.5h1.5V39H42v1.5h1.5V42H45v1.5h1.5V45H48v1.5h1.5V48H51v1.5h1.5V51H54v1.5h1.5V54H57v1.5h1.5V57H60v1.5h1.5V60H63v1.5h1.5V63H66v1.5h1.5V66H69v1.5h1.5V69H72v1.5h1.5V72H75v1.5h1.5V75H78v1.5h1.5V78H81v1.5h1.5V81H84v1.5h1.5V84H87v1.5h1.5V87H90v1.5h1.5V90H93v1.5h1.5V93H96v1.5h1.5V96H99v1.5h1.5V99h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v3h-3V132H129v-1.5h-1.5V129H126v-1.5h-1.5V126H123v-1.5h-1.5V123H120v-1.5h-1.5V120H117v-1.5h-1.5V117H114v-1.5h-1.5V114H111v-1.5h-1.5V111H108v-1.5h-1.5V108H105v-1.5h-1.5V105H102v-1.5h-1.5V102H99v-1.5h-1.5V99H96v-1.5h-1.5V96H93v-1.5h-1.5V93H90v-1.5h-1.5V90H87v-1.5h-1.5V87H84v-1.5h-1.5V84H81v-1.5h-1.5V81H78v-1.5h-1.5V78H75v-1.5h-1.5V75H72v-1.5h-1.5V72H69v-1.5h-1.5V69H66v-1.5h-1.5V66H63v-1.5h-1.5V63H60v-1.5h-1.5V60H57v-1.5h-1.5V57H54v-1.5h-1.5V54H51v-1.5h-1.5V51H48v-1.5h-1.5V48H45v-1.5h-1.5V45H42v-1.5h-1.5V42H39v-1.5h-1.5V39H36v-1.5h-1.5V36H33v-1.5h-1.5V33H30v-1.5h-1.5V30H27v-1.5h-1.5V27H24v-1.5h-1.5V24H21v-1.5h-1.5V21H18v-1.5h-1.5V18H15v-1.5h-1.5V15H12v-1.5h-1.5V12H9v-1.5H7.5V9H6V7.5H4.5V6H3V4.5H1.5V3H0V0ZM108.8 22h5.2v5.1h-2.6v2.6H109v2.6h-2.6v2.6h-2.6v2.5h-2.6v5.2h2.6V45h2.6v2.6h2.6v2.6h2.5v2.6h2.6V58h-5.1v-2.6h-2.6V53h-2.6v-2.6h-2.6v-2.6h-2.5v-2.6h-5.2v2.6H91v2.6h-2.6v2.6h-2.6v2.5h-2.6V58H78v-5.1h2.6v-2.6H83v-2.6h2.6v-2.6h2.6v-2.5h2.6v-5.2h-2.6V35h-2.6v-2.6h-2.6v-2.6h-2.5v-2.6H78V22h5.2v2.6h2.5V27h2.6v2.6h2.6v2.6h2.5v2.6h5.2v-2.6h2.5v-2.6h2.6v-2.6h2.6v-2.5h2.5V22Z" fill="#fff"/></svg>`;
|
|
5
|
-
const CONFIRM_BUTTON_SVG = `<div style="width: 28px;"><svg viewBox="0 0 60 33" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M34.5 0.75H43.5V5.25H49V9.75H54.5V14.25H60V18.75H54.5V23.25H49V27.75H43.5V32.25H34.5V27.75H40V23.25H45.5V18.75H0V14.25H45.5V9.75H40V5.25H34.5V0.75Z" fill="white"/></svg></div>`;
|
|
6
|
-
|
|
7
|
-
export function info (promptText, ...content) {
|
|
8
|
-
themodal.html = `<div class="max-w-[440px] space-y-5 mb-7">
|
|
9
|
-
<div class="text-[20px] sm:text-[22px] font-bold">${promptText}</div>
|
|
10
|
-
${content.map(c => `<div class="text-[16px] sm:text-[18px] font-normal">${c}</div>`).join("")}
|
|
11
|
-
</div>`;
|
|
12
|
-
themodal.closeHtml = CLOSE_BUTTON_SVG;
|
|
13
|
-
themodal.yes = CONFIRM_BUTTON_SVG;
|
|
14
|
-
|
|
15
|
-
const promise = new Promise((resolve, reject) => {
|
|
16
|
-
themodal.onYes(() => {
|
|
17
|
-
resolve();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
themodal.onNo = () => {
|
|
21
|
-
reject();
|
|
22
|
-
};
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
themodal.open();
|
|
26
|
-
|
|
27
|
-
return promise;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Auto-initialize - cleanup any leftover modal elements
|
|
31
|
-
export function init() {
|
|
32
|
-
onDomReady(() => {
|
|
33
|
-
const micromodalParentElem = document.querySelector(".micromodal-parent");
|
|
34
|
-
if (micromodalParentElem) {
|
|
35
|
-
micromodalParentElem.remove();
|
|
36
|
-
document.body.style.overflow = "";
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Self-export to window and hyperclay
|
|
42
|
-
window.info = info;
|
|
43
|
-
window.hyperclay = window.hyperclay || {};
|
|
44
|
-
window.hyperclay.info = info;
|
|
45
|
-
|
|
46
|
-
// Auto-init when module is imported
|
|
47
|
-
init();
|