@devschile/chucao 1.5.3 → 1.7.0
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 +5 -3
- package/dist/chucao/chucao.css +1 -1
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/chucao.esm.js.map +1 -1
- package/dist/chucao/index.esm.js +1 -1
- package/dist/chucao/index.esm.js.map +1 -1
- package/dist/chucao/p-0305f2eb.entry.js +2 -0
- package/dist/chucao/{p-117c93d3.entry.js.map → p-0305f2eb.entry.js.map} +1 -1
- package/dist/chucao/{p-b07c23e1.entry.js → p-053d58a4.entry.js} +2 -2
- package/dist/chucao/{p-bb82aaf8.entry.js → p-20492b73.entry.js} +2 -2
- package/dist/chucao/p-488c7838.entry.js +2 -0
- package/dist/chucao/{p-061ffcf3.entry.js → p-9a614e82.entry.js} +2 -2
- package/dist/chucao/{p-14d8a79c.entry.js → p-ad3206a2.entry.js} +2 -2
- package/dist/chucao/p-c598f978.entry.js +2 -0
- package/dist/chucao/p-c598f978.entry.js.map +1 -0
- package/dist/chucao/{p-c0c5522f.entry.js → p-fe8e9537.entry.js} +2 -2
- package/dist/chucao/p-pfWAsOzE.js +3 -0
- package/dist/chucao/p-pfWAsOzE.js.map +1 -0
- package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
- package/dist/cjs/{ch-badge_6.cjs.entry.js → ch-alert_8.cjs.entry.js} +73 -9
- package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/ch-divider.cjs.entry.js +2 -2
- package/dist/cjs/ch-link.cjs.entry.js +1 -1
- package/dist/cjs/ch-radio.cjs.entry.js +2 -2
- package/dist/cjs/ch-tabs.cjs.entry.js +2 -2
- package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
- package/dist/cjs/chucao.cjs.js +3 -3
- package/dist/cjs/chucao.cjs.js.map +1 -1
- package/dist/cjs/{index-D7ZSLrHc.js → index-ls4U227d.js} +715 -16
- package/dist/cjs/index-ls4U227d.js.map +1 -0
- package/dist/cjs/index.cjs.js +7 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/ch-alert/ch-alert.css +77 -0
- package/dist/collection/components/ch-alert/ch-alert.js +118 -0
- package/dist/collection/components/ch-alert/ch-alert.js.map +1 -0
- package/dist/collection/components/ch-badge/ch-badge.js +1 -1
- package/dist/collection/components/ch-button/ch-button.js +1 -1
- package/dist/collection/components/ch-button/ch-button.js.map +1 -1
- package/dist/collection/components/ch-card/ch-card.js +1 -1
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
- package/dist/collection/components/ch-divider/ch-divider.js +1 -1
- package/dist/collection/components/ch-input/ch-input.js +1 -1
- package/dist/collection/components/ch-radio/ch-radio.js +1 -1
- package/dist/collection/components/ch-select/ch-select.js +1 -1
- package/dist/collection/components/ch-spinner/ch-spinner.css +39 -0
- package/dist/collection/components/ch-spinner/ch-spinner.js +90 -0
- package/dist/collection/components/ch-spinner/ch-spinner.js.map +1 -0
- package/dist/collection/components/ch-switch/ch-switch.js +1 -1
- package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
- package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
- package/dist/collection/tokens/tokens.js +5 -1
- package/dist/collection/tokens/tokens.js.map +1 -1
- package/dist/collection/tokens/types.js.map +1 -1
- package/dist/components/ch-accordion.js +1 -1
- package/dist/components/ch-alert.d.ts +11 -0
- package/dist/components/ch-alert.js +2 -0
- package/dist/components/ch-alert.js.map +1 -0
- package/dist/components/ch-badge.js +1 -1
- package/dist/components/ch-button.js +1 -1
- package/dist/components/ch-button.js.map +1 -1
- package/dist/components/ch-card.js +1 -1
- package/dist/components/ch-card.js.map +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-link.js +1 -1
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-spinner.d.ts +11 -0
- package/dist/components/ch-spinner.js +2 -0
- package/dist/components/ch-spinner.js.map +1 -0
- package/dist/components/ch-switch.js +1 -1
- package/dist/components/ch-tabs.js +1 -1
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-ONE3uKkF.js +2 -0
- package/dist/components/p-ONE3uKkF.js.map +1 -0
- package/dist/esm/ch-accordion.entry.js +1 -1
- package/dist/esm/{ch-badge_6.entry.js → ch-alert_8.entry.js} +72 -10
- package/dist/esm/ch-alert_8.entry.js.map +1 -0
- package/dist/esm/ch-checkbox.entry.js +2 -2
- package/dist/esm/ch-divider.entry.js +2 -2
- package/dist/esm/ch-link.entry.js +1 -1
- package/dist/esm/ch-radio.entry.js +2 -2
- package/dist/esm/ch-tabs.entry.js +2 -2
- package/dist/esm/ch-textarea.entry.js +2 -2
- package/dist/esm/chucao.js +4 -4
- package/dist/esm/chucao.js.map +1 -1
- package/dist/esm/{index-B0AkgfgP.js → index-pfWAsOzE.js} +715 -16
- package/dist/esm/index-pfWAsOzE.js.map +1 -0
- package/dist/esm/index.js +6 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/ch-alert/ch-alert.d.ts +34 -0
- package/dist/types/components/ch-spinner/ch-spinner.d.ts +25 -0
- package/dist/types/components.d.ts +153 -0
- package/dist/types/stencil-public-runtime.d.ts +11 -0
- package/dist/types/tokens/tokens.d.ts +4 -0
- package/dist/types/tokens/types.d.ts +2 -2
- package/dist-react/components.d.ts +9 -1
- package/dist-react/components.js +18 -0
- package/dist-react/components.ts +25 -1
- package/dist-vue/index.d.ts +2 -0
- package/dist-vue/index.js +13 -0
- package/dist-vue/index.ts +17 -0
- package/hydrate/index.d.ts +287 -0
- package/hydrate/index.js +24405 -0
- package/hydrate/index.mjs +24395 -0
- package/hydrate/package.json +12 -0
- package/package.json +12 -2
- package/dist/chucao/p-117c93d3.entry.js +0 -2
- package/dist/chucao/p-B0AkgfgP.js +0 -3
- package/dist/chucao/p-B0AkgfgP.js.map +0 -1
- package/dist/chucao/p-c1edf460.entry.js +0 -2
- package/dist/chucao/p-fa56821f.entry.js +0 -2
- package/dist/chucao/p-fa56821f.entry.js.map +0 -1
- package/dist/cjs/ch-badge_6.cjs.entry.js.map +0 -1
- package/dist/cjs/index-D7ZSLrHc.js.map +0 -1
- package/dist/components/p-W-iJXblk.js +0 -2
- package/dist/components/p-W-iJXblk.js.map +0 -1
- package/dist/esm/ch-badge_6.entry.js.map +0 -1
- package/dist/esm/index-B0AkgfgP.js.map +0 -1
- /package/dist/chucao/{p-b07c23e1.entry.js.map → p-053d58a4.entry.js.map} +0 -0
- /package/dist/chucao/{p-bb82aaf8.entry.js.map → p-20492b73.entry.js.map} +0 -0
- /package/dist/chucao/{p-c1edf460.entry.js.map → p-488c7838.entry.js.map} +0 -0
- /package/dist/chucao/{p-061ffcf3.entry.js.map → p-9a614e82.entry.js.map} +0 -0
- /package/dist/chucao/{p-14d8a79c.entry.js.map → p-ad3206a2.entry.js.map} +0 -0
- /package/dist/chucao/{p-c0c5522f.entry.js.map → p-fe8e9537.entry.js.map} +0 -0
package/dist-react/components.ts
CHANGED
|
@@ -11,9 +11,10 @@ import type { EventName, StencilReactComponent } from '@stencil/react-output-tar
|
|
|
11
11
|
import { createComponent } from '@stencil/react-output-target/runtime';
|
|
12
12
|
import React from 'react';
|
|
13
13
|
|
|
14
|
-
import { type ChAccordionCustomEvent, type ChButtonCustomEvent, type ChCheckboxCustomEvent, type ChInputCustomEvent, type ChLinkCustomEvent, type ChRadioCustomEvent, type ChSelectCustomEvent, type ChSwitchCustomEvent, type ChTabsCustomEvent, type ChTextareaCustomEvent } from "@devschile/chucao";
|
|
14
|
+
import { type ChAccordionCustomEvent, type ChAlertCustomEvent, type ChButtonCustomEvent, type ChCheckboxCustomEvent, type ChInputCustomEvent, type ChLinkCustomEvent, type ChRadioCustomEvent, type ChSelectCustomEvent, type ChSwitchCustomEvent, type ChTabsCustomEvent, type ChTextareaCustomEvent } from "@devschile/chucao";
|
|
15
15
|
import type { Components } from "@devschile/chucao/dist/components";
|
|
16
16
|
import { ChAccordion as ChAccordionElement, defineCustomElement as defineChAccordion } from "@devschile/chucao/dist/components/ch-accordion.js";
|
|
17
|
+
import { ChAlert as ChAlertElement, defineCustomElement as defineChAlert } from "@devschile/chucao/dist/components/ch-alert.js";
|
|
17
18
|
import { ChBadge as ChBadgeElement, defineCustomElement as defineChBadge } from "@devschile/chucao/dist/components/ch-badge.js";
|
|
18
19
|
import { ChButton as ChButtonElement, defineCustomElement as defineChButton } from "@devschile/chucao/dist/components/ch-button.js";
|
|
19
20
|
import { ChCard as ChCardElement, defineCustomElement as defineChCard } from "@devschile/chucao/dist/components/ch-card.js";
|
|
@@ -23,6 +24,7 @@ import { ChInput as ChInputElement, defineCustomElement as defineChInput } from
|
|
|
23
24
|
import { ChLink as ChLinkElement, defineCustomElement as defineChLink } from "@devschile/chucao/dist/components/ch-link.js";
|
|
24
25
|
import { ChRadio as ChRadioElement, defineCustomElement as defineChRadio } from "@devschile/chucao/dist/components/ch-radio.js";
|
|
25
26
|
import { ChSelect as ChSelectElement, defineCustomElement as defineChSelect } from "@devschile/chucao/dist/components/ch-select.js";
|
|
27
|
+
import { ChSpinner as ChSpinnerElement, defineCustomElement as defineChSpinner } from "@devschile/chucao/dist/components/ch-spinner.js";
|
|
26
28
|
import { ChSwitch as ChSwitchElement, defineCustomElement as defineChSwitch } from "@devschile/chucao/dist/components/ch-switch.js";
|
|
27
29
|
import { ChTabs as ChTabsElement, defineCustomElement as defineChTabs } from "@devschile/chucao/dist/components/ch-tabs.js";
|
|
28
30
|
import { ChTextarea as ChTextareaElement, defineCustomElement as defineChTextarea } from "@devschile/chucao/dist/components/ch-textarea.js";
|
|
@@ -38,6 +40,17 @@ export const ChAccordion: StencilReactComponent<ChAccordionElement, ChAccordionE
|
|
|
38
40
|
defineCustomElement: defineChAccordion
|
|
39
41
|
});
|
|
40
42
|
|
|
43
|
+
export type ChAlertEvents = { onChDismiss: EventName<ChAlertCustomEvent<void>> };
|
|
44
|
+
|
|
45
|
+
export const ChAlert: StencilReactComponent<ChAlertElement, ChAlertEvents, Components.ChAlert> = /*@__PURE__*/ createComponent<ChAlertElement, ChAlertEvents, Components.ChAlert>({
|
|
46
|
+
tagName: 'ch-alert',
|
|
47
|
+
elementClass: ChAlertElement,
|
|
48
|
+
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
49
|
+
react: React,
|
|
50
|
+
events: { onChDismiss: 'chDismiss' } as ChAlertEvents,
|
|
51
|
+
defineCustomElement: defineChAlert
|
|
52
|
+
});
|
|
53
|
+
|
|
41
54
|
export type ChBadgeEvents = NonNullable<unknown>;
|
|
42
55
|
|
|
43
56
|
export const ChBadge: StencilReactComponent<ChBadgeElement, ChBadgeEvents, Components.ChBadge> = /*@__PURE__*/ createComponent<ChBadgeElement, ChBadgeEvents, Components.ChBadge>({
|
|
@@ -143,6 +156,17 @@ export const ChSelect: StencilReactComponent<ChSelectElement, ChSelectEvents, Co
|
|
|
143
156
|
defineCustomElement: defineChSelect
|
|
144
157
|
});
|
|
145
158
|
|
|
159
|
+
export type ChSpinnerEvents = NonNullable<unknown>;
|
|
160
|
+
|
|
161
|
+
export const ChSpinner: StencilReactComponent<ChSpinnerElement, ChSpinnerEvents, Components.ChSpinner> = /*@__PURE__*/ createComponent<ChSpinnerElement, ChSpinnerEvents, Components.ChSpinner>({
|
|
162
|
+
tagName: 'ch-spinner',
|
|
163
|
+
elementClass: ChSpinnerElement,
|
|
164
|
+
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
165
|
+
react: React,
|
|
166
|
+
events: {} as ChSpinnerEvents,
|
|
167
|
+
defineCustomElement: defineChSpinner
|
|
168
|
+
});
|
|
169
|
+
|
|
146
170
|
export type ChSwitchEvents = { onChChange: EventName<ChSwitchCustomEvent<boolean>> };
|
|
147
171
|
|
|
148
172
|
export const ChSwitch: StencilReactComponent<ChSwitchElement, ChSwitchEvents, Components.ChSwitch> = /*@__PURE__*/ createComponent<ChSwitchElement, ChSwitchEvents, Components.ChSwitch>({
|
package/dist-vue/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type StencilVueComponent } from '@stencil/vue-output-target/runtime';
|
|
2
2
|
import type { JSX } from '@devschile/chucao/dist/components';
|
|
3
3
|
export declare const ChAccordion: StencilVueComponent<JSX.ChAccordion>;
|
|
4
|
+
export declare const ChAlert: StencilVueComponent<JSX.ChAlert>;
|
|
4
5
|
export declare const ChBadge: StencilVueComponent<JSX.ChBadge>;
|
|
5
6
|
export declare const ChButton: StencilVueComponent<JSX.ChButton>;
|
|
6
7
|
export declare const ChCard: StencilVueComponent<JSX.ChCard>;
|
|
@@ -10,6 +11,7 @@ export declare const ChInput: StencilVueComponent<JSX.ChInput>;
|
|
|
10
11
|
export declare const ChLink: StencilVueComponent<JSX.ChLink>;
|
|
11
12
|
export declare const ChRadio: StencilVueComponent<JSX.ChRadio>;
|
|
12
13
|
export declare const ChSelect: StencilVueComponent<JSX.ChSelect>;
|
|
14
|
+
export declare const ChSpinner: StencilVueComponent<JSX.ChSpinner>;
|
|
13
15
|
export declare const ChSwitch: StencilVueComponent<JSX.ChSwitch>;
|
|
14
16
|
export declare const ChTabs: StencilVueComponent<JSX.ChTabs>;
|
|
15
17
|
export declare const ChTextarea: StencilVueComponent<JSX.ChTextarea>;
|
package/dist-vue/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/* auto-generated vue proxies */
|
|
4
4
|
import { defineContainer } from '@stencil/vue-output-target/runtime';
|
|
5
5
|
import { defineCustomElement as defineChAccordion } from '@devschile/chucao/dist/components/ch-accordion.js';
|
|
6
|
+
import { defineCustomElement as defineChAlert } from '@devschile/chucao/dist/components/ch-alert.js';
|
|
6
7
|
import { defineCustomElement as defineChBadge } from '@devschile/chucao/dist/components/ch-badge.js';
|
|
7
8
|
import { defineCustomElement as defineChButton } from '@devschile/chucao/dist/components/ch-button.js';
|
|
8
9
|
import { defineCustomElement as defineChCard } from '@devschile/chucao/dist/components/ch-card.js';
|
|
@@ -12,6 +13,7 @@ import { defineCustomElement as defineChInput } from '@devschile/chucao/dist/com
|
|
|
12
13
|
import { defineCustomElement as defineChLink } from '@devschile/chucao/dist/components/ch-link.js';
|
|
13
14
|
import { defineCustomElement as defineChRadio } from '@devschile/chucao/dist/components/ch-radio.js';
|
|
14
15
|
import { defineCustomElement as defineChSelect } from '@devschile/chucao/dist/components/ch-select.js';
|
|
16
|
+
import { defineCustomElement as defineChSpinner } from '@devschile/chucao/dist/components/ch-spinner.js';
|
|
15
17
|
import { defineCustomElement as defineChSwitch } from '@devschile/chucao/dist/components/ch-switch.js';
|
|
16
18
|
import { defineCustomElement as defineChTabs } from '@devschile/chucao/dist/components/ch-tabs.js';
|
|
17
19
|
import { defineCustomElement as defineChTextarea } from '@devschile/chucao/dist/components/ch-textarea.js';
|
|
@@ -22,6 +24,13 @@ export const ChAccordion = /*@__PURE__*/ defineContainer('ch-accordion', defineC
|
|
|
22
24
|
], [
|
|
23
25
|
'chChange'
|
|
24
26
|
]);
|
|
27
|
+
export const ChAlert = /*@__PURE__*/ defineContainer('ch-alert', defineChAlert, [
|
|
28
|
+
'variant',
|
|
29
|
+
'dismissLabel',
|
|
30
|
+
'chDismiss'
|
|
31
|
+
], [
|
|
32
|
+
'chDismiss'
|
|
33
|
+
]);
|
|
25
34
|
export const ChBadge = /*@__PURE__*/ defineContainer('ch-badge', defineChBadge, [
|
|
26
35
|
'variant'
|
|
27
36
|
]);
|
|
@@ -106,6 +115,10 @@ export const ChSelect = /*@__PURE__*/ defineContainer('ch-select', defineChSelec
|
|
|
106
115
|
], [
|
|
107
116
|
'chChange'
|
|
108
117
|
]);
|
|
118
|
+
export const ChSpinner = /*@__PURE__*/ defineContainer('ch-spinner', defineChSpinner, [
|
|
119
|
+
'size',
|
|
120
|
+
'label'
|
|
121
|
+
]);
|
|
109
122
|
export const ChSwitch = /*@__PURE__*/ defineContainer('ch-switch', defineChSwitch, [
|
|
110
123
|
'label',
|
|
111
124
|
'name',
|
package/dist-vue/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { defineContainer, type StencilVueComponent } from '@stencil/vue-output-t
|
|
|
6
6
|
import type { JSX } from '@devschile/chucao/dist/components';
|
|
7
7
|
|
|
8
8
|
import { defineCustomElement as defineChAccordion } from '@devschile/chucao/dist/components/ch-accordion.js';
|
|
9
|
+
import { defineCustomElement as defineChAlert } from '@devschile/chucao/dist/components/ch-alert.js';
|
|
9
10
|
import { defineCustomElement as defineChBadge } from '@devschile/chucao/dist/components/ch-badge.js';
|
|
10
11
|
import { defineCustomElement as defineChButton } from '@devschile/chucao/dist/components/ch-button.js';
|
|
11
12
|
import { defineCustomElement as defineChCard } from '@devschile/chucao/dist/components/ch-card.js';
|
|
@@ -15,6 +16,7 @@ import { defineCustomElement as defineChInput } from '@devschile/chucao/dist/com
|
|
|
15
16
|
import { defineCustomElement as defineChLink } from '@devschile/chucao/dist/components/ch-link.js';
|
|
16
17
|
import { defineCustomElement as defineChRadio } from '@devschile/chucao/dist/components/ch-radio.js';
|
|
17
18
|
import { defineCustomElement as defineChSelect } from '@devschile/chucao/dist/components/ch-select.js';
|
|
19
|
+
import { defineCustomElement as defineChSpinner } from '@devschile/chucao/dist/components/ch-spinner.js';
|
|
18
20
|
import { defineCustomElement as defineChSwitch } from '@devschile/chucao/dist/components/ch-switch.js';
|
|
19
21
|
import { defineCustomElement as defineChTabs } from '@devschile/chucao/dist/components/ch-tabs.js';
|
|
20
22
|
import { defineCustomElement as defineChTextarea } from '@devschile/chucao/dist/components/ch-textarea.js';
|
|
@@ -30,6 +32,15 @@ export const ChAccordion: StencilVueComponent<JSX.ChAccordion> = /*@__PURE__*/ d
|
|
|
30
32
|
]);
|
|
31
33
|
|
|
32
34
|
|
|
35
|
+
export const ChAlert: StencilVueComponent<JSX.ChAlert> = /*@__PURE__*/ defineContainer<JSX.ChAlert>('ch-alert', defineChAlert, [
|
|
36
|
+
'variant',
|
|
37
|
+
'dismissLabel',
|
|
38
|
+
'chDismiss'
|
|
39
|
+
], [
|
|
40
|
+
'chDismiss'
|
|
41
|
+
]);
|
|
42
|
+
|
|
43
|
+
|
|
33
44
|
export const ChBadge: StencilVueComponent<JSX.ChBadge> = /*@__PURE__*/ defineContainer<JSX.ChBadge>('ch-badge', defineChBadge, [
|
|
34
45
|
'variant'
|
|
35
46
|
]);
|
|
@@ -132,6 +143,12 @@ export const ChSelect: StencilVueComponent<JSX.ChSelect> = /*@__PURE__*/ defineC
|
|
|
132
143
|
]);
|
|
133
144
|
|
|
134
145
|
|
|
146
|
+
export const ChSpinner: StencilVueComponent<JSX.ChSpinner> = /*@__PURE__*/ defineContainer<JSX.ChSpinner>('ch-spinner', defineChSpinner, [
|
|
147
|
+
'size',
|
|
148
|
+
'label'
|
|
149
|
+
]);
|
|
150
|
+
|
|
151
|
+
|
|
135
152
|
export const ChSwitch: StencilVueComponent<JSX.ChSwitch> = /*@__PURE__*/ defineContainer<JSX.ChSwitch>('ch-switch', defineChSwitch, [
|
|
136
153
|
'label',
|
|
137
154
|
'name',
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
+
|
|
3
|
+
import { Readable } from 'node:stream';
|
|
4
|
+
|
|
5
|
+
export declare function createWindowFromHtml(templateHtml: string, uniqueId: string): any;
|
|
6
|
+
export type TagTransformer = (tag: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* Serialize a value to a string that can be deserialized later.
|
|
9
|
+
* @param {unknown} value - The value to serialize.
|
|
10
|
+
* @returns {string} A string that can be deserialized later.
|
|
11
|
+
* @deprecated will be removed in v5. Use `@PropSerialize()` decorator instead.
|
|
12
|
+
*/
|
|
13
|
+
export declare function serializeProperty(value: unknown): string | number | boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Deserialize a value from a string that was serialized earlier.
|
|
16
|
+
* @param {string} value - The string to deserialize.
|
|
17
|
+
* @returns {unknown} The deserialized value.
|
|
18
|
+
* @deprecated will be removed in v5. Use `@AttrDeserialize()` decorator instead.
|
|
19
|
+
*/
|
|
20
|
+
export declare function deserializeProperty(value: string): any;
|
|
21
|
+
export type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
|
|
22
|
+
export interface HydrateDocumentOptions {
|
|
23
|
+
/**
|
|
24
|
+
* Build ID that will be added to `<html data-stencil-build="BUILD_ID">`. By default
|
|
25
|
+
* a random ID will be generated
|
|
26
|
+
*/
|
|
27
|
+
buildId?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the `href` attribute on the `<link rel="canonical">`
|
|
30
|
+
* tag within the `<head>`. If the value is not defined it will
|
|
31
|
+
* ensure a canonical link tag is no included in the `<head>`.
|
|
32
|
+
*/
|
|
33
|
+
canonicalUrl?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Include the HTML comments and attributes used by the client-side
|
|
36
|
+
* JavaScript to read the structure of the HTML and rebuild each
|
|
37
|
+
* component. Defaults to `true`.
|
|
38
|
+
*/
|
|
39
|
+
clientHydrateAnnotations?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Constrain `setTimeout()` to 1ms, but still async. Also
|
|
42
|
+
* only allows `setInterval()` to fire once, also constrained to 1ms.
|
|
43
|
+
* Defaults to `true`.
|
|
44
|
+
*/
|
|
45
|
+
constrainTimeouts?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Sets `document.cookie`
|
|
48
|
+
*/
|
|
49
|
+
cookie?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Sets the `dir` attribute on the top level `<html>`.
|
|
52
|
+
*/
|
|
53
|
+
direction?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Component tag names listed here will not be prerendered, nor will
|
|
56
|
+
* hydrated on the client-side. Components listed here will be ignored
|
|
57
|
+
* as custom elements and treated no differently than a `<div>`.
|
|
58
|
+
*/
|
|
59
|
+
excludeComponents?: string[];
|
|
60
|
+
/**
|
|
61
|
+
* Sets the `lang` attribute on the top level `<html>`.
|
|
62
|
+
*/
|
|
63
|
+
language?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Maximum number of components to hydrate on one page. Defaults to `300`.
|
|
66
|
+
*/
|
|
67
|
+
maxHydrateCount?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Sets `document.referrer`
|
|
70
|
+
*/
|
|
71
|
+
referrer?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Removes every `<script>` element found in the `document`. Defaults to `false`.
|
|
74
|
+
*/
|
|
75
|
+
removeScripts?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Removes CSS not used by elements within the `document`. Defaults to `true`.
|
|
78
|
+
*/
|
|
79
|
+
removeUnusedStyles?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* The url the runtime uses for the resources, such as the assets directory.
|
|
82
|
+
*/
|
|
83
|
+
resourcesUrl?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Prints out runtime console logs to the NodeJS process. Defaults to `false`.
|
|
86
|
+
*/
|
|
87
|
+
runtimeLogging?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Component tags listed here will only be prerendered or server-side-rendered
|
|
90
|
+
* and will not be client-side hydrated. This is useful for components that
|
|
91
|
+
* are not dynamic and do not need to be defined as a custom element within the
|
|
92
|
+
* browser. For example, a header or footer component would be a good example that
|
|
93
|
+
* may not require any client-side JavaScript.
|
|
94
|
+
*/
|
|
95
|
+
staticComponents?: string[];
|
|
96
|
+
/**
|
|
97
|
+
* The amount of milliseconds to wait for a page to finish rendering until
|
|
98
|
+
* a timeout error is thrown. Defaults to `15000`.
|
|
99
|
+
*/
|
|
100
|
+
timeout?: number;
|
|
101
|
+
/**
|
|
102
|
+
* Sets `document.title`.
|
|
103
|
+
*/
|
|
104
|
+
title?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Sets `location.href`
|
|
107
|
+
*/
|
|
108
|
+
url?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Sets `navigator.userAgent`
|
|
111
|
+
*/
|
|
112
|
+
userAgent?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Configure how Stencil serializes the components shadow root.
|
|
115
|
+
* - If set to `declarative-shadow-dom` the component will be rendered within a Declarative Shadow DOM.
|
|
116
|
+
* - If set to `scoped` Stencil will render the contents of the shadow root as a `scoped: true` component
|
|
117
|
+
* and the shadow DOM will be created during client-side hydration.
|
|
118
|
+
* - Alternatively you can mix and match the two by providing an object with `declarative-shadow-dom` and `scoped` keys,
|
|
119
|
+
* the value arrays containing the tag names of the components that should be rendered in that mode.
|
|
120
|
+
*
|
|
121
|
+
* Examples:
|
|
122
|
+
* - `{ 'declarative-shadow-dom': ['my-component-1', 'another-component'], default: 'scoped' }`
|
|
123
|
+
* Render all components as `scoped` apart from `my-component-1` and `another-component`
|
|
124
|
+
* - `{ 'scoped': ['an-option-component'], default: 'declarative-shadow-dom' }`
|
|
125
|
+
* Render all components within `declarative-shadow-dom` apart from `an-option-component`
|
|
126
|
+
* - `'scoped'` Render all components as `scoped`
|
|
127
|
+
* - `false` disables shadow root serialization
|
|
128
|
+
*
|
|
129
|
+
* *NOTE* `true` has been deprecated in favor of `declarative-shadow-dom` and `scoped`
|
|
130
|
+
* @default 'declarative-shadow-dom'
|
|
131
|
+
*/
|
|
132
|
+
serializeShadowRoot?: "declarative-shadow-dom" | "scoped" | {
|
|
133
|
+
"declarative-shadow-dom"?: string[];
|
|
134
|
+
scoped?: string[];
|
|
135
|
+
default: "declarative-shadow-dom" | "scoped";
|
|
136
|
+
} | boolean;
|
|
137
|
+
}
|
|
138
|
+
export interface SerializeDocumentOptions extends HydrateDocumentOptions {
|
|
139
|
+
/**
|
|
140
|
+
* Runs after the `document` has been hydrated.
|
|
141
|
+
*/
|
|
142
|
+
afterHydrate?(document: any): any | Promise<any>;
|
|
143
|
+
/**
|
|
144
|
+
* Sets an approximate line width the HTML should attempt to stay within.
|
|
145
|
+
* Note that this is "approximate", in that HTML may often not be able
|
|
146
|
+
* to be split at an exact line width. Additionally, new lines created
|
|
147
|
+
* is where HTML naturally already has whitespace, such as before an
|
|
148
|
+
* attribute or spaces between words. Defaults to `100`.
|
|
149
|
+
*/
|
|
150
|
+
approximateLineWidth?: number;
|
|
151
|
+
/**
|
|
152
|
+
* Runs before the `document` has been hydrated.
|
|
153
|
+
*/
|
|
154
|
+
beforeHydrate?(document: any): any | Promise<any>;
|
|
155
|
+
/**
|
|
156
|
+
* Format the HTML in a nicely indented format.
|
|
157
|
+
* Defaults to `false`.
|
|
158
|
+
*/
|
|
159
|
+
prettyHtml?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Remove quotes from attribute values when possible.
|
|
162
|
+
* Defaults to `true`.
|
|
163
|
+
*/
|
|
164
|
+
removeAttributeQuotes?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Remove the `=""` from standardized `boolean` attributes,
|
|
167
|
+
* such as `hidden` or `checked`. Defaults to `true`.
|
|
168
|
+
*/
|
|
169
|
+
removeBooleanAttributeQuotes?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Remove these standardized attributes when their value is empty:
|
|
172
|
+
* `class`, `dir`, `id`, `lang`, and `name`, `title`. Defaults to `true`.
|
|
173
|
+
*/
|
|
174
|
+
removeEmptyAttributes?: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Remove HTML comments. Defaults to `true`.
|
|
177
|
+
*/
|
|
178
|
+
removeHtmlComments?: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* The `fullDocument` flag determines the format of the rendered output. Set it to true to
|
|
181
|
+
* generate a complete HTML document, or false to render only the component.
|
|
182
|
+
* @default true
|
|
183
|
+
*/
|
|
184
|
+
fullDocument?: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Style modes to render the component in.
|
|
187
|
+
* @see https://stenciljs.com/docs/styling#style-modes
|
|
188
|
+
*/
|
|
189
|
+
modes?: ResolutionHandler[];
|
|
190
|
+
}
|
|
191
|
+
export interface HydrateFactoryOptions extends SerializeDocumentOptions {
|
|
192
|
+
serializeToHtml: boolean;
|
|
193
|
+
destroyWindow: boolean;
|
|
194
|
+
destroyDocument: boolean;
|
|
195
|
+
}
|
|
196
|
+
export interface Diagnostic {
|
|
197
|
+
absFilePath?: string | undefined;
|
|
198
|
+
code?: string;
|
|
199
|
+
columnNumber?: number | undefined;
|
|
200
|
+
debugText?: string;
|
|
201
|
+
header?: string;
|
|
202
|
+
language?: string;
|
|
203
|
+
level: "error" | "warn" | "info" | "log" | "debug";
|
|
204
|
+
lineNumber?: number | undefined;
|
|
205
|
+
lines: PrintLine[];
|
|
206
|
+
messageText: string;
|
|
207
|
+
relFilePath?: string | undefined;
|
|
208
|
+
type: string;
|
|
209
|
+
}
|
|
210
|
+
export interface PrintLine {
|
|
211
|
+
lineIndex: number;
|
|
212
|
+
lineNumber: number;
|
|
213
|
+
text: string;
|
|
214
|
+
errorCharStart: number;
|
|
215
|
+
errorLength?: number;
|
|
216
|
+
}
|
|
217
|
+
export interface HydrateResults {
|
|
218
|
+
buildId: string;
|
|
219
|
+
diagnostics: Diagnostic[];
|
|
220
|
+
url: string;
|
|
221
|
+
host: string | null;
|
|
222
|
+
hostname: string | null;
|
|
223
|
+
href: string | null;
|
|
224
|
+
port: string | null;
|
|
225
|
+
pathname: string | null;
|
|
226
|
+
search: string | null;
|
|
227
|
+
hash: string | null;
|
|
228
|
+
html: string | null;
|
|
229
|
+
components: HydrateComponent[];
|
|
230
|
+
anchors: HydrateAnchorElement[];
|
|
231
|
+
imgs: HydrateImgElement[];
|
|
232
|
+
scripts: HydrateScriptElement[];
|
|
233
|
+
styles: HydrateStyleElement[];
|
|
234
|
+
staticData: HydrateStaticData[];
|
|
235
|
+
title: string | null;
|
|
236
|
+
hydratedCount: number;
|
|
237
|
+
httpStatus: number | null;
|
|
238
|
+
}
|
|
239
|
+
export interface HydrateComponent {
|
|
240
|
+
tag: string;
|
|
241
|
+
mode: string;
|
|
242
|
+
count: number;
|
|
243
|
+
depth: number;
|
|
244
|
+
}
|
|
245
|
+
export interface HydrateElement {
|
|
246
|
+
[attrName: string]: string | undefined;
|
|
247
|
+
}
|
|
248
|
+
export interface HydrateAnchorElement extends HydrateElement {
|
|
249
|
+
href?: string;
|
|
250
|
+
target?: string;
|
|
251
|
+
}
|
|
252
|
+
export interface HydrateImgElement extends HydrateElement {
|
|
253
|
+
src?: string;
|
|
254
|
+
}
|
|
255
|
+
export interface HydrateScriptElement extends HydrateElement {
|
|
256
|
+
src?: string;
|
|
257
|
+
type?: string;
|
|
258
|
+
}
|
|
259
|
+
export interface HydrateStyleElement extends HydrateElement {
|
|
260
|
+
id?: string;
|
|
261
|
+
href?: string;
|
|
262
|
+
content?: string;
|
|
263
|
+
}
|
|
264
|
+
export interface HydrateStaticData {
|
|
265
|
+
id: string;
|
|
266
|
+
type: string;
|
|
267
|
+
content: string;
|
|
268
|
+
}
|
|
269
|
+
export declare function streamToString(html: string | any, option?: SerializeDocumentOptions): Readable;
|
|
270
|
+
export declare function renderToString(html: string | any, options?: SerializeDocumentOptions): Promise<HydrateResults>;
|
|
271
|
+
export declare function renderToString(html: string | any, options: SerializeDocumentOptions | undefined, asStream: true): Readable;
|
|
272
|
+
export declare function hydrateDocument(doc: any | string, options?: HydrateDocumentOptions): Promise<HydrateResults>;
|
|
273
|
+
export declare function hydrateDocument(doc: any | string, options: HydrateDocumentOptions | undefined, asStream?: boolean): Readable;
|
|
274
|
+
export declare function serializeDocumentToString(doc: Document, opts: HydrateFactoryOptions): string;
|
|
275
|
+
/**
|
|
276
|
+
* Transforms a tag name using the current tag transformer
|
|
277
|
+
* @param tag - the tag to transform e.g. `my-tag`
|
|
278
|
+
* @returns the transformed tag e.g. `new-my-tag`
|
|
279
|
+
*/
|
|
280
|
+
export declare function transformTag<T extends string>(tag: T): T;
|
|
281
|
+
/**
|
|
282
|
+
* Sets the tag transformer to be used when rendering custom elements
|
|
283
|
+
* @param transformer the transformer function to use. Must return a string
|
|
284
|
+
*/
|
|
285
|
+
export declare function setTagTransformer(transformer: TagTransformer): void;
|
|
286
|
+
|
|
287
|
+
export {};
|