@lvce-editor/renderer-process 13.11.0 → 13.13.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.
@@ -62,6 +62,8 @@ const getModuleId = commandId => {
62
62
  case 'ClipBoard.readText':
63
63
  case 'ClipBoard.writeImage':
64
64
  case 'ClipBoard.writeText':
65
+ case 'ClipBoard.write':
66
+ case 'ClipBoard.read':
65
67
  return ClipBoard;
66
68
  case 'FileHandles.get':
67
69
  return FileHandles;
@@ -4297,10 +4299,38 @@ const Audio_ipc = {
4297
4299
  const readText = async () => {
4298
4300
  return navigator.clipboard.readText();
4299
4301
  };
4302
+ const normalizeItems = async items => {
4303
+ const normalized = [];
4304
+ for (const clipboardItem of items) {
4305
+ for (const type of clipboardItem.types) {
4306
+ if (!type.startsWith('web ')) {
4307
+ continue;
4308
+ }
4309
+ const blob = await clipboardItem.getType(type);
4310
+ normalized.push({
4311
+ blob,
4312
+ type
4313
+ });
4314
+ }
4315
+ }
4316
+ return normalized;
4317
+ };
4318
+ const read = async () => {
4319
+ const items = await navigator.clipboard.read();
4320
+ const normalized = normalizeItems(items);
4321
+ return normalized;
4322
+ };
4300
4323
  const writeText = async text => {
4301
4324
  string(text);
4302
4325
  await navigator.clipboard.writeText(text);
4303
4326
  };
4327
+ const toClipBoardItem = options => {
4328
+ return new ClipboardItem(options);
4329
+ };
4330
+ const write$1 = async itemOptions => {
4331
+ const items = itemOptions.map(toClipBoardItem);
4332
+ await navigator.clipboard.write(items);
4333
+ };
4304
4334
  const writeImage = async blob => {
4305
4335
  await navigator.clipboard.write([new ClipboardItem({
4306
4336
  [blob.type]: blob
@@ -4317,7 +4347,9 @@ const Commands$z = {
4317
4347
  execCopy: execCopy,
4318
4348
  readText: readText,
4319
4349
  writeImage: writeImage,
4320
- writeText: writeText
4350
+ writeText: writeText,
4351
+ write: write$1,
4352
+ read: read
4321
4353
  };
4322
4354
 
4323
4355
  const ClipBoard_ipc = {
@@ -5115,7 +5147,7 @@ const handleMouseEnter = event => {
5115
5147
  };
5116
5148
  const handleMouseLeave = event => {
5117
5149
  const $RelatedTarget = event.relatedTarget;
5118
- if ($RelatedTarget.classList.contains('MenuItem')) ;
5150
+ if ($RelatedTarget && $RelatedTarget.classList.contains('MenuItem')) ;
5119
5151
  // RendererWorker.send(/* Menu.handleMouseLeave */ 'Menu.handleMouseLeave')
5120
5152
  };
5121
5153
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "13.11.0",
3
+ "version": "13.13.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "lvce-editor",