@esportsplus/template 0.20.1 → 0.20.2

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.
@@ -1,6 +1,6 @@
1
1
  import { ReactiveArray } from '@esportsplus/reactivity';
2
2
  import { Attributes, Renderable, RenderableReactive } from '../types.js';
3
- type Values<T> = Attributes | Attributes[] | Readonly<Attributes> | Readonly<Attributes[]> | Renderable<T>;
3
+ type Values<T> = Attributes | Renderable<T>;
4
4
  declare const html: {
5
5
  <T>(literals: TemplateStringsArray, ...values: (Values<T> | Values<T>[])[]): Node;
6
6
  reactive<T>(array: ReactiveArray<T>, template: RenderableReactive<T>["template"]): RenderableReactive<T>;
package/build/types.d.ts CHANGED
@@ -6,17 +6,16 @@ import slot from './slot/index.js';
6
6
  import html from './html/index.js';
7
7
  type Attribute = Effect<Primitive | Primitive[]> | Primitive;
8
8
  type Attributes = {
9
+ [key: `aria-${string}`]: string | number | boolean | undefined;
10
+ [key: `data-${string}`]: string | undefined;
9
11
  class?: Attribute | Attribute[];
12
+ onconnect?: <T = HTMLElement>(element: T) => void;
13
+ ondisconnect?: <T = HTMLElement>(element: T) => void;
14
+ onrender?: <T = HTMLElement>(element: T) => void;
15
+ ontick?: <T = HTMLElement>(element: T) => void;
10
16
  style?: Attribute | Attribute[];
11
17
  } & {
12
- [K in keyof GlobalEventHandlersEventMap as `on${string & K}`]?: (this: Element, event: GlobalEventHandlersEventMap[K]) => void;
13
- } & {
14
- [key: `aria-${string}`]: string | number | boolean | undefined;
15
- [key: `data-${string}`]: string | undefined;
16
- onconnect?: <T = Element>(element: T) => void;
17
- ondisconnect?: <T = Element>(element: T) => void;
18
- onrender?: <T = Element>(element: T) => void;
19
- ontick?: <T = Element>(element: T) => void;
18
+ [K in keyof GlobalEventHandlersEventMap as `on${string & K}`]?: (this: HTMLElement, event: GlobalEventHandlersEventMap[K]) => void;
20
19
  } & Record<PropertyKey, unknown>;
21
20
  type Effect<T> = () => T extends [] ? Renderable<T>[] : Renderable<T>;
22
21
  type Element = HTMLElement & Attributes;
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "private": false,
15
15
  "type": "module",
16
16
  "types": "./build/index.d.ts",
17
- "version": "0.20.1",
17
+ "version": "0.20.2",
18
18
  "scripts": {
19
19
  "build": "tsc && tsc-alias",
20
20
  "-": "-"
package/src/html/index.ts CHANGED
@@ -5,7 +5,7 @@ import { cloneNode } from '~/utilities/node';
5
5
  import parser from './parser';
6
6
 
7
7
 
8
- type Values<T> = Attributes | Attributes[] | Readonly<Attributes> | Readonly<Attributes[]> | Renderable<T>;
8
+ type Values<T> = Attributes | Renderable<T>;
9
9
 
10
10
 
11
11
  const html = <T>(literals: TemplateStringsArray, ...values: (Values<T> | Values<T>[])[]) => {
package/src/types.ts CHANGED
@@ -9,17 +9,16 @@ import html from './html';
9
9
  type Attribute = Effect<Primitive | Primitive[]> | Primitive;
10
10
 
11
11
  type Attributes = {
12
+ [key: `aria-${string}`]: string | number | boolean | undefined;
13
+ [key: `data-${string}`]: string | undefined;
12
14
  class?: Attribute | Attribute[];
15
+ onconnect?: <T = HTMLElement>(element: T) => void;
16
+ ondisconnect?: <T = HTMLElement>(element: T) => void;
17
+ onrender?: <T = HTMLElement>(element: T) => void;
18
+ ontick?: <T = HTMLElement>(element: T) => void;
13
19
  style?: Attribute | Attribute[];
14
20
  } & {
15
- [K in keyof GlobalEventHandlersEventMap as `on${string & K}`]?: (this: Element, event: GlobalEventHandlersEventMap[K]) => void;
16
- } & {
17
- [key: `aria-${string}`]: string | number | boolean | undefined;
18
- [key: `data-${string}`]: string | undefined;
19
- onconnect?: <T = Element>(element: T) => void;
20
- ondisconnect?: <T = Element>(element: T) => void;
21
- onrender?: <T = Element>(element: T) => void;
22
- ontick?: <T = Element>(element: T) => void;
21
+ [K in keyof GlobalEventHandlersEventMap as `on${string & K}`]?: (this: HTMLElement, event: GlobalEventHandlersEventMap[K]) => void;
23
22
  } & Record<PropertyKey, unknown>;
24
23
 
25
24
  type Effect<T> = () => T extends [] ? Renderable<T>[] : Renderable<T>;