@furystack/shades 11.1.0 → 12.0.1
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/CHANGELOG.md +312 -0
- package/README.md +13 -13
- package/esm/component-factory.spec.js +13 -5
- package/esm/component-factory.spec.js.map +1 -1
- package/esm/components/index.d.ts +4 -1
- package/esm/components/index.d.ts.map +1 -1
- package/esm/components/index.js +4 -1
- package/esm/components/index.js.map +1 -1
- package/esm/components/lazy-load.d.ts +2 -4
- package/esm/components/lazy-load.d.ts.map +1 -1
- package/esm/components/lazy-load.js +40 -24
- package/esm/components/lazy-load.js.map +1 -1
- package/esm/components/lazy-load.spec.js +57 -50
- package/esm/components/lazy-load.spec.js.map +1 -1
- package/esm/components/link-to-route.d.ts +2 -0
- package/esm/components/link-to-route.d.ts.map +1 -1
- package/esm/components/link-to-route.js +3 -2
- package/esm/components/link-to-route.js.map +1 -1
- package/esm/components/link-to-route.spec.js +13 -9
- package/esm/components/link-to-route.spec.js.map +1 -1
- package/esm/components/nested-route-link.d.ts +62 -0
- package/esm/components/nested-route-link.d.ts.map +1 -0
- package/esm/components/nested-route-link.js +66 -0
- package/esm/components/nested-route-link.js.map +1 -0
- package/esm/components/nested-route-link.spec.d.ts +2 -0
- package/esm/components/nested-route-link.spec.d.ts.map +1 -0
- package/esm/components/nested-route-link.spec.js +179 -0
- package/esm/components/nested-route-link.spec.js.map +1 -0
- package/esm/components/nested-route-types.d.ts +37 -0
- package/esm/components/nested-route-types.d.ts.map +1 -0
- package/esm/components/nested-route-types.js +2 -0
- package/esm/components/nested-route-types.js.map +1 -0
- package/esm/components/nested-router.d.ts +103 -0
- package/esm/components/nested-router.d.ts.map +1 -0
- package/esm/components/nested-router.js +183 -0
- package/esm/components/nested-router.js.map +1 -0
- package/esm/components/nested-router.spec.d.ts +2 -0
- package/esm/components/nested-router.spec.d.ts.map +1 -0
- package/esm/components/nested-router.spec.js +737 -0
- package/esm/components/nested-router.spec.js.map +1 -0
- package/esm/components/route-link.d.ts +4 -0
- package/esm/components/route-link.d.ts.map +1 -1
- package/esm/components/route-link.js +5 -5
- package/esm/components/route-link.js.map +1 -1
- package/esm/components/route-link.spec.js +16 -12
- package/esm/components/route-link.spec.js.map +1 -1
- package/esm/components/router.d.ts +20 -2
- package/esm/components/router.d.ts.map +1 -1
- package/esm/components/router.js +12 -7
- package/esm/components/router.js.map +1 -1
- package/esm/components/router.spec.js +141 -74
- package/esm/components/router.spec.js.map +1 -1
- package/esm/initialize.d.ts +11 -0
- package/esm/initialize.d.ts.map +1 -1
- package/esm/initialize.js +5 -0
- package/esm/initialize.js.map +1 -1
- package/esm/jsx.d.ts +83 -2
- package/esm/jsx.d.ts.map +1 -1
- package/esm/models/children-list.d.ts +5 -1
- package/esm/models/children-list.d.ts.map +1 -1
- package/esm/models/partial-element.d.ts +12 -2
- package/esm/models/partial-element.d.ts.map +1 -1
- package/esm/models/render-options.d.ts +89 -3
- package/esm/models/render-options.d.ts.map +1 -1
- package/esm/models/selection-state.d.ts +4 -0
- package/esm/models/selection-state.d.ts.map +1 -1
- package/esm/services/location-service.d.ts +11 -0
- package/esm/services/location-service.d.ts.map +1 -1
- package/esm/services/location-service.js +11 -0
- package/esm/services/location-service.js.map +1 -1
- package/esm/services/resource-manager.d.ts +24 -0
- package/esm/services/resource-manager.d.ts.map +1 -1
- package/esm/services/resource-manager.js +36 -1
- package/esm/services/resource-manager.js.map +1 -1
- package/esm/services/resource-manager.spec.js +102 -0
- package/esm/services/resource-manager.spec.js.map +1 -1
- package/esm/services/screen-service.d.ts +81 -4
- package/esm/services/screen-service.d.ts.map +1 -1
- package/esm/services/screen-service.js +75 -4
- package/esm/services/screen-service.js.map +1 -1
- package/esm/services/screen-service.spec.js +91 -7
- package/esm/services/screen-service.spec.js.map +1 -1
- package/esm/shade-component.d.ts +17 -4
- package/esm/shade-component.d.ts.map +1 -1
- package/esm/shade-component.js +67 -5
- package/esm/shade-component.js.map +1 -1
- package/esm/shade-host-props-ref.integration.spec.d.ts +2 -0
- package/esm/shade-host-props-ref.integration.spec.d.ts.map +1 -0
- package/esm/shade-host-props-ref.integration.spec.js +381 -0
- package/esm/shade-host-props-ref.integration.spec.js.map +1 -0
- package/esm/shade-resources.integration.spec.js +208 -39
- package/esm/shade-resources.integration.spec.js.map +1 -1
- package/esm/shade.d.ts +20 -17
- package/esm/shade.d.ts.map +1 -1
- package/esm/shade.js +172 -33
- package/esm/shade.js.map +1 -1
- package/esm/shade.spec.js +31 -30
- package/esm/shade.spec.js.map +1 -1
- package/esm/shades.integration.spec.js +135 -72
- package/esm/shades.integration.spec.js.map +1 -1
- package/esm/style-manager.d.ts +2 -2
- package/esm/style-manager.js +2 -2
- package/esm/svg-types.d.ts +389 -0
- package/esm/svg-types.d.ts.map +1 -0
- package/esm/svg-types.js +9 -0
- package/esm/svg-types.js.map +1 -0
- package/esm/svg.d.ts +15 -0
- package/esm/svg.d.ts.map +1 -0
- package/esm/svg.js +76 -0
- package/esm/svg.js.map +1 -0
- package/esm/svg.spec.d.ts +2 -0
- package/esm/svg.spec.d.ts.map +1 -0
- package/esm/svg.spec.js +80 -0
- package/esm/svg.spec.js.map +1 -0
- package/esm/vnode.d.ts +103 -0
- package/esm/vnode.d.ts.map +1 -0
- package/esm/vnode.integration.spec.d.ts +2 -0
- package/esm/vnode.integration.spec.d.ts.map +1 -0
- package/esm/vnode.integration.spec.js +494 -0
- package/esm/vnode.integration.spec.js.map +1 -0
- package/esm/vnode.js +453 -0
- package/esm/vnode.js.map +1 -0
- package/esm/vnode.spec.d.ts +2 -0
- package/esm/vnode.spec.d.ts.map +1 -0
- package/esm/vnode.spec.js +473 -0
- package/esm/vnode.spec.js.map +1 -0
- package/package.json +8 -9
- package/src/component-factory.spec.tsx +18 -5
- package/src/components/index.ts +4 -1
- package/src/components/lazy-load.spec.tsx +82 -75
- package/src/components/lazy-load.tsx +49 -27
- package/src/components/link-to-route.spec.tsx +25 -21
- package/src/components/link-to-route.tsx +4 -2
- package/src/components/nested-route-link.spec.tsx +303 -0
- package/src/components/nested-route-link.tsx +100 -0
- package/src/components/nested-route-types.ts +42 -0
- package/src/components/nested-router.spec.tsx +918 -0
- package/src/components/nested-router.tsx +260 -0
- package/src/components/route-link.spec.tsx +22 -18
- package/src/components/route-link.tsx +6 -5
- package/src/components/router.spec.tsx +196 -108
- package/src/components/router.tsx +21 -8
- package/src/initialize.ts +12 -0
- package/src/jsx.ts +129 -2
- package/src/models/children-list.ts +7 -1
- package/src/models/partial-element.ts +13 -2
- package/src/models/render-options.ts +90 -3
- package/src/models/selection-state.ts +4 -0
- package/src/services/location-service.tsx +11 -0
- package/src/services/resource-manager.spec.ts +128 -0
- package/src/services/resource-manager.ts +36 -1
- package/src/services/screen-service.spec.ts +109 -7
- package/src/services/screen-service.ts +81 -4
- package/src/shade-component.ts +72 -6
- package/src/shade-host-props-ref.integration.spec.tsx +460 -0
- package/src/shade-resources.integration.spec.tsx +276 -52
- package/src/shade.spec.tsx +40 -39
- package/src/shade.ts +186 -58
- package/src/shades.integration.spec.tsx +154 -80
- package/src/style-manager.ts +2 -2
- package/src/svg-types.ts +437 -0
- package/src/svg.spec.ts +89 -0
- package/src/svg.ts +78 -0
- package/src/vnode.integration.spec.tsx +657 -0
- package/src/vnode.spec.ts +579 -0
- package/src/vnode.ts +508 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG element attribute types for JSX support.
|
|
3
|
+
*
|
|
4
|
+
* Unlike HTML elements where JSX props map to DOM properties, SVG elements
|
|
5
|
+
* use XML attributes set via `setAttribute`. These types describe the
|
|
6
|
+
* attribute-based API rather than the DOM property interfaces.
|
|
7
|
+
*/
|
|
8
|
+
import type { RefObject } from './models/render-options.js';
|
|
9
|
+
/**
|
|
10
|
+
* Common event handlers available on SVG elements.
|
|
11
|
+
*/
|
|
12
|
+
export type SvgEventHandlers = {
|
|
13
|
+
onclick?: (ev: MouseEvent) => void;
|
|
14
|
+
ondblclick?: (ev: MouseEvent) => void;
|
|
15
|
+
onmousedown?: (ev: MouseEvent) => void;
|
|
16
|
+
onmouseup?: (ev: MouseEvent) => void;
|
|
17
|
+
onmousemove?: (ev: MouseEvent) => void;
|
|
18
|
+
onmouseenter?: (ev: MouseEvent) => void;
|
|
19
|
+
onmouseleave?: (ev: MouseEvent) => void;
|
|
20
|
+
onmouseover?: (ev: MouseEvent) => void;
|
|
21
|
+
onmouseout?: (ev: MouseEvent) => void;
|
|
22
|
+
onfocus?: (ev: FocusEvent) => void;
|
|
23
|
+
onblur?: (ev: FocusEvent) => void;
|
|
24
|
+
onkeydown?: (ev: KeyboardEvent) => void;
|
|
25
|
+
onkeyup?: (ev: KeyboardEvent) => void;
|
|
26
|
+
ontouchstart?: (ev: TouchEvent) => void;
|
|
27
|
+
ontouchmove?: (ev: TouchEvent) => void;
|
|
28
|
+
ontouchend?: (ev: TouchEvent) => void;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* SVG presentation attributes shared by most SVG elements.
|
|
32
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Presentation
|
|
33
|
+
*/
|
|
34
|
+
export type SvgPresentationAttributes = {
|
|
35
|
+
'clip-path'?: string;
|
|
36
|
+
'clip-rule'?: 'nonzero' | 'evenodd';
|
|
37
|
+
color?: string;
|
|
38
|
+
cursor?: string;
|
|
39
|
+
display?: string;
|
|
40
|
+
fill?: string;
|
|
41
|
+
'fill-opacity'?: string | number;
|
|
42
|
+
'fill-rule'?: 'nonzero' | 'evenodd';
|
|
43
|
+
filter?: string;
|
|
44
|
+
'flood-color'?: string;
|
|
45
|
+
'flood-opacity'?: string | number;
|
|
46
|
+
'font-family'?: string;
|
|
47
|
+
'font-size'?: string | number;
|
|
48
|
+
'font-style'?: 'normal' | 'italic' | 'oblique';
|
|
49
|
+
'font-weight'?: string | number;
|
|
50
|
+
'letter-spacing'?: string | number;
|
|
51
|
+
'lighting-color'?: string;
|
|
52
|
+
marker?: string;
|
|
53
|
+
'marker-end'?: string;
|
|
54
|
+
'marker-mid'?: string;
|
|
55
|
+
'marker-start'?: string;
|
|
56
|
+
mask?: string;
|
|
57
|
+
opacity?: string | number;
|
|
58
|
+
overflow?: string;
|
|
59
|
+
'pointer-events'?: string;
|
|
60
|
+
'shape-rendering'?: 'auto' | 'optimizeSpeed' | 'crispEdges' | 'geometricPrecision';
|
|
61
|
+
'stop-color'?: string;
|
|
62
|
+
'stop-opacity'?: string | number;
|
|
63
|
+
stroke?: string;
|
|
64
|
+
'stroke-dasharray'?: string;
|
|
65
|
+
'stroke-dashoffset'?: string | number;
|
|
66
|
+
'stroke-linecap'?: 'butt' | 'round' | 'square';
|
|
67
|
+
'stroke-linejoin'?: 'arcs' | 'bevel' | 'miter' | 'miter-clip' | 'round';
|
|
68
|
+
'stroke-miterlimit'?: string | number;
|
|
69
|
+
'stroke-opacity'?: string | number;
|
|
70
|
+
'stroke-width'?: string | number;
|
|
71
|
+
'text-anchor'?: 'start' | 'middle' | 'end';
|
|
72
|
+
'text-decoration'?: string;
|
|
73
|
+
'dominant-baseline'?: string;
|
|
74
|
+
'alignment-baseline'?: string;
|
|
75
|
+
transform?: string;
|
|
76
|
+
'transform-origin'?: string;
|
|
77
|
+
visibility?: 'visible' | 'hidden' | 'collapse';
|
|
78
|
+
'word-spacing'?: string | number;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Core attributes available on all SVG elements.
|
|
82
|
+
*/
|
|
83
|
+
export type SvgCoreAttributes = {
|
|
84
|
+
id?: string;
|
|
85
|
+
className?: string;
|
|
86
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
87
|
+
tabIndex?: number;
|
|
88
|
+
ref?: RefObject<Element>;
|
|
89
|
+
} & SvgPresentationAttributes & SvgEventHandlers;
|
|
90
|
+
/** Attributes for the `<svg>` element. */
|
|
91
|
+
export type SvgSvgAttributes = SvgCoreAttributes & {
|
|
92
|
+
viewBox?: string;
|
|
93
|
+
width?: string | number;
|
|
94
|
+
height?: string | number;
|
|
95
|
+
xmlns?: string;
|
|
96
|
+
preserveAspectRatio?: string;
|
|
97
|
+
x?: string | number;
|
|
98
|
+
y?: string | number;
|
|
99
|
+
};
|
|
100
|
+
/** Attributes for the `<g>` element. */
|
|
101
|
+
export type SvgGAttributes = SvgCoreAttributes;
|
|
102
|
+
/** Attributes for the `<defs>` element. */
|
|
103
|
+
export type SvgDefsAttributes = SvgCoreAttributes;
|
|
104
|
+
/** Attributes for the `<symbol>` element. */
|
|
105
|
+
export type SvgSymbolAttributes = SvgCoreAttributes & {
|
|
106
|
+
viewBox?: string;
|
|
107
|
+
preserveAspectRatio?: string;
|
|
108
|
+
x?: string | number;
|
|
109
|
+
y?: string | number;
|
|
110
|
+
width?: string | number;
|
|
111
|
+
height?: string | number;
|
|
112
|
+
refX?: string | number;
|
|
113
|
+
refY?: string | number;
|
|
114
|
+
};
|
|
115
|
+
/** Attributes for the `<use>` element. */
|
|
116
|
+
export type SvgUseAttributes = SvgCoreAttributes & {
|
|
117
|
+
href?: string;
|
|
118
|
+
x?: string | number;
|
|
119
|
+
y?: string | number;
|
|
120
|
+
width?: string | number;
|
|
121
|
+
height?: string | number;
|
|
122
|
+
};
|
|
123
|
+
/** Attributes for the `<path>` element. */
|
|
124
|
+
export type SvgPathAttributes = SvgCoreAttributes & {
|
|
125
|
+
d: string;
|
|
126
|
+
pathLength?: number;
|
|
127
|
+
};
|
|
128
|
+
/** Attributes for the `<rect>` element. */
|
|
129
|
+
export type SvgRectAttributes = SvgCoreAttributes & {
|
|
130
|
+
x?: string | number;
|
|
131
|
+
y?: string | number;
|
|
132
|
+
width?: string | number;
|
|
133
|
+
height?: string | number;
|
|
134
|
+
rx?: string | number;
|
|
135
|
+
ry?: string | number;
|
|
136
|
+
pathLength?: number;
|
|
137
|
+
};
|
|
138
|
+
/** Attributes for the `<circle>` element. */
|
|
139
|
+
export type SvgCircleAttributes = SvgCoreAttributes & {
|
|
140
|
+
cx?: string | number;
|
|
141
|
+
cy?: string | number;
|
|
142
|
+
r?: string | number;
|
|
143
|
+
pathLength?: number;
|
|
144
|
+
};
|
|
145
|
+
/** Attributes for the `<ellipse>` element. */
|
|
146
|
+
export type SvgEllipseAttributes = SvgCoreAttributes & {
|
|
147
|
+
cx?: string | number;
|
|
148
|
+
cy?: string | number;
|
|
149
|
+
rx?: string | number;
|
|
150
|
+
ry?: string | number;
|
|
151
|
+
pathLength?: number;
|
|
152
|
+
};
|
|
153
|
+
/** Attributes for the `<line>` element. */
|
|
154
|
+
export type SvgLineAttributes = SvgCoreAttributes & {
|
|
155
|
+
x1?: string | number;
|
|
156
|
+
y1?: string | number;
|
|
157
|
+
x2?: string | number;
|
|
158
|
+
y2?: string | number;
|
|
159
|
+
pathLength?: number;
|
|
160
|
+
};
|
|
161
|
+
/** Attributes for the `<polyline>` element. */
|
|
162
|
+
export type SvgPolylineAttributes = SvgCoreAttributes & {
|
|
163
|
+
points?: string;
|
|
164
|
+
pathLength?: number;
|
|
165
|
+
};
|
|
166
|
+
/** Attributes for the `<polygon>` element. */
|
|
167
|
+
export type SvgPolygonAttributes = SvgCoreAttributes & {
|
|
168
|
+
points?: string;
|
|
169
|
+
pathLength?: number;
|
|
170
|
+
};
|
|
171
|
+
/** Attributes for the `<text>` element. */
|
|
172
|
+
export type SvgTextAttributes = SvgCoreAttributes & {
|
|
173
|
+
x?: string | number;
|
|
174
|
+
y?: string | number;
|
|
175
|
+
dx?: string | number;
|
|
176
|
+
dy?: string | number;
|
|
177
|
+
rotate?: string;
|
|
178
|
+
textLength?: string | number;
|
|
179
|
+
lengthAdjust?: 'spacing' | 'spacingAndGlyphs';
|
|
180
|
+
};
|
|
181
|
+
/** Attributes for the `<tspan>` element. */
|
|
182
|
+
export type SvgTspanAttributes = SvgCoreAttributes & {
|
|
183
|
+
x?: string | number;
|
|
184
|
+
y?: string | number;
|
|
185
|
+
dx?: string | number;
|
|
186
|
+
dy?: string | number;
|
|
187
|
+
rotate?: string;
|
|
188
|
+
textLength?: string | number;
|
|
189
|
+
lengthAdjust?: 'spacing' | 'spacingAndGlyphs';
|
|
190
|
+
};
|
|
191
|
+
/** Attributes for the `<textPath>` element. */
|
|
192
|
+
export type SvgTextPathAttributes = SvgCoreAttributes & {
|
|
193
|
+
href?: string;
|
|
194
|
+
method?: 'align' | 'stretch';
|
|
195
|
+
spacing?: 'auto' | 'exact';
|
|
196
|
+
startOffset?: string | number;
|
|
197
|
+
textLength?: string | number;
|
|
198
|
+
lengthAdjust?: 'spacing' | 'spacingAndGlyphs';
|
|
199
|
+
};
|
|
200
|
+
/** Attributes for the `<clipPath>` element. */
|
|
201
|
+
export type SvgClipPathAttributes = SvgCoreAttributes & {
|
|
202
|
+
clipPathUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
|
203
|
+
};
|
|
204
|
+
/** Attributes for the `<mask>` element. */
|
|
205
|
+
export type SvgMaskAttributes = SvgCoreAttributes & {
|
|
206
|
+
maskUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
|
207
|
+
maskContentUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
|
208
|
+
x?: string | number;
|
|
209
|
+
y?: string | number;
|
|
210
|
+
width?: string | number;
|
|
211
|
+
height?: string | number;
|
|
212
|
+
};
|
|
213
|
+
/** Attributes for the `<linearGradient>` element. */
|
|
214
|
+
export type SvgLinearGradientAttributes = SvgCoreAttributes & {
|
|
215
|
+
x1?: string | number;
|
|
216
|
+
y1?: string | number;
|
|
217
|
+
x2?: string | number;
|
|
218
|
+
y2?: string | number;
|
|
219
|
+
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
|
220
|
+
gradientTransform?: string;
|
|
221
|
+
spreadMethod?: 'pad' | 'reflect' | 'repeat';
|
|
222
|
+
href?: string;
|
|
223
|
+
};
|
|
224
|
+
/** Attributes for the `<radialGradient>` element. */
|
|
225
|
+
export type SvgRadialGradientAttributes = SvgCoreAttributes & {
|
|
226
|
+
cx?: string | number;
|
|
227
|
+
cy?: string | number;
|
|
228
|
+
r?: string | number;
|
|
229
|
+
fx?: string | number;
|
|
230
|
+
fy?: string | number;
|
|
231
|
+
fr?: string | number;
|
|
232
|
+
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
|
233
|
+
gradientTransform?: string;
|
|
234
|
+
spreadMethod?: 'pad' | 'reflect' | 'repeat';
|
|
235
|
+
href?: string;
|
|
236
|
+
};
|
|
237
|
+
/** Attributes for the `<stop>` element. */
|
|
238
|
+
export type SvgStopAttributes = SvgCoreAttributes & {
|
|
239
|
+
offset?: string | number;
|
|
240
|
+
'stop-color'?: string;
|
|
241
|
+
'stop-opacity'?: string | number;
|
|
242
|
+
};
|
|
243
|
+
/** Attributes for the `<pattern>` element. */
|
|
244
|
+
export type SvgPatternAttributes = SvgCoreAttributes & {
|
|
245
|
+
x?: string | number;
|
|
246
|
+
y?: string | number;
|
|
247
|
+
width?: string | number;
|
|
248
|
+
height?: string | number;
|
|
249
|
+
patternUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
|
250
|
+
patternContentUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
|
251
|
+
patternTransform?: string;
|
|
252
|
+
viewBox?: string;
|
|
253
|
+
preserveAspectRatio?: string;
|
|
254
|
+
href?: string;
|
|
255
|
+
};
|
|
256
|
+
/** Attributes for the `<marker>` element. */
|
|
257
|
+
export type SvgMarkerAttributes = SvgCoreAttributes & {
|
|
258
|
+
viewBox?: string;
|
|
259
|
+
preserveAspectRatio?: string;
|
|
260
|
+
refX?: string | number;
|
|
261
|
+
refY?: string | number;
|
|
262
|
+
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
|
|
263
|
+
markerWidth?: string | number;
|
|
264
|
+
markerHeight?: string | number;
|
|
265
|
+
orient?: string;
|
|
266
|
+
};
|
|
267
|
+
/** Attributes for the `<filter>` element. */
|
|
268
|
+
export type SvgFilterAttributes = SvgCoreAttributes & {
|
|
269
|
+
x?: string | number;
|
|
270
|
+
y?: string | number;
|
|
271
|
+
width?: string | number;
|
|
272
|
+
height?: string | number;
|
|
273
|
+
filterUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
|
274
|
+
primitiveUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
|
275
|
+
};
|
|
276
|
+
/** Common attributes for SVG filter primitive elements. */
|
|
277
|
+
type SvgFilterPrimitiveAttributes = SvgCoreAttributes & {
|
|
278
|
+
x?: string | number;
|
|
279
|
+
y?: string | number;
|
|
280
|
+
width?: string | number;
|
|
281
|
+
height?: string | number;
|
|
282
|
+
result?: string;
|
|
283
|
+
};
|
|
284
|
+
/** Attributes for the `<feGaussianBlur>` element. */
|
|
285
|
+
export type SvgFeGaussianBlurAttributes = SvgFilterPrimitiveAttributes & {
|
|
286
|
+
in?: string;
|
|
287
|
+
stdDeviation?: string | number;
|
|
288
|
+
edgeMode?: 'duplicate' | 'wrap' | 'none';
|
|
289
|
+
};
|
|
290
|
+
/** Attributes for the `<feBlend>` element. */
|
|
291
|
+
export type SvgFeBlendAttributes = SvgFilterPrimitiveAttributes & {
|
|
292
|
+
in?: string;
|
|
293
|
+
in2?: string;
|
|
294
|
+
mode?: 'normal' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten';
|
|
295
|
+
};
|
|
296
|
+
/** Attributes for the `<feColorMatrix>` element. */
|
|
297
|
+
export type SvgFeColorMatrixAttributes = SvgFilterPrimitiveAttributes & {
|
|
298
|
+
in?: string;
|
|
299
|
+
type?: 'matrix' | 'saturate' | 'hueRotate' | 'luminanceToAlpha';
|
|
300
|
+
values?: string;
|
|
301
|
+
};
|
|
302
|
+
/** Attributes for the `<feOffset>` element. */
|
|
303
|
+
export type SvgFeOffsetAttributes = SvgFilterPrimitiveAttributes & {
|
|
304
|
+
in?: string;
|
|
305
|
+
dx?: string | number;
|
|
306
|
+
dy?: string | number;
|
|
307
|
+
};
|
|
308
|
+
/** Attributes for the `<feFlood>` element. */
|
|
309
|
+
export type SvgFeFloodAttributes = SvgFilterPrimitiveAttributes & {
|
|
310
|
+
'flood-color'?: string;
|
|
311
|
+
'flood-opacity'?: string | number;
|
|
312
|
+
};
|
|
313
|
+
/** Attributes for the `<feMerge>` element. */
|
|
314
|
+
export type SvgFeMergeAttributes = SvgFilterPrimitiveAttributes;
|
|
315
|
+
/** Attributes for the `<feMergeNode>` element. */
|
|
316
|
+
export type SvgFeMergeNodeAttributes = SvgCoreAttributes & {
|
|
317
|
+
in?: string;
|
|
318
|
+
};
|
|
319
|
+
/** Attributes for the `<feComposite>` element. */
|
|
320
|
+
export type SvgFeCompositeAttributes = SvgFilterPrimitiveAttributes & {
|
|
321
|
+
in?: string;
|
|
322
|
+
in2?: string;
|
|
323
|
+
operator?: 'over' | 'in' | 'out' | 'atop' | 'xor' | 'lighter' | 'arithmetic';
|
|
324
|
+
k1?: number;
|
|
325
|
+
k2?: number;
|
|
326
|
+
k3?: number;
|
|
327
|
+
k4?: number;
|
|
328
|
+
};
|
|
329
|
+
/** Attributes for the `<image>` element (SVG). */
|
|
330
|
+
export type SvgImageAttributes = SvgCoreAttributes & {
|
|
331
|
+
href?: string;
|
|
332
|
+
x?: string | number;
|
|
333
|
+
y?: string | number;
|
|
334
|
+
width?: string | number;
|
|
335
|
+
height?: string | number;
|
|
336
|
+
preserveAspectRatio?: string;
|
|
337
|
+
crossorigin?: 'anonymous' | 'use-credentials';
|
|
338
|
+
};
|
|
339
|
+
/** Attributes for the `<foreignObject>` element. */
|
|
340
|
+
export type SvgForeignObjectAttributes = SvgCoreAttributes & {
|
|
341
|
+
x?: string | number;
|
|
342
|
+
y?: string | number;
|
|
343
|
+
width?: string | number;
|
|
344
|
+
height?: string | number;
|
|
345
|
+
};
|
|
346
|
+
/** Common attributes for SVG animation elements. */
|
|
347
|
+
type SvgAnimationAttributes = SvgCoreAttributes & {
|
|
348
|
+
attributeName?: string;
|
|
349
|
+
begin?: string;
|
|
350
|
+
dur?: string;
|
|
351
|
+
end?: string;
|
|
352
|
+
repeatCount?: string | number;
|
|
353
|
+
repeatDur?: string;
|
|
354
|
+
fill?: 'freeze' | 'remove';
|
|
355
|
+
from?: string;
|
|
356
|
+
to?: string;
|
|
357
|
+
by?: string;
|
|
358
|
+
values?: string;
|
|
359
|
+
keyTimes?: string;
|
|
360
|
+
keySplines?: string;
|
|
361
|
+
calcMode?: 'discrete' | 'linear' | 'paced' | 'spline';
|
|
362
|
+
};
|
|
363
|
+
/** Attributes for the `<animate>` element. */
|
|
364
|
+
export type SvgAnimateAttributes = SvgAnimationAttributes;
|
|
365
|
+
/** Attributes for the `<animateMotion>` element. */
|
|
366
|
+
export type SvgAnimateMotionAttributes = SvgAnimationAttributes & {
|
|
367
|
+
path?: string;
|
|
368
|
+
rotate?: string;
|
|
369
|
+
};
|
|
370
|
+
/** Attributes for the `<animateTransform>` element. */
|
|
371
|
+
export type SvgAnimateTransformAttributes = SvgAnimationAttributes & {
|
|
372
|
+
type?: 'translate' | 'scale' | 'rotate' | 'skewX' | 'skewY';
|
|
373
|
+
};
|
|
374
|
+
/** Attributes for the `<set>` element. */
|
|
375
|
+
export type SvgSetAttributes = SvgCoreAttributes & {
|
|
376
|
+
attributeName?: string;
|
|
377
|
+
to?: string;
|
|
378
|
+
begin?: string;
|
|
379
|
+
dur?: string;
|
|
380
|
+
end?: string;
|
|
381
|
+
repeatCount?: string | number;
|
|
382
|
+
fill?: 'freeze' | 'remove';
|
|
383
|
+
};
|
|
384
|
+
/** Attributes for the `<title>` element (SVG). */
|
|
385
|
+
export type SvgTitleAttributes = SvgCoreAttributes;
|
|
386
|
+
/** Attributes for the `<desc>` element. */
|
|
387
|
+
export type SvgDescAttributes = SvgCoreAttributes;
|
|
388
|
+
export {};
|
|
389
|
+
//# sourceMappingURL=svg-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg-types.d.ts","sourceRoot":"","sources":["../src/svg-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAA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like HTML elements where JSX props map to DOM properties, SVG elements
|
|
5
|
+
* use XML attributes set via `setAttribute`. These types describe the
|
|
6
|
+
* attribute-based API rather than the DOM property interfaces.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=svg-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg-types.js","sourceRoot":"","sources":["../src/svg-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
package/esm/svg.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG namespace and tag detection helpers.
|
|
3
|
+
*/
|
|
4
|
+
export declare const SVG_NS = "http://www.w3.org/2000/svg";
|
|
5
|
+
/**
|
|
6
|
+
* Set of known SVG element tag names.
|
|
7
|
+
* Used to determine whether to create elements with `createElementNS`
|
|
8
|
+
* and to apply attributes via `setAttribute` instead of property assignment.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SVG_TAGS: ReadonlySet<string>;
|
|
11
|
+
/**
|
|
12
|
+
* Returns true if the given tag name is a known SVG element.
|
|
13
|
+
*/
|
|
14
|
+
export declare const isSvgTag: (tag: string) => boolean;
|
|
15
|
+
//# sourceMappingURL=svg.d.ts.map
|
package/esm/svg.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../src/svg.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,MAAM,+BAA+B,CAAA;AAElD;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,MAAM,CA6DvC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,KAAG,OAA4B,CAAA"}
|
package/esm/svg.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG namespace and tag detection helpers.
|
|
3
|
+
*/
|
|
4
|
+
export const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
5
|
+
/**
|
|
6
|
+
* Set of known SVG element tag names.
|
|
7
|
+
* Used to determine whether to create elements with `createElementNS`
|
|
8
|
+
* and to apply attributes via `setAttribute` instead of property assignment.
|
|
9
|
+
*/
|
|
10
|
+
export const SVG_TAGS = new Set([
|
|
11
|
+
// Root
|
|
12
|
+
'svg',
|
|
13
|
+
// Container / structural
|
|
14
|
+
'g',
|
|
15
|
+
'defs',
|
|
16
|
+
'symbol',
|
|
17
|
+
'use',
|
|
18
|
+
'foreignObject',
|
|
19
|
+
// Shape elements
|
|
20
|
+
'path',
|
|
21
|
+
'rect',
|
|
22
|
+
'circle',
|
|
23
|
+
'ellipse',
|
|
24
|
+
'line',
|
|
25
|
+
'polyline',
|
|
26
|
+
'polygon',
|
|
27
|
+
// Text
|
|
28
|
+
'text',
|
|
29
|
+
'tspan',
|
|
30
|
+
'textPath',
|
|
31
|
+
// Gradient / pattern
|
|
32
|
+
'linearGradient',
|
|
33
|
+
'radialGradient',
|
|
34
|
+
'stop',
|
|
35
|
+
'pattern',
|
|
36
|
+
// Clipping / masking
|
|
37
|
+
'clipPath',
|
|
38
|
+
'mask',
|
|
39
|
+
// Marker
|
|
40
|
+
'marker',
|
|
41
|
+
// Filter
|
|
42
|
+
'filter',
|
|
43
|
+
'feBlend',
|
|
44
|
+
'feColorMatrix',
|
|
45
|
+
'feComponentTransfer',
|
|
46
|
+
'feComposite',
|
|
47
|
+
'feConvolveMatrix',
|
|
48
|
+
'feDiffuseLighting',
|
|
49
|
+
'feDisplacementMap',
|
|
50
|
+
'feFlood',
|
|
51
|
+
'feGaussianBlur',
|
|
52
|
+
'feImage',
|
|
53
|
+
'feMerge',
|
|
54
|
+
'feMergeNode',
|
|
55
|
+
'feMorphology',
|
|
56
|
+
'feOffset',
|
|
57
|
+
'feSpecularLighting',
|
|
58
|
+
'feTile',
|
|
59
|
+
'feTurbulence',
|
|
60
|
+
// Animation
|
|
61
|
+
'animate',
|
|
62
|
+
'animateMotion',
|
|
63
|
+
'animateTransform',
|
|
64
|
+
'set',
|
|
65
|
+
// Descriptive
|
|
66
|
+
'title',
|
|
67
|
+
'desc',
|
|
68
|
+
'metadata',
|
|
69
|
+
// Other
|
|
70
|
+
'image',
|
|
71
|
+
]);
|
|
72
|
+
/**
|
|
73
|
+
* Returns true if the given tag name is a known SVG element.
|
|
74
|
+
*/
|
|
75
|
+
export const isSvgTag = (tag) => SVG_TAGS.has(tag);
|
|
76
|
+
//# sourceMappingURL=svg.js.map
|
package/esm/svg.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.js","sourceRoot":"","sources":["../src/svg.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,4BAA4B,CAAA;AAElD;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAwB,IAAI,GAAG,CAAC;IACnD,OAAO;IACP,KAAK;IACL,yBAAyB;IACzB,GAAG;IACH,MAAM;IACN,QAAQ;IACR,KAAK;IACL,eAAe;IACf,iBAAiB;IACjB,MAAM;IACN,MAAM;IACN,QAAQ;IACR,SAAS;IACT,MAAM;IACN,UAAU;IACV,SAAS;IACT,OAAO;IACP,MAAM;IACN,OAAO;IACP,UAAU;IACV,qBAAqB;IACrB,gBAAgB;IAChB,gBAAgB;IAChB,MAAM;IACN,SAAS;IACT,qBAAqB;IACrB,UAAU;IACV,MAAM;IACN,SAAS;IACT,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,SAAS;IACT,eAAe;IACf,qBAAqB;IACrB,aAAa;IACb,kBAAkB;IAClB,mBAAmB;IACnB,mBAAmB;IACnB,SAAS;IACT,gBAAgB;IAChB,SAAS;IACT,SAAS;IACT,aAAa;IACb,cAAc;IACd,UAAU;IACV,oBAAoB;IACpB,QAAQ;IACR,cAAc;IACd,YAAY;IACZ,SAAS;IACT,eAAe;IACf,kBAAkB;IAClB,KAAK;IACL,cAAc;IACd,OAAO;IACP,MAAM;IACN,UAAU;IACV,QAAQ;IACR,OAAO;CACR,CAAC,CAAA;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.spec.d.ts","sourceRoot":"","sources":["../src/svg.spec.ts"],"names":[],"mappings":""}
|
package/esm/svg.spec.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { isSvgTag, SVG_NS, SVG_TAGS } from './svg.js';
|
|
3
|
+
describe('svg', () => {
|
|
4
|
+
describe('SVG_NS', () => {
|
|
5
|
+
it('should be the standard SVG namespace URI', () => {
|
|
6
|
+
expect(SVG_NS).toBe('http://www.w3.org/2000/svg');
|
|
7
|
+
});
|
|
8
|
+
});
|
|
9
|
+
describe('SVG_TAGS', () => {
|
|
10
|
+
it('should contain core SVG element tags', () => {
|
|
11
|
+
const coreTags = ['svg', 'g', 'path', 'rect', 'circle', 'ellipse', 'line', 'polyline', 'polygon'];
|
|
12
|
+
for (const tag of coreTags) {
|
|
13
|
+
expect(SVG_TAGS.has(tag)).toBe(true);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
it('should contain text-related SVG tags', () => {
|
|
17
|
+
expect(SVG_TAGS.has('text')).toBe(true);
|
|
18
|
+
expect(SVG_TAGS.has('tspan')).toBe(true);
|
|
19
|
+
expect(SVG_TAGS.has('textPath')).toBe(true);
|
|
20
|
+
});
|
|
21
|
+
it('should contain gradient and pattern tags', () => {
|
|
22
|
+
expect(SVG_TAGS.has('linearGradient')).toBe(true);
|
|
23
|
+
expect(SVG_TAGS.has('radialGradient')).toBe(true);
|
|
24
|
+
expect(SVG_TAGS.has('stop')).toBe(true);
|
|
25
|
+
expect(SVG_TAGS.has('pattern')).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
it('should contain filter primitive tags', () => {
|
|
28
|
+
const filterTags = [
|
|
29
|
+
'filter',
|
|
30
|
+
'feBlend',
|
|
31
|
+
'feColorMatrix',
|
|
32
|
+
'feGaussianBlur',
|
|
33
|
+
'feOffset',
|
|
34
|
+
'feFlood',
|
|
35
|
+
'feMerge',
|
|
36
|
+
'feMergeNode',
|
|
37
|
+
'feComposite',
|
|
38
|
+
];
|
|
39
|
+
for (const tag of filterTags) {
|
|
40
|
+
expect(SVG_TAGS.has(tag)).toBe(true);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
it('should contain animation tags', () => {
|
|
44
|
+
expect(SVG_TAGS.has('animate')).toBe(true);
|
|
45
|
+
expect(SVG_TAGS.has('animateMotion')).toBe(true);
|
|
46
|
+
expect(SVG_TAGS.has('animateTransform')).toBe(true);
|
|
47
|
+
expect(SVG_TAGS.has('set')).toBe(true);
|
|
48
|
+
});
|
|
49
|
+
it('should not contain HTML element tags', () => {
|
|
50
|
+
const htmlTags = ['div', 'span', 'p', 'button', 'input', 'form', 'table', 'a', 'img'];
|
|
51
|
+
for (const tag of htmlTags) {
|
|
52
|
+
expect(SVG_TAGS.has(tag)).toBe(false);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
describe('isSvgTag', () => {
|
|
57
|
+
it('should return true for known SVG tags', () => {
|
|
58
|
+
expect(isSvgTag('svg')).toBe(true);
|
|
59
|
+
expect(isSvgTag('path')).toBe(true);
|
|
60
|
+
expect(isSvgTag('circle')).toBe(true);
|
|
61
|
+
expect(isSvgTag('g')).toBe(true);
|
|
62
|
+
expect(isSvgTag('feGaussianBlur')).toBe(true);
|
|
63
|
+
expect(isSvgTag('linearGradient')).toBe(true);
|
|
64
|
+
expect(isSvgTag('clipPath')).toBe(true);
|
|
65
|
+
expect(isSvgTag('foreignObject')).toBe(true);
|
|
66
|
+
});
|
|
67
|
+
it('should return false for HTML tags', () => {
|
|
68
|
+
expect(isSvgTag('div')).toBe(false);
|
|
69
|
+
expect(isSvgTag('span')).toBe(false);
|
|
70
|
+
expect(isSvgTag('button')).toBe(false);
|
|
71
|
+
expect(isSvgTag('input')).toBe(false);
|
|
72
|
+
});
|
|
73
|
+
it('should return false for unknown tags', () => {
|
|
74
|
+
expect(isSvgTag('my-component')).toBe(false);
|
|
75
|
+
expect(isSvgTag('')).toBe(false);
|
|
76
|
+
expect(isSvgTag('SVG')).toBe(false);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=svg.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.spec.js","sourceRoot":"","sources":["../src/svg.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAErD,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;IACnB,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;QACtB,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;YAClD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAA;QACnD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;QACxB,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;YAC9C,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,CAAA;YACjG,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;gBAC3B,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC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