@sitecore-feaas/clientside 0.5.7 → 0.5.10
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/components/FEAASElement.js +1 -1
- package/build/components/FEAASElement.js.map +1 -1
- package/build/dom/html.js +3 -0
- package/build/dom/html.js.map +1 -1
- package/build/ui/FEAASExternal.js +24 -9
- package/build/ui/FEAASExternal.js.map +1 -1
- package/build/ui/react.js +1 -1
- package/build/ui/react.js.map +1 -1
- package/dist/browser/headless.cjs +7 -7
- package/dist/browser/headless.cjs.map +2 -2
- package/dist/browser/headless.esm.js +6 -6
- package/dist/browser/headless.esm.js.map +1 -1
- package/dist/browser/index.cjs +5 -5
- package/dist/browser/index.cjs.map +2 -2
- package/dist/browser/index.esm.js +4 -4
- package/dist/browser/index.esm.js.map +1 -1
- package/dist/browser/react.cjs +6 -6
- package/dist/browser/react.cjs.map +3 -3
- package/dist/browser/react.esm.js +6 -6
- package/dist/browser/react.esm.js.map +1 -1
- package/dist/node/headless.cjs +2 -2
- package/dist/node/headless.cjs.map +2 -2
- package/dist/node/headless.esm.js +2 -2
- package/dist/node/headless.esm.js.map +2 -2
- package/dist/node/index.cjs +4 -4
- package/dist/node/index.cjs.map +2 -2
- package/dist/node/index.esm.js +3 -3
- package/dist/node/index.esm.js.map +2 -2
- package/dist/node/react.cjs +5 -5
- package/dist/node/react.cjs.map +3 -3
- package/dist/node/react.esm.js +5 -5
- package/dist/node/react.esm.js.map +3 -3
- package/headless.cjs +2 -2
- package/headless.cjs.map +2 -2
- package/headless.js +2 -2
- package/headless.js.map +2 -2
- package/package.json +2 -2
- package/react.cjs +6 -6
- package/react.cjs.map +3 -3
- package/react.js +6 -6
- package/react.js.map +3 -3
- package/src/components/FEAASElement.tsx +1 -1
- package/src/dom/html.ts +3 -0
- package/src/ui/FEAASExternal.tsx +34 -12
- package/src/ui/react.tsx +1 -1
- package/test/FEAASComponent.react.test.tsx +64 -1
- package/test/FEAASExternal.test.tsx +12 -0
- package/types/dom/html.d.ts +1 -0
- package/types/dom/html.d.ts.map +1 -1
- package/types/ui/FEAASContext.d.ts +1 -1
- package/types/ui/FEAASExternal.d.ts +8 -5
- package/types/ui/FEAASExternal.d.ts.map +1 -1
|
@@ -339,7 +339,7 @@ export class FEAASElement<Props = any, Payload = any> extends WebComponent {
|
|
|
339
339
|
const { React, ReactDOM, ReactDOMClient } = (this.payload as ReactPayload) || {}
|
|
340
340
|
if (!React) throw new Error(`${this.tagName}: React is not present in payload`)
|
|
341
341
|
if (!ReactDOM) throw new Error(`${this.tagName}: ReactDOM is not present in payload`)
|
|
342
|
-
if (this.getAttribute('hydrate') == 'false') return
|
|
342
|
+
if (this.getAttribute('hydrate') == 'false' && this.firstElementChild) return
|
|
343
343
|
if (!this.refs.topReact && !this.forceUpdateReact) {
|
|
344
344
|
if (ReactDOMClient) {
|
|
345
345
|
this.reactRoot ||= ReactDOMClient.createRoot(this.getReactRootElement())
|
package/src/dom/html.ts
CHANGED
package/src/ui/FEAASExternal.tsx
CHANGED
|
@@ -5,39 +5,61 @@ import { FEAASElement } from '../components/FEAASElement.js'
|
|
|
5
5
|
import { ReactJSX, ReactModules } from '../components/FEAASReactElement.js'
|
|
6
6
|
import { Component, FEAASComponentProps } from './react.js'
|
|
7
7
|
|
|
8
|
-
export const FEAASExternalPropsObject = BYOC.
|
|
8
|
+
export const FEAASExternalPropsObject = BYOC.getMergedComponentProperties
|
|
9
9
|
|
|
10
|
-
export function FEAASExternalProps(element: FEAASElement):
|
|
10
|
+
export function FEAASExternalProps(element: FEAASElement): FEAASExternalProps {
|
|
11
11
|
const props = BYOC.objectKeysToCamelCase(
|
|
12
12
|
Array.from(element.attributes).reduce((prev, { name, value }) => {
|
|
13
|
+
if (name == 'data-external-id') name = 'component-name'
|
|
13
14
|
return Object.assign(prev, { [name]: value })
|
|
14
15
|
}, {} as any)
|
|
15
|
-
)
|
|
16
|
-
return FEAASExternalPropsObject(props.
|
|
16
|
+
) as FEAASExternalProps
|
|
17
|
+
return FEAASExternalPropsObject(props).merged
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
export type FEAASExternalProps =
|
|
20
|
+
export type FEAASExternalProps = { componentName: string; [key: string]: any }
|
|
20
21
|
|
|
21
22
|
export default class FEAASExternal extends FEAASElement<FEAASExternalProps, ReactModules> {
|
|
22
23
|
load() {
|
|
23
24
|
return Promise.resolve({ React, ReactDOM })
|
|
24
25
|
}
|
|
25
26
|
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
// Set up the observer
|
|
29
|
+
const observer = new MutationObserver((mutations) => {
|
|
30
|
+
mutations.forEach((mutation) => {
|
|
31
|
+
if (mutation.type === 'attributes') {
|
|
32
|
+
this.attributeChangedCallback(
|
|
33
|
+
mutation.attributeName,
|
|
34
|
+
mutation.oldValue,
|
|
35
|
+
this.getAttribute(mutation.attributeName)
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
// Start observing
|
|
42
|
+
observer.observe(this, { attributes: true, attributeOldValue: true })
|
|
43
|
+
|
|
44
|
+
super.connectedCallback()
|
|
45
|
+
}
|
|
46
|
+
|
|
26
47
|
update() {
|
|
27
|
-
const
|
|
28
|
-
const Component = BYOC.getComponent(id)?.component
|
|
48
|
+
const Component = BYOC.getComponent(this.getComponentName())?.component
|
|
29
49
|
if (!Component && this.getAttribute('hydrate') == 'false') return
|
|
30
50
|
return super.update()
|
|
31
51
|
}
|
|
32
52
|
|
|
33
53
|
render(props: FEAASExternalProps, { React }: ReactModules): ReactJSX {
|
|
34
|
-
const
|
|
35
|
-
console.log(props)
|
|
36
|
-
const Component = BYOC.getComponent(id)?.component
|
|
54
|
+
const Component = BYOC.getComponent(this.getComponentName())?.component
|
|
37
55
|
if (!Component) {
|
|
38
|
-
console.warn(`FEAASExternal: \`${
|
|
56
|
+
console.warn(`FEAASExternal: \`${this.getComponentName()}\` is not registered`)
|
|
39
57
|
}
|
|
40
|
-
return <>{Component && <Component {...props} />}</>
|
|
58
|
+
return <>{Component && <Component componentName={this.getComponentName()} {...props} />}</>
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
getComponentName() {
|
|
62
|
+
return this.getAttribute('data-external-id')
|
|
41
63
|
}
|
|
42
64
|
|
|
43
65
|
getProps() {
|
package/src/ui/react.tsx
CHANGED
|
@@ -114,7 +114,7 @@ export function FEAASReactComponent({
|
|
|
114
114
|
props = { ...parseComponentSource(props.src), ...props }
|
|
115
115
|
}
|
|
116
116
|
const fetch = normalizeFetchAttribute(props.fetch)
|
|
117
|
-
const embeddedData = fetch.includes('data') ? data : fetch.includes('template') ? fetchedData : null
|
|
117
|
+
const embeddedData = fetch.includes('data') ? data : fetch.includes('template') ? fetchedData || data : null
|
|
118
118
|
return (
|
|
119
119
|
<>
|
|
120
120
|
{'preload' in props && preload === true && 'src' in props && (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useContext } from 'react'
|
|
2
2
|
import ReactDOM from 'react-dom'
|
|
3
|
-
import { describe, expect, it } from 'vitest'
|
|
3
|
+
import { describe, expect, it, spy } from 'vitest'
|
|
4
4
|
import { Component, registerComponent, ExternalComponent } from '../src/ui/react.js'
|
|
5
5
|
|
|
6
6
|
function Hello(props: { firstName: string; telephone: string }) {
|
|
@@ -80,6 +80,11 @@ export async function validate(react: any, html: string) {
|
|
|
80
80
|
const DataContext = React.createContext('DEFAULT')
|
|
81
81
|
|
|
82
82
|
describe('React', () => {
|
|
83
|
+
beforeEach(() => {
|
|
84
|
+
document.open()
|
|
85
|
+
document.write('<html><head></head><body></body></html>')
|
|
86
|
+
document.close()
|
|
87
|
+
})
|
|
83
88
|
it('render react component', async () => {
|
|
84
89
|
await validate(
|
|
85
90
|
<section>
|
|
@@ -232,6 +237,64 @@ Typeof superobject object, {"a":1,"b":2})</div></feaas-external></feaas-componen
|
|
|
232
237
|
'And context value is INHERITED</div></feaas-external></feaas-component></section>'
|
|
233
238
|
)
|
|
234
239
|
})
|
|
240
|
+
it('render wrapped external component with context provider and data mapping asyncronously', async () => {
|
|
241
|
+
registerComponent(Hello, helloSchema)
|
|
242
|
+
validate(
|
|
243
|
+
<DataContext.Provider value='INHERITED'>
|
|
244
|
+
<section>
|
|
245
|
+
<Component
|
|
246
|
+
template={
|
|
247
|
+
'<feaas-external data-path-attributes="$" first-name="Yarik" data-path-attributes="$" data-external-id="MyTestComponent"></feaas-external>'
|
|
248
|
+
}
|
|
249
|
+
data={{ telephone: 321 }}
|
|
250
|
+
></Component>
|
|
251
|
+
</section>
|
|
252
|
+
</DataContext.Provider>,
|
|
253
|
+
'<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' +
|
|
254
|
+
'Hello my name is Yarik (string) and my tel is 321 (number).\n' +
|
|
255
|
+
'And context value is INHERITED</div></feaas-external></feaas-component></section>'
|
|
256
|
+
)
|
|
257
|
+
})
|
|
258
|
+
it('render external component after resetting of a template', async () => {
|
|
259
|
+
registerComponent(HelloData, helloDataSchema)
|
|
260
|
+
const now = new Date()
|
|
261
|
+
const spy = vi.spyOn(global, 'fetch')
|
|
262
|
+
spy.mockImplementation(async (url: string, options: Parameters<typeof fetch>[1] = {}) => {
|
|
263
|
+
return new Response(
|
|
264
|
+
'<feaas-external data-external-id="MyTestDataComponent" first-name="Yarik" data-path-attributes="_"></feaas-external>',
|
|
265
|
+
{
|
|
266
|
+
headers: {
|
|
267
|
+
date: now.toUTCString(),
|
|
268
|
+
'last-modified': now.toUTCString()
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
)
|
|
272
|
+
})
|
|
273
|
+
validate(
|
|
274
|
+
<DataContext.Provider value='INHERITED'>
|
|
275
|
+
<section>
|
|
276
|
+
<Component
|
|
277
|
+
src='a/b'
|
|
278
|
+
data={{ _: { telephone: 321, superobject: { '1': 2 } } }}
|
|
279
|
+
fetch={['template']}
|
|
280
|
+
></Component>
|
|
281
|
+
</section>
|
|
282
|
+
</DataContext.Provider>,
|
|
283
|
+
'<section><feaas-component class="-feaas" library="a" component="b" src="a/b" fetch="template" data="{"_":{"telephone":321,"superobject":{"1":2}}}"></feaas-component></section>'
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
await document.querySelector('feaas-component')?.whenRendered
|
|
287
|
+
await new Promise(requestAnimationFrame)
|
|
288
|
+
await new Promise(requestAnimationFrame)
|
|
289
|
+
|
|
290
|
+
expect(document.querySelector('feaas-component').outerHTML).toEqual(
|
|
291
|
+
'<feaas-component class="-feaas" library="a" component="b" src="a/b" fetch="template" data="{"_":{"telephone":321,"superobject":{"1":2}}}"><feaas-external data-external-id="MyTestDataComponent" first-name="Yarik" data-path-attributes="_" telephone="321" superobject="{"1":2}" data-attributes-keys="telephone,superobject" datasources="{"_":{"telephone":321,"superobject":{"1":2}}}"><div>\n' +
|
|
292
|
+
'Hello my name is Yarik (string) and my tel is 321 (number).\n' +
|
|
293
|
+
'And context value is DEFAULT.\n' +
|
|
294
|
+
'Typeof datasources: object with keys _)\n' +
|
|
295
|
+
'Typeof superobject object, {"1":2})</div></feaas-external></feaas-component>'
|
|
296
|
+
)
|
|
297
|
+
})
|
|
235
298
|
it('render not map attributes of external component with given array', async () => {
|
|
236
299
|
registerComponent(Hello, helloSchema)
|
|
237
300
|
validate(
|
|
@@ -63,6 +63,8 @@ describe('External', () => {
|
|
|
63
63
|
Clientside.External.registerComponent(Hello, helloSchema)
|
|
64
64
|
document.body.innerHTML =
|
|
65
65
|
'<feaas-external id="external-component" class="-component" data-attributes-keys="first-name,telephone" first-name="Chuck" telephone="45657890875643" data-attributes="{"first-name":"Chuck","telephone":"45657890875643"}" data-external-id="MyTestComponent" contenteditable="false"></feaas-external>'
|
|
66
|
+
debugger
|
|
67
|
+
|
|
66
68
|
const component = document.getElementById('external-component') as FEAASExternal
|
|
67
69
|
await expect(component.whenRendered).resolves.toEqual(component)
|
|
68
70
|
expect(component.innerHTML).toEqual('<div>Hello my name is Chuck and my tel is 45657890875643</div>')
|
|
@@ -96,4 +98,14 @@ describe('External', () => {
|
|
|
96
98
|
'<div>Text: this is a string, Number + 1: 6, Boolean: it is true, Array (joined): 1, 2, 3, 4, 5, Object: object value</div>'
|
|
97
99
|
)
|
|
98
100
|
})
|
|
101
|
+
it('can spread data', async () => {
|
|
102
|
+
Clientside.External.registerComponent(TypesComponent, typesComponentSchema)
|
|
103
|
+
document.body.innerHTML = `<feaas-external id="types-component" class="-component" datasources='{"my": {"arrayProp": [1,2,3], "objectProp": {"value": 333}, "numberProp": 1, "booleanProp": false, "stringProp": "Hey"}}' data-external-id="TypesComponent" contenteditable="false"></feaas-external>`
|
|
104
|
+
const typesComponent = document.getElementById('types-component') as FEAASExternal
|
|
105
|
+
|
|
106
|
+
await expect(typesComponent.whenRendered).resolves.toEqual(typesComponent)
|
|
107
|
+
expect(typesComponent.innerHTML).toEqual(
|
|
108
|
+
'<div>Text: Hey, Number + 1: 2, Boolean: error, Array (joined): 1, 2, 3, Object: 333</div>'
|
|
109
|
+
)
|
|
110
|
+
})
|
|
99
111
|
})
|
package/types/dom/html.d.ts
CHANGED
package/types/dom/html.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/dom/html.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,mBAAmB,EAAoB,MAAM,gBAAgB,CAAA;AAEtE,MAAM,MAAM,aAAa,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3D,qBAAa,QAAQ;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CA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IzC,OAAO,CAAC,WAAW;IAgBnB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ;IAQtC,IAAI,eAAe,IAAI,QAAQ,GAAG,IAAI,CAErC;IAED,IAAI,WAAW,IAAI,QAAQ,GAAG,IAAI,CAEjC;IAED,IAAI,sBAAsB,IAAI,QAAQ,GAAG,IAAI,CAE5C;IAED,IAAI,kBAAkB,IAAI,QAAQ,GAAG,IAAI,CAExC;IACD,SAAS,CAAC,IAAI,GAAE,OAAe,GAAG,QAAQ;IAiB1C,IAAI,aAAa,aAEhB;IAED,aAAa;4BACS,MAAM,GAAG,QAAQ;kCAGX,QAAQ;MAGnC;CACF;AA+CD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,EAAE,CAgDlD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOhD;AAWD,wBAAgB,aAAa,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,CAmBvD;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,mBAAmB,UAElG;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,mBAAmB,cAMjG"}
|
|
@@ -53,7 +53,7 @@ export declare class FEAASContext extends FEAASElement<FEAASContextProps, typeof
|
|
|
53
53
|
clientside: typeof FEAAS;
|
|
54
54
|
onStatusChange: FEAASContextImports.SDKStatusCallback;
|
|
55
55
|
whenSDKReady: ControlledPromise<FEAASContextImports.SDK>;
|
|
56
|
-
getPortalRoot(): HTMLElement |
|
|
56
|
+
getPortalRoot(): HTMLElement | FEAASElement<any, any> | ShadowRoot;
|
|
57
57
|
render({ children, library }: React.PropsWithChildren<FEAASContextProps>, { AppContext, Chakra: { Button, Tooltip }, React }: typeof this.payload): JSX.Element;
|
|
58
58
|
}
|
|
59
59
|
declare global {
|
|
@@ -4,19 +4,22 @@ import ReactDOM from 'react-dom';
|
|
|
4
4
|
import { FEAASElement } from '../components/FEAASElement.js';
|
|
5
5
|
import { ReactJSX, ReactModules } from '../components/FEAASReactElement.js';
|
|
6
6
|
import { FEAASComponentProps } from './react.js';
|
|
7
|
-
export declare const FEAASExternalPropsObject: typeof BYOC.
|
|
8
|
-
export declare function FEAASExternalProps(element: FEAASElement):
|
|
9
|
-
export type FEAASExternalProps =
|
|
10
|
-
|
|
7
|
+
export declare const FEAASExternalPropsObject: typeof BYOC.getMergedComponentProperties;
|
|
8
|
+
export declare function FEAASExternalProps(element: FEAASElement): FEAASExternalProps;
|
|
9
|
+
export type FEAASExternalProps = {
|
|
10
|
+
componentName: string;
|
|
11
|
+
[key: string]: any;
|
|
11
12
|
};
|
|
12
13
|
export default class FEAASExternal extends FEAASElement<FEAASExternalProps, ReactModules> {
|
|
13
14
|
load(): Promise<{
|
|
14
15
|
React: typeof React;
|
|
15
16
|
ReactDOM: typeof ReactDOM;
|
|
16
17
|
}>;
|
|
18
|
+
connectedCallback(): void;
|
|
17
19
|
update(): any;
|
|
18
20
|
render(props: FEAASExternalProps, { React }: ReactModules): ReactJSX;
|
|
19
|
-
|
|
21
|
+
getComponentName(): string;
|
|
22
|
+
getProps(): FEAASExternalProps;
|
|
20
23
|
static Preview(props: Partial<FEAASComponentProps<any>> & {
|
|
21
24
|
src: string;
|
|
22
25
|
}): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FEAASExternal.d.ts","sourceRoot":"","sources":["../../src/ui/FEAASExternal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAA;AACtC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,QAAQ,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAC5D,OAAO,EAAE,QAAQ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