el-text-editor 0.0.57 → 0.0.59

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.
@@ -1301,13 +1301,10 @@ class ElTextEditorComponent {
1301
1301
  onPaste(event) {
1302
1302
  event.preventDefault();
1303
1303
  const clipboardData = event.clipboardData;
1304
- console.log('clipboardData: =>> ', clipboardData);
1305
1304
  if (clipboardData) {
1306
1305
  for (let i = 0; i < clipboardData.items.length; i++) {
1307
1306
  const item = clipboardData.items[i];
1308
- console.log(`Item ${i}: Type = ${item.type}`);
1309
1307
  if (item.type.startsWith("image/")) {
1310
- console.log("Image data detected!");
1311
1308
  // Handle image paste
1312
1309
  const file = item.getAsFile();
1313
1310
  if (file) {
@@ -1321,7 +1318,6 @@ class ElTextEditorComponent {
1321
1318
  }
1322
1319
  }
1323
1320
  else if (item.type === "text/html") {
1324
- console.log("HTML data detected!");
1325
1321
  // Handle HTML paste
1326
1322
  // const htmlData = clipboardData.getData("text/html");
1327
1323
  if (this.isTableData(clipboardData.getData('text/html'))) {
@@ -1335,7 +1331,6 @@ class ElTextEditorComponent {
1335
1331
  return;
1336
1332
  }
1337
1333
  else if (item.type === "text/plain") {
1338
- console.log("Plain text detected!");
1339
1334
  // Handle plain text paste
1340
1335
  if (this.isTableData(clipboardData.getData('text/plain'))) {
1341
1336
  const html = this.convertTextToTable(clipboardData.getData('text/plain'));
@@ -1369,7 +1364,7 @@ class ElTextEditorComponent {
1369
1364
  const rows = text.split('\n').filter(row => row.trim() !== '');
1370
1365
  const tableRows = rows.map(row => {
1371
1366
  const cells = row.split('\t').map(cell => `<td class="px-1 py-1" >${cell}</td>`).join('');
1372
- return `<tr >${cells}</tr>`;
1367
+ return `<tr class="table-border-top" style="border-top: ${this.themeModeTableBorderTop()}">${cells}</tr>`;
1373
1368
  }).join('');
1374
1369
  return `<table>${tableRows}</table>`;
1375
1370
  }
@@ -1389,6 +1384,15 @@ class ElTextEditorComponent {
1389
1384
  range.collapse(false);
1390
1385
  }
1391
1386
  }
1387
+ themeModeTableBorderTop() {
1388
+ const clrMode = document.body.getAttribute('data-layout-color');
1389
+ if (clrMode == 'dark') {
1390
+ return '1px solid #D0D0D0; !important';
1391
+ }
1392
+ else {
1393
+ return '1px solid #414141 !important';
1394
+ }
1395
+ }
1392
1396
  openFullscreen() {
1393
1397
  var elem = document.getElementById("textEditor");
1394
1398
  this.isFullScreen = true;