hyperclayjs 1.3.1 → 1.5.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 +79 -45
- package/communication/behaviorCollector.js +7 -4
- package/communication/sendMessage.js +7 -4
- package/communication/uploadFile.js +8 -5
- package/core/autosave.js +7 -51
- 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 +136 -26
- package/core/savePageCore.js +25 -9
- package/core/saveToast.js +37 -0
- package/custom-attributes/domHelpers.js +7 -4
- package/custom-attributes/onaftersave.js +41 -0
- 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 +96 -31
- package/module-dependency-graph.json +135 -136
- 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
package/LICENSE
CHANGED
|
@@ -19,3 +19,24 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Third-Party Licenses
|
|
26
|
+
|
|
27
|
+
This project includes the following third-party libraries:
|
|
28
|
+
|
|
29
|
+
### Idiomorph
|
|
30
|
+
- Copyright (c) Big Sky Software
|
|
31
|
+
- License: 0BSD (Zero-Clause BSD)
|
|
32
|
+
- https://github.com/bigskysoftware/idiomorph
|
|
33
|
+
|
|
34
|
+
### Tailwind CSS
|
|
35
|
+
- Copyright (c) Tailwind Labs, Inc.
|
|
36
|
+
- License: MIT
|
|
37
|
+
- https://github.com/tailwindlabs/tailwindcss
|
|
38
|
+
|
|
39
|
+
### Sortable.js
|
|
40
|
+
- Copyright (c) All contributors to Sortable
|
|
41
|
+
- License: MIT
|
|
42
|
+
- https://github.com/SortableJS/Sortable
|
package/README.md
CHANGED
|
@@ -15,22 +15,27 @@ A modular JavaScript library for building interactive HTML applications with Hyp
|
|
|
15
15
|
|
|
16
16
|
### Using CDN (Self-detecting Loader)
|
|
17
17
|
|
|
18
|
-
The self-detecting loader reads URL parameters and automatically loads the requested features with all dependencies
|
|
18
|
+
The self-detecting loader reads URL parameters and automatically loads the requested features with all dependencies.
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
<!-- Minimal setup -->
|
|
22
|
-
<script src="https://hyperclay.com/js/hyperclay.js?preset=minimal" type="module"></script>
|
|
20
|
+
Destructure directly from the import:
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
<script
|
|
22
|
+
```html
|
|
23
|
+
<script type="module">
|
|
24
|
+
const { toast, savePage } = await import('https://cdn.jsdelivr.net/npm/hyperclayjs@1/hyperclay.js?preset=standard');
|
|
25
|
+
toast('Hello!');
|
|
26
|
+
</script>
|
|
27
|
+
```
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
<script src="https://hyperclay.com/js/hyperclay.js?features=save,admin,toast,ajax" type="module"></script>
|
|
29
|
+
Or with custom features:
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
<script
|
|
31
|
+
```html
|
|
32
|
+
<script type="module">
|
|
33
|
+
const { toast, ask } = await import('https://cdn.jsdelivr.net/npm/hyperclayjs@1/hyperclay.js?features=toast,dialogs');
|
|
34
|
+
</script>
|
|
32
35
|
```
|
|
33
36
|
|
|
37
|
+
**Note:** Presets include `export-to-window` by default, which also exports to `window.hyperclay`. Omit it from custom features if you only want ES module exports.
|
|
38
|
+
|
|
34
39
|
### Using NPM
|
|
35
40
|
|
|
36
41
|
```bash
|
|
@@ -52,91 +57,112 @@ import 'hyperclayjs/presets/standard.js';
|
|
|
52
57
|
|
|
53
58
|
| Module | Size | Description |
|
|
54
59
|
|--------|------|-------------|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
| edit-mode |
|
|
60
|
+
| autosave | 1.1KB | Auto-save on DOM changes, unsaved changes warning |
|
|
61
|
+
| edit-mode | 1.8KB | Toggle edit mode on hyperclay on/off |
|
|
62
|
+
| edit-mode-helpers | 5.4KB | Admin-only functionality: [edit-mode-input], [edit-mode-resource], [edit-mode-onclick] |
|
|
58
63
|
| option-visibility | 4.7KB | Dynamic show/hide based on ancestor state with option:attribute="value" |
|
|
59
|
-
| persist | 2.
|
|
60
|
-
| save-core |
|
|
61
|
-
| save-system |
|
|
64
|
+
| persist | 2.5KB | Persist input/select/textarea values to the DOM with [persist] attribute |
|
|
65
|
+
| save-core | 6.3KB | Basic save function only - hyperclay.savePage() |
|
|
66
|
+
| save-system | 7KB | Manual save: keyboard shortcut (CMD+S), save button, change tracking |
|
|
67
|
+
| save-toast | 0.9KB | Toast notifications for save events (opt-in) |
|
|
62
68
|
|
|
63
69
|
### Custom Attributes (HTML enhancements)
|
|
64
70
|
|
|
65
71
|
| Module | Size | Description |
|
|
66
72
|
|--------|------|-------------|
|
|
67
73
|
| ajax-elements | 2.8KB | [ajax-form], [ajax-button] for async form submissions |
|
|
68
|
-
| dom-helpers | 5.
|
|
74
|
+
| dom-helpers | 5.7KB | el.nearest, el.val, el.text, el.exec, el.cycle |
|
|
69
75
|
| event-attrs | 3.6KB | [onclickaway], [onclone], [onpagemutation], [onrender] |
|
|
70
76
|
| input-helpers | 1.2KB | [prevent-enter], [autosize] for textareas |
|
|
71
|
-
|
|
|
77
|
+
| onaftersave | 1.2KB | [onaftersave] attribute - run JS when save status changes |
|
|
78
|
+
| sortable | 2.8KB | Drag-drop sorting with [sortable], lazy-loads ~118KB Sortable.js in edit mode |
|
|
72
79
|
|
|
73
80
|
### UI Components (User interface elements)
|
|
74
81
|
|
|
75
82
|
| Module | Size | Description |
|
|
76
83
|
|--------|------|-------------|
|
|
77
|
-
| dialogs |
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
| toast | 7.
|
|
84
|
+
| dialogs | 8.4KB | ask(), consent(), tell(), snippet() dialog functions |
|
|
85
|
+
| tailwind-play | 0.7KB | Live Tailwind CSS editing, lazy-loads ~370KB script in edit mode only |
|
|
86
|
+
| the-modal | 19.8KB | Full modal window creation system - window.theModal |
|
|
87
|
+
| toast | 7.7KB | Success/error message notifications, toast(msg, msgType) |
|
|
81
88
|
|
|
82
89
|
### Utilities (Core utilities (often auto-included))
|
|
83
90
|
|
|
84
91
|
| Module | Size | Description |
|
|
85
92
|
|--------|------|-------------|
|
|
86
|
-
| cookie | 1.
|
|
93
|
+
| cookie | 1.4KB | Cookie management (often auto-included) |
|
|
87
94
|
| debounce | 0.4KB | Function debouncing |
|
|
88
|
-
| mutation |
|
|
89
|
-
| nearest | 3.
|
|
90
|
-
| throttle | 0.
|
|
95
|
+
| mutation | 13KB | DOM mutation observation (often auto-included) |
|
|
96
|
+
| nearest | 3.4KB | Find nearest elements (often auto-included) |
|
|
97
|
+
| throttle | 0.8KB | Function throttling |
|
|
91
98
|
|
|
92
99
|
### DOM Utilities (DOM manipulation helpers)
|
|
93
100
|
|
|
94
101
|
| Module | Size | Description |
|
|
95
102
|
|--------|------|-------------|
|
|
96
|
-
| all-js |
|
|
97
|
-
| dom-ready | 0.
|
|
98
|
-
| form-data |
|
|
99
|
-
| style-injection | 1KB | Dynamic stylesheet injection |
|
|
103
|
+
| all-js | 14KB | Full DOM manipulation library |
|
|
104
|
+
| dom-ready | 0.4KB | DOM ready callback |
|
|
105
|
+
| form-data | 2KB | Extract form data as an object |
|
|
106
|
+
| style-injection | 1.1KB | Dynamic stylesheet injection |
|
|
100
107
|
|
|
101
108
|
### String Utilities (String manipulation helpers)
|
|
102
109
|
|
|
103
110
|
| Module | Size | Description |
|
|
104
111
|
|--------|------|-------------|
|
|
105
|
-
| clipboard | 0.
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
| slugify | 0.6KB | URL-friendly slug generator |
|
|
112
|
+
| copy-to-clipboard | 0.9KB | Clipboard utility |
|
|
113
|
+
| query-params | 0.3KB | Parse URL search params |
|
|
114
|
+
| slugify | 0.7KB | URL-friendly slug generator |
|
|
109
115
|
|
|
110
116
|
### Communication & Files (File handling and messaging)
|
|
111
117
|
|
|
112
118
|
| Module | Size | Description |
|
|
113
119
|
|--------|------|-------------|
|
|
114
|
-
| file-upload | 10.
|
|
115
|
-
| send-message | 1.
|
|
120
|
+
| file-upload | 10.7KB | File upload with progress |
|
|
121
|
+
| send-message | 1.4KB | Message sending utility |
|
|
116
122
|
|
|
117
123
|
### Vendor Libraries (Third-party libraries)
|
|
118
124
|
|
|
119
125
|
| Module | Size | Description |
|
|
120
126
|
|--------|------|-------------|
|
|
121
|
-
| idiomorph | 8.
|
|
127
|
+
| idiomorph | 8.2KB | Efficient DOM morphing library |
|
|
122
128
|
|
|
123
129
|
## Presets
|
|
124
130
|
|
|
125
|
-
### Minimal (~
|
|
131
|
+
### Minimal (~27.7KB)
|
|
126
132
|
Essential features for basic editing
|
|
127
133
|
|
|
128
|
-
**Modules:** `save-core`, `save-system`, `
|
|
134
|
+
**Modules:** `save-core`, `save-system`, `edit-mode-helpers`, `toast`, `save-toast`, `export-to-window`
|
|
129
135
|
|
|
130
|
-
### Standard (~
|
|
136
|
+
### Standard (~44.2KB)
|
|
131
137
|
Standard feature set for most use cases
|
|
132
138
|
|
|
133
|
-
**Modules:** `save-core`, `save-system`, `
|
|
139
|
+
**Modules:** `save-core`, `save-system`, `edit-mode-helpers`, `persist`, `option-visibility`, `event-attrs`, `dom-helpers`, `toast`, `save-toast`, `export-to-window`
|
|
134
140
|
|
|
135
|
-
### Everything (~
|
|
141
|
+
### Everything (~149.6KB)
|
|
136
142
|
All available features
|
|
137
143
|
|
|
138
144
|
Includes all available modules across all categories.
|
|
139
145
|
|
|
146
|
+
## Lazy-Loaded Modules
|
|
147
|
+
|
|
148
|
+
Some modules with large vendor dependencies are **lazy-loaded** to optimize page performance:
|
|
149
|
+
|
|
150
|
+
| Module | Wrapper Size | Vendor Size | Loaded When |
|
|
151
|
+
|--------|-------------|-------------|-------------|
|
|
152
|
+
| `sortable` | ~3KB | ~118KB | Edit mode only |
|
|
153
|
+
| `tailwind-play` | ~1KB | ~370KB | Edit mode only |
|
|
154
|
+
|
|
155
|
+
**How it works:**
|
|
156
|
+
- The wrapper module checks if the page is in edit mode (`isEditMode`)
|
|
157
|
+
- If true, it injects a `<script save-ignore>` tag that loads the vendor script
|
|
158
|
+
- If false, nothing is loaded - viewers don't download the heavy scripts
|
|
159
|
+
- The `save-ignore` attribute strips the script tag when the page is saved
|
|
160
|
+
|
|
161
|
+
This means:
|
|
162
|
+
- **Editors** get full functionality when needed
|
|
163
|
+
- **Viewers** never download ~500KB of vendor scripts
|
|
164
|
+
- **Saved pages** stay clean with no leftover script tags
|
|
165
|
+
|
|
140
166
|
## Visual Configurator
|
|
141
167
|
|
|
142
168
|
Explore features and build your custom bundle with our interactive configurator:
|
|
@@ -217,7 +243,7 @@ The configurator dynamically loads this file to always show accurate information
|
|
|
217
243
|
- Safari 15.4+
|
|
218
244
|
- Edge 89+
|
|
219
245
|
|
|
220
|
-
The loader uses top-level await
|
|
246
|
+
The loader uses ES modules with top-level await. Use `await import()` to ensure modules finish loading before your code runs.
|
|
221
247
|
|
|
222
248
|
## API Examples
|
|
223
249
|
|
|
@@ -278,7 +304,7 @@ tell("Welcome to Hyperclay!");
|
|
|
278
304
|
Click outside this div
|
|
279
305
|
</div>
|
|
280
306
|
|
|
281
|
-
<!-- Persist
|
|
307
|
+
<!-- Persist input/select/textarea values -->
|
|
282
308
|
<input type="text" name="username" persist>
|
|
283
309
|
```
|
|
284
310
|
|
|
@@ -320,7 +346,7 @@ myFeature();
|
|
|
320
346
|
<script src="/js/hyperclay.js?preset=standard" type="module"></script>
|
|
321
347
|
|
|
322
348
|
<!-- Or specific features -->
|
|
323
|
-
<script src="/js/hyperclay.js?features=save,
|
|
349
|
+
<script src="/js/hyperclay.js?features=save,edit-mode-helpers,toast" type="module"></script>
|
|
324
350
|
```
|
|
325
351
|
|
|
326
352
|
## Contributing
|
|
@@ -338,6 +364,14 @@ myFeature();
|
|
|
338
364
|
|
|
339
365
|
MIT © Hyperclay
|
|
340
366
|
|
|
367
|
+
### Third-Party Credits
|
|
368
|
+
|
|
369
|
+
This project includes the following open-source libraries:
|
|
370
|
+
|
|
371
|
+
- **[Idiomorph](https://github.com/bigskysoftware/idiomorph)** - DOM morphing library by Big Sky Software (0BSD)
|
|
372
|
+
- **[Tailwind CSS](https://github.com/tailwindlabs/tailwindcss)** - Utility-first CSS framework by Tailwind Labs (MIT)
|
|
373
|
+
- **[Sortable.js](https://github.com/SortableJS/Sortable)** - Drag-and-drop library (MIT)
|
|
374
|
+
|
|
341
375
|
## Links
|
|
342
376
|
|
|
343
377
|
- [Documentation](https://hyperclay.com/docs)
|
|
@@ -222,9 +222,12 @@ const behaviorCollector = (() => {
|
|
|
222
222
|
};
|
|
223
223
|
})();
|
|
224
224
|
|
|
225
|
-
//
|
|
226
|
-
|
|
227
|
-
window.hyperclay
|
|
225
|
+
// Auto-export to window unless suppressed by loader
|
|
226
|
+
if (!window.__hyperclayNoAutoExport) {
|
|
227
|
+
window.hyperclay = window.hyperclay || {};
|
|
228
|
+
window.hyperclay.behaviorCollector = behaviorCollector;
|
|
229
|
+
window.h = window.hyperclay;
|
|
230
|
+
}
|
|
228
231
|
|
|
229
232
|
export default behaviorCollector;
|
|
230
233
|
|
|
@@ -234,4 +237,4 @@ export function init() {
|
|
|
234
237
|
}
|
|
235
238
|
|
|
236
239
|
// Auto-init when module is imported
|
|
237
|
-
init();
|
|
240
|
+
init();
|
|
@@ -47,8 +47,11 @@ function sendMessage(eventOrObj, successMessage = "Successfully sent", callback)
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
window.hyperclay
|
|
50
|
+
// Auto-export to window unless suppressed by loader
|
|
51
|
+
if (!window.__hyperclayNoAutoExport) {
|
|
52
|
+
window.hyperclay = window.hyperclay || {};
|
|
53
|
+
window.hyperclay.sendMessage = sendMessage;
|
|
54
|
+
window.h = window.hyperclay;
|
|
55
|
+
}
|
|
53
56
|
|
|
54
|
-
export default sendMessage;
|
|
57
|
+
export default sendMessage;
|
|
@@ -347,8 +347,11 @@ function detectContentType(content) {
|
|
|
347
347
|
return { type: "txt", mime: "text/plain", extension: ".txt" };
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
//
|
|
351
|
-
|
|
352
|
-
window.hyperclay
|
|
353
|
-
window.hyperclay.
|
|
354
|
-
window.hyperclay.
|
|
350
|
+
// Auto-export to window unless suppressed by loader
|
|
351
|
+
if (!window.__hyperclayNoAutoExport) {
|
|
352
|
+
window.hyperclay = window.hyperclay || {};
|
|
353
|
+
window.hyperclay.uploadFile = uploadFile;
|
|
354
|
+
window.hyperclay.createFile = createFile;
|
|
355
|
+
window.hyperclay.uploadFileBasic = uploadFileBasic;
|
|
356
|
+
window.h = window.hyperclay;
|
|
357
|
+
}
|
package/core/autosave.js
CHANGED
|
@@ -4,67 +4,27 @@
|
|
|
4
4
|
* Automatically saves page on DOM changes with throttling.
|
|
5
5
|
* Warns before leaving page with unsaved changes.
|
|
6
6
|
*
|
|
7
|
-
* Requires the 'save' module to be loaded first.
|
|
7
|
+
* Requires the 'save-system' module to be loaded first.
|
|
8
|
+
* For toast notifications, also load the 'save-toast' module.
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
|
-
import toast from "../ui/toast.js";
|
|
11
|
-
import throttle from "../utilities/throttle.js";
|
|
12
11
|
import Mutation from "../utilities/mutation.js";
|
|
13
12
|
import { isEditMode, isOwner } from "./isAdminOfCurrentResource.js";
|
|
14
|
-
import { getPageContents } from "./savePageCore.js";
|
|
15
13
|
import {
|
|
16
|
-
|
|
17
|
-
getUnsavedChanges
|
|
18
|
-
setUnsavedChanges,
|
|
19
|
-
getLastSavedContents
|
|
14
|
+
savePageThrottled,
|
|
15
|
+
getUnsavedChanges
|
|
20
16
|
} from "./savePage.js";
|
|
21
17
|
|
|
22
|
-
let baselineContents = '';
|
|
23
|
-
|
|
24
|
-
// Capture baseline after setup mutations settle
|
|
25
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
26
|
-
if (isEditMode) {
|
|
27
|
-
setTimeout(() => {
|
|
28
|
-
baselineContents = getPageContents();
|
|
29
|
-
}, 1500);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Throttled version of savePage for auto-save
|
|
35
|
-
*/
|
|
36
|
-
const throttledSave = throttle(savePage, 1200);
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Save the page with throttling, for use with auto-save
|
|
40
|
-
* Checks both baseline and last saved content to prevent saves from initial setup
|
|
41
|
-
*
|
|
42
|
-
* @param {Function} callback - Optional callback
|
|
43
|
-
*/
|
|
44
|
-
export function savePageThrottled(callback = () => {}) {
|
|
45
|
-
if (!isEditMode) return;
|
|
46
|
-
|
|
47
|
-
const currentContents = getPageContents();
|
|
48
|
-
// For autosave: check both that content changed from baseline AND from last save
|
|
49
|
-
// This prevents saves from initial setup mutations
|
|
50
|
-
if (currentContents !== baselineContents && currentContents !== getLastSavedContents()) {
|
|
51
|
-
setUnsavedChanges(true);
|
|
52
|
-
throttledSave(callback);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
18
|
/**
|
|
57
19
|
* Initialize auto-save on DOM changes
|
|
58
20
|
* Uses debounced mutation observer
|
|
59
21
|
*/
|
|
60
|
-
|
|
22
|
+
function initSavePageOnChange() {
|
|
61
23
|
Mutation.onAnyChange({
|
|
62
24
|
debounce: 3333,
|
|
63
25
|
omitChangeDetails: true
|
|
64
26
|
}, () => {
|
|
65
|
-
savePageThrottled(
|
|
66
|
-
if (msg) toast(msg, msgType);
|
|
67
|
-
});
|
|
27
|
+
savePageThrottled();
|
|
68
28
|
});
|
|
69
29
|
}
|
|
70
30
|
|
|
@@ -83,13 +43,9 @@ function init() {
|
|
|
83
43
|
initSavePageOnChange();
|
|
84
44
|
}
|
|
85
45
|
|
|
86
|
-
//
|
|
87
|
-
window.hyperclay = window.hyperclay || {};
|
|
88
|
-
window.hyperclay.savePageThrottled = savePageThrottled;
|
|
89
|
-
window.hyperclay.initSavePageOnChange = initSavePageOnChange;
|
|
46
|
+
// No window exports - savePageThrottled is exported from save-system
|
|
90
47
|
|
|
91
48
|
// Auto-init when module is imported
|
|
92
49
|
init();
|
|
93
50
|
|
|
94
|
-
export { init, savePageThrottled, initSavePageOnChange };
|
|
95
51
|
export default init;
|
package/core/editmodeSystem.js
CHANGED
|
@@ -7,11 +7,14 @@ function init() {
|
|
|
7
7
|
initPageType();
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
window.hyperclay
|
|
13
|
-
window.hyperclay.
|
|
14
|
-
window.hyperclay.
|
|
10
|
+
// Auto-export to window unless suppressed by loader
|
|
11
|
+
if (!window.__hyperclayNoAutoExport) {
|
|
12
|
+
window.hyperclay = window.hyperclay || {};
|
|
13
|
+
window.hyperclay.toggleEditMode = toggleEditMode;
|
|
14
|
+
window.hyperclay.isEditMode = isEditMode;
|
|
15
|
+
window.hyperclay.isOwner = isOwner;
|
|
16
|
+
window.h = window.hyperclay;
|
|
17
|
+
}
|
|
15
18
|
|
|
16
19
|
// Auto-init when module is imported
|
|
17
20
|
init();
|
|
@@ -61,9 +61,12 @@ export function init() {
|
|
|
61
61
|
enablePersistentFormInputValues("[persist]");
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
window.hyperclay
|
|
64
|
+
// Auto-export to window unless suppressed by loader
|
|
65
|
+
if (!window.__hyperclayNoAutoExport) {
|
|
66
|
+
window.hyperclay = window.hyperclay || {};
|
|
67
|
+
window.hyperclay.enablePersistentFormInputValues = enablePersistentFormInputValues;
|
|
68
|
+
window.h = window.hyperclay;
|
|
69
|
+
}
|
|
67
70
|
|
|
68
71
|
// Auto-init when module is imported
|
|
69
|
-
init();
|
|
72
|
+
init();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Export to Window Module
|
|
3
|
+
*
|
|
4
|
+
* When loaded FIRST by the loader, this flips the __hyperclayNoAutoExport flag
|
|
5
|
+
* to false, allowing subsequent modules to self-export to window.hyperclay.
|
|
6
|
+
*
|
|
7
|
+
* This module is included in all presets by default.
|
|
8
|
+
* Exclude it if you prefer ES module-only imports (no window pollution).
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// Flip the flag so modules will auto-export
|
|
12
|
+
window.__hyperclayNoAutoExport = false;
|
|
13
|
+
|
|
14
|
+
export default true;
|
|
@@ -152,10 +152,13 @@ const optionVisibilityRuleGenerator = {
|
|
|
152
152
|
},
|
|
153
153
|
};
|
|
154
154
|
|
|
155
|
-
//
|
|
156
|
-
window.
|
|
157
|
-
window.
|
|
158
|
-
window.hyperclay
|
|
155
|
+
// Auto-export to window unless suppressed by loader
|
|
156
|
+
if (!window.__hyperclayNoAutoExport) {
|
|
157
|
+
window.optionVisibilityRuleGenerator = optionVisibilityRuleGenerator;
|
|
158
|
+
window.hyperclay = window.hyperclay || {};
|
|
159
|
+
window.hyperclay.optionVisibilityRuleGenerator = optionVisibilityRuleGenerator;
|
|
160
|
+
window.h = window.hyperclay;
|
|
161
|
+
}
|
|
159
162
|
|
|
160
163
|
export default optionVisibilityRuleGenerator;
|
|
161
164
|
|
|
@@ -165,4 +168,4 @@ export function init() {
|
|
|
165
168
|
}
|
|
166
169
|
|
|
167
170
|
// Auto-init when module is imported
|
|
168
|
-
init();
|
|
171
|
+
init();
|