@furystack/shades 11.0.35 → 12.0.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/CHANGELOG.md +337 -0
- package/README.md +99 -13
- package/esm/compile-route.spec.d.ts +2 -0
- package/esm/compile-route.spec.d.ts.map +1 -0
- package/esm/compile-route.spec.js +34 -0
- package/esm/compile-route.spec.js.map +1 -0
- 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 +178 -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 +659 -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 +9 -10
- 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 +3 -0
- package/esm/components/router.js.map +1 -1
- package/esm/components/router.spec.js +75 -74
- package/esm/components/router.spec.js.map +1 -1
- package/esm/css-generator.d.ts +50 -0
- package/esm/css-generator.d.ts.map +1 -0
- package/esm/css-generator.js +107 -0
- package/esm/css-generator.js.map +1 -0
- package/esm/css-generator.spec.d.ts +2 -0
- package/esm/css-generator.spec.d.ts.map +1 -0
- package/esm/css-generator.spec.js +162 -0
- package/esm/css-generator.spec.js.map +1 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -0
- package/esm/index.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/css-object.d.ts +33 -0
- package/esm/models/css-object.d.ts.map +1 -0
- package/esm/models/css-object.js +2 -0
- package/esm/models/css-object.js.map +1 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +1 -0
- package/esm/models/index.js.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 +30 -0
- package/esm/services/resource-manager.js.map +1 -1
- package/esm/services/resource-manager.spec.js +93 -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 +34 -15
- package/esm/shade.d.ts.map +1 -1
- package/esm/shade.js +180 -33
- package/esm/shade.js.map +1 -1
- package/esm/shade.spec.d.ts +2 -0
- package/esm/shade.spec.d.ts.map +1 -0
- package/esm/shade.spec.js +198 -0
- package/esm/shade.spec.js.map +1 -0
- package/esm/shades.integration.spec.js +135 -72
- package/esm/shades.integration.spec.js.map +1 -1
- package/esm/style-manager.d.ts +65 -0
- package/esm/style-manager.d.ts.map +1 -0
- package/esm/style-manager.js +95 -0
- package/esm/style-manager.js.map +1 -0
- package/esm/style-manager.spec.d.ts +2 -0
- package/esm/style-manager.spec.d.ts.map +1 -0
- package/esm/style-manager.spec.js +179 -0
- package/esm/style-manager.spec.js.map +1 -0
- package/esm/styled-element.spec.d.ts +2 -0
- package/esm/styled-element.spec.d.ts.map +1 -0
- package/esm/styled-element.spec.js +86 -0
- package/esm/styled-element.spec.js.map +1 -0
- package/esm/styled-shade.spec.d.ts +2 -0
- package/esm/styled-shade.spec.d.ts.map +1 -0
- package/esm/styled-shade.spec.js +66 -0
- package/esm/styled-shade.spec.js.map +1 -0
- 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 +3 -3
- package/src/compile-route.spec.ts +39 -0
- 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 +817 -0
- package/src/components/nested-router.tsx +256 -0
- package/src/components/route-link.spec.tsx +22 -18
- package/src/components/route-link.tsx +10 -10
- package/src/components/router.spec.tsx +109 -108
- package/src/components/router.tsx +15 -2
- package/src/css-generator.spec.ts +183 -0
- package/src/css-generator.ts +117 -0
- package/src/index.ts +2 -0
- package/src/initialize.ts +12 -0
- package/src/jsx.ts +129 -2
- package/src/models/children-list.ts +7 -1
- package/src/models/css-object.ts +34 -0
- package/src/models/index.ts +1 -0
- 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 +116 -0
- package/src/services/resource-manager.ts +30 -0
- 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 +239 -0
- package/src/shade.ts +211 -56
- package/src/shades.integration.spec.tsx +154 -80
- package/src/style-manager.spec.ts +229 -0
- package/src/style-manager.ts +104 -0
- package/src/styled-element.spec.tsx +117 -0
- package/src/styled-shade.spec.ts +86 -0
- 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,162 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { camelToKebab, generateCSS, generateCSSRule, isSelectorKey, propertiesToCSSString } from './css-generator.js';
|
|
3
|
+
describe('css-generator', () => {
|
|
4
|
+
describe('camelToKebab', () => {
|
|
5
|
+
it('should convert camelCase to kebab-case', () => {
|
|
6
|
+
expect(camelToKebab('backgroundColor')).toBe('background-color');
|
|
7
|
+
expect(camelToKebab('fontSize')).toBe('font-size');
|
|
8
|
+
expect(camelToKebab('borderTopLeftRadius')).toBe('border-top-left-radius');
|
|
9
|
+
});
|
|
10
|
+
it('should handle single word properties', () => {
|
|
11
|
+
expect(camelToKebab('color')).toBe('color');
|
|
12
|
+
expect(camelToKebab('margin')).toBe('margin');
|
|
13
|
+
});
|
|
14
|
+
it('should handle empty string', () => {
|
|
15
|
+
expect(camelToKebab('')).toBe('');
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
describe('isSelectorKey', () => {
|
|
19
|
+
it('should return true for selector keys starting with &', () => {
|
|
20
|
+
expect(isSelectorKey('&:hover')).toBe(true);
|
|
21
|
+
expect(isSelectorKey('&:active')).toBe(true);
|
|
22
|
+
expect(isSelectorKey('& .className')).toBe(true);
|
|
23
|
+
expect(isSelectorKey('& > div')).toBe(true);
|
|
24
|
+
});
|
|
25
|
+
it('should return false for regular CSS property keys', () => {
|
|
26
|
+
expect(isSelectorKey('color')).toBe(false);
|
|
27
|
+
expect(isSelectorKey('backgroundColor')).toBe(false);
|
|
28
|
+
expect(isSelectorKey('fontSize')).toBe(false);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
describe('propertiesToCSSString', () => {
|
|
32
|
+
it('should convert CSS properties object to CSS string', () => {
|
|
33
|
+
const result = propertiesToCSSString({
|
|
34
|
+
color: 'red',
|
|
35
|
+
backgroundColor: 'blue',
|
|
36
|
+
});
|
|
37
|
+
expect(result).toBe('color: red; background-color: blue');
|
|
38
|
+
});
|
|
39
|
+
it('should skip undefined and null values', () => {
|
|
40
|
+
const result = propertiesToCSSString({
|
|
41
|
+
color: 'red',
|
|
42
|
+
backgroundColor: undefined,
|
|
43
|
+
});
|
|
44
|
+
expect(result).toBe('color: red');
|
|
45
|
+
});
|
|
46
|
+
it('should skip empty string values', () => {
|
|
47
|
+
const result = propertiesToCSSString({
|
|
48
|
+
color: 'red',
|
|
49
|
+
backgroundColor: '',
|
|
50
|
+
});
|
|
51
|
+
expect(result).toBe('color: red');
|
|
52
|
+
});
|
|
53
|
+
it('should return empty string for empty object', () => {
|
|
54
|
+
const result = propertiesToCSSString({});
|
|
55
|
+
expect(result).toBe('');
|
|
56
|
+
});
|
|
57
|
+
it('should ignore selector keys', () => {
|
|
58
|
+
// Type assertion needed to test mixed object with selectors
|
|
59
|
+
const mixedObject = {
|
|
60
|
+
color: 'red',
|
|
61
|
+
'&:hover': { color: 'blue' },
|
|
62
|
+
};
|
|
63
|
+
const result = propertiesToCSSString(mixedObject);
|
|
64
|
+
expect(result).toBe('color: red');
|
|
65
|
+
});
|
|
66
|
+
it('should filter out non-string values', () => {
|
|
67
|
+
// Type assertion to test edge case with non-string values
|
|
68
|
+
const mixedObject = {
|
|
69
|
+
color: 'red',
|
|
70
|
+
opacity: 0.5, // number - should be filtered
|
|
71
|
+
display: 'flex',
|
|
72
|
+
hidden: true, // boolean - should be filtered
|
|
73
|
+
};
|
|
74
|
+
const result = propertiesToCSSString(mixedObject);
|
|
75
|
+
expect(result).toBe('color: red; display: flex');
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
describe('generateCSSRule', () => {
|
|
79
|
+
it('should generate a complete CSS rule', () => {
|
|
80
|
+
const result = generateCSSRule('my-component', {
|
|
81
|
+
color: 'red',
|
|
82
|
+
padding: '10px',
|
|
83
|
+
});
|
|
84
|
+
expect(result).toBe('my-component { color: red; padding: 10px; }');
|
|
85
|
+
});
|
|
86
|
+
it('should return empty string for empty properties', () => {
|
|
87
|
+
const result = generateCSSRule('my-component', {});
|
|
88
|
+
expect(result).toBe('');
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
describe('generateCSS', () => {
|
|
92
|
+
it('should generate CSS for base properties only', () => {
|
|
93
|
+
const result = generateCSS('my-component', {
|
|
94
|
+
color: 'red',
|
|
95
|
+
padding: '10px',
|
|
96
|
+
});
|
|
97
|
+
expect(result).toBe('my-component { color: red; padding: 10px; }');
|
|
98
|
+
});
|
|
99
|
+
it('should generate CSS with pseudo-selectors', () => {
|
|
100
|
+
const result = generateCSS('my-component', {
|
|
101
|
+
color: 'red',
|
|
102
|
+
'&:hover': { color: 'blue' },
|
|
103
|
+
});
|
|
104
|
+
expect(result).toContain('my-component { color: red; }');
|
|
105
|
+
expect(result).toContain('my-component:hover { color: blue; }');
|
|
106
|
+
});
|
|
107
|
+
it('should generate CSS with nested class selectors', () => {
|
|
108
|
+
const result = generateCSS('my-component', {
|
|
109
|
+
padding: '10px',
|
|
110
|
+
'& .inner': { fontWeight: 'bold' },
|
|
111
|
+
});
|
|
112
|
+
expect(result).toContain('my-component { padding: 10px; }');
|
|
113
|
+
expect(result).toContain('my-component .inner { font-weight: bold; }');
|
|
114
|
+
});
|
|
115
|
+
it('should generate CSS with child selectors', () => {
|
|
116
|
+
const result = generateCSS('my-component', {
|
|
117
|
+
display: 'flex',
|
|
118
|
+
'& > div': { margin: '5px' },
|
|
119
|
+
});
|
|
120
|
+
expect(result).toContain('my-component { display: flex; }');
|
|
121
|
+
expect(result).toContain('my-component > div { margin: 5px; }');
|
|
122
|
+
});
|
|
123
|
+
it('should handle multiple pseudo-selectors', () => {
|
|
124
|
+
const result = generateCSS('my-button', {
|
|
125
|
+
backgroundColor: 'blue',
|
|
126
|
+
'&:hover': { backgroundColor: 'darkblue' },
|
|
127
|
+
'&:active': { backgroundColor: 'navy' },
|
|
128
|
+
'&:disabled': { opacity: '0.5' },
|
|
129
|
+
});
|
|
130
|
+
expect(result).toContain('my-button { background-color: blue; }');
|
|
131
|
+
expect(result).toContain('my-button:hover { background-color: darkblue; }');
|
|
132
|
+
expect(result).toContain('my-button:active { background-color: navy; }');
|
|
133
|
+
expect(result).toContain('my-button:disabled { opacity: 0.5; }');
|
|
134
|
+
});
|
|
135
|
+
it('should handle empty css object', () => {
|
|
136
|
+
const result = generateCSS('my-component', {});
|
|
137
|
+
expect(result).toBe('');
|
|
138
|
+
});
|
|
139
|
+
it('should handle css object with only selectors', () => {
|
|
140
|
+
const result = generateCSS('my-component', {
|
|
141
|
+
'&:hover': { color: 'blue' },
|
|
142
|
+
});
|
|
143
|
+
expect(result).toBe('my-component:hover { color: blue; }');
|
|
144
|
+
});
|
|
145
|
+
it('should skip selector keys with non-object values', () => {
|
|
146
|
+
// Type assertion to test edge case with invalid selector values
|
|
147
|
+
const cssObject = {
|
|
148
|
+
color: 'red',
|
|
149
|
+
'&:hover': 'invalid', // string instead of object - should be skipped
|
|
150
|
+
'&:active': null, // null - should be skipped
|
|
151
|
+
'&:focus': { backgroundColor: 'blue' }, // valid - should be included
|
|
152
|
+
};
|
|
153
|
+
const result = generateCSS('my-component', cssObject);
|
|
154
|
+
expect(result).toContain('my-component { color: red; }');
|
|
155
|
+
expect(result).toContain('my-component:focus { background-color: blue; }');
|
|
156
|
+
expect(result).not.toContain('invalid');
|
|
157
|
+
expect(result).not.toContain(':hover');
|
|
158
|
+
expect(result).not.toContain(':active');
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
//# sourceMappingURL=css-generator.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-generator.spec.js","sourceRoot":"","sources":["../src/css-generator.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAGrH,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;QAC5B,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;YAChD,MAAM,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;YAChE,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;YAClD,MAAM,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAA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AE,SAAyD,CAAC,CAAA;YACrG,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,8BAA8B,CAAC,CAAA;YACxD,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,gDAAgD,CAAC,CAAA;YAC1E,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;YACvC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;YACtC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;QACzC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/esm/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export * from './compile-route.js';
|
|
2
2
|
export * from './components/index.js';
|
|
3
|
+
export * from './css-generator.js';
|
|
3
4
|
export * from './initialize.js';
|
|
4
5
|
export * from './models/index.js';
|
|
5
6
|
export * from './services/index.js';
|
|
6
7
|
export * from './shade-component.js';
|
|
7
8
|
export * from './shade.js';
|
|
9
|
+
export * from './style-manager.js';
|
|
8
10
|
export * from './styled-element.js';
|
|
9
11
|
export * from './styled-shade.js';
|
|
10
12
|
import './jsx.js';
|
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA;AAC1B,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,OAAO,UAAU,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,OAAO,UAAU,CAAA"}
|
package/esm/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export * from './compile-route.js';
|
|
2
2
|
export * from './components/index.js';
|
|
3
|
+
export * from './css-generator.js';
|
|
3
4
|
export * from './initialize.js';
|
|
4
5
|
export * from './models/index.js';
|
|
5
6
|
export * from './services/index.js';
|
|
6
7
|
export * from './shade-component.js';
|
|
7
8
|
export * from './shade.js';
|
|
9
|
+
export * from './style-manager.js';
|
|
8
10
|
export * from './styled-element.js';
|
|
9
11
|
export * from './styled-shade.js';
|
|
10
12
|
import './jsx.js';
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA;AAC1B,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,OAAO,UAAU,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,OAAO,UAAU,CAAA"}
|
package/esm/initialize.d.ts
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import type { Injector } from '@furystack/inject';
|
|
2
|
+
/**
|
|
3
|
+
* Options for bootstrapping a Shades application.
|
|
4
|
+
*/
|
|
2
5
|
export interface InitializeOptions {
|
|
6
|
+
/** The DOM element that will host the application */
|
|
3
7
|
rootElement: HTMLElement;
|
|
8
|
+
/** The root JSX element to render */
|
|
4
9
|
jsxElement: JSX.Element;
|
|
10
|
+
/** The root injector instance for dependency injection */
|
|
5
11
|
injector: Injector;
|
|
6
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Bootstraps a Shades application by attaching the root JSX element to a DOM node
|
|
15
|
+
* and wiring up the dependency injection context.
|
|
16
|
+
* @param options The initialization options
|
|
17
|
+
*/
|
|
7
18
|
export declare const initializeShadeRoot: (options: InitializeOptions) => void;
|
|
8
19
|
//# sourceMappingURL=initialize.d.ts.map
|
package/esm/initialize.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../src/initialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEjD,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,WAAW,CAAA;IACxB,UAAU,EAAE,GAAG,CAAC,OAAO,CAAA;IACvB,QAAQ,EAAE,QAAQ,CAAA;CACnB;
|
|
1
|
+
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../src/initialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEjD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,qDAAqD;IACrD,WAAW,EAAE,WAAW,CAAA;IACxB,qCAAqC;IACrC,UAAU,EAAE,GAAG,CAAC,OAAO,CAAA;IACvB,0DAA0D;IAC1D,QAAQ,EAAE,QAAQ,CAAA;CACnB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,iBAAiB,SAG7D,CAAA"}
|
package/esm/initialize.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bootstraps a Shades application by attaching the root JSX element to a DOM node
|
|
3
|
+
* and wiring up the dependency injection context.
|
|
4
|
+
* @param options The initialization options
|
|
5
|
+
*/
|
|
1
6
|
export const initializeShadeRoot = (options) => {
|
|
2
7
|
options.jsxElement.injector = options.injector;
|
|
3
8
|
options.rootElement.appendChild(options.jsxElement);
|
package/esm/initialize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../src/initialize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../src/initialize.ts"],"names":[],"mappings":"AAcA;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAA0B,EAAE,EAAE;IAChE,OAAO,CAAC,UAAU,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;IAC9C,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;AACrD,CAAC,CAAA"}
|
package/esm/jsx.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Injector } from '@furystack/inject';
|
|
2
2
|
import type { ChildrenList, PartialElement } from './models/index.js';
|
|
3
3
|
import type { ResourceManager } from './services/resource-manager.js';
|
|
4
|
+
import type { SvgAnimateAttributes, SvgAnimateMotionAttributes, SvgAnimateTransformAttributes, SvgCircleAttributes, SvgClipPathAttributes, SvgCoreAttributes, SvgDefsAttributes, SvgDescAttributes, SvgEllipseAttributes, SvgFeBlendAttributes, SvgFeColorMatrixAttributes, SvgFeCompositeAttributes, SvgFeFloodAttributes, SvgFeGaussianBlurAttributes, SvgFeMergeAttributes, SvgFeMergeNodeAttributes, SvgFeOffsetAttributes, SvgFilterAttributes, SvgForeignObjectAttributes, SvgGAttributes, SvgImageAttributes, SvgLinearGradientAttributes, SvgLineAttributes, SvgMarkerAttributes, SvgMaskAttributes, SvgPathAttributes, SvgPatternAttributes, SvgPolygonAttributes, SvgPolylineAttributes, SvgRadialGradientAttributes, SvgRectAttributes, SvgSetAttributes, SvgStopAttributes, SvgSvgAttributes, SvgSymbolAttributes, SvgTextAttributes, SvgTextPathAttributes, SvgTitleAttributes, SvgTspanAttributes, SvgUseAttributes } from './svg-types.js';
|
|
4
5
|
declare global {
|
|
5
6
|
export namespace JSX {
|
|
6
7
|
interface Element<TProps = any> extends HTMLElement {
|
|
@@ -8,7 +9,6 @@ declare global {
|
|
|
8
9
|
props: TProps;
|
|
9
10
|
updateComponent: () => void;
|
|
10
11
|
shadeChildren?: ChildrenList;
|
|
11
|
-
callConstructed: () => void;
|
|
12
12
|
resourceManager: ResourceManager;
|
|
13
13
|
getRenderCount(): number;
|
|
14
14
|
}
|
|
@@ -427,7 +427,7 @@ declare global {
|
|
|
427
427
|
* The <svg> tag defines a container for SVG graphics.
|
|
428
428
|
* SVG has several methods for drawing paths, boxes, circles, text, and graphic images.
|
|
429
429
|
*/
|
|
430
|
-
svg:
|
|
430
|
+
svg: SvgSvgAttributes;
|
|
431
431
|
/**
|
|
432
432
|
* The <table> tag defines an HTML table.
|
|
433
433
|
* An HTML table consists of the <table> element and one or more <tr>, <th>, and <td> elements.
|
|
@@ -522,6 +522,87 @@ declare global {
|
|
|
522
522
|
* Tip: When a word is too long, or you are afraid that the browser will break your lines at the wrong place, you can use the <wbr> element to add word break opportunities.
|
|
523
523
|
*/
|
|
524
524
|
wbr: PartialElement<HTMLElement>;
|
|
525
|
+
/** The `<g>` element groups SVG elements together. */
|
|
526
|
+
g: SvgGAttributes;
|
|
527
|
+
/** The `<defs>` element stores graphical objects for later reuse. */
|
|
528
|
+
defs: SvgDefsAttributes;
|
|
529
|
+
/** The `<symbol>` element defines a reusable graphical template. */
|
|
530
|
+
symbol: SvgSymbolAttributes;
|
|
531
|
+
/** The `<use>` element references another element for rendering. */
|
|
532
|
+
use: SvgUseAttributes;
|
|
533
|
+
/** The `<path>` element defines a shape via SVG path commands. */
|
|
534
|
+
path: SvgPathAttributes;
|
|
535
|
+
/** The `<rect>` element draws a rectangle. */
|
|
536
|
+
rect: SvgRectAttributes;
|
|
537
|
+
/** The `<circle>` element draws a circle. */
|
|
538
|
+
circle: SvgCircleAttributes;
|
|
539
|
+
/** The `<ellipse>` element draws an ellipse. */
|
|
540
|
+
ellipse: SvgEllipseAttributes;
|
|
541
|
+
/** The `<line>` element draws a straight line between two points. */
|
|
542
|
+
line: SvgLineAttributes;
|
|
543
|
+
/** The `<polyline>` element draws connected straight line segments. */
|
|
544
|
+
polyline: SvgPolylineAttributes;
|
|
545
|
+
/** The `<polygon>` element draws a closed shape of connected line segments. */
|
|
546
|
+
polygon: SvgPolygonAttributes;
|
|
547
|
+
/** The `<text>` element renders text in SVG. */
|
|
548
|
+
text: SvgTextAttributes;
|
|
549
|
+
/** The `<tspan>` element defines a subtext within a `<text>` element. */
|
|
550
|
+
tspan: SvgTspanAttributes;
|
|
551
|
+
/** The `<textPath>` element renders text along a path. */
|
|
552
|
+
textPath: SvgTextPathAttributes;
|
|
553
|
+
/** The `<clipPath>` element defines a clipping region. */
|
|
554
|
+
clipPath: SvgClipPathAttributes;
|
|
555
|
+
/** The `<mask>` element defines an alpha mask for compositing. */
|
|
556
|
+
mask: SvgMaskAttributes;
|
|
557
|
+
/** The `<linearGradient>` element defines a linear color gradient. */
|
|
558
|
+
linearGradient: SvgLinearGradientAttributes;
|
|
559
|
+
/** The `<radialGradient>` element defines a radial color gradient. */
|
|
560
|
+
radialGradient: SvgRadialGradientAttributes;
|
|
561
|
+
/** The `<stop>` element defines a color stop in a gradient. */
|
|
562
|
+
stop: SvgStopAttributes;
|
|
563
|
+
/** The `<pattern>` element defines a repeating graphic pattern. */
|
|
564
|
+
pattern: SvgPatternAttributes;
|
|
565
|
+
/** The `<marker>` element defines a graphic for drawing on edges of shapes. */
|
|
566
|
+
marker: SvgMarkerAttributes;
|
|
567
|
+
/** The `<filter>` element defines a set of filter operations. */
|
|
568
|
+
filter: SvgFilterAttributes;
|
|
569
|
+
/** The `<feGaussianBlur>` filter primitive blurs the input image. */
|
|
570
|
+
feGaussianBlur: SvgFeGaussianBlurAttributes;
|
|
571
|
+
/** The `<feBlend>` filter primitive composites two inputs. */
|
|
572
|
+
feBlend: SvgFeBlendAttributes;
|
|
573
|
+
/** The `<feColorMatrix>` filter primitive applies a matrix color transform. */
|
|
574
|
+
feColorMatrix: SvgFeColorMatrixAttributes;
|
|
575
|
+
/** The `<feOffset>` filter primitive offsets the input image. */
|
|
576
|
+
feOffset: SvgFeOffsetAttributes;
|
|
577
|
+
/** The `<feFlood>` filter primitive fills with a solid color. */
|
|
578
|
+
feFlood: SvgFeFloodAttributes;
|
|
579
|
+
/** The `<feMerge>` filter primitive composites multiple inputs. */
|
|
580
|
+
feMerge: SvgFeMergeAttributes;
|
|
581
|
+
/** The `<feMergeNode>` element defines an input for `<feMerge>`. */
|
|
582
|
+
feMergeNode: SvgFeMergeNodeAttributes;
|
|
583
|
+
/** The `<feComposite>` filter primitive combines images using Porter-Duff operations. */
|
|
584
|
+
feComposite: SvgFeCompositeAttributes;
|
|
585
|
+
/** The `<image>` element (SVG) embeds a raster image. */
|
|
586
|
+
image: SvgImageAttributes;
|
|
587
|
+
/** The `<foreignObject>` element embeds external XML (e.g. HTML) in SVG. */
|
|
588
|
+
foreignObject: SvgForeignObjectAttributes;
|
|
589
|
+
/** The `<animate>` element animates an attribute over time. */
|
|
590
|
+
animate: SvgAnimateAttributes;
|
|
591
|
+
/** The `<animateMotion>` element animates an element along a path. */
|
|
592
|
+
animateMotion: SvgAnimateMotionAttributes;
|
|
593
|
+
/** The `<animateTransform>` element animates a transformation attribute. */
|
|
594
|
+
animateTransform: SvgAnimateTransformAttributes;
|
|
595
|
+
/** The `<set>` element sets an attribute to a value for a duration. */
|
|
596
|
+
set: SvgSetAttributes;
|
|
597
|
+
/** The `<title>` element (SVG) provides an accessible title. */
|
|
598
|
+
title: SvgTitleAttributes;
|
|
599
|
+
/** The `<desc>` element provides an accessible description. */
|
|
600
|
+
desc: SvgDescAttributes;
|
|
601
|
+
/**
|
|
602
|
+
* Catch-all for SVG filter primitives and other SVG elements
|
|
603
|
+
* not explicitly listed above.
|
|
604
|
+
*/
|
|
605
|
+
[key: `fe${string}`]: SvgCoreAttributes;
|
|
525
606
|
}
|
|
526
607
|
}
|
|
527
608
|
}
|
package/esm/jsx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx.d.ts","sourceRoot":"","sources":["../src/jsx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"jsx.d.ts","sourceRoot":"","sources":["../src/jsx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AACrE,OAAO,KAAK,EACV,oBAAoB,EACpB,0BAA0B,EAC1B,6BAA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,EAAE,oBAAoB,CAAA;YAC7B,mEAAmE;YACnE,OAAO,EAAE,oBAAoB,CAAA;YAC7B,oEAAoE;YACpE,WAAW,EAAE,wBAAwB,CAAA;YACrC,yFAAyF;YACzF,WAAW,EAAE,wBAAwB,CAAA;YACrC,yDAAyD;YACzD,KAAK,EAAE,kBAAkB,CAAA;YACzB,4EAA4E;YAC5E,aAAa,EAAE,0BAA0B,CAAA;YACzC,+DAA+D;YAC/D,OAAO,EAAE,oBAAoB,CAAA;YAC7B,sEAAsE;YACtE,aAAa,EAAE,0BAA0B,CAAA;YACzC,4EAA4E;YAC5E,gBAAgB,EAAE,6BAA6B,CAAA;YAC/C,uEAAuE;YACvE,GAAG,EAAE,gBAAgB,CAAA;YACrB,gEAAgE;YAChE,KAAK,EAAE,kBAAkB,CAAA;YACzB,+DAA+D;YAC/D,IAAI,EAAE,iBAAiB,CAAA;YACvB;;;eAGG;YACH,CAAC,GAAG,EAAE,KAAK,MAAM,EAAE,GAAG,iBAAiB,CAAA;SACxC;KACF;CACF"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The type for children passed to Shade components and intrinsic JSX elements.
|
|
3
|
+
* Supports strings, HTML/SVG elements, JSX elements, and nested arrays of these.
|
|
4
|
+
*/
|
|
5
|
+
export type ChildrenList = Array<string | HTMLElement | SVGElement | JSX.Element | string[] | HTMLElement[] | SVGElement[] | JSX.Element[]>;
|
|
2
6
|
//# sourceMappingURL=children-list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"children-list.d.ts","sourceRoot":"","sources":["../../src/models/children-list.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"children-list.d.ts","sourceRoot":"","sources":["../../src/models/children-list.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,CAC9B,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,GAAG,CAAC,OAAO,GAAG,MAAM,EAAE,GAAG,WAAW,EAAE,GAAG,UAAU,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,CAC1G,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base CSS properties - subset of CSSStyleDeclaration
|
|
3
|
+
*/
|
|
4
|
+
export type CSSProperties = Partial<CSSStyleDeclaration>;
|
|
5
|
+
/**
|
|
6
|
+
* Selector key pattern for pseudo-classes and nested selectors
|
|
7
|
+
* Examples: '&:hover', '&:active', '& .className', '& > div'
|
|
8
|
+
*/
|
|
9
|
+
export type SelectorKey = `&${string}`;
|
|
10
|
+
/**
|
|
11
|
+
* CSS object supporting nested selectors for component-level styling.
|
|
12
|
+
*
|
|
13
|
+
* Use this type for the `css` property in Shade components to define
|
|
14
|
+
* styles that are injected as a stylesheet during component registration.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const styles: CSSObject = {
|
|
19
|
+
* padding: '16px',
|
|
20
|
+
* backgroundColor: 'white',
|
|
21
|
+
* '&:hover': {
|
|
22
|
+
* backgroundColor: '#f0f0f0'
|
|
23
|
+
* },
|
|
24
|
+
* '& .title': {
|
|
25
|
+
* fontWeight: 'bold'
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export type CSSObject = CSSProperties & {
|
|
31
|
+
[K in SelectorKey]?: CSSProperties;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=css-object.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-object.d.ts","sourceRoot":"","sources":["../../src/models/css-object.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AAExD;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,MAAM,EAAE,CAAA;AAEtC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG;KACrC,CAAC,IAAI,WAAW,CAAC,CAAC,EAAE,aAAa;CACnC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-object.js","sourceRoot":"","sources":["../../src/models/css-object.ts"],"names":[],"mappings":""}
|
package/esm/models/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA"}
|
package/esm/models/index.js
CHANGED
package/esm/models/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA"}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import type { RefObject } from './render-options.js';
|
|
2
|
+
/**
|
|
3
|
+
* Makes all properties of an HTML element type optional, with `style` narrowed
|
|
4
|
+
* to `Partial<CSSStyleDeclaration>` and a `ref` prop for capturing DOM references.
|
|
5
|
+
* Used as the props type for intrinsic JSX elements and component host element overrides.
|
|
6
|
+
* @typeParam T - The base HTML element type
|
|
7
|
+
*/
|
|
8
|
+
export type PartialElement<T> = (T extends {
|
|
2
9
|
style?: CSSStyleDeclaration;
|
|
3
10
|
} ? Omit<Partial<T>, 'style'> & {
|
|
4
11
|
style?: Partial<CSSStyleDeclaration>;
|
|
5
|
-
} : Partial<T
|
|
12
|
+
} : Partial<T>) & {
|
|
13
|
+
/** Ref object to capture a reference to the underlying DOM element. */
|
|
14
|
+
ref?: RefObject<Element>;
|
|
15
|
+
};
|
|
6
16
|
//# sourceMappingURL=partial-element.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partial-element.d.ts","sourceRoot":"","sources":["../../src/models/partial-element.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,KAAK,CAAC,EAAE,mBAAmB,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"partial-element.d.ts","sourceRoot":"","sources":["../../src/models/partial-element.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD;;;;;GAKG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;IAAE,KAAK,CAAC,EAAE,mBAAmB,CAAA;CAAE,GACtE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;CACrC,GACD,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG;IAChB,uEAAuE;IACvE,GAAG,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;CACzB,CAAA"}
|
|
@@ -2,12 +2,80 @@ import type { Injector } from '@furystack/inject';
|
|
|
2
2
|
import type { ObservableValue, ValueObserverOptions } from '@furystack/utils';
|
|
3
3
|
import type { ChildrenList } from './children-list.js';
|
|
4
4
|
import type { PartialElement } from './partial-element.js';
|
|
5
|
+
/**
|
|
6
|
+
* A reference object returned by `useRef`.
|
|
7
|
+
* `current` is set to the DOM element when it is mounted, and `null` when unmounted.
|
|
8
|
+
* The `readonly` modifier ensures covariance so that `RefObject<HTMLInputElement>`
|
|
9
|
+
* is assignable to `RefObject<Element>`.
|
|
10
|
+
*/
|
|
11
|
+
export type RefObject<T extends Element = HTMLElement> = {
|
|
12
|
+
readonly current: T | null;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Options provided to a Shade component's `render` function.
|
|
16
|
+
* Contains the current props, injector, children, and hooks for managing state, side effects, and host element attributes.
|
|
17
|
+
* @typeParam TProps - The component's props type
|
|
18
|
+
* @typeParam TElementBase - The base HTML element type (defaults to HTMLElement)
|
|
19
|
+
*/
|
|
5
20
|
export type RenderOptions<TProps, TElementBase extends HTMLElement = HTMLElement> = {
|
|
6
21
|
readonly props: TProps & PartialElement<TElementBase>;
|
|
7
22
|
renderCount: number;
|
|
8
23
|
injector: Injector;
|
|
9
24
|
children?: ChildrenList;
|
|
10
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Declaratively sets attributes and styles on the host custom element.
|
|
27
|
+
* Can be called multiple times per render; each call merges into the previous values.
|
|
28
|
+
*
|
|
29
|
+
* CSS custom properties (e.g. `--my-color`) are applied via `setProperty`.
|
|
30
|
+
* The `style` property accepts both standard camelCase properties and CSS custom properties.
|
|
31
|
+
*
|
|
32
|
+
* **Best practice:** Use `useHostProps` for data attributes, ARIA attributes, CSS variables,
|
|
33
|
+
* and event handlers on the host element instead of imperative DOM manipulation.
|
|
34
|
+
*
|
|
35
|
+
* @param hostProps An object of attribute key-value pairs, optionally including a `style` record
|
|
36
|
+
*
|
|
37
|
+
* **Note:** Object and function values are assigned as properties on the host element
|
|
38
|
+
* (not as attributes). This means you can set event handlers (e.g. `onclick`) and
|
|
39
|
+
* even class properties like `injector` via `useHostProps`.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* useHostProps({
|
|
44
|
+
* 'data-variant': props.variant,
|
|
45
|
+
* role: 'progressbar',
|
|
46
|
+
* 'aria-valuenow': String(value),
|
|
47
|
+
* style: {
|
|
48
|
+
* '--btn-color-main': colors.main,
|
|
49
|
+
* display: 'flex',
|
|
50
|
+
* },
|
|
51
|
+
* })
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
useHostProps: (hostProps: Record<string, unknown> & {
|
|
55
|
+
style?: Record<string, string>;
|
|
56
|
+
}) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Creates a mutable ref object that can be attached to intrinsic JSX elements via the `ref` prop.
|
|
59
|
+
* The ref's `current` property will be set to the DOM element after mount and `null` on unmount.
|
|
60
|
+
*
|
|
61
|
+
* Refs are cached by key, so calling `useRef` with the same key returns the same object across renders.
|
|
62
|
+
*
|
|
63
|
+
* **Best practice:** Prefer declarative JSX and `useHostProps` when possible.
|
|
64
|
+
* Use refs sparingly for imperative needs like focus management or measuring elements.
|
|
65
|
+
*
|
|
66
|
+
* @param key A unique key for caching the ref object
|
|
67
|
+
* @returns A ref object with a `current` property
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* const inputRef = useRef<HTMLInputElement>('input')
|
|
72
|
+
* // In JSX:
|
|
73
|
+
* <input ref={inputRef} />
|
|
74
|
+
* // Later:
|
|
75
|
+
* inputRef.current?.focus()
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
useRef: <T extends Element = HTMLElement>(key: string) => RefObject<T>;
|
|
11
79
|
/**
|
|
12
80
|
* Creates and disposes a resource after the component has been detached from the DOM
|
|
13
81
|
* @param key The key for caching the disposable resource
|
|
@@ -16,11 +84,29 @@ export type RenderOptions<TProps, TElementBase extends HTMLElement = HTMLElement
|
|
|
16
84
|
*/
|
|
17
85
|
useDisposable: <T extends Disposable | AsyncDisposable>(key: string, factory: () => T) => T;
|
|
18
86
|
/**
|
|
19
|
-
* Creates a state object from an existing observable value
|
|
87
|
+
* Creates a state object from an existing observable value.
|
|
88
|
+
*
|
|
89
|
+
* **Important:** By default, this will trigger a full component re-render when the observable value changes.
|
|
90
|
+
* To prevent re-renders (e.g., for manual DOM updates or animations), provide a custom `onChange` callback.
|
|
91
|
+
*
|
|
20
92
|
* @param key The key for caching the observable value
|
|
21
93
|
* @param observable The observable value to observe
|
|
22
|
-
* @param options Optional options for the observer
|
|
94
|
+
* @param options Optional options for the observer
|
|
95
|
+
* @param options.onChange Custom callback when value changes. If not provided, the component will re-render on each change.
|
|
23
96
|
* @returns tuple with the current value and a setter function
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* // Default behavior: re-renders component on change
|
|
100
|
+
* const [count] = useObservable('count', countObservable)
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* // Custom onChange: no re-render, update host element via useHostProps
|
|
104
|
+
* useHostProps({ 'data-active': count > 0 ? '' : undefined })
|
|
105
|
+
* const [count] = useObservable('count', countObservable, {
|
|
106
|
+
* onChange: () => {
|
|
107
|
+
* // Triggers a re-render so useHostProps above picks up the new value
|
|
108
|
+
* }
|
|
109
|
+
* })
|
|
24
110
|
*/
|
|
25
111
|
useObservable: <T>(key: string, observable: ObservableValue<T>, options?: ValueObserverOptions<T> & {
|
|
26
112
|
onChange?: (newValue: T) => void;
|