@sitecore-feaas/clientside 0.5.6 → 0.5.7
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/build/cdn.js +3 -2
- package/build/cdn.js.map +1 -1
- package/build/dom/stylesheet.js +17 -8
- package/build/dom/stylesheet.js.map +1 -1
- package/dist/browser/headless.cjs +7 -4
- package/dist/browser/headless.cjs.map +3 -3
- package/dist/browser/headless.esm.js +8 -5
- package/dist/browser/headless.esm.js.map +1 -1
- package/dist/browser/index.cjs +8 -5
- package/dist/browser/index.cjs.map +3 -3
- package/dist/browser/index.esm.js +8 -5
- package/dist/browser/index.esm.js.map +1 -1
- package/dist/browser/react.cjs +8 -5
- package/dist/browser/react.cjs.map +3 -3
- package/dist/browser/react.esm.js +8 -5
- package/dist/browser/react.esm.js.map +1 -1
- package/dist/node/headless.cjs +7 -4
- package/dist/node/headless.cjs.map +3 -3
- package/dist/node/headless.esm.js +7 -4
- package/dist/node/headless.esm.js.map +3 -3
- package/dist/node/index.cjs +7 -4
- package/dist/node/index.cjs.map +3 -3
- package/dist/node/index.esm.js +7 -4
- package/dist/node/index.esm.js.map +3 -3
- package/dist/node/react.cjs +7 -4
- package/dist/node/react.cjs.map +3 -3
- package/dist/node/react.esm.js +7 -4
- package/dist/node/react.esm.js.map +3 -3
- package/headless.cjs +7 -4
- package/headless.cjs.map +3 -3
- package/headless.js +7 -4
- package/headless.js.map +3 -3
- package/package.json +2 -2
- package/react.cjs +8 -5
- package/react.cjs.map +3 -3
- package/react.js +8 -5
- package/react.js.map +3 -3
- package/src/cdn.ts +3 -1
- package/src/dom/stylesheet.ts +19 -9
- package/test/FEAASComponent.react.test.tsx +69 -7
- package/test/FEAASStylesheet.test.tsx +104 -2
- package/test/dom.test.ts +8 -0
- package/types/cdn.d.ts.map +1 -1
- package/types/dom/stylesheet.d.ts.map +1 -1
package/src/cdn.ts
CHANGED
|
@@ -108,6 +108,9 @@ export function getStylesheetURL(props: FEAASCDNStylesheetProps) {
|
|
|
108
108
|
props = { src: props }
|
|
109
109
|
}
|
|
110
110
|
if ('src' in props) {
|
|
111
|
+
// edge url are always well formed
|
|
112
|
+
if (String(props.src).includes('v1/files/components/styles')) return props.src
|
|
113
|
+
|
|
111
114
|
props = {
|
|
112
115
|
...parseStylesheetSource(props.src)
|
|
113
116
|
}
|
|
@@ -188,7 +191,6 @@ export async function fetchAndRevalidateStylesheet(
|
|
|
188
191
|
props: FEAASCDNStylesheetProps,
|
|
189
192
|
callback: ValidatableStylesheetCallback
|
|
190
193
|
) {
|
|
191
|
-
if (typeof props == 'string') props = { src: props }
|
|
192
194
|
return fetchAndRevalidate(
|
|
193
195
|
getStylesheetURL(props),
|
|
194
196
|
{
|
package/src/dom/stylesheet.ts
CHANGED
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
FEAASCDNStylesheetProps,
|
|
3
3
|
fetchAndRevalidateStylesheet,
|
|
4
4
|
getStylesheetURL,
|
|
5
|
+
parseStylesheetSource,
|
|
5
6
|
ValidatableStylesheetCallback
|
|
6
7
|
} from '../cdn.js'
|
|
7
8
|
|
|
@@ -19,15 +20,18 @@ export function renderStylesheetPromise(props: FEAASCDNStylesheetProps, styleshe
|
|
|
19
20
|
|
|
20
21
|
const validatedStylesheets = new WeakSet<HTMLStyleElement | HTMLLinkElement>()
|
|
21
22
|
export function loadStylesheet(props: FEAASCDNStylesheetProps, callback?: ValidatableStylesheetCallback) {
|
|
22
|
-
var foundStylesheet: HTMLStyleElement | HTMLLinkElement
|
|
23
23
|
var writableStylesheet: HTMLStyleElement
|
|
24
|
+
var foundStylesheet = findStylesheet(props)
|
|
24
25
|
|
|
25
|
-
if (foundStylesheet
|
|
26
|
-
|
|
26
|
+
if (foundStylesheet) {
|
|
27
|
+
if (validatedStylesheets.has(foundStylesheet)) {
|
|
28
|
+
return Promise.resolve(foundStylesheet)
|
|
29
|
+
}
|
|
30
|
+
// it can be that page already have stylesheet using alternative URL (e.g. edge url), use that instead
|
|
31
|
+
props = foundStylesheet.getAttribute('data-href') || foundStylesheet.getAttribute('href')
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
return fetchAndRevalidateStylesheet(props, (cssText, phase) => {
|
|
30
|
-
foundStylesheet ||= findStylesheet(props)
|
|
31
35
|
// dont need to write stylesheet for cached state if we already found a stylesheet
|
|
32
36
|
if (!(phase == 'initial' && foundStylesheet)) {
|
|
33
37
|
writableStylesheet ||=
|
|
@@ -35,7 +39,7 @@ export function loadStylesheet(props: FEAASCDNStylesheetProps, callback?: Valida
|
|
|
35
39
|
writableStylesheet.textContent = cssText
|
|
36
40
|
}
|
|
37
41
|
callback?.(cssText, phase)
|
|
38
|
-
}).then(() =>
|
|
42
|
+
}).then(() => writableStylesheet || foundStylesheet)
|
|
39
43
|
}
|
|
40
44
|
|
|
41
45
|
export function loadStylesheetAllowStale(props: FEAASCDNStylesheetProps) {
|
|
@@ -44,11 +48,17 @@ export function loadStylesheetAllowStale(props: FEAASCDNStylesheetProps) {
|
|
|
44
48
|
})
|
|
45
49
|
}
|
|
46
50
|
|
|
51
|
+
// Find stylesheet on the page for given props, also check by alternative edge url
|
|
47
52
|
export function findStylesheet(props: FEAASCDNStylesheetProps) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
const cdnURL = getStylesheetURL(props)
|
|
54
|
+
const { library } = parseStylesheetSource(cdnURL)
|
|
55
|
+
const edgeURL = `/files/components/styles/${library}.css`
|
|
56
|
+
return document.querySelector(
|
|
57
|
+
`style[data-href="${cdnURL}"],
|
|
58
|
+
link[rel="stylesheet"][href="${cdnURL}"],
|
|
59
|
+
style[data-href*="${edgeURL}"],
|
|
60
|
+
link[rel="stylesheet"][href*="${edgeURL}"]`
|
|
61
|
+
) as HTMLStyleElement | HTMLLinkElement
|
|
52
62
|
}
|
|
53
63
|
|
|
54
64
|
export function createStylesheet(props: FEAASCDNStylesheetProps) {
|
|
@@ -9,9 +9,11 @@ function Hello(props: { firstName: string; telephone: string }) {
|
|
|
9
9
|
return React.createElement(
|
|
10
10
|
'div',
|
|
11
11
|
{},
|
|
12
|
-
`
|
|
12
|
+
`
|
|
13
|
+
Hello my name is ${props.firstName || 'Unknown'} (${typeof props.firstName}) and my tel is ${
|
|
13
14
|
props.telephone || 'Unknown'
|
|
14
|
-
} (${typeof props.telephone}).
|
|
15
|
+
} (${typeof props.telephone}).
|
|
16
|
+
And context value is ${context}`
|
|
15
17
|
)
|
|
16
18
|
}
|
|
17
19
|
const helloSchema = {
|
|
@@ -26,6 +28,36 @@ const helloSchema = {
|
|
|
26
28
|
}
|
|
27
29
|
} as const
|
|
28
30
|
|
|
31
|
+
function HelloData(props: { firstName: string; telephone: string; datasources: any; superobject: any }) {
|
|
32
|
+
const context = useContext(DataContext)
|
|
33
|
+
|
|
34
|
+
return React.createElement(
|
|
35
|
+
'div',
|
|
36
|
+
{},
|
|
37
|
+
`
|
|
38
|
+
Hello my name is ${props.firstName || 'Unknown'} (${typeof props.firstName}) and my tel is ${
|
|
39
|
+
props.telephone || 'Unknown'
|
|
40
|
+
} (${typeof props.telephone}).
|
|
41
|
+
And context value is ${context}.
|
|
42
|
+
Typeof datasources: ${typeof props.datasources} with keys ${Object.keys(props.datasources || {})})
|
|
43
|
+
Typeof superobject ${typeof props.superobject}, ${JSON.stringify(props.superobject)})`
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
const helloDataSchema = {
|
|
47
|
+
name: 'MyTestDataComponent',
|
|
48
|
+
properties: {
|
|
49
|
+
firstName: {
|
|
50
|
+
type: 'string'
|
|
51
|
+
},
|
|
52
|
+
telephone: {
|
|
53
|
+
type: 'number'
|
|
54
|
+
},
|
|
55
|
+
superobject: {
|
|
56
|
+
type: 'object'
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
} as const
|
|
60
|
+
|
|
29
61
|
export async function validate(react: any, html: string) {
|
|
30
62
|
const div = document.createElement('div')
|
|
31
63
|
document.body.appendChild(div)
|
|
@@ -123,7 +155,9 @@ describe('React', () => {
|
|
|
123
155
|
<section>
|
|
124
156
|
<ExternalComponent componentName='MyTestComponent' telephone={'12345'} firstName='Yarik' />
|
|
125
157
|
</section>,
|
|
126
|
-
'<section><feaas-external data-external-id="MyTestComponent" telephone="12345" first-name="Yarik" hydrate="false"><div
|
|
158
|
+
'<section><feaas-external data-external-id="MyTestComponent" telephone="12345" first-name="Yarik" hydrate="false"><div>\n' +
|
|
159
|
+
'Hello my name is Yarik (string) and my tel is 12345 (number).\n' +
|
|
160
|
+
'And context value is DEFAULT</div></feaas-external></section>'
|
|
127
161
|
)
|
|
128
162
|
})
|
|
129
163
|
it('render wrapped external component with parsed values', async () => {
|
|
@@ -137,7 +171,29 @@ describe('React', () => {
|
|
|
137
171
|
data={{ abc: 321 }}
|
|
138
172
|
></Component>
|
|
139
173
|
</section>,
|
|
140
|
-
'<section><feaas-component class="-feaas" data="{"abc":321}"><feaas-external data-external-id="MyTestComponent" telephone="12345" first-name="Yarik" hydrate="false"><div
|
|
174
|
+
'<section><feaas-component class="-feaas" data="{"abc":321}"><feaas-external data-external-id="MyTestComponent" telephone="12345" first-name="Yarik" hydrate="false"><div>\n' +
|
|
175
|
+
'Hello my name is Yarik (string) and my tel is 12345 (number).\n' +
|
|
176
|
+
'And context value is DEFAULT</div></feaas-external></feaas-component></section>'
|
|
177
|
+
)
|
|
178
|
+
})
|
|
179
|
+
it('render wrapped external component and parse data object', async () => {
|
|
180
|
+
registerComponent(HelloData, helloDataSchema)
|
|
181
|
+
validate(
|
|
182
|
+
<DataContext.Provider value='INHERITED'>
|
|
183
|
+
<section>
|
|
184
|
+
<Component
|
|
185
|
+
template={
|
|
186
|
+
'<feaas-external data-path-attributes="my.$" first-name="Yarik" data-external-id="MyTestDataComponent"></feaas-external>'
|
|
187
|
+
}
|
|
188
|
+
data={{ my: { telephone: 321, superobject: { a: 1, b: 2 } } }}
|
|
189
|
+
></Component>
|
|
190
|
+
</section>
|
|
191
|
+
</DataContext.Provider>,
|
|
192
|
+
`<section><feaas-component class="-feaas" data="{"my":{"telephone":321,"superobject":{"a":1,"b":2}}}"><feaas-external data-external-id="MyTestDataComponent" telephone="321" superobject="{"a":1,"b":2}" data-path-attributes="my.$" first-name="Yarik" data-attributes-keys="telephone,superobject" datasources="{"my":{"telephone":321,"superobject":{"a":1,"b":2}}}" hydrate="false"><div>
|
|
193
|
+
Hello my name is Yarik (string) and my tel is 321 (number).
|
|
194
|
+
And context value is INHERITED.
|
|
195
|
+
Typeof datasources: object with keys my)
|
|
196
|
+
Typeof superobject object, {"a":1,"b":2})</div></feaas-external></feaas-component></section>`
|
|
141
197
|
)
|
|
142
198
|
})
|
|
143
199
|
it('render wrapped external component with context provider', async () => {
|
|
@@ -153,7 +209,9 @@ describe('React', () => {
|
|
|
153
209
|
></Component>
|
|
154
210
|
</section>
|
|
155
211
|
</DataContext.Provider>,
|
|
156
|
-
'<section><feaas-component class="-feaas" data="{"abc":321}"><feaas-external data-external-id="MyTestComponent" telephone="12345" first-name="Yarik" hydrate="false"><div
|
|
212
|
+
'<section><feaas-component class="-feaas" data="{"abc":321}"><feaas-external data-external-id="MyTestComponent" telephone="12345" first-name="Yarik" hydrate="false"><div>\n' +
|
|
213
|
+
'Hello my name is Yarik (string) and my tel is 12345 (number).\n' +
|
|
214
|
+
'And context value is INHERITED</div></feaas-external></feaas-component></section>'
|
|
157
215
|
)
|
|
158
216
|
})
|
|
159
217
|
it('render wrapped external component with context provider and data mapping', async () => {
|
|
@@ -169,7 +227,9 @@ describe('React', () => {
|
|
|
169
227
|
></Component>
|
|
170
228
|
</section>
|
|
171
229
|
</DataContext.Provider>,
|
|
172
|
-
'<section><feaas-component class="-feaas" data="{"telephone":321}"><feaas-external data-external-id="MyTestComponent" data-path-attributes="$" first-name="Yarik"
|
|
230
|
+
'<section><feaas-component class="-feaas" data="{"telephone":321}"><feaas-external data-external-id="MyTestComponent" telephone="321" data-path-attributes="$" first-name="Yarik" data-attributes-keys="telephone" datasources="{"_":{"telephone":321}}" hydrate="false"><div>\n' +
|
|
231
|
+
'Hello my name is Yarik (string) and my tel is 321 (number).\n' +
|
|
232
|
+
'And context value is INHERITED</div></feaas-external></feaas-component></section>'
|
|
173
233
|
)
|
|
174
234
|
})
|
|
175
235
|
it('render not map attributes of external component with given array', async () => {
|
|
@@ -185,7 +245,9 @@ describe('React', () => {
|
|
|
185
245
|
></Component>
|
|
186
246
|
</section>
|
|
187
247
|
</DataContext.Provider>,
|
|
188
|
-
'<section><feaas-component class="-feaas" data="[{"telephone":321}]"><feaas-external data-external-id="MyTestComponent" first-name="Yarik" data-path-attributes="$" datasources="{"_":[{"telephone":321}]}" hydrate="false"><div
|
|
248
|
+
'<section><feaas-component class="-feaas" data="[{"telephone":321}]"><feaas-external data-external-id="MyTestComponent" first-name="Yarik" data-path-attributes="$" datasources="{"_":[{"telephone":321}]}" hydrate="false"><div>\n' +
|
|
249
|
+
'Hello my name is Yarik (string) and my tel is Unknown (undefined).\n' +
|
|
250
|
+
'And context value is INHERITED</div></feaas-external></feaas-component></section>'
|
|
189
251
|
)
|
|
190
252
|
})
|
|
191
253
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { afterAll, beforeEach, beforeAll, describe, expect, it, vi } from 'vitest'
|
|
2
2
|
import { FEAASStylesheet } from '../src/components/FEAASStylesheet.js'
|
|
3
3
|
import { renderDOMContent } from '../src/dom/rendering.js'
|
|
4
|
-
import { clearFetchCache, DEFAULT_CDN_URL, loadStylesheet } from '../src/headless.js'
|
|
4
|
+
import { clearFetchCache, DEFAULT_CDN_URL, findStylesheet, loadStylesheet } from '../src/headless.js'
|
|
5
5
|
|
|
6
6
|
const earliest = new Date(2000, 1, 1, 0, 0, 0)
|
|
7
7
|
const earlier = new Date(2000, 1, 2, 0, 0, 0)
|
|
@@ -179,5 +179,107 @@ describe('Stylesheet', () => {
|
|
|
179
179
|
await expect(loadStylesheet(`http://CDN/L/published.css`).then((r) => r.textContent)).resolves.toEqual('FRESH {}')
|
|
180
180
|
})
|
|
181
181
|
|
|
182
|
-
|
|
182
|
+
describe('.findStylesheet', () => {
|
|
183
|
+
it('should find FEAASStylesheet', async () => {
|
|
184
|
+
const spy = vi.spyOn(global, 'fetch')
|
|
185
|
+
spy.mockImplementation(async (url: string, options: Parameters<typeof fetch>[1] = {}) => {
|
|
186
|
+
// Serve from cache
|
|
187
|
+
return new Response('CSS {}', {
|
|
188
|
+
headers: {
|
|
189
|
+
date: earlier.toUTCString(),
|
|
190
|
+
'last-modified': earliest.toUTCString()
|
|
191
|
+
}
|
|
192
|
+
})
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
document.body.innerHTML = '<feaas-stylesheet library="L" cdn="https://CDN" revision="staged"></feaas-stylesheet>'
|
|
196
|
+
const stylesheet = document.body.firstElementChild as FEAASStylesheet
|
|
197
|
+
await stylesheet.whenRendered
|
|
198
|
+
expect(findStylesheet({ library: 'L', cdn: 'https://CDN', revision: 'staged' })?.textContent).toEqual('CSS {}')
|
|
199
|
+
})
|
|
200
|
+
})
|
|
201
|
+
it('should find stylesheet by its edge url', async () => {
|
|
202
|
+
document.body.innerHTML =
|
|
203
|
+
'<link rel="http://edge-platform-staging.sitecore-staging.cloud/v1/files/components/styles/L.css?sitecoreContextId=abc/>'
|
|
204
|
+
expect(findStylesheet({ library: 'L', cdn: 'https://CDN', revision: 'staged' })).toEqual(
|
|
205
|
+
document.body.firstElementChild
|
|
206
|
+
)
|
|
207
|
+
expect(findStylesheet({ library: 'L', cdn: 'https://CDN', revision: 'published' })).toEqual(
|
|
208
|
+
document.body.firstElementChild
|
|
209
|
+
)
|
|
210
|
+
expect(findStylesheet({ library: 'T', cdn: 'https://CDN', revision: 'staged' })).toEqual(null)
|
|
211
|
+
expect(findStylesheet({ library: 'T', cdn: 'https://CDN', revision: 'published' })).toEqual(null)
|
|
212
|
+
})
|
|
213
|
+
it('should reload stylesheet embedded as edge url', async () => {
|
|
214
|
+
const spy = vi.spyOn(global, 'fetch')
|
|
215
|
+
spy.mockImplementation(async (url: string, options: Parameters<typeof fetch>[1] = {}) => {
|
|
216
|
+
if (
|
|
217
|
+
!url.includes(
|
|
218
|
+
'http://edge-platform-staging.sitecore-staging.cloud/v1/files/components/styles/L.css?sitecoreContextId=abc'
|
|
219
|
+
)
|
|
220
|
+
)
|
|
221
|
+
return
|
|
222
|
+
|
|
223
|
+
if (options?.method != 'HEAD') {
|
|
224
|
+
// Serve from cache
|
|
225
|
+
return new Response('YESTERDAY {}', {
|
|
226
|
+
headers: {
|
|
227
|
+
date: earlier.toUTCString(),
|
|
228
|
+
'last-modified': earliest.toUTCString()
|
|
229
|
+
}
|
|
230
|
+
})
|
|
231
|
+
} else if (options?.method == 'HEAD') {
|
|
232
|
+
return new Response(null, {
|
|
233
|
+
headers: {
|
|
234
|
+
date: now.toUTCString(),
|
|
235
|
+
'last-modified': earlier.toUTCString()
|
|
236
|
+
}
|
|
237
|
+
})
|
|
238
|
+
} else {
|
|
239
|
+
return new Response('FRESH {}', {
|
|
240
|
+
headers: {
|
|
241
|
+
date: now.toUTCString(),
|
|
242
|
+
'last-modified': earlier.toUTCString()
|
|
243
|
+
}
|
|
244
|
+
})
|
|
245
|
+
}
|
|
246
|
+
})
|
|
247
|
+
|
|
248
|
+
document.body.innerHTML =
|
|
249
|
+
'<link rel="stylesheet" href="http://edge-platform-staging.sitecore-staging.cloud/v1/files/components/styles/L.css?sitecoreContextId=abc" />'
|
|
250
|
+
|
|
251
|
+
const stylesheet = await loadStylesheet({ library: 'L', cdn: 'https://CDN', revision: 'staged' })
|
|
252
|
+
expect(stylesheet?.tagName).toEqual('STYLE')
|
|
253
|
+
expect(stylesheet?.getAttribute('data-href')).toEqual(
|
|
254
|
+
'http://edge-platform-staging.sitecore-staging.cloud/v1/files/components/styles/L.css?sitecoreContextId=abc'
|
|
255
|
+
)
|
|
256
|
+
})
|
|
257
|
+
it("should not attempt to reload edge stylesheet if it's up to date", async () => {
|
|
258
|
+
const spy = vi.spyOn(global, 'fetch')
|
|
259
|
+
spy.mockImplementation(async (url: string, options: Parameters<typeof fetch>[1] = {}) => {
|
|
260
|
+
if (
|
|
261
|
+
!url.includes(
|
|
262
|
+
'http://edge-platform-staging.sitecore-staging.cloud/v1/files/components/styles/L.css?sitecoreContextId=abc'
|
|
263
|
+
)
|
|
264
|
+
)
|
|
265
|
+
return
|
|
266
|
+
|
|
267
|
+
if (options?.method != 'HEAD') {
|
|
268
|
+
// Serve from cache
|
|
269
|
+
return new Response('YESTERDAY {}', {
|
|
270
|
+
headers: {
|
|
271
|
+
date: now.toUTCString(),
|
|
272
|
+
'last-modified': earliest.toUTCString()
|
|
273
|
+
}
|
|
274
|
+
})
|
|
275
|
+
}
|
|
276
|
+
})
|
|
277
|
+
|
|
278
|
+
document.body.innerHTML =
|
|
279
|
+
'<link rel="stylesheet" href="http://edge-platform-staging.sitecore-staging.cloud/v1/files/components/styles/L.css?sitecoreContextId=abc" />'
|
|
280
|
+
|
|
281
|
+
const stylesheet = await loadStylesheet({ library: 'L', cdn: 'https://CDN', revision: 'staged' })
|
|
282
|
+
expect(stylesheet?.tagName).toEqual('LINK')
|
|
283
|
+
expect(stylesheet).toEqual(document.body.firstElementChild)
|
|
284
|
+
})
|
|
183
285
|
})
|
package/test/dom.test.ts
CHANGED
|
@@ -173,6 +173,14 @@ describe('DOM Clientside', function () {
|
|
|
173
173
|
'<div data-path-attributes="test" a="a.jpg" b="2" c="{"user":"yarik"}" data-attributes-keys="a,b,c"></div>'
|
|
174
174
|
)
|
|
175
175
|
})
|
|
176
|
+
/*
|
|
177
|
+
it('should render attributes object with global top level fallback', function () {
|
|
178
|
+
assertRenderedHTML(
|
|
179
|
+
`<div data-path-attributes="test"></div>`,
|
|
180
|
+
{ a: 'a.jpg', b: 2, c: { user: 'yarik' } },
|
|
181
|
+
'<div data-path-attributes="test" a="a.jpg" b="2" c="{"user":"yarik"}" data-attributes-keys="a,b,c"></div>'
|
|
182
|
+
)
|
|
183
|
+
}) */
|
|
176
184
|
it('should render attributes in dynamic html', function () {
|
|
177
185
|
assertRenderedHTML(
|
|
178
186
|
`<div data-path="html"></div>`,
|
package/types/cdn.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdn.d.ts","sourceRoot":"","sources":["../src/cdn.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,uBAAuB,EACxB,MAAM,YAAY,CAAA;AAEnB,eAAO,MAAM,eAAe,wCAAwC,CAAA;AACpE,MAAM,MAAM,uBAAuB,GAAG;IACpC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAA;IACpD,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AACD,MAAM,MAAM,uBAAuB,GAAG;IACpC,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AACD,MAAM,MAAM,qCAAqC,GAAG;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AACD,MAAM,MAAM,sBAAsB,GAAG,CAAC,uBAAuB,GAAG,uBAAuB,CAAC,GACtF,qCAAqC,CAAA;AAEvC,MAAM,WAAW,wBAAwB;IACvC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAA;IAEpD;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AACD,MAAM,MAAM,uBAAuB,GAAG,wBAAwB,GAAG,wBAAwB,GAAG,MAAM,CAAA;AAElG,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,uBAAuB,CAQ5E;AACD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,UAahE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,UAIlE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,wBAAwB,CAc9E;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,UAYrE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"cdn.d.ts","sourceRoot":"","sources":["../src/cdn.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,uBAAuB,EACxB,MAAM,YAAY,CAAA;AAEnB,eAAO,MAAM,eAAe,wCAAwC,CAAA;AACpE,MAAM,MAAM,uBAAuB,GAAG;IACpC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAA;IACpD,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AACD,MAAM,MAAM,uBAAuB,GAAG;IACpC,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AACD,MAAM,MAAM,qCAAqC,GAAG;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AACD,MAAM,MAAM,sBAAsB,GAAG,CAAC,uBAAuB,GAAG,uBAAuB,CAAC,GACtF,qCAAqC,CAAA;AAEvC,MAAM,WAAW,wBAAwB;IACvC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAA;IAEpD;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AACD,MAAM,MAAM,uBAAuB,GAAG,wBAAwB,GAAG,wBAAwB,GAAG,MAAM,CAAA;AAElG,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,uBAAuB,CAQ5E;AACD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,UAahE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,UAIlE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,wBAAwB,CAc9E;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,UAYrE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,uBAAuB,UAe9D;AAED,wBAAsB,2BAA2B,CAC/C,KAAK,EAAE,sBAAsB,EAC7B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EACjC,cAAc,UAAQ,0HA+CvB;AAED,mCAAmC;AACnC,wBAAsB,cAAc,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM;;;;;;;;IA/JzE;;OAEG;;;;;;;;GAwKJ;AAED,MAAM,MAAM,6BAA6B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAA;AACjG,wBAAsB,4BAA4B,CAChD,KAAK,EAAE,uBAAuB,EAC9B,QAAQ,EAAE,6BAA6B,qBAoBxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stylesheet.d.ts","sourceRoot":"","sources":["../../src/dom/stylesheet.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,
|
|
1
|
+
{"version":3,"file":"stylesheet.d.ts","sourceRoot":"","sources":["../../src/dom/stylesheet.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAIvB,6BAA6B,EAC9B,MAAM,WAAW,CAAA;AAElB,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,uBAAuB,EAAE,KAAK,CAAC,EAAE,gBAAgB,oBAGxF;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,uBAAuB,EAAE,UAAU,CAAC,EAAE,gBAAgB,6BAKpG;AAGD,wBAAgB,cAAc,CAAC,KAAK,EAAE,uBAAuB,EAAE,QAAQ,CAAC,EAAE,6BAA6B,6BAqBtG;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,uBAAuB,oBAItE;AAGD,wBAAgB,cAAc,CAAC,KAAK,EAAE,uBAAuB,sCAU5D;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,uBAAuB,oBAM9D"}
|