hyperclayjs 1.1.2 → 1.2.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/README.md CHANGED
@@ -55,7 +55,7 @@ import 'hyperclayjs/presets/standard.js';
55
55
  | Admin Features | 5.3KB | Hides admin inputs, scripts, contenteditable, onclick for regular viewers |
56
56
  | Edit Mode | 1.4KB | Toggle edit mode on/off |
57
57
  | Form Persistence | 2.2KB | Persist form values to the DOM with [persist] attribute |
58
- | Option Visibility | 4.4KB | Dynamic show/hide based on page state with option:attribute="value" |
58
+ | Option Visibility | 4.4KB | Dynamic show/hide based on ancestor state with option:attribute="value" |
59
59
  | Save Core | 5.9KB | Basic save function only - hyperclay.savePage() |
60
60
  | Save System | 4.9KB | Full save: save button, keyboard shortcut, auto-save, change tracking |
61
61
 
@@ -76,7 +76,7 @@ import 'hyperclayjs/presets/standard.js';
76
76
  | Dialog Functions | 7.7KB | ask(), consent(), tell(), snippet() functions |
77
77
  | Info Dialog | 3.2KB | Info dialog component |
78
78
  | Modal System | 18.4KB | Full modal window creation system - window.theModal |
79
- | Tailwind Play | 362.3KB | Live Tailwind CSS editing - updates styles based on classes in your HTML |
79
+ | Tailwind Play | 362.3KB | Live Tailwind CSS editing - no need for a build system |
80
80
  | Toast Notifications | 7.3KB | Success/error message notifications - toast(msg, msgType) |
81
81
 
82
82
  ### Utilities (Core utilities (often auto-included))
@@ -97,7 +97,6 @@ import 'hyperclayjs/presets/standard.js';
97
97
  | DOM Ready | 0.2KB | DOM ready callback |
98
98
  | Get Data From Form | 1.7KB | Extract form data as an object |
99
99
  | Style Injection | 0.8KB | Dynamic stylesheet injection |
100
- | Window Load | 0.2KB | Window load callback |
101
100
 
102
101
  ### String Utilities (String manipulation helpers)
103
102
 
@@ -112,7 +111,6 @@ import 'hyperclayjs/presets/standard.js';
112
111
 
113
112
  | Module | Size | Description |
114
113
  |--------|------|-------------|
115
- | Behavior Collector | 5.2KB | Tracks user interactions (mouse, scroll, keyboard) |
116
114
  | File Upload to App Owner | 10.4KB | File upload with progress |
117
115
  | Send Message to App Owner | 1.2KB | Message sending utility |
118
116
 
@@ -120,7 +118,7 @@ import 'hyperclayjs/presets/standard.js';
120
118
 
121
119
  | Module | Size | Description |
122
120
  |--------|------|-------------|
123
- | DOM Morphing | 7.9KB | Efficient DOM updates |
121
+ | Idiomorph | 7.9KB | Efficient DOM morphing library |
124
122
 
125
123
  ## Presets
126
124
 
@@ -134,7 +132,7 @@ Standard feature set for most use cases
134
132
 
135
133
  **Modules:** `save-core`, `save`, `admin`, `persist`, `ajax`, `events`, `helpers`, `toast`
136
134
 
137
- ### Everything (~616.4KB)
135
+ ### Everything (~624.4KB)
138
136
  All available features
139
137
 
140
138
  Includes all available modules across all categories.
package/hyperclay.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * HyperclayJS - Self-detecting module loader
2
+ * HyperclayJS v1.2.0 - Self-detecting module loader
3
3
  * Automatically loads requested features with dependency resolution
4
4
  *
5
5
  * USAGE:
@@ -52,6 +52,7 @@
52
52
  "dependencies": [
53
53
  "save-core",
54
54
  "toast",
55
+ "toast-hyperclay",
55
56
  "mutation",
56
57
  "throttle"
57
58
  ],
@@ -175,7 +176,8 @@
175
176
  "dom-ready",
176
177
  "copy-to-clipboard",
177
178
  "modals",
178
- "toast"
179
+ "toast",
180
+ "toast-hyperclay"
179
181
  ],
180
182
  "exports": {
181
183
  "ask": [
@@ -208,6 +210,18 @@
208
210
  ]
209
211
  }
210
212
  },
213
+ "toast-hyperclay": {
214
+ "path": "./ui/toast-hyperclay.js",
215
+ "dependencies": [
216
+ "toast"
217
+ ],
218
+ "exports": {
219
+ "toast": [
220
+ "window",
221
+ "hyperclay"
222
+ ]
223
+ }
224
+ },
211
225
  "modals": {
212
226
  "path": "./ui/theModal.js",
213
227
  "dependencies": [],
@@ -334,7 +348,7 @@
334
348
  ]
335
349
  }
336
350
  },
337
- "dom-morphing": {
351
+ "idiomorph": {
338
352
  "path": "./vendor/idiomorph.min.js",
339
353
  "dependencies": [],
340
354
  "exports": {
@@ -395,7 +409,8 @@
395
409
  "dependencies": [
396
410
  "behavior-collector",
397
411
  "get-data-from-form",
398
- "toast"
412
+ "toast",
413
+ "toast-hyperclay"
399
414
  ],
400
415
  "exports": {
401
416
  "sendMessage": [
@@ -408,6 +423,7 @@
408
423
  "dependencies": [
409
424
  "copy-to-clipboard",
410
425
  "toast",
426
+ "toast-hyperclay",
411
427
  "debounce"
412
428
  ],
413
429
  "exports": {
@@ -467,6 +483,7 @@
467
483
  "inputs",
468
484
  "prompts",
469
485
  "toast",
486
+ "toast-hyperclay",
470
487
  "modals",
471
488
  "info",
472
489
  "tailwind-play",
@@ -480,7 +497,7 @@
480
497
  "alljs",
481
498
  "style-injection",
482
499
  "get-data-from-form",
483
- "dom-morphing",
500
+ "idiomorph",
484
501
  "slugify",
485
502
  "emmet-html",
486
503
  "copy-to-clipboard",
@@ -507,20 +524,21 @@
507
524
  const scriptUrl = new URL(currentScript.src);
508
525
  const featuresParam = scriptUrl.searchParams.get('features');
509
526
  const presetParam = scriptUrl.searchParams.get('preset');
527
+ const debugMode = scriptUrl.searchParams.get('debug') === 'true';
510
528
 
511
529
  // Determine requested features
512
530
  let requestedFeatures = [];
513
531
 
514
532
  if (presetParam && presets[presetParam]) {
515
533
  requestedFeatures = presets[presetParam].modules;
516
- console.log(`HyperclayJS: Loading preset "${presetParam}"`);
534
+ if (debugMode) console.log(`HyperclayJS: Loading preset "${presetParam}"`);
517
535
  } else if (featuresParam) {
518
536
  requestedFeatures = featuresParam.split(',').map(f => f.trim());
519
- console.log(`HyperclayJS: Loading features:`, requestedFeatures);
537
+ if (debugMode) console.log(`HyperclayJS: Loading features:`, requestedFeatures);
520
538
  } else {
521
539
  // Default to minimal preset
522
540
  requestedFeatures = presets.minimal.modules;
523
- console.log('HyperclayJS: No features specified, loading minimal preset');
541
+ if (debugMode) console.log('HyperclayJS: No features specified, loading minimal preset');
524
542
  }
525
543
 
526
544
  // Resolve all dependencies
@@ -594,7 +612,7 @@
594
612
  const modulePath = `${baseUrl}/${module.path}`;
595
613
 
596
614
  try {
597
- console.log(`HyperclayJS: Loading ${feature}...`);
615
+ if (debugMode) console.log(`HyperclayJS: Loading ${feature}...`);
598
616
  const loaded = await import(modulePath);
599
617
 
600
618
  // Auto-initialize if the module exports an init function
@@ -617,7 +635,7 @@
617
635
  // Sort in correct load order
618
636
  const loadOrder = topologicalSort(allFeatures);
619
637
 
620
- console.log('HyperclayJS: Load order:', loadOrder);
638
+ if (debugMode) console.log('HyperclayJS: Load order:', loadOrder);
621
639
 
622
640
  // Get base URL
623
641
  const baseUrl = getBaseUrl();
@@ -682,10 +700,11 @@
682
700
  hyperclayReadyResolve(window.hyperclay);
683
701
  }
684
702
 
685
- console.log('HyperclayJS: All modules loaded successfully');
703
+ if (debugMode) {
704
+ console.log('HyperclayJS: All modules loaded successfully');
686
705
 
687
- // Show feature summary - AUTO-GENERATED
688
- const sizes = {
706
+ // Show feature summary - AUTO-GENERATED
707
+ const sizes = {
689
708
  "save-core": 5.9,
690
709
  "save": 4.9,
691
710
  "admin": 5.300000000000001,
@@ -699,6 +718,7 @@
699
718
  "inputs": 1.2,
700
719
  "prompts": 7.7,
701
720
  "toast": 7.3,
721
+ "toast-hyperclay": 8,
702
722
  "modals": 18.4,
703
723
  "info": 3.2,
704
724
  "tailwind-play": 362.3,
@@ -712,7 +732,7 @@
712
732
  "alljs": 13.9,
713
733
  "style-injection": 0.8,
714
734
  "get-data-from-form": 1.7,
715
- "dom-morphing": 7.9,
735
+ "idiomorph": 7.9,
716
736
  "slugify": 0.7,
717
737
  "emmet-html": 1.4,
718
738
  "copy-to-clipboard": 0.9,
@@ -721,11 +741,12 @@
721
741
  "send-message": 1.2,
722
742
  "file-upload": 10.4
723
743
  };
724
- const totalSize = loadOrder.reduce((sum, feature) => {
725
- return sum + (sizes[feature] || 0);
726
- }, 0);
744
+ const totalSize = loadOrder.reduce((sum, feature) => {
745
+ return sum + (sizes[feature] || 0);
746
+ }, 0);
727
747
 
728
- console.log(`HyperclayJS: Loaded ${loadOrder.length} modules (~${totalSize.toFixed(1)}KB)`);
748
+ console.log(`HyperclayJS: Loaded ${loadOrder.length} modules (~${totalSize.toFixed(1)}KB)`);
749
+ }
729
750
 
730
751
  } catch (error) {
731
752
  console.error('HyperclayJS: Fatal error during initialization:', error);
@@ -138,6 +138,9 @@
138
138
  "ui/toast.js"
139
139
  ],
140
140
  "ui/theModal.js": [],
141
+ "ui/toast-hyperclay.js": [
142
+ "ui/toast.js"
143
+ ],
141
144
  "ui/toast.js": [],
142
145
  "utilities/cookie.js": [],
143
146
  "utilities/debounce.js": [],
@@ -230,7 +233,7 @@
230
233
  "files": [
231
234
  "core/optionVisibilityRuleGenerator.js"
232
235
  ],
233
- "description": "Dynamic show/hide based on page state with option:attribute=\"value\"",
236
+ "description": "Dynamic show/hide based on ancestor state with option:attribute=\"value\"",
234
237
  "exports": {
235
238
  "optionVisibilityRuleGenerator": [
236
239
  "window",
@@ -371,6 +374,22 @@
371
374
  ]
372
375
  }
373
376
  },
377
+ "toast-hyperclay": {
378
+ "name": "Toast Hyperclay (Legacy)",
379
+ "category": "ui",
380
+ "size": 8,
381
+ "files": [
382
+ "ui/toast-hyperclay.js",
383
+ "ui/toast.js"
384
+ ],
385
+ "description": "Toast with legacy Hyperclay platform styling (hidden feature)",
386
+ "exports": {
387
+ "toast": [
388
+ "window",
389
+ "hyperclay"
390
+ ]
391
+ }
392
+ },
374
393
  "modals": {
375
394
  "name": "Modal System",
376
395
  "category": "ui",
@@ -408,7 +427,7 @@
408
427
  "files": [
409
428
  "vendor/tailwind-play.js"
410
429
  ],
411
- "description": "Live Tailwind CSS editing - updates styles based on classes in your HTML",
430
+ "description": "Live Tailwind CSS editing - no need for a build system",
412
431
  "exports": {}
413
432
  },
414
433
  "mutation": {
@@ -557,14 +576,14 @@
557
576
  ]
558
577
  }
559
578
  },
560
- "dom-morphing": {
561
- "name": "DOM Morphing",
579
+ "idiomorph": {
580
+ "name": "Idiomorph",
562
581
  "category": "vendor",
563
582
  "size": 7.9,
564
583
  "files": [
565
584
  "vendor/idiomorph.min.js"
566
585
  ],
567
- "description": "Efficient DOM updates",
586
+ "description": "Efficient DOM morphing library",
568
587
  "exports": {
569
588
  "Idiomorph": [
570
589
  "hyperclay"
@@ -729,7 +748,6 @@
729
748
  "description": "DOM manipulation helpers",
730
749
  "modules": [
731
750
  "dom-ready",
732
- "window-load",
733
751
  "alljs",
734
752
  "style-injection",
735
753
  "get-data-from-form"
@@ -749,7 +767,6 @@
749
767
  "name": "Communication & Files",
750
768
  "description": "File handling and messaging",
751
769
  "modules": [
752
- "behavior-collector",
753
770
  "send-message",
754
771
  "file-upload"
755
772
  ]
@@ -758,7 +775,7 @@
758
775
  "name": "Vendor Libraries",
759
776
  "description": "Third-party libraries",
760
777
  "modules": [
761
- "dom-morphing"
778
+ "idiomorph"
762
779
  ]
763
780
  }
764
781
  },
@@ -804,6 +821,7 @@
804
821
  "inputs",
805
822
  "prompts",
806
823
  "toast",
824
+ "toast-hyperclay",
807
825
  "modals",
808
826
  "info",
809
827
  "tailwind-play",
@@ -817,7 +835,7 @@
817
835
  "alljs",
818
836
  "style-injection",
819
837
  "get-data-from-form",
820
- "dom-morphing",
838
+ "idiomorph",
821
839
  "slugify",
822
840
  "emmet-html",
823
841
  "copy-to-clipboard",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperclayjs",
3
- "version": "1.1.2",
3
+ "version": "1.2.0",
4
4
  "description": "Modular JavaScript library for building interactive HTML applications with Hyperclay",
5
5
  "type": "module",
6
6
  "main": "hyperclay.js",
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Toast Hyperclay - Legacy toast for Hyperclay platform
3
+ *
4
+ * This is a wrapper that loads the toast module and automatically
5
+ * calls toast.useLegacy() to enable the legacy Hyperclay platform styling.
6
+ *
7
+ * This is a hidden feature not exposed in the UI - used internally by
8
+ * the Hyperclay platform for backward compatibility.
9
+ */
10
+
11
+ import toast from './toast.js';
12
+
13
+ // Automatically apply legacy styling for Hyperclay platform
14
+ toast.useLegacy();
15
+
16
+ // Re-export toast with legacy config already applied
17
+ export default toast;
18
+
19
+ // Export to window for global access
20
+ export function exportToWindow() {
21
+ if (!window.hyperclay) {
22
+ window.hyperclay = {};
23
+ }
24
+ window.hyperclay.toast = toast;
25
+ }