@supernova-studio/client 0.48.33 → 0.48.35
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/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +64 -172
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +64 -172
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/yjs/docs-editor/prosemirror/schema.ts +63 -171
- package/src/yjs/version-room/utils.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Schema } from "prosemirror-model";
|
|
2
2
|
|
|
3
3
|
const newSchema = {
|
|
4
|
+
topNode: "doc",
|
|
4
5
|
nodes: {
|
|
5
6
|
paragraph: {
|
|
6
7
|
content: "inline*",
|
|
@@ -59,7 +60,7 @@ const newSchema = {
|
|
|
59
60
|
},
|
|
60
61
|
tableCell: {
|
|
61
62
|
tableRole: "cell",
|
|
62
|
-
content: "
|
|
63
|
+
content: "(paragraph|image)+",
|
|
63
64
|
isolating: true,
|
|
64
65
|
attrs: {
|
|
65
66
|
id: {
|
|
@@ -86,7 +87,7 @@ const newSchema = {
|
|
|
86
87
|
},
|
|
87
88
|
tableHeader: {
|
|
88
89
|
tableRole: "header_cell",
|
|
89
|
-
content: "
|
|
90
|
+
content: "(paragraph|image)+",
|
|
90
91
|
isolating: true,
|
|
91
92
|
attrs: {
|
|
92
93
|
id: {
|
|
@@ -343,7 +344,7 @@ const newSchema = {
|
|
|
343
344
|
default: null,
|
|
344
345
|
},
|
|
345
346
|
variantId: {
|
|
346
|
-
default:
|
|
347
|
+
default: "Tabs",
|
|
347
348
|
},
|
|
348
349
|
},
|
|
349
350
|
parseDOM: [
|
|
@@ -419,10 +420,10 @@ const newSchema = {
|
|
|
419
420
|
},
|
|
420
421
|
],
|
|
421
422
|
},
|
|
422
|
-
|
|
423
|
-
group: "block",
|
|
423
|
+
image: {
|
|
424
|
+
group: "block customBlock",
|
|
424
425
|
atom: true,
|
|
425
|
-
draggable:
|
|
426
|
+
draggable: false,
|
|
426
427
|
attrs: {
|
|
427
428
|
id: {
|
|
428
429
|
default: null,
|
|
@@ -449,35 +450,10 @@ const newSchema = {
|
|
|
449
450
|
},
|
|
450
451
|
],
|
|
451
452
|
},
|
|
452
|
-
|
|
453
|
-
group: "block",
|
|
454
|
-
draggable: true,
|
|
455
|
-
defining: true,
|
|
456
|
-
attrs: {
|
|
457
|
-
id: {
|
|
458
|
-
default: null,
|
|
459
|
-
},
|
|
460
|
-
definitionId: {
|
|
461
|
-
default: null,
|
|
462
|
-
},
|
|
463
|
-
variantId: {
|
|
464
|
-
default: null,
|
|
465
|
-
},
|
|
466
|
-
type: {
|
|
467
|
-
default: "youtube",
|
|
468
|
-
},
|
|
469
|
-
url: {
|
|
470
|
-
default: null,
|
|
471
|
-
},
|
|
472
|
-
height: {
|
|
473
|
-
default: null,
|
|
474
|
-
},
|
|
475
|
-
},
|
|
476
|
-
},
|
|
477
|
-
image: {
|
|
478
|
-
group: "block",
|
|
453
|
+
blockNode: {
|
|
454
|
+
group: "block customBlock",
|
|
479
455
|
atom: true,
|
|
480
|
-
draggable:
|
|
456
|
+
draggable: false,
|
|
481
457
|
attrs: {
|
|
482
458
|
id: {
|
|
483
459
|
default: null,
|
|
@@ -507,177 +483,93 @@ const newSchema = {
|
|
|
507
483
|
},
|
|
508
484
|
marks: {
|
|
509
485
|
link: {
|
|
510
|
-
|
|
511
|
-
rank: 0,
|
|
512
|
-
spec: {
|
|
513
|
-
inclusive: false,
|
|
514
|
-
attrs: {
|
|
515
|
-
href: {
|
|
516
|
-
default: null,
|
|
517
|
-
},
|
|
518
|
-
target: {
|
|
519
|
-
default: "_blank",
|
|
520
|
-
},
|
|
521
|
-
rel: {
|
|
522
|
-
default: "noopener noreferrer nofollow",
|
|
523
|
-
},
|
|
524
|
-
class: {
|
|
525
|
-
default: "tiptap-link",
|
|
526
|
-
},
|
|
527
|
-
},
|
|
528
|
-
parseDOM: [
|
|
529
|
-
{
|
|
530
|
-
tag: 'a[href]:not([href *= "javascript:" i])',
|
|
531
|
-
},
|
|
532
|
-
],
|
|
533
|
-
},
|
|
486
|
+
inclusive: false,
|
|
534
487
|
attrs: {
|
|
535
488
|
href: {
|
|
536
|
-
hasDefault: true,
|
|
537
489
|
default: null,
|
|
538
490
|
},
|
|
539
491
|
target: {
|
|
540
|
-
hasDefault: true,
|
|
541
492
|
default: "_blank",
|
|
542
493
|
},
|
|
543
494
|
rel: {
|
|
544
|
-
hasDefault: true,
|
|
545
495
|
default: "noopener noreferrer nofollow",
|
|
546
496
|
},
|
|
547
497
|
class: {
|
|
548
|
-
hasDefault: true,
|
|
549
498
|
default: "tiptap-link",
|
|
550
499
|
},
|
|
551
500
|
},
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
href: null,
|
|
556
|
-
target: "_blank",
|
|
557
|
-
rel: "noopener noreferrer nofollow",
|
|
558
|
-
class: "tiptap-link",
|
|
501
|
+
parseDOM: [
|
|
502
|
+
{
|
|
503
|
+
tag: 'a[href]:not([href *= "javascript:" i])',
|
|
559
504
|
},
|
|
560
|
-
|
|
505
|
+
],
|
|
561
506
|
},
|
|
562
507
|
commentHighlight: {
|
|
563
|
-
name: "commentHighlight",
|
|
564
|
-
rank: 1,
|
|
565
|
-
spec: {
|
|
566
|
-
attrs: {
|
|
567
|
-
highlightId: {
|
|
568
|
-
default: null,
|
|
569
|
-
},
|
|
570
|
-
resolved: {
|
|
571
|
-
default: false,
|
|
572
|
-
},
|
|
573
|
-
},
|
|
574
|
-
parseDOM: [
|
|
575
|
-
{
|
|
576
|
-
tag: "commenthighlight",
|
|
577
|
-
},
|
|
578
|
-
],
|
|
579
|
-
},
|
|
580
508
|
attrs: {
|
|
581
509
|
highlightId: {
|
|
582
|
-
hasDefault: true,
|
|
583
510
|
default: null,
|
|
584
511
|
},
|
|
585
512
|
resolved: {
|
|
586
|
-
hasDefault: true,
|
|
587
513
|
default: false,
|
|
588
514
|
},
|
|
589
515
|
},
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
highlightId: null,
|
|
594
|
-
resolved: false,
|
|
516
|
+
parseDOM: [
|
|
517
|
+
{
|
|
518
|
+
tag: "commenthighlight",
|
|
595
519
|
},
|
|
596
|
-
|
|
520
|
+
],
|
|
597
521
|
},
|
|
598
522
|
bold: {
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
style: "font-weight",
|
|
611
|
-
},
|
|
612
|
-
],
|
|
613
|
-
},
|
|
614
|
-
attrs: {},
|
|
615
|
-
instance: {
|
|
616
|
-
type: "bold",
|
|
617
|
-
},
|
|
523
|
+
parseDOM: [
|
|
524
|
+
{
|
|
525
|
+
tag: "strong",
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
tag: "b",
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
style: "font-weight",
|
|
532
|
+
},
|
|
533
|
+
],
|
|
618
534
|
},
|
|
619
535
|
italic: {
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
style: "font-style=italic",
|
|
632
|
-
},
|
|
633
|
-
],
|
|
634
|
-
},
|
|
635
|
-
attrs: {},
|
|
636
|
-
instance: {
|
|
637
|
-
type: "italic",
|
|
638
|
-
},
|
|
536
|
+
parseDOM: [
|
|
537
|
+
{
|
|
538
|
+
tag: "em",
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
tag: "i",
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
style: "font-style=italic",
|
|
545
|
+
},
|
|
546
|
+
],
|
|
639
547
|
},
|
|
640
548
|
strike: {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
consuming: false,
|
|
657
|
-
},
|
|
658
|
-
],
|
|
659
|
-
},
|
|
660
|
-
attrs: {},
|
|
661
|
-
instance: {
|
|
662
|
-
type: "strike",
|
|
663
|
-
},
|
|
549
|
+
parseDOM: [
|
|
550
|
+
{
|
|
551
|
+
tag: "s",
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
tag: "del",
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
tag: "strike",
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
style: "text-decoration",
|
|
561
|
+
consuming: false,
|
|
562
|
+
},
|
|
563
|
+
],
|
|
664
564
|
},
|
|
665
565
|
code: {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
tag: "code",
|
|
674
|
-
},
|
|
675
|
-
],
|
|
676
|
-
},
|
|
677
|
-
attrs: {},
|
|
678
|
-
instance: {
|
|
679
|
-
type: "code",
|
|
680
|
-
},
|
|
566
|
+
excludes: "bold code italic strike link",
|
|
567
|
+
code: true,
|
|
568
|
+
parseDOM: [
|
|
569
|
+
{
|
|
570
|
+
tag: "code",
|
|
571
|
+
},
|
|
572
|
+
],
|
|
681
573
|
},
|
|
682
574
|
},
|
|
683
575
|
} as const;
|
|
@@ -18,7 +18,7 @@ export function generatePageContentHash(
|
|
|
18
18
|
let sanitizedContent = structuredClone(content);
|
|
19
19
|
|
|
20
20
|
// Remove comment spans
|
|
21
|
-
sanitizedContent = removeCommentSpansFromPage(
|
|
21
|
+
sanitizedContent = removeCommentSpansFromPage(sanitizedContent, definitions);
|
|
22
22
|
|
|
23
23
|
// Make sure hashes of empty pages always match
|
|
24
24
|
if (isPageContentEmpty(sanitizedContent)) {
|