@ctzhian/tiptap 0.5.0 → 0.5.3

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.
@@ -81,7 +81,7 @@ var Reader = function Reader() {
81
81
  }
82
82
  return onUpload;
83
83
  }(),
84
- content: "<p>demo.tsx:12</p><p>\u98DE\u673A\u554A\u7684\u6570<code>\u91CF\u5496\u5561\u5C31\u62C9\u4E0A\u98DE\u673A</code>\u554A\u8001<a target=\"_blank\" type=\"icon\" href=\"https://www.baidu.com\" title=\"\u5E08\u7684\u98DE\u673A\u62C9\u591A\">\u5E08\u7684\u98DE\u673A\u62C9\u591A</a>\u5C11\u5206\uFF0C\u98DE<a target=\"_blank\" type=\"text\" href=\"https://remixicon.com/\" title=\"\u673A\u554A\u4E0A\u98DE\u673A\u62C9\u5FB7\">\u673A\u554A\u4E0A\u98DE\u673A\u62C9\u5FB7</a>\u65AF\u57FA\u5F17\u62C9\u7D22\u592B\u5362\u5361\u65AF\u5230\u5BB6\u4E86\u98DE\u673A\u554A\u7684\u6570\u91CF\u5496\u5561\u5C31\u62C9\u4E0A\u98DE\u673A\u554A\u8001\u5E08\u7684\u98DE\u673A\u62C9\u591A\u5C11\u5206\uFF0C\u98DE\u673A\u554A\u4E0A\u98DE\u673A\u62C9\u5FB7\u65AF\u57FA\u5206\uFF0C\u98DE\u673A\u554A\u4E0A<a target=\"_blank\" type=\"icon\" href=\"afsd\" title=\"\u98DE\u673A\u62C9\u5FB7\u65AF\">\u98DE\u673A\u62C9\u5FB7\u65AF</a>\u57FA\u5F17\u62C9\u7D22</p><div class=\"tableWrapper\"><table style=\"min-width: 436px;\"><colgroup><col style=\"width: 136px;\"><col style=\"min-width: 100px;\"><col style=\"min-width: 100px;\"><col style=\"min-width: 100px;\"></colgroup><tbody><tr class=\"table-row\"><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"136\"><p>\u6587\u672C\u4E00</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\"><p>\u6587\u672C\u800C</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\"><p>\u6587\u672C\u4E09</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\"><p>\u6587\u672C\u56DB</p></th></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" colwidth=\"136\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u6D4B\u8BD5\u6570\u636E</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u5386\u53F2\u4E8B\u4EF6</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u798F\u514B\u65AF</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u62C9\u8428</p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" colwidth=\"136\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u6536\u62FE\u6536\u62FE</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u798F\u514B\u65AF\u5566\u53D1\u5927\u6C34</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u91CD\u65B0\u4F60\u54E6\u95EE\u7C89\u4E1D</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u98DE\u673A\u554A\u5723\u8BDE\u5FEB\u4E50</p></td></tr></tbody></table></div><p></p>"
84
+ content: "<p>demo.tsx:12</p><pre data-title=\"\u6570\u91CF\u98DE\u673A\"><code>export { default as darkPalette } from './dark';\nexport { default as lightPalette } from './light';</code></pre><p></p>"
85
85
  }),
86
86
  editor = _useTiptap.editor;
87
87
  return /*#__PURE__*/React.createElement(EditorThemeProvider, {
package/dist/index.css CHANGED
@@ -6,6 +6,10 @@
6
6
  color: var(--mui-palette-text-secondary);
7
7
  }
8
8
 
9
+ .tiptap.ProseMirror[contenteditable="false"] {
10
+ padding: 0;
11
+ }
12
+
9
13
  .tiptap.ProseMirror :first-child {
10
14
  margin-top: 0;
11
15
  }
@@ -155,12 +159,14 @@
155
159
  }
156
160
 
157
161
  /* code */
162
+ .tiptap.ProseMirror .codeblock-wrapper {
163
+ margin-bottom: 16px;
164
+ }
165
+
158
166
  .tiptap.ProseMirror pre {
159
167
  position: relative;
160
- border-radius: var(--mui-shape-borderRadius);
161
168
  color: var(--mui-palette-common-white);
162
169
  background-color: #171c19;
163
- margin-bottom: 16px;
164
170
  }
165
171
 
166
172
  .tiptap.ProseMirror code {
@@ -356,6 +362,11 @@
356
362
  transition: all 0.2s ease-in-out;
357
363
  }
358
364
 
365
+ .tiptap.ProseMirror table tbody tr:first-child th,
366
+ .tiptap.ProseMirror table tbody tr:first-child td {
367
+ border-top: 1px solid var(--mui-palette-divider);
368
+ }
369
+
359
370
  .tiptap.ProseMirror table td>*,
360
371
  .tiptap.ProseMirror table th>* {
361
372
  margin-bottom: 0;
@@ -376,25 +387,41 @@
376
387
  background-color: var(--mui-palette-background-default);
377
388
  }
378
389
 
379
- /* 表格悬停时显示所有列边框 */
380
- .tiptap.ProseMirror table:hover {
390
+ /* 表格悬停时显示所有列边框 - 只在编辑模式下生效 */
391
+ .tiptap.ProseMirror[contenteditable="true"] table:hover {
381
392
  border-left: 1px dotted var(--mui-palette-divider);
382
393
  border-right: 1px dotted var(--mui-palette-divider);
383
394
  }
384
395
 
385
- .tiptap.ProseMirror table:hover td,
386
- .tiptap.ProseMirror table:hover th {
396
+ .tiptap.ProseMirror[contenteditable="true"] table:hover td,
397
+ .tiptap.ProseMirror[contenteditable="true"] table:hover th {
387
398
  border-right-color: var(--mui-palette-divider);
388
399
  border-right-style: dotted;
389
400
  }
390
401
 
391
- .tiptap.ProseMirror table:hover td:last-child,
392
- .tiptap.ProseMirror table:hover th:last-child {
402
+ .tiptap.ProseMirror[contenteditable="true"] table:hover td:last-child,
403
+ .tiptap.ProseMirror[contenteditable="true"] table:hover th:last-child {
404
+ border-right-color: transparent;
405
+ }
406
+
407
+ .tiptap.ProseMirror[contenteditable="false"] table {
408
+ border-left: 1px dotted var(--mui-palette-divider);
409
+ border-right: 1px dotted var(--mui-palette-divider);
410
+ }
411
+
412
+ .tiptap.ProseMirror[contenteditable="false"] table td,
413
+ .tiptap.ProseMirror[contenteditable="false"] table th {
414
+ border-right-color: var(--mui-palette-divider);
415
+ border-right-style: dotted;
416
+ }
417
+
418
+ .tiptap.ProseMirror[contenteditable="false"] table td:last-child,
419
+ .tiptap.ProseMirror[contenteditable="false"] table th:last-child {
393
420
  border-right-color: transparent;
394
421
  }
395
422
 
396
423
  /* 表格选择状态 */
397
- .tiptap.ProseMirror table .selectedCell:after {
424
+ .tiptap.ProseMirror[contenteditable="true"] table .selectedCell:after {
398
425
  background-color: color-mix(in srgb, var(--mui-palette-primary-main) 12%, transparent);
399
426
  content: '';
400
427
  left: 0;
@@ -408,17 +435,17 @@
408
435
  /* border: 2px solid var(--mui-palette-primary-main); */
409
436
  }
410
437
 
411
- .tiptap.ProseMirror table .selectedCell {
438
+ .tiptap.ProseMirror[contenteditable="true"] table .selectedCell {
412
439
  background-color: color-mix(in srgb, var(--mui-palette-primary-main) 5%, transparent) !important;
413
440
  }
414
441
 
415
442
  /* 选中单元格的边框样式 - 只改变最外圈边框颜色 */
416
- .tiptap.ProseMirror table .selectedCell {
443
+ .tiptap.ProseMirror[contenteditable="true"] table .selectedCell {
417
444
  border-color: var(--mui-palette-primary-main) !important;
418
445
  }
419
446
 
420
447
  /* 表格列调整手柄 */
421
- .tiptap.ProseMirror table .column-resize-handle {
448
+ .tiptap.ProseMirror[contenteditable="true"] table .column-resize-handle {
422
449
  background-color: transparent;
423
450
  border-right: 2px dotted var(--mui-palette-primary-main);
424
451
  bottom: -2px;
@@ -444,21 +471,17 @@
444
471
 
445
472
  /* 表格滚动条样式 */
446
473
  .tiptap.ProseMirror .tableWrapper::-webkit-scrollbar {
447
- height: 8px;
474
+ height: 2px;
448
475
  }
449
476
 
450
477
  .tiptap.ProseMirror .tableWrapper::-webkit-scrollbar-track {
451
- background: var(--mui-palette-background-paper2);
452
- border-radius: 4px;
453
- }
454
-
455
- .tiptap.ProseMirror .tableWrapper::-webkit-scrollbar-thumb {
456
478
  background: var(--mui-palette-divider);
457
479
  border-radius: 4px;
458
480
  }
459
481
 
460
- .tiptap.ProseMirror .tableWrapper::-webkit-scrollbar-thumb:hover {
482
+ .tiptap.ProseMirror .tableWrapper::-webkit-scrollbar-thumb {
461
483
  background: var(--mui-palette-text-disabled);
484
+ border-radius: 4px;
462
485
  }
463
486
 
464
487
  /* youtube */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctzhian/tiptap",
3
- "version": "0.5.0",
3
+ "version": "0.5.3",
4
4
  "description": "基于 Tiptap 二次开发的编辑器组件",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",