@sitecore-feaas/clientside 0.1.19 → 0.1.20
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/basic.js +5 -1
- package/build/basic.js.map +1 -1
- package/build/cloud.js +40 -7
- package/build/cloud.js.map +1 -1
- package/build/components/FEAASBase.js +60 -21
- package/build/components/FEAASBase.js.map +1 -1
- package/build/components/FEAASComponent.js +35 -1
- package/build/components/FEAASComponent.js.map +1 -1
- package/build/components/FEAASElement.js +14 -0
- package/build/components/FEAASElement.js.map +1 -0
- package/build/components/FEAASLoader.js +13 -1
- package/build/components/FEAASLoader.js.map +1 -1
- package/build/components/FEAASStylesheet.js.map +1 -1
- package/build/dom.js +6 -0
- package/build/dom.js.map +1 -1
- package/build/fetch.js +48 -45
- package/build/fetch.js.map +1 -1
- package/build/ui/FEAASContext.js +12 -13
- package/build/ui/FEAASContext.js.map +1 -1
- package/build/ui/FEAASEditor.js +448 -76
- package/build/ui/FEAASEditor.js.map +1 -1
- package/build/ui/FEAASPicker.js +9 -59
- package/build/ui/FEAASPicker.js.map +1 -1
- package/dist/browser/basic.esm.js +5 -5
- package/dist/browser/basic.esm.js.map +1 -1
- package/dist/browser/basic.js +5 -5
- package/dist/browser/basic.js.map +1 -1
- package/dist/browser/index.esm.js +5 -10
- package/dist/browser/index.esm.js.map +1 -1
- package/dist/browser/index.js +5 -10
- package/dist/browser/index.js.map +1 -1
- package/dist/node/basic.esm.js +3 -3
- package/dist/node/basic.esm.js.map +1 -1
- package/dist/node/basic.js +3 -3
- package/dist/node/basic.js.map +1 -1
- package/dist/node/index.esm.js +3 -8
- package/dist/node/index.esm.js.map +1 -1
- package/dist/node/index.js +3 -8
- package/dist/node/index.js.map +1 -1
- package/examples/index.html +8 -49
- package/package.json +1 -6
- package/src/basic.ts +8 -1
- package/src/cloud.ts +43 -13
- package/src/components/FEAASBase.tsx +73 -20
- package/src/components/{FEAASComponent.ts → FEAASComponent.tsx} +37 -1
- package/src/components/FEAASElement.tsx +21 -0
- package/src/components/{FEAASLoader.ts → FEAASLoader.tsx} +14 -1
- package/src/components/{FEAASStylesheet.ts → FEAASStylesheet.tsx} +0 -0
- package/src/dom.ts +5 -0
- package/src/fetch.ts +82 -51
- package/src/ui/FEAASContext.tsx +13 -14
- package/src/ui/FEAASEditor.tsx +598 -144
- package/src/ui/FEAASPicker.tsx +18 -65
- package/test/components.ts +19 -0
- package/types/basic.d.ts +3 -0
- package/types/basic.d.ts.map +1 -1
- package/types/cloud.d.ts +8 -1
- package/types/cloud.d.ts.map +1 -1
- package/types/components/FEAASBase.d.ts +18 -4
- package/types/components/FEAASBase.d.ts.map +1 -1
- package/types/components/FEAASComponent.d.ts +7 -0
- package/types/components/FEAASComponent.d.ts.map +1 -1
- package/types/components/FEAASElement.d.ts +12 -0
- package/types/components/FEAASElement.d.ts.map +1 -0
- package/types/components/FEAASLoader.d.ts +6 -0
- package/types/components/FEAASLoader.d.ts.map +1 -1
- package/types/components/FEAASStylesheet.d.ts +2 -2
- package/types/components/FEAASStylesheet.d.ts.map +1 -1
- package/types/dom.d.ts.map +1 -1
- package/types/fetch.d.ts +42 -1
- package/types/fetch.d.ts.map +1 -1
- package/types/tsbuildinfo +1 -1
- package/types/tsbuildinfo_ui +1 -1
- package/types/ui/FEAASContext.d.ts +4 -4
- package/types/ui/FEAASContext.d.ts.map +1 -1
- package/types/ui/FEAASEditor.d.ts +71 -5
- package/types/ui/FEAASEditor.d.ts.map +1 -1
- package/types/ui/FEAASPicker.d.ts +15 -34
- package/types/ui/FEAASPicker.d.ts.map +1 -1
package/src/ui/FEAASContext.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { FEAASBase, OptionalExcept } from '../components/FEAASBase.js'
|
|
|
4
4
|
export function FEAASContextProps(element: HTMLElement = this) {
|
|
5
5
|
return {
|
|
6
6
|
library: element?.getAttribute('library') as string,
|
|
7
|
-
src: element?.getAttribute('src') ?? '/
|
|
7
|
+
src: element?.getAttribute('src') ?? '/context.js',
|
|
8
8
|
frontend: element?.getAttribute('frontend') ?? 'https://components.sitecoreclud.io',
|
|
9
9
|
backend: element?.getAttribute('backend') ?? 'https://components-api.sitecoreclud.io',
|
|
10
10
|
cdn: element?.getAttribute('cdn') ?? 'https://feaascompontsapiprod.blob.core.windows.net',
|
|
@@ -36,23 +36,21 @@ export class FEAASContext extends FEAASBase<FEAASContextProps, typeof FEAASConte
|
|
|
36
36
|
return this.shadowRoot || this.attachShadow({ mode: 'open' })
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (!this.
|
|
42
|
-
this.
|
|
43
|
-
this.getRoot().appendChild(this.
|
|
39
|
+
reactRootElement: HTMLDivElement
|
|
40
|
+
getReactRootElement() {
|
|
41
|
+
if (!this.reactRootElement) {
|
|
42
|
+
this.reactRootElement = document.createElement('div')
|
|
43
|
+
this.getRoot().appendChild(this.reactRootElement)
|
|
44
44
|
}
|
|
45
|
-
return this.
|
|
45
|
+
return this.reactRootElement
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/** Pull in children FEAAS react elements into the shadow DOM so they receieve the styles */
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.getRoot().appendChild(target)
|
|
55
|
-
}
|
|
49
|
+
connectedCallback(): void {
|
|
50
|
+
Array.from(this.children).forEach((child) => {
|
|
51
|
+
this.getRoot().appendChild(child)
|
|
52
|
+
})
|
|
53
|
+
super.connectedCallback()
|
|
56
54
|
}
|
|
57
55
|
|
|
58
56
|
renderReact(
|
|
@@ -69,6 +67,7 @@ export class FEAASContext extends FEAASBase<FEAASContextProps, typeof FEAASConte
|
|
|
69
67
|
}
|
|
70
68
|
return (
|
|
71
69
|
<AppContext
|
|
70
|
+
backend={this.props.backend}
|
|
72
71
|
libraryId={this.props.library}
|
|
73
72
|
container={this.getRoot()}
|
|
74
73
|
getToken={this.props.getToken}
|