@sitecore-feaas/clientside 0.5.10 → 0.5.11

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.
@@ -24,23 +24,17 @@ export default class FEAASExternal extends FEAASElement<FEAASExternalProps, Reac
24
24
  return Promise.resolve({ React, ReactDOM })
25
25
  }
26
26
 
27
+ // observe all arttribute changes
28
+ _setAttribute: typeof HTMLElement.prototype.setAttribute
27
29
  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
-
30
+ if (!this._setAttribute) {
31
+ this._setAttribute = this.setAttribute
32
+ this.setAttribute = function (name, value) {
33
+ const old = this.getAttribute(value)
34
+ this._setAttribute(name, value)
35
+ this.attributeChangedCallback(name, old, value)
36
+ }
37
+ }
44
38
  super.connectedCallback()
45
39
  }
46
40
 
@@ -284,8 +284,7 @@ Typeof superobject object, {"a":1,"b":2})</div></feaas-external></feaas-componen
284
284
  )
285
285
 
286
286
  await document.querySelector('feaas-component')?.whenRendered
287
- await new Promise(requestAnimationFrame)
288
- await new Promise(requestAnimationFrame)
287
+ await document.querySelector('feaas-external')?.whenRendered
289
288
 
290
289
  expect(document.querySelector('feaas-component').outerHTML).toEqual(
291
290
  '<feaas-component class="-feaas" library="a" component="b" src="a/b" fetch="template" data="{&quot;_&quot;:{&quot;telephone&quot;:321,&quot;superobject&quot;:{&quot;1&quot;:2}}}"><feaas-external data-external-id="MyTestDataComponent" first-name="Yarik" data-path-attributes="_" telephone="321" superobject="{&quot;1&quot;:2}" data-attributes-keys="telephone,superobject" datasources="{&quot;_&quot;:{&quot;telephone&quot;:321,&quot;superobject&quot;:{&quot;1&quot;:2}}}"><div>\n' +
@@ -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 | FEAASElement<any, any> | ShadowRoot;
56
+ getPortalRoot(): HTMLElement | ShadowRoot | FEAASElement<any, any>;
57
57
  render({ children, library }: React.PropsWithChildren<FEAASContextProps>, { AppContext, Chakra: { Button, Tooltip }, React }: typeof this.payload): JSX.Element;
58
58
  }
59
59
  declare global {
@@ -15,6 +15,7 @@ export default class FEAASExternal extends FEAASElement<FEAASExternalProps, Reac
15
15
  React: typeof React;
16
16
  ReactDOM: typeof ReactDOM;
17
17
  }>;
18
+ _setAttribute: typeof HTMLElement.prototype.setAttribute;
18
19
  connectedCallback(): void;
19
20
  update(): any;
20
21
  render(props: FEAASExternalProps, { React }: ReactModules): ReactJSX;
@@ -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,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AAC3E,OAAO,EAAa,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAE3D,eAAO,MAAM,wBAAwB,0CAAoC,CAAA;AAEzE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,kBAAkB,CAQ5E;AAED,MAAM,MAAM,kBAAkB,GAAG;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAA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