@lvce-editor/renderer-process 9.5.0 → 9.6.0

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.
@@ -5812,22 +5812,21 @@ const create$C = async (uid, src, sandbox, csp, credentialless) => {
5812
5812
  const load = async uid => {
5813
5813
  const $Iframe = get(uid);
5814
5814
  const promise = waitForFrameToLoad($Iframe);
5815
- document.body.append($Iframe);
5815
+ const parent = document.getElementById('Workbench');
5816
+ parent.append($Iframe);
5816
5817
  await promise;
5817
5818
  };
5818
5819
 
5819
5820
  // TODO rename to sendMessage
5820
- const setPort$2 = (state, portId, origin) => {
5821
- const port = acquire(portId);
5822
- const {
5823
- frame
5824
- } = state;
5825
- // TODO wait for load in renderer worker
5826
- // TODO avoid closure
5821
+ const setPort$2 = (uid, port, origin) => {
5822
+ const $Iframe = get(uid);
5827
5823
  // TODO use jsonrpc invoke
5828
5824
  const {
5829
5825
  contentWindow
5830
- } = frame;
5826
+ } = $Iframe;
5827
+ if (!contentWindow) {
5828
+ throw new Error(`content window not found`);
5829
+ }
5831
5830
  contentWindow.postMessage({
5832
5831
  jsonrpc: '2.0',
5833
5832
  method: 'setPort',
@@ -7146,7 +7145,7 @@ const setDecorationsDom$2 = (state, decorations) => {
7146
7145
  renderInto($LayerDiagnostics, decorations);
7147
7146
  };
7148
7147
 
7149
- const setPosition = (state, scrollBarY, scrollBarHeight) => {
7148
+ const setPosition$1 = (state, scrollBarY, scrollBarHeight) => {
7150
7149
  const {
7151
7150
  $ScrollBarThumbVertical
7152
7151
  } = state;
@@ -7319,7 +7318,7 @@ const setIncrementalEdits$1 = (state, incrementalEdits) => {
7319
7318
  }
7320
7319
  };
7321
7320
  const setScrollBar$1 = (state, scrollBarY, scrollBarHeight) => {
7322
- setPosition(state, scrollBarY, scrollBarHeight);
7321
+ setPosition$1(state, scrollBarY, scrollBarHeight);
7323
7322
  };
7324
7323
  const setScrollBarHorizontal$1 = setScrollBarHorizontal$2;
7325
7324
  const renderGutter$1 = (state, dom) => {
@@ -11434,10 +11433,15 @@ const setPort = (state, portId, origin) => {
11434
11433
  once: true
11435
11434
  });
11436
11435
  };
11436
+ const setPosition = (state, id, x, y, width, height) => {
11437
+ const $Iframe = get(id);
11438
+ setBounds$6($Iframe, x, y, width, height);
11439
+ };
11437
11440
 
11438
11441
  const ViewletWebView = {
11439
11442
  __proto__: null,
11440
11443
  Events: ViewletWebViewEvents,
11441
11444
  setIframe,
11442
- setPort
11445
+ setPort,
11446
+ setPosition
11443
11447
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "9.5.0",
3
+ "version": "9.6.0",
4
4
  "description": "",
5
5
  "main": "dist/diffWorkerMain.js",
6
6
  "type": "module",