decap-cms-widget-markdown 3.3.0 → 3.4.1
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/CHANGELOG.md +10 -0
- package/dist/decap-cms-widget-markdown.js +6 -6
- package/dist/decap-cms-widget-markdown.js.LICENSE.txt +5 -5
- package/dist/decap-cms-widget-markdown.js.map +1 -1
- package/dist/esm/MarkdownControl/RawEditor.js +1 -2
- package/dist/esm/MarkdownControl/Toolbar.js +43 -47
- package/dist/esm/MarkdownControl/VisualEditor.js +6 -8
- package/dist/esm/MarkdownControl/components/Shortcode.js +6 -11
- package/dist/esm/MarkdownControl/components/VoidBlock.js +1 -1
- package/dist/esm/MarkdownControl/index.js +34 -34
- package/dist/esm/MarkdownControl/plugins/CommandsAndQueries.js +8 -8
- package/dist/esm/MarkdownControl/plugins/inlines/events/toggleLink.js +1 -2
- package/dist/esm/MarkdownControl/plugins/lists/events/keyDownShiftTab.js +6 -9
- package/dist/esm/MarkdownControl/plugins/lists/events/keyDownTab.js +3 -7
- package/dist/esm/MarkdownControl/plugins/lists/transforms/liftFirstMatchedParent.js +4 -8
- package/dist/esm/MarkdownControl/plugins/lists/transforms/unwrapSelectionFromList.js +3 -7
- package/dist/esm/MarkdownControl/plugins/util.js +4 -4
- package/dist/esm/MarkdownControl/renderers.js +6 -11
- package/dist/esm/MarkdownPreview.js +11 -10
- package/dist/esm/index.js +4 -8
- package/dist/esm/regexHelper.js +4 -3
- package/dist/esm/serializers/index.js +2 -2
- package/dist/esm/serializers/remarkAssertParents.js +17 -20
- package/dist/esm/serializers/remarkEscapeMarkdownEntities.js +17 -17
- package/dist/esm/serializers/remarkImagesToText.js +3 -7
- package/dist/esm/serializers/remarkPaddedLinks.js +17 -21
- package/dist/esm/serializers/remarkRehypeShortcodes.js +10 -13
- package/dist/esm/serializers/remarkSlate.js +64 -55
- package/dist/esm/serializers/remarkSquashReferences.js +7 -11
- package/dist/esm/serializers/slateRemark.js +52 -52
- package/package.json +9 -7
- package/src/MarkdownControl/Toolbar.js +5 -0
- package/src/MarkdownControl/VisualEditor.js +1 -1
- package/src/MarkdownControl/components/Shortcode.js +1 -1
- package/src/MarkdownControl/index.js +5 -0
- package/src/MarkdownControl/plugins/CommandsAndQueries.js +3 -1
- package/src/MarkdownControl/plugins/util.js +2 -1
- package/src/MarkdownPreview.js +5 -0
- package/src/__tests__/renderer.spec.js +84 -117
- package/src/regexHelper.js +1 -1
- package/src/serializers/__tests__/commonmark.spec.js +1 -1
- package/src/serializers/__tests__/slate.spec.js +1 -1
- package/src/serializers/index.js +1 -1
- package/src/serializers/remarkAssertParents.js +4 -1
- package/src/serializers/remarkEscapeMarkdownEntities.js +4 -1
- package/src/serializers/remarkPaddedLinks.js +7 -1
- package/src/serializers/remarkRehypeShortcodes.js +2 -1
- package/src/serializers/remarkSlate.js +6 -1
- package/src/serializers/remarkSquashReferences.js +2 -1
- package/src/serializers/slateRemark.js +6 -1
- package/src/__tests__/__snapshots__/renderer.spec.js.snap +0 -239
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "decap-cms-widget-markdown",
|
|
3
3
|
"description": "Widget for editing markdown in Decap CMS.",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.4.1",
|
|
5
5
|
"homepage": "https://www.decapcms.org/docs/widgets/#markdown",
|
|
6
6
|
"repository": "https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-widget-markdown",
|
|
7
7
|
"bugs": "https://github.com/decaporg/decap-cms/issues",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore \"**/__tests__\" --root-mode upward"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
+
"detab": "^2.0.4",
|
|
24
25
|
"dompurify": "^2.2.6",
|
|
25
26
|
"is-hotkey": "^0.2.0",
|
|
26
27
|
"is-url": "^1.2.4",
|
|
@@ -37,12 +38,14 @@
|
|
|
37
38
|
"slate": "^0.91.1",
|
|
38
39
|
"slate-base64-serializer": "^0.2.107",
|
|
39
40
|
"slate-history": "^0.93.0",
|
|
41
|
+
"slate-hyperscript": "^0.77.0",
|
|
40
42
|
"slate-plain-serializer": "^0.7.1",
|
|
41
43
|
"slate-react": "^0.91.2",
|
|
42
44
|
"slate-soft-break": "^0.9.0",
|
|
43
45
|
"unified": "^9.2.0",
|
|
44
46
|
"unist-builder": "^1.0.3",
|
|
45
|
-
"unist-util-visit-parents": "^2.0.1"
|
|
47
|
+
"unist-util-visit-parents": "^2.0.1",
|
|
48
|
+
"vfile-location": "^2.0.6"
|
|
46
49
|
},
|
|
47
50
|
"peerDependencies": {
|
|
48
51
|
"@emotion/react": "^11.11.1",
|
|
@@ -51,14 +54,13 @@
|
|
|
51
54
|
"immutable": "^3.7.6",
|
|
52
55
|
"lodash": "^4.17.11",
|
|
53
56
|
"prop-types": "^15.7.2",
|
|
54
|
-
"react": "^
|
|
55
|
-
"react-dom": "^
|
|
57
|
+
"react": "^19.1.0",
|
|
58
|
+
"react-dom": "^19.1.0",
|
|
56
59
|
"react-immutable-proptypes": "^2.1.0"
|
|
57
60
|
},
|
|
58
61
|
"devDependencies": {
|
|
59
62
|
"commonmark": "^0.30.0",
|
|
60
|
-
"commonmark-spec": "^0.30.0"
|
|
61
|
-
"slate-hyperscript": "^0.77.0"
|
|
63
|
+
"commonmark-spec": "^0.30.0"
|
|
62
64
|
},
|
|
63
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "bfe122aee875ceaaf9f132110db7f8797eedfc5b"
|
|
64
66
|
}
|
|
@@ -80,6 +80,11 @@ export default class Toolbar extends React.Component {
|
|
|
80
80
|
t: PropTypes.func.isRequired,
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
componentDidMount() {
|
|
84
|
+
// Manually validate PropTypes - React 19 breaking change
|
|
85
|
+
PropTypes.checkPropTypes(Toolbar.propTypes, this.props, 'prop', 'Toolbar');
|
|
86
|
+
}
|
|
87
|
+
|
|
83
88
|
isVisible = button => {
|
|
84
89
|
const { buttons } = this.props;
|
|
85
90
|
return !List.isList(buttons) || buttons.includes(button);
|
|
@@ -9,7 +9,7 @@ import { createEditor, Transforms, Editor as SlateEditor } from 'slate';
|
|
|
9
9
|
import { Editable, ReactEditor, Slate, withReact } from 'slate-react';
|
|
10
10
|
import { withHistory } from 'slate-history';
|
|
11
11
|
import { fromJS } from 'immutable';
|
|
12
|
-
import
|
|
12
|
+
import isEqual from 'lodash/isEqual';
|
|
13
13
|
|
|
14
14
|
import { editorStyleVars, EditorControlBar } from '../styles';
|
|
15
15
|
import Toolbar from './Toolbar';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { fromJS } from 'immutable';
|
|
5
|
-
import
|
|
5
|
+
import omit from 'lodash/omit';
|
|
6
6
|
import { ReactEditor, useSlate } from 'slate-react';
|
|
7
7
|
import { Range, Transforms } from 'slate';
|
|
8
8
|
|
|
@@ -54,6 +54,11 @@ export default class MarkdownControl extends React.Component {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
componentDidMount() {
|
|
58
|
+
// Manually validate PropTypes - React 19 breaking change
|
|
59
|
+
PropTypes.checkPropTypes(MarkdownControl.propTypes, this.props, 'prop', 'MarkdownControl');
|
|
60
|
+
}
|
|
61
|
+
|
|
57
62
|
handleMode = mode => {
|
|
58
63
|
this.setState({ mode, pendingFocus: true });
|
|
59
64
|
localStorage.setItem(MODE_STORAGE_KEY, mode);
|
package/src/MarkdownPreview.js
CHANGED
|
@@ -11,6 +11,11 @@ class MarkdownPreview extends React.Component {
|
|
|
11
11
|
value: PropTypes.string,
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
+
componentDidMount() {
|
|
15
|
+
// Manually validate PropTypes - React 19 breaking change
|
|
16
|
+
PropTypes.checkPropTypes(MarkdownPreview.propTypes, this.props, 'prop', 'MarkdownPreview');
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
render() {
|
|
15
20
|
const { value, getAsset, resolveWidget, field, getRemarkPlugins } = this.props;
|
|
16
21
|
if (value === null) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import padStart from 'lodash/padStart';
|
|
4
4
|
import { Map } from 'immutable';
|
|
5
5
|
|
|
6
6
|
import MarkdownPreview from '../MarkdownPreview';
|
|
@@ -40,14 +40,21 @@ Text with **bold** & _em_ elements
|
|
|
40
40
|
`;
|
|
41
41
|
const html = await markdownToHtml(value);
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
expect(
|
|
43
|
+
const { container } = render(
|
|
44
|
+
<MarkdownPreview value={html} getAsset={jest.fn()} resolveWidget={jest.fn()} />,
|
|
45
|
+
);
|
|
46
|
+
expect(screen.getByRole('heading', { level: 1 })).toHaveTextContent('H1');
|
|
47
|
+
expect(screen.getByRole('heading', { level: 2 })).toHaveTextContent('H2');
|
|
48
|
+
expect(screen.getByRole('heading', { level: 3 })).toHaveTextContent('H3');
|
|
49
|
+
expect(screen.getByRole('heading', { level: 4 })).toHaveTextContent('H4');
|
|
50
|
+
expect(screen.getByRole('heading', { level: 5 })).toHaveTextContent('H5');
|
|
51
|
+
expect(screen.getByRole('heading', { level: 6 })).toHaveTextContent('H6');
|
|
52
|
+
expect(container).toHaveTextContent('Text with bold & em elements');
|
|
53
|
+
expect(screen.getByRole('link', { name: 'link title' })).toHaveAttribute(
|
|
54
|
+
'href',
|
|
55
|
+
'http://google.com',
|
|
56
|
+
);
|
|
57
|
+
expect(screen.getAllByRole('img').length).toBe(2);
|
|
51
58
|
});
|
|
52
59
|
});
|
|
53
60
|
|
|
@@ -57,14 +64,8 @@ Text with **bold** & _em_ elements
|
|
|
57
64
|
const value = padStart(' Title', heading + 7, '#');
|
|
58
65
|
const html = await markdownToHtml(value);
|
|
59
66
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
root = create(
|
|
63
|
-
<MarkdownPreview value={html} getAsset={jest.fn()} resolveWidget={jest.fn()} />,
|
|
64
|
-
);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
expect(root.toJSON()).toMatchSnapshot();
|
|
67
|
+
render(<MarkdownPreview value={html} getAsset={jest.fn()} resolveWidget={jest.fn()} />);
|
|
68
|
+
expect(screen.getByRole('heading', { level: heading + 1 })).toHaveTextContent('Title');
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
71
|
});
|
|
@@ -84,39 +85,15 @@ Text with **bold** & _em_ elements
|
|
|
84
85
|
`;
|
|
85
86
|
const html = await markdownToHtml(value);
|
|
86
87
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
expect(
|
|
95
|
-
.
|
|
96
|
-
margin: 15px 2px;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
<div
|
|
100
|
-
className="emotion-0 emotion-1"
|
|
101
|
-
dangerouslySetInnerHTML={
|
|
102
|
-
Object {
|
|
103
|
-
"__html": "<ol>
|
|
104
|
-
<li>ol item 1</li>
|
|
105
|
-
<li>ol item 2<ul>
|
|
106
|
-
<li>Sublist 1</li>
|
|
107
|
-
<li>Sublist 2</li>
|
|
108
|
-
<li>Sublist 3<ol>
|
|
109
|
-
<li>Sub-Sublist 1</li>
|
|
110
|
-
<li>Sub-Sublist 2</li>
|
|
111
|
-
<li>Sub-Sublist 3</li>
|
|
112
|
-
</ol></li>
|
|
113
|
-
</ul></li>
|
|
114
|
-
<li>ol item 3</li>
|
|
115
|
-
</ol>",
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
/>
|
|
119
|
-
`);
|
|
88
|
+
const { container } = render(
|
|
89
|
+
<MarkdownPreview value={html} getAsset={jest.fn()} resolveWidget={jest.fn()} />,
|
|
90
|
+
);
|
|
91
|
+
// Check for ordered and unordered lists
|
|
92
|
+
expect(container.querySelectorAll('ol').length).toBeGreaterThan(0);
|
|
93
|
+
expect(container.querySelectorAll('ul').length).toBeGreaterThan(0);
|
|
94
|
+
expect(screen.getByText('ol item 1')).toBeInTheDocument();
|
|
95
|
+
expect(screen.getByText('Sublist 1')).toBeInTheDocument();
|
|
96
|
+
expect(screen.getByText('Sub-Sublist 1')).toBeInTheDocument();
|
|
120
97
|
});
|
|
121
98
|
});
|
|
122
99
|
|
|
@@ -131,14 +108,19 @@ I get 10 times more traffic from [Google] than from [Yahoo] or [MSN].
|
|
|
131
108
|
`;
|
|
132
109
|
const html = await markdownToHtml(value);
|
|
133
110
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
})
|
|
140
|
-
|
|
141
|
-
|
|
111
|
+
render(<MarkdownPreview value={html} getAsset={jest.fn()} resolveWidget={jest.fn()} />);
|
|
112
|
+
expect(screen.getByRole('link', { name: 'Google' })).toHaveAttribute(
|
|
113
|
+
'href',
|
|
114
|
+
'http://google.com/',
|
|
115
|
+
);
|
|
116
|
+
expect(screen.getByRole('link', { name: 'Yahoo' })).toHaveAttribute(
|
|
117
|
+
'href',
|
|
118
|
+
'http://search.yahoo.com/',
|
|
119
|
+
);
|
|
120
|
+
expect(screen.getByRole('link', { name: 'MSN' })).toHaveAttribute(
|
|
121
|
+
'href',
|
|
122
|
+
'http://search.msn.com/',
|
|
123
|
+
);
|
|
142
124
|
});
|
|
143
125
|
});
|
|
144
126
|
|
|
@@ -147,28 +129,22 @@ I get 10 times more traffic from [Google] than from [Yahoo] or [MSN].
|
|
|
147
129
|
const value = 'Use the `printf()` function.';
|
|
148
130
|
const html = await markdownToHtml(value);
|
|
149
131
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
);
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
expect(root.toJSON()).toMatchSnapshot();
|
|
132
|
+
const { container } = render(
|
|
133
|
+
<MarkdownPreview value={html} getAsset={jest.fn()} resolveWidget={jest.fn()} />,
|
|
134
|
+
);
|
|
135
|
+
expect(container.querySelector('code')).toHaveTextContent('printf()');
|
|
158
136
|
});
|
|
159
137
|
|
|
160
138
|
it('should render code 2', async () => {
|
|
161
139
|
const value = '``There is a literal backtick (`) here.``';
|
|
162
140
|
const html = await markdownToHtml(value);
|
|
163
141
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
)
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
expect(root.toJSON()).toMatchSnapshot();
|
|
142
|
+
const { container } = render(
|
|
143
|
+
<MarkdownPreview value={html} getAsset={jest.fn()} resolveWidget={jest.fn()} />,
|
|
144
|
+
);
|
|
145
|
+
expect(container.querySelector('code')).toHaveTextContent(
|
|
146
|
+
'There is a literal backtick (`) here.',
|
|
147
|
+
);
|
|
172
148
|
});
|
|
173
149
|
});
|
|
174
150
|
|
|
@@ -191,14 +167,12 @@ I get 10 times more traffic from [Google] than from [Yahoo] or [MSN].
|
|
|
191
167
|
`;
|
|
192
168
|
const html = await markdownToHtml(value);
|
|
193
169
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
expect(root.toJSON()).toMatchSnapshot();
|
|
170
|
+
const { container } = render(
|
|
171
|
+
<MarkdownPreview value={html} getAsset={jest.fn()} resolveWidget={jest.fn()} />,
|
|
172
|
+
);
|
|
173
|
+
expect(container.querySelector('form')).toBeInTheDocument();
|
|
174
|
+
expect(container.querySelector('dl')).toBeInTheDocument();
|
|
175
|
+
expect(container.querySelector('h1[style]')).toHaveTextContent('Test');
|
|
202
176
|
});
|
|
203
177
|
});
|
|
204
178
|
});
|
|
@@ -208,14 +182,11 @@ I get 10 times more traffic from [Google] than from [Yahoo] or [MSN].
|
|
|
208
182
|
const value = '<p>Paragraph with <em>inline</em> element</p>';
|
|
209
183
|
const html = await markdownToHtml(value);
|
|
210
184
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
expect(root.toJSON()).toMatchSnapshot();
|
|
185
|
+
const { container } = render(
|
|
186
|
+
<MarkdownPreview value={html} getAsset={jest.fn()} resolveWidget={jest.fn()} />,
|
|
187
|
+
);
|
|
188
|
+
expect(container.querySelector('p')).toHaveTextContent('Paragraph with inline element');
|
|
189
|
+
expect(container.querySelector('em')).toHaveTextContent('inline');
|
|
219
190
|
});
|
|
220
191
|
});
|
|
221
192
|
|
|
@@ -224,38 +195,34 @@ I get 10 times more traffic from [Google] than from [Yahoo] or [MSN].
|
|
|
224
195
|
const value = `<img src="foobar.png" onerror="alert('hello')">`;
|
|
225
196
|
const field = Map({ sanitize_preview: true });
|
|
226
197
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
expect(root.toJSON()).toMatchSnapshot();
|
|
198
|
+
const { container } = render(
|
|
199
|
+
<MarkdownPreview
|
|
200
|
+
value={value}
|
|
201
|
+
getAsset={jest.fn()}
|
|
202
|
+
resolveWidget={jest.fn()}
|
|
203
|
+
field={field}
|
|
204
|
+
/>,
|
|
205
|
+
);
|
|
206
|
+
const img = container.querySelector('img');
|
|
207
|
+
expect(img).toHaveAttribute('src', 'foobar.png');
|
|
208
|
+
expect(img).not.toHaveAttribute('onerror');
|
|
240
209
|
});
|
|
241
210
|
|
|
242
211
|
it('should not sanitize HTML', async () => {
|
|
243
212
|
const value = `<img src="foobar.png" onerror="alert('hello')">`;
|
|
244
213
|
const field = Map({ sanitize_preview: false });
|
|
245
214
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
expect(root.toJSON()).toMatchSnapshot();
|
|
215
|
+
const { container } = render(
|
|
216
|
+
<MarkdownPreview
|
|
217
|
+
value={value}
|
|
218
|
+
getAsset={jest.fn()}
|
|
219
|
+
resolveWidget={jest.fn()}
|
|
220
|
+
field={field}
|
|
221
|
+
/>,
|
|
222
|
+
);
|
|
223
|
+
const img = container.querySelector('img');
|
|
224
|
+
expect(img).toHaveAttribute('src', 'foobar.png');
|
|
225
|
+
expect(img).toHaveAttribute('onerror', "alert('hello')");
|
|
259
226
|
});
|
|
260
227
|
});
|
|
261
228
|
});
|
package/src/regexHelper.js
CHANGED
package/src/serializers/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import has from 'lodash/has';
|
|
2
|
+
import flow from 'lodash/flow';
|
|
3
|
+
import partial from 'lodash/partial';
|
|
4
|
+
import map from 'lodash/map';
|
|
2
5
|
|
|
3
6
|
import { joinPatternSegments, combinePatterns, replaceWhen } from '../regexHelper';
|
|
4
7
|
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import find from 'lodash/find';
|
|
2
|
+
import findLast from 'lodash/findLast';
|
|
3
|
+
import startsWith from 'lodash/startsWith';
|
|
4
|
+
import endsWith from 'lodash/endsWith';
|
|
5
|
+
import trimStart from 'lodash/trimStart';
|
|
6
|
+
import trimEnd from 'lodash/trimEnd';
|
|
7
|
+
import flatMap from 'lodash/flatMap';
|
|
2
8
|
import u from 'unist-builder';
|
|
3
9
|
import toString from 'mdast-util-to-string';
|
|
4
10
|
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import isEmpty from 'lodash/isEmpty';
|
|
2
|
+
import isArray from 'lodash/isArray';
|
|
3
|
+
import flatMap from 'lodash/flatMap';
|
|
4
|
+
import map from 'lodash/map';
|
|
5
|
+
import flatten from 'lodash/flatten';
|
|
6
|
+
import isEqual from 'lodash/isEqual';
|
|
2
7
|
|
|
3
8
|
/**
|
|
4
9
|
* Map of MDAST node types to Slate node types.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import get from 'lodash/get';
|
|
2
|
+
import without from 'lodash/without';
|
|
3
|
+
import last from 'lodash/last';
|
|
4
|
+
import map from 'lodash/map';
|
|
5
|
+
import intersection from 'lodash/intersection';
|
|
6
|
+
import omit from 'lodash/omit';
|
|
2
7
|
import u from 'unist-builder';
|
|
3
8
|
import mdastToString from 'mdast-util-to-string';
|
|
4
9
|
|