@htmlplus/element 3.4.1 → 3.4.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/dist/client.d.ts +14 -10
- package/dist/client.js +543 -601
- package/dist/constants.d.ts +8 -8
- package/dist/constants.js +9 -9
- package/dist/jsx-runtime.d.ts +15 -186
- package/dist/transformer.js +51 -21
- package/package.json +50 -47
- package/dist/internal.d.ts +0 -1
- package/dist/internal.js +0 -3
package/dist/constants.d.ts
CHANGED
|
@@ -23,6 +23,13 @@ declare const LIFECYCLE_DISCONNECTED = "disconnectedCallback";
|
|
|
23
23
|
declare const LIFECYCLE_READY = "readyCallback";
|
|
24
24
|
declare const LIFECYCLE_UPDATE = "updateCallback";
|
|
25
25
|
declare const LIFECYCLE_UPDATED = "updatedCallback";
|
|
26
|
+
declare const INTERNAL_ATTRIBUTES_IMPORTED = "_internal_a_";
|
|
27
|
+
declare const INTERNAL_ATTRIBUTES_LOCAL = "INTERNAL_ATTRIBUTES";
|
|
28
|
+
declare const INTERNAL_HTML_IMPORTED = "_internal_h_";
|
|
29
|
+
declare const INTERNAL_HTML_LOCAL = "INTERNAL_HTML";
|
|
30
|
+
declare const INTERNAL_STYLES_IMPORTED = "_internal_s_";
|
|
31
|
+
declare const INTERNAL_STYLES_LOCAL = "INTERNAL_STYLES";
|
|
32
|
+
declare const INTERNAL_PATH = "@htmlplus/element";
|
|
26
33
|
declare const METHOD_RENDER = "render";
|
|
27
34
|
declare const STATIC_STYLE = "style";
|
|
28
35
|
declare const STATIC_TAG = "tag";
|
|
@@ -38,12 +45,5 @@ declare const TYPE_NUMBER: number;
|
|
|
38
45
|
declare const TYPE_OBJECT: number;
|
|
39
46
|
declare const TYPE_STRING: number;
|
|
40
47
|
declare const TYPE_UNDEFINED: number;
|
|
41
|
-
declare const UTILS_ATTRIBUTES_IMPORTED = "attributes";
|
|
42
|
-
declare const UTILS_ATTRIBUTES_LOCAL = "UTILS_ATTRIBUTES";
|
|
43
|
-
declare const UTILS_HTML_IMPORTED = "html";
|
|
44
|
-
declare const UTILS_HTML_LOCAL = "UTILS_HTML";
|
|
45
|
-
declare const UTILS_STYLES_IMPORTED = "styles";
|
|
46
|
-
declare const UTILS_STYLES_LOCAL = "UTILS_STYLES";
|
|
47
|
-
declare const UTILS_PATH = "@htmlplus/element/internal.js";
|
|
48
48
|
|
|
49
|
-
export { API_CONNECTED, API_DEFAULTS, API_HOST, API_RENDER_COMPLETED, API_REQUEST, API_STACKS, API_STYLE, COMMENT_AUTO_ADDED, DECORATOR_CSS_VARIABLE, DECORATOR_ELEMENT, DECORATOR_EVENT, DECORATOR_METHOD, DECORATOR_PROPERTY, DECORATOR_PROPERTY_TYPE, DECORATOR_STATE, ELEMENT_HOST_NAME, KEY, LIFECYCLE_ADOPTED, LIFECYCLE_CONNECTED, LIFECYCLE_CONSTRUCTED, LIFECYCLE_DISCONNECTED, LIFECYCLE_READY, LIFECYCLE_UPDATE, LIFECYCLE_UPDATED, METHOD_RENDER, PACKAGE_NAME, STATIC_STYLE, STATIC_TAG, STYLE_IMPORTED, TYPE_ARRAY, TYPE_BIGINT, TYPE_BOOLEAN, TYPE_DATE, TYPE_ENUM, TYPE_FUNCTION, TYPE_NULL, TYPE_NUMBER, TYPE_OBJECT, TYPE_STRING, TYPE_UNDEFINED
|
|
49
|
+
export { API_CONNECTED, API_DEFAULTS, API_HOST, API_RENDER_COMPLETED, API_REQUEST, API_STACKS, API_STYLE, COMMENT_AUTO_ADDED, DECORATOR_CSS_VARIABLE, DECORATOR_ELEMENT, DECORATOR_EVENT, DECORATOR_METHOD, DECORATOR_PROPERTY, DECORATOR_PROPERTY_TYPE, DECORATOR_STATE, ELEMENT_HOST_NAME, INTERNAL_ATTRIBUTES_IMPORTED, INTERNAL_ATTRIBUTES_LOCAL, INTERNAL_HTML_IMPORTED, INTERNAL_HTML_LOCAL, INTERNAL_PATH, INTERNAL_STYLES_IMPORTED, INTERNAL_STYLES_LOCAL, KEY, LIFECYCLE_ADOPTED, LIFECYCLE_CONNECTED, LIFECYCLE_CONSTRUCTED, LIFECYCLE_DISCONNECTED, LIFECYCLE_READY, LIFECYCLE_UPDATE, LIFECYCLE_UPDATED, METHOD_RENDER, PACKAGE_NAME, STATIC_STYLE, STATIC_TAG, STYLE_IMPORTED, TYPE_ARRAY, TYPE_BIGINT, TYPE_BOOLEAN, TYPE_DATE, TYPE_ENUM, TYPE_FUNCTION, TYPE_NULL, TYPE_NUMBER, TYPE_OBJECT, TYPE_STRING, TYPE_UNDEFINED };
|
package/dist/constants.js
CHANGED
|
@@ -29,6 +29,14 @@ const LIFECYCLE_DISCONNECTED = 'disconnectedCallback';
|
|
|
29
29
|
const LIFECYCLE_READY = 'readyCallback';
|
|
30
30
|
const LIFECYCLE_UPDATE = 'updateCallback';
|
|
31
31
|
const LIFECYCLE_UPDATED = 'updatedCallback';
|
|
32
|
+
// internal
|
|
33
|
+
const INTERNAL_ATTRIBUTES_IMPORTED = '_internal_a_';
|
|
34
|
+
const INTERNAL_ATTRIBUTES_LOCAL = 'INTERNAL_ATTRIBUTES';
|
|
35
|
+
const INTERNAL_HTML_IMPORTED = '_internal_h_';
|
|
36
|
+
const INTERNAL_HTML_LOCAL = 'INTERNAL_HTML';
|
|
37
|
+
const INTERNAL_STYLES_IMPORTED = '_internal_s_';
|
|
38
|
+
const INTERNAL_STYLES_LOCAL = 'INTERNAL_STYLES';
|
|
39
|
+
const INTERNAL_PATH = PACKAGE_NAME;
|
|
32
40
|
// methods
|
|
33
41
|
const METHOD_RENDER = 'render';
|
|
34
42
|
// statics
|
|
@@ -48,13 +56,5 @@ const TYPE_NUMBER = 2 ** 7;
|
|
|
48
56
|
const TYPE_OBJECT = 2 ** 8;
|
|
49
57
|
const TYPE_STRING = 2 ** 9;
|
|
50
58
|
const TYPE_UNDEFINED = 2 ** 10;
|
|
51
|
-
// utils
|
|
52
|
-
const UTILS_ATTRIBUTES_IMPORTED = 'attributes';
|
|
53
|
-
const UTILS_ATTRIBUTES_LOCAL = 'UTILS_ATTRIBUTES';
|
|
54
|
-
const UTILS_HTML_IMPORTED = 'html';
|
|
55
|
-
const UTILS_HTML_LOCAL = 'UTILS_HTML';
|
|
56
|
-
const UTILS_STYLES_IMPORTED = 'styles';
|
|
57
|
-
const UTILS_STYLES_LOCAL = 'UTILS_STYLES';
|
|
58
|
-
const UTILS_PATH = '@htmlplus/element/internal.js';
|
|
59
59
|
|
|
60
|
-
export { API_CONNECTED, API_DEFAULTS, API_HOST, API_RENDER_COMPLETED, API_REQUEST, API_STACKS, API_STYLE, COMMENT_AUTO_ADDED, DECORATOR_CSS_VARIABLE, DECORATOR_ELEMENT, DECORATOR_EVENT, DECORATOR_METHOD, DECORATOR_PROPERTY, DECORATOR_PROPERTY_TYPE, DECORATOR_STATE, ELEMENT_HOST_NAME, KEY, LIFECYCLE_ADOPTED, LIFECYCLE_CONNECTED, LIFECYCLE_CONSTRUCTED, LIFECYCLE_DISCONNECTED, LIFECYCLE_READY, LIFECYCLE_UPDATE, LIFECYCLE_UPDATED, METHOD_RENDER, PACKAGE_NAME, STATIC_STYLE, STATIC_TAG, STYLE_IMPORTED, TYPE_ARRAY, TYPE_BIGINT, TYPE_BOOLEAN, TYPE_DATE, TYPE_ENUM, TYPE_FUNCTION, TYPE_NULL, TYPE_NUMBER, TYPE_OBJECT, TYPE_STRING, TYPE_UNDEFINED
|
|
60
|
+
export { API_CONNECTED, API_DEFAULTS, API_HOST, API_RENDER_COMPLETED, API_REQUEST, API_STACKS, API_STYLE, COMMENT_AUTO_ADDED, DECORATOR_CSS_VARIABLE, DECORATOR_ELEMENT, DECORATOR_EVENT, DECORATOR_METHOD, DECORATOR_PROPERTY, DECORATOR_PROPERTY_TYPE, DECORATOR_STATE, ELEMENT_HOST_NAME, INTERNAL_ATTRIBUTES_IMPORTED, INTERNAL_ATTRIBUTES_LOCAL, INTERNAL_HTML_IMPORTED, INTERNAL_HTML_LOCAL, INTERNAL_PATH, INTERNAL_STYLES_IMPORTED, INTERNAL_STYLES_LOCAL, KEY, LIFECYCLE_ADOPTED, LIFECYCLE_CONNECTED, LIFECYCLE_CONSTRUCTED, LIFECYCLE_DISCONNECTED, LIFECYCLE_READY, LIFECYCLE_UPDATE, LIFECYCLE_UPDATED, METHOD_RENDER, PACKAGE_NAME, STATIC_STYLE, STATIC_TAG, STYLE_IMPORTED, TYPE_ARRAY, TYPE_BIGINT, TYPE_BOOLEAN, TYPE_DATE, TYPE_ENUM, TYPE_FUNCTION, TYPE_NULL, TYPE_NUMBER, TYPE_OBJECT, TYPE_STRING, TYPE_UNDEFINED };
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -1,193 +1,22 @@
|
|
|
1
|
-
import 'react';
|
|
1
|
+
import type { JSX as JSXReact } from '@types/react';
|
|
2
2
|
|
|
3
|
-
type WithPart<
|
|
3
|
+
type WithPart<T> = T & {
|
|
4
4
|
part?: string;
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
a: WithPart<'a'>;
|
|
12
|
-
abbr: WithPart<'abbr'>;
|
|
13
|
-
address: WithPart<'address'>;
|
|
14
|
-
area: WithPart<'area'>;
|
|
15
|
-
article: WithPart<'article'>;
|
|
16
|
-
aside: WithPart<'aside'>;
|
|
17
|
-
audio: WithPart<'audio'>;
|
|
18
|
-
b: WithPart<'b'>;
|
|
19
|
-
base: WithPart<'base'>;
|
|
20
|
-
bdi: WithPart<'bdi'>;
|
|
21
|
-
bdo: WithPart<'bdo'>;
|
|
22
|
-
big: WithPart<'big'>;
|
|
23
|
-
blockquote: WithPart<'blockquote'>;
|
|
24
|
-
body: WithPart<'body'>;
|
|
25
|
-
br: WithPart<'br'>;
|
|
26
|
-
button: WithPart<'button'>;
|
|
27
|
-
canvas: WithPart<'canvas'>;
|
|
28
|
-
caption: WithPart<'caption'>;
|
|
29
|
-
center: WithPart<'center'>;
|
|
30
|
-
cite: WithPart<'cite'>;
|
|
31
|
-
code: WithPart<'code'>;
|
|
32
|
-
col: WithPart<'col'>;
|
|
33
|
-
colgroup: WithPart<'colgroup'>;
|
|
34
|
-
data: WithPart<'data'>;
|
|
35
|
-
datalist: WithPart<'datalist'>;
|
|
36
|
-
dd: WithPart<'dd'>;
|
|
37
|
-
del: WithPart<'del'>;
|
|
38
|
-
details: WithPart<'details'>;
|
|
39
|
-
dfn: WithPart<'dfn'>;
|
|
40
|
-
dialog: WithPart<'dialog'>;
|
|
41
|
-
div: WithPart<'div'>;
|
|
42
|
-
dl: WithPart<'dl'>;
|
|
43
|
-
dt: WithPart<'dt'>;
|
|
44
|
-
em: WithPart<'em'>;
|
|
45
|
-
embed: WithPart<'embed'>;
|
|
46
|
-
fieldset: WithPart<'fieldset'>;
|
|
47
|
-
figcaption: WithPart<'figcaption'>;
|
|
48
|
-
figure: WithPart<'figure'>;
|
|
49
|
-
footer: WithPart<'footer'>;
|
|
50
|
-
form: WithPart<'form'>;
|
|
51
|
-
h1: WithPart<'h1'>;
|
|
52
|
-
h2: WithPart<'h2'>;
|
|
53
|
-
h3: WithPart<'h3'>;
|
|
54
|
-
h4: WithPart<'h4'>;
|
|
55
|
-
h5: WithPart<'h5'>;
|
|
56
|
-
h6: WithPart<'h6'>;
|
|
57
|
-
head: WithPart<'head'>;
|
|
58
|
-
header: WithPart<'header'>;
|
|
59
|
-
hgroup: WithPart<'hgroup'>;
|
|
60
|
-
hr: WithPart<'hr'>;
|
|
61
|
-
html: WithPart<'html'>;
|
|
62
|
-
i: WithPart<'i'>;
|
|
63
|
-
iframe: WithPart<'iframe'>;
|
|
64
|
-
img: WithPart<'img'>;
|
|
65
|
-
input: WithPart<'input'>;
|
|
66
|
-
ins: WithPart<'ins'>;
|
|
67
|
-
kbd: WithPart<'kbd'>;
|
|
68
|
-
keygen: WithPart<'keygen'>;
|
|
69
|
-
label: WithPart<'label'>;
|
|
70
|
-
legend: WithPart<'legend'>;
|
|
71
|
-
li: WithPart<'li'>;
|
|
72
|
-
link: WithPart<'link'>;
|
|
73
|
-
main: WithPart<'main'>;
|
|
74
|
-
map: WithPart<'map'>;
|
|
75
|
-
mark: WithPart<'mark'>;
|
|
76
|
-
menu: WithPart<'menu'>;
|
|
77
|
-
menuitem: WithPart<'menuitem'>;
|
|
78
|
-
meta: WithPart<'meta'>;
|
|
79
|
-
meter: WithPart<'meter'>;
|
|
80
|
-
nav: WithPart<'nav'>;
|
|
81
|
-
noindex: WithPart<'noindex'>;
|
|
82
|
-
noscript: WithPart<'noscript'>;
|
|
83
|
-
object: WithPart<'object'>;
|
|
84
|
-
ol: WithPart<'ol'>;
|
|
85
|
-
optgroup: WithPart<'optgroup'>;
|
|
86
|
-
option: WithPart<'option'>;
|
|
87
|
-
output: WithPart<'output'>;
|
|
88
|
-
p: WithPart<'p'>;
|
|
89
|
-
param: WithPart<'param'>;
|
|
90
|
-
picture: WithPart<'picture'>;
|
|
91
|
-
pre: WithPart<'pre'>;
|
|
92
|
-
progress: WithPart<'progress'>;
|
|
93
|
-
q: WithPart<'q'>;
|
|
94
|
-
rp: WithPart<'rp'>;
|
|
95
|
-
rt: WithPart<'rt'>;
|
|
96
|
-
ruby: WithPart<'ruby'>;
|
|
97
|
-
s: WithPart<'s'>;
|
|
98
|
-
samp: WithPart<'samp'>;
|
|
99
|
-
search: WithPart<'search'>;
|
|
100
|
-
slot: WithPart<'slot'> & { onSlotChange?: (event: Event) => void };
|
|
101
|
-
script: WithPart<'script'>;
|
|
102
|
-
section: WithPart<'section'>;
|
|
103
|
-
select: WithPart<'select'>;
|
|
104
|
-
small: WithPart<'small'>;
|
|
105
|
-
source: WithPart<'source'>;
|
|
106
|
-
span: WithPart<'span'>;
|
|
107
|
-
strong: WithPart<'strong'>;
|
|
108
|
-
style: WithPart<'style'>;
|
|
109
|
-
sub: WithPart<'sub'>;
|
|
110
|
-
summary: WithPart<'summary'>;
|
|
111
|
-
sup: WithPart<'sup'>;
|
|
112
|
-
table: WithPart<'table'>;
|
|
113
|
-
template: WithPart<'template'>;
|
|
114
|
-
tbody: WithPart<'tbody'>;
|
|
115
|
-
td: WithPart<'td'>;
|
|
116
|
-
textarea: WithPart<'textarea'>;
|
|
117
|
-
tfoot: WithPart<'tfoot'>;
|
|
118
|
-
th: WithPart<'th'>;
|
|
119
|
-
thead: WithPart<'thead'>;
|
|
120
|
-
time: WithPart<'time'>;
|
|
121
|
-
title: WithPart<'title'>;
|
|
122
|
-
tr: WithPart<'tr'>;
|
|
123
|
-
track: WithPart<'track'>;
|
|
124
|
-
u: WithPart<'u'>;
|
|
125
|
-
ul: WithPart<'ul'>;
|
|
126
|
-
var: WithPart<'var'>;
|
|
127
|
-
video: WithPart<'video'>;
|
|
128
|
-
wbr: WithPart<'wbr'>;
|
|
129
|
-
webview: WithPart<'webview'>;
|
|
130
|
-
|
|
131
|
-
// SVG
|
|
132
|
-
svg: WithPart<'svg'>;
|
|
7
|
+
type IntrinsicElementsWithPart = {
|
|
8
|
+
[K in keyof JSXReact.IntrinsicElements]: WithPart<Omit<JSXReact.IntrinsicElements[K], 'ref'>>;
|
|
9
|
+
};
|
|
133
10
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
feComponentTransfer: WithPart<'feComponentTransfer'>;
|
|
145
|
-
feComposite: WithPart<'feComposite'>;
|
|
146
|
-
feConvolveMatrix: WithPart<'feConvolveMatrix'>;
|
|
147
|
-
feDiffuseLighting: WithPart<'feDiffuseLighting'>;
|
|
148
|
-
feDisplacementMap: WithPart<'feDisplacementMap'>;
|
|
149
|
-
feDistantLight: WithPart<'feDistantLight'>;
|
|
150
|
-
feDropShadow: WithPart<'feDropShadow'>;
|
|
151
|
-
feFlood: WithPart<'feFlood'>;
|
|
152
|
-
feFuncA: WithPart<'feFuncA'>;
|
|
153
|
-
feFuncB: WithPart<'feFuncB'>;
|
|
154
|
-
feFuncG: WithPart<'feFuncG'>;
|
|
155
|
-
feFuncR: WithPart<'feFuncR'>;
|
|
156
|
-
feGaussianBlur: WithPart<'feGaussianBlur'>;
|
|
157
|
-
feImage: WithPart<'feImage'>;
|
|
158
|
-
feMerge: WithPart<'feMerge'>;
|
|
159
|
-
feMergeNode: WithPart<'feMergeNode'>;
|
|
160
|
-
feMorphology: WithPart<'feMorphology'>;
|
|
161
|
-
feOffset: WithPart<'feOffset'>;
|
|
162
|
-
fePointLight: WithPart<'fePointLight'>;
|
|
163
|
-
feSpecularLighting: WithPart<'feSpecularLighting'>;
|
|
164
|
-
feSpotLight: WithPart<'feSpotLight'>;
|
|
165
|
-
feTile: WithPart<'feTile'>;
|
|
166
|
-
feTurbulence: WithPart<'feTurbulence'>;
|
|
167
|
-
filter: WithPart<'filter'>;
|
|
168
|
-
foreignObject: WithPart<'foreignObject'>;
|
|
169
|
-
g: WithPart<'g'>;
|
|
170
|
-
image: WithPart<'image'>;
|
|
171
|
-
line: WithPart<'line'>;
|
|
172
|
-
linearGradient: WithPart<'linearGradient'>;
|
|
173
|
-
marker: WithPart<'marker'>;
|
|
174
|
-
mask: WithPart<'mask'>;
|
|
175
|
-
metadata: WithPart<'metadata'>;
|
|
176
|
-
mpath: WithPart<'mpath'>;
|
|
177
|
-
path: WithPart<'path'>;
|
|
178
|
-
pattern: WithPart<'pattern'>;
|
|
179
|
-
polygon: WithPart<'polygon'>;
|
|
180
|
-
polyline: WithPart<'polyline'>;
|
|
181
|
-
radialGradient: WithPart<'radialGradient'>;
|
|
182
|
-
rect: WithPart<'rect'>;
|
|
183
|
-
set: WithPart<'set'>;
|
|
184
|
-
stop: WithPart<'stop'>;
|
|
185
|
-
switch: WithPart<'switch'>;
|
|
186
|
-
symbol: WithPart<'symbol'>;
|
|
187
|
-
text: WithPart<'text'>;
|
|
188
|
-
textPath: WithPart<'textPath'>;
|
|
189
|
-
tspan: WithPart<'tspan'>;
|
|
190
|
-
use: WithPart<'use'>;
|
|
191
|
-
view: WithPart<'view'>;
|
|
11
|
+
declare global {
|
|
12
|
+
namespace JSX {
|
|
13
|
+
interface IntrinsicElements extends IntrinsicElementsWithPart {
|
|
14
|
+
host: WithPart<JSXReact.IntrinsicElements['div']> & {
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
slot: WithPart<JSXReact.IntrinsicElements['slot']> & {
|
|
18
|
+
onSlotChange?: (event: Event) => void;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
192
21
|
}
|
|
193
22
|
}
|
package/dist/transformer.js
CHANGED
|
@@ -5,7 +5,7 @@ import { glob } from 'glob';
|
|
|
5
5
|
import template from '@babel/template';
|
|
6
6
|
import { pascalCase, kebabCase, camelCase, capitalCase } from 'change-case';
|
|
7
7
|
import path, { join, resolve, dirname } from 'node:path';
|
|
8
|
-
import { COMMENT_AUTO_ADDED, DECORATOR_PROPERTY, STATIC_TAG, DECORATOR_PROPERTY_TYPE,
|
|
8
|
+
import { COMMENT_AUTO_ADDED, DECORATOR_PROPERTY, STATIC_TAG, DECORATOR_PROPERTY_TYPE, INTERNAL_STYLES_IMPORTED, INTERNAL_STYLES_LOCAL, INTERNAL_PATH, INTERNAL_HTML_IMPORTED, INTERNAL_HTML_LOCAL, ELEMENT_HOST_NAME, TYPE_OBJECT, TYPE_NULL, TYPE_ARRAY, TYPE_STRING, TYPE_ENUM, TYPE_NUMBER, TYPE_DATE, TYPE_BOOLEAN, INTERNAL_ATTRIBUTES_IMPORTED, INTERNAL_ATTRIBUTES_LOCAL, DECORATOR_CSS_VARIABLE, DECORATOR_EVENT, DECORATOR_METHOD, DECORATOR_STATE, STATIC_STYLE, STYLE_IMPORTED, PACKAGE_NAME, DECORATOR_ELEMENT, KEY } from './constants.js';
|
|
9
9
|
import core from '@babel/traverse';
|
|
10
10
|
import core$1 from '@babel/generator';
|
|
11
11
|
import ora from 'ora';
|
|
@@ -385,7 +385,7 @@ const customElement = (userOptions) => {
|
|
|
385
385
|
return;
|
|
386
386
|
if (value.expression.type === 'JSXEmptyExpression')
|
|
387
387
|
return;
|
|
388
|
-
const { local } = addDependency(path,
|
|
388
|
+
const { local } = addDependency(path, INTERNAL_PATH, INTERNAL_STYLES_LOCAL, INTERNAL_STYLES_IMPORTED);
|
|
389
389
|
path.replaceWith(t.jsxAttribute(t.jsxIdentifier('style'), t.jsxExpressionContainer(t.callExpression(t.identifier(local || ''), [value.expression]))));
|
|
390
390
|
path.skip();
|
|
391
391
|
}
|
|
@@ -436,7 +436,7 @@ const customElement = (userOptions) => {
|
|
|
436
436
|
if (!['JSXElement', 'JSXFragment'].includes(type))
|
|
437
437
|
return;
|
|
438
438
|
const TODO = (node, attributes) => {
|
|
439
|
-
const { local } = addDependency(path,
|
|
439
|
+
const { local } = addDependency(path, INTERNAL_PATH, INTERNAL_ATTRIBUTES_LOCAL, INTERNAL_ATTRIBUTES_IMPORTED);
|
|
440
440
|
return t.callExpression(t.identifier(local || ''), [
|
|
441
441
|
node,
|
|
442
442
|
t.arrayExpression(attributes.map((attribute) => {
|
|
@@ -542,7 +542,7 @@ const customElement = (userOptions) => {
|
|
|
542
542
|
const templateLiteral = t.templateLiteral(quasis, expressions);
|
|
543
543
|
// TODO
|
|
544
544
|
// if (!expressions.length) return template;
|
|
545
|
-
const { local } = addDependency(path,
|
|
545
|
+
const { local } = addDependency(path, INTERNAL_PATH, INTERNAL_HTML_LOCAL, INTERNAL_HTML_IMPORTED, true);
|
|
546
546
|
return t.taggedTemplateExpression(t.identifier(local || ''), templateLiteral);
|
|
547
547
|
};
|
|
548
548
|
path.replaceWith(transform(render(path.node)));
|
|
@@ -703,22 +703,48 @@ const customElement = (userOptions) => {
|
|
|
703
703
|
const ast = template.default.ast(`
|
|
704
704
|
// THE FOLLOWING TYPES HAVE BEEN ADDED AUTOMATICALLY
|
|
705
705
|
|
|
706
|
-
|
|
706
|
+
type Filter<Base, Overrides> = {
|
|
707
|
+
[K in keyof Base as K extends keyof Overrides
|
|
708
|
+
? Overrides[K] extends never
|
|
709
|
+
? never
|
|
710
|
+
: K
|
|
711
|
+
: K]: Base[K];
|
|
712
|
+
};
|
|
713
|
+
|
|
714
|
+
export interface ${context.className}AttributesBase {
|
|
707
715
|
${attributes.map(print).join('')}
|
|
708
716
|
}
|
|
709
717
|
|
|
710
|
-
|
|
718
|
+
export interface ${context.className}AttributesDisables { }
|
|
719
|
+
|
|
720
|
+
export type ${context.className}Attributes = Filter<${context.className}AttributesBase, ${context.className}AttributesDisables>;
|
|
721
|
+
|
|
722
|
+
export interface ${context.className}EventsBase {
|
|
711
723
|
${events.map(print).join('')}
|
|
712
724
|
}
|
|
713
725
|
|
|
714
|
-
|
|
726
|
+
export interface ${context.className}EventsDisables { }
|
|
727
|
+
|
|
728
|
+
export type ${context.className}Events = Filter<${context.className}EventsBase, ${context.className}EventsDisables>;
|
|
729
|
+
|
|
730
|
+
export interface ${context.className}MethodsBase {
|
|
715
731
|
${methods.map(print).join('')}
|
|
716
732
|
}
|
|
717
733
|
|
|
718
|
-
|
|
734
|
+
export interface ${context.className}MethodsDisables { }
|
|
735
|
+
|
|
736
|
+
export type ${context.className}Methods = Filter<${context.className}MethodsBase, ${context.className}MethodsDisables>;
|
|
737
|
+
|
|
738
|
+
export interface ${context.className}PropertiesBase {
|
|
719
739
|
${properties.map(print).join('')}
|
|
720
740
|
}
|
|
721
741
|
|
|
742
|
+
export interface ${context.className}PropertiesDisables { }
|
|
743
|
+
|
|
744
|
+
export type ${context.className}Properties = Filter<${context.className}PropertiesBase, ${context.className}PropertiesDisables>;
|
|
745
|
+
|
|
746
|
+
export type ${context.className}AttributesAndEvents = ${context.className}Attributes & ${context.className}Events;
|
|
747
|
+
|
|
722
748
|
export interface ${context.className}JSX extends ${context.className}Events, ${context.className}Properties { }
|
|
723
749
|
|
|
724
750
|
declare global {
|
|
@@ -732,21 +758,25 @@ const customElement = (userOptions) => {
|
|
|
732
758
|
interface HTMLElementTagNameMap {
|
|
733
759
|
"${context.elementTagName}": ${context.elementInterfaceName};
|
|
734
760
|
}
|
|
735
|
-
|
|
736
|
-
namespace JSX {
|
|
737
|
-
interface IntrinsicElements {
|
|
738
|
-
"${context.elementTagName}": ${context.className}Events & ${context.className}Attributes & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
761
|
}
|
|
762
|
+
|
|
763
|
+
export namespace JSX {
|
|
764
|
+
interface IntrinsicElements {
|
|
765
|
+
"${context.elementTagName}": ${context.className}Attributes & ${context.className}Events;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
742
768
|
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
769
|
+
${['@builder.io/qwik', 'inferno', 'preact', 'react', 'solid-js']
|
|
770
|
+
.map((key) => `
|
|
771
|
+
declare module "${key}" {
|
|
772
|
+
namespace JSX {
|
|
773
|
+
interface IntrinsicElements {
|
|
774
|
+
"${context.elementTagName}": ${context.className}AttributesAndEvents & Omit<HTMLAttributes<${context.elementInterfaceName}>, keyof ${context.className}AttributesAndEvents>;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
`)
|
|
779
|
+
.join('\n')}
|
|
750
780
|
|
|
751
781
|
export type ${context.className}Element = globalThis.${context.elementInterfaceName}
|
|
752
782
|
`, {
|
package/package.json
CHANGED
|
@@ -1,63 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@htmlplus/element",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.3",
|
|
4
|
+
"description": "A powerful library for building scalable, reusable, fast, tastable and lightweight design system for any web technologies. Powered by Web Component.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"components",
|
|
7
|
+
"custom elements",
|
|
8
|
+
"design systems",
|
|
9
|
+
"web components"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/htmlplus/element#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/htmlplus/element/issues"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/htmlplus/element.git"
|
|
18
|
+
},
|
|
19
|
+
"funding": [],
|
|
4
20
|
"license": "MIT",
|
|
5
|
-
"sideEffects": false,
|
|
6
21
|
"author": "Masood Abdolian <m.abdolian@gmail.com>",
|
|
7
|
-
"
|
|
22
|
+
"sideEffects": false,
|
|
8
23
|
"type": "module",
|
|
9
|
-
"main": "./dist/client.js",
|
|
10
|
-
"types": "./dist/client.d.ts",
|
|
11
|
-
"scripts": {
|
|
12
|
-
"build": "npm run clean && rollup -c",
|
|
13
|
-
"clean": "rimraf dist",
|
|
14
|
-
"development:start": "vite --config development/vite.config.js",
|
|
15
|
-
"lint": "biome check --write",
|
|
16
|
-
"prepare": "husky",
|
|
17
|
-
"type-check": "tsc --noEmit"
|
|
18
|
-
},
|
|
19
|
-
"files": [
|
|
20
|
-
"./dist/*",
|
|
21
|
-
"./package.json",
|
|
22
|
-
"./README.md"
|
|
23
|
-
],
|
|
24
24
|
"exports": {
|
|
25
25
|
".": {
|
|
26
|
-
"
|
|
27
|
-
"
|
|
26
|
+
"types": "./dist/client.d.ts",
|
|
27
|
+
"import": "./dist/client.js"
|
|
28
28
|
},
|
|
29
29
|
"./bundlers.js": {
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
},
|
|
33
|
-
"./internal.js": {
|
|
34
|
-
"import": "./dist/internal.js",
|
|
35
|
-
"types": "./dist/internal.d.ts"
|
|
30
|
+
"types": "./dist/bundlers.d.ts",
|
|
31
|
+
"import": "./dist/bundlers.js"
|
|
36
32
|
},
|
|
37
33
|
"./transformer.js": {
|
|
38
|
-
"
|
|
39
|
-
"
|
|
34
|
+
"types": "./dist/transformer.d.ts",
|
|
35
|
+
"import": "./dist/transformer.js"
|
|
40
36
|
},
|
|
41
37
|
"./jsx-runtime": "./dist/jsx-runtime.d.ts"
|
|
42
38
|
},
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
"custom elements",
|
|
50
|
-
"design systems",
|
|
51
|
-
"web components"
|
|
39
|
+
"main": "./dist/client.js",
|
|
40
|
+
"types": "./dist/client.d.ts",
|
|
41
|
+
"files": [
|
|
42
|
+
"./dist/*",
|
|
43
|
+
"./package.json",
|
|
44
|
+
"./README.md"
|
|
52
45
|
],
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "npm run clean && rollup -c",
|
|
48
|
+
"build:watch": "npm run clean && rollup -c -w",
|
|
49
|
+
"clean": "rimraf dist",
|
|
50
|
+
"dev": "vite --force development",
|
|
51
|
+
"lint": "biome check --write",
|
|
52
|
+
"prepare": "husky",
|
|
53
|
+
"test": "vitest --config tests/vitest.config.ts",
|
|
54
|
+
"type-check": "tsc --noEmit"
|
|
59
55
|
},
|
|
60
|
-
"homepage": "https://github.com/htmlplus/element#readme",
|
|
61
56
|
"dependencies": {
|
|
62
57
|
"@babel/generator": "^7.28.3",
|
|
63
58
|
"@babel/parser": "^7.28.3",
|
|
@@ -80,19 +75,27 @@
|
|
|
80
75
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
81
76
|
"@semantic-release/git": "^10.0.1",
|
|
82
77
|
"@semantic-release/github": "^11.0.4",
|
|
83
|
-
"@semantic-release/npm": "^
|
|
78
|
+
"@semantic-release/npm": "^13.1.3",
|
|
84
79
|
"@semantic-release/release-notes-generator": "^14.0.3",
|
|
80
|
+
"@testing-library/dom": "^10.4.1",
|
|
81
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
82
|
+
"@vitest/browser-playwright": "^4.0.16",
|
|
85
83
|
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
86
84
|
"cpy": "^12.0.1",
|
|
87
85
|
"husky": "^9.1.7",
|
|
88
86
|
"lint-staged": "^16.1.5",
|
|
87
|
+
"playwright": "^1.57.0",
|
|
89
88
|
"rimraf": "^6.0.1",
|
|
90
89
|
"rollup": "^4.48.1",
|
|
91
90
|
"rollup-plugin-copy": "^3.5.0",
|
|
92
91
|
"rollup-plugin-dts": "^6.2.3",
|
|
93
92
|
"rollup-plugin-node-externals": "^8.1.0",
|
|
94
|
-
"semantic-release": "^
|
|
93
|
+
"semantic-release": "^25.0.2",
|
|
95
94
|
"tslib": "^2.8.1",
|
|
96
|
-
"vite": "^7.1.3"
|
|
95
|
+
"vite": "^7.1.3",
|
|
96
|
+
"vitest": "^4.0.16"
|
|
97
|
+
},
|
|
98
|
+
"engines": {
|
|
99
|
+
"node": ">= 20.10.0"
|
|
97
100
|
}
|
|
98
101
|
}
|
package/dist/internal.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { a as attributes, h as html, s as styles } from './client.js';
|
package/dist/internal.js
DELETED