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.
Files changed (42) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +77 -45
  3. package/communication/behaviorCollector.js +7 -4
  4. package/communication/sendMessage.js +7 -4
  5. package/communication/uploadFile.js +8 -5
  6. package/core/autosave.js +5 -47
  7. package/core/editmodeSystem.js +8 -5
  8. package/core/enablePersistentFormInputValues.js +7 -4
  9. package/core/exportToWindow.js +14 -0
  10. package/core/optionVisibilityRuleGenerator.js +8 -5
  11. package/core/savePage.js +47 -14
  12. package/core/savePageCore.js +10 -7
  13. package/custom-attributes/domHelpers.js +7 -4
  14. package/custom-attributes/sortable.js +23 -16
  15. package/dom-utilities/All.js +9 -6
  16. package/dom-utilities/getDataFromForm.js +8 -5
  17. package/dom-utilities/insertStyleTag.js +8 -5
  18. package/dom-utilities/onDomReady.js +7 -4
  19. package/dom-utilities/onLoad.js +7 -4
  20. package/hyperclay.js +90 -31
  21. package/module-dependency-graph.json +103 -135
  22. package/package.json +1 -1
  23. package/string-utilities/copy-to-clipboard.js +7 -4
  24. package/string-utilities/query.js +8 -5
  25. package/string-utilities/slugify.js +8 -5
  26. package/ui/prompts.js +49 -31
  27. package/ui/theModal.js +50 -6
  28. package/ui/toast-hyperclay.js +27 -11
  29. package/ui/toast.js +82 -92
  30. package/utilities/cookie.js +8 -5
  31. package/utilities/debounce.js +7 -4
  32. package/utilities/loadVendorScript.js +57 -0
  33. package/utilities/mutation.js +9 -6
  34. package/utilities/nearest.js +7 -4
  35. package/utilities/throttle.js +7 -4
  36. package/vendor/Sortable.vendor.js +2 -0
  37. package/vendor/idiomorph.min.js +8 -5
  38. package/vendor/tailwind-play.js +16 -162
  39. package/vendor/tailwind-play.vendor.js +169 -0
  40. package/string-utilities/emmet-html.js +0 -60
  41. package/ui/info.js +0 -47
  42. package/vendor/Sortable.js +0 -3351
@@ -47,7 +47,12 @@
47
47
  "core/adminOnClick.js",
48
48
  "core/adminResources.js"
49
49
  ],
50
- "core/autosave.js": [],
50
+ "core/autosave.js": [
51
+ "core/isAdminOfCurrentResource.js",
52
+ "core/savePage.js",
53
+ "ui/toast.js",
54
+ "utilities/mutation.js"
55
+ ],
51
56
  "core/editmode.js": [
52
57
  "core/isAdminOfCurrentResource.js"
53
58
  ],
@@ -59,6 +64,7 @@
59
64
  "core/enablePersistentFormInputValues.js": [
60
65
  "core/savePage.js"
61
66
  ],
67
+ "core/exportToWindow.js": [],
62
68
  "core/isAdminOfCurrentResource.js": [
63
69
  "string-utilities/query.js",
64
70
  "utilities/cookie.js"
@@ -66,7 +72,12 @@
66
72
  "core/optionVisibilityRuleGenerator.js": [
67
73
  "utilities/mutation.js"
68
74
  ],
69
- "core/savePage.js": [],
75
+ "core/savePage.js": [
76
+ "core/isAdminOfCurrentResource.js",
77
+ "core/savePageCore.js",
78
+ "ui/toast.js",
79
+ "utilities/throttle.js"
80
+ ],
70
81
  "core/savePageCore.js": [
71
82
  "core/isAdminOfCurrentResource.js",
72
83
  "utilities/cookie.js"
@@ -109,8 +120,8 @@
109
120
  "custom-attributes/preventEnter.js": [],
110
121
  "custom-attributes/sortable.js": [
111
122
  "core/isAdminOfCurrentResource.js",
112
- "utilities/mutation.js",
113
- "vendor/Sortable.js"
123
+ "utilities/loadVendorScript.js",
124
+ "utilities/mutation.js"
114
125
  ],
115
126
  "dom-utilities/All.js": [],
116
127
  "dom-utilities/getDataFromForm.js": [],
@@ -120,17 +131,11 @@
120
131
  "hyperclay.js": [],
121
132
  "jest.config.js": [],
122
133
  "string-utilities/copy-to-clipboard.js": [],
123
- "string-utilities/emmet-html.js": [],
124
134
  "string-utilities/query.js": [],
125
135
  "string-utilities/slugify.js": [],
126
- "ui/info.js": [
127
- "dom-utilities/onDomReady.js",
128
- "ui/theModal.js"
129
- ],
130
136
  "ui/prompts.js": [
131
137
  "dom-utilities/onDomReady.js",
132
138
  "string-utilities/copy-to-clipboard.js",
133
- "ui/info.js",
134
139
  "ui/theModal.js",
135
140
  "ui/toast.js"
136
141
  ],
@@ -141,13 +146,18 @@
141
146
  "ui/toast.js": [],
142
147
  "utilities/cookie.js": [],
143
148
  "utilities/debounce.js": [],
149
+ "utilities/loadVendorScript.js": [],
144
150
  "utilities/mutation.js": [],
145
151
  "utilities/nearest.js": [],
146
152
  "utilities/pipe.js": [],
147
153
  "utilities/throttle.js": [],
148
- "vendor/Sortable.js": [],
154
+ "vendor/Sortable.vendor.js": [],
149
155
  "vendor/idiomorph.min.js": [],
150
156
  "vendor/tailwind-play.js": [
157
+ "core/isAdminOfCurrentResource.js",
158
+ "utilities/loadVendorScript.js"
159
+ ],
160
+ "vendor/tailwind-play.vendor.js": [
151
161
  "dom-utilities/insertStyleTag.js"
152
162
  ]
153
163
  },
@@ -155,7 +165,7 @@
155
165
  "save-core": {
156
166
  "name": "save-core",
157
167
  "category": "core",
158
- "size": 5.8,
168
+ "size": 5.9,
159
169
  "files": [
160
170
  "core/savePageCore.js"
161
171
  ],
@@ -169,7 +179,7 @@
169
179
  "save-system": {
170
180
  "name": "save-system",
171
181
  "category": "core",
172
- "size": 4.1,
182
+ "size": 4.9,
173
183
  "files": [
174
184
  "core/savePage.js"
175
185
  ],
@@ -181,13 +191,10 @@
181
191
  "savePage": [
182
192
  "hyperclay"
183
193
  ],
184
- "replacePageWith": [
185
- "hyperclay"
186
- ],
187
- "initHyperclaySaveButton": [
194
+ "savePageThrottled": [
188
195
  "hyperclay"
189
196
  ],
190
- "initSaveKeyboardShortcut": [
197
+ "replacePageWith": [
191
198
  "hyperclay"
192
199
  ]
193
200
  }
@@ -195,22 +202,15 @@
195
202
  "autosave": {
196
203
  "name": "autosave",
197
204
  "category": "core",
198
- "size": 2.4,
205
+ "size": 1.2,
199
206
  "files": [
200
207
  "core/autosave.js"
201
208
  ],
202
209
  "description": "Auto-save on DOM changes, unsaved changes warning",
203
- "exports": {
204
- "savePageThrottled": [
205
- "hyperclay"
206
- ],
207
- "initSavePageOnChange": [
208
- "hyperclay"
209
- ]
210
- }
210
+ "exports": {}
211
211
  },
212
- "admin": {
213
- "name": "admin",
212
+ "edit-mode-helpers": {
213
+ "name": "edit-mode-helpers",
214
214
  "category": "core",
215
215
  "size": 5.4,
216
216
  "files": [
@@ -220,22 +220,18 @@
220
220
  "core/adminOnClick.js",
221
221
  "core/adminResources.js"
222
222
  ],
223
- "description": "Hides admin inputs, scripts, contenteditable, onclick for regular viewers",
223
+ "description": "Admin-only functionality: [edit-mode-input], [edit-mode-resource], [edit-mode-onclick]",
224
224
  "exports": {}
225
225
  },
226
226
  "persist": {
227
227
  "name": "persist",
228
228
  "category": "core",
229
- "size": 2.4,
229
+ "size": 2.5,
230
230
  "files": [
231
231
  "core/enablePersistentFormInputValues.js"
232
232
  ],
233
- "description": "Persist form values to the DOM with [persist] attribute",
234
- "exports": {
235
- "enablePersistentFormInputValues": [
236
- "hyperclay"
237
- ]
238
- }
233
+ "description": "Persist input/select/textarea values to the DOM with [persist] attribute",
234
+ "exports": {}
239
235
  },
240
236
  "option-visibility": {
241
237
  "name": "option-visibility",
@@ -245,23 +241,18 @@
245
241
  "core/optionVisibilityRuleGenerator.js"
246
242
  ],
247
243
  "description": "Dynamic show/hide based on ancestor state with option:attribute=\"value\"",
248
- "exports": {
249
- "optionVisibilityRuleGenerator": [
250
- "window",
251
- "hyperclay"
252
- ]
253
- }
244
+ "exports": {}
254
245
  },
255
246
  "edit-mode": {
256
247
  "name": "edit-mode",
257
248
  "category": "core",
258
- "size": 1.7,
249
+ "size": 1.8,
259
250
  "files": [
260
251
  "core/editmodeSystem.js",
261
252
  "core/editmode.js",
262
253
  "core/setPageTypeOnDocumentElement.js"
263
254
  ],
264
- "description": "Toggle edit mode on/off",
255
+ "description": "Toggle edit mode on hyperclay on/off",
265
256
  "exports": {
266
257
  "toggleEditMode": [
267
258
  "hyperclay"
@@ -301,33 +292,22 @@
301
292
  "sortable": {
302
293
  "name": "sortable",
303
294
  "category": "custom-attributes",
304
- "size": 118.1,
295
+ "size": 2.8,
305
296
  "files": [
306
- "custom-attributes/sortable.js",
307
- "vendor/Sortable.js"
297
+ "custom-attributes/sortable.js"
308
298
  ],
309
- "description": "Drag-drop sorting with [sortable] - includes Sortable.js vendor library",
310
- "exports": {
311
- "Sortable": [
312
- "window",
313
- "hyperclay"
314
- ]
315
- }
299
+ "description": "Drag-drop sorting with [sortable], lazy-loads ~118KB Sortable.js in edit mode",
300
+ "exports": {}
316
301
  },
317
302
  "dom-helpers": {
318
303
  "name": "dom-helpers",
319
304
  "category": "custom-attributes",
320
- "size": 5.6,
305
+ "size": 5.7,
321
306
  "files": [
322
307
  "custom-attributes/domHelpers.js"
323
308
  ],
324
309
  "description": "el.nearest, el.val, el.text, el.exec, el.cycle",
325
- "exports": {
326
- "initCustomAttributes": [
327
- "window",
328
- "hyperclay"
329
- ]
330
- }
310
+ "exports": {}
331
311
  },
332
312
  "input-helpers": {
333
313
  "name": "input-helpers",
@@ -344,12 +324,11 @@
344
324
  "dialogs": {
345
325
  "name": "dialogs",
346
326
  "category": "ui",
347
- "size": 11.2,
327
+ "size": 8.4,
348
328
  "files": [
349
- "ui/prompts.js",
350
- "ui/info.js"
329
+ "ui/prompts.js"
351
330
  ],
352
- "description": "ask(), consent(), tell(), info(), snippet() functions",
331
+ "description": "ask(), consent(), tell(), snippet() dialog functions",
353
332
  "exports": {
354
333
  "ask": [
355
334
  "window",
@@ -363,26 +342,19 @@
363
342
  "window",
364
343
  "hyperclay"
365
344
  ],
366
- "info": [
367
- "window",
368
- "hyperclay"
369
- ],
370
345
  "snippet": [
371
346
  "hyperclay"
372
- ],
373
- "showApiKey": [
374
- "hyperclay"
375
347
  ]
376
348
  }
377
349
  },
378
350
  "toast": {
379
351
  "name": "toast",
380
352
  "category": "ui",
381
- "size": 7.3,
353
+ "size": 7.7,
382
354
  "files": [
383
355
  "ui/toast.js"
384
356
  ],
385
- "description": "Success/error message notifications - toast(msg, msgType)",
357
+ "description": "Success/error message notifications, toast(msg, msgType)",
386
358
  "exports": {
387
359
  "toast": [
388
360
  "window",
@@ -393,23 +365,22 @@
393
365
  "toast-hyperclay": {
394
366
  "name": "toast-hyperclay",
395
367
  "category": "ui",
396
- "size": 7.8999999999999995,
368
+ "size": 1,
397
369
  "files": [
398
- "ui/toast-hyperclay.js",
399
- "ui/toast.js"
370
+ "ui/toast-hyperclay.js"
400
371
  ],
401
- "description": "Toast with legacy Hyperclay platform styling (hidden feature)",
372
+ "description": "toastHyperclay() with legacy Hyperclay platform styling (hidden feature)",
402
373
  "exports": {
403
- "toast": [
374
+ "toastHyperclay": [
404
375
  "window",
405
376
  "hyperclay"
406
377
  ]
407
378
  }
408
379
  },
409
- "modal": {
410
- "name": "modal",
380
+ "the-modal": {
381
+ "name": "the-modal",
411
382
  "category": "ui",
412
- "size": 18.5,
383
+ "size": 19.8,
413
384
  "files": [
414
385
  "ui/theModal.js"
415
386
  ],
@@ -424,17 +395,17 @@
424
395
  "tailwind-play": {
425
396
  "name": "tailwind-play",
426
397
  "category": "ui",
427
- "size": 362.3,
398
+ "size": 0.7,
428
399
  "files": [
429
400
  "vendor/tailwind-play.js"
430
401
  ],
431
- "description": "Live Tailwind CSS editing - no need for a build system",
402
+ "description": "Live Tailwind CSS editing, lazy-loads ~370KB script in edit mode only",
432
403
  "exports": {}
433
404
  },
434
405
  "mutation": {
435
406
  "name": "mutation",
436
407
  "category": "utilities",
437
- "size": 12.9,
408
+ "size": 13,
438
409
  "files": [
439
410
  "utilities/mutation.js"
440
411
  ],
@@ -449,7 +420,7 @@
449
420
  "nearest": {
450
421
  "name": "nearest",
451
422
  "category": "utilities",
452
- "size": 3.3,
423
+ "size": 3.4,
453
424
  "files": [
454
425
  "utilities/nearest.js"
455
426
  ],
@@ -464,7 +435,7 @@
464
435
  "cookie": {
465
436
  "name": "cookie",
466
437
  "category": "utilities",
467
- "size": 1.3,
438
+ "size": 1.4,
468
439
  "files": [
469
440
  "utilities/cookie.js"
470
441
  ],
@@ -479,7 +450,7 @@
479
450
  "throttle": {
480
451
  "name": "throttle",
481
452
  "category": "utilities",
482
- "size": 0.7,
453
+ "size": 0.8,
483
454
  "files": [
484
455
  "utilities/throttle.js"
485
456
  ],
@@ -507,7 +478,7 @@
507
478
  "dom-ready": {
508
479
  "name": "dom-ready",
509
480
  "category": "dom-utilities",
510
- "size": 0.3,
481
+ "size": 0.4,
511
482
  "files": [
512
483
  "dom-utilities/onDomReady.js"
513
484
  ],
@@ -521,7 +492,7 @@
521
492
  "window-load": {
522
493
  "name": "window-load",
523
494
  "category": "dom-utilities",
524
- "size": 0.3,
495
+ "size": 0.4,
525
496
  "files": [
526
497
  "dom-utilities/onLoad.js"
527
498
  ],
@@ -535,7 +506,7 @@
535
506
  "all-js": {
536
507
  "name": "all-js",
537
508
  "category": "dom-utilities",
538
- "size": 13.9,
509
+ "size": 14,
539
510
  "files": [
540
511
  "dom-utilities/All.js"
541
512
  ],
@@ -550,7 +521,7 @@
550
521
  "style-injection": {
551
522
  "name": "style-injection",
552
523
  "category": "dom-utilities",
553
- "size": 1,
524
+ "size": 1.1,
554
525
  "files": [
555
526
  "dom-utilities/insertStyleTag.js"
556
527
  ],
@@ -565,7 +536,7 @@
565
536
  "form-data": {
566
537
  "name": "form-data",
567
538
  "category": "dom-utilities",
568
- "size": 1.9,
539
+ "size": 2,
569
540
  "files": [
570
541
  "dom-utilities/getDataFromForm.js"
571
542
  ],
@@ -580,7 +551,7 @@
580
551
  "idiomorph": {
581
552
  "name": "idiomorph",
582
553
  "category": "vendor",
583
- "size": 8.1,
554
+ "size": 8.2,
584
555
  "files": [
585
556
  "vendor/idiomorph.min.js"
586
557
  ],
@@ -594,7 +565,7 @@
594
565
  "slugify": {
595
566
  "name": "slugify",
596
567
  "category": "string-utilities",
597
- "size": 0.6,
568
+ "size": 0.7,
598
569
  "files": [
599
570
  "string-utilities/slugify.js"
600
571
  ],
@@ -606,24 +577,10 @@
606
577
  ]
607
578
  }
608
579
  },
609
- "emmet": {
610
- "name": "emmet",
580
+ "copy-to-clipboard": {
581
+ "name": "copy-to-clipboard",
611
582
  "category": "string-utilities",
612
- "size": 1.5,
613
- "files": [
614
- "string-utilities/emmet-html.js"
615
- ],
616
- "description": "Emmet-like HTML generation",
617
- "exports": {
618
- "emmet": [
619
- "hyperclay"
620
- ]
621
- }
622
- },
623
- "clipboard": {
624
- "name": "clipboard",
625
- "category": "string-utilities",
626
- "size": 0.8,
583
+ "size": 0.9,
627
584
  "files": [
628
585
  "string-utilities/copy-to-clipboard.js"
629
586
  ],
@@ -637,7 +594,7 @@
637
594
  "query-params": {
638
595
  "name": "query-params",
639
596
  "category": "string-utilities",
640
- "size": 0.2,
597
+ "size": 0.3,
641
598
  "files": [
642
599
  "string-utilities/query.js"
643
600
  ],
@@ -652,7 +609,7 @@
652
609
  "behavior-collector": {
653
610
  "name": "behavior-collector",
654
611
  "category": "communication",
655
- "size": 5.4,
612
+ "size": 5.5,
656
613
  "files": [
657
614
  "communication/behaviorCollector.js"
658
615
  ],
@@ -666,7 +623,7 @@
666
623
  "send-message": {
667
624
  "name": "send-message",
668
625
  "category": "communication",
669
- "size": 1.3,
626
+ "size": 1.4,
670
627
  "files": [
671
628
  "communication/sendMessage.js"
672
629
  ],
@@ -680,7 +637,7 @@
680
637
  "file-upload": {
681
638
  "name": "file-upload",
682
639
  "category": "communication",
683
- "size": 10.6,
640
+ "size": 10.7,
684
641
  "files": [
685
642
  "communication/uploadFile.js"
686
643
  ],
@@ -696,13 +653,23 @@
696
653
  "hyperclay"
697
654
  ]
698
655
  }
656
+ },
657
+ "export-to-window": {
658
+ "name": "export-to-window",
659
+ "category": "core",
660
+ "size": 0.4,
661
+ "files": [
662
+ "core/exportToWindow.js"
663
+ ],
664
+ "description": "Export all modules to window.hyperclay and window globals",
665
+ "exports": {}
699
666
  }
700
667
  },
701
668
  "modulePaths": {
702
669
  "save-core": "./core/savePageCore.js",
703
670
  "save-system": "./core/savePage.js",
704
671
  "autosave": "./core/autosave.js",
705
- "admin": "./core/adminSystem.js",
672
+ "edit-mode-helpers": "./core/adminSystem.js",
706
673
  "persist": "./core/enablePersistentFormInputValues.js",
707
674
  "option-visibility": "./core/optionVisibilityRuleGenerator.js",
708
675
  "edit-mode": "./core/editmodeSystem.js",
@@ -714,7 +681,7 @@
714
681
  "dialogs": "./ui/prompts.js",
715
682
  "toast": "./ui/toast.js",
716
683
  "toast-hyperclay": "./ui/toast-hyperclay.js",
717
- "modal": "./ui/theModal.js",
684
+ "the-modal": "./ui/theModal.js",
718
685
  "tailwind-play": "./vendor/tailwind-play.js",
719
686
  "mutation": "./utilities/mutation.js",
720
687
  "nearest": "./utilities/nearest.js",
@@ -728,12 +695,12 @@
728
695
  "form-data": "./dom-utilities/getDataFromForm.js",
729
696
  "idiomorph": "./vendor/idiomorph.min.js",
730
697
  "slugify": "./string-utilities/slugify.js",
731
- "emmet": "./string-utilities/emmet-html.js",
732
- "clipboard": "./string-utilities/copy-to-clipboard.js",
698
+ "copy-to-clipboard": "./string-utilities/copy-to-clipboard.js",
733
699
  "query-params": "./string-utilities/query.js",
734
700
  "behavior-collector": "./communication/behaviorCollector.js",
735
701
  "send-message": "./communication/sendMessage.js",
736
- "file-upload": "./communication/uploadFile.js"
702
+ "file-upload": "./communication/uploadFile.js",
703
+ "export-to-window": "./core/exportToWindow.js"
737
704
  },
738
705
  "categories": {
739
706
  "core": {
@@ -743,7 +710,7 @@
743
710
  "save-core",
744
711
  "save-system",
745
712
  "autosave",
746
- "admin",
713
+ "edit-mode-helpers",
747
714
  "persist",
748
715
  "option-visibility",
749
716
  "edit-mode"
@@ -766,7 +733,7 @@
766
733
  "modules": [
767
734
  "dialogs",
768
735
  "toast",
769
- "modal",
736
+ "the-modal",
770
737
  "tailwind-play"
771
738
  ]
772
739
  },
@@ -796,8 +763,7 @@
796
763
  "description": "String manipulation helpers",
797
764
  "modules": [
798
765
  "slugify",
799
- "emmet",
800
- "clipboard",
766
+ "copy-to-clipboard",
801
767
  "query-params"
802
768
  ]
803
769
  },
@@ -824,8 +790,9 @@
824
790
  "modules": [
825
791
  "save-core",
826
792
  "save-system",
827
- "admin",
828
- "toast"
793
+ "edit-mode-helpers",
794
+ "toast",
795
+ "export-to-window"
829
796
  ]
830
797
  },
831
798
  "standard": {
@@ -834,12 +801,13 @@
834
801
  "modules": [
835
802
  "save-core",
836
803
  "save-system",
837
- "admin",
804
+ "edit-mode-helpers",
838
805
  "persist",
839
806
  "option-visibility",
840
807
  "event-attrs",
841
808
  "dom-helpers",
842
- "toast"
809
+ "toast",
810
+ "export-to-window"
843
811
  ]
844
812
  },
845
813
  "everything": {
@@ -849,7 +817,7 @@
849
817
  "save-core",
850
818
  "save-system",
851
819
  "autosave",
852
- "admin",
820
+ "edit-mode-helpers",
853
821
  "persist",
854
822
  "option-visibility",
855
823
  "edit-mode",
@@ -861,7 +829,7 @@
861
829
  "dialogs",
862
830
  "toast",
863
831
  "toast-hyperclay",
864
- "modal",
832
+ "the-modal",
865
833
  "tailwind-play",
866
834
  "mutation",
867
835
  "nearest",
@@ -875,12 +843,12 @@
875
843
  "form-data",
876
844
  "idiomorph",
877
845
  "slugify",
878
- "emmet",
879
- "clipboard",
846
+ "copy-to-clipboard",
880
847
  "query-params",
881
848
  "behavior-collector",
882
849
  "send-message",
883
- "file-upload"
850
+ "file-upload",
851
+ "export-to-window"
884
852
  ]
885
853
  }
886
854
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperclayjs",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "Modular JavaScript library for building interactive HTML applications with Hyperclay",
5
5
  "type": "module",
6
6
  "main": "hyperclay.js",
@@ -24,8 +24,11 @@ function copyToClipboard(text) {
24
24
  document.body.removeChild(textarea);
25
25
  }
26
26
 
27
- // Self-export to hyperclay only
28
- window.hyperclay = window.hyperclay || {};
29
- window.hyperclay.copyToClipboard = copyToClipboard;
27
+ // Auto-export to window unless suppressed by loader
28
+ if (!window.__hyperclayNoAutoExport) {
29
+ window.hyperclay = window.hyperclay || {};
30
+ window.hyperclay.copyToClipboard = copyToClipboard;
31
+ window.h = window.hyperclay;
32
+ }
30
33
 
31
- export default copyToClipboard;
34
+ export default copyToClipboard;
@@ -1,8 +1,11 @@
1
1
  const query = Object.fromEntries(new URLSearchParams(window.location.search));
2
2
 
3
- // Self-export to window and hyperclay
4
- window.query = query;
5
- window.hyperclay = window.hyperclay || {};
6
- window.hyperclay.query = query;
3
+ // Auto-export to window unless suppressed by loader
4
+ if (!window.__hyperclayNoAutoExport) {
5
+ window.query = query;
6
+ window.hyperclay = window.hyperclay || {};
7
+ window.hyperclay.query = query;
8
+ window.h = window.hyperclay;
9
+ }
7
10
 
8
- export default query;
11
+ export default query;
@@ -10,9 +10,12 @@ function slugify (text) {
10
10
  .replace(/-+$/, ''); // trim - from end of text
11
11
  }
12
12
 
13
- // Self-export to window and hyperclay
14
- window.slugify = slugify;
15
- window.hyperclay = window.hyperclay || {};
16
- window.hyperclay.slugify = slugify;
13
+ // Auto-export to window unless suppressed by loader
14
+ if (!window.__hyperclayNoAutoExport) {
15
+ window.slugify = slugify;
16
+ window.hyperclay = window.hyperclay || {};
17
+ window.hyperclay.slugify = slugify;
18
+ window.h = window.hyperclay;
19
+ }
17
20
 
18
- export default slugify;
21
+ export default slugify;