@contentful/field-editor-markdown 2.4.4-canary.28 → 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,17 +5,17 @@ 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
|
-
DefaultMarkdownToolbar
|
|
12
|
+
get DefaultMarkdownToolbar () {
|
|
13
13
|
return DefaultMarkdownToolbar;
|
|
14
14
|
},
|
|
15
|
-
MarkdownToolbar
|
|
15
|
+
get MarkdownToolbar () {
|
|
16
16
|
return MarkdownToolbar;
|
|
17
17
|
},
|
|
18
|
-
ZenMarkdownToolbar
|
|
18
|
+
get ZenMarkdownToolbar () {
|
|
19
19
|
return ZenMarkdownToolbar;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
@@ -106,7 +106,7 @@ const styles = {
|
|
|
106
106
|
pointerEvents: 'none'
|
|
107
107
|
})
|
|
108
108
|
};
|
|
109
|
-
const ToolbarButton =
|
|
109
|
+
const ToolbarButton = _react.forwardRef((props, ref)=>{
|
|
110
110
|
const { tooltip, onClick, children, className, variant = 'transparent', tooltipPlace = 'top', isDisabled = false, ...otherProps } = props;
|
|
111
111
|
const pointerTriggeredRef = _react.useRef(false);
|
|
112
112
|
const handlePointerDown = _react.useCallback((event)=>{
|
|
@@ -129,7 +129,7 @@ const ToolbarButton = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
129
129
|
}, [
|
|
130
130
|
onClick
|
|
131
131
|
]);
|
|
132
|
-
return
|
|
132
|
+
return _react.createElement(_f36components.IconButton, {
|
|
133
133
|
...otherProps,
|
|
134
134
|
ref: ref,
|
|
135
135
|
className: (0, _css.cx)(styles.button, className),
|
|
@@ -152,178 +152,178 @@ const ToolbarButton = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
152
152
|
ToolbarButton.displayName = 'ToolbarButton';
|
|
153
153
|
function MainButtons(props) {
|
|
154
154
|
const tooltipPlace = props.mode === 'zen' ? 'bottom' : 'top';
|
|
155
|
-
return
|
|
155
|
+
return _react.createElement(_react.Fragment, null, _react.createElement(_HeadingSelector.HeadingSelector, {
|
|
156
156
|
onSelect: (heading)=>{
|
|
157
157
|
if (heading && props.actions.headings[heading]) {
|
|
158
158
|
props.actions.headings[heading]();
|
|
159
159
|
}
|
|
160
160
|
},
|
|
161
|
-
renderTrigger: ({ isOpen, onClick })
|
|
161
|
+
renderTrigger: ({ isOpen, onClick })=>_react.createElement(ToolbarButton, {
|
|
162
162
|
isDisabled: props.disabled,
|
|
163
163
|
testId: "markdown-action-button-heading",
|
|
164
164
|
tooltip: "Headings",
|
|
165
165
|
tooltipPlace: tooltipPlace,
|
|
166
166
|
onClick: onClick,
|
|
167
167
|
"aria-expanded": isOpen
|
|
168
|
-
},
|
|
168
|
+
}, _react.createElement(_f36icons.TextHIcon, {
|
|
169
169
|
"aria-label": "Headings",
|
|
170
170
|
className: styles.icon
|
|
171
171
|
}))
|
|
172
|
-
}),
|
|
172
|
+
}), _react.createElement(ToolbarButton, {
|
|
173
173
|
isDisabled: props.disabled,
|
|
174
174
|
testId: "markdown-action-button-bold",
|
|
175
175
|
tooltip: "Bold",
|
|
176
176
|
tooltipPlace: tooltipPlace,
|
|
177
177
|
onClick: props.actions.simple.bold
|
|
178
|
-
},
|
|
178
|
+
}, _react.createElement(_f36icons.TextBIcon, {
|
|
179
179
|
"aria-label": "Bold",
|
|
180
180
|
className: styles.icon
|
|
181
|
-
})),
|
|
181
|
+
})), _react.createElement(ToolbarButton, {
|
|
182
182
|
isDisabled: props.disabled,
|
|
183
183
|
testId: "markdown-action-button-italic",
|
|
184
184
|
tooltip: "Italic",
|
|
185
185
|
tooltipPlace: tooltipPlace,
|
|
186
186
|
onClick: props.actions.simple.italic
|
|
187
|
-
},
|
|
187
|
+
}, _react.createElement(_f36icons.TextItalicIcon, {
|
|
188
188
|
"aria-label": "Italic",
|
|
189
189
|
className: styles.icon
|
|
190
|
-
})),
|
|
190
|
+
})), _react.createElement(ToolbarButton, {
|
|
191
191
|
isDisabled: props.disabled,
|
|
192
192
|
testId: "markdown-action-button-quote",
|
|
193
193
|
tooltip: "Quote",
|
|
194
194
|
tooltipPlace: tooltipPlace,
|
|
195
195
|
onClick: props.actions.simple.quote
|
|
196
|
-
},
|
|
196
|
+
}, _react.createElement(_f36icons.QuotesIcon, {
|
|
197
197
|
"aria-label": "Quote",
|
|
198
198
|
className: styles.icon
|
|
199
|
-
})),
|
|
199
|
+
})), _react.createElement(ToolbarButton, {
|
|
200
200
|
isDisabled: props.disabled,
|
|
201
201
|
testId: "markdown-action-button-ul",
|
|
202
202
|
tooltip: "Unordered list",
|
|
203
203
|
tooltipPlace: tooltipPlace,
|
|
204
204
|
onClick: props.actions.simple.ul
|
|
205
|
-
},
|
|
205
|
+
}, _react.createElement(_f36icons.ListBulletsIcon, {
|
|
206
206
|
"aria-label": "Unordered list",
|
|
207
207
|
className: styles.icon
|
|
208
|
-
})),
|
|
208
|
+
})), _react.createElement(ToolbarButton, {
|
|
209
209
|
isDisabled: props.disabled,
|
|
210
210
|
testId: "markdown-action-button-ol",
|
|
211
211
|
tooltip: "Ordered list",
|
|
212
212
|
tooltipPlace: tooltipPlace,
|
|
213
213
|
onClick: props.actions.simple.ol
|
|
214
|
-
},
|
|
214
|
+
}, _react.createElement(_f36icons.ListNumbersIcon, {
|
|
215
215
|
"aria-label": "Ordered list",
|
|
216
216
|
className: styles.icon
|
|
217
|
-
})),
|
|
217
|
+
})), _react.createElement(ToolbarButton, {
|
|
218
218
|
isDisabled: props.disabled,
|
|
219
219
|
testId: "markdown-action-button-link",
|
|
220
220
|
tooltip: "Link",
|
|
221
221
|
tooltipPlace: tooltipPlace,
|
|
222
222
|
onClick: props.actions.insertLink
|
|
223
|
-
},
|
|
223
|
+
}, _react.createElement(_f36icons.LinkSimpleIcon, {
|
|
224
224
|
"aria-label": "Link",
|
|
225
225
|
className: styles.icon
|
|
226
226
|
})));
|
|
227
227
|
}
|
|
228
228
|
function AdditionalButtons(props) {
|
|
229
229
|
const tooltipPlace = props.mode === 'zen' ? 'bottom' : 'top';
|
|
230
|
-
return
|
|
230
|
+
return _react.createElement(_react.Fragment, null, _react.createElement(ToolbarButton, {
|
|
231
231
|
isDisabled: props.disabled,
|
|
232
232
|
testId: "markdown-action-button-strike",
|
|
233
233
|
tooltip: "Strike out",
|
|
234
234
|
tooltipPlace: tooltipPlace,
|
|
235
235
|
onClick: props.actions.simple.strike
|
|
236
|
-
},
|
|
236
|
+
}, _react.createElement(_f36icons.TextStrikethroughIcon, {
|
|
237
237
|
"aria-label": "Strike out",
|
|
238
238
|
className: styles.icon
|
|
239
|
-
})),
|
|
239
|
+
})), _react.createElement(ToolbarButton, {
|
|
240
240
|
isDisabled: props.disabled,
|
|
241
241
|
testId: "markdown-action-button-code",
|
|
242
242
|
tooltip: "Code block",
|
|
243
243
|
tooltipPlace: tooltipPlace,
|
|
244
244
|
onClick: props.actions.simple.code
|
|
245
|
-
},
|
|
245
|
+
}, _react.createElement(_f36icons.CodeSimpleIcon, {
|
|
246
246
|
"aria-label": "Code block",
|
|
247
247
|
className: styles.icon
|
|
248
|
-
})),
|
|
248
|
+
})), _react.createElement(ToolbarButton, {
|
|
249
249
|
isDisabled: props.disabled,
|
|
250
250
|
testId: "markdown-action-button-hr",
|
|
251
251
|
tooltip: "Horizontal rule",
|
|
252
252
|
tooltipPlace: tooltipPlace,
|
|
253
253
|
onClick: props.actions.simple.hr
|
|
254
|
-
},
|
|
254
|
+
}, _react.createElement(_f36icons.MinusIcon, {
|
|
255
255
|
"aria-label": "Horizontal rule",
|
|
256
256
|
className: styles.icon
|
|
257
|
-
})),
|
|
257
|
+
})), _react.createElement(ToolbarButton, {
|
|
258
258
|
isDisabled: props.disabled,
|
|
259
259
|
testId: "markdown-action-button-indent",
|
|
260
260
|
tooltip: "Increase indentation",
|
|
261
261
|
tooltipPlace: tooltipPlace,
|
|
262
262
|
onClick: props.actions.simple.indent
|
|
263
|
-
},
|
|
263
|
+
}, _react.createElement(_f36icons.TextIndentIcon, {
|
|
264
264
|
"aria-label": "Increase indentation",
|
|
265
265
|
className: styles.icon
|
|
266
|
-
})),
|
|
266
|
+
})), _react.createElement(ToolbarButton, {
|
|
267
267
|
isDisabled: props.disabled,
|
|
268
268
|
testId: "markdown-action-button-dedent",
|
|
269
269
|
tooltip: "Decrease indentation",
|
|
270
270
|
tooltipPlace: tooltipPlace,
|
|
271
271
|
onClick: props.actions.simple.dedent
|
|
272
|
-
},
|
|
272
|
+
}, _react.createElement(_f36icons.TextOutdentIcon, {
|
|
273
273
|
"aria-label": "Decrease indentation",
|
|
274
274
|
className: styles.icon
|
|
275
|
-
})),
|
|
275
|
+
})), _react.createElement(ToolbarButton, {
|
|
276
276
|
isDisabled: props.disabled,
|
|
277
277
|
testId: "markdown-action-button-embed",
|
|
278
278
|
tooltip: "Embed external content",
|
|
279
279
|
tooltipPlace: tooltipPlace,
|
|
280
280
|
onClick: props.actions.embedExternalContent
|
|
281
|
-
},
|
|
281
|
+
}, _react.createElement(_f36icons.CubesThreeIcon, {
|
|
282
282
|
"aria-label": "Embed external content",
|
|
283
283
|
className: styles.icon
|
|
284
|
-
})),
|
|
284
|
+
})), _react.createElement(ToolbarButton, {
|
|
285
285
|
isDisabled: props.disabled,
|
|
286
286
|
testId: "markdown-action-button-table",
|
|
287
287
|
tooltip: "Insert table",
|
|
288
288
|
tooltipPlace: tooltipPlace,
|
|
289
289
|
onClick: props.actions.insertTable
|
|
290
|
-
},
|
|
290
|
+
}, _react.createElement(_f36icons.TableIcon, {
|
|
291
291
|
"aria-label": "Insert table",
|
|
292
292
|
className: styles.icon
|
|
293
|
-
})),
|
|
293
|
+
})), _react.createElement(ToolbarButton, {
|
|
294
294
|
isDisabled: props.disabled,
|
|
295
295
|
testId: "markdown-action-button-special",
|
|
296
296
|
tooltip: "Insert special character",
|
|
297
297
|
tooltipPlace: tooltipPlace,
|
|
298
298
|
onClick: props.actions.insertSpecialCharacter
|
|
299
|
-
},
|
|
299
|
+
}, _react.createElement(_f36icons.CurrencyEurIcon, {
|
|
300
300
|
"aria-label": "Insert special character",
|
|
301
301
|
className: styles.icon
|
|
302
|
-
})),
|
|
302
|
+
})), _react.createElement(ToolbarButton, {
|
|
303
303
|
isDisabled: props.disabled,
|
|
304
304
|
testId: "markdown-action-button-organizeLinks",
|
|
305
305
|
tooltip: "Organize links",
|
|
306
306
|
tooltipPlace: tooltipPlace,
|
|
307
307
|
onClick: props.actions.organizeLinks
|
|
308
|
-
},
|
|
308
|
+
}, _react.createElement(_f36icons.TreeStructureIcon, {
|
|
309
309
|
"aria-label": "Organize links",
|
|
310
310
|
className: styles.icon
|
|
311
|
-
})),
|
|
311
|
+
})), _react.createElement(ToolbarButton, {
|
|
312
312
|
isDisabled: props.disabled,
|
|
313
313
|
testId: "markdown-action-button-undo",
|
|
314
314
|
tooltip: "Undo",
|
|
315
315
|
tooltipPlace: tooltipPlace,
|
|
316
316
|
onClick: props.actions.history.undo
|
|
317
|
-
},
|
|
317
|
+
}, _react.createElement(_f36icons.ArrowUUpLeftIcon, {
|
|
318
318
|
"aria-label": "Undo",
|
|
319
319
|
className: styles.icon
|
|
320
|
-
})),
|
|
320
|
+
})), _react.createElement(ToolbarButton, {
|
|
321
321
|
isDisabled: props.disabled,
|
|
322
322
|
testId: "markdown-action-button-redo",
|
|
323
323
|
tooltip: "Redo",
|
|
324
324
|
tooltipPlace: tooltipPlace,
|
|
325
325
|
onClick: props.actions.history.redo
|
|
326
|
-
},
|
|
326
|
+
}, _react.createElement(_f36icons.ArrowUUpRightIcon, {
|
|
327
327
|
"aria-label": "Redo",
|
|
328
328
|
className: styles.icon
|
|
329
329
|
})));
|
|
@@ -333,55 +333,55 @@ function DefaultMarkdownToolbar(props) {
|
|
|
333
333
|
const toggleAdditionalActions = _react.useCallback(()=>{
|
|
334
334
|
setShowAdditional((current)=>!current);
|
|
335
335
|
}, []);
|
|
336
|
-
return
|
|
336
|
+
return _react.createElement("div", {
|
|
337
337
|
className: styles.root
|
|
338
|
-
},
|
|
338
|
+
}, _react.createElement(_f36components.Flex, {
|
|
339
339
|
justifyContent: "space-between",
|
|
340
340
|
flexWrap: "wrap"
|
|
341
|
-
},
|
|
341
|
+
}, _react.createElement(_f36components.Flex, {
|
|
342
342
|
flexWrap: "wrap"
|
|
343
|
-
},
|
|
343
|
+
}, _react.createElement(MainButtons, props), _react.createElement(ToolbarButton, {
|
|
344
344
|
isDisabled: props.disabled,
|
|
345
345
|
testId: "markdown-action-button-toggle-additional",
|
|
346
346
|
tooltip: showAdditional ? 'Hide additional actions' : 'More actions',
|
|
347
347
|
"aria-expanded": showAdditional,
|
|
348
348
|
onClick: toggleAdditionalActions
|
|
349
|
-
},
|
|
349
|
+
}, _react.createElement(_f36icons.DotsThreeIcon, {
|
|
350
350
|
className: styles.icon
|
|
351
|
-
}))),
|
|
351
|
+
}))), _react.createElement(_f36components.Flex, null, _react.createElement(_InsertLinkSelector.InsertLinkSelector, {
|
|
352
352
|
disabled: props.disabled,
|
|
353
353
|
onSelectExisting: props.actions.linkExistingMedia,
|
|
354
354
|
onAddNew: props.actions.addNewMedia,
|
|
355
355
|
canAddNew: props.canUploadAssets
|
|
356
|
-
}),
|
|
356
|
+
}), _react.createElement(ToolbarButton, {
|
|
357
357
|
isDisabled: props.disabled,
|
|
358
358
|
testId: "markdown-action-button-zen",
|
|
359
359
|
variant: "secondary",
|
|
360
360
|
onClick: props.actions.openZenMode,
|
|
361
361
|
className: styles.zenButton,
|
|
362
362
|
tooltip: "Expand"
|
|
363
|
-
},
|
|
363
|
+
}, _react.createElement(_f36icons.ArrowsOutIcon, {
|
|
364
364
|
"aria-label": "Expand",
|
|
365
365
|
className: styles.icon
|
|
366
|
-
})))), showAdditional &&
|
|
366
|
+
})))), showAdditional && _react.createElement(_f36components.Flex, {
|
|
367
367
|
justifyContent: "space-between",
|
|
368
368
|
marginTop: "spacingXs"
|
|
369
|
-
},
|
|
369
|
+
}, _react.createElement(_f36components.Flex, null, _react.createElement(AdditionalButtons, props))));
|
|
370
370
|
}
|
|
371
371
|
function ZenMarkdownToolbar(props) {
|
|
372
|
-
return
|
|
372
|
+
return _react.createElement("div", {
|
|
373
373
|
className: styles.root
|
|
374
|
-
},
|
|
374
|
+
}, _react.createElement(_f36components.Flex, {
|
|
375
375
|
justifyContent: "space-between",
|
|
376
376
|
alignItems: "flex-start"
|
|
377
|
-
},
|
|
377
|
+
}, _react.createElement(_f36components.Flex, {
|
|
378
378
|
flexWrap: "wrap"
|
|
379
|
-
},
|
|
379
|
+
}, _react.createElement(MainButtons, props), _react.createElement(AdditionalButtons, props)), _react.createElement(_f36components.Flex, null, _react.createElement(_InsertLinkSelector.InsertLinkSelector, {
|
|
380
380
|
disabled: props.disabled,
|
|
381
381
|
onSelectExisting: props.actions.linkExistingMedia,
|
|
382
382
|
onAddNew: props.actions.addNewMedia,
|
|
383
383
|
canAddNew: props.canUploadAssets
|
|
384
|
-
}),
|
|
384
|
+
}), _react.createElement(_f36components.IconButton, {
|
|
385
385
|
testId: "markdown-action-button-zen-close",
|
|
386
386
|
variant: "secondary",
|
|
387
387
|
size: "small",
|
|
@@ -389,17 +389,17 @@ function ZenMarkdownToolbar(props) {
|
|
|
389
389
|
onClick: ()=>{
|
|
390
390
|
props.actions.closeZenMode();
|
|
391
391
|
},
|
|
392
|
-
icon:
|
|
392
|
+
icon: _react.createElement(_f36icons.ArrowsOutIcon, {
|
|
393
393
|
"aria-label": "Collapse",
|
|
394
394
|
className: styles.icon
|
|
395
395
|
}),
|
|
396
396
|
"aria-label": "Collapse"
|
|
397
397
|
}))));
|
|
398
398
|
}
|
|
399
|
-
const MarkdownToolbar =
|
|
399
|
+
const MarkdownToolbar = _react.memo((props)=>{
|
|
400
400
|
if (props.mode === 'zen') {
|
|
401
|
-
return
|
|
401
|
+
return _react.createElement(ZenMarkdownToolbar, props);
|
|
402
402
|
}
|
|
403
|
-
return
|
|
403
|
+
return _react.createElement(DefaultMarkdownToolbar, props);
|
|
404
404
|
});
|
|
405
405
|
MarkdownToolbar.displayName = 'MarkdownToolbar';
|
|
@@ -99,7 +99,7 @@ const createProps = ()=>({
|
|
|
99
99
|
});
|
|
100
100
|
(0, _vitest.it)('opens the heading menu and calls the selected heading action', async ()=>{
|
|
101
101
|
const props = createProps();
|
|
102
|
-
(0, _react1.render)(
|
|
102
|
+
(0, _react1.render)(_react.createElement(_MarkdownToolbar.MarkdownToolbar, props));
|
|
103
103
|
await _userevent.default.click(_react1.screen.getByRole('button', {
|
|
104
104
|
name: 'Headings'
|
|
105
105
|
}));
|
|
@@ -110,7 +110,7 @@ const createProps = ()=>({
|
|
|
110
110
|
});
|
|
111
111
|
(0, _vitest.it)('toggles additional actions and exposes the expanded state', async ()=>{
|
|
112
112
|
const props = createProps();
|
|
113
|
-
(0, _react1.render)(
|
|
113
|
+
(0, _react1.render)(_react.createElement(_MarkdownToolbar.MarkdownToolbar, props));
|
|
114
114
|
const toggle = _react1.screen.getByRole('button', {
|
|
115
115
|
name: 'More actions'
|
|
116
116
|
});
|
|
@@ -125,7 +125,7 @@ const createProps = ()=>({
|
|
|
125
125
|
});
|
|
126
126
|
(0, _vitest.it)('triggers a toolbar action once per click', async ()=>{
|
|
127
127
|
const props = createProps();
|
|
128
|
-
(0, _react1.render)(
|
|
128
|
+
(0, _react1.render)(_react.createElement(_MarkdownToolbar.MarkdownToolbar, props));
|
|
129
129
|
await _userevent.default.click(_react1.screen.getByRole('button', {
|
|
130
130
|
name: 'Bold'
|
|
131
131
|
}));
|
|
@@ -133,7 +133,7 @@ const createProps = ()=>({
|
|
|
133
133
|
});
|
|
134
134
|
(0, _vitest.it)('still supports keyboard-style activation', async ()=>{
|
|
135
135
|
const props = createProps();
|
|
136
|
-
(0, _react1.render)(
|
|
136
|
+
(0, _react1.render)(_react.createElement(_MarkdownToolbar.MarkdownToolbar, props));
|
|
137
137
|
const bold = _react1.screen.getByRole('button', {
|
|
138
138
|
name: 'Bold'
|
|
139
139
|
});
|
|
@@ -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
|
-
CheatsheetModalDialog
|
|
12
|
+
get CheatsheetModalDialog () {
|
|
13
13
|
return CheatsheetModalDialog;
|
|
14
14
|
},
|
|
15
|
-
openCheatsheetModal
|
|
15
|
+
get openCheatsheetModal () {
|
|
16
16
|
return openCheatsheetModal;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -125,102 +125,102 @@ const styles = {
|
|
|
125
125
|
})
|
|
126
126
|
};
|
|
127
127
|
const CheatsheetModalDialog = ()=>{
|
|
128
|
-
return
|
|
128
|
+
return _react.createElement(_f36components.ModalContent, {
|
|
129
129
|
testId: "markdown-cheatsheet-dialog-content"
|
|
130
|
-
},
|
|
130
|
+
}, _react.createElement("div", {
|
|
131
131
|
className: styles.flexColumnContainer
|
|
132
|
-
},
|
|
132
|
+
}, _react.createElement("div", {
|
|
133
133
|
className: (0, _css.cx)(styles.flexColumn, styles.verticalDivider)
|
|
134
|
-
},
|
|
134
|
+
}, _react.createElement("div", {
|
|
135
135
|
className: styles.helpItem
|
|
136
|
-
},
|
|
136
|
+
}, _react.createElement(_f36components.Heading, {
|
|
137
137
|
marginBottom: "none",
|
|
138
138
|
as: "h1",
|
|
139
139
|
className: (0, _css.cx)(styles.preview, styles.h1)
|
|
140
|
-
}, "H1"),
|
|
140
|
+
}, "H1"), _react.createElement("div", {
|
|
141
141
|
className: styles.markup
|
|
142
|
-
}, "# heading")),
|
|
142
|
+
}, "# heading")), _react.createElement("div", {
|
|
143
143
|
className: styles.helpItem
|
|
144
|
-
},
|
|
144
|
+
}, _react.createElement(_f36components.Heading, {
|
|
145
145
|
marginBottom: "none",
|
|
146
146
|
as: "h2",
|
|
147
147
|
className: (0, _css.cx)(styles.preview, styles.h2)
|
|
148
|
-
}, "H2"),
|
|
148
|
+
}, "H2"), _react.createElement("div", {
|
|
149
149
|
className: styles.markup
|
|
150
|
-
}, "## heading")),
|
|
150
|
+
}, "## heading")), _react.createElement("div", {
|
|
151
151
|
className: styles.helpItem
|
|
152
|
-
},
|
|
152
|
+
}, _react.createElement(_f36components.Heading, {
|
|
153
153
|
marginBottom: "none",
|
|
154
154
|
as: "h3",
|
|
155
155
|
className: (0, _css.cx)(styles.preview, styles.h3)
|
|
156
|
-
}, "H3"),
|
|
156
|
+
}, "H3"), _react.createElement("div", {
|
|
157
157
|
className: styles.markup
|
|
158
|
-
}, "### heading")),
|
|
158
|
+
}, "### heading")), _react.createElement("div", {
|
|
159
159
|
className: styles.helpItem
|
|
160
|
-
},
|
|
160
|
+
}, _react.createElement("strong", {
|
|
161
161
|
className: styles.preview
|
|
162
|
-
}, "bold"),
|
|
162
|
+
}, "bold"), _react.createElement("div", {
|
|
163
163
|
className: styles.markup
|
|
164
|
-
}, "__text__")),
|
|
164
|
+
}, "__text__")), _react.createElement("div", {
|
|
165
165
|
className: styles.helpItem
|
|
166
|
-
},
|
|
166
|
+
}, _react.createElement("em", {
|
|
167
167
|
className: styles.preview
|
|
168
|
-
}, "italic"),
|
|
168
|
+
}, "italic"), _react.createElement("div", {
|
|
169
169
|
className: styles.markup
|
|
170
|
-
}, "*text*")),
|
|
170
|
+
}, "*text*")), _react.createElement("div", {
|
|
171
171
|
className: styles.helpItem
|
|
172
|
-
},
|
|
172
|
+
}, _react.createElement("div", {
|
|
173
173
|
className: styles.preview
|
|
174
|
-
}, "strikethrough"),
|
|
174
|
+
}, "strikethrough"), _react.createElement("div", {
|
|
175
175
|
className: styles.markup
|
|
176
|
-
}, "~~text~~")),
|
|
176
|
+
}, "~~text~~")), _react.createElement("div", {
|
|
177
177
|
className: styles.helpItem
|
|
178
|
-
},
|
|
178
|
+
}, _react.createElement(_f36components.TextLink, {
|
|
179
179
|
as: "button",
|
|
180
180
|
className: styles.preview
|
|
181
|
-
}, "Link"),
|
|
181
|
+
}, "Link"), _react.createElement("div", {
|
|
182
182
|
className: styles.markup
|
|
183
|
-
}, "[text](url)"))),
|
|
183
|
+
}, "[text](url)"))), _react.createElement("div", {
|
|
184
184
|
className: styles.flexColumn
|
|
185
|
-
},
|
|
185
|
+
}, _react.createElement("div", {
|
|
186
186
|
className: styles.helpItem
|
|
187
|
-
},
|
|
187
|
+
}, _react.createElement("div", {
|
|
188
188
|
className: styles.preview
|
|
189
|
-
}, "Image"),
|
|
189
|
+
}, "Image"), _react.createElement("div", {
|
|
190
190
|
className: styles.markup
|
|
191
|
-
}, "")),
|
|
191
|
+
}, "")), _react.createElement("div", {
|
|
192
192
|
className: styles.helpItem
|
|
193
|
-
},
|
|
193
|
+
}, _react.createElement("div", {
|
|
194
194
|
className: styles.preview
|
|
195
|
-
}, "Unordered list"),
|
|
195
|
+
}, "Unordered list"), _react.createElement("div", {
|
|
196
196
|
className: styles.markup
|
|
197
|
-
}, "* list item")),
|
|
197
|
+
}, "* list item")), _react.createElement("div", {
|
|
198
198
|
className: styles.helpItem
|
|
199
|
-
},
|
|
199
|
+
}, _react.createElement("div", {
|
|
200
200
|
className: styles.preview
|
|
201
|
-
},
|
|
201
|
+
}, _react.createElement("div", null, "Ordered list")), _react.createElement("div", {
|
|
202
202
|
className: styles.markup
|
|
203
|
-
}, "1. list item")),
|
|
203
|
+
}, "1. list item")), _react.createElement("div", {
|
|
204
204
|
className: styles.helpItem
|
|
205
|
-
},
|
|
205
|
+
}, _react.createElement("div", {
|
|
206
206
|
className: styles.preview
|
|
207
|
-
},
|
|
207
|
+
}, _react.createElement("div", null, "Blockquote")), _react.createElement("div", {
|
|
208
208
|
className: styles.markup
|
|
209
|
-
}, "> quote")),
|
|
209
|
+
}, "> quote")), _react.createElement("div", {
|
|
210
210
|
className: styles.helpItem
|
|
211
|
-
},
|
|
211
|
+
}, _react.createElement("div", {
|
|
212
212
|
className: styles.preview
|
|
213
|
-
}, "code span"),
|
|
213
|
+
}, "code span"), _react.createElement("div", {
|
|
214
214
|
className: styles.markup
|
|
215
|
-
}, "`code here`")),
|
|
215
|
+
}, "`code here`")), _react.createElement("div", {
|
|
216
216
|
className: styles.helpItem
|
|
217
|
-
},
|
|
217
|
+
}, _react.createElement("div", {
|
|
218
218
|
className: styles.preview
|
|
219
|
-
}, "code block"),
|
|
219
|
+
}, "code block"), _react.createElement("div", {
|
|
220
220
|
className: styles.markup
|
|
221
|
-
}, "```code here```")))),
|
|
221
|
+
}, "```code here```")))), _react.createElement("div", {
|
|
222
222
|
className: styles.flexRowContainer
|
|
223
|
-
},
|
|
223
|
+
}, _react.createElement(_f36components.TextLink, {
|
|
224
224
|
className: styles.helpLink,
|
|
225
225
|
href: "https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax",
|
|
226
226
|
target: "_blank",
|
|
@@ -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
|
-
ConfirmInsertAssetModalDialog
|
|
12
|
+
get ConfirmInsertAssetModalDialog () {
|
|
13
13
|
return ConfirmInsertAssetModalDialog;
|
|
14
14
|
},
|
|
15
|
-
openConfirmInsertAsset
|
|
15
|
+
get openConfirmInsertAsset () {
|
|
16
16
|
return openConfirmInsertAsset;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -64,26 +64,26 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
64
64
|
const THUMBNAIL_SIZE = 46;
|
|
65
65
|
const ConfirmInsertAssetModalDialog = ({ onClose, assets, locale })=>{
|
|
66
66
|
const localesNumber = assets.length;
|
|
67
|
-
return
|
|
67
|
+
return _react.createElement(_react.Fragment, null, _react.createElement(_f36components.ModalContent, {
|
|
68
68
|
testId: "confirm-insert-asset"
|
|
69
|
-
},
|
|
69
|
+
}, _react.createElement(_f36components.Paragraph, null, localesNumber === 1 ? `Link asset with missing file for locale ${locale}` : `Link assets with missing files for locale ${locale}`), _react.createElement(_f36components.Paragraph, null, localesNumber === 1 ? 'Do you want to link to the file in its fallback locale?' : 'Do you want to link to the files in their fallback locales?'), _react.createElement(_f36components.EntityList, null, assets.map(({ title, description, thumbnailUrl, thumbnailAltText })=>{
|
|
70
70
|
const resolvedThumbnailUrl = _fieldeditorshared.entityHelpers.getResolvedImageUrl(thumbnailUrl, {
|
|
71
71
|
w: THUMBNAIL_SIZE,
|
|
72
72
|
h: THUMBNAIL_SIZE,
|
|
73
73
|
fit: 'thumb'
|
|
74
74
|
});
|
|
75
|
-
return
|
|
75
|
+
return _react.createElement(_f36components.EntityList.Item, {
|
|
76
76
|
key: thumbnailUrl,
|
|
77
77
|
title: title,
|
|
78
78
|
thumbnailUrl: resolvedThumbnailUrl,
|
|
79
79
|
thumbnailAltText: thumbnailAltText,
|
|
80
80
|
description: description
|
|
81
81
|
});
|
|
82
|
-
}))),
|
|
82
|
+
}))), _react.createElement(_f36components.ModalControls, null, _react.createElement(_f36components.Button, {
|
|
83
83
|
onClick: ()=>onClose(false),
|
|
84
84
|
variant: "secondary",
|
|
85
85
|
size: "small"
|
|
86
|
-
}, "Cancel"),
|
|
86
|
+
}, "Cancel"), _react.createElement(_f36components.Button, {
|
|
87
87
|
testId: "confirm-insert-asset",
|
|
88
88
|
onClick: ()=>onClose(true),
|
|
89
89
|
variant: "positive",
|