@contentful/field-editor-markdown 2.4.4-canary.26 → 2.4.4-canary.30
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 +15 -15
- package/dist/cjs/__fixtures__/asset/index.js +6 -6
- package/dist/cjs/__fixtures__/entry/index.js +5 -5
- package/dist/cjs/__fixtures__/fixtures.js +6 -6
- package/dist/cjs/__fixtures__/locale/index.js +4 -4
- package/dist/cjs/components/HeadingSelector.js +5 -5
- package/dist/cjs/components/InsertLinkSelector.js +9 -9
- package/dist/cjs/components/MarkdownBottomBar.js +14 -14
- 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 +62 -62
- package/dist/cjs/components/MarkdownToolbar.spec.js +4 -4
- package/dist/cjs/dialogs/CheatsheetModalDialog.js +48 -48
- package/dist/cjs/dialogs/ConfirmInsertAssetModalDialog.js +8 -8
- package/dist/cjs/dialogs/EmdebExternalContentDialog.js +21 -21
- package/dist/cjs/dialogs/InsertLinkModalDialog.js +13 -13
- package/dist/cjs/dialogs/InsertTableModalDialog.js +10 -10
- package/dist/cjs/dialogs/SpecialCharacterModalDialog.js +13 -13
- package/dist/cjs/dialogs/ZenModeModalDialog.js +20 -20
- package/dist/cjs/dialogs/openMarkdownDialog.js +7 -7
- package/dist/cjs/dialogs/renderMarkdownDialog.js +8 -8
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/types.js +3 -3
- package/dist/cjs/utils/insertAssetLinks.js +3 -3
- package/dist/cjs/utils/isValidUrl.js +3 -3
- package/dist/cjs/utils/linkOrganizer.js +7 -7
- package/dist/esm/MarkdownEditor.js +12 -12
- package/dist/esm/components/HeadingSelector.js +5 -5
- 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 +58 -58
- package/dist/esm/components/MarkdownToolbar.spec.js +4 -4
- package/dist/esm/dialogs/CheatsheetModalDialog.js +45 -45
- package/dist/esm/dialogs/ConfirmInsertAssetModalDialog.js +5 -5
- package/dist/esm/dialogs/EmdebExternalContentDialog.js +18 -18
- 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 +5 -5
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
EmbedExternalContentModal
|
|
12
|
+
get EmbedExternalContentModal () {
|
|
13
13
|
return EmbedExternalContentModal;
|
|
14
14
|
},
|
|
15
|
-
openEmbedExternalContentDialog
|
|
15
|
+
get openEmbedExternalContentDialog () {
|
|
16
16
|
return openEmbedExternalContentDialog;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -111,16 +111,16 @@ const EmbedExternalContentModal = ({ onClose })=>{
|
|
|
111
111
|
}, [
|
|
112
112
|
mainInputRef
|
|
113
113
|
]);
|
|
114
|
-
return
|
|
114
|
+
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_f36components.ModalContent, {
|
|
115
115
|
testId: "embed-external-dialog"
|
|
116
|
-
},
|
|
116
|
+
}, _react.default.createElement(_f36components.Form, null, _react.default.createElement(_f36components.FormControl, {
|
|
117
117
|
id: "external-link-url-field",
|
|
118
118
|
isRequired: true,
|
|
119
119
|
isInvalid: !urlIsValid
|
|
120
|
-
},
|
|
120
|
+
}, _react.default.createElement(_f36components.FormControl.Label, null, _core.i18n._({
|
|
121
121
|
id: "FieldEditors.Markdown.EmbedExternalContent.ContentURL",
|
|
122
122
|
message: "Content URL"
|
|
123
|
-
})),
|
|
123
|
+
})), _react.default.createElement(_f36components.TextInput, {
|
|
124
124
|
name: "external-link-url",
|
|
125
125
|
value: url,
|
|
126
126
|
onChange: (e)=>{
|
|
@@ -131,64 +131,64 @@ const EmbedExternalContentModal = ({ onClose })=>{
|
|
|
131
131
|
testId: "external-link-url-field",
|
|
132
132
|
placeholder: "https://example.com",
|
|
133
133
|
ref: mainInputRef
|
|
134
|
-
}),
|
|
134
|
+
}), _react.default.createElement(_f36components.FormControl.HelpText, null, _core.i18n._({
|
|
135
135
|
id: "FieldEditors.Markdown.EmbedExternalContent.ProtocolHelpText",
|
|
136
136
|
message: "Include protocol (e.g. https://"
|
|
137
|
-
})), !urlIsValid &&
|
|
137
|
+
})), !urlIsValid && _react.default.createElement(_f36components.FormControl.ValidationMessage, null, _core.i18n._({
|
|
138
138
|
id: "FieldEditors.Markdown.EmbedExternalContent.URLInvalidMessage",
|
|
139
139
|
message: "URL is invalid"
|
|
140
|
-
}))),
|
|
140
|
+
}))), _react.default.createElement(_f36components.TextLink, {
|
|
141
141
|
href: "http://embed.ly/providers",
|
|
142
142
|
target: "_blank",
|
|
143
143
|
rel: "noopener noreferrer"
|
|
144
|
-
}, "Supported sources"),
|
|
144
|
+
}, "Supported sources"), _react.default.createElement("div", {
|
|
145
145
|
className: styles.widthFiledGroup
|
|
146
|
-
},
|
|
146
|
+
}, _react.default.createElement(_f36components.FormControl, {
|
|
147
147
|
id: "embedded-content-width",
|
|
148
148
|
isRequired: true,
|
|
149
149
|
isInvalid: !isWidthValid(Number(width), selectedUnit)
|
|
150
|
-
},
|
|
150
|
+
}, _react.default.createElement(_f36components.FormControl.Label, null, "Width"), _react.default.createElement(_f36components.TextInput, {
|
|
151
151
|
value: width,
|
|
152
152
|
name: "embedded-content-width",
|
|
153
153
|
testId: "embedded-content-width",
|
|
154
154
|
type: "number",
|
|
155
155
|
width: "small",
|
|
156
156
|
onChange: (e)=>setWidth(e.target.value)
|
|
157
|
-
}), !isWidthValid(Number(width), selectedUnit) &&
|
|
157
|
+
}), !isWidthValid(Number(width), selectedUnit) && _react.default.createElement(_f36components.FormControl.ValidationMessage, null, "Should be equal or less then 100")), _react.default.createElement("div", {
|
|
158
158
|
className: styles.radioButtonGroup
|
|
159
|
-
},
|
|
159
|
+
}, _react.default.createElement(_f36components.Radio, {
|
|
160
160
|
id: "unit-option-percent",
|
|
161
161
|
value: "percent",
|
|
162
162
|
isChecked: selectedUnit === 'percent',
|
|
163
163
|
onChange: ()=>setUnit('percent'),
|
|
164
164
|
className: styles.radioButton
|
|
165
|
-
}, "percent"),
|
|
165
|
+
}, "percent"), _react.default.createElement(_f36components.Radio, {
|
|
166
166
|
id: "unit-option-pixels",
|
|
167
167
|
value: "pixels",
|
|
168
168
|
isChecked: selectedUnit === 'px',
|
|
169
169
|
onChange: ()=>setUnit('px'),
|
|
170
170
|
className: styles.radioButton
|
|
171
|
-
}, "pixels"))),
|
|
171
|
+
}, "pixels"))), _react.default.createElement(_f36components.Checkbox, {
|
|
172
172
|
id: "attach-social-checkbox",
|
|
173
173
|
name: "attach-social-checkbox",
|
|
174
174
|
value: "Yes",
|
|
175
175
|
isChecked: attachSocial,
|
|
176
176
|
onChange: ()=>setAttachSocial(!attachSocial),
|
|
177
177
|
testId: "attach-social-checkbox"
|
|
178
|
-
}, "Attach social sharing links to this element"),
|
|
178
|
+
}, "Attach social sharing links to this element"), _react.default.createElement(_f36components.Text, {
|
|
179
179
|
as: "p",
|
|
180
180
|
fontColor: "gray500",
|
|
181
181
|
marginTop: "spacingXs"
|
|
182
|
-
}, "To enable this embedded content in your application make sure to add the ",
|
|
182
|
+
}, "To enable this embedded content in your application make sure to add the ", _react.default.createElement(_f36components.TextLink, {
|
|
183
183
|
href: "http://embed.ly/docs/products/cards",
|
|
184
184
|
target: "_blank",
|
|
185
185
|
rel: "noopener noreferrer"
|
|
186
|
-
}, "Embedly's platform.js"), " on your development environment"))),
|
|
186
|
+
}, "Embedly's platform.js"), " on your development environment"))), _react.default.createElement(_f36components.ModalControls, null, _react.default.createElement(_f36components.Button, {
|
|
187
187
|
testId: "emded-external-cancel",
|
|
188
188
|
onClick: ()=>onClose(false),
|
|
189
189
|
variant: "secondary",
|
|
190
190
|
size: "small"
|
|
191
|
-
}, "Cancel"),
|
|
191
|
+
}, "Cancel"), _react.default.createElement(_f36components.Button, {
|
|
192
192
|
testId: "embed-external-confirm",
|
|
193
193
|
onClick: ()=>onClose(makeEmbedlyLink({
|
|
194
194
|
url,
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
InsertLinkModal
|
|
12
|
+
get InsertLinkModal () {
|
|
13
13
|
return InsertLinkModal;
|
|
14
14
|
},
|
|
15
|
-
openInsertLinkDialog
|
|
15
|
+
get openInsertLinkDialog () {
|
|
16
16
|
return openInsertLinkDialog;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -76,28 +76,28 @@ const InsertLinkModal = ({ selectedText, onClose })=>{
|
|
|
76
76
|
}, [
|
|
77
77
|
mainInputRef
|
|
78
78
|
]);
|
|
79
|
-
return
|
|
79
|
+
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_f36components.ModalContent, {
|
|
80
80
|
testId: "insert-link-modal"
|
|
81
|
-
},
|
|
81
|
+
}, _react.default.createElement(_f36components.Form, {
|
|
82
82
|
onSubmit: ()=>onInsert({
|
|
83
83
|
url,
|
|
84
84
|
text,
|
|
85
85
|
title
|
|
86
86
|
})
|
|
87
|
-
},
|
|
87
|
+
}, _react.default.createElement(_f36components.FormControl, {
|
|
88
88
|
id: "link-text-field",
|
|
89
89
|
isDisabled: Boolean(selectedText)
|
|
90
|
-
},
|
|
90
|
+
}, _react.default.createElement(_f36components.FormControl.Label, null, "Link text"), _react.default.createElement(_f36components.TextInput, {
|
|
91
91
|
name: "link-text",
|
|
92
92
|
value: text,
|
|
93
93
|
onChange: (e)=>{
|
|
94
94
|
setText(e.target.value);
|
|
95
95
|
},
|
|
96
96
|
testId: "link-text-field"
|
|
97
|
-
})),
|
|
97
|
+
})), _react.default.createElement(_f36components.FormControl, {
|
|
98
98
|
id: "target-url-field",
|
|
99
99
|
isInvalid: touched && !urlIsValid
|
|
100
|
-
},
|
|
100
|
+
}, _react.default.createElement(_f36components.FormControl.Label, null, "Target URL"), _react.default.createElement(_f36components.TextInput, {
|
|
101
101
|
name: "target-url",
|
|
102
102
|
value: url,
|
|
103
103
|
onChange: (e)=>{
|
|
@@ -108,21 +108,21 @@ const InsertLinkModal = ({ selectedText, onClose })=>{
|
|
|
108
108
|
maxLength: 2100,
|
|
109
109
|
testId: "target-url-field",
|
|
110
110
|
ref: mainInputRef
|
|
111
|
-
}),
|
|
111
|
+
}), _react.default.createElement(_f36components.FormControl.HelpText, null, "Include protocol (e.g. https://)"), touched && !urlIsValid && _react.default.createElement(_f36components.FormControl.ValidationMessage, null, "Invalid URL")), _react.default.createElement(_f36components.FormControl, {
|
|
112
112
|
id: "link-title-field"
|
|
113
|
-
},
|
|
113
|
+
}, _react.default.createElement(_f36components.FormControl.Label, null, "Link title"), _react.default.createElement(_f36components.TextInput, {
|
|
114
114
|
name: "link-title",
|
|
115
115
|
value: title,
|
|
116
116
|
onChange: (e)=>{
|
|
117
117
|
setTitle(e.target.value);
|
|
118
118
|
},
|
|
119
119
|
testId: "link-title-field"
|
|
120
|
-
}),
|
|
120
|
+
}), _react.default.createElement(_f36components.FormControl.HelpText, null, "Extra link information, usually shown as a tooltip on mouse hover")))), _react.default.createElement(_f36components.ModalControls, null, _react.default.createElement(_f36components.Button, {
|
|
121
121
|
testId: "insert-link-cancel",
|
|
122
122
|
onClick: ()=>onClose(false),
|
|
123
123
|
variant: "secondary",
|
|
124
124
|
size: "small"
|
|
125
|
-
}, "Cancel"),
|
|
125
|
+
}, "Cancel"), _react.default.createElement(_f36components.Button, {
|
|
126
126
|
testId: "insert-link-confirm",
|
|
127
127
|
onClick: ()=>{
|
|
128
128
|
onInsert({
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
InsertTableModal
|
|
12
|
+
get InsertTableModal () {
|
|
13
13
|
return InsertTableModal;
|
|
14
14
|
},
|
|
15
|
-
openInsertTableDialog
|
|
15
|
+
get openInsertTableDialog () {
|
|
16
16
|
return openInsertTableDialog;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -79,13 +79,13 @@ const InsertTableModal = ({ onClose })=>{
|
|
|
79
79
|
}, [
|
|
80
80
|
mainInputRef
|
|
81
81
|
]);
|
|
82
|
-
return
|
|
82
|
+
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_f36components.ModalContent, {
|
|
83
83
|
testId: "insert-table-modal"
|
|
84
|
-
},
|
|
84
|
+
}, _react.default.createElement(_f36components.Form, null, _react.default.createElement(_f36components.FormControl, {
|
|
85
85
|
id: "insert-table-rows-number-field",
|
|
86
86
|
isRequired: true,
|
|
87
87
|
isInvalid: !rowsAreValid
|
|
88
|
-
},
|
|
88
|
+
}, _react.default.createElement(_f36components.FormControl.Label, null, "Number of rows"), _react.default.createElement(_f36components.TextInput, {
|
|
89
89
|
name: "rows",
|
|
90
90
|
value: rows.toString(),
|
|
91
91
|
onChange: (e)=>setRows(Number(e.target.value)),
|
|
@@ -97,11 +97,11 @@ const InsertTableModal = ({ onClose })=>{
|
|
|
97
97
|
width: "small",
|
|
98
98
|
autoComplete: "off",
|
|
99
99
|
ref: mainInputRef
|
|
100
|
-
}), !rowsAreValid &&
|
|
100
|
+
}), !rowsAreValid && _react.default.createElement(_f36components.FormControl.ValidationMessage, null, "Should be between 2 and 100")), _react.default.createElement(_f36components.FormControl, {
|
|
101
101
|
id: "insert-table-columns-number-field",
|
|
102
102
|
isRequired: true,
|
|
103
103
|
isInvalid: !colsAreValid
|
|
104
|
-
},
|
|
104
|
+
}, _react.default.createElement(_f36components.FormControl.Label, null, "Number of columns"), _react.default.createElement(_f36components.TextInput, {
|
|
105
105
|
name: "columns",
|
|
106
106
|
value: cols.toString(),
|
|
107
107
|
onChange: (e)=>setColumns(Number(e.target.value)),
|
|
@@ -112,12 +112,12 @@ const InsertTableModal = ({ onClose })=>{
|
|
|
112
112
|
type: "number",
|
|
113
113
|
width: "small",
|
|
114
114
|
autoComplete: "off"
|
|
115
|
-
}), !colsAreValid &&
|
|
115
|
+
}), !colsAreValid && _react.default.createElement(_f36components.FormControl.ValidationMessage, null, "Should be between 1 and 100")))), _react.default.createElement(_f36components.ModalControls, null, _react.default.createElement(_f36components.Button, {
|
|
116
116
|
testId: "insert-table-cancel",
|
|
117
117
|
onClick: ()=>onClose(false),
|
|
118
118
|
variant: "secondary",
|
|
119
119
|
size: "small"
|
|
120
|
-
}, "Cancel"),
|
|
120
|
+
}, "Cancel"), _react.default.createElement(_f36components.Button, {
|
|
121
121
|
testId: "insert-table-confirm",
|
|
122
122
|
onClick: ()=>onClose({
|
|
123
123
|
rows,
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
SpecialCharacterModalDialog
|
|
12
|
+
get SpecialCharacterModalDialog () {
|
|
13
13
|
return SpecialCharacterModalDialog;
|
|
14
14
|
},
|
|
15
|
-
openInsertSpecialCharacter
|
|
15
|
+
get openInsertSpecialCharacter () {
|
|
16
16
|
return openInsertSpecialCharacter;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -95,39 +95,39 @@ const styles = {
|
|
|
95
95
|
};
|
|
96
96
|
const SpecialCharacterModalDialog = ({ onClose })=>{
|
|
97
97
|
const [selectedCharacter, setSelectedCharacter] = (0, _react.useState)(_specialCharacters.specialCharacters[0]);
|
|
98
|
-
return
|
|
98
|
+
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_f36components.ModalContent, {
|
|
99
99
|
testId: "insert-special-character-modal"
|
|
100
|
-
},
|
|
100
|
+
}, _react.default.createElement(_f36components.Flex, {
|
|
101
101
|
flexDirection: "column",
|
|
102
102
|
alignItems: "center"
|
|
103
|
-
},
|
|
103
|
+
}, _react.default.createElement(_f36components.Text, {
|
|
104
104
|
as: "div",
|
|
105
105
|
lineHeight: "lineHeight3Xl",
|
|
106
106
|
fontSize: "fontSize3Xl",
|
|
107
107
|
marginBottom: "spacingS"
|
|
108
|
-
}, String.fromCharCode(selectedCharacter.code)),
|
|
108
|
+
}, String.fromCharCode(selectedCharacter.code)), _react.default.createElement(_f36components.Text, {
|
|
109
109
|
as: "div",
|
|
110
110
|
marginBottom: "spacingS"
|
|
111
|
-
}, selectedCharacter.desc)),
|
|
111
|
+
}, selectedCharacter.desc)), _react.default.createElement("div", {
|
|
112
112
|
className: styles.buttonPanel
|
|
113
|
-
}, _specialCharacters.specialCharacters.map((char)
|
|
113
|
+
}, _specialCharacters.specialCharacters.map((char)=>_react.default.createElement("div", {
|
|
114
114
|
key: char.code
|
|
115
|
-
},
|
|
115
|
+
}, _react.default.createElement(_f36components.Tooltip, {
|
|
116
116
|
className: styles.tooltip,
|
|
117
117
|
content: char.desc
|
|
118
|
-
},
|
|
118
|
+
}, _react.default.createElement(_f36components.Button, {
|
|
119
119
|
testId: "special-character-button",
|
|
120
120
|
isActive: char.code === selectedCharacter.code,
|
|
121
121
|
className: styles.charButton,
|
|
122
122
|
variant: "transparent",
|
|
123
123
|
onClick: ()=>setSelectedCharacter(char)
|
|
124
|
-
}, String.fromCharCode(char.code))))))),
|
|
124
|
+
}, String.fromCharCode(char.code))))))), _react.default.createElement(_f36components.ModalControls, null, _react.default.createElement(_f36components.Button, {
|
|
125
125
|
testId: "insert-character-cancel",
|
|
126
126
|
className: styles.button,
|
|
127
127
|
onClick: ()=>onClose(false),
|
|
128
128
|
variant: "secondary",
|
|
129
129
|
size: "small"
|
|
130
|
-
}, "Cancel"),
|
|
130
|
+
}, "Cancel"), _react.default.createElement(_f36components.Button, {
|
|
131
131
|
className: styles.button,
|
|
132
132
|
testId: "insert-character-confirm",
|
|
133
133
|
onClick: ()=>onClose(String.fromCharCode(selectedCharacter.code)),
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
ZenModeModalDialog
|
|
12
|
+
get ZenModeModalDialog () {
|
|
13
13
|
return ZenModeModalDialog;
|
|
14
14
|
},
|
|
15
|
-
openZenMode
|
|
15
|
+
get openZenMode () {
|
|
16
16
|
return openZenMode;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -74,7 +74,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
74
74
|
}
|
|
75
75
|
return newObj;
|
|
76
76
|
}
|
|
77
|
-
const MarkdownPreview =
|
|
77
|
+
const MarkdownPreview = _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("../components/MarkdownPreview"))));
|
|
78
78
|
const styles = {
|
|
79
79
|
root: (0, _css.css)({
|
|
80
80
|
display: 'grid',
|
|
@@ -166,21 +166,21 @@ const ZenModeModalDialog = (props)=>{
|
|
|
166
166
|
});
|
|
167
167
|
};
|
|
168
168
|
const direction = props.sdk.locales.direction[props.locale] ?? 'ltr';
|
|
169
|
-
return
|
|
169
|
+
return _react.createElement(_f36components.Grid, {
|
|
170
170
|
className: styles.root,
|
|
171
171
|
testId: "zen-mode-markdown-editor"
|
|
172
|
-
},
|
|
172
|
+
}, _react.createElement(_f36components.Grid.Item, {
|
|
173
173
|
className: styles.topSplit
|
|
174
|
-
},
|
|
174
|
+
}, _react.createElement(_MarkdownToolbar.MarkdownToolbar, {
|
|
175
175
|
mode: "zen",
|
|
176
176
|
disabled: false,
|
|
177
177
|
canUploadAssets: false,
|
|
178
178
|
actions: actions
|
|
179
|
-
})),
|
|
179
|
+
})), _react.createElement(_f36components.Grid.Item, {
|
|
180
180
|
className: (0, _css.cx)(styles.editorSplit, {
|
|
181
181
|
[styles.editorSplitFullscreen]: showPreview === false
|
|
182
182
|
})
|
|
183
|
-
},
|
|
183
|
+
}, _react.createElement(_MarkdownTextarea.MarkdownTextarea, {
|
|
184
184
|
mode: "zen",
|
|
185
185
|
visible: true,
|
|
186
186
|
disabled: false,
|
|
@@ -195,40 +195,40 @@ const ZenModeModalDialog = (props)=>{
|
|
|
195
195
|
props.saveValueToSDK(value);
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
|
-
})), showPreview &&
|
|
198
|
+
})), showPreview && _react.createElement(_f36components.Grid.Item, {
|
|
199
199
|
className: styles.previewSplit
|
|
200
|
-
},
|
|
201
|
-
fallback:
|
|
202
|
-
},
|
|
200
|
+
}, _react.createElement(_react.Suspense, {
|
|
201
|
+
fallback: _react.createElement(_MarkdownPreviewSkeleton.default, null)
|
|
202
|
+
}, _react.createElement(MarkdownPreview, {
|
|
203
203
|
direction: direction,
|
|
204
204
|
mode: "zen",
|
|
205
205
|
value: currentValue,
|
|
206
206
|
previewComponents: props.previewComponents
|
|
207
|
-
}))), showPreview &&
|
|
207
|
+
}))), showPreview && _react.createElement(_f36components.Grid.Item, {
|
|
208
208
|
className: styles.separator
|
|
209
|
-
}), showPreview &&
|
|
209
|
+
}), showPreview && _react.createElement("button", {
|
|
210
210
|
className: (0, _css.cx)(styles.button, styles.hideButton),
|
|
211
211
|
"aria-label": "Hide preview",
|
|
212
212
|
onClick: ()=>{
|
|
213
213
|
setShowPreview(false);
|
|
214
214
|
}
|
|
215
|
-
},
|
|
215
|
+
}, _react.createElement(_f36icons.CaretRightIcon, {
|
|
216
216
|
color: _f36tokens.default.gray600,
|
|
217
217
|
size: "tiny",
|
|
218
218
|
className: styles.icon
|
|
219
|
-
})), !showPreview &&
|
|
219
|
+
})), !showPreview && _react.createElement("button", {
|
|
220
220
|
className: (0, _css.cx)(styles.button, styles.showButton),
|
|
221
221
|
"aria-label": "Show preview",
|
|
222
222
|
onClick: ()=>{
|
|
223
223
|
setShowPreview(true);
|
|
224
224
|
}
|
|
225
|
-
},
|
|
225
|
+
}, _react.createElement(_f36icons.CaretLeftIcon, {
|
|
226
226
|
color: _f36tokens.default.gray600,
|
|
227
227
|
size: "tiny",
|
|
228
228
|
className: styles.icon
|
|
229
|
-
})),
|
|
229
|
+
})), _react.createElement(_f36components.Grid.Item, {
|
|
230
230
|
className: styles.bottomSplit
|
|
231
|
-
},
|
|
231
|
+
}, _react.createElement(_MarkdownBottomBar.MarkdownBottomBar, null, _react.createElement(_MarkdownBottomBar.MarkdownHelp, {
|
|
232
232
|
mode: "zen",
|
|
233
233
|
onClick: ()=>{
|
|
234
234
|
(0, _CheatsheetModalDialog.openCheatsheetModal)(props.sdk.dialogs);
|
|
@@ -62,31 +62,31 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
62
62
|
const openMarkdownDialog = (sdk, previewComponents)=>(options)=>{
|
|
63
63
|
if (options.parameters?.type === _types.MarkdownDialogType.cheatsheet) {
|
|
64
64
|
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ()=>{
|
|
65
|
-
return
|
|
65
|
+
return _react.createElement(_CheatsheetModalDialog.CheatsheetModalDialog, null);
|
|
66
66
|
});
|
|
67
67
|
} else if (options.parameters?.type === _types.MarkdownDialogType.insertLink) {
|
|
68
68
|
const selectedText = options.parameters.selectedText;
|
|
69
69
|
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
70
|
-
return
|
|
70
|
+
return _react.createElement(_InsertLinkModalDialog.InsertLinkModal, {
|
|
71
71
|
selectedText: selectedText,
|
|
72
72
|
onClose: onClose
|
|
73
73
|
});
|
|
74
74
|
});
|
|
75
75
|
} else if (options.parameters?.type === _types.MarkdownDialogType.insertSpecialCharacter) {
|
|
76
76
|
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
77
|
-
return
|
|
77
|
+
return _react.createElement(_SpecialCharacterModalDialog.SpecialCharacterModalDialog, {
|
|
78
78
|
onClose: onClose
|
|
79
79
|
});
|
|
80
80
|
});
|
|
81
81
|
} else if (options.parameters?.type === _types.MarkdownDialogType.insertTable) {
|
|
82
82
|
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
83
|
-
return
|
|
83
|
+
return _react.createElement(_InsertTableModalDialog.InsertTableModal, {
|
|
84
84
|
onClose: onClose
|
|
85
85
|
});
|
|
86
86
|
});
|
|
87
87
|
} else if (options.parameters?.type === _types.MarkdownDialogType.embedExternalContent) {
|
|
88
88
|
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
89
|
-
return
|
|
89
|
+
return _react.createElement(_EmdebExternalContentDialog.EmbedExternalContentModal, {
|
|
90
90
|
onClose: onClose
|
|
91
91
|
});
|
|
92
92
|
});
|
|
@@ -94,7 +94,7 @@ const openMarkdownDialog = (sdk, previewComponents)=>(options)=>{
|
|
|
94
94
|
const locale = options.parameters.locale;
|
|
95
95
|
const assets = options.parameters.assets;
|
|
96
96
|
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
97
|
-
return
|
|
97
|
+
return _react.createElement(_ConfirmInsertAssetModalDialog.ConfirmInsertAssetModalDialog, {
|
|
98
98
|
onClose: onClose,
|
|
99
99
|
locale: locale,
|
|
100
100
|
assets: assets
|
|
@@ -104,7 +104,7 @@ const openMarkdownDialog = (sdk, previewComponents)=>(options)=>{
|
|
|
104
104
|
const initialValue = options.parameters.initialValue;
|
|
105
105
|
const locale = options.parameters.locale;
|
|
106
106
|
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
107
|
-
return
|
|
107
|
+
return _react.createElement(_ZenModeModalDialog.ZenModeModalDialog, {
|
|
108
108
|
saveValueToSDK: (value)=>{
|
|
109
109
|
if (value) {
|
|
110
110
|
return sdk?.field?.setValue(value);
|
|
@@ -62,34 +62,34 @@ const renderMarkdownDialog = (sdk)=>{
|
|
|
62
62
|
const parameters = sdk.parameters.invocation;
|
|
63
63
|
if (parameters.type === _types.MarkdownDialogType.cheatsheet) {
|
|
64
64
|
sdk.window.startAutoResizer();
|
|
65
|
-
return
|
|
65
|
+
return _react.createElement(_CheatsheetModalDialog.CheatsheetModalDialog, null);
|
|
66
66
|
} else if (parameters.type === _types.MarkdownDialogType.insertLink) {
|
|
67
67
|
const selectedText = parameters.selectedText;
|
|
68
68
|
sdk.window.startAutoResizer();
|
|
69
|
-
return
|
|
69
|
+
return _react.createElement(_InsertLinkModalDialog.InsertLinkModal, {
|
|
70
70
|
selectedText: selectedText,
|
|
71
71
|
onClose: sdk.close
|
|
72
72
|
});
|
|
73
73
|
} else if (parameters.type === _types.MarkdownDialogType.insertSpecialCharacter) {
|
|
74
74
|
sdk.window.startAutoResizer();
|
|
75
|
-
return
|
|
75
|
+
return _react.createElement(_SpecialCharacterModalDialog.SpecialCharacterModalDialog, {
|
|
76
76
|
onClose: sdk.close
|
|
77
77
|
});
|
|
78
78
|
} else if (parameters.type === _types.MarkdownDialogType.insertTable) {
|
|
79
79
|
sdk.window.startAutoResizer();
|
|
80
|
-
return
|
|
80
|
+
return _react.createElement(_InsertTableModalDialog.InsertTableModal, {
|
|
81
81
|
onClose: sdk.close
|
|
82
82
|
});
|
|
83
83
|
} else if (parameters.type === _types.MarkdownDialogType.embedExternalContent) {
|
|
84
84
|
sdk.window.startAutoResizer();
|
|
85
|
-
return
|
|
85
|
+
return _react.createElement(_EmdebExternalContentDialog.EmbedExternalContentModal, {
|
|
86
86
|
onClose: sdk.close
|
|
87
87
|
});
|
|
88
88
|
} else if (parameters.type === _types.MarkdownDialogType.confirmInsertAsset) {
|
|
89
89
|
const locale = parameters.locale;
|
|
90
90
|
const assets = parameters.assets;
|
|
91
91
|
sdk.window.startAutoResizer();
|
|
92
|
-
return
|
|
92
|
+
return _react.createElement(_ConfirmInsertAssetModalDialog.ConfirmInsertAssetModalDialog, {
|
|
93
93
|
onClose: sdk.close,
|
|
94
94
|
locale: locale,
|
|
95
95
|
assets: assets
|
|
@@ -98,7 +98,7 @@ const renderMarkdownDialog = (sdk)=>{
|
|
|
98
98
|
const locale = parameters.locale;
|
|
99
99
|
const initialValue = parameters.initialValue;
|
|
100
100
|
sdk.window.updateHeight('100%');
|
|
101
|
-
return
|
|
101
|
+
return _react.createElement(_ZenModeModalDialog.ZenModeModalDialog, {
|
|
102
102
|
onClose: sdk.close,
|
|
103
103
|
saveValueToSDK: ()=>{},
|
|
104
104
|
initialValue: initialValue,
|
|
@@ -106,5 +106,5 @@ const renderMarkdownDialog = (sdk)=>{
|
|
|
106
106
|
sdk: sdk
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
return
|
|
109
|
+
return _react.createElement("div", null);
|
|
110
110
|
};
|
package/dist/cjs/index.js
CHANGED
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
MarkdownEditor
|
|
12
|
+
get MarkdownEditor () {
|
|
13
13
|
return _MarkdownEditor.MarkdownEditorConnected;
|
|
14
14
|
},
|
|
15
|
-
MarkdownPreview
|
|
15
|
+
get MarkdownPreview () {
|
|
16
16
|
return _MarkdownPreview.default;
|
|
17
17
|
},
|
|
18
|
-
openMarkdownDialog
|
|
18
|
+
get openMarkdownDialog () {
|
|
19
19
|
return _openMarkdownDialog.openMarkdownDialog;
|
|
20
20
|
},
|
|
21
|
-
renderMarkdownDialog
|
|
21
|
+
get renderMarkdownDialog () {
|
|
22
22
|
return _renderMarkdownDialog.renderMarkdownDialog;
|
|
23
23
|
}
|
|
24
24
|
});
|
package/dist/cjs/types.js
CHANGED
|
@@ -8,8 +8,7 @@ Object.defineProperty(exports, "MarkdownDialogType", {
|
|
|
8
8
|
return MarkdownDialogType;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
var MarkdownDialogType
|
|
12
|
-
(function(MarkdownDialogType) {
|
|
11
|
+
var MarkdownDialogType = /*#__PURE__*/ function(MarkdownDialogType) {
|
|
13
12
|
MarkdownDialogType["cheatsheet"] = "markdown-cheatsheet";
|
|
14
13
|
MarkdownDialogType["insertLink"] = "markdown-insertLink";
|
|
15
14
|
MarkdownDialogType["insertSpecialCharacter"] = "markdown-insertSpecialCharacter";
|
|
@@ -17,4 +16,5 @@ var MarkdownDialogType;
|
|
|
17
16
|
MarkdownDialogType["embedExternalContent"] = "markdown-embedExternalContent";
|
|
18
17
|
MarkdownDialogType["confirmInsertAsset"] = "markdown-confirmInsertAsset";
|
|
19
18
|
MarkdownDialogType["zenMode"] = "markdown-zenMode";
|
|
20
|
-
|
|
19
|
+
return MarkdownDialogType;
|
|
20
|
+
}({});
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
insertAssetLinks
|
|
12
|
+
get insertAssetLinks () {
|
|
13
13
|
return insertAssetLinks;
|
|
14
14
|
},
|
|
15
|
-
replaceAssetDomain
|
|
15
|
+
get replaceAssetDomain () {
|
|
16
16
|
return replaceAssetDomain;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
isValidUrl
|
|
12
|
+
get isValidUrl () {
|
|
13
13
|
return isValidUrl;
|
|
14
14
|
},
|
|
15
|
-
urlRegex
|
|
15
|
+
get urlRegex () {
|
|
16
16
|
return urlRegex;
|
|
17
17
|
}
|
|
18
18
|
});
|