@daz4126/helium 1.0.0-beta.1 → 1.0.0-beta.3

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/CLAUDE.md CHANGED
@@ -105,9 +105,7 @@ const { helium, heliumTeardown } = createHelium({
105
105
  createScope(ctx) {
106
106
  // Return scope object for expression execution
107
107
  }
108
- },
109
- prefix: 'my', // For data-my-* attributes
110
- rootAttr: 'mylib' // For @mylib / data-mylib root element
108
+ }
111
109
  });
112
110
  ```
113
111
 
@@ -378,6 +378,15 @@
378
378
  <p>History: <span @text="history.join(', ') || 'None yet'">None yet</span></p>
379
379
  </div>
380
380
 
381
+ <!-- Clipboard Copy -->
382
+ <div class="card" @data="{ copied: false, textToCopy: 'Hello from Helium!' }">
383
+ <h2>Copy to Clipboard</h2>
384
+ <input @bind="textToCopy" placeholder="Text to copy">
385
+ <button @click="navigator.clipboard.writeText(textToCopy).then(() => (copied = true, setTimeout(() => copied = false, 2000)))">
386
+ <span @text="copied ? 'Copied!' : 'Copy'"></span>
387
+ </button>
388
+ </div>
389
+
381
390
  </div>
382
391
  </div>
383
392
 
@@ -225,6 +225,12 @@
225
225
 
226
226
  <div class="examples">
227
227
 
228
+ <!-- @data Test -->
229
+ <div class="card" data-he="{ word: 'Hello',number: 42 }">
230
+ <h2 data-he-text="word"></h2>
231
+ <p>Number: <b @text="number"></b></p>
232
+ </div>
233
+
228
234
  <!-- Counter -->
229
235
  <div class="card">
230
236
  <h2>Counter</h2>
@@ -430,12 +436,21 @@
430
436
  <p>History: <span @text="history.join(', ') || 'None yet'">None yet</span></p>
431
437
  </div>
432
438
 
439
+ <!-- Clipboard Copy -->
440
+ <div class="card" @data="{ copied: false, textToCopy: 'Hello from Helium!' }">
441
+ <h2>Copy to Clipboard</h2>
442
+ <input @bind="textToCopy" placeholder="Text to copy">
443
+ <button @click="navigator.clipboard.writeText(textToCopy).then(() => { copied = true; setTimeout(() => copied = false, 2000) })">
444
+ <span @text="copied ? 'Copied!' : 'Copy'"></span>
445
+ </button>
446
+ </div>
447
+
433
448
  </div>
434
449
 
435
450
  <!-- AJAX Examples Section -->
436
451
  <div class="page" style="margin-top: 2rem;" @data="{
437
452
  templates: {
438
- post: data => `<section class='post'><h1>${data?.title || 'Loading...'}</h1><p>${data?.body || ''}</p></section>`
453
+ post: data => `<section class='post'><h1>${data && data.title || 'Loading...'}</h1><p>${data && data.body || ''}</p></section>`
439
454
  }
440
455
  }">
441
456
  <h1>AJAX Examples</h1>