@skirbi/sugar 0.1.13 → 0.1.15

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/Changes CHANGED
@@ -1,5 +1,13 @@
1
1
  Revision history for @skirbi/sugar
2
2
 
3
+ 0.1.15 2026-07-03 22:08:57Z
4
+
5
+ * Add MouseEvent for @skirbi/semtic
6
+
7
+ 0.1.14 2026-07-01 19:35:00Z
8
+
9
+ * withConnectedSucu, not withConnectSucu. Typo's are yya (pun intended).
10
+
3
11
  0.1.13 2026-07-01 19:22:49Z
4
12
 
5
13
  * Whoopsy. Succa ta cu un c :) And also export the damn thing. haha.
package/lib/fakedom.mjs CHANGED
@@ -41,6 +41,7 @@ export async function setupDomForTesting(
41
41
  global.window = dom.window;
42
42
  global.MutationObserver = dom.window.MutationObserver;
43
43
  global.CustomEvent = dom.window.CustomEvent;
44
+ global.MouseEvent = dom.window.MouseEvent;
44
45
 
45
46
  const projectRoot = process.cwd();
46
47
 
@@ -94,8 +94,6 @@ export class HTMLElementSugarInput extends HTMLElementSugar {
94
94
 
95
95
  attributeChangedCallback(name, oldValue, newValue) {
96
96
  super.attributeChangedCallback?.(name, oldValue, newValue);
97
-
98
-
99
97
  if (name === 'value') {
100
98
  this._value = newValue ?? '';
101
99
  this._syncValueToControl();
@@ -348,29 +348,35 @@ export class HTMLElementSugar extends HTMLElement {
348
348
  /**
349
349
  * Called when an observed attribute changes.
350
350
  * @param {string} name - The attribute name
351
- * @param {string|null} oldVal - Previous value (unused)
351
+ * @param {string|null} oldVal - Previous value (unused without a hook)
352
352
  * @param {string|null} newVal - New value
353
353
  */
354
354
  attributeChangedCallback(name, oldVal, newVal) {
355
355
  this._applyAttribute(name, newVal);
356
356
 
357
- if (!this.hasRenderedShape?.()) return;
357
+ if (!this.hasRenderedShape()) return;
358
358
 
359
359
  const def = this.constructor.attributeDefs?.[name];
360
360
 
361
361
  if (def?.hook) {
362
362
  if (typeof def.hook === 'function') {
363
363
  def.hook(this, newVal, oldVal);
364
- } else if (typeof def.hook === 'string') {
364
+ }
365
+ else if (typeof def.hook === 'string') {
365
366
  const el = this.querySelector(def.hook);
366
367
  if (el) el.textContent = newVal ?? '';
367
368
  }
368
- } else {
369
+ }
370
+ else {
369
371
  const el = this.querySelector(`[semtic-${name}]`);
370
372
  if (el) el.textContent = newVal ?? '';
371
373
  }
372
374
 
373
- if (this.attributeChangedCallbackSugar) {
375
+ if (this.updatedAttributeSugar) {
376
+ this.updatedAttributeSugar(name, oldVal, newVal);
377
+ }
378
+ else if (this.attributeChangedCallbackSugar) {
379
+ console.warn("Using deprecated attributeChangedCallbackSugar");
374
380
  this.attributeChangedCallbackSugar(name, oldVal, newVal);
375
381
  }
376
382
  }
package/lib/index.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  //
3
3
  // SPDX-License-Identifier: MIT
4
4
 
5
- const VERSION = "0.1.13";
5
+ const VERSION = "0.1.15";
6
6
 
7
7
  export { HTMLElementSugar } from './htmlelement.mjs';
8
8
  export { HTMLElementSugarInput } from './htmlelement-input.mjs';
@@ -3,7 +3,7 @@
3
3
  // SPDX-License-Identifier: MIT
4
4
 
5
5
  /**
6
- * withConnectSucu
6
+ * withConnectedSucu
7
7
  *
8
8
  * Second-generation connected-lifecycle mixin. Built and tested alongside
9
9
  * withConnectedSugar so existing components can migrate one at a time.
@@ -20,7 +20,7 @@
20
20
 
21
21
  const sucuState = new WeakMap();
22
22
 
23
- export const withConnectSucu = (Base) =>
23
+ export const withConnectedSucu = (Base) =>
24
24
  class extends Base {
25
25
  static morphTriggerSelector = '';
26
26
 
package/package.json CHANGED
@@ -62,5 +62,5 @@
62
62
  "./aliases-register"
63
63
  ],
64
64
  "type": "module",
65
- "version": "0.1.13"
65
+ "version": "0.1.15"
66
66
  }