hyperclayjs 1.27.0 → 1.27.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 +2 -2
- package/package.json +1 -1
- package/src/hyperclay.js +1 -1
- package/src/ui/prompts.js +15 -10
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ import 'hyperclayjs/presets/standard.js';
|
|
|
86
86
|
|
|
87
87
|
| Module | Size | Description |
|
|
88
88
|
|--------|------|-------------|
|
|
89
|
-
| dialogs | 8.
|
|
89
|
+
| dialogs | 8.5KB | ask(), consent(), tell(), snippet() dialog functions |
|
|
90
90
|
| the-modal | 22.5KB | Full modal window creation system - window.theModal |
|
|
91
91
|
| toast | 15.8KB | Success/error message notifications, toast(msg, msgType) |
|
|
92
92
|
|
|
@@ -144,7 +144,7 @@ Standard feature set for most use cases
|
|
|
144
144
|
|
|
145
145
|
**Modules:** `save-core`, `snapshot`, `save-system`, `unsaved-warning`, `edit-mode-helpers`, `persist`, `option-visibility`, `event-attrs`, `dom-helpers`, `toast`, `save-toast`, `export-to-window`, `view-mode-excludes-edit-modules`
|
|
146
146
|
|
|
147
|
-
### Everything (~
|
|
147
|
+
### Everything (~236.1KB)
|
|
148
148
|
All available features
|
|
149
149
|
|
|
150
150
|
Includes all available modules across all categories.
|
package/package.json
CHANGED
package/src/hyperclay.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DO NOT EDIT THIS FILE DIRECTLY — it is generated from build/hyperclay.template.js
|
|
3
3
|
*
|
|
4
|
-
* HyperclayJS v1.27.
|
|
4
|
+
* HyperclayJS v1.27.1 - Minimal Browser-Native Loader
|
|
5
5
|
*
|
|
6
6
|
* Modules auto-init when imported (no separate init call needed).
|
|
7
7
|
* Include `export-to-window` feature to export to window.hyperclay.
|
package/src/ui/prompts.js
CHANGED
|
@@ -26,17 +26,22 @@ function createModal(promptText, yesCallback, extraContent = "", includeInput =
|
|
|
26
26
|
promptResult = document.querySelector(".micromodal__input").value;
|
|
27
27
|
if (!promptResult) return false; // keep modal open on empty input
|
|
28
28
|
}
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
// Run the validation callback synchronously so a throw can keep the
|
|
30
|
+
// modal open (callers rely on this — e.g. delete-site confirms by
|
|
31
|
+
// throwing when the typed name doesn't match).
|
|
32
|
+
if (yesCallback) {
|
|
33
|
+
try {
|
|
34
|
+
yesCallback(promptResult);
|
|
35
|
+
} catch (err) {
|
|
36
|
+
toast(err.message || 'An error occurred', 'error');
|
|
37
|
+
return false; // keep modal open, user can retry
|
|
36
38
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
}
|
|
40
|
+
// Defer resolve so downstream .then() handlers don't fire inside this
|
|
41
|
+
// modal's onYes loop — themodal is a singleton, and chained ask()/
|
|
42
|
+
// consent() calls need a clean themodal to set up their state.
|
|
43
|
+
setTimeout(() => resolve(promptResult), 0);
|
|
44
|
+
return true; // allow modal to close
|
|
40
45
|
});
|
|
41
46
|
|
|
42
47
|
themodal.onNo = () => {
|