@xtia/jel 0.1.1 → 0.1.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/README.md CHANGED
@@ -10,7 +10,7 @@ See [demo/index.ts](https://github.com/tiadrop/jel-ts/blob/main/demo/index.ts) f
10
10
  `$.[tagname](details)` produces an element of `<tagname>`. `details` can be content of various types or a descriptor object.
11
11
 
12
12
  ```ts
13
- import { $ } from "jel-ts";
13
+ import { $ } from "@xtia/jel";
14
14
 
15
15
  // wrap body
16
16
  const body = $(document.body);
package/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export type ElementClassSpec = string | Record<string, boolean> | ElementClassSpec[];
2
2
  export type DOMContent = number | null | string | Element | JelEntity<object, any> | Text | DOMContent[];
3
3
  export type DomEntity<T extends HTMLElement> = JelEntity<ElementAPI<T>, HTMLElementEventMap>;
4
- type Classes = string | Record<string, boolean> | Classes[];
5
4
  type JelConstructor<Spec, API, EventDataMap> = (spec?: Partial<Spec & CommonOptions<EventDataMap>>) => JelEntity<API, EventDataMap>;
6
5
  type CommonOptions<EventDataMap> = {
7
6
  on?: Partial<{
@@ -13,7 +12,7 @@ type JelEntity<API, EventDataMap> = API & {
13
12
  readonly [componentDataSymbol]: JelComponentData;
14
13
  };
15
14
  interface ElementDescriptor {
16
- classes?: Classes;
15
+ classes?: ElementClassSpec;
17
16
  content?: DOMContent;
18
17
  attribs?: Record<string, string | number | boolean>;
19
18
  on?: Partial<{
@@ -23,7 +22,7 @@ interface ElementDescriptor {
23
22
  [key in keyof CSSStyleDeclaration]: string | number;
24
23
  }> & Record<string, string | number>;
25
24
  }
26
- type DomHelper = ((<T extends keyof HTMLElementTagNameMap>(tagName: T, descriptor: ElementDescriptor) => DomEntity<HTMLElementTagNameMap[T]>) & ((selector: string, content?: DOMContent) => DomEntity<any>) & (<T extends HTMLElement>(element: T) => DomEntity<T>) & {
25
+ type DomHelper = ((<T extends keyof HTMLElementTagNameMap>(tagName: T, descriptor: ElementDescriptor) => DomEntity<HTMLElementTagNameMap[T]>) & (<T extends keyof HTMLElementTagNameMap>(selector: `${T}#${string}`, content?: DOMContent) => DomEntity<HTMLElementTagNameMap[T]>) & (<T extends keyof HTMLElementTagNameMap>(selector: `${T}.${string}`, content?: DOMContent) => DomEntity<HTMLElementTagNameMap[T]>) & (<T extends keyof HTMLElementTagNameMap>(selector: T, content?: DOMContent) => DomEntity<HTMLElementTagNameMap[T]>) & (<T extends HTMLElement>(element: T) => DomEntity<T>) & {
27
26
  [T in keyof HTMLElementTagNameMap]: (descriptor: ElementDescriptor) => DomEntity<HTMLElementTagNameMap[T]>;
28
27
  } & {
29
28
  [T in keyof HTMLElementTagNameMap]: (content?: DOMContent) => DomEntity<HTMLElementTagNameMap[T]>;
package/index.js CHANGED
@@ -144,7 +144,7 @@ function definePart(defaultOptions, init) {
144
144
  },
145
145
  _a)) : (_b = {},
146
146
  _b[componentDataSymbol] = {
147
- dom: content
147
+ dom: content,
148
148
  },
149
149
  _b.on = addEventListener,
150
150
  _b);
package/package.json CHANGED
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "name": "@xtia/jel",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
+ "repository": {
5
+ "url": "https://github.com/tiadrop/jel-ts",
6
+ "type": "github"
7
+ },
4
8
  "description": "Lightweight DOM wrapper",
5
9
  "main": "index.js",
6
10
  "keywords": [