@contentful/field-editor-markdown 1.9.5 → 1.10.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/MarkdownEditor.js +12 -12
- package/dist/cjs/components/HeadingSelector.js +3 -3
- package/dist/cjs/components/InsertLinkSelector.js +9 -9
- package/dist/cjs/components/MarkdownBottomBar.js +10 -10
- package/dist/cjs/components/MarkdownConstraints.js +3 -3
- package/dist/cjs/components/MarkdownPreview.js +6 -6
- package/dist/cjs/components/MarkdownPreviewSkeleton.js +2 -2
- package/dist/cjs/components/MarkdownTabs.js +4 -4
- package/dist/cjs/components/MarkdownTextarea/MarkdownTextarea.js +2 -2
- package/dist/cjs/components/MarkdownToolbar.js +59 -59
- package/dist/cjs/components/icons.js +30 -30
- package/dist/cjs/dialogs/CheatsheetModalDialog.js +45 -45
- package/dist/cjs/dialogs/ConfirmInsertAssetModalDialog.js +4 -4
- package/dist/cjs/dialogs/EmdebExternalContentDialog.js +15 -15
- package/dist/cjs/dialogs/InsertLinkModalDialog.js +10 -10
- package/dist/cjs/dialogs/InsertTableModalDialog.js +7 -7
- package/dist/cjs/dialogs/SpecialCharacterModalDialog.js +10 -10
- package/dist/cjs/dialogs/ZenModeModalDialog.js +17 -17
- package/dist/cjs/dialogs/openMarkdownDialog.js +7 -7
- package/dist/cjs/dialogs/renderMarkdownDialog.js +8 -8
- package/dist/cjs/types.js +3 -3
- package/dist/esm/MarkdownEditor.js +12 -12
- package/dist/esm/components/HeadingSelector.js +3 -3
- package/dist/esm/components/InsertLinkSelector.js +9 -9
- package/dist/esm/components/MarkdownBottomBar.js +10 -10
- package/dist/esm/components/MarkdownConstraints.js +3 -3
- package/dist/esm/components/MarkdownPreview.js +6 -6
- package/dist/esm/components/MarkdownPreviewSkeleton.js +2 -2
- package/dist/esm/components/MarkdownTabs.js +4 -4
- package/dist/esm/components/MarkdownTextarea/MarkdownTextarea.js +2 -2
- package/dist/esm/components/MarkdownToolbar.js +59 -59
- package/dist/esm/components/icons.js +30 -30
- package/dist/esm/dialogs/CheatsheetModalDialog.js +45 -45
- package/dist/esm/dialogs/ConfirmInsertAssetModalDialog.js +4 -4
- package/dist/esm/dialogs/EmdebExternalContentDialog.js +15 -15
- package/dist/esm/dialogs/InsertLinkModalDialog.js +10 -10
- package/dist/esm/dialogs/InsertTableModalDialog.js +7 -7
- package/dist/esm/dialogs/SpecialCharacterModalDialog.js +10 -10
- package/dist/esm/dialogs/ZenModeModalDialog.js +17 -17
- package/dist/esm/dialogs/openMarkdownDialog.js +7 -7
- package/dist/esm/dialogs/renderMarkdownDialog.js +8 -8
- package/dist/esm/types.js +3 -3
- package/package.json +6 -4
|
@@ -46,13 +46,13 @@ export const EmbedExternalContentModal = ({ onClose })=>{
|
|
|
46
46
|
}, [
|
|
47
47
|
mainInputRef
|
|
48
48
|
]);
|
|
49
|
-
return React.createElement(React.Fragment, null, React.createElement(ModalContent, {
|
|
49
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(ModalContent, {
|
|
50
50
|
testId: "embed-external-dialog"
|
|
51
|
-
}, React.createElement(Form, null, React.createElement(FormControl, {
|
|
51
|
+
}, /*#__PURE__*/ React.createElement(Form, null, /*#__PURE__*/ React.createElement(FormControl, {
|
|
52
52
|
id: "external-link-url-field",
|
|
53
53
|
isRequired: true,
|
|
54
54
|
isInvalid: !urlIsValid
|
|
55
|
-
}, React.createElement(FormControl.Label, null, "Content URL"), React.createElement(TextInput, {
|
|
55
|
+
}, /*#__PURE__*/ React.createElement(FormControl.Label, null, "Content URL"), /*#__PURE__*/ React.createElement(TextInput, {
|
|
56
56
|
name: "external-link-url",
|
|
57
57
|
value: url,
|
|
58
58
|
onChange: (e)=>{
|
|
@@ -63,58 +63,58 @@ export const EmbedExternalContentModal = ({ onClose })=>{
|
|
|
63
63
|
testId: "external-link-url-field",
|
|
64
64
|
placeholder: "https://example.com",
|
|
65
65
|
ref: mainInputRef
|
|
66
|
-
}), React.createElement(FormControl.HelpText, null, "Include protocol (e.g. https://)"), !urlIsValid && React.createElement(FormControl.ValidationMessage, null, "URL is invalid")), React.createElement(TextLink, {
|
|
66
|
+
}), /*#__PURE__*/ React.createElement(FormControl.HelpText, null, "Include protocol (e.g. https://)"), !urlIsValid && /*#__PURE__*/ React.createElement(FormControl.ValidationMessage, null, "URL is invalid")), /*#__PURE__*/ React.createElement(TextLink, {
|
|
67
67
|
href: "http://embed.ly/providers",
|
|
68
68
|
target: "_blank",
|
|
69
69
|
rel: "noopener noreferrer"
|
|
70
|
-
}, "Supported sources"), React.createElement("div", {
|
|
70
|
+
}, "Supported sources"), /*#__PURE__*/ React.createElement("div", {
|
|
71
71
|
className: styles.widthFiledGroup
|
|
72
|
-
}, React.createElement(FormControl, {
|
|
72
|
+
}, /*#__PURE__*/ React.createElement(FormControl, {
|
|
73
73
|
id: "embedded-content-width",
|
|
74
74
|
isRequired: true,
|
|
75
75
|
isInvalid: !isWidthValid(Number(width), selectedUnit)
|
|
76
|
-
}, React.createElement(FormControl.Label, null, "Width"), React.createElement(TextInput, {
|
|
76
|
+
}, /*#__PURE__*/ React.createElement(FormControl.Label, null, "Width"), /*#__PURE__*/ React.createElement(TextInput, {
|
|
77
77
|
value: width,
|
|
78
78
|
name: "embedded-content-width",
|
|
79
79
|
testId: "embedded-content-width",
|
|
80
80
|
type: "number",
|
|
81
81
|
width: "small",
|
|
82
82
|
onChange: (e)=>setWidth(e.target.value)
|
|
83
|
-
}), !isWidthValid(Number(width), selectedUnit) && React.createElement(FormControl.ValidationMessage, null, "Should be equal or less then 100")), React.createElement("div", {
|
|
83
|
+
}), !isWidthValid(Number(width), selectedUnit) && /*#__PURE__*/ React.createElement(FormControl.ValidationMessage, null, "Should be equal or less then 100")), /*#__PURE__*/ React.createElement("div", {
|
|
84
84
|
className: styles.radioButtonGroup
|
|
85
|
-
}, React.createElement(Radio, {
|
|
85
|
+
}, /*#__PURE__*/ React.createElement(Radio, {
|
|
86
86
|
id: "unit-option-percent",
|
|
87
87
|
value: "percent",
|
|
88
88
|
isChecked: selectedUnit === 'percent',
|
|
89
89
|
onChange: ()=>setUnit('percent'),
|
|
90
90
|
className: styles.radioButton
|
|
91
|
-
}, "percent"), React.createElement(Radio, {
|
|
91
|
+
}, "percent"), /*#__PURE__*/ React.createElement(Radio, {
|
|
92
92
|
id: "unit-option-pixels",
|
|
93
93
|
value: "pixels",
|
|
94
94
|
isChecked: selectedUnit === 'px',
|
|
95
95
|
onChange: ()=>setUnit('px'),
|
|
96
96
|
className: styles.radioButton
|
|
97
|
-
}, "pixels"))), React.createElement(Checkbox, {
|
|
97
|
+
}, "pixels"))), /*#__PURE__*/ React.createElement(Checkbox, {
|
|
98
98
|
id: "attach-social-checkbox",
|
|
99
99
|
name: "attach-social-checkbox",
|
|
100
100
|
value: "Yes",
|
|
101
101
|
isChecked: attachSocial,
|
|
102
102
|
onChange: ()=>setAttachSocial(!attachSocial),
|
|
103
103
|
testId: "attach-social-checkbox"
|
|
104
|
-
}, "Attach social sharing links to this element"), React.createElement(Text, {
|
|
104
|
+
}, "Attach social sharing links to this element"), /*#__PURE__*/ React.createElement(Text, {
|
|
105
105
|
as: "p",
|
|
106
106
|
fontColor: "gray500",
|
|
107
107
|
marginTop: "spacingXs"
|
|
108
|
-
}, "To enable this embedded content in your application make sure to add the ", React.createElement(TextLink, {
|
|
108
|
+
}, "To enable this embedded content in your application make sure to add the ", /*#__PURE__*/ React.createElement(TextLink, {
|
|
109
109
|
href: "http://embed.ly/docs/products/cards",
|
|
110
110
|
target: "_blank",
|
|
111
111
|
rel: "noopener noreferrer"
|
|
112
|
-
}, "Embedly's platform.js"), " on your development environment"))), React.createElement(ModalControls, null, React.createElement(Button, {
|
|
112
|
+
}, "Embedly's platform.js"), " on your development environment"))), /*#__PURE__*/ React.createElement(ModalControls, null, /*#__PURE__*/ React.createElement(Button, {
|
|
113
113
|
testId: "emded-external-cancel",
|
|
114
114
|
onClick: ()=>onClose(false),
|
|
115
115
|
variant: "secondary",
|
|
116
116
|
size: "small"
|
|
117
|
-
}, "Cancel"), React.createElement(Button, {
|
|
117
|
+
}, "Cancel"), /*#__PURE__*/ React.createElement(Button, {
|
|
118
118
|
testId: "embed-external-confirm",
|
|
119
119
|
onClick: ()=>onClose(makeEmbedlyLink({
|
|
120
120
|
url,
|
|
@@ -17,28 +17,28 @@ export const InsertLinkModal = ({ selectedText, onClose })=>{
|
|
|
17
17
|
}, [
|
|
18
18
|
mainInputRef
|
|
19
19
|
]);
|
|
20
|
-
return React.createElement(React.Fragment, null, React.createElement(ModalContent, {
|
|
20
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(ModalContent, {
|
|
21
21
|
testId: "insert-link-modal"
|
|
22
|
-
}, React.createElement(Form, {
|
|
22
|
+
}, /*#__PURE__*/ React.createElement(Form, {
|
|
23
23
|
onSubmit: ()=>onInsert({
|
|
24
24
|
url,
|
|
25
25
|
text,
|
|
26
26
|
title
|
|
27
27
|
})
|
|
28
|
-
}, React.createElement(FormControl, {
|
|
28
|
+
}, /*#__PURE__*/ React.createElement(FormControl, {
|
|
29
29
|
id: "link-text-field",
|
|
30
30
|
isDisabled: Boolean(selectedText)
|
|
31
|
-
}, React.createElement(FormControl.Label, null, "Link text"), React.createElement(TextInput, {
|
|
31
|
+
}, /*#__PURE__*/ React.createElement(FormControl.Label, null, "Link text"), /*#__PURE__*/ React.createElement(TextInput, {
|
|
32
32
|
name: "link-text",
|
|
33
33
|
value: text,
|
|
34
34
|
onChange: (e)=>{
|
|
35
35
|
setText(e.target.value);
|
|
36
36
|
},
|
|
37
37
|
testId: "link-text-field"
|
|
38
|
-
})), React.createElement(FormControl, {
|
|
38
|
+
})), /*#__PURE__*/ React.createElement(FormControl, {
|
|
39
39
|
id: "target-url-field",
|
|
40
40
|
isInvalid: touched && !urlIsValid
|
|
41
|
-
}, React.createElement(FormControl.Label, null, "Target URL"), React.createElement(TextInput, {
|
|
41
|
+
}, /*#__PURE__*/ React.createElement(FormControl.Label, null, "Target URL"), /*#__PURE__*/ React.createElement(TextInput, {
|
|
42
42
|
name: "target-url",
|
|
43
43
|
value: url,
|
|
44
44
|
onChange: (e)=>{
|
|
@@ -49,21 +49,21 @@ export const InsertLinkModal = ({ selectedText, onClose })=>{
|
|
|
49
49
|
maxLength: 2100,
|
|
50
50
|
testId: "target-url-field",
|
|
51
51
|
ref: mainInputRef
|
|
52
|
-
}), React.createElement(FormControl.HelpText, null, "Include protocol (e.g. https://)"), touched && !urlIsValid && React.createElement(FormControl.ValidationMessage, null, "Invalid URL")), React.createElement(FormControl, {
|
|
52
|
+
}), /*#__PURE__*/ React.createElement(FormControl.HelpText, null, "Include protocol (e.g. https://)"), touched && !urlIsValid && /*#__PURE__*/ React.createElement(FormControl.ValidationMessage, null, "Invalid URL")), /*#__PURE__*/ React.createElement(FormControl, {
|
|
53
53
|
id: "link-title-field"
|
|
54
|
-
}, React.createElement(FormControl.Label, null, "Link title"), React.createElement(TextInput, {
|
|
54
|
+
}, /*#__PURE__*/ React.createElement(FormControl.Label, null, "Link title"), /*#__PURE__*/ React.createElement(TextInput, {
|
|
55
55
|
name: "link-title",
|
|
56
56
|
value: title,
|
|
57
57
|
onChange: (e)=>{
|
|
58
58
|
setTitle(e.target.value);
|
|
59
59
|
},
|
|
60
60
|
testId: "link-title-field"
|
|
61
|
-
}), React.createElement(FormControl.HelpText, null, "Extra link information, usually shown as a tooltip on mouse hover")))), React.createElement(ModalControls, null, React.createElement(Button, {
|
|
61
|
+
}), /*#__PURE__*/ React.createElement(FormControl.HelpText, null, "Extra link information, usually shown as a tooltip on mouse hover")))), /*#__PURE__*/ React.createElement(ModalControls, null, /*#__PURE__*/ React.createElement(Button, {
|
|
62
62
|
testId: "insert-link-cancel",
|
|
63
63
|
onClick: ()=>onClose(false),
|
|
64
64
|
variant: "secondary",
|
|
65
65
|
size: "small"
|
|
66
|
-
}, "Cancel"), React.createElement(Button, {
|
|
66
|
+
}, "Cancel"), /*#__PURE__*/ React.createElement(Button, {
|
|
67
67
|
testId: "insert-link-confirm",
|
|
68
68
|
onClick: ()=>{
|
|
69
69
|
onInsert({
|
|
@@ -15,13 +15,13 @@ export const InsertTableModal = ({ onClose })=>{
|
|
|
15
15
|
}, [
|
|
16
16
|
mainInputRef
|
|
17
17
|
]);
|
|
18
|
-
return React.createElement(React.Fragment, null, React.createElement(ModalContent, {
|
|
18
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(ModalContent, {
|
|
19
19
|
testId: "insert-table-modal"
|
|
20
|
-
}, React.createElement(Form, null, React.createElement(FormControl, {
|
|
20
|
+
}, /*#__PURE__*/ React.createElement(Form, null, /*#__PURE__*/ React.createElement(FormControl, {
|
|
21
21
|
id: "insert-table-rows-number-field",
|
|
22
22
|
isRequired: true,
|
|
23
23
|
isInvalid: !rowsAreValid
|
|
24
|
-
}, React.createElement(FormControl.Label, null, "Number of rows"), React.createElement(TextInput, {
|
|
24
|
+
}, /*#__PURE__*/ React.createElement(FormControl.Label, null, "Number of rows"), /*#__PURE__*/ React.createElement(TextInput, {
|
|
25
25
|
name: "rows",
|
|
26
26
|
value: rows.toString(),
|
|
27
27
|
onChange: (e)=>setRows(Number(e.target.value)),
|
|
@@ -33,11 +33,11 @@ export const InsertTableModal = ({ onClose })=>{
|
|
|
33
33
|
width: "small",
|
|
34
34
|
autoComplete: "off",
|
|
35
35
|
ref: mainInputRef
|
|
36
|
-
}), !rowsAreValid && React.createElement(FormControl.ValidationMessage, null, "Should be between 2 and 100")), React.createElement(FormControl, {
|
|
36
|
+
}), !rowsAreValid && /*#__PURE__*/ React.createElement(FormControl.ValidationMessage, null, "Should be between 2 and 100")), /*#__PURE__*/ React.createElement(FormControl, {
|
|
37
37
|
id: "insert-table-columns-number-field",
|
|
38
38
|
isRequired: true,
|
|
39
39
|
isInvalid: !colsAreValid
|
|
40
|
-
}, React.createElement(FormControl.Label, null, "Number of columns"), React.createElement(TextInput, {
|
|
40
|
+
}, /*#__PURE__*/ React.createElement(FormControl.Label, null, "Number of columns"), /*#__PURE__*/ React.createElement(TextInput, {
|
|
41
41
|
name: "columns",
|
|
42
42
|
value: cols.toString(),
|
|
43
43
|
onChange: (e)=>setColumns(Number(e.target.value)),
|
|
@@ -48,12 +48,12 @@ export const InsertTableModal = ({ onClose })=>{
|
|
|
48
48
|
type: "number",
|
|
49
49
|
width: "small",
|
|
50
50
|
autoComplete: "off"
|
|
51
|
-
}), !colsAreValid && React.createElement(FormControl.ValidationMessage, null, "Should be between 1 and 100")))), React.createElement(ModalControls, null, React.createElement(Button, {
|
|
51
|
+
}), !colsAreValid && /*#__PURE__*/ React.createElement(FormControl.ValidationMessage, null, "Should be between 1 and 100")))), /*#__PURE__*/ React.createElement(ModalControls, null, /*#__PURE__*/ React.createElement(Button, {
|
|
52
52
|
testId: "insert-table-cancel",
|
|
53
53
|
onClick: ()=>onClose(false),
|
|
54
54
|
variant: "secondary",
|
|
55
55
|
size: "small"
|
|
56
|
-
}, "Cancel"), React.createElement(Button, {
|
|
56
|
+
}, "Cancel"), /*#__PURE__*/ React.createElement(Button, {
|
|
57
57
|
testId: "insert-table-confirm",
|
|
58
58
|
onClick: ()=>onClose({
|
|
59
59
|
rows,
|
|
@@ -30,39 +30,39 @@ const styles = {
|
|
|
30
30
|
};
|
|
31
31
|
export const SpecialCharacterModalDialog = ({ onClose })=>{
|
|
32
32
|
const [selectedCharacter, setSelectedCharacter] = useState(specialCharacters[0]);
|
|
33
|
-
return React.createElement(React.Fragment, null, React.createElement(ModalContent, {
|
|
33
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(ModalContent, {
|
|
34
34
|
testId: "insert-special-character-modal"
|
|
35
|
-
}, React.createElement(Flex, {
|
|
35
|
+
}, /*#__PURE__*/ React.createElement(Flex, {
|
|
36
36
|
flexDirection: "column",
|
|
37
37
|
alignItems: "center"
|
|
38
|
-
}, React.createElement(Text, {
|
|
38
|
+
}, /*#__PURE__*/ React.createElement(Text, {
|
|
39
39
|
as: "div",
|
|
40
40
|
lineHeight: "lineHeight3Xl",
|
|
41
41
|
fontSize: "fontSize3Xl",
|
|
42
42
|
marginBottom: "spacingS"
|
|
43
|
-
}, String.fromCharCode(selectedCharacter.code)), React.createElement(Text, {
|
|
43
|
+
}, String.fromCharCode(selectedCharacter.code)), /*#__PURE__*/ React.createElement(Text, {
|
|
44
44
|
as: "div",
|
|
45
45
|
marginBottom: "spacingS"
|
|
46
|
-
}, selectedCharacter.desc)), React.createElement("div", {
|
|
46
|
+
}, selectedCharacter.desc)), /*#__PURE__*/ React.createElement("div", {
|
|
47
47
|
className: styles.buttonPanel
|
|
48
|
-
}, specialCharacters.map((char)
|
|
48
|
+
}, specialCharacters.map((char)=>/*#__PURE__*/ React.createElement("div", {
|
|
49
49
|
key: char.code
|
|
50
|
-
}, React.createElement(Tooltip, {
|
|
50
|
+
}, /*#__PURE__*/ React.createElement(Tooltip, {
|
|
51
51
|
className: styles.tooltip,
|
|
52
52
|
content: char.desc
|
|
53
|
-
}, React.createElement(Button, {
|
|
53
|
+
}, /*#__PURE__*/ React.createElement(Button, {
|
|
54
54
|
testId: "special-character-button",
|
|
55
55
|
isActive: char.code === selectedCharacter.code,
|
|
56
56
|
className: styles.charButton,
|
|
57
57
|
variant: "transparent",
|
|
58
58
|
onClick: ()=>setSelectedCharacter(char)
|
|
59
|
-
}, String.fromCharCode(char.code))))))), React.createElement(ModalControls, null, React.createElement(Button, {
|
|
59
|
+
}, String.fromCharCode(char.code))))))), /*#__PURE__*/ React.createElement(ModalControls, null, /*#__PURE__*/ React.createElement(Button, {
|
|
60
60
|
testId: "insert-character-cancel",
|
|
61
61
|
className: styles.button,
|
|
62
62
|
onClick: ()=>onClose(false),
|
|
63
63
|
variant: "secondary",
|
|
64
64
|
size: "small"
|
|
65
|
-
}, "Cancel"), React.createElement(Button, {
|
|
65
|
+
}, "Cancel"), /*#__PURE__*/ React.createElement(Button, {
|
|
66
66
|
className: styles.button,
|
|
67
67
|
testId: "insert-character-confirm",
|
|
68
68
|
onClick: ()=>onClose(String.fromCharCode(selectedCharacter.code)),
|
|
@@ -10,7 +10,7 @@ import { MarkdownToolbar } from '../components/MarkdownToolbar';
|
|
|
10
10
|
import { openCheatsheetModal } from '../dialogs/CheatsheetModalDialog';
|
|
11
11
|
import { createMarkdownActions } from '../MarkdownActions';
|
|
12
12
|
import { MarkdownDialogType } from '../types';
|
|
13
|
-
const MarkdownPreview = React.lazy(()=>import('../components/MarkdownPreview'));
|
|
13
|
+
const MarkdownPreview = /*#__PURE__*/ React.lazy(()=>import('../components/MarkdownPreview'));
|
|
14
14
|
const styles = {
|
|
15
15
|
root: css({
|
|
16
16
|
display: 'grid',
|
|
@@ -102,21 +102,21 @@ export const ZenModeModalDialog = (props)=>{
|
|
|
102
102
|
});
|
|
103
103
|
};
|
|
104
104
|
const direction = props.sdk.locales.direction[props.locale] ?? 'ltr';
|
|
105
|
-
return React.createElement(Grid, {
|
|
105
|
+
return /*#__PURE__*/ React.createElement(Grid, {
|
|
106
106
|
className: styles.root,
|
|
107
107
|
"data-test-id": "zen-mode-markdown-editor"
|
|
108
|
-
}, React.createElement(Grid.Item, {
|
|
108
|
+
}, /*#__PURE__*/ React.createElement(Grid.Item, {
|
|
109
109
|
className: styles.topSplit
|
|
110
|
-
}, React.createElement(MarkdownToolbar, {
|
|
110
|
+
}, /*#__PURE__*/ React.createElement(MarkdownToolbar, {
|
|
111
111
|
mode: "zen",
|
|
112
112
|
disabled: false,
|
|
113
113
|
canUploadAssets: false,
|
|
114
114
|
actions: actions
|
|
115
|
-
})), React.createElement(Grid.Item, {
|
|
115
|
+
})), /*#__PURE__*/ React.createElement(Grid.Item, {
|
|
116
116
|
className: cx(styles.editorSplit, {
|
|
117
117
|
[styles.editorSplitFullscreen]: showPreview === false
|
|
118
118
|
})
|
|
119
|
-
}, React.createElement(MarkdownTextarea, {
|
|
119
|
+
}, /*#__PURE__*/ React.createElement(MarkdownTextarea, {
|
|
120
120
|
mode: "zen",
|
|
121
121
|
visible: true,
|
|
122
122
|
disabled: false,
|
|
@@ -131,40 +131,40 @@ export const ZenModeModalDialog = (props)=>{
|
|
|
131
131
|
props.saveValueToSDK(value);
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
})), showPreview && React.createElement(Grid.Item, {
|
|
134
|
+
})), showPreview && /*#__PURE__*/ React.createElement(Grid.Item, {
|
|
135
135
|
className: styles.previewSplit
|
|
136
|
-
}, React.createElement(React.Suspense, {
|
|
137
|
-
fallback: React.createElement(MarkdownPreviewSkeleton, null)
|
|
138
|
-
}, React.createElement(MarkdownPreview, {
|
|
136
|
+
}, /*#__PURE__*/ React.createElement(React.Suspense, {
|
|
137
|
+
fallback: /*#__PURE__*/ React.createElement(MarkdownPreviewSkeleton, null)
|
|
138
|
+
}, /*#__PURE__*/ React.createElement(MarkdownPreview, {
|
|
139
139
|
direction: direction,
|
|
140
140
|
mode: "zen",
|
|
141
141
|
value: currentValue,
|
|
142
142
|
previewComponents: props.previewComponents
|
|
143
|
-
}))), showPreview && React.createElement(Grid.Item, {
|
|
143
|
+
}))), showPreview && /*#__PURE__*/ React.createElement(Grid.Item, {
|
|
144
144
|
className: styles.separator
|
|
145
|
-
}), showPreview && React.createElement("button", {
|
|
145
|
+
}), showPreview && /*#__PURE__*/ React.createElement("button", {
|
|
146
146
|
className: cx(styles.button, styles.hideButton),
|
|
147
147
|
"aria-label": "Hide preview",
|
|
148
148
|
onClick: ()=>{
|
|
149
149
|
setShowPreview(false);
|
|
150
150
|
}
|
|
151
|
-
}, React.createElement(ChevronRightIcon, {
|
|
151
|
+
}, /*#__PURE__*/ React.createElement(ChevronRightIcon, {
|
|
152
152
|
variant: "muted",
|
|
153
153
|
size: "tiny",
|
|
154
154
|
className: styles.icon
|
|
155
|
-
})), !showPreview && React.createElement("button", {
|
|
155
|
+
})), !showPreview && /*#__PURE__*/ React.createElement("button", {
|
|
156
156
|
className: cx(styles.button, styles.showButton),
|
|
157
157
|
"aria-label": "Show preview",
|
|
158
158
|
onClick: ()=>{
|
|
159
159
|
setShowPreview(true);
|
|
160
160
|
}
|
|
161
|
-
}, React.createElement(ChevronLeftIcon, {
|
|
161
|
+
}, /*#__PURE__*/ React.createElement(ChevronLeftIcon, {
|
|
162
162
|
variant: "muted",
|
|
163
163
|
size: "tiny",
|
|
164
164
|
className: styles.icon
|
|
165
|
-
})), React.createElement(Grid.Item, {
|
|
165
|
+
})), /*#__PURE__*/ React.createElement(Grid.Item, {
|
|
166
166
|
className: styles.bottomSplit
|
|
167
|
-
}, React.createElement(MarkdownBottomBar, null, React.createElement(MarkdownHelp, {
|
|
167
|
+
}, /*#__PURE__*/ React.createElement(MarkdownBottomBar, null, /*#__PURE__*/ React.createElement(MarkdownHelp, {
|
|
168
168
|
mode: "zen",
|
|
169
169
|
onClick: ()=>{
|
|
170
170
|
openCheatsheetModal(props.sdk.dialogs);
|
|
@@ -11,31 +11,31 @@ import { ZenModeModalDialog } from './ZenModeModalDialog';
|
|
|
11
11
|
export const openMarkdownDialog = (sdk, previewComponents)=>(options)=>{
|
|
12
12
|
if (options.parameters?.type === MarkdownDialogType.cheatsheet) {
|
|
13
13
|
return ModalDialogLauncher.openDialog(options, ()=>{
|
|
14
|
-
return React.createElement(CheatsheetModalDialog, null);
|
|
14
|
+
return /*#__PURE__*/ React.createElement(CheatsheetModalDialog, null);
|
|
15
15
|
});
|
|
16
16
|
} else if (options.parameters?.type === MarkdownDialogType.insertLink) {
|
|
17
17
|
const selectedText = options.parameters.selectedText;
|
|
18
18
|
return ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
19
|
-
return React.createElement(InsertLinkModal, {
|
|
19
|
+
return /*#__PURE__*/ React.createElement(InsertLinkModal, {
|
|
20
20
|
selectedText: selectedText,
|
|
21
21
|
onClose: onClose
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
24
|
} else if (options.parameters?.type === MarkdownDialogType.insertSpecialCharacter) {
|
|
25
25
|
return ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
26
|
-
return React.createElement(SpecialCharacterModalDialog, {
|
|
26
|
+
return /*#__PURE__*/ React.createElement(SpecialCharacterModalDialog, {
|
|
27
27
|
onClose: onClose
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
30
|
} else if (options.parameters?.type === MarkdownDialogType.insertTable) {
|
|
31
31
|
return ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
32
|
-
return React.createElement(InsertTableModal, {
|
|
32
|
+
return /*#__PURE__*/ React.createElement(InsertTableModal, {
|
|
33
33
|
onClose: onClose
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
36
|
} else if (options.parameters?.type === MarkdownDialogType.embedExternalContent) {
|
|
37
37
|
return ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
38
|
-
return React.createElement(EmbedExternalContentModal, {
|
|
38
|
+
return /*#__PURE__*/ React.createElement(EmbedExternalContentModal, {
|
|
39
39
|
onClose: onClose
|
|
40
40
|
});
|
|
41
41
|
});
|
|
@@ -43,7 +43,7 @@ export const openMarkdownDialog = (sdk, previewComponents)=>(options)=>{
|
|
|
43
43
|
const locale = options.parameters.locale;
|
|
44
44
|
const assets = options.parameters.assets;
|
|
45
45
|
return ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
46
|
-
return React.createElement(ConfirmInsertAssetModalDialog, {
|
|
46
|
+
return /*#__PURE__*/ React.createElement(ConfirmInsertAssetModalDialog, {
|
|
47
47
|
onClose: onClose,
|
|
48
48
|
locale: locale,
|
|
49
49
|
assets: assets
|
|
@@ -53,7 +53,7 @@ export const openMarkdownDialog = (sdk, previewComponents)=>(options)=>{
|
|
|
53
53
|
const initialValue = options.parameters.initialValue;
|
|
54
54
|
const locale = options.parameters.locale;
|
|
55
55
|
return ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
56
|
-
return React.createElement(ZenModeModalDialog, {
|
|
56
|
+
return /*#__PURE__*/ React.createElement(ZenModeModalDialog, {
|
|
57
57
|
saveValueToSDK: (value)=>{
|
|
58
58
|
if (value) {
|
|
59
59
|
return sdk?.field?.setValue(value);
|
|
@@ -11,34 +11,34 @@ export const renderMarkdownDialog = (sdk)=>{
|
|
|
11
11
|
const parameters = sdk.parameters.invocation;
|
|
12
12
|
if (parameters.type === MarkdownDialogType.cheatsheet) {
|
|
13
13
|
sdk.window.startAutoResizer();
|
|
14
|
-
return React.createElement(CheatsheetModalDialog, null);
|
|
14
|
+
return /*#__PURE__*/ React.createElement(CheatsheetModalDialog, null);
|
|
15
15
|
} else if (parameters.type === MarkdownDialogType.insertLink) {
|
|
16
16
|
const selectedText = parameters.selectedText;
|
|
17
17
|
sdk.window.startAutoResizer();
|
|
18
|
-
return React.createElement(InsertLinkModal, {
|
|
18
|
+
return /*#__PURE__*/ React.createElement(InsertLinkModal, {
|
|
19
19
|
selectedText: selectedText,
|
|
20
20
|
onClose: sdk.close
|
|
21
21
|
});
|
|
22
22
|
} else if (parameters.type === MarkdownDialogType.insertSpecialCharacter) {
|
|
23
23
|
sdk.window.startAutoResizer();
|
|
24
|
-
return React.createElement(SpecialCharacterModalDialog, {
|
|
24
|
+
return /*#__PURE__*/ React.createElement(SpecialCharacterModalDialog, {
|
|
25
25
|
onClose: sdk.close
|
|
26
26
|
});
|
|
27
27
|
} else if (parameters.type === MarkdownDialogType.insertTable) {
|
|
28
28
|
sdk.window.startAutoResizer();
|
|
29
|
-
return React.createElement(InsertTableModal, {
|
|
29
|
+
return /*#__PURE__*/ React.createElement(InsertTableModal, {
|
|
30
30
|
onClose: sdk.close
|
|
31
31
|
});
|
|
32
32
|
} else if (parameters.type === MarkdownDialogType.embedExternalContent) {
|
|
33
33
|
sdk.window.startAutoResizer();
|
|
34
|
-
return React.createElement(EmbedExternalContentModal, {
|
|
34
|
+
return /*#__PURE__*/ React.createElement(EmbedExternalContentModal, {
|
|
35
35
|
onClose: sdk.close
|
|
36
36
|
});
|
|
37
37
|
} else if (parameters.type === MarkdownDialogType.confirmInsertAsset) {
|
|
38
38
|
const locale = parameters.locale;
|
|
39
39
|
const assets = parameters.assets;
|
|
40
40
|
sdk.window.startAutoResizer();
|
|
41
|
-
return React.createElement(ConfirmInsertAssetModalDialog, {
|
|
41
|
+
return /*#__PURE__*/ React.createElement(ConfirmInsertAssetModalDialog, {
|
|
42
42
|
onClose: sdk.close,
|
|
43
43
|
locale: locale,
|
|
44
44
|
assets: assets
|
|
@@ -47,7 +47,7 @@ export const renderMarkdownDialog = (sdk)=>{
|
|
|
47
47
|
const locale = parameters.locale;
|
|
48
48
|
const initialValue = parameters.initialValue;
|
|
49
49
|
sdk.window.updateHeight('100%');
|
|
50
|
-
return React.createElement(ZenModeModalDialog, {
|
|
50
|
+
return /*#__PURE__*/ React.createElement(ZenModeModalDialog, {
|
|
51
51
|
onClose: sdk.close,
|
|
52
52
|
saveValueToSDK: ()=>{},
|
|
53
53
|
initialValue: initialValue,
|
|
@@ -55,5 +55,5 @@ export const renderMarkdownDialog = (sdk)=>{
|
|
|
55
55
|
sdk: sdk
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
return React.createElement("div", null);
|
|
58
|
+
return /*#__PURE__*/ React.createElement("div", null);
|
|
59
59
|
};
|
package/dist/esm/types.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export var MarkdownDialogType
|
|
1
|
+
export var MarkdownDialogType;
|
|
2
|
+
(function(MarkdownDialogType) {
|
|
2
3
|
MarkdownDialogType["cheatsheet"] = "markdown-cheatsheet";
|
|
3
4
|
MarkdownDialogType["insertLink"] = "markdown-insertLink";
|
|
4
5
|
MarkdownDialogType["insertSpecialCharacter"] = "markdown-insertSpecialCharacter";
|
|
@@ -6,5 +7,4 @@ export var MarkdownDialogType = /*#__PURE__*/ function(MarkdownDialogType) {
|
|
|
6
7
|
MarkdownDialogType["embedExternalContent"] = "markdown-embedExternalContent";
|
|
7
8
|
MarkdownDialogType["confirmInsertAsset"] = "markdown-confirmInsertAsset";
|
|
8
9
|
MarkdownDialogType["zenMode"] = "markdown-zenMode";
|
|
9
|
-
|
|
10
|
-
}({});
|
|
10
|
+
})(MarkdownDialogType || (MarkdownDialogType = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-markdown",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@contentful/f36-components": "^4.70.0",
|
|
39
39
|
"@contentful/f36-icons": "^4.29.0",
|
|
40
40
|
"@contentful/f36-tokens": "^4.0.5",
|
|
41
|
-
"@contentful/field-editor-shared": "^2.
|
|
41
|
+
"@contentful/field-editor-shared": "^2.8.0",
|
|
42
42
|
"@types/codemirror": "0.0.109",
|
|
43
43
|
"codemirror": "^5.65.11",
|
|
44
44
|
"constate": "^3.3.2",
|
|
@@ -52,14 +52,16 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@babel/core": "^7.5.5",
|
|
54
54
|
"@contentful/app-sdk": "^4.29.0",
|
|
55
|
-
"@contentful/field-editor-test-utils": "^1.5.2"
|
|
55
|
+
"@contentful/field-editor-test-utils": "^1.5.2",
|
|
56
|
+
"@lingui/core": "5.3.0"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
59
|
"@contentful/app-sdk": "^4.29.0",
|
|
60
|
+
"@lingui/core": "^5.3.0",
|
|
59
61
|
"react": ">=16.8.0"
|
|
60
62
|
},
|
|
61
63
|
"publishConfig": {
|
|
62
64
|
"registry": "https://npm.pkg.github.com/"
|
|
63
65
|
},
|
|
64
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "a86f67a6d507eb7c8c7a38b4312380361bdbebbb"
|
|
65
67
|
}
|