@milkdown/preset-commonmark 5.3.1 → 5.3.5
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/lib/index.d.ts +1 -34
- package/lib/index.es.js +105 -49
- package/lib/index.es.js.map +1 -1
- package/lib/src/index.d.ts +34 -0
- package/lib/src/index.d.ts.map +1 -0
- package/lib/{mark → src/mark}/code-inline.d.ts +1 -1
- package/lib/src/mark/code-inline.d.ts.map +1 -0
- package/lib/{mark → src/mark}/em.d.ts +1 -1
- package/lib/src/mark/em.d.ts.map +1 -0
- package/lib/src/mark/index.d.ts +6 -0
- package/lib/src/mark/index.d.ts.map +1 -0
- package/lib/{mark → src/mark}/link.d.ts +1 -1
- package/lib/src/mark/link.d.ts.map +1 -0
- package/lib/{mark → src/mark}/strong.d.ts +1 -1
- package/lib/src/mark/strong.d.ts.map +1 -0
- package/lib/{node → src/node}/blockquote.d.ts +1 -1
- package/lib/src/node/blockquote.d.ts.map +1 -0
- package/lib/{node → src/node}/bullet-list.d.ts +1 -1
- package/lib/src/node/bullet-list.d.ts.map +1 -0
- package/lib/{node → src/node}/code-fence.d.ts +1 -1
- package/lib/src/node/code-fence.d.ts.map +1 -0
- package/lib/{node → src/node}/doc.d.ts +1 -1
- package/lib/src/node/doc.d.ts.map +1 -0
- package/lib/{node → src/node}/hardbreak.d.ts +1 -1
- package/lib/src/node/hardbreak.d.ts.map +1 -0
- package/lib/{node → src/node}/heading.d.ts +3 -1
- package/lib/src/node/heading.d.ts.map +1 -0
- package/lib/{node → src/node}/hr.d.ts +1 -1
- package/lib/src/node/hr.d.ts.map +1 -0
- package/lib/{node → src/node}/image.d.ts +1 -1
- package/lib/src/node/image.d.ts.map +1 -0
- package/lib/{node → src/node}/index.d.ts +2 -2
- package/lib/src/node/index.d.ts.map +1 -0
- package/lib/{node → src/node}/list-item.d.ts +1 -1
- package/lib/src/node/list-item.d.ts.map +1 -0
- package/lib/{node → src/node}/ordered-list.d.ts +1 -1
- package/lib/src/node/ordered-list.d.ts.map +1 -0
- package/lib/{node → src/node}/paragraph.d.ts +1 -1
- package/lib/src/node/paragraph.d.ts.map +1 -0
- package/lib/{node → src/node}/text.d.ts +1 -1
- package/lib/src/node/text.d.ts.map +1 -0
- package/lib/{plugin → src/plugin}/filter-html.d.ts +0 -0
- package/lib/src/plugin/filter-html.d.ts.map +1 -0
- package/lib/src/plugin/index.d.ts +2 -0
- package/lib/src/plugin/index.d.ts.map +1 -0
- package/lib/{supported-keys.d.ts → src/supported-keys.d.ts} +0 -0
- package/lib/src/supported-keys.d.ts.map +1 -0
- package/lib/src/types.d.ts +5 -0
- package/package.json +7 -14
- package/src/mark/code-inline.ts +6 -7
- package/src/mark/link.ts +1 -2
- package/src/mark/strong.ts +1 -2
- package/src/node/blockquote.ts +1 -2
- package/src/node/bullet-list.ts +1 -1
- package/src/node/code-fence.ts +3 -4
- package/src/node/heading.ts +74 -25
- package/src/node/hr.ts +1 -2
- package/src/node/image.ts +12 -5
- package/src/node/list-item.ts +1 -2
- package/src/node/ordered-list.ts +1 -1
- package/src/node/paragraph.ts +8 -9
- package/lib/index.d.ts.map +0 -1
- package/lib/mark/code-inline.d.ts.map +0 -1
- package/lib/mark/em.d.ts.map +0 -1
- package/lib/mark/index.d.ts +0 -6
- package/lib/mark/index.d.ts.map +0 -1
- package/lib/mark/link.d.ts.map +0 -1
- package/lib/mark/strong.d.ts.map +0 -1
- package/lib/node/blockquote.d.ts.map +0 -1
- package/lib/node/bullet-list.d.ts.map +0 -1
- package/lib/node/code-fence.d.ts.map +0 -1
- package/lib/node/doc.d.ts.map +0 -1
- package/lib/node/hardbreak.d.ts.map +0 -1
- package/lib/node/heading.d.ts.map +0 -1
- package/lib/node/hr.d.ts.map +0 -1
- package/lib/node/image.d.ts.map +0 -1
- package/lib/node/index.d.ts.map +0 -1
- package/lib/node/list-item.d.ts.map +0 -1
- package/lib/node/ordered-list.d.ts.map +0 -1
- package/lib/node/paragraph.d.ts.map +0 -1
- package/lib/node/text.d.ts.map +0 -1
- package/lib/plugin/filter-html.d.ts.map +0 -1
- package/lib/plugin/index.d.ts +0 -2
- package/lib/plugin/index.d.ts.map +0 -1
- package/lib/supported-keys.d.ts.map +0 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,34 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { commonmarkPlugins } from './plugin';
|
|
3
|
-
export * from './mark';
|
|
4
|
-
export * from './node';
|
|
5
|
-
export * from './supported-keys';
|
|
6
|
-
export declare const commonmarkNodes: AtomList<(import("@milkdown/utils/lib/types").Metadata<import("@milkdown/utils/lib/types").GetPlugin<"CodeFence", {
|
|
7
|
-
languageList?: string[] | undefined;
|
|
8
|
-
}>> & import("@milkdown/core").MilkdownPlugin) | (import("@milkdown/utils/lib/types").Metadata<import("@milkdown/utils/lib/types").GetPlugin<string, import("./node").ImageOptions>> & import("@milkdown/core").MilkdownPlugin)>;
|
|
9
|
-
export { commonmarkPlugins };
|
|
10
|
-
export declare const commonmark: AtomList<(import("@milkdown/utils/lib/types").Metadata<import("@milkdown/utils/lib/types").GetPlugin<"CodeFence", {
|
|
11
|
-
languageList?: string[] | undefined;
|
|
12
|
-
}>> & import("@milkdown/core").MilkdownPlugin) | (import("@milkdown/utils/lib/types").Metadata<import("@milkdown/utils/lib/types").GetPlugin<string, import("./node").ImageOptions>> & import("@milkdown/core").MilkdownPlugin)>;
|
|
13
|
-
export declare const commands: {
|
|
14
|
-
readonly ToggleInlineCode: import("@milkdown/core").CmdKey<undefined>;
|
|
15
|
-
readonly ToggleItalic: import("@milkdown/core").CmdKey<undefined>;
|
|
16
|
-
readonly ToggleLink: import("@milkdown/core").CmdKey<string>;
|
|
17
|
-
readonly ToggleBold: import("@milkdown/core").CmdKey<undefined>;
|
|
18
|
-
readonly ModifyLink: import("@milkdown/core").CmdKey<string>;
|
|
19
|
-
readonly ModifyImage: import("@milkdown/core").CmdKey<string>;
|
|
20
|
-
readonly WrapInBlockquote: import("@milkdown/core").CmdKey<undefined>;
|
|
21
|
-
readonly WrapInBulletList: import("@milkdown/core").CmdKey<undefined>;
|
|
22
|
-
readonly WrapInOrderedList: import("@milkdown/core").CmdKey<undefined>;
|
|
23
|
-
readonly TurnIntoCodeFence: import("@milkdown/core").CmdKey<undefined>;
|
|
24
|
-
readonly TurnIntoHeading: import("@milkdown/core").CmdKey<number>;
|
|
25
|
-
readonly TurnIntoText: import("@milkdown/core").CmdKey<undefined>;
|
|
26
|
-
readonly InsertHardbreak: import("@milkdown/core").CmdKey<undefined>;
|
|
27
|
-
readonly InsertHr: import("@milkdown/core").CmdKey<string>;
|
|
28
|
-
readonly InsertImage: import("@milkdown/core").CmdKey<string>;
|
|
29
|
-
readonly SplitListItem: import("@milkdown/core").CmdKey<undefined>;
|
|
30
|
-
readonly SinkListItem: import("@milkdown/core").CmdKey<undefined>;
|
|
31
|
-
readonly LiftListItem: import("@milkdown/core").CmdKey<undefined>;
|
|
32
|
-
};
|
|
33
|
-
export declare type Commands = typeof commands;
|
|
34
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export * from './src/index'
|
package/lib/index.es.js
CHANGED
|
@@ -18,7 +18,6 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import { createMark, createShortcut, createNode, createPlugin, AtomList } from "@milkdown/utils";
|
|
21
|
-
import { css } from "@emotion/css";
|
|
22
21
|
import { createCmdKey, createCmd, schemaCtx, themeToolCtx } from "@milkdown/core";
|
|
23
22
|
import { markRule, toggleMark, TextSelection, InputRule, wrappingInputRule, wrapIn, textblockTypeInputRule, setBlockType, Plugin, PluginKey, ReplaceStep, AddMarkStep, Selection, findSelectedNodeOfType, splitListItem, sinkListItem, liftListItem } from "@milkdown/prose";
|
|
24
23
|
import links from "remark-inline-links";
|
|
@@ -45,7 +44,7 @@ const SupportedKeys = {
|
|
|
45
44
|
const id$a = "code_inline";
|
|
46
45
|
const ToggleInlineCode = createCmdKey();
|
|
47
46
|
const codeInline = createMark((utils) => {
|
|
48
|
-
const style = utils.getStyle(({ palette, size, font }) => css`
|
|
47
|
+
const style = utils.getStyle(({ palette, size, font }, { css }) => css`
|
|
49
48
|
background-color: ${palette("neutral")};
|
|
50
49
|
color: ${palette("background")};
|
|
51
50
|
border-radius: ${size.radius};
|
|
@@ -56,7 +55,9 @@ const codeInline = createMark((utils) => {
|
|
|
56
55
|
return {
|
|
57
56
|
id: id$a,
|
|
58
57
|
schema: () => ({
|
|
59
|
-
|
|
58
|
+
priority: 100,
|
|
59
|
+
code: true,
|
|
60
|
+
inclusive: false,
|
|
60
61
|
parseDOM: [{ tag: "code" }],
|
|
61
62
|
toDOM: (mark) => ["code", { class: utils.getClassName(mark.attrs, "code-inline", style) }],
|
|
62
63
|
parseMarkdown: {
|
|
@@ -69,9 +70,8 @@ const codeInline = createMark((utils) => {
|
|
|
69
70
|
},
|
|
70
71
|
toMarkdown: {
|
|
71
72
|
match: (mark) => mark.type.name === id$a,
|
|
72
|
-
runner: (state,
|
|
73
|
-
state.
|
|
74
|
-
return true;
|
|
73
|
+
runner: (state, mark, node) => {
|
|
74
|
+
state.withMark(mark, "inlineCode", node.text || "");
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}),
|
|
@@ -121,7 +121,7 @@ const ToggleLink = createCmdKey();
|
|
|
121
121
|
const ModifyLink = createCmdKey();
|
|
122
122
|
const id$8 = "link";
|
|
123
123
|
const link = createMark((utils) => {
|
|
124
|
-
const style = utils.getStyle((themeTool) => {
|
|
124
|
+
const style = utils.getStyle((themeTool, { css }) => {
|
|
125
125
|
const lineColor = themeTool.palette("line");
|
|
126
126
|
return css`
|
|
127
127
|
color: ${themeTool.palette("secondary")};
|
|
@@ -220,7 +220,7 @@ const link = createMark((utils) => {
|
|
|
220
220
|
const id$7 = "strong";
|
|
221
221
|
const ToggleBold = createCmdKey();
|
|
222
222
|
const strong = createMark((utils) => {
|
|
223
|
-
const style = utils.getStyle(() => css`
|
|
223
|
+
const style = utils.getStyle((_, { css }) => css`
|
|
224
224
|
font-weight: 600;
|
|
225
225
|
`);
|
|
226
226
|
return {
|
|
@@ -261,7 +261,7 @@ const marks = [codeInline(), em(), strong(), link()];
|
|
|
261
261
|
const id$6 = "blockquote";
|
|
262
262
|
const WrapInBlockquote = createCmdKey();
|
|
263
263
|
const blockquote = createNode((utils) => {
|
|
264
|
-
const style = utils.getStyle((themeTool) => css`
|
|
264
|
+
const style = utils.getStyle((themeTool, { css }) => css`
|
|
265
265
|
padding-left: 1.875rem;
|
|
266
266
|
line-height: 1.75rem;
|
|
267
267
|
border-left: 4px solid ${themeTool.palette("primary")};
|
|
@@ -326,7 +326,7 @@ const bulletList = createNode((utils) => {
|
|
|
326
326
|
inputRules: (nodeType) => [wrappingInputRule(/^\s*([-+*])\s$/, nodeType)],
|
|
327
327
|
commands: (nodeType) => [createCmd(WrapInBulletList, () => wrapIn(nodeType))],
|
|
328
328
|
shortcuts: {
|
|
329
|
-
[SupportedKeys.BulletList]: createShortcut(WrapInBulletList, "Mod-
|
|
329
|
+
[SupportedKeys.BulletList]: createShortcut(WrapInBulletList, "Mod-Alt-8")
|
|
330
330
|
}
|
|
331
331
|
};
|
|
332
332
|
});
|
|
@@ -353,7 +353,7 @@ const tildeInputRegex = /^~~~(?<language>[a-z]*)?[\s\n]$/;
|
|
|
353
353
|
const TurnIntoCodeFence = createCmdKey();
|
|
354
354
|
const id$5 = "fence";
|
|
355
355
|
const codeFence = createNode((utils, options) => {
|
|
356
|
-
const style = utils.getStyle(({ palette, mixin, size, font }) => {
|
|
356
|
+
const style = utils.getStyle(({ palette, mixin, size, font }, { css }) => {
|
|
357
357
|
const { shadow, scrollbar, border } = mixin;
|
|
358
358
|
const { lineWidth, radius } = size;
|
|
359
359
|
return css`
|
|
@@ -489,12 +489,12 @@ const codeFence = createNode((utils, options) => {
|
|
|
489
489
|
],
|
|
490
490
|
toDOM: (node) => {
|
|
491
491
|
return [
|
|
492
|
-
"
|
|
492
|
+
"pre",
|
|
493
493
|
{
|
|
494
494
|
"data-language": node.attrs.language,
|
|
495
495
|
class: utils.getClassName(node.attrs, "code-fence", style)
|
|
496
496
|
},
|
|
497
|
-
["
|
|
497
|
+
["code", { spellCheck: "false" }, 0]
|
|
498
498
|
];
|
|
499
499
|
},
|
|
500
500
|
parseMarkdown: {
|
|
@@ -710,27 +710,42 @@ const hardbreak = createNode((utils) => {
|
|
|
710
710
|
});
|
|
711
711
|
const headingIndex = Array(6).fill(0).map((_, i) => i + 1);
|
|
712
712
|
const TurnIntoHeading = createCmdKey();
|
|
713
|
-
const
|
|
713
|
+
const headingPluginKey = new PluginKey("MILKDOWN_PLUGIN_ID");
|
|
714
|
+
const heading = createNode((utils) => {
|
|
714
715
|
const id2 = "heading";
|
|
715
|
-
const
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
716
|
+
const style = (level) => utils.getStyle((_, { css }) => {
|
|
717
|
+
const headingMap = {
|
|
718
|
+
1: css`
|
|
719
|
+
font-size: 3rem;
|
|
720
|
+
line-height: 3.5rem;
|
|
721
|
+
`,
|
|
722
|
+
2: css`
|
|
723
|
+
font-size: 2.5rem;
|
|
724
|
+
line-height: 3rem;
|
|
725
|
+
`,
|
|
726
|
+
3: css`
|
|
727
|
+
font-size: 2.125rem;
|
|
728
|
+
line-height: 2.25rem;
|
|
729
|
+
`,
|
|
730
|
+
4: css`
|
|
731
|
+
font-size: 1.75rem;
|
|
732
|
+
line-height: 2rem;
|
|
733
|
+
`,
|
|
734
|
+
5: css`
|
|
735
|
+
font-size: 1.5rem;
|
|
736
|
+
line-height: 1.5rem;
|
|
737
|
+
`,
|
|
738
|
+
6: css`
|
|
739
|
+
font-size: 1.25rem;
|
|
740
|
+
line-height: 1.25rem;
|
|
741
|
+
`
|
|
742
|
+
};
|
|
743
|
+
return css`
|
|
744
|
+
${headingMap[level] || ""}
|
|
745
|
+
margin: 2.5rem 0 !important;
|
|
746
|
+
font-weight: 400;
|
|
747
|
+
`;
|
|
748
|
+
});
|
|
734
749
|
return {
|
|
735
750
|
id: id2,
|
|
736
751
|
schema: () => ({
|
|
@@ -738,15 +753,27 @@ const heading = createNode((utils, options) => {
|
|
|
738
753
|
group: "block",
|
|
739
754
|
defining: true,
|
|
740
755
|
attrs: {
|
|
756
|
+
id: {
|
|
757
|
+
default: ""
|
|
758
|
+
},
|
|
741
759
|
level: {
|
|
742
760
|
default: 1
|
|
743
761
|
}
|
|
744
762
|
},
|
|
745
|
-
parseDOM: headingIndex.map((x) => ({
|
|
763
|
+
parseDOM: headingIndex.map((x) => ({
|
|
764
|
+
tag: `h${x}`,
|
|
765
|
+
getAttrs: (node) => {
|
|
766
|
+
if (!(node instanceof HTMLElement)) {
|
|
767
|
+
throw new Error();
|
|
768
|
+
}
|
|
769
|
+
return { level: x, id: node.id };
|
|
770
|
+
}
|
|
771
|
+
})),
|
|
746
772
|
toDOM: (node) => {
|
|
747
773
|
return [
|
|
748
774
|
`h${node.attrs.level}`,
|
|
749
775
|
{
|
|
776
|
+
id: node.attrs.id || node.textContent.split(" ").join("-").toLocaleLowerCase(),
|
|
750
777
|
class: utils.getClassName(node.attrs, `heading h${node.attrs.level}`, style(node.attrs.level))
|
|
751
778
|
},
|
|
752
779
|
0
|
|
@@ -781,13 +808,34 @@ const heading = createNode((utils, options) => {
|
|
|
781
808
|
[SupportedKeys.H4]: createShortcut(TurnIntoHeading, "Mod-Alt-4", 4),
|
|
782
809
|
[SupportedKeys.H5]: createShortcut(TurnIntoHeading, "Mod-Alt-5", 5),
|
|
783
810
|
[SupportedKeys.H6]: createShortcut(TurnIntoHeading, "Mod-Alt-6", 6)
|
|
784
|
-
}
|
|
811
|
+
},
|
|
812
|
+
prosePlugins: (type) => [
|
|
813
|
+
new Plugin({
|
|
814
|
+
key: headingPluginKey,
|
|
815
|
+
appendTransaction: (transactions, _, nextState) => {
|
|
816
|
+
const tr = nextState.tr;
|
|
817
|
+
let modified = false;
|
|
818
|
+
if (transactions.some((transaction) => transaction.docChanged)) {
|
|
819
|
+
nextState.doc.descendants((node, pos) => {
|
|
820
|
+
if (node.type === type) {
|
|
821
|
+
const attrs = node.attrs;
|
|
822
|
+
tr.setNodeMarkup(pos, void 0, __spreadProps(__spreadValues({}, attrs), {
|
|
823
|
+
id: node.textContent.split(" ").join("-").toLocaleLowerCase()
|
|
824
|
+
}));
|
|
825
|
+
modified = true;
|
|
826
|
+
}
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
return modified ? tr : null;
|
|
830
|
+
}
|
|
831
|
+
})
|
|
832
|
+
]
|
|
785
833
|
};
|
|
786
834
|
});
|
|
787
835
|
const id$4 = "hr";
|
|
788
836
|
const InsertHr = createCmdKey();
|
|
789
837
|
const hr = createNode((utils) => {
|
|
790
|
-
const style = utils.getStyle((themeTool) => css`
|
|
838
|
+
const style = utils.getStyle((themeTool, { css }) => css`
|
|
791
839
|
height: ${themeTool.size.lineWidth};
|
|
792
840
|
background-color: ${themeTool.palette("line")};
|
|
793
841
|
border-width: 0;
|
|
@@ -852,7 +900,7 @@ const image = createNode((utils, options) => {
|
|
|
852
900
|
failed: "Image loads failed"
|
|
853
901
|
}, (_a = options == null ? void 0 : options.placeholder) != null ? _a : {});
|
|
854
902
|
const isBlock = (_b = options == null ? void 0 : options.isBlock) != null ? _b : false;
|
|
855
|
-
const containerStyle = utils.getStyle((themeTool) => css`
|
|
903
|
+
const containerStyle = utils.getStyle((themeTool, { css }) => css`
|
|
856
904
|
display: inline-block;
|
|
857
905
|
position: relative;
|
|
858
906
|
text-align: center;
|
|
@@ -944,7 +992,7 @@ const image = createNode((utils, options) => {
|
|
|
944
992
|
}
|
|
945
993
|
}
|
|
946
994
|
`);
|
|
947
|
-
const style = utils.getStyle(() => css`
|
|
995
|
+
const style = utils.getStyle((_, { css }) => css`
|
|
948
996
|
display: inline-block;
|
|
949
997
|
margin: 0 auto;
|
|
950
998
|
object-fit: contain;
|
|
@@ -1076,8 +1124,11 @@ const image = createNode((utils, options) => {
|
|
|
1076
1124
|
const img = document.createElement("img");
|
|
1077
1125
|
img.src = src2;
|
|
1078
1126
|
img.onerror = () => {
|
|
1127
|
+
const pos = getPos();
|
|
1128
|
+
if (!pos)
|
|
1129
|
+
return;
|
|
1079
1130
|
const { tr } = view.state;
|
|
1080
|
-
const _tr = tr.setNodeMarkup(
|
|
1131
|
+
const _tr = tr.setNodeMarkup(pos, nodeType, __spreadProps(__spreadValues({}, node.attrs), {
|
|
1081
1132
|
src: src2,
|
|
1082
1133
|
loading: false,
|
|
1083
1134
|
failed: true
|
|
@@ -1086,7 +1137,10 @@ const image = createNode((utils, options) => {
|
|
|
1086
1137
|
};
|
|
1087
1138
|
img.onload = () => {
|
|
1088
1139
|
const { tr } = view.state;
|
|
1089
|
-
const
|
|
1140
|
+
const pos = getPos();
|
|
1141
|
+
if (!pos)
|
|
1142
|
+
return;
|
|
1143
|
+
const _tr = tr.setNodeMarkup(pos, nodeType, __spreadProps(__spreadValues({}, node.attrs), {
|
|
1090
1144
|
width: img.width,
|
|
1091
1145
|
src: src2,
|
|
1092
1146
|
loading: false,
|
|
@@ -1153,7 +1207,7 @@ const SplitListItem = createCmdKey();
|
|
|
1153
1207
|
const SinkListItem = createCmdKey();
|
|
1154
1208
|
const LiftListItem = createCmdKey();
|
|
1155
1209
|
const listItem = createNode((utils) => {
|
|
1156
|
-
const style = utils.getStyle((themeTool) => css`
|
|
1210
|
+
const style = utils.getStyle((themeTool, { css }) => css`
|
|
1157
1211
|
&,
|
|
1158
1212
|
& > * {
|
|
1159
1213
|
margin: 0.5rem 0;
|
|
@@ -1254,17 +1308,19 @@ const orderedList = createNode((utils) => ({
|
|
|
1254
1308
|
],
|
|
1255
1309
|
commands: (nodeType) => [createCmd(WrapInOrderedList, () => wrapIn(nodeType))],
|
|
1256
1310
|
shortcuts: {
|
|
1257
|
-
[SupportedKeys.OrderedList]: createShortcut(WrapInOrderedList, "Mod-
|
|
1311
|
+
[SupportedKeys.OrderedList]: createShortcut(WrapInOrderedList, "Mod-Alt-7")
|
|
1258
1312
|
}
|
|
1259
1313
|
}));
|
|
1260
1314
|
const TurnIntoText = createCmdKey();
|
|
1261
1315
|
const id = "paragraph";
|
|
1262
|
-
const paragraph = createNode((utils
|
|
1263
|
-
const style = (
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1316
|
+
const paragraph = createNode((utils) => {
|
|
1317
|
+
const style = utils.getStyle((_, { css }) => {
|
|
1318
|
+
return css`
|
|
1319
|
+
font-size: 1rem;
|
|
1320
|
+
line-height: 1.5;
|
|
1321
|
+
letter-spacing: 0.5px;
|
|
1322
|
+
`;
|
|
1323
|
+
});
|
|
1268
1324
|
return {
|
|
1269
1325
|
id,
|
|
1270
1326
|
schema: () => ({
|
|
@@ -1389,5 +1445,5 @@ const commands = {
|
|
|
1389
1445
|
SinkListItem,
|
|
1390
1446
|
LiftListItem
|
|
1391
1447
|
};
|
|
1392
|
-
export { InsertHardbreak, InsertHr, InsertImage, LiftListItem, ModifyImage, ModifyLink, SinkListItem, SplitListItem, SupportedKeys, ToggleBold, ToggleInlineCode, ToggleItalic, ToggleLink, TurnIntoCodeFence, TurnIntoHeading, TurnIntoText, WrapInBlockquote, WrapInBulletList, WrapInOrderedList, backtickInputRegex, blockquote, bulletList, codeFence, codeInline, commands, commonmark, commonmarkNodes, commonmarkPlugins, doc, em, hardbreak, heading, hr, image, link, listItem, marks, nodes, orderedList, paragraph, strong, text, tildeInputRegex };
|
|
1448
|
+
export { InsertHardbreak, InsertHr, InsertImage, LiftListItem, ModifyImage, ModifyLink, SinkListItem, SplitListItem, SupportedKeys, ToggleBold, ToggleInlineCode, ToggleItalic, ToggleLink, TurnIntoCodeFence, TurnIntoHeading, TurnIntoText, WrapInBlockquote, WrapInBulletList, WrapInOrderedList, backtickInputRegex, blockquote, bulletList, codeFence, codeInline, commands, commonmark, commonmarkNodes, commonmarkPlugins, doc, em, hardbreak, heading, headingPluginKey, hr, image, link, listItem, marks, nodes, orderedList, paragraph, strong, text, tildeInputRegex };
|
|
1393
1449
|
//# sourceMappingURL=index.es.js.map
|