@blokkli/editor 2.0.0-alpha.11 → 2.0.0-alpha.12

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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "blokkli",
3
3
  "configKey": "blokkli",
4
- "version": "2.0.0-alpha.11",
4
+ "version": "2.0.0-alpha.12",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.15.0"
7
7
  },
package/dist/module.mjs CHANGED
@@ -13,7 +13,7 @@ import { BK_VISIBLE_LANGUAGES, BK_HIDDEN_GLOBALLY } from '../dist/runtime/helper
13
13
  import fs from 'node:fs';
14
14
  import { defu, createDefu } from 'defu';
15
15
 
16
- const version = "2.0.0-alpha.11";
16
+ const version = "2.0.0-alpha.12";
17
17
 
18
18
  function sortObjectKeys(obj) {
19
19
  if (Array.isArray(obj)) {
@@ -664,7 +664,7 @@ export default defineBlokkliEditAdapter(
664
664
  }).then(mapMutation);
665
665
  };
666
666
  }
667
- if (availableFeatureIds.has("comments")) {
667
+ if (availableFeatureIds.has("clipboard")) {
668
668
  adapter.clipboardMapBundle = (e) => {
669
669
  if (e.type === "video") {
670
670
  return config.clipboard.find((v) => {
@@ -291,27 +291,26 @@ function onPaste(e, fromInput) {
291
291
  return;
292
292
  }
293
293
  const clipboardData = e.clipboardData;
294
- if (clipboardData?.files.length) {
295
- return handleFiles(clipboardData);
296
- }
297
- let pastedData = clipboardData?.getData("text/html");
298
- if (!pastedData) {
299
- pastedData = clipboardData?.getData("text");
300
- }
301
- if (!pastedData) {
294
+ if (!clipboardData) {
302
295
  return;
303
296
  }
304
- if (pastedData.startsWith("{")) {
305
- try {
306
- const data = JSON.parse(pastedData);
307
- if (typeof data === "object" && data.type && data.type === "selection") {
308
- const uuids = data.uuids;
309
- return handleSelectionPaste(uuids);
297
+ const pastedData = clipboardData.getData("text/html") || clipboardData.getData("text/plain") || clipboardData.getData("text");
298
+ if (pastedData) {
299
+ if (pastedData.startsWith("{")) {
300
+ try {
301
+ const data = JSON.parse(pastedData);
302
+ if (typeof data === "object" && data.type && data.type === "selection") {
303
+ const uuids = data.uuids;
304
+ return handleSelectionPaste(uuids);
305
+ }
306
+ } catch (_e) {
310
307
  }
311
- } catch (_e) {
312
308
  }
309
+ handlePastedText(pastedData);
310
+ }
311
+ if (clipboardData.files.length) {
312
+ return handleFiles(clipboardData);
313
313
  }
314
- handlePastedText(pastedData);
315
314
  }
316
315
  const handlePastedText = (text) => {
317
316
  if (!adapter.clipboardMapBundle) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blokkli/editor",
3
- "version": "2.0.0-alpha.11",
3
+ "version": "2.0.0-alpha.12",
4
4
  "description": "Interactive page building experience for Nuxt",
5
5
  "repository": "blokkli/editor",
6
6
  "type": "module",