@domternal/core 0.3.0 → 0.4.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.
- package/README.md +7 -5
- package/dist/index.cjs +20 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +823 -794
- package/dist/index.d.ts +823 -794
- package/dist/index.js +20 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/helpers/inputRulesPlugin.d.ts.map +0 -1
- package/dist/nodes/HorizontalRule.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -707,8 +707,12 @@ var ExtensionManager = class {
|
|
|
707
707
|
return items;
|
|
708
708
|
}
|
|
709
709
|
/**
|
|
710
|
-
* Collects node views from all Node extensions
|
|
711
|
-
* Returns a map of node name
|
|
710
|
+
* Collects node views from all Node extensions.
|
|
711
|
+
* Returns a map of node name to NodeViewConstructor for EditorView.
|
|
712
|
+
*
|
|
713
|
+
* Each constructor is annotated with `__domternalContext` containing
|
|
714
|
+
* the editor and extension metadata so framework wrappers (React, Vue)
|
|
715
|
+
* can access them without changing the ProseMirror calling convention.
|
|
712
716
|
*/
|
|
713
717
|
collectNodeViews() {
|
|
714
718
|
const nodeViews = {};
|
|
@@ -722,6 +726,10 @@ var ExtensionManager = class {
|
|
|
722
726
|
`${ext.name}.addNodeView`
|
|
723
727
|
);
|
|
724
728
|
if (nodeView) {
|
|
729
|
+
nodeView.__domternalContext = {
|
|
730
|
+
editor: this.editor,
|
|
731
|
+
extension: { name: nodeExt.name, options: nodeExt.options }
|
|
732
|
+
};
|
|
725
733
|
nodeViews[ext.name] = nodeView;
|
|
726
734
|
}
|
|
727
735
|
}
|
|
@@ -7656,31 +7664,31 @@ var InvisibleChars = Extension.create({
|
|
|
7656
7664
|
|
|
7657
7665
|
// src/extensions/TextColor.ts
|
|
7658
7666
|
var DEFAULT_TEXT_COLORS = [
|
|
7659
|
-
// Row 1
|
|
7667
|
+
// Row 1 - Neutrals
|
|
7660
7668
|
"#000000",
|
|
7661
7669
|
"#595959",
|
|
7662
7670
|
"#a6a6a6",
|
|
7663
7671
|
"#d9d9d9",
|
|
7664
7672
|
"#ffffff",
|
|
7665
|
-
// Row 2
|
|
7673
|
+
// Row 2 - Pastel
|
|
7666
7674
|
"#ffc9c9",
|
|
7667
7675
|
"#fff3bf",
|
|
7668
7676
|
"#b2f2bb",
|
|
7669
7677
|
"#a5d8ff",
|
|
7670
7678
|
"#d0bfff",
|
|
7671
|
-
// Row 3
|
|
7679
|
+
// Row 3 - Vivid
|
|
7672
7680
|
"#e03131",
|
|
7673
7681
|
"#f08c00",
|
|
7674
7682
|
"#2f9e44",
|
|
7675
7683
|
"#1971c2",
|
|
7676
7684
|
"#7048e8",
|
|
7677
|
-
// Row 4
|
|
7685
|
+
// Row 4 - Medium
|
|
7678
7686
|
"#ff6b6b",
|
|
7679
7687
|
"#ffd43b",
|
|
7680
7688
|
"#69db7c",
|
|
7681
7689
|
"#4dabf7",
|
|
7682
7690
|
"#9775fa",
|
|
7683
|
-
// Row 5
|
|
7691
|
+
// Row 5 - Dark
|
|
7684
7692
|
"#c92a2a",
|
|
7685
7693
|
"#e67700",
|
|
7686
7694
|
"#2b8a3e",
|
|
@@ -7770,31 +7778,31 @@ var TextColor = Extension.create({
|
|
|
7770
7778
|
}
|
|
7771
7779
|
});
|
|
7772
7780
|
var DEFAULT_HIGHLIGHT_COLORS = [
|
|
7773
|
-
// Row 1
|
|
7781
|
+
// Row 1 - Classic warm highlights
|
|
7774
7782
|
"#fef08a",
|
|
7775
7783
|
"#fde68a",
|
|
7776
7784
|
"#fed7aa",
|
|
7777
7785
|
"#fecaca",
|
|
7778
7786
|
"#fbcfe8",
|
|
7779
|
-
// Row 2
|
|
7787
|
+
// Row 2 - Lighter warm pastels
|
|
7780
7788
|
"#fef9c3",
|
|
7781
7789
|
"#fef3c7",
|
|
7782
7790
|
"#ffedd5",
|
|
7783
7791
|
"#fee2e2",
|
|
7784
7792
|
"#fce7f3",
|
|
7785
|
-
// Row 3
|
|
7793
|
+
// Row 3 - Cool highlights
|
|
7786
7794
|
"#a7f3d0",
|
|
7787
7795
|
"#99f6e4",
|
|
7788
7796
|
"#a5f3fc",
|
|
7789
7797
|
"#bfdbfe",
|
|
7790
7798
|
"#c4b5fd",
|
|
7791
|
-
// Row 4
|
|
7799
|
+
// Row 4 - Lighter cool pastels
|
|
7792
7800
|
"#d1fae5",
|
|
7793
7801
|
"#ccfbf1",
|
|
7794
7802
|
"#cffafe",
|
|
7795
7803
|
"#dbeafe",
|
|
7796
7804
|
"#ede9fe",
|
|
7797
|
-
// Row 5
|
|
7805
|
+
// Row 5 - Neutrals
|
|
7798
7806
|
"#e5e7eb",
|
|
7799
7807
|
"#d1d5db",
|
|
7800
7808
|
"#f3f4f6",
|