@parhelia/core 0.1.12780 → 0.1.12781

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.
@@ -1,4 +1,4 @@
1
1
  export function selectComponents(componentIds) {
2
- window.top?.window.postMessage({ componentIds, type: "componentsSelected" }, "*");
2
+ window.top?.window.postMessage({ componentIds, type: "componentsSelected" }, window.location.origin);
3
3
  }
4
4
  //# sourceMappingURL=api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/client-components/api.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,YAAsB;IACrD,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,CAC5B,EAAE,YAAY,EAAE,IAAI,EAAE,oBAAoB,EAAE,EAC5C,GAAG,CACJ,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/client-components/api.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,YAAsB;IACrD,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,CAC5B,EAAE,YAAY,EAAE,IAAI,EAAE,oBAAoB,EAAE,EAC5C,MAAM,CAAC,QAAQ,CAAC,MAAM,CACvB,CAAC;AACJ,CAAC"}
@@ -1278,7 +1278,10 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
1278
1278
  }
1279
1279
  };
1280
1280
  const handleMessage = (event) => {
1281
- if (event.data.type === "componentsSelected") {
1281
+ if (event.origin !== window.location.origin)
1282
+ return;
1283
+ if (event.data.type === "componentsSelected" &&
1284
+ Array.isArray(event.data.componentIds)) {
1282
1285
  setSelection(event.data.componentIds);
1283
1286
  }
1284
1287
  };