@lvce-editor/renderer-process 12.1.0 → 12.3.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.
@@ -1447,7 +1447,7 @@ const has = listener => {
1447
1447
  const set$7 = (listener, value) => {
1448
1448
  cache$1.set(listener, value);
1449
1449
  };
1450
- const get$1$1 = listener => {
1450
+ const get$7 = listener => {
1451
1451
  return cache$1.get(listener);
1452
1452
  };
1453
1453
  const nameAnonymousFunction$1 = (fn, name) => {
@@ -1473,7 +1473,7 @@ const getWrappedListener$1 = (listener, returnValue) => {
1473
1473
  nameAnonymousFunction$1(wrapped, listener.name);
1474
1474
  set$7(listener, wrapped);
1475
1475
  }
1476
- return get$1$1(listener);
1476
+ return get$7(listener);
1477
1477
  };
1478
1478
  const getOptions = fn => {
1479
1479
  if (fn.passive) {
@@ -1695,11 +1695,13 @@ const create$H = () => {
1695
1695
  return ++id;
1696
1696
  };
1697
1697
  const state$8 = Object.create(null);
1698
- const get$7 = id => {
1699
- return state$8[id];
1698
+ const acquire$1 = id => {
1699
+ const promise = state$8[id];
1700
+ delete state$8[id];
1701
+ return promise;
1700
1702
  };
1701
1703
  const getFileHandles$1 = async ids => {
1702
- const promises = ids.map(id => get$7(id));
1704
+ const promises = ids.map(id => acquire$1(id));
1703
1705
  const handles = await Promise.all(promises);
1704
1706
  return handles;
1705
1707
  };
@@ -1708,7 +1710,7 @@ const add = promise => {
1708
1710
  state$8[id] = promise;
1709
1711
  return id;
1710
1712
  };
1711
- const handleDataTransferFiles = async event => {
1713
+ const handleDataTransferFiles = event => {
1712
1714
  const items = [...event.dataTransfer.items];
1713
1715
  const promises = items.map(item => item.getAsFileSystemHandle());
1714
1716
  const ids = promises.map(promise => add(promise));
@@ -11120,20 +11122,21 @@ const isUint8Array = value => {
11120
11122
  return value instanceof Uint8Array;
11121
11123
  };
11122
11124
 
11123
- // @ts-nocheck
11124
- const CHAR_WIDTH$1 = 12;
11125
- const CHAR_HEIGHT$1 = 15;
11125
+ const CHAR_WIDTH = 12;
11126
+ const CHAR_HEIGHT = 15;
11127
+
11126
11128
  const supportsOffscreenCanvas = true;
11129
+
11127
11130
  (() => {
11128
11131
  try {
11129
11132
  supportsOffscreenCanvas ? (() => {
11130
- const canvas = new OffscreenCanvas(CHAR_WIDTH$1, CHAR_HEIGHT$1);
11133
+ const canvas = new OffscreenCanvas(CHAR_WIDTH, CHAR_HEIGHT);
11131
11134
  canvas.getContext("2d");
11132
11135
  canvas.transferToImageBitmap();
11133
11136
  })() : (() => {
11134
11137
  const canvas = document.createElement("canvas");
11135
- canvas.width = CHAR_WIDTH$1;
11136
- canvas.height = CHAR_HEIGHT$1;
11138
+ canvas.width = CHAR_WIDTH;
11139
+ canvas.height = CHAR_HEIGHT;
11137
11140
  canvas.transferToImageBitmap();
11138
11141
  })();
11139
11142
  return true;
@@ -11141,15 +11144,18 @@ const supportsOffscreenCanvas = true;
11141
11144
  return false;
11142
11145
  }
11143
11146
  })();
11144
- const tmpCanvas = new OffscreenCanvas(CHAR_WIDTH$1, CHAR_HEIGHT$1);
11147
+
11148
+ const tmpCanvas = new OffscreenCanvas(CHAR_WIDTH, CHAR_HEIGHT) ;
11145
11149
  tmpCanvas.getContext("2d", {
11146
- alpha: false
11150
+ // desynchronized: true, // perf
11151
+ alpha: false // perf
11147
11152
  });
11148
- const noop$1 = () => {};
11153
+
11154
+ const noop = () => {};
11149
11155
  const createOffscreenTerminalDom = (root, {
11150
- handleMouseDown = noop$1,
11151
- handleKeyDown = noop$1,
11152
- handleBlur = noop$1,
11156
+ handleMouseDown = noop,
11157
+ handleKeyDown = noop,
11158
+ handleBlur = noop,
11153
11159
  canvasText = document.createElement("canvas"),
11154
11160
  canvasCursor = document.createElement("canvas")
11155
11161
  }) => {
@@ -11168,6 +11174,7 @@ const createOffscreenTerminalDom = (root, {
11168
11174
  $Layers.append(canvasText, canvasCursor);
11169
11175
  root.append(textarea, $Layers);
11170
11176
  const wrappedKeyDown = event => {
11177
+ // @ts-ignore
11171
11178
  handleKeyDown({
11172
11179
  key: event.key,
11173
11180
  shiftKey: event.shiftKey,
@@ -11186,9 +11193,15 @@ const createOffscreenTerminalDom = (root, {
11186
11193
  textarea.focus();
11187
11194
  };
11188
11195
  return {
11196
+ /**
11197
+ * @deprecated
11198
+ */
11189
11199
  get offscreenCanvasCursor() {
11190
11200
  return canvasCursor.transferControlToOffscreen();
11191
11201
  },
11202
+ /**
11203
+ * @deprecated
11204
+ */
11192
11205
  get offscreenCanvasText() {
11193
11206
  return canvasText.transferControlToOffscreen();
11194
11207
  },
@@ -11196,7 +11209,6 @@ const createOffscreenTerminalDom = (root, {
11196
11209
  };
11197
11210
  };
11198
11211
 
11199
- // @ts-ignore
11200
11212
  const create$1 = ({
11201
11213
  $Element,
11202
11214
  ...options
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "12.1.0",
3
+ "version": "12.3.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "lvce-editor",