@contentful/field-editor-rich-text 4.6.0 → 4.7.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/dist/cjs/RichTextEditor.js +11 -11
- package/dist/cjs/Toolbar/_tests_/toolbar.test.js +12 -12
- package/dist/cjs/Toolbar/components/ButtonRedo.js +3 -3
- package/dist/cjs/Toolbar/components/ButtonUndo.js +3 -3
- package/dist/cjs/Toolbar/components/EmbedEntityWidget.js +6 -6
- package/dist/cjs/Toolbar/components/EmbeddedEntityDropdownButton.js +5 -5
- package/dist/cjs/Toolbar/components/StickyToolbarWrapper.js +1 -1
- package/dist/cjs/Toolbar/index.js +28 -28
- package/dist/cjs/dialogs/HypelinkDialog/HyperlinkDialog.js +20 -20
- package/dist/cjs/dialogs/openRichTextDialog.js +1 -1
- package/dist/cjs/dialogs/renderRichTextDialog.js +2 -2
- package/dist/cjs/helpers/__tests__/removeInternalMarks.test.js +8 -8
- package/dist/cjs/plugins/Break/createExitBreakPlugin.test.js +1 -1
- package/dist/cjs/plugins/Break/createSoftBreakPlugin.test.js +1 -1
- package/dist/cjs/plugins/CommandPalette/components/CommandList.js +26 -26
- package/dist/cjs/plugins/CommandPalette/components/CommandPrompt.js +2 -2
- package/dist/cjs/plugins/EmbeddedEntityBlock/LinkedEntityBlock.js +3 -3
- package/dist/cjs/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.js +11 -11
- package/dist/cjs/plugins/EmbeddedEntityInline/LinkedEntityInline.js +2 -2
- package/dist/cjs/plugins/EmbeddedResourceBlock/LinkedResourceBlock.js +2 -2
- package/dist/cjs/plugins/EmbeddedResourceInline/FetchingWrappedResourceInlineCard.js +5 -5
- package/dist/cjs/plugins/EmbeddedResourceInline/LinkedResourceInline.js +2 -2
- package/dist/cjs/plugins/Heading/__tests__/createHeadingPlugin.test.js +31 -31
- package/dist/cjs/plugins/Heading/components/Heading.js +7 -7
- package/dist/cjs/plugins/Heading/components/ToolbarHeadingButton.js +6 -6
- package/dist/cjs/plugins/Hr/index.js +5 -5
- package/dist/cjs/plugins/Hyperlink/HyperlinkModal.js +19 -19
- package/dist/cjs/plugins/Hyperlink/__tests__/createHyperlinkPlugin.test.js +7 -7
- package/dist/cjs/plugins/Hyperlink/components/EntityHyperlink.js +3 -3
- package/dist/cjs/plugins/Hyperlink/components/LinkPopover.js +13 -13
- package/dist/cjs/plugins/Hyperlink/components/ResourceHyperlink.js +3 -3
- package/dist/cjs/plugins/Hyperlink/components/ToolbarHyperlinkButton.js +2 -2
- package/dist/cjs/plugins/Hyperlink/components/UrlHyperlink.js +3 -3
- package/dist/cjs/plugins/List/__tests__/createListPlugin.test.js +12 -12
- package/dist/cjs/plugins/List/__tests__/insertListBreak.test.js +23 -23
- package/dist/cjs/plugins/List/__tests__/insertListFragment.test.js +20 -20
- package/dist/cjs/plugins/List/components/List.js +1 -1
- package/dist/cjs/plugins/List/components/ListItem.js +1 -1
- package/dist/cjs/plugins/List/components/ToolbarListButton.js +3 -3
- package/dist/cjs/plugins/List/transforms/moveListItems.test.js +12 -12
- package/dist/cjs/plugins/List/transforms/toggleList.spec.js +18 -18
- package/dist/cjs/plugins/Marks/Bold.js +2 -2
- package/dist/cjs/plugins/Marks/Code.js +2 -2
- package/dist/cjs/plugins/Marks/Italic.js +2 -2
- package/dist/cjs/plugins/Marks/Strikethrough.js +6 -6
- package/dist/cjs/plugins/Marks/Subscript.js +4 -4
- package/dist/cjs/plugins/Marks/Superscript.js +4 -4
- package/dist/cjs/plugins/Marks/Underline.js +2 -2
- package/dist/cjs/plugins/Marks/components/MarkToolbarButton.js +2 -2
- package/dist/cjs/plugins/Normalizer/createNormalizerPlugin.test.js +8 -8
- package/dist/cjs/plugins/Paragraph/Paragraph.js +1 -1
- package/dist/cjs/plugins/Paragraph/__tests__/createParagraphPlugin.test.js +31 -31
- package/dist/cjs/plugins/Quote/__test__/createQuotePlugin.test.js +20 -20
- package/dist/cjs/plugins/Quote/components/Quote.js +1 -1
- package/dist/cjs/plugins/Quote/components/ToolbarQuoteButton.js +2 -2
- package/dist/cjs/plugins/Table/__tests__/createTablePlugin.test.js +21 -21
- package/dist/cjs/plugins/Table/__tests__/helpers.test.js +2 -2
- package/dist/cjs/plugins/Table/components/Cell.js +2 -2
- package/dist/cjs/plugins/Table/components/HeaderCell.js +2 -2
- package/dist/cjs/plugins/Table/components/Row.js +1 -1
- package/dist/cjs/plugins/Table/components/Table.js +3 -3
- package/dist/cjs/plugins/Table/components/TableActions.js +11 -11
- package/dist/cjs/plugins/Table/components/ToolbarButton.js +2 -2
- package/dist/cjs/plugins/Text/__tests__/createTextPlugin.test.js +14 -14
- package/dist/cjs/plugins/shared/EmbeddedBlockToolbarIcon.js +4 -4
- package/dist/cjs/plugins/shared/EmbeddedInlineToolbarIcon.js +4 -4
- package/dist/cjs/plugins/shared/FetchingWrappedAssetCard.js +6 -6
- package/dist/cjs/plugins/shared/FetchingWrappedEntryCard.js +6 -6
- package/dist/cjs/plugins/shared/FetchingWrappedResourceCard.js +6 -6
- package/dist/cjs/plugins/shared/LinkedBlockWrapper.js +2 -2
- package/dist/cjs/plugins/shared/LinkedInlineWrapper.js +2 -2
- package/dist/cjs/plugins/shared/ResourceNewBadge.js +1 -1
- package/dist/cjs/plugins/shared/ToolbarButton.js +2 -2
- package/dist/cjs/plugins/shared/__tests__/FetchingWrappedAssetCard.test.js +2 -2
- package/dist/cjs/plugins/shared/__tests__/FetchingWrappedEntryCard.test.js +2 -2
- package/dist/cjs/plugins/shared/__tests__/FetchingWrappedResourceCard.test.js +2 -2
- package/dist/esm/RichTextEditor.js +11 -11
- package/dist/esm/Toolbar/_tests_/toolbar.test.js +12 -12
- package/dist/esm/Toolbar/components/ButtonRedo.js +3 -3
- package/dist/esm/Toolbar/components/ButtonUndo.js +3 -3
- package/dist/esm/Toolbar/components/EmbedEntityWidget.js +6 -6
- package/dist/esm/Toolbar/components/EmbeddedEntityDropdownButton.js +5 -5
- package/dist/esm/Toolbar/components/StickyToolbarWrapper.js +1 -1
- package/dist/esm/Toolbar/index.js +30 -30
- package/dist/esm/dialogs/HypelinkDialog/HyperlinkDialog.js +20 -20
- package/dist/esm/dialogs/openRichTextDialog.js +1 -1
- package/dist/esm/dialogs/renderRichTextDialog.js +2 -2
- package/dist/esm/helpers/__tests__/removeInternalMarks.test.js +8 -8
- package/dist/esm/plugins/Break/createExitBreakPlugin.test.js +1 -1
- package/dist/esm/plugins/Break/createSoftBreakPlugin.test.js +1 -1
- package/dist/esm/plugins/CommandPalette/components/CommandList.js +26 -26
- package/dist/esm/plugins/CommandPalette/components/CommandPrompt.js +2 -2
- package/dist/esm/plugins/EmbeddedEntityBlock/LinkedEntityBlock.js +3 -3
- package/dist/esm/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.js +11 -11
- package/dist/esm/plugins/EmbeddedEntityInline/LinkedEntityInline.js +2 -2
- package/dist/esm/plugins/EmbeddedResourceBlock/LinkedResourceBlock.js +2 -2
- package/dist/esm/plugins/EmbeddedResourceInline/FetchingWrappedResourceInlineCard.js +5 -5
- package/dist/esm/plugins/EmbeddedResourceInline/LinkedResourceInline.js +2 -2
- package/dist/esm/plugins/Heading/__tests__/createHeadingPlugin.test.js +31 -31
- package/dist/esm/plugins/Heading/components/Heading.js +7 -7
- package/dist/esm/plugins/Heading/components/ToolbarHeadingButton.js +6 -6
- package/dist/esm/plugins/Hr/index.js +5 -5
- package/dist/esm/plugins/Hyperlink/HyperlinkModal.js +19 -19
- package/dist/esm/plugins/Hyperlink/__tests__/createHyperlinkPlugin.test.js +7 -7
- package/dist/esm/plugins/Hyperlink/components/EntityHyperlink.js +3 -3
- package/dist/esm/plugins/Hyperlink/components/LinkPopover.js +13 -13
- package/dist/esm/plugins/Hyperlink/components/ResourceHyperlink.js +3 -3
- package/dist/esm/plugins/Hyperlink/components/ToolbarHyperlinkButton.js +2 -2
- package/dist/esm/plugins/Hyperlink/components/UrlHyperlink.js +3 -3
- package/dist/esm/plugins/List/__tests__/createListPlugin.test.js +12 -12
- package/dist/esm/plugins/List/__tests__/insertListBreak.test.js +23 -23
- package/dist/esm/plugins/List/__tests__/insertListFragment.test.js +20 -20
- package/dist/esm/plugins/List/components/List.js +1 -1
- package/dist/esm/plugins/List/components/ListItem.js +1 -1
- package/dist/esm/plugins/List/components/ToolbarListButton.js +3 -3
- package/dist/esm/plugins/List/transforms/moveListItems.test.js +12 -12
- package/dist/esm/plugins/List/transforms/toggleList.spec.js +18 -18
- package/dist/esm/plugins/Marks/Bold.js +2 -2
- package/dist/esm/plugins/Marks/Code.js +2 -2
- package/dist/esm/plugins/Marks/Italic.js +2 -2
- package/dist/esm/plugins/Marks/Strikethrough.js +6 -6
- package/dist/esm/plugins/Marks/Subscript.js +4 -4
- package/dist/esm/plugins/Marks/Superscript.js +4 -4
- package/dist/esm/plugins/Marks/Underline.js +2 -2
- package/dist/esm/plugins/Marks/components/MarkToolbarButton.js +2 -2
- package/dist/esm/plugins/Marks/index.js +2 -2
- package/dist/esm/plugins/Normalizer/createNormalizerPlugin.test.js +8 -8
- package/dist/esm/plugins/Paragraph/Paragraph.js +1 -1
- package/dist/esm/plugins/Paragraph/__tests__/createParagraphPlugin.test.js +31 -31
- package/dist/esm/plugins/Quote/__test__/createQuotePlugin.test.js +20 -20
- package/dist/esm/plugins/Quote/components/Quote.js +1 -1
- package/dist/esm/plugins/Quote/components/ToolbarQuoteButton.js +2 -2
- package/dist/esm/plugins/Table/__tests__/createTablePlugin.test.js +21 -21
- package/dist/esm/plugins/Table/__tests__/helpers.test.js +2 -2
- package/dist/esm/plugins/Table/components/Cell.js +2 -2
- package/dist/esm/plugins/Table/components/HeaderCell.js +2 -2
- package/dist/esm/plugins/Table/components/Row.js +1 -1
- package/dist/esm/plugins/Table/components/Table.js +3 -3
- package/dist/esm/plugins/Table/components/TableActions.js +11 -11
- package/dist/esm/plugins/Table/components/ToolbarButton.js +2 -2
- package/dist/esm/plugins/Text/__tests__/createTextPlugin.test.js +14 -14
- package/dist/esm/plugins/shared/EmbeddedBlockToolbarIcon.js +4 -4
- package/dist/esm/plugins/shared/EmbeddedInlineToolbarIcon.js +4 -4
- package/dist/esm/plugins/shared/FetchingWrappedAssetCard.js +6 -6
- package/dist/esm/plugins/shared/FetchingWrappedEntryCard.js +6 -6
- package/dist/esm/plugins/shared/FetchingWrappedResourceCard.js +6 -6
- package/dist/esm/plugins/shared/LinkedBlockWrapper.js +2 -2
- package/dist/esm/plugins/shared/LinkedInlineWrapper.js +2 -2
- package/dist/esm/plugins/shared/ResourceNewBadge.js +1 -1
- package/dist/esm/plugins/shared/ToolbarButton.js +2 -2
- package/dist/esm/plugins/shared/__tests__/FetchingWrappedAssetCard.test.js +2 -2
- package/dist/esm/plugins/shared/__tests__/FetchingWrappedEntryCard.test.js +2 -2
- package/dist/esm/plugins/shared/__tests__/FetchingWrappedResourceCard.test.js +2 -2
- package/dist/esm/test-utils/jsx.js +1 -1
- package/package.json +6 -4
|
@@ -196,30 +196,30 @@ function HyperlinkModal(props) {
|
|
|
196
196
|
event.preventDefault();
|
|
197
197
|
setLinkEntity(null);
|
|
198
198
|
}
|
|
199
|
-
return _react.createElement(_fieldeditorreference.EntityProvider, {
|
|
199
|
+
return /*#__PURE__*/ _react.createElement(_fieldeditorreference.EntityProvider, {
|
|
200
200
|
sdk: props.sdk
|
|
201
|
-
}, _react.createElement(_react.Fragment, null, _react.createElement(_f36components.ModalContent, null, _react.createElement(_f36components.Form, null, !props.linkType && _react.createElement(_f36components.FormControl, {
|
|
201
|
+
}, /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement(_f36components.ModalContent, null, /*#__PURE__*/ _react.createElement(_f36components.Form, null, !props.linkType && /*#__PURE__*/ _react.createElement(_f36components.FormControl, {
|
|
202
202
|
id: "link-text",
|
|
203
203
|
isRequired: true
|
|
204
|
-
}, _react.createElement(_f36components.FormControl.Label, null, "Link text"), _react.createElement(_f36components.TextInput, {
|
|
204
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.FormControl.Label, null, "Link text"), /*#__PURE__*/ _react.createElement(_f36components.TextInput, {
|
|
205
205
|
testId: "link-text-input",
|
|
206
206
|
name: "link-text",
|
|
207
207
|
value: linkText,
|
|
208
208
|
onChange: (event)=>setLinkText(event.target.value)
|
|
209
|
-
})), enabledLinkTypes.length > 1 && _react.createElement(_f36components.FormControl, {
|
|
209
|
+
})), enabledLinkTypes.length > 1 && /*#__PURE__*/ _react.createElement(_f36components.FormControl, {
|
|
210
210
|
id: "link-type"
|
|
211
|
-
}, _react.createElement(_f36components.FormControl.Label, null, "Link type"), _react.createElement(_f36components.Select, {
|
|
211
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.FormControl.Label, null, "Link type"), /*#__PURE__*/ _react.createElement(_f36components.Select, {
|
|
212
212
|
value: linkType,
|
|
213
213
|
onChange: (event)=>setLinkType(event.target.value),
|
|
214
214
|
testId: "link-type-input",
|
|
215
215
|
isDisabled: props.readonly
|
|
216
|
-
}, enabledLinkTypes.map((nodeType)
|
|
216
|
+
}, enabledLinkTypes.map((nodeType)=>/*#__PURE__*/ _react.createElement(_f36components.Select.Option, {
|
|
217
217
|
key: nodeType,
|
|
218
218
|
value: nodeType
|
|
219
|
-
}, LINK_TYPE_SELECTION_VALUES[nodeType])))), linkType === _richtexttypes.INLINES.HYPERLINK && _react.createElement(_f36components.FormControl, {
|
|
219
|
+
}, LINK_TYPE_SELECTION_VALUES[nodeType])))), linkType === _richtexttypes.INLINES.HYPERLINK && /*#__PURE__*/ _react.createElement(_f36components.FormControl, {
|
|
220
220
|
id: "linkTarget",
|
|
221
221
|
isRequired: true
|
|
222
|
-
}, _react.createElement(_f36components.FormControl.Label, null, "Link target"), _react.createElement(_f36components.TextInput, {
|
|
222
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.FormControl.Label, null, "Link target"), /*#__PURE__*/ _react.createElement(_f36components.TextInput, {
|
|
223
223
|
ref: linkTargetInputRef,
|
|
224
224
|
name: "linkTarget",
|
|
225
225
|
value: linkTarget,
|
|
@@ -229,46 +229,46 @@ function HyperlinkModal(props) {
|
|
|
229
229
|
},
|
|
230
230
|
testId: "link-target-input",
|
|
231
231
|
isDisabled: props.readonly
|
|
232
|
-
}), _react.createElement(_f36components.FormControl.HelpText, null, "A protocol may be required, e.g. https://")), linkType !== _richtexttypes.INLINES.HYPERLINK && _react.createElement("div", null, _react.createElement(_f36components.FormLabel, {
|
|
232
|
+
}), /*#__PURE__*/ _react.createElement(_f36components.FormControl.HelpText, null, "A protocol may be required, e.g. https://")), linkType !== _richtexttypes.INLINES.HYPERLINK && /*#__PURE__*/ _react.createElement("div", null, /*#__PURE__*/ _react.createElement(_f36components.FormLabel, {
|
|
233
233
|
isRequired: true,
|
|
234
234
|
htmlFor: ""
|
|
235
|
-
}, "Link target", ' '), linkEntity && linkEntity.sys.linkType === SYS_LINK_TYPES[linkType] ? _react.createElement(_react.Fragment, null, !props.readonly && _react.createElement(_f36components.TextLink, {
|
|
235
|
+
}, "Link target", ' '), linkEntity && linkEntity.sys.linkType === SYS_LINK_TYPES[linkType] ? /*#__PURE__*/ _react.createElement(_react.Fragment, null, !props.readonly && /*#__PURE__*/ _react.createElement(_f36components.TextLink, {
|
|
236
236
|
testId: "entity-selection-link",
|
|
237
237
|
onClick: resetLinkEntity,
|
|
238
238
|
className: styles.removeSelectionLabel
|
|
239
|
-
}, "Remove selection"), _react.createElement("div", null, linkType === _richtexttypes.INLINES.ENTRY_HYPERLINK && isEntryLink(linkEntity) && _react.createElement(_FetchingWrappedEntryCard.FetchingWrappedEntryCard, {
|
|
239
|
+
}, "Remove selection"), /*#__PURE__*/ _react.createElement("div", null, linkType === _richtexttypes.INLINES.ENTRY_HYPERLINK && isEntryLink(linkEntity) && /*#__PURE__*/ _react.createElement(_FetchingWrappedEntryCard.FetchingWrappedEntryCard, {
|
|
240
240
|
sdk: props.sdk,
|
|
241
241
|
locale: props.sdk.field.locale,
|
|
242
242
|
entryId: linkEntity.sys.id,
|
|
243
243
|
isDisabled: true,
|
|
244
244
|
isSelected: false
|
|
245
|
-
}), linkType === _richtexttypes.INLINES.RESOURCE_HYPERLINK && isResourceLink(linkEntity) && _react.createElement(_FetchingWrappedResourceCard.FetchingWrappedResourceCard, {
|
|
245
|
+
}), linkType === _richtexttypes.INLINES.RESOURCE_HYPERLINK && isResourceLink(linkEntity) && /*#__PURE__*/ _react.createElement(_FetchingWrappedResourceCard.FetchingWrappedResourceCard, {
|
|
246
246
|
sdk: props.sdk,
|
|
247
247
|
link: linkEntity.sys,
|
|
248
248
|
isDisabled: true,
|
|
249
249
|
isSelected: false
|
|
250
|
-
}), linkType === _richtexttypes.INLINES.ASSET_HYPERLINK && isAssetLink(linkEntity) && _react.createElement(_FetchingWrappedAssetCard.FetchingWrappedAssetCard, {
|
|
250
|
+
}), linkType === _richtexttypes.INLINES.ASSET_HYPERLINK && isAssetLink(linkEntity) && /*#__PURE__*/ _react.createElement(_FetchingWrappedAssetCard.FetchingWrappedAssetCard, {
|
|
251
251
|
sdk: props.sdk,
|
|
252
252
|
locale: props.sdk.field.locale,
|
|
253
253
|
assetId: linkEntity.sys.id,
|
|
254
254
|
isDisabled: true,
|
|
255
255
|
isSelected: false
|
|
256
|
-
}))) : _react.createElement("div", null, linkType === _richtexttypes.INLINES.ENTRY_HYPERLINK && _react.createElement(_f36components.TextLink, {
|
|
256
|
+
}))) : /*#__PURE__*/ _react.createElement("div", null, linkType === _richtexttypes.INLINES.ENTRY_HYPERLINK && /*#__PURE__*/ _react.createElement(_f36components.TextLink, {
|
|
257
257
|
testId: "entity-selection-link",
|
|
258
258
|
onClick: selectEntry
|
|
259
|
-
}, "Select entry"), linkType === _richtexttypes.INLINES.RESOURCE_HYPERLINK && _react.createElement(_f36components.TextLink, {
|
|
259
|
+
}, "Select entry"), linkType === _richtexttypes.INLINES.RESOURCE_HYPERLINK && /*#__PURE__*/ _react.createElement(_f36components.TextLink, {
|
|
260
260
|
testId: "entity-selection-link",
|
|
261
261
|
onClick: selectResourceEntry
|
|
262
|
-
}, "Select entry"), linkType === _richtexttypes.INLINES.ASSET_HYPERLINK && _react.createElement(_f36components.TextLink, {
|
|
262
|
+
}, "Select entry"), linkType === _richtexttypes.INLINES.ASSET_HYPERLINK && /*#__PURE__*/ _react.createElement(_f36components.TextLink, {
|
|
263
263
|
testId: "entity-selection-link",
|
|
264
264
|
onClick: selectAsset
|
|
265
|
-
}, "Select asset"))))), _react.createElement(_f36components.ModalControls, null, _react.createElement(_f36components.Button, {
|
|
265
|
+
}, "Select asset"))))), /*#__PURE__*/ _react.createElement(_f36components.ModalControls, null, /*#__PURE__*/ _react.createElement(_f36components.Button, {
|
|
266
266
|
type: "button",
|
|
267
267
|
onClick: ()=>props.onClose(null),
|
|
268
268
|
variant: "secondary",
|
|
269
269
|
testId: "cancel-cta",
|
|
270
270
|
size: "small"
|
|
271
|
-
}, "Cancel"), _react.createElement(_f36components.Button, {
|
|
271
|
+
}, "Cancel"), /*#__PURE__*/ _react.createElement(_f36components.Button, {
|
|
272
272
|
type: "submit",
|
|
273
273
|
variant: "positive",
|
|
274
274
|
size: "small",
|
|
@@ -305,7 +305,7 @@ async function addOrEditLink(editor, sdk, logAction, targetPath) {
|
|
|
305
305
|
shouldCloseOnOverlayClick: true,
|
|
306
306
|
allowHeightOverflow: true
|
|
307
307
|
}, ({ onClose })=>{
|
|
308
|
-
return _react.createElement(HyperlinkModal, {
|
|
308
|
+
return /*#__PURE__*/ _react.createElement(HyperlinkModal, {
|
|
309
309
|
linkTarget: linkTarget,
|
|
310
310
|
linkText: currentLinkText,
|
|
311
311
|
linkType: linkType,
|
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
const _testutils = require("../../../test-utils");
|
|
6
6
|
describe('normalization', ()=>{
|
|
7
7
|
it('removes empty links from the document structure', ()=>{
|
|
8
|
-
const input = (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null, "link"), (0, _testutils.jsx)("hlink", {
|
|
8
|
+
const input = /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null, "link"), /*#__PURE__*/ (0, _testutils.jsx)("hlink", {
|
|
9
9
|
uri: "https://link.com"
|
|
10
|
-
})), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null, "asset"), (0, _testutils.jsx)("hlink", {
|
|
10
|
+
})), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null, "asset"), /*#__PURE__*/ (0, _testutils.jsx)("hlink", {
|
|
11
11
|
asset: "asset-id"
|
|
12
|
-
})), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null, "entry"), (0, _testutils.jsx)("hlink", {
|
|
12
|
+
})), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null, "entry"), /*#__PURE__*/ (0, _testutils.jsx)("hlink", {
|
|
13
13
|
entry: "entry-id"
|
|
14
|
-
})), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null, "resource"), (0, _testutils.jsx)("hlink", {
|
|
14
|
+
})), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null, "resource"), /*#__PURE__*/ (0, _testutils.jsx)("hlink", {
|
|
15
15
|
resource: "resource-urn"
|
|
16
|
-
})), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null, "explicit empty link"), (0, _testutils.jsx)("hlink", {
|
|
16
|
+
})), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null, "explicit empty link"), /*#__PURE__*/ (0, _testutils.jsx)("hlink", {
|
|
17
17
|
uri: "https://link.com"
|
|
18
|
-
}, '')), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null, "link with empty space"), (0, _testutils.jsx)("hlink", {
|
|
18
|
+
}, '')), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null, "link with empty space"), /*#__PURE__*/ (0, _testutils.jsx)("hlink", {
|
|
19
19
|
uri: "https://link.com"
|
|
20
20
|
}, " ")));
|
|
21
|
-
const expected = (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null, "link")), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null, "asset")), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null, "entry")), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null, "resource")), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null, "explicit empty link")), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null, "link with empty space")));
|
|
21
|
+
const expected = /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null, "link")), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null, "asset")), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null, "entry")), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null, "resource")), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null, "explicit empty link")), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null, "link with empty space")));
|
|
22
22
|
(0, _testutils.assertOutput)({
|
|
23
23
|
input,
|
|
24
24
|
expected
|
|
@@ -69,18 +69,18 @@ function EntityHyperlink(props) {
|
|
|
69
69
|
if (!target) {
|
|
70
70
|
return null;
|
|
71
71
|
}
|
|
72
|
-
const popoverText = _react.createElement(_f36components.Text, {
|
|
72
|
+
const popoverText = /*#__PURE__*/ _react.createElement(_f36components.Text, {
|
|
73
73
|
fontColor: "blue600",
|
|
74
74
|
fontWeight: "fontWeightMedium",
|
|
75
75
|
className: _styles.styles.openLink
|
|
76
76
|
}, tooltipContent);
|
|
77
|
-
return _react.createElement(_LinkPopover.LinkPopover, {
|
|
77
|
+
return /*#__PURE__*/ _react.createElement(_LinkPopover.LinkPopover, {
|
|
78
78
|
isLinkFocused: isLinkFocused,
|
|
79
79
|
handleEditLink: ()=>(0, _linkHandlers.handleEditLink)(editor, sdk, pathToElement),
|
|
80
80
|
handleRemoveLink: ()=>(0, _linkHandlers.handleRemoveLink)(editor),
|
|
81
81
|
popoverText: popoverText,
|
|
82
82
|
isEditorFocused: isEditorFocused
|
|
83
|
-
}, _react.createElement(_f36components.Text, {
|
|
83
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.Text, {
|
|
84
84
|
testId: "cf-ui-text-link",
|
|
85
85
|
fontColor: "blue600",
|
|
86
86
|
fontWeight: "fontWeightMedium",
|
|
@@ -70,63 +70,63 @@ const LinkPopover = ({ isLinkFocused, popoverText, handleEditLink, handleRemoveL
|
|
|
70
70
|
};
|
|
71
71
|
}, []);
|
|
72
72
|
const isOpen = isLinkFocused && isEditorFocused || isPopoverContentClicked;
|
|
73
|
-
return _react.createElement(_f36components.Popover, {
|
|
73
|
+
return /*#__PURE__*/ _react.createElement(_f36components.Popover, {
|
|
74
74
|
renderOnlyWhenOpen: false,
|
|
75
75
|
usePortal: true,
|
|
76
76
|
autoFocus: false,
|
|
77
77
|
isOpen: isOpen
|
|
78
|
-
}, _react.createElement(_f36components.Popover.Trigger, null, children), _react.createElement(_f36components.Popover.Content, {
|
|
78
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.Popover.Trigger, null, children), /*#__PURE__*/ _react.createElement(_f36components.Popover.Content, {
|
|
79
79
|
className: _styles.styles.popover
|
|
80
|
-
}, _react.createElement(_f36components.Flex, {
|
|
80
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.Flex, {
|
|
81
81
|
ref: popoverContent,
|
|
82
82
|
alignItems: "center",
|
|
83
83
|
paddingTop: "spacing2Xs",
|
|
84
84
|
paddingBottom: "spacing2Xs",
|
|
85
85
|
paddingRight: "spacing2Xs",
|
|
86
86
|
paddingLeft: "spacingXs"
|
|
87
|
-
}, popoverText, handleCopyLink && _react.createElement(_f36components.Tooltip, {
|
|
87
|
+
}, popoverText, handleCopyLink && /*#__PURE__*/ _react.createElement(_f36components.Tooltip, {
|
|
88
88
|
placement: "bottom",
|
|
89
89
|
content: "Copy link",
|
|
90
90
|
usePortal: true
|
|
91
|
-
}, _react.createElement(_f36components.IconButton, {
|
|
91
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.IconButton, {
|
|
92
92
|
className: _styles.styles.iconButton,
|
|
93
93
|
onClick: handleCopyLink,
|
|
94
94
|
size: "small",
|
|
95
95
|
variant: "transparent",
|
|
96
96
|
"aria-label": "Copy link",
|
|
97
|
-
icon: _react.createElement(_f36icons.CopyIcon, {
|
|
97
|
+
icon: /*#__PURE__*/ _react.createElement(_f36icons.CopyIcon, {
|
|
98
98
|
size: "tiny"
|
|
99
99
|
})
|
|
100
|
-
})), _react.createElement(_f36components.Tooltip, {
|
|
100
|
+
})), /*#__PURE__*/ _react.createElement(_f36components.Tooltip, {
|
|
101
101
|
placement: "bottom",
|
|
102
102
|
content: "Edit link",
|
|
103
103
|
usePortal: true
|
|
104
|
-
}, _react.createElement(_f36components.IconButton, {
|
|
104
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.IconButton, {
|
|
105
105
|
className: _styles.styles.iconButton,
|
|
106
106
|
onClick: handleEditLink,
|
|
107
107
|
size: "small",
|
|
108
108
|
variant: "transparent",
|
|
109
109
|
"aria-label": "Edit link",
|
|
110
|
-
icon: _react.createElement(_f36icons.EditIcon, {
|
|
110
|
+
icon: /*#__PURE__*/ _react.createElement(_f36icons.EditIcon, {
|
|
111
111
|
size: "tiny"
|
|
112
112
|
})
|
|
113
|
-
})), _react.createElement(_f36components.Tooltip, {
|
|
113
|
+
})), /*#__PURE__*/ _react.createElement(_f36components.Tooltip, {
|
|
114
114
|
placement: "bottom",
|
|
115
115
|
content: "Remove link",
|
|
116
116
|
usePortal: true
|
|
117
|
-
}, _react.createElement(_f36components.IconButton, {
|
|
117
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.IconButton, {
|
|
118
118
|
onClick: handleRemoveLink,
|
|
119
119
|
className: _styles.styles.iconButton,
|
|
120
120
|
size: "small",
|
|
121
121
|
variant: "transparent",
|
|
122
122
|
"aria-label": "Remove link",
|
|
123
|
-
icon: _react.createElement("svg", {
|
|
123
|
+
icon: /*#__PURE__*/ _react.createElement("svg", {
|
|
124
124
|
width: "16",
|
|
125
125
|
height: "16",
|
|
126
126
|
viewBox: "0 0 16 16",
|
|
127
127
|
fill: "none",
|
|
128
128
|
xmlns: "http://www.w3.org/2000/svg"
|
|
129
|
-
}, _react.createElement("path", {
|
|
129
|
+
}, /*#__PURE__*/ _react.createElement("path", {
|
|
130
130
|
d: "M1.75 8C1.75 8.59674 1.98705 9.16903 2.40901 9.59099C2.83097 10.0129 3.40326 10.25 4 10.25H6.5C6.69891 10.25 6.88968 10.329 7.03033 10.4697C7.17098 10.6103 7.25 10.8011 7.25 11C7.25 11.1989 7.17098 11.3897 7.03033 11.5303C6.88968 11.671 6.69891 11.75 6.5 11.75H4C3.00544 11.75 2.05161 11.3549 1.34835 10.6517C0.645088 9.94839 0.25 8.99456 0.25 8C0.25 7.00544 0.645088 6.05161 1.34835 5.34835C2.05161 4.64509 3.00544 4.25 4 4.25H6.5C6.69891 4.25 6.88968 4.32902 7.03033 4.46967C7.17098 4.61032 7.25 4.80109 7.25 5C7.25 5.19891 7.17098 5.38968 7.03033 5.53033C6.88968 5.67098 6.69891 5.75 6.5 5.75H4C3.40326 5.75 2.83097 5.98705 2.40901 6.40901C1.98705 6.83097 1.75 7.40326 1.75 8ZM12 4.25H9.5C9.30109 4.25 9.11032 4.32902 8.96967 4.46967C8.82902 4.61032 8.75 4.80109 8.75 5C8.75 5.19891 8.82902 5.38968 8.96967 5.53033C9.11032 5.67098 9.30109 5.75 9.5 5.75H12C12.5967 5.75 13.169 5.98705 13.591 6.40901C14.0129 6.83097 14.25 7.40326 14.25 8C14.25 8.59674 14.0129 9.16903 13.591 9.59099C13.169 10.0129 12.5967 10.25 12 10.25H9.5C9.30109 10.25 9.11032 10.329 8.96967 10.4697C8.82902 10.6103 8.75 10.8011 8.75 11C8.75 11.1989 8.82902 11.3897 8.96967 11.5303C9.11032 11.671 9.30109 11.75 9.5 11.75H12C12.9946 11.75 13.9484 11.3549 14.6517 10.6517C15.3549 9.94839 15.75 8.99456 15.75 8C15.75 7.00544 15.3549 6.05161 14.6517 5.34835C13.9484 4.64509 12.9946 4.25 12 4.25Z",
|
|
131
131
|
fill: "black"
|
|
132
132
|
}))
|
|
@@ -68,18 +68,18 @@ function ResourceHyperlink(props) {
|
|
|
68
68
|
if (!target) {
|
|
69
69
|
return null;
|
|
70
70
|
}
|
|
71
|
-
const popoverText = _react.createElement(_f36components.Text, {
|
|
71
|
+
const popoverText = /*#__PURE__*/ _react.createElement(_f36components.Text, {
|
|
72
72
|
fontColor: "blue600",
|
|
73
73
|
fontWeight: "fontWeightMedium",
|
|
74
74
|
className: _styles.styles.openLink
|
|
75
75
|
}, tooltipContent);
|
|
76
|
-
return _react.createElement(_LinkPopover.LinkPopover, {
|
|
76
|
+
return /*#__PURE__*/ _react.createElement(_LinkPopover.LinkPopover, {
|
|
77
77
|
isLinkFocused: isLinkFocused,
|
|
78
78
|
handleEditLink: ()=>(0, _linkHandlers.handleEditLink)(editor, sdk, pathToElement),
|
|
79
79
|
handleRemoveLink: ()=>(0, _linkHandlers.handleRemoveLink)(editor),
|
|
80
80
|
popoverText: popoverText,
|
|
81
81
|
isEditorFocused: isEditorFocused
|
|
82
|
-
}, _react.createElement(_f36components.Text, {
|
|
82
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.Text, {
|
|
83
83
|
testId: "cf-ui-text-link",
|
|
84
84
|
fontColor: "blue600",
|
|
85
85
|
fontWeight: "fontWeightMedium",
|
|
@@ -70,11 +70,11 @@ function ToolbarHyperlinkButton(props) {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
if (!editor) return null;
|
|
73
|
-
return _react.createElement(_ToolbarButton.ToolbarButton, {
|
|
73
|
+
return /*#__PURE__*/ _react.createElement(_ToolbarButton.ToolbarButton, {
|
|
74
74
|
title: "Hyperlink",
|
|
75
75
|
testId: "hyperlink-toolbar-button",
|
|
76
76
|
onClick: handleClick,
|
|
77
77
|
isActive: isActive,
|
|
78
78
|
isDisabled: props.isDisabled
|
|
79
|
-
}, _react.createElement(_f36icons.LinkIcon, null));
|
|
79
|
+
}, /*#__PURE__*/ _react.createElement(_f36icons.LinkIcon, null));
|
|
80
80
|
}
|
|
@@ -58,20 +58,20 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
58
58
|
function UrlHyperlink(props) {
|
|
59
59
|
const { editor, sdk, isLinkFocused, pathToElement, isEditorFocused } = (0, _useHyperlinkCommon.useHyperlinkCommon)(props.element);
|
|
60
60
|
const uri = props.element.data?.uri;
|
|
61
|
-
const popoverText = _react.createElement(_f36components.TextLink, {
|
|
61
|
+
const popoverText = /*#__PURE__*/ _react.createElement(_f36components.TextLink, {
|
|
62
62
|
className: _styles.styles.openLink,
|
|
63
63
|
href: uri,
|
|
64
64
|
rel: "noopener noreferrer",
|
|
65
65
|
target: "_blank"
|
|
66
66
|
}, uri);
|
|
67
|
-
return _react.createElement(_LinkPopover.LinkPopover, {
|
|
67
|
+
return /*#__PURE__*/ _react.createElement(_LinkPopover.LinkPopover, {
|
|
68
68
|
isLinkFocused: isLinkFocused,
|
|
69
69
|
handleEditLink: ()=>(0, _linkHandlers.handleEditLink)(editor, sdk, pathToElement),
|
|
70
70
|
handleRemoveLink: ()=>(0, _linkHandlers.handleRemoveLink)(editor),
|
|
71
71
|
handleCopyLink: ()=>(0, _linkHandlers.handleCopyLink)(uri),
|
|
72
72
|
popoverText: popoverText,
|
|
73
73
|
isEditorFocused: isEditorFocused
|
|
74
|
-
}, _react.createElement(_f36components.TextLink, {
|
|
74
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.TextLink, {
|
|
75
75
|
testId: "cf-ui-text-link",
|
|
76
76
|
href: uri,
|
|
77
77
|
onClick: (e)=>e.preventDefault(),
|
|
@@ -5,40 +5,40 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
const _testutils = require("../../../test-utils");
|
|
6
6
|
describe('normalization', ()=>{
|
|
7
7
|
it('wraps orphaned list items in a list', ()=>{
|
|
8
|
-
const input = (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "Item")), (0, _testutils.jsx)("hp", null));
|
|
9
|
-
const expected = (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "Item"))), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null)));
|
|
8
|
+
const input = /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "Item")), /*#__PURE__*/ (0, _testutils.jsx)("hp", null));
|
|
9
|
+
const expected = /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "Item"))), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null)));
|
|
10
10
|
(0, _testutils.assertOutput)({
|
|
11
11
|
input,
|
|
12
12
|
expected
|
|
13
13
|
});
|
|
14
14
|
});
|
|
15
15
|
it('adds empty paragraph to empty list items', ()=>{
|
|
16
|
-
const input = (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null)), (0, _testutils.jsx)("hp", null));
|
|
17
|
-
const expected = (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null)))), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null)));
|
|
16
|
+
const input = /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null)), /*#__PURE__*/ (0, _testutils.jsx)("hp", null));
|
|
17
|
+
const expected = /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null)))), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null)));
|
|
18
18
|
(0, _testutils.assertOutput)({
|
|
19
19
|
input,
|
|
20
20
|
expected
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
23
|
it('replaces invalid list items with text', ()=>{
|
|
24
|
-
const input = (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "Item"), (0, _testutils.jsx)("htd", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", {
|
|
24
|
+
const input = /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "Item"), /*#__PURE__*/ (0, _testutils.jsx)("htd", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", {
|
|
25
25
|
bold: true
|
|
26
|
-
}, "bold text"))), (0, _testutils.jsx)("htd", null, (0, _testutils.jsx)("hp", null, "Take a look at this ", (0, _testutils.jsx)("hlink", {
|
|
26
|
+
}, "bold text"))), /*#__PURE__*/ (0, _testutils.jsx)("htd", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "Take a look at this ", /*#__PURE__*/ (0, _testutils.jsx)("hlink", {
|
|
27
27
|
uri: "https://google.com"
|
|
28
|
-
}, "link"))))), (0, _testutils.jsx)("hp", null));
|
|
29
|
-
const expected = (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "Item"), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", {
|
|
28
|
+
}, "link"))))), /*#__PURE__*/ (0, _testutils.jsx)("hp", null));
|
|
29
|
+
const expected = /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "Item"), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", {
|
|
30
30
|
bold: true
|
|
31
|
-
}, "bold text")), (0, _testutils.jsx)("hp", null, "Take a look at this ", (0, _testutils.jsx)("hlink", {
|
|
31
|
+
}, "bold text")), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "Take a look at this ", /*#__PURE__*/ (0, _testutils.jsx)("hlink", {
|
|
32
32
|
uri: "https://google.com"
|
|
33
|
-
}, "link"), (0, _testutils.jsx)("htext", null)))), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null)));
|
|
33
|
+
}, "link"), /*#__PURE__*/ (0, _testutils.jsx)("htext", null)))), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null)));
|
|
34
34
|
(0, _testutils.assertOutput)({
|
|
35
35
|
input,
|
|
36
36
|
expected
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
39
|
it('replaces list items with nested lists as a first child', ()=>{
|
|
40
|
-
const input = (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "Item 1"), (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "Item 1.1")))), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "Item 2.1"), (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "Item 2.1.1")))), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "Item 2.2"))))), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null)));
|
|
41
|
-
const expected = (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "Item 1"), (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "Item 1.1")))), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "Item 2.1"), (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "Item 2.1.1")))), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "Item 2.2"))), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null)));
|
|
40
|
+
const input = /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "Item 1"), /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "Item 1.1")))), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "Item 2.1"), /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "Item 2.1.1")))), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "Item 2.2"))))), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null)));
|
|
41
|
+
const expected = /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "Item 1"), /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "Item 1.1")))), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "Item 2.1"), /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "Item 2.1.1")))), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "Item 2.2"))), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null)));
|
|
42
42
|
(0, _testutils.assertOutput)({
|
|
43
43
|
input,
|
|
44
44
|
expected
|
|
@@ -7,61 +7,61 @@ describe('insert line break', ()=>{
|
|
|
7
7
|
const tests = [
|
|
8
8
|
{
|
|
9
9
|
title: 'at the start of a li',
|
|
10
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("cursor", null), "p1"))),
|
|
11
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("cursor", null))), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "p1")))
|
|
10
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("cursor", null), "p1"))),
|
|
11
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("cursor", null))), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "p1")))
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
title: 'at the end of a li',
|
|
15
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "p1", (0, _testutils.jsx)("cursor", null)))),
|
|
16
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "p1")), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("cursor", null))))
|
|
15
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "p1", /*#__PURE__*/ (0, _testutils.jsx)("cursor", null)))),
|
|
16
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "p1")), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("cursor", null))))
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
title: 'at the middle of a li',
|
|
20
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "split ", (0, _testutils.jsx)("cursor", null), "me"))),
|
|
21
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "split ")), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("cursor", null), "me")))
|
|
20
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "split ", /*#__PURE__*/ (0, _testutils.jsx)("cursor", null), "me"))),
|
|
21
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "split ")), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("cursor", null), "me")))
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
title: 'at the start of a li with multiple p',
|
|
25
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("cursor", null), "p1"), (0, _testutils.jsx)("hp", null, "p2"))),
|
|
26
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("cursor", null))), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "p1"), (0, _testutils.jsx)("hp", null, "p2")))
|
|
25
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("cursor", null), "p1"), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "p2"))),
|
|
26
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("cursor", null))), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "p1"), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "p2")))
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
title: 'at the start of the second p of a li',
|
|
30
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "p1"), (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("cursor", null), "p2"))),
|
|
31
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "p1")), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("cursor", null)), (0, _testutils.jsx)("hp", null, "p2")))
|
|
30
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "p1"), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("cursor", null), "p2"))),
|
|
31
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "p1")), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("cursor", null)), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "p2")))
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
title: 'at the end of a li with multiple p',
|
|
35
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "p1"), (0, _testutils.jsx)("hp", null, "p2", (0, _testutils.jsx)("cursor", null)))),
|
|
36
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "p1"), (0, _testutils.jsx)("hp", null, "p2")), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("cursor", null))))
|
|
35
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "p1"), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "p2", /*#__PURE__*/ (0, _testutils.jsx)("cursor", null)))),
|
|
36
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "p1"), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "p2")), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("cursor", null))))
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
title: 'at the middle of a li with multiple p',
|
|
40
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "split ", (0, _testutils.jsx)("cursor", null), "me"), (0, _testutils.jsx)("hp", null, "move me"))),
|
|
41
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "split ")), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("cursor", null), "me"), (0, _testutils.jsx)("hp", null, "move me")))
|
|
40
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "split ", /*#__PURE__*/ (0, _testutils.jsx)("cursor", null), "me"), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "move me"))),
|
|
41
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "split ")), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("cursor", null), "me"), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "move me")))
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
title: 'at the start of a li with heading',
|
|
45
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hh1", null, (0, _testutils.jsx)("cursor", null), "p1"))),
|
|
46
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("cursor", null))), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hh1", null, "p1")))
|
|
45
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hh1", null, /*#__PURE__*/ (0, _testutils.jsx)("cursor", null), "p1"))),
|
|
46
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("cursor", null))), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hh1", null, "p1")))
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
title: 'at the end of a li with heading',
|
|
50
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hh1", null, "p1", (0, _testutils.jsx)("cursor", null)))),
|
|
51
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hh1", null, "p1")), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("cursor", null))))
|
|
50
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hh1", null, "p1", /*#__PURE__*/ (0, _testutils.jsx)("cursor", null)))),
|
|
51
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hh1", null, "p1")), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("cursor", null))))
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
title: 'at the middle of a li with heading',
|
|
55
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hh1", null, "split ", (0, _testutils.jsx)("cursor", null), "me"))),
|
|
56
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hh1", null, "split ")), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hh1", null, (0, _testutils.jsx)("cursor", null), "me")))
|
|
55
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hh1", null, "split ", /*#__PURE__*/ (0, _testutils.jsx)("cursor", null), "me"))),
|
|
56
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hh1", null, "split ")), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hh1", null, /*#__PURE__*/ (0, _testutils.jsx)("cursor", null), "me")))
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
title: 'at a li with nested list',
|
|
60
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "item 1")), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "item 2", (0, _testutils.jsx)("cursor", null)), (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "sub list"))))),
|
|
61
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "item 1")), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "item 2")), (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("cursor", null)), (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "sub list")))))
|
|
60
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "item 1")), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "item 2", /*#__PURE__*/ (0, _testutils.jsx)("cursor", null)), /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "sub list"))))),
|
|
61
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "item 1")), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "item 2")), /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("cursor", null)), /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "sub list")))))
|
|
62
62
|
}
|
|
63
63
|
];
|
|
64
|
-
const render = (children)
|
|
64
|
+
const render = (children)=>/*#__PURE__*/ (0, _testutils.jsx)("editor", null, children, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null)));
|
|
65
65
|
for (const t of tests){
|
|
66
66
|
test(t.title, ()=>{
|
|
67
67
|
const { editor } = (0, _testutils.createTestEditor)({
|
|
@@ -7,48 +7,48 @@ describe('insert fragment', ()=>{
|
|
|
7
7
|
const tests = [
|
|
8
8
|
{
|
|
9
9
|
title: 'text wrapped in li > p',
|
|
10
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "hello ", (0, _testutils.jsx)("cursor", null)))),
|
|
11
|
-
fragment: (0, _testutils.jsx)("fragment", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "world"))),
|
|
12
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "hello world")))
|
|
10
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "hello ", /*#__PURE__*/ (0, _testutils.jsx)("cursor", null)))),
|
|
11
|
+
fragment: /*#__PURE__*/ (0, _testutils.jsx)("fragment", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "world"))),
|
|
12
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "hello world")))
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
title: 'text wrapped in li > h*',
|
|
16
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "hello ", (0, _testutils.jsx)("cursor", null)))),
|
|
17
|
-
fragment: (0, _testutils.jsx)("fragment", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hh1", null, "world"))),
|
|
18
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "hello world")))
|
|
16
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "hello ", /*#__PURE__*/ (0, _testutils.jsx)("cursor", null)))),
|
|
17
|
+
fragment: /*#__PURE__*/ (0, _testutils.jsx)("fragment", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hh1", null, "world"))),
|
|
18
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "hello world")))
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
title: 'single li with only asset card',
|
|
22
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "hello", (0, _testutils.jsx)("cursor", null), "world"))),
|
|
23
|
-
fragment: (0, _testutils.jsx)("fragment", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hembed", {
|
|
22
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "hello", /*#__PURE__*/ (0, _testutils.jsx)("cursor", null), "world"))),
|
|
23
|
+
fragment: /*#__PURE__*/ (0, _testutils.jsx)("fragment", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hembed", {
|
|
24
24
|
type: "Asset",
|
|
25
25
|
id: "asset-id"
|
|
26
26
|
}))),
|
|
27
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "hello"), (0, _testutils.jsx)("hembed", {
|
|
27
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "hello"), /*#__PURE__*/ (0, _testutils.jsx)("hembed", {
|
|
28
28
|
type: "Asset",
|
|
29
29
|
id: "asset-id"
|
|
30
|
-
}), (0, _testutils.jsx)("hp", null, "world")))
|
|
30
|
+
}), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "world")))
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
title: 'two paragraphs',
|
|
34
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "hello ", (0, _testutils.jsx)("cursor", null)))),
|
|
35
|
-
fragment: (0, _testutils.jsx)("fragment", null, (0, _testutils.jsx)("hp", null, "world"), (0, _testutils.jsx)("hp", null, "line 2")),
|
|
36
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "hello world"), (0, _testutils.jsx)("hp", null, "line 2")))
|
|
34
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "hello ", /*#__PURE__*/ (0, _testutils.jsx)("cursor", null)))),
|
|
35
|
+
fragment: /*#__PURE__*/ (0, _testutils.jsx)("fragment", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "world"), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "line 2")),
|
|
36
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "hello world"), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "line 2")))
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
title: 'two headings',
|
|
40
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "hello ", (0, _testutils.jsx)("cursor", null)))),
|
|
41
|
-
fragment: (0, _testutils.jsx)("fragment", null, (0, _testutils.jsx)("hh1", null, "world"), (0, _testutils.jsx)("hh1", null, "line 2")),
|
|
42
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "hello world"), (0, _testutils.jsx)("hh1", null, "line 2")))
|
|
40
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "hello ", /*#__PURE__*/ (0, _testutils.jsx)("cursor", null)))),
|
|
41
|
+
fragment: /*#__PURE__*/ (0, _testutils.jsx)("fragment", null, /*#__PURE__*/ (0, _testutils.jsx)("hh1", null, "world"), /*#__PURE__*/ (0, _testutils.jsx)("hh1", null, "line 2")),
|
|
42
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "hello world"), /*#__PURE__*/ (0, _testutils.jsx)("hh1", null, "line 2")))
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
title: 'two paragraphs wrapped in a li',
|
|
46
|
-
input: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "hello ", (0, _testutils.jsx)("cursor", null)))),
|
|
47
|
-
fragment: (0, _testutils.jsx)("fragment", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "world"), (0, _testutils.jsx)("hp", null, "line 2"))),
|
|
48
|
-
expected: (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "hello "), (0, _testutils.jsx)("hul", null, (0, _testutils.jsx)("hli", null, (0, _testutils.jsx)("hp", null, "world"), (0, _testutils.jsx)("hp", null, "line 2")))))
|
|
46
|
+
input: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "hello ", /*#__PURE__*/ (0, _testutils.jsx)("cursor", null)))),
|
|
47
|
+
fragment: /*#__PURE__*/ (0, _testutils.jsx)("fragment", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "world"), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "line 2"))),
|
|
48
|
+
expected: /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "hello "), /*#__PURE__*/ (0, _testutils.jsx)("hul", null, /*#__PURE__*/ (0, _testutils.jsx)("hli", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "world"), /*#__PURE__*/ (0, _testutils.jsx)("hp", null, "line 2")))))
|
|
49
49
|
}
|
|
50
50
|
];
|
|
51
|
-
const render = (children)
|
|
51
|
+
const render = (children)=>/*#__PURE__*/ (0, _testutils.jsx)("editor", null, children, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null)));
|
|
52
52
|
for (const t of tests){
|
|
53
53
|
test(t.title, ()=>{
|
|
54
54
|
const { editor } = (0, _testutils.createTestEditor)({
|
|
@@ -101,7 +101,7 @@ const styles = {
|
|
|
101
101
|
};
|
|
102
102
|
function createList(Tag, block) {
|
|
103
103
|
return function List(props) {
|
|
104
|
-
return _react.createElement(Tag, {
|
|
104
|
+
return /*#__PURE__*/ _react.createElement(Tag, {
|
|
105
105
|
...props.attributes,
|
|
106
106
|
className: (0, _emotion.cx)(baseStyle, styles[block])
|
|
107
107
|
}, props.children);
|