@contentful/field-editor-rich-text 3.2.2 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/field-editor-rich-text.cjs.development.js +99 -34
- package/dist/field-editor-rich-text.cjs.development.js.map +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js.map +1 -1
- package/dist/field-editor-rich-text.esm.js +100 -35
- package/dist/field-editor-rich-text.esm.js.map +1 -1
- package/dist/plugins/Marks/Code.d.ts +6 -0
- package/dist/plugins/Marks/Subscript.d.ts +6 -0
- package/dist/plugins/Marks/Superscript.d.ts +6 -0
- package/dist/plugins/Marks/components/MarkToolbarButton.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.3.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-rich-text@3.3.0...@contentful/field-editor-rich-text@3.3.1) (2022-12-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @contentful/field-editor-rich-text
|
|
9
|
+
|
|
10
|
+
# [3.3.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-rich-text@3.2.2...@contentful/field-editor-rich-text@3.3.0) (2022-12-09)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- dropdown toolbar rich text [TOL-764] ([#1287](https://github.com/contentful/field-editors/issues/1287)) ([bfcc3d1](https://github.com/contentful/field-editors/commit/bfcc3d1f2a0da46877c0f35f53e13a3c79abca3b))
|
|
15
|
+
|
|
6
16
|
## [3.2.2](https://github.com/contentful/field-editors/compare/@contentful/field-editor-rich-text@3.2.1...@contentful/field-editor-rich-text@3.2.2) (2022-12-08)
|
|
7
17
|
|
|
8
18
|
### Bug Fixes
|
|
@@ -5120,6 +5120,12 @@ var buildMarkEventHandler = function buildMarkEventHandler(type) {
|
|
|
5120
5120
|
};
|
|
5121
5121
|
};
|
|
5122
5122
|
|
|
5123
|
+
var styles$c = {
|
|
5124
|
+
isActive: /*#__PURE__*/emotion.css({
|
|
5125
|
+
backgroundColor: tokens.blue100,
|
|
5126
|
+
color: tokens.blue600
|
|
5127
|
+
})
|
|
5128
|
+
};
|
|
5123
5129
|
var createMarkToolbarButton = function createMarkToolbarButton(_ref) {
|
|
5124
5130
|
var mark = _ref.mark,
|
|
5125
5131
|
title = _ref.title,
|
|
@@ -5138,6 +5144,18 @@ var createMarkToolbarButton = function createMarkToolbarButton(_ref) {
|
|
|
5138
5144
|
focus(editor);
|
|
5139
5145
|
}, [editor]);
|
|
5140
5146
|
if (!editor) return null;
|
|
5147
|
+
|
|
5148
|
+
if (!icon) {
|
|
5149
|
+
var _cx;
|
|
5150
|
+
|
|
5151
|
+
return /*#__PURE__*/React.createElement(f36Components.Menu.Item, {
|
|
5152
|
+
onClick: handleClick,
|
|
5153
|
+
disabled: isDisabled,
|
|
5154
|
+
className: emotion.cx((_cx = {}, _cx[styles$c.isActive] = plateCore.isMarkActive(editor, mark), _cx)),
|
|
5155
|
+
testId: mark + "-toolbar-button"
|
|
5156
|
+
}, title);
|
|
5157
|
+
}
|
|
5158
|
+
|
|
5141
5159
|
return /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
5142
5160
|
title: title,
|
|
5143
5161
|
testId: mark + "-toolbar-button",
|
|
@@ -5156,14 +5174,14 @@ var ToolbarBoldButton = /*#__PURE__*/createMarkToolbarButton({
|
|
|
5156
5174
|
mark: Contentful.MARKS.BOLD,
|
|
5157
5175
|
icon: /*#__PURE__*/React.createElement(f36Icons.FormatBoldIcon, null)
|
|
5158
5176
|
});
|
|
5159
|
-
var styles$
|
|
5177
|
+
var styles$d = {
|
|
5160
5178
|
bold: /*#__PURE__*/emotion.css({
|
|
5161
5179
|
fontWeight: 600
|
|
5162
5180
|
})
|
|
5163
5181
|
};
|
|
5164
5182
|
function Bold(props) {
|
|
5165
5183
|
return /*#__PURE__*/React.createElement("strong", _extends({}, props.attributes, {
|
|
5166
|
-
className: styles$
|
|
5184
|
+
className: styles$d.bold
|
|
5167
5185
|
}), props.children);
|
|
5168
5186
|
}
|
|
5169
5187
|
|
|
@@ -5203,7 +5221,11 @@ var ToolbarCodeButton = /*#__PURE__*/createMarkToolbarButton({
|
|
|
5203
5221
|
mark: Contentful.MARKS.CODE,
|
|
5204
5222
|
icon: /*#__PURE__*/React.createElement(f36Icons.CodeIcon, null)
|
|
5205
5223
|
});
|
|
5206
|
-
var
|
|
5224
|
+
var ToolbarDropdownCodeButton = /*#__PURE__*/createMarkToolbarButton({
|
|
5225
|
+
title: 'Code',
|
|
5226
|
+
mark: Contentful.MARKS.CODE
|
|
5227
|
+
});
|
|
5228
|
+
var styles$e = {
|
|
5207
5229
|
code: /*#__PURE__*/emotion.css({
|
|
5208
5230
|
fontFamily: 'monospace',
|
|
5209
5231
|
fontSize: '.9em'
|
|
@@ -5211,7 +5233,7 @@ var styles$d = {
|
|
|
5211
5233
|
};
|
|
5212
5234
|
function Code(props) {
|
|
5213
5235
|
return /*#__PURE__*/React.createElement("code", _extends({}, props.attributes, {
|
|
5214
|
-
className: styles$
|
|
5236
|
+
className: styles$e.code
|
|
5215
5237
|
}), props.children);
|
|
5216
5238
|
}
|
|
5217
5239
|
var createCodePlugin = function createCodePlugin() {
|
|
@@ -5241,14 +5263,14 @@ var ToolbarItalicButton = /*#__PURE__*/createMarkToolbarButton({
|
|
|
5241
5263
|
mark: Contentful.MARKS.ITALIC,
|
|
5242
5264
|
icon: /*#__PURE__*/React.createElement(f36Icons.FormatItalicIcon, null)
|
|
5243
5265
|
});
|
|
5244
|
-
var styles$
|
|
5266
|
+
var styles$f = {
|
|
5245
5267
|
italic: /*#__PURE__*/emotion.css({
|
|
5246
5268
|
fontStyle: 'italic'
|
|
5247
5269
|
})
|
|
5248
5270
|
};
|
|
5249
5271
|
function Italic(props) {
|
|
5250
5272
|
return /*#__PURE__*/React.createElement("em", _extends({}, props.attributes, {
|
|
5251
|
-
className: styles$
|
|
5273
|
+
className: styles$f.italic
|
|
5252
5274
|
}), props.children);
|
|
5253
5275
|
}
|
|
5254
5276
|
var createItalicPlugin = function createItalicPlugin() {
|
|
@@ -5313,7 +5335,7 @@ var createUnderlinePlugin = function createUnderlinePlugin() {
|
|
|
5313
5335
|
});
|
|
5314
5336
|
};
|
|
5315
5337
|
|
|
5316
|
-
var styles$
|
|
5338
|
+
var styles$g = {
|
|
5317
5339
|
superscript: /*#__PURE__*/emotion.css({
|
|
5318
5340
|
verticalAlign: 'super',
|
|
5319
5341
|
fontSize: 'smaller'
|
|
@@ -5324,9 +5346,13 @@ var ToolbarSuperscriptButton = /*#__PURE__*/createMarkToolbarButton({
|
|
|
5324
5346
|
mark: Contentful.MARKS.SUPERSCRIPT,
|
|
5325
5347
|
icon: /*#__PURE__*/React.createElement(f36Icons.SuperscriptIcon, null)
|
|
5326
5348
|
});
|
|
5349
|
+
var ToolbarDropdownSuperscriptButton = /*#__PURE__*/createMarkToolbarButton({
|
|
5350
|
+
title: 'Superscript',
|
|
5351
|
+
mark: Contentful.MARKS.SUPERSCRIPT
|
|
5352
|
+
});
|
|
5327
5353
|
function Superscript(props) {
|
|
5328
5354
|
return /*#__PURE__*/React.createElement("sup", _extends({}, props.attributes, {
|
|
5329
|
-
className: styles$
|
|
5355
|
+
className: styles$g.superscript
|
|
5330
5356
|
}), props.children);
|
|
5331
5357
|
}
|
|
5332
5358
|
var createSuperscriptPlugin = function createSuperscriptPlugin() {
|
|
@@ -5344,7 +5370,7 @@ var createSuperscriptPlugin = function createSuperscriptPlugin() {
|
|
|
5344
5370
|
});
|
|
5345
5371
|
};
|
|
5346
5372
|
|
|
5347
|
-
var styles$
|
|
5373
|
+
var styles$h = {
|
|
5348
5374
|
subscript: /*#__PURE__*/emotion.css({
|
|
5349
5375
|
verticalAlign: 'sub',
|
|
5350
5376
|
fontSize: 'smaller'
|
|
@@ -5357,9 +5383,13 @@ var ToolbarSubscriptButton = /*#__PURE__*/createMarkToolbarButton({
|
|
|
5357
5383
|
viewBox: "0 0 23 18"
|
|
5358
5384
|
})
|
|
5359
5385
|
});
|
|
5386
|
+
var ToolbarDropdownSubscriptButton = /*#__PURE__*/createMarkToolbarButton({
|
|
5387
|
+
title: 'Subscript',
|
|
5388
|
+
mark: Contentful.MARKS.SUBSCRIPT
|
|
5389
|
+
});
|
|
5360
5390
|
function Subscript(props) {
|
|
5361
5391
|
return /*#__PURE__*/React.createElement("sub", _extends({}, props.attributes, {
|
|
5362
|
-
className: styles$
|
|
5392
|
+
className: styles$h.subscript
|
|
5363
5393
|
}), props.children);
|
|
5364
5394
|
}
|
|
5365
5395
|
var createSubscriptPlugin = function createSubscriptPlugin() {
|
|
@@ -5588,10 +5618,10 @@ var createNormalizerPlugin = function createNormalizerPlugin() {
|
|
|
5588
5618
|
};
|
|
5589
5619
|
|
|
5590
5620
|
var _templateObject$6, _styles$1;
|
|
5591
|
-
var styles$
|
|
5621
|
+
var styles$i = (_styles$1 = {}, _styles$1[Contentful.BLOCKS.PARAGRAPH] = /*#__PURE__*/emotion.css(_templateObject$6 || (_templateObject$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n line-height: ", ";\n margin-bottom: 1.5em;\n "])), tokens.lineHeightDefault), _styles$1);
|
|
5592
5622
|
function Paragraph(props) {
|
|
5593
5623
|
return /*#__PURE__*/React.createElement("div", _extends({}, props.attributes, {
|
|
5594
|
-
className: styles$
|
|
5624
|
+
className: styles$i[Contentful.BLOCKS.PARAGRAPH]
|
|
5595
5625
|
}), props.children);
|
|
5596
5626
|
}
|
|
5597
5627
|
|
|
@@ -6233,7 +6263,7 @@ var isTable = function isTable(node) {
|
|
|
6233
6263
|
return slate.Element.isElement(node) && node.type === Contentful.BLOCKS.TABLE;
|
|
6234
6264
|
};
|
|
6235
6265
|
|
|
6236
|
-
var styles$
|
|
6266
|
+
var styles$j = {
|
|
6237
6267
|
topRight: /*#__PURE__*/emotion.css({
|
|
6238
6268
|
position: 'absolute',
|
|
6239
6269
|
top: '6px',
|
|
@@ -6322,7 +6352,7 @@ var TableActions = function TableActions() {
|
|
|
6322
6352
|
size: "small",
|
|
6323
6353
|
variant: "transparent",
|
|
6324
6354
|
tabIndex: -1,
|
|
6325
|
-
className: styles$
|
|
6355
|
+
className: styles$j.topRight,
|
|
6326
6356
|
icon: /*#__PURE__*/React__default.createElement(f36Icons.ChevronDownIcon, null),
|
|
6327
6357
|
"aria-label": "Open table menu",
|
|
6328
6358
|
testId: "cf-table-actions-button"
|
|
@@ -7271,7 +7301,7 @@ var normalizeEditorValue = function normalizeEditorValue(value, options) {
|
|
|
7271
7301
|
};
|
|
7272
7302
|
|
|
7273
7303
|
var STYLE_EDITOR_BORDER = "1px solid " + tokens.gray400;
|
|
7274
|
-
var styles$
|
|
7304
|
+
var styles$k = {
|
|
7275
7305
|
root: /*#__PURE__*/emotion.css({
|
|
7276
7306
|
position: 'relative'
|
|
7277
7307
|
}),
|
|
@@ -7388,13 +7418,19 @@ var EmbedEntityWidget = function EmbedEntityWidget(_ref) {
|
|
|
7388
7418
|
}, actions) : null;
|
|
7389
7419
|
};
|
|
7390
7420
|
|
|
7391
|
-
var styles$
|
|
7421
|
+
var styles$l = {
|
|
7392
7422
|
toolbar: /*#__PURE__*/emotion.css({
|
|
7393
7423
|
border: "1px solid " + tokens.gray400,
|
|
7394
7424
|
backgroundColor: tokens.gray100,
|
|
7395
7425
|
padding: tokens.spacingXs,
|
|
7396
7426
|
borderRadius: tokens.borderRadiusMedium + " " + tokens.borderRadiusMedium + " 0 0"
|
|
7397
7427
|
}),
|
|
7428
|
+
toolbarBtn: /*#__PURE__*/emotion.css({
|
|
7429
|
+
height: '30px',
|
|
7430
|
+
width: '30px',
|
|
7431
|
+
marginLeft: tokens.spacing2Xs,
|
|
7432
|
+
marginRight: tokens.spacing2Xs
|
|
7433
|
+
}),
|
|
7398
7434
|
divider: /*#__PURE__*/emotion.css({
|
|
7399
7435
|
display: 'inline-block',
|
|
7400
7436
|
height: '21px',
|
|
@@ -7420,8 +7456,30 @@ var styles$k = {
|
|
|
7420
7456
|
})
|
|
7421
7457
|
};
|
|
7422
7458
|
|
|
7423
|
-
var
|
|
7424
|
-
var
|
|
7459
|
+
var Dropdown = function Dropdown(_ref) {
|
|
7460
|
+
var sdk = _ref.sdk,
|
|
7461
|
+
isDisabled = _ref.isDisabled;
|
|
7462
|
+
var editor = useContentfulEditor();
|
|
7463
|
+
var isActive = plateCore.isMarkActive(editor, Contentful.MARKS.SUPERSCRIPT) || plateCore.isMarkActive(editor, Contentful.MARKS.SUBSCRIPT) || plateCore.isMarkActive(editor, Contentful.MARKS.CODE);
|
|
7464
|
+
return /*#__PURE__*/React__default.createElement(f36Components.Menu, null, /*#__PURE__*/React__default.createElement(f36Components.Menu.Trigger, null, /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(f36Components.IconButton, {
|
|
7465
|
+
size: "small",
|
|
7466
|
+
className: styles$l.toolbarBtn,
|
|
7467
|
+
variant: isActive ? 'secondary' : 'transparent',
|
|
7468
|
+
icon: /*#__PURE__*/React__default.createElement(f36Icons.MoreHorizontalIcon, null),
|
|
7469
|
+
"aria-label": "toggle menu",
|
|
7470
|
+
isDisabled: isDisabled,
|
|
7471
|
+
testId: "dropdown-toolbar-button"
|
|
7472
|
+
}))), /*#__PURE__*/React__default.createElement(f36Components.Menu.List, null, isMarkEnabled(sdk.field, Contentful.MARKS.SUPERSCRIPT) && /*#__PURE__*/React__default.createElement(ToolbarDropdownSuperscriptButton, {
|
|
7473
|
+
isDisabled: isDisabled
|
|
7474
|
+
}), isMarkEnabled(sdk.field, Contentful.MARKS.SUBSCRIPT) && /*#__PURE__*/React__default.createElement(ToolbarDropdownSubscriptButton, {
|
|
7475
|
+
isDisabled: isDisabled
|
|
7476
|
+
}), isMarkEnabled(sdk.field, Contentful.MARKS.CODE) && /*#__PURE__*/React__default.createElement(ToolbarDropdownCodeButton, {
|
|
7477
|
+
isDisabled: isDisabled
|
|
7478
|
+
})));
|
|
7479
|
+
};
|
|
7480
|
+
|
|
7481
|
+
var Toolbar = function Toolbar(_ref2) {
|
|
7482
|
+
var isDisabled = _ref2.isDisabled;
|
|
7425
7483
|
var sdk = useSdkContext();
|
|
7426
7484
|
var editor = useContentfulEditor();
|
|
7427
7485
|
var canInsertBlocks = !isNodeTypeSelected(editor, Contentful.BLOCKS.TABLE);
|
|
@@ -7430,35 +7488,42 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
7430
7488
|
}, [sdk.field]);
|
|
7431
7489
|
var isListSelected = isNodeTypeSelected(editor, Contentful.BLOCKS.UL_LIST) || isNodeTypeSelected(editor, Contentful.BLOCKS.OL_LIST);
|
|
7432
7490
|
var isBlockquoteSelected = isNodeTypeSelected(editor, Contentful.BLOCKS.QUOTE);
|
|
7433
|
-
var shouldDisableTables = isDisabled || !canInsertBlocks || isListSelected || isBlockquoteSelected;
|
|
7491
|
+
var shouldDisableTables = isDisabled || !canInsertBlocks || isListSelected || isBlockquoteSelected; // We only show the dropdown when: whenever at least bold , italic and underline are available; If nothing that would go inside the dropdown is available, we hide it
|
|
7492
|
+
|
|
7493
|
+
var boldItalicUnderlineAvailable = isMarkEnabled(sdk.field, Contentful.MARKS.BOLD) || isMarkEnabled(sdk.field, Contentful.MARKS.ITALIC) || isMarkEnabled(sdk.field, Contentful.MARKS.UNDERLINE);
|
|
7494
|
+
var dropdownItemsAvailable = isMarkEnabled(sdk.field, Contentful.MARKS.SUPERSCRIPT) || isMarkEnabled(sdk.field, Contentful.MARKS.SUBSCRIPT) || isMarkEnabled(sdk.field, Contentful.MARKS.CODE);
|
|
7495
|
+
var shouldShowDropdown = boldItalicUnderlineAvailable && dropdownItemsAvailable;
|
|
7434
7496
|
return /*#__PURE__*/React__default.createElement(f36Components.Flex, {
|
|
7435
7497
|
testId: "toolbar",
|
|
7436
|
-
className: styles$
|
|
7498
|
+
className: styles$l.toolbar,
|
|
7437
7499
|
alignItems: "center"
|
|
7438
7500
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
7439
|
-
className: styles$
|
|
7501
|
+
className: styles$l.formattingOptionsWrapper
|
|
7440
7502
|
}, /*#__PURE__*/React__default.createElement(ToolbarHeadingButton, {
|
|
7441
7503
|
isDisabled: isDisabled || !canInsertBlocks
|
|
7442
7504
|
}), validationInfo.isAnyMarkEnabled && /*#__PURE__*/React__default.createElement("span", {
|
|
7443
|
-
className: styles$
|
|
7505
|
+
className: styles$l.divider
|
|
7444
7506
|
}), isMarkEnabled(sdk.field, Contentful.MARKS.BOLD) && /*#__PURE__*/React__default.createElement(ToolbarBoldButton, {
|
|
7445
7507
|
isDisabled: isDisabled
|
|
7446
7508
|
}), isMarkEnabled(sdk.field, Contentful.MARKS.ITALIC) && /*#__PURE__*/React__default.createElement(ToolbarItalicButton, {
|
|
7447
7509
|
isDisabled: isDisabled
|
|
7448
|
-
}), isMarkEnabled(sdk.field, Contentful.MARKS.
|
|
7510
|
+
}), isMarkEnabled(sdk.field, Contentful.MARKS.UNDERLINE) && /*#__PURE__*/React__default.createElement(ToolbarUnderlineButton, {
|
|
7449
7511
|
isDisabled: isDisabled
|
|
7450
|
-
}), isMarkEnabled(sdk.field, Contentful.MARKS.
|
|
7512
|
+
}), !boldItalicUnderlineAvailable && isMarkEnabled(sdk.field, Contentful.MARKS.SUPERSCRIPT) && /*#__PURE__*/React__default.createElement(ToolbarSuperscriptButton, {
|
|
7451
7513
|
isDisabled: isDisabled
|
|
7452
|
-
}), isMarkEnabled(sdk.field, Contentful.MARKS.
|
|
7514
|
+
}), !boldItalicUnderlineAvailable && isMarkEnabled(sdk.field, Contentful.MARKS.SUBSCRIPT) && /*#__PURE__*/React__default.createElement(ToolbarSubscriptButton, {
|
|
7453
7515
|
isDisabled: isDisabled
|
|
7454
|
-
}), isMarkEnabled(sdk.field, Contentful.MARKS.CODE) && /*#__PURE__*/React__default.createElement(ToolbarCodeButton, {
|
|
7516
|
+
}), !boldItalicUnderlineAvailable && isMarkEnabled(sdk.field, Contentful.MARKS.CODE) && /*#__PURE__*/React__default.createElement(ToolbarCodeButton, {
|
|
7517
|
+
isDisabled: isDisabled
|
|
7518
|
+
}), shouldShowDropdown && /*#__PURE__*/React__default.createElement(Dropdown, {
|
|
7519
|
+
sdk: sdk,
|
|
7455
7520
|
isDisabled: isDisabled
|
|
7456
7521
|
}), validationInfo.isAnyHyperlinkEnabled && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", {
|
|
7457
|
-
className: styles$
|
|
7522
|
+
className: styles$l.divider
|
|
7458
7523
|
}), /*#__PURE__*/React__default.createElement(ToolbarHyperlinkButton, {
|
|
7459
7524
|
isDisabled: isDisabled
|
|
7460
7525
|
})), validationInfo.isAnyBlockFormattingEnabled && /*#__PURE__*/React__default.createElement("span", {
|
|
7461
|
-
className: styles$
|
|
7526
|
+
className: styles$l.divider
|
|
7462
7527
|
}), /*#__PURE__*/React__default.createElement(ToolbarListButton, {
|
|
7463
7528
|
isDisabled: isDisabled || !canInsertBlocks
|
|
7464
7529
|
}), isNodeTypeEnabled(sdk.field, Contentful.BLOCKS.QUOTE) && /*#__PURE__*/React__default.createElement(ToolbarQuoteButton, {
|
|
@@ -7468,7 +7533,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
7468
7533
|
}), isNodeTypeEnabled(sdk.field, Contentful.BLOCKS.TABLE) && /*#__PURE__*/React__default.createElement(ToolbarTableButton, {
|
|
7469
7534
|
isDisabled: shouldDisableTables
|
|
7470
7535
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
7471
|
-
className: styles$
|
|
7536
|
+
className: styles$l.embedActionsWrapper
|
|
7472
7537
|
}, /*#__PURE__*/React__default.createElement(EmbedEntityWidget, {
|
|
7473
7538
|
isDisabled: isDisabled,
|
|
7474
7539
|
canInsertBlocks: canInsertBlocks
|
|
@@ -7493,7 +7558,7 @@ function getValidationInfo(field) {
|
|
|
7493
7558
|
}
|
|
7494
7559
|
|
|
7495
7560
|
var _templateObject$b;
|
|
7496
|
-
var styles$
|
|
7561
|
+
var styles$m = {
|
|
7497
7562
|
nativeSticky: /*#__PURE__*/emotion.css(_templateObject$b || (_templateObject$b = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: -webkit-sticky;\n position: sticky;\n top: -1px;\n z-index: 2;\n "])))
|
|
7498
7563
|
};
|
|
7499
7564
|
|
|
@@ -7501,7 +7566,7 @@ var StickyToolbarWrapper = function StickyToolbarWrapper(_ref) {
|
|
|
7501
7566
|
var isDisabled = _ref.isDisabled,
|
|
7502
7567
|
children = _ref.children;
|
|
7503
7568
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
7504
|
-
className: isDisabled ? '' : styles$
|
|
7569
|
+
className: isDisabled ? '' : styles$m.nativeSticky
|
|
7505
7570
|
}, children);
|
|
7506
7571
|
};
|
|
7507
7572
|
|
|
@@ -7614,9 +7679,9 @@ var ConnectedRichTextEditor = function ConnectedRichTextEditor(props) {
|
|
|
7614
7679
|
setPendingExternalUpdate(true);
|
|
7615
7680
|
setEditorContent(editor, documentToEditorValue(props.value));
|
|
7616
7681
|
}, [props.value, id]);
|
|
7617
|
-
var classNames = emotion.cx(styles$
|
|
7682
|
+
var classNames = emotion.cx(styles$k.editor, props.minHeight !== undefined ? emotion.css({
|
|
7618
7683
|
minHeight: props.minHeight
|
|
7619
|
-
}) : undefined, props.isDisabled ? styles$
|
|
7684
|
+
}) : undefined, props.isDisabled ? styles$k.disabled : styles$k.enabled, props.isToolbarHidden && styles$k.hiddenToolbar);
|
|
7620
7685
|
React.useEffect(function () {
|
|
7621
7686
|
if (!isFirstRender) {
|
|
7622
7687
|
return;
|
|
@@ -7632,7 +7697,7 @@ var ConnectedRichTextEditor = function ConnectedRichTextEditor(props) {
|
|
|
7632
7697
|
}, /*#__PURE__*/React__default.createElement(ContentfulEditorIdProvider, {
|
|
7633
7698
|
value: id
|
|
7634
7699
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
7635
|
-
className: styles$
|
|
7700
|
+
className: styles$k.root,
|
|
7636
7701
|
"data-test-id": "rich-text-editor"
|
|
7637
7702
|
}, /*#__PURE__*/React__default.createElement(plateCore.Plate, {
|
|
7638
7703
|
id: id,
|