@esportsplus/template 0.16.8 → 0.16.10

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.
@@ -41,7 +41,7 @@ function list(ctx, element, id, name, state, value) {
41
41
  let hot = {};
42
42
  if (value && typeof value === 'string') {
43
43
  let part, parts = value.split(delimiter);
44
- while (part = parts.pop()) {
44
+ while ((part = parts.pop()) !== undefined) {
45
45
  part = part.trim();
46
46
  if (part === '') {
47
47
  continue;
@@ -152,7 +152,9 @@ const setList = (element, name, value, attributes = {}) => {
152
152
  let ctx = context(element), store = ctx.store ??= {};
153
153
  store[name] ??= new Set();
154
154
  store[name + '.static'] ??= '';
155
- store[name + '.static'] += `${attributes[name] && store[name + '.static'] ? ATTRIBUTE_DELIMITERS[name] : ''}${attributes[name]}`;
155
+ if (attributes[name]) {
156
+ store[name + '.static'] += (store[name + '.static'] ? ATTRIBUTE_DELIMITERS[name] : '') + attributes[name];
157
+ }
156
158
  if (typeof value === 'function') {
157
159
  reactive(element, name, STATE_HYDRATING, value);
158
160
  }
@@ -9,6 +9,7 @@ const DIRECT_ATTACH_EVENTS = new Set([
9
9
  'onerror',
10
10
  'onfocus', 'onfocusin', 'onfocusout',
11
11
  'onload',
12
+ 'onmouseenter', 'onmouseleave',
12
13
  'onplay', 'onpause', 'onended', 'ontimeupdate',
13
14
  'onreset',
14
15
  'onscroll', 'onsubmit'
package/package.json CHANGED
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "type": "module",
41
41
  "types": "./build/index.d.ts",
42
- "version": "0.16.8",
42
+ "version": "0.16.10",
43
43
  "scripts": {
44
44
  "build": "tsc",
45
45
  "test": "vitest run",
package/src/attributes.ts CHANGED
@@ -77,7 +77,7 @@ function list(
77
77
  let part: string | undefined,
78
78
  parts = (value as string).split(delimiter);
79
79
 
80
- while (part = parts.pop()) {
80
+ while ((part = parts.pop()) !== undefined) {
81
81
  part = part.trim();
82
82
 
83
83
  if (part === '') {
@@ -240,7 +240,10 @@ const setList = (element: Element, name: 'class' | 'style', value: unknown, attr
240
240
 
241
241
  store[name] ??= new Set<string>();
242
242
  store[name + '.static'] ??= '';
243
- store[name + '.static'] += `${attributes[name] && store[name + '.static'] ? ATTRIBUTE_DELIMITERS[name] : ''}${attributes[name]}`;
243
+
244
+ if (attributes[name]) {
245
+ store[name + '.static'] += (store[name + '.static'] ? ATTRIBUTE_DELIMITERS[name] : '') + attributes[name];
246
+ }
244
247
 
245
248
  if (typeof value === 'function') {
246
249
  reactive(element, name, STATE_HYDRATING, value);
package/src/constants.ts CHANGED
@@ -12,6 +12,7 @@ const DIRECT_ATTACH_EVENTS = new Set<string>([
12
12
  'onerror',
13
13
  'onfocus', 'onfocusin', 'onfocusout',
14
14
  'onload',
15
+ 'onmouseenter', 'onmouseleave',
15
16
  'onplay', 'onpause', 'onended', 'ontimeupdate',
16
17
  'onreset',
17
18
  'onscroll', 'onsubmit'