@seahax/elemental 0.5.14 → 0.5.16
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 +48 -19
- package/dist/defineComponent.d.ts +19 -7
- package/dist/defineComponent.js +21 -12
- package/dist/defineComponent.js.map +1 -1
- package/dist/extendComponentDefinition.d.ts +16 -0
- package/dist/extendComponentDefinition.js +16 -0
- package/dist/extendComponentDefinition.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +15 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,7 +51,6 @@ export const MyComponent = defineComponent((shadow) => {
|
|
|
51
51
|
|
|
52
52
|
// Render content to the shadow DOM.
|
|
53
53
|
h(shadow, [
|
|
54
|
-
h('style', [/* css */]),
|
|
55
54
|
h('p', { class: 'hello' }, ['Hello, World!']),
|
|
56
55
|
h('div', { class: 'inputs' }, [
|
|
57
56
|
myInput,
|
|
@@ -135,6 +134,39 @@ export const MyComponent = defineComponent((shadow) => {
|
|
|
135
134
|
});
|
|
136
135
|
```
|
|
137
136
|
|
|
137
|
+
## Add Styles
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
const MyComponent = defineComponent(
|
|
141
|
+
(shadow) => {
|
|
142
|
+
...
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
// Styles to be adopted by the shadow root. String values are parsed
|
|
146
|
+
// as CSS to create new `CSSStyleSheet` instances.
|
|
147
|
+
styles: [cssText, cssStyleSheet],
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Customize The Shadow Root
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
const MyComponent = defineComponent(
|
|
156
|
+
(shadow) => {
|
|
157
|
+
...
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
// Use custom shadow root initialization options.
|
|
161
|
+
// (default: { mode: 'open' }).
|
|
162
|
+
shadow: {
|
|
163
|
+
mode: 'closed',
|
|
164
|
+
...
|
|
165
|
+
},
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
```
|
|
169
|
+
|
|
138
170
|
## Enable Form Association
|
|
139
171
|
|
|
140
172
|
```ts
|
|
@@ -176,24 +208,6 @@ const MyComponent = defineComponent(
|
|
|
176
208
|
);
|
|
177
209
|
```
|
|
178
210
|
|
|
179
|
-
## Customize The Shadow Root
|
|
180
|
-
|
|
181
|
-
```ts
|
|
182
|
-
const MyComponent = defineComponent(
|
|
183
|
-
(shadow) => {
|
|
184
|
-
...
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
// Use custom shadow root initialization options.
|
|
188
|
-
// (default: { mode: 'open' }).
|
|
189
|
-
shadow: {
|
|
190
|
-
mode: 'closed',
|
|
191
|
-
...
|
|
192
|
-
},
|
|
193
|
-
}
|
|
194
|
-
);
|
|
195
|
-
```
|
|
196
|
-
|
|
197
211
|
## Add Web Component Properties
|
|
198
212
|
|
|
199
213
|
```ts
|
|
@@ -251,6 +265,21 @@ const MyComponent = defineComponent((shadow) => {
|
|
|
251
265
|
});
|
|
252
266
|
```
|
|
253
267
|
|
|
268
|
+
## Extend Component Definition
|
|
269
|
+
|
|
270
|
+
```ts
|
|
271
|
+
import { extendComponentDefinition } from '@seahax/elemental';
|
|
272
|
+
|
|
273
|
+
// Create a new component definition factory (ie. `defineComponent`
|
|
274
|
+
// function) with hooks (callbacks) that can be used to add shared
|
|
275
|
+
// behavior to all defined components.
|
|
276
|
+
export const defineComponent = extendComponentDefinition({
|
|
277
|
+
init: (shadow) => {...},
|
|
278
|
+
preRender: (shadow) => {...},
|
|
279
|
+
postRender: (shadow) => {...},
|
|
280
|
+
});
|
|
281
|
+
```
|
|
282
|
+
|
|
254
283
|
## Render An Element
|
|
255
284
|
|
|
256
285
|
```ts
|
|
@@ -2,18 +2,30 @@ import { type Ref } from './hooks/useRef.ts';
|
|
|
2
2
|
type UnsafeProps = 'connectedCallback' | 'connectedMoveCallback' | 'disconnectedCallback' | 'adoptedCallback' | 'formResetCallback' | 'formStateRestoreCallback' | 'formDisabledCallback';
|
|
3
3
|
type SafePropKeys<TProps> = Exclude<keyof TProps, keyof HTMLElement | UnsafeProps>;
|
|
4
4
|
export interface ComponentConstructor<TProps extends object> {
|
|
5
|
+
/**
|
|
6
|
+
* True to mark the component as form-associated.
|
|
7
|
+
*/
|
|
5
8
|
readonly formAssociated: boolean;
|
|
6
9
|
new (): ComponentWithProps<TProps>;
|
|
10
|
+
/**
|
|
11
|
+
* Helper that sets the shadow root adopted stylesheets array from strings or
|
|
12
|
+
* style sheets.
|
|
13
|
+
*/
|
|
14
|
+
setAdoptedStyleSheets(...styles: (string | CSSStyleSheet)[]): void;
|
|
7
15
|
}
|
|
8
16
|
export interface ComponentOptions<TProps extends object> {
|
|
9
|
-
/** Shadow root attachment options. */
|
|
10
|
-
readonly shadow?: Partial<ShadowRootInit>;
|
|
11
|
-
/** Component custom property descriptors. */
|
|
12
|
-
readonly props?: ComponentPropDescriptors<TProps>;
|
|
13
|
-
/** True to mark the component as form-associated. */
|
|
14
|
-
readonly formAssociated?: boolean;
|
|
15
17
|
/** Register the component as a custom element with this tag name. */
|
|
16
18
|
readonly tagName?: `${string}-${string}`;
|
|
19
|
+
/** True to mark the component as form-associated. */
|
|
20
|
+
readonly formAssociated?: boolean;
|
|
21
|
+
/** Component custom property descriptors. */
|
|
22
|
+
readonly props?: ComponentPropDescriptors<TProps>;
|
|
23
|
+
/** Shadow root attachment options. */
|
|
24
|
+
readonly shadow?: Partial<ShadowRootInit>;
|
|
25
|
+
/** Styles to be adopted by the shadow root after creation. */
|
|
26
|
+
readonly styles?: readonly (string | CSSStyleSheet)[];
|
|
27
|
+
/** Called after the component instance is created, before rendering. */
|
|
28
|
+
readonly init?: (shadow: ComponentShadowRoot<TProps>) => void;
|
|
17
29
|
}
|
|
18
30
|
export type ComponentPropDescriptors<TProps extends object> = {
|
|
19
31
|
readonly [P in SafePropKeys<TProps>]: ComponentPropDescriptorFactory<TProps[P]>;
|
|
@@ -34,5 +46,5 @@ export type ComponentPropRefs<TProps extends object> = {
|
|
|
34
46
|
readonly [P in SafePropKeys<TProps>]: Ref<TProps[P] | undefined>;
|
|
35
47
|
};
|
|
36
48
|
/** Define a custom `HTMLElement` that is functional and reactive. */
|
|
37
|
-
export declare function defineComponent<TProps extends object = {}>(render: ComponentRender<TProps>, { props, shadow,
|
|
49
|
+
export declare function defineComponent<TProps extends object = {}>(render: ComponentRender<TProps>, { tagName, formAssociated, props, shadow, styles, init: postCreate }?: ComponentOptions<TProps>): ComponentConstructor<TProps>;
|
|
38
50
|
export {};
|
package/dist/defineComponent.js
CHANGED
|
@@ -1,29 +1,38 @@
|
|
|
1
1
|
import { createController as e } from "./internal/createController.js";
|
|
2
2
|
//#region src/defineComponent.ts
|
|
3
|
-
function t(t, {
|
|
4
|
-
class
|
|
5
|
-
static formAssociated =
|
|
3
|
+
function t(t, { tagName: n, formAssociated: r = !1, props: i, shadow: a, styles: o = [], init: s } = {}) {
|
|
4
|
+
class c extends HTMLElement {
|
|
5
|
+
static formAssociated = r;
|
|
6
6
|
#e;
|
|
7
7
|
#t;
|
|
8
8
|
#n = {};
|
|
9
9
|
constructor() {
|
|
10
10
|
if (super(), this.#e = this.attachShadow({
|
|
11
|
-
...
|
|
12
|
-
mode:
|
|
11
|
+
...a,
|
|
12
|
+
mode: a?.mode ?? "open"
|
|
13
13
|
}), this.#t = e({
|
|
14
14
|
host: this,
|
|
15
|
-
formAssociated:
|
|
15
|
+
formAssociated: r,
|
|
16
16
|
render: () => t(this.#e, this.#n),
|
|
17
17
|
attachInternals: () => super.attachInternals()
|
|
18
|
-
}),
|
|
18
|
+
}), r && this.attachInternals(), i) {
|
|
19
19
|
let e = this.#n;
|
|
20
|
-
for (let [t,
|
|
20
|
+
for (let [t, n] of Object.entries(i)) {
|
|
21
21
|
if (t in this) continue;
|
|
22
|
-
let
|
|
23
|
-
Object.defineProperty(this, t,
|
|
22
|
+
let r = n(e[t] = this.#t.createRef(void 0), this);
|
|
23
|
+
Object.defineProperty(this, t, r);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
this.setAdoptedStyleSheets(...o), s?.(this.#e);
|
|
27
|
+
}
|
|
28
|
+
setAdoptedStyleSheets(...e) {
|
|
29
|
+
this.#e.adoptedStyleSheets = e.map((e) => {
|
|
30
|
+
if (typeof e == "string") {
|
|
31
|
+
let t = new CSSStyleSheet();
|
|
32
|
+
return t.replaceSync(e), t;
|
|
33
|
+
}
|
|
34
|
+
return e;
|
|
35
|
+
});
|
|
27
36
|
}
|
|
28
37
|
attachInternals() {
|
|
29
38
|
return this.#t.attachInternals();
|
|
@@ -50,7 +59,7 @@ function t(t, { props: n, shadow: r, formAssociated: i = !1, tagName: a } = {})
|
|
|
50
59
|
this.#t.formStateRestoreCallback(e, t);
|
|
51
60
|
}
|
|
52
61
|
}
|
|
53
|
-
return
|
|
62
|
+
return n && customElements.define(n, c), c;
|
|
54
63
|
}
|
|
55
64
|
//#endregion
|
|
56
65
|
export { t as defineComponent };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineComponent.js","names":["#shadow","#controller","#props"],"sources":["../src/defineComponent.ts"],"sourcesContent":["import { type Ref } from './hooks/useRef.ts';\nimport { type Controller, createController } from './internal/createController.ts';\n\ntype UnsafeProps =\n | 'connectedCallback'\n | 'connectedMoveCallback'\n | 'disconnectedCallback'\n | 'adoptedCallback'\n | 'formResetCallback'\n | 'formStateRestoreCallback'\n | 'formDisabledCallback';\n\ntype SafePropKeys<TProps> = Exclude<keyof TProps, keyof HTMLElement | UnsafeProps>;\n\nexport interface ComponentConstructor<TProps extends object> {\n readonly formAssociated: boolean;\n new (): ComponentWithProps<TProps>;\n}\n\nexport interface ComponentOptions<TProps extends object> {\n /**
|
|
1
|
+
{"version":3,"file":"defineComponent.js","names":["#shadow","#controller","#props"],"sources":["../src/defineComponent.ts"],"sourcesContent":["import { type Ref } from './hooks/useRef.ts';\nimport { type Controller, createController } from './internal/createController.ts';\n\ntype UnsafeProps =\n | 'connectedCallback'\n | 'connectedMoveCallback'\n | 'disconnectedCallback'\n | 'adoptedCallback'\n | 'formResetCallback'\n | 'formStateRestoreCallback'\n | 'formDisabledCallback';\n\ntype SafePropKeys<TProps> = Exclude<keyof TProps, keyof HTMLElement | UnsafeProps>;\n\nexport interface ComponentConstructor<TProps extends object> {\n /**\n * True to mark the component as form-associated.\n */\n readonly formAssociated: boolean;\n\n new (): ComponentWithProps<TProps>;\n\n /**\n * Helper that sets the shadow root adopted stylesheets array from strings or\n * style sheets.\n */\n setAdoptedStyleSheets(...styles: (string | CSSStyleSheet)[]): void;\n}\n\nexport interface ComponentOptions<TProps extends object> {\n /** Register the component as a custom element with this tag name. */\n readonly tagName?: `${string}-${string}`;\n /** True to mark the component as form-associated. */\n readonly formAssociated?: boolean;\n /** Component custom property descriptors. */\n readonly props?: ComponentPropDescriptors<TProps>;\n /** Shadow root attachment options. */\n readonly shadow?: Partial<ShadowRootInit>;\n /** Styles to be adopted by the shadow root after creation. */\n readonly styles?: readonly (string | CSSStyleSheet)[];\n /** Called after the component instance is created, before rendering. */\n readonly init?: (shadow: ComponentShadowRoot<TProps>) => void;\n}\n\nexport type ComponentPropDescriptors<TProps extends object> = {\n readonly [P in SafePropKeys<TProps>]: ComponentPropDescriptorFactory<TProps[P]>;\n};\n\nexport type ComponentPropDescriptorFactory<TType> = (\n ref: Ref<TType | undefined>,\n host: HTMLElement,\n) => ComponentPropDescriptor<TType>;\n\nexport interface ComponentPropDescriptor<T> extends Omit<PropertyDescriptor, 'value' | 'get' | 'set'> {\n get(): T;\n set?(value: T): void;\n}\n\nexport type ComponentRender<TProps extends object> = (\n shadowRoot: ComponentShadowRoot<TProps>,\n props: ComponentPropRefs<TProps>,\n) => void;\n\nexport type ComponentShadowRoot<TProps extends object> = Omit<ShadowRoot, 'host'> & {\n readonly host: ComponentWithProps<TProps>;\n};\n\nexport type ComponentWithProps<TProps extends object> = HTMLElement & {\n -readonly [P in SafePropKeys<TProps>]: TProps[P];\n};\n\nexport type ComponentPropRefs<TProps extends object> = {\n readonly [P in SafePropKeys<TProps>]: Ref<TProps[P] | undefined>;\n};\n\n/** Define a custom `HTMLElement` that is functional and reactive. */\nexport function defineComponent<TProps extends object = {}>(\n render: ComponentRender<TProps>,\n { tagName, formAssociated = false, props, shadow, styles = [], init: postCreate }: ComponentOptions<TProps> = {},\n): ComponentConstructor<TProps> {\n class ComponentElement extends HTMLElement {\n static readonly formAssociated = formAssociated;\n\n readonly #shadow: ComponentShadowRoot<TProps>;\n readonly #controller: Controller;\n readonly #props = {} as ComponentPropRefs<TProps>;\n\n constructor() {\n super();\n\n this.#shadow = this.attachShadow({\n ...shadow,\n mode: shadow?.mode ?? 'open',\n }) as ComponentShadowRoot<TProps>;\n\n this.#controller = createController({\n host: this,\n formAssociated,\n render: () => render(this.#shadow, this.#props),\n attachInternals: () => super.attachInternals(),\n });\n\n if (formAssociated) {\n this.attachInternals();\n }\n\n if (props) {\n const propRefs: Record<string, Ref<unknown>> = this.#props;\n\n for (const [key, getDescriptor] of Object.entries(props as ComponentPropDescriptors<Record<string, unknown>>)) {\n if (key in this) continue;\n const ref = (propRefs[key] = this.#controller.createRef<any>(undefined));\n const descriptor = getDescriptor(ref, this);\n Object.defineProperty(this, key, descriptor);\n }\n }\n\n this.setAdoptedStyleSheets(...styles);\n postCreate?.(this.#shadow);\n }\n\n setAdoptedStyleSheets(...styles: (string | CSSStyleSheet)[]): void {\n this.#shadow.adoptedStyleSheets = styles.map((style) => {\n if (typeof style === 'string') {\n const styleSheet = new CSSStyleSheet();\n styleSheet.replaceSync(style);\n return styleSheet;\n }\n\n return style;\n });\n }\n\n override attachInternals(): ElementInternals {\n return this.#controller.attachInternals();\n }\n\n protected connectedCallback(): void {\n this.#controller.connectedCallback();\n }\n\n protected connectedMoveCallback(): void {\n this.#controller.connectedMoveCallback();\n }\n\n protected disconnectedCallback(): void {\n this.#controller.disconnectedCallback();\n }\n\n protected adoptedCallback(): void {\n this.#controller.adoptedCallback();\n }\n\n protected formDisabledCallback(disabled: boolean): void {\n this.#controller.formDisabledCallback(disabled);\n }\n\n protected formResetCallback(): void {\n this.#controller.formResetCallback();\n }\n\n protected formStateRestoreCallback(state: string | File | FormData, reason: 'restore' | 'autocomplete'): void {\n this.#controller.formStateRestoreCallback(state, reason);\n }\n }\n\n if (tagName) {\n customElements.define(tagName, ComponentElement);\n }\n\n return ComponentElement as unknown as ComponentConstructor<TProps>;\n}\n"],"mappings":";;AA4EA,SAAgB,EACd,GACA,EAAE,YAAS,oBAAiB,IAAO,UAAO,WAAQ,YAAS,EAAE,EAAE,MAAM,MAAyC,EAAE,EAClF;CAC9B,MAAM,UAAyB,YAAY;EACzC,OAAgB,iBAAiB;EAEjC;EACA;EACA,KAAkB,EAAE;EAEpB,cAAc;AAmBZ,OAlBA,OAAO,EAEP,MAAA,IAAe,KAAK,aAAa;IAC/B,GAAG;IACH,MAAM,GAAQ,QAAQ;IACvB,CAAC,EAEF,MAAA,IAAmB,EAAiB;IAClC,MAAM;IACN;IACA,cAAc,EAAO,MAAA,GAAc,MAAA,EAAY;IAC/C,uBAAuB,MAAM,iBAAiB;IAC/C,CAAC,EAEE,KACF,KAAK,iBAAiB,EAGpB,GAAO;IACT,IAAM,IAAyC,MAAA;AAE/C,SAAK,IAAM,CAAC,GAAK,MAAkB,OAAO,QAAQ,EAA2D,EAAE;AAC7G,SAAI,KAAO,KAAM;KAEjB,IAAM,IAAa,EAAc,EADX,KAAO,MAAA,EAAiB,UAAe,KAAA,EAAU,EACjC,KAAK;AAC3C,YAAO,eAAe,MAAM,GAAK,EAAW;;;AAKhD,GADA,KAAK,sBAAsB,GAAG,EAAO,EACrC,IAAa,MAAA,EAAa;;EAG5B,sBAAsB,GAAG,GAA0C;AACjE,SAAA,EAAa,qBAAqB,EAAO,KAAK,MAAU;AACtD,QAAI,OAAO,KAAU,UAAU;KAC7B,IAAM,IAAa,IAAI,eAAe;AAEtC,YADA,EAAW,YAAY,EAAM,EACtB;;AAGT,WAAO;KACP;;EAGJ,kBAA6C;AAC3C,UAAO,MAAA,EAAiB,iBAAiB;;EAG3C,oBAAoC;AAClC,SAAA,EAAiB,mBAAmB;;EAGtC,wBAAwC;AACtC,SAAA,EAAiB,uBAAuB;;EAG1C,uBAAuC;AACrC,SAAA,EAAiB,sBAAsB;;EAGzC,kBAAkC;AAChC,SAAA,EAAiB,iBAAiB;;EAGpC,qBAA+B,GAAyB;AACtD,SAAA,EAAiB,qBAAqB,EAAS;;EAGjD,oBAAoC;AAClC,SAAA,EAAiB,mBAAmB;;EAGtC,yBAAmC,GAAiC,GAA0C;AAC5G,SAAA,EAAiB,yBAAyB,GAAO,EAAO;;;AAQ5D,QAJI,KACF,eAAe,OAAO,GAAS,EAAiB,EAG3C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineComponent } from './defineComponent.js';
|
|
2
|
+
export interface ExtendComponentDefinitionOptions {
|
|
3
|
+
/** Called after the component instance is created, before rendering. */
|
|
4
|
+
init?: (shadow: ShadowRoot) => void;
|
|
5
|
+
/** Called before the component render function. */
|
|
6
|
+
preRender?: (shadow: ShadowRoot) => void;
|
|
7
|
+
/** Called after the component render function. */
|
|
8
|
+
postRender?: (shadow: ShadowRoot) => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Create a new component factory function (ie. `defineComponent`) with
|
|
12
|
+
* modified default options or render hooks.
|
|
13
|
+
*
|
|
14
|
+
* NOTE: Does not support `tagName` or `props` option defaults.
|
|
15
|
+
*/
|
|
16
|
+
export declare function extendComponentDefinition({ init, preRender, postRender, }: ExtendComponentDefinitionOptions): typeof defineComponent;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineComponent as e } from "./defineComponent.js";
|
|
2
|
+
//#region src/extendComponentDefinition.ts
|
|
3
|
+
function t({ init: t, preRender: n, postRender: r }) {
|
|
4
|
+
return (i, a) => e((e, t) => {
|
|
5
|
+
n?.(e), i(e, t), r?.(e);
|
|
6
|
+
}, {
|
|
7
|
+
...a,
|
|
8
|
+
init: (e) => {
|
|
9
|
+
t?.(e), a?.init?.(e);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { t as extendComponentDefinition };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=extendComponentDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extendComponentDefinition.js","names":[],"sources":["../src/extendComponentDefinition.ts"],"sourcesContent":["import { defineComponent } from './defineComponent.js';\n\nexport interface ExtendComponentDefinitionOptions {\n /** Called after the component instance is created, before rendering. */\n init?: (shadow: ShadowRoot) => void;\n /** Called before the component render function. */\n preRender?: (shadow: ShadowRoot) => void;\n /** Called after the component render function. */\n postRender?: (shadow: ShadowRoot) => void;\n}\n\n/**\n * Create a new component factory function (ie. `defineComponent`) with\n * modified default options or render hooks.\n *\n * NOTE: Does not support `tagName` or `props` option defaults.\n */\nexport function extendComponentDefinition({\n init,\n preRender,\n postRender,\n}: ExtendComponentDefinitionOptions): typeof defineComponent {\n return (render, options) => {\n return defineComponent(\n (shadow, propRefs) => {\n preRender?.(shadow);\n render(shadow, propRefs);\n postRender?.(shadow);\n },\n {\n ...options,\n init: (shadow) => {\n init?.(shadow);\n options?.init?.(shadow);\n },\n },\n );\n };\n}\n"],"mappings":";;AAiBA,SAAgB,EAA0B,EACxC,SACA,cACA,iBAC2D;AAC3D,SAAQ,GAAQ,MACP,GACJ,GAAQ,MAAa;AAGpB,EAFA,IAAY,EAAO,EACnB,EAAO,GAAQ,EAAS,EACxB,IAAa,EAAO;IAEtB;EACE,GAAG;EACH,OAAO,MAAW;AAEhB,GADA,IAAO,EAAO,EACd,GAAS,OAAO,EAAO;;EAE1B,CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './classes.ts';
|
|
2
2
|
export * from './createStore.ts';
|
|
3
3
|
export * from './defineComponent.ts';
|
|
4
|
+
export * from './extendComponentDefinition.ts';
|
|
4
5
|
export * from './hooks/useAsync.ts';
|
|
5
6
|
export * from './hooks/useAttributes.ts';
|
|
6
7
|
export * from './hooks/useChildEffect.ts';
|
package/dist/index.js
CHANGED
|
@@ -2,17 +2,18 @@ import { classes as e } from "./classes.js";
|
|
|
2
2
|
import { createStore as t } from "./createStore.js";
|
|
3
3
|
import { useRef as n } from "./hooks/useRef.js";
|
|
4
4
|
import { defineComponent as r } from "./defineComponent.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
5
|
+
import { extendComponentDefinition as i } from "./extendComponentDefinition.js";
|
|
6
|
+
import { useDisconnectCallback as a } from "./hooks/useDisconnect.js";
|
|
7
|
+
import { useEffect as o } from "./hooks/useEffect.js";
|
|
8
|
+
import { useAsync as s } from "./hooks/useAsync.js";
|
|
9
|
+
import { useHost as c } from "./hooks/useHost.js";
|
|
10
|
+
import { useAttributes as l } from "./hooks/useAttributes.js";
|
|
11
|
+
import { useChildEffect as u } from "./hooks/useChildEffect.js";
|
|
12
|
+
import { useDocument as d } from "./hooks/useDocument.js";
|
|
13
|
+
import { useElementInternals as f } from "./hooks/useElementInternals.js";
|
|
14
|
+
import { useForm as p, useFormDisabled as m, useFormResetCallback as h, useFormRestoreCallback as g } from "./hooks/useForm.js";
|
|
15
|
+
import { useParent as _ } from "./hooks/useParent.js";
|
|
16
|
+
import { useStore as v } from "./hooks/useStore.js";
|
|
17
|
+
import { useRoute as y } from "./hooks/useRoute.js";
|
|
18
|
+
import { html as b } from "./html.js";
|
|
19
|
+
export { e as classes, t as createStore, r as defineComponent, i as extendComponentDefinition, b as h, b as html, s as useAsync, l as useAttributes, u as useChildEffect, a as useDisconnectCallback, d as useDocument, o as useEffect, f as useElementInternals, p as useForm, m as useFormDisabled, h as useFormResetCallback, g as useFormRestoreCallback, c as useHost, _ as useParent, n as useRef, y as useRoute, v as useStore };
|
package/package.json
CHANGED