@contentful/field-editor-rich-text 3.2.0 → 3.2.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 CHANGED
@@ -3,6 +3,12 @@
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.2.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-rich-text@3.2.0...@contentful/field-editor-rich-text@3.2.1) (2022-11-18)
7
+
8
+ ### Bug Fixes
9
+
10
+ - explicitly setting sub super styles [TOL-30] ([#1281](https://github.com/contentful/field-editors/issues/1281)) ([6044115](https://github.com/contentful/field-editors/commit/6044115c89d68ac37d3a36d239bd45e5503cea7b))
11
+
6
12
  # [3.2.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-rich-text@3.1.12...@contentful/field-editor-rich-text@3.2.0) (2022-11-16)
7
13
 
8
14
  ### Features
@@ -5313,13 +5313,21 @@ var createUnderlinePlugin = function createUnderlinePlugin() {
5313
5313
  });
5314
5314
  };
5315
5315
 
5316
+ var styles$f = {
5317
+ superscript: /*#__PURE__*/emotion.css({
5318
+ verticalAlign: 'super',
5319
+ fontSize: 'smaller'
5320
+ })
5321
+ };
5316
5322
  var ToolbarSuperscriptButton = /*#__PURE__*/createMarkToolbarButton({
5317
5323
  title: 'Superscript',
5318
5324
  mark: Contentful.MARKS.SUPERSCRIPT,
5319
5325
  icon: /*#__PURE__*/React.createElement(f36Icons.SuperscriptIcon, null)
5320
5326
  });
5321
5327
  function Superscript(props) {
5322
- return /*#__PURE__*/React.createElement("sup", _extends({}, props.attributes), props.children);
5328
+ return /*#__PURE__*/React.createElement("sup", _extends({}, props.attributes, {
5329
+ className: styles$f.superscript
5330
+ }), props.children);
5323
5331
  }
5324
5332
  var createSuperscriptPlugin = function createSuperscriptPlugin() {
5325
5333
  return plateBasicMarks.createSuperscriptPlugin({
@@ -5336,6 +5344,12 @@ var createSuperscriptPlugin = function createSuperscriptPlugin() {
5336
5344
  });
5337
5345
  };
5338
5346
 
5347
+ var styles$g = {
5348
+ subscript: /*#__PURE__*/emotion.css({
5349
+ verticalAlign: 'sub',
5350
+ fontSize: 'smaller'
5351
+ })
5352
+ };
5339
5353
  var ToolbarSubscriptButton = /*#__PURE__*/createMarkToolbarButton({
5340
5354
  title: 'Subscript',
5341
5355
  mark: Contentful.MARKS.SUBSCRIPT,
@@ -5344,7 +5358,9 @@ var ToolbarSubscriptButton = /*#__PURE__*/createMarkToolbarButton({
5344
5358
  })
5345
5359
  });
5346
5360
  function Subscript(props) {
5347
- return /*#__PURE__*/React.createElement("sub", _extends({}, props.attributes), props.children);
5361
+ return /*#__PURE__*/React.createElement("sub", _extends({}, props.attributes, {
5362
+ className: styles$g.subscript
5363
+ }), props.children);
5348
5364
  }
5349
5365
  var createSubscriptPlugin = function createSubscriptPlugin() {
5350
5366
  return plateBasicMarks.createSubscriptPlugin({
@@ -5572,10 +5588,10 @@ var createNormalizerPlugin = function createNormalizerPlugin() {
5572
5588
  };
5573
5589
 
5574
5590
  var _templateObject$6, _styles$1;
5575
- var styles$f = (_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);
5591
+ var styles$h = (_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);
5576
5592
  function Paragraph(props) {
5577
5593
  return /*#__PURE__*/React.createElement("div", _extends({}, props.attributes, {
5578
- className: styles$f[Contentful.BLOCKS.PARAGRAPH]
5594
+ className: styles$h[Contentful.BLOCKS.PARAGRAPH]
5579
5595
  }), props.children);
5580
5596
  }
5581
5597
 
@@ -6217,7 +6233,7 @@ var isTable = function isTable(node) {
6217
6233
  return slate.Element.isElement(node) && node.type === Contentful.BLOCKS.TABLE;
6218
6234
  };
6219
6235
 
6220
- var styles$g = {
6236
+ var styles$i = {
6221
6237
  topRight: /*#__PURE__*/emotion.css({
6222
6238
  position: 'absolute',
6223
6239
  top: '6px',
@@ -6306,7 +6322,7 @@ var TableActions = function TableActions() {
6306
6322
  size: "small",
6307
6323
  variant: "transparent",
6308
6324
  tabIndex: -1,
6309
- className: styles$g.topRight,
6325
+ className: styles$i.topRight,
6310
6326
  icon: /*#__PURE__*/React__default.createElement(f36Icons.ChevronDownIcon, null),
6311
6327
  "aria-label": "Open table menu",
6312
6328
  testId: "cf-table-actions-button"
@@ -7236,7 +7252,7 @@ var normalizeEditorValue = function normalizeEditorValue(value, options) {
7236
7252
  };
7237
7253
 
7238
7254
  var STYLE_EDITOR_BORDER = "1px solid " + tokens.gray400;
7239
- var styles$h = {
7255
+ var styles$j = {
7240
7256
  root: /*#__PURE__*/emotion.css({
7241
7257
  position: 'relative'
7242
7258
  }),
@@ -7353,7 +7369,7 @@ var EmbedEntityWidget = function EmbedEntityWidget(_ref) {
7353
7369
  }, actions) : null;
7354
7370
  };
7355
7371
 
7356
- var styles$i = {
7372
+ var styles$k = {
7357
7373
  toolbar: /*#__PURE__*/emotion.css({
7358
7374
  border: "1px solid " + tokens.gray400,
7359
7375
  backgroundColor: tokens.gray100,
@@ -7398,14 +7414,14 @@ var Toolbar = function Toolbar(_ref) {
7398
7414
  var shouldDisableTables = isDisabled || !canInsertBlocks || isListSelected || isBlockquoteSelected;
7399
7415
  return /*#__PURE__*/React__default.createElement(f36Components.Flex, {
7400
7416
  testId: "toolbar",
7401
- className: styles$i.toolbar,
7417
+ className: styles$k.toolbar,
7402
7418
  alignItems: "center"
7403
7419
  }, /*#__PURE__*/React__default.createElement("div", {
7404
- className: styles$i.formattingOptionsWrapper
7420
+ className: styles$k.formattingOptionsWrapper
7405
7421
  }, /*#__PURE__*/React__default.createElement(ToolbarHeadingButton, {
7406
7422
  isDisabled: isDisabled || !canInsertBlocks
7407
7423
  }), validationInfo.isAnyMarkEnabled && /*#__PURE__*/React__default.createElement("span", {
7408
- className: styles$i.divider
7424
+ className: styles$k.divider
7409
7425
  }), isMarkEnabled(sdk.field, Contentful.MARKS.BOLD) && /*#__PURE__*/React__default.createElement(ToolbarBoldButton, {
7410
7426
  isDisabled: isDisabled
7411
7427
  }), isMarkEnabled(sdk.field, Contentful.MARKS.ITALIC) && /*#__PURE__*/React__default.createElement(ToolbarItalicButton, {
@@ -7419,11 +7435,11 @@ var Toolbar = function Toolbar(_ref) {
7419
7435
  }), isMarkEnabled(sdk.field, Contentful.MARKS.CODE) && /*#__PURE__*/React__default.createElement(ToolbarCodeButton, {
7420
7436
  isDisabled: isDisabled
7421
7437
  }), validationInfo.isAnyHyperlinkEnabled && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", {
7422
- className: styles$i.divider
7438
+ className: styles$k.divider
7423
7439
  }), /*#__PURE__*/React__default.createElement(ToolbarHyperlinkButton, {
7424
7440
  isDisabled: isDisabled
7425
7441
  })), validationInfo.isAnyBlockFormattingEnabled && /*#__PURE__*/React__default.createElement("span", {
7426
- className: styles$i.divider
7442
+ className: styles$k.divider
7427
7443
  }), /*#__PURE__*/React__default.createElement(ToolbarListButton, {
7428
7444
  isDisabled: isDisabled || !canInsertBlocks
7429
7445
  }), isNodeTypeEnabled(sdk.field, Contentful.BLOCKS.QUOTE) && /*#__PURE__*/React__default.createElement(ToolbarQuoteButton, {
@@ -7433,7 +7449,7 @@ var Toolbar = function Toolbar(_ref) {
7433
7449
  }), isNodeTypeEnabled(sdk.field, Contentful.BLOCKS.TABLE) && /*#__PURE__*/React__default.createElement(ToolbarTableButton, {
7434
7450
  isDisabled: shouldDisableTables
7435
7451
  })), /*#__PURE__*/React__default.createElement("div", {
7436
- className: styles$i.embedActionsWrapper
7452
+ className: styles$k.embedActionsWrapper
7437
7453
  }, /*#__PURE__*/React__default.createElement(EmbedEntityWidget, {
7438
7454
  isDisabled: isDisabled,
7439
7455
  canInsertBlocks: canInsertBlocks
@@ -7458,7 +7474,7 @@ function getValidationInfo(field) {
7458
7474
  }
7459
7475
 
7460
7476
  var _templateObject$b;
7461
- var styles$j = {
7477
+ var styles$l = {
7462
7478
  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 "])))
7463
7479
  };
7464
7480
 
@@ -7466,7 +7482,7 @@ var StickyToolbarWrapper = function StickyToolbarWrapper(_ref) {
7466
7482
  var isDisabled = _ref.isDisabled,
7467
7483
  children = _ref.children;
7468
7484
  return /*#__PURE__*/React__default.createElement("div", {
7469
- className: isDisabled ? '' : styles$j.nativeSticky
7485
+ className: isDisabled ? '' : styles$l.nativeSticky
7470
7486
  }, children);
7471
7487
  };
7472
7488
 
@@ -7579,9 +7595,9 @@ var ConnectedRichTextEditor = function ConnectedRichTextEditor(props) {
7579
7595
  setPendingExternalUpdate(true);
7580
7596
  setEditorContent(editor, documentToEditorValue(props.value));
7581
7597
  }, [props.value, id]);
7582
- var classNames = emotion.cx(styles$h.editor, props.minHeight !== undefined ? emotion.css({
7598
+ var classNames = emotion.cx(styles$j.editor, props.minHeight !== undefined ? emotion.css({
7583
7599
  minHeight: props.minHeight
7584
- }) : undefined, props.isDisabled ? styles$h.disabled : styles$h.enabled, props.isToolbarHidden && styles$h.hiddenToolbar);
7600
+ }) : undefined, props.isDisabled ? styles$j.disabled : styles$j.enabled, props.isToolbarHidden && styles$j.hiddenToolbar);
7585
7601
  React.useEffect(function () {
7586
7602
  if (!isFirstRender) {
7587
7603
  return;
@@ -7597,7 +7613,7 @@ var ConnectedRichTextEditor = function ConnectedRichTextEditor(props) {
7597
7613
  }, /*#__PURE__*/React__default.createElement(ContentfulEditorIdProvider, {
7598
7614
  value: id
7599
7615
  }, /*#__PURE__*/React__default.createElement("div", {
7600
- className: styles$h.root,
7616
+ className: styles$j.root,
7601
7617
  "data-test-id": "rich-text-editor"
7602
7618
  }, /*#__PURE__*/React__default.createElement(plateCore.Plate, {
7603
7619
  id: id,