@atlaskit/editor-common 107.2.2 → 107.2.4

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.
Files changed (31) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/analytics/types/enums.js +1 -0
  3. package/dist/cjs/monitoring/error.js +1 -1
  4. package/dist/cjs/styles/shared/code-block.js +3 -4
  5. package/dist/cjs/ugc-tokens/get-editor-ugc-token.js +1 -6
  6. package/dist/cjs/ui/DropList/index.js +1 -1
  7. package/dist/cjs/utils/annotation/index.js +35 -0
  8. package/dist/cjs/utils/index.js +6 -0
  9. package/dist/es2019/analytics/types/enums.js +1 -0
  10. package/dist/es2019/monitoring/error.js +1 -1
  11. package/dist/es2019/styles/shared/code-block.js +0 -5
  12. package/dist/es2019/ugc-tokens/get-editor-ugc-token.js +2 -7
  13. package/dist/es2019/ui/DropList/index.js +1 -1
  14. package/dist/es2019/utils/annotation/index.js +35 -0
  15. package/dist/es2019/utils/index.js +1 -1
  16. package/dist/esm/analytics/types/enums.js +1 -0
  17. package/dist/esm/monitoring/error.js +1 -1
  18. package/dist/esm/styles/shared/code-block.js +3 -4
  19. package/dist/esm/ugc-tokens/get-editor-ugc-token.js +2 -7
  20. package/dist/esm/ui/DropList/index.js +1 -1
  21. package/dist/esm/utils/annotation/index.js +34 -0
  22. package/dist/esm/utils/index.js +1 -1
  23. package/dist/types/analytics/types/enums.d.ts +1 -0
  24. package/dist/types/analytics/types/offline-editing-event.d.ts +1 -1
  25. package/dist/types/utils/annotation/index.d.ts +8 -0
  26. package/dist/types/utils/index.d.ts +1 -1
  27. package/dist/types-ts4.5/analytics/types/enums.d.ts +1 -0
  28. package/dist/types-ts4.5/analytics/types/offline-editing-event.d.ts +1 -1
  29. package/dist/types-ts4.5/utils/annotation/index.d.ts +8 -0
  30. package/dist/types-ts4.5/utils/index.d.ts +1 -1
  31. package/package.json +4 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 107.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#176907](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/176907)
8
+ [`b3cdb5aa072a9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b3cdb5aa072a9) -
9
+ [ux] Adjust non-empty selection validation logic for the renderer, to disallow annotations on
10
+ empty block nodes like table cells and expands
11
+
12
+ ## 107.2.3
13
+
14
+ ### Patch Changes
15
+
16
+ - [#175286](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/175286)
17
+ [`0e6d71c300392`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0e6d71c300392) -
18
+ [EDITOR-971] - ff cleanup on platform_editor_fix_code_block_bg_color_in_macro
19
+
3
20
  ## 107.2.2
4
21
 
5
22
  ### Patch Changes
@@ -92,6 +92,7 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
92
92
  ACTION["MEDIA_LINK_TRANSFORMED"] = "mediaLinkTransformed";
93
93
  ACTION["NODE_CONTENT_SANITIZED"] = "nodeContentSanitized";
94
94
  ACTION["OFFLINE_STORAGE_TOO_MANY_RETRIES_ERROR"] = "offlineStorageTooManyRetriesError";
95
+ ACTION["OFFLINE_STORAGE_FAILED_STEPS"] = "offlineStorageFailedSteps";
95
96
  ACTION["OFFLINE_STORAGE_STEPS_DATABASE_ERROR"] = "offlineStorageStepsDatabaseError";
96
97
  ACTION["OFFLINE_STORAGE_RESYNC_ONLINE"] = "offlineStorageResyncOnline";
97
98
  ACTION["OFFLINE_STORAGE_BROADCAST_CHANNEL_FIRST_UPDATE"] = "offlineStorageBroadcastChannelFirstUpdate";
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
16
16
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "107.2.1";
19
+ var packageVersion = "107.2.3";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // Ignored via go/ees007
@@ -8,8 +8,7 @@ exports.codeBlockSharedStyles = exports.codeBlockInListSafariFix = exports.CodeB
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
9
  var _react = require("@emotion/react");
10
10
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
11
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
11
+ var _templateObject, _templateObject2;
13
12
  /* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression -- Should be safe to autofix, but ignoring for now */
14
13
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
15
14
  var CodeBlockSharedCssClassName = exports.CodeBlockSharedCssClassName = {
@@ -24,10 +23,10 @@ var CodeBlockSharedCssClassName = exports.CodeBlockSharedCssClassName = {
24
23
  CODEBLOCK_CONTAINER_LINE_NUMBER_WIDGET: 'code-content__line-number--wrapped'
25
24
  };
26
25
  var codeBlockSharedStyles = exports.codeBlockSharedStyles = function codeBlockSharedStyles() {
27
- return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", "\n\t\t> .", "\n\t\t> .", " {\n\t\tmargin-right: ", ";\n\n\t\tcode {\n\t\t\tdisplay: block;\n\t\t\tword-break: break-word;\n\t\t\twhite-space: pre-wrap;\n\t\t}\n\t}\n\n\t.", "\n\t\t> .", " {\n\t\tdisplay: flex;\n\t\tflex: 1;\n\n\t\tcode {\n\t\t\tflex-grow: 1;\n\n\t\t\twhite-space: pre;\n\t\t}\n\t}\n\n\t.", " {\n\t\tposition: relative;\n\t\tbackground-color: ", ";\n\t\tborder-radius: ", ";\n\t\tmargin: ", " 0 0 0;\n\t\tfont-family: ", ";\n\t\tmin-width: ", "px;\n\t\tcursor: pointer;\n\t\tclear: both;\n\n\t\t", "\n\n\t\t.code-block-gutter-pseudo-element::before {\n\t\t\tcontent: attr(data-label);\n\t\t}\n\n\t\t/* This is necessary to allow for arrow key navigation in/out of code blocks in Firefox. */\n\t\twhite-space: normal;\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\ttop: 0px;\n\t\t\tleft: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\tbottom: 0px;\n\t\t\tright: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tposition: relative;\n\t\t\tbackground-color: ", ";\n\t\t\tdisplay: flex;\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 100%;\n\t\t\tcounter-reset: line;\n\t\t\toverflow-x: auto;\n\n\t\t\tbackground-image: ", ";\n\n\t\t\tbackground-repeat: no-repeat;\n\t\t\tbackground-attachment: local, local, local, local, scroll, scroll, scroll, scroll;\n\t\t\tbackground-size:\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%;\n\t\t\tbackground-position:\n\t\t\t\t0 0,\n\t\t\t\t0 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t0 0,\n\t\t\t\t0 0;\n\n\t\t\t/* Be careful if refactoring this; it is needed to keep arrow key navigation in Firefox consistent with other browsers. */\n\t\t\toverflow-y: hidden;\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tposition: relative;\n\t\t\twidth: var(--lineNumberGutterWidth, 2rem);\n\t\t\tpadding: ", ";\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: ", ";\n\t\t\tbox-sizing: content-box;\n\t\t}\n\n\t\t/* This is a fix of marker of list item with code block.\n\t\t The list item marker in Chrome is aligned by the baseline of the text,\n\t\t that's why we need to add a text (content: \"1\") to the line number gutter to align\n\t\t the list item marker with the text.\n\t\t Without it, the list item marker will be aligned by the bottom of the code block. */\n\t\t.", "::before {\n\t\t\tcontent: '1';\n\t\t\tvisibility: hidden;\n\t\t\tfont-size: ", ";\n\t\t\tline-height: 1.5rem;\n\t\t}\n\n\t\t.", " {\n\t\t\tcode {\n\t\t\t\ttab-size: 4;\n\t\t\t\tcursor: text;\n\t\t\t\tcolor: ", ";\n\t\t\t\tborder-radius: ", ";\n\t\t\t\tmargin: ", ";\n\t\t\t\tfont-size: ", ";\n\t\t\t\tline-height: 1.5rem;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tpointer-events: none;\n\t\t\tuser-select: none;\n\t\t\twidth: var(--lineNumberGutterWidth, 2rem);\n\t\t\tleft: 0;\n\t\t\tposition: absolute;\n\t\t\tfont-size: ", ";\n\t\t\tpadding: 0px ", ";\n\t\t\tline-height: 1.5rem;\n\t\t\ttext-align: right;\n\t\t\tcolor: ", ";\n\t\t\tbox-sizing: content-box;\n\t\t}\n\t}\n"])), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPED, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-space-100, 8px)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, #FFFFFF)", "var(--ds-border-radius, 3px)", _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorCodeFontFamily, _editorSharedStyles.akEditorTableCellMinWidth, (0, _platformFeatureFlags.fg)('platform_editor_fix_code_block_bg_color_in_macro') ? (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)([""]))) : (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t\t--ds--code--bg-color: transparent;\n\t\t\t\t"]))), CodeBlockSharedCssClassName.CODEBLOCK_START, CodeBlockSharedCssClassName.CODEBLOCK_END, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "var(--ds-background-neutral, #091E420F)", "var(--ds-border-radius, 3px)", (0, _editorSharedStyles.overflowShadow)({
26
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", "\n\t\t> .", "\n\t\t> .", " {\n\t\tmargin-right: ", ";\n\n\t\tcode {\n\t\t\tdisplay: block;\n\t\t\tword-break: break-word;\n\t\t\twhite-space: pre-wrap;\n\t\t}\n\t}\n\n\t.", "\n\t\t> .", " {\n\t\tdisplay: flex;\n\t\tflex: 1;\n\n\t\tcode {\n\t\t\tflex-grow: 1;\n\n\t\t\twhite-space: pre;\n\t\t}\n\t}\n\n\t.", " {\n\t\tposition: relative;\n\t\tbackground-color: ", ";\n\t\tborder-radius: ", ";\n\t\tmargin: ", " 0 0 0;\n\t\tfont-family: ", ";\n\t\tmin-width: ", "px;\n\t\tcursor: pointer;\n\t\tclear: both;\n\n\t\t.code-block-gutter-pseudo-element::before {\n\t\t\tcontent: attr(data-label);\n\t\t}\n\n\t\t/* This is necessary to allow for arrow key navigation in/out of code blocks in Firefox. */\n\t\twhite-space: normal;\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\ttop: 0px;\n\t\t\tleft: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\tbottom: 0px;\n\t\t\tright: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tposition: relative;\n\t\t\tbackground-color: ", ";\n\t\t\tdisplay: flex;\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 100%;\n\t\t\tcounter-reset: line;\n\t\t\toverflow-x: auto;\n\n\t\t\tbackground-image: ", ";\n\n\t\t\tbackground-repeat: no-repeat;\n\t\t\tbackground-attachment: local, local, local, local, scroll, scroll, scroll, scroll;\n\t\t\tbackground-size:\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%;\n\t\t\tbackground-position:\n\t\t\t\t0 0,\n\t\t\t\t0 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t0 0,\n\t\t\t\t0 0;\n\n\t\t\t/* Be careful if refactoring this; it is needed to keep arrow key navigation in Firefox consistent with other browsers. */\n\t\t\toverflow-y: hidden;\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tposition: relative;\n\t\t\twidth: var(--lineNumberGutterWidth, 2rem);\n\t\t\tpadding: ", ";\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: ", ";\n\t\t\tbox-sizing: content-box;\n\t\t}\n\n\t\t/* This is a fix of marker of list item with code block.\n\t\t The list item marker in Chrome is aligned by the baseline of the text,\n\t\t that's why we need to add a text (content: \"1\") to the line number gutter to align\n\t\t the list item marker with the text.\n\t\t Without it, the list item marker will be aligned by the bottom of the code block. */\n\t\t.", "::before {\n\t\t\tcontent: '1';\n\t\t\tvisibility: hidden;\n\t\t\tfont-size: ", ";\n\t\t\tline-height: 1.5rem;\n\t\t}\n\n\t\t.", " {\n\t\t\tcode {\n\t\t\t\ttab-size: 4;\n\t\t\t\tcursor: text;\n\t\t\t\tcolor: ", ";\n\t\t\t\tborder-radius: ", ";\n\t\t\t\tmargin: ", ";\n\t\t\t\tfont-size: ", ";\n\t\t\t\tline-height: 1.5rem;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tpointer-events: none;\n\t\t\tuser-select: none;\n\t\t\twidth: var(--lineNumberGutterWidth, 2rem);\n\t\t\tleft: 0;\n\t\t\tposition: absolute;\n\t\t\tfont-size: ", ";\n\t\t\tpadding: 0px ", ";\n\t\t\tline-height: 1.5rem;\n\t\t\ttext-align: right;\n\t\t\tcolor: ", ";\n\t\t\tbox-sizing: content-box;\n\t\t}\n\t}\n"])), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPED, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-space-100, 8px)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, #FFFFFF)", "var(--ds-border-radius, 3px)", _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorCodeFontFamily, _editorSharedStyles.akEditorTableCellMinWidth, CodeBlockSharedCssClassName.CODEBLOCK_START, CodeBlockSharedCssClassName.CODEBLOCK_END, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "var(--ds-background-neutral, #091E420F)", "var(--ds-border-radius, 3px)", (0, _editorSharedStyles.overflowShadow)({
28
27
  leftCoverWidth: "var(--ds-space-300, 24px)"
29
28
  }), "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-neutral, #091E420F)", "var(--ds-space-100, 8px)", (0, _editorSharedStyles.relativeFontSizeToBase16)(14), CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, (0, _editorSharedStyles.relativeFontSizeToBase16)(14), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-text, #172B4D)", "var(--ds-border-radius, 3px)", "var(--ds-space-100, 8px)", (0, _editorSharedStyles.relativeFontSizeToBase16)(14), CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER_LINE_NUMBER_WIDGET, (0, _editorSharedStyles.relativeFontSizeToBase16)(14), "var(--ds-space-100, 8px)", "var(--ds-text-subtlest, #505F79)");
30
29
  };
31
30
 
32
31
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
33
- var codeBlockInListSafariFix = exports.codeBlockInListSafariFix = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n\t::before {\n\t\tcontent: ' ';\n\t\tline-height: ", ";\n\t}\n\n\t> p:first-child,\n\t> .code-block:first-child,\n\t> .ProseMirror-gapcursor:first-child + .code-block {\n\t\tmargin-top: -", "em !important;\n\t}\n"])), _editorSharedStyles.akEditorLineHeight, _editorSharedStyles.akEditorLineHeight);
32
+ var codeBlockInListSafariFix = exports.codeBlockInListSafariFix = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t::before {\n\t\tcontent: ' ';\n\t\tline-height: ", ";\n\t}\n\n\t> p:first-child,\n\t> .code-block:first-child,\n\t> .ProseMirror-gapcursor:first-child + .code-block {\n\t\tmargin-top: -", "em !important;\n\t}\n"])), _editorSharedStyles.akEditorLineHeight, _editorSharedStyles.akEditorLineHeight);
@@ -9,12 +9,7 @@ var _editorUgcTokenNames = require("./editor-ugc-token-names");
9
9
  function editorUGCToken(path) {
10
10
  var tokens;
11
11
  if ((0, _platformFeatureFlags.fg)('platform_editor_typography_ugc')) {
12
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
13
- if ((0, _platformFeatureFlags.fg)('platform-dst-jira-web-fonts') || (0, _platformFeatureFlags.fg)('confluence_typography_refreshed') || (0, _platformFeatureFlags.fg)('atlas_editor_typography_refreshed')) {
14
- tokens = _editorUgcTokenNames.editorUGCTokensRefreshed;
15
- } else {
16
- tokens = _editorUgcTokenNames.editorUGCTokensModernized;
17
- }
12
+ tokens = _editorUgcTokenNames.editorUGCTokensRefreshed;
18
13
  } else {
19
14
  tokens = _editorUgcTokenNames.editorUGCTokens;
20
15
  }
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "107.2.1";
26
+ var packageVersion = "107.2.3";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -12,6 +12,7 @@ exports.getAnnotationMarksForPos = getAnnotationMarksForPos;
12
12
  exports.getRangeInlineNodeNames = getRangeInlineNodeNames;
13
13
  exports.hasAnnotationMark = hasAnnotationMark;
14
14
  exports.isEmptyTextSelection = isEmptyTextSelection;
15
+ exports.isEmptyTextSelectionRenderer = isEmptyTextSelectionRenderer;
15
16
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
16
17
  var _adfSchema = require("@atlaskit/adf-schema");
17
18
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
@@ -191,4 +192,38 @@ function isEmptyTextSelection(selection, schema) {
191
192
  return !hasContent;
192
193
  });
193
194
  return !hasContent;
195
+ }
196
+
197
+ /**
198
+ * This is a modified version of the `isEmptyTextSelection` function (above), fixing some unexpected behavior in the renderer.
199
+ *
200
+ * This function does NOT consider non-inline nodes as non-empty.
201
+ * With this change, the function continues descending into block nodes, like tables or expands. Without this change for
202
+ * the renderer, block nodes containing empty text were not considered empty.
203
+ */
204
+ function isEmptyTextSelectionRenderer(selection, schema) {
205
+ var _schema$nodes2 = schema.nodes,
206
+ text = _schema$nodes2.text,
207
+ paragraph = _schema$nodes2.paragraph;
208
+ var hasContent = false;
209
+ selection.content().content.descendants(function (node) {
210
+ // for empty paragraph - consider empty (nothing to comment on)
211
+ if (node.type === paragraph && !node.content.size) {
212
+ return false;
213
+ }
214
+
215
+ // for inline elements - consider nonempty
216
+ if (node.type !== text && node.type.isInline) {
217
+ hasContent = true;
218
+ }
219
+
220
+ // for nonempty text - consider nonempty (can comment if the node is supported for annotations)
221
+ if (node.type === text && !!node.textContent) {
222
+ hasContent = true;
223
+ }
224
+
225
+ // for other non-text nodes - continue descending
226
+ return !hasContent;
227
+ });
228
+ return !hasContent;
194
229
  }
@@ -686,6 +686,12 @@ Object.defineProperty(exports, "isEmptyTextSelection", {
686
686
  return _annotation.isEmptyTextSelection;
687
687
  }
688
688
  });
689
+ Object.defineProperty(exports, "isEmptyTextSelectionRenderer", {
690
+ enumerable: true,
691
+ get: function get() {
692
+ return _annotation.isEmptyTextSelectionRenderer;
693
+ }
694
+ });
689
695
  Object.defineProperty(exports, "isFromCurrentDomain", {
690
696
  enumerable: true,
691
697
  get: function get() {
@@ -86,6 +86,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
86
86
  ACTION["MEDIA_LINK_TRANSFORMED"] = "mediaLinkTransformed";
87
87
  ACTION["NODE_CONTENT_SANITIZED"] = "nodeContentSanitized";
88
88
  ACTION["OFFLINE_STORAGE_TOO_MANY_RETRIES_ERROR"] = "offlineStorageTooManyRetriesError";
89
+ ACTION["OFFLINE_STORAGE_FAILED_STEPS"] = "offlineStorageFailedSteps";
89
90
  ACTION["OFFLINE_STORAGE_STEPS_DATABASE_ERROR"] = "offlineStorageStepsDatabaseError";
90
91
  ACTION["OFFLINE_STORAGE_RESYNC_ONLINE"] = "offlineStorageResyncOnline";
91
92
  ACTION["OFFLINE_STORAGE_BROADCAST_CHANNEL_FIRST_UPDATE"] = "offlineStorageBroadcastChannelFirstUpdate";
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "107.2.1";
4
+ const packageVersion = "107.2.3";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007
@@ -2,7 +2,6 @@
2
2
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
3
  import { css } from '@emotion/react';
4
4
  import { akEditorCodeFontFamily, akEditorLineHeight, akEditorTableCellMinWidth, blockNodesVerticalMargin, overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
5
- import { fg } from '@atlaskit/platform-feature-flags';
6
5
  export const CodeBlockSharedCssClassName = {
7
6
  CODEBLOCK_CONTAINER: 'code-block',
8
7
  CODEBLOCK_START: 'code-block--start',
@@ -49,10 +48,6 @@ export const codeBlockSharedStyles = () => css`
49
48
  cursor: pointer;
50
49
  clear: both;
51
50
 
52
- ${fg('platform_editor_fix_code_block_bg_color_in_macro') ? css`` : css`
53
- --ds--code--bg-color: transparent;
54
- `}
55
-
56
51
  .code-block-gutter-pseudo-element::before {
57
52
  content: attr(data-label);
58
53
  }
@@ -1,14 +1,9 @@
1
1
  import { fg } from '@atlaskit/platform-feature-flags';
2
- import { editorUGCTokens, editorUGCTokensModernized, editorUGCTokensRefreshed } from './editor-ugc-token-names';
2
+ import { editorUGCTokens, editorUGCTokensRefreshed } from './editor-ugc-token-names';
3
3
  function editorUGCToken(path) {
4
4
  let tokens;
5
5
  if (fg('platform_editor_typography_ugc')) {
6
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
7
- if (fg('platform-dst-jira-web-fonts') || fg('confluence_typography_refreshed') || fg('atlas_editor_typography_refreshed')) {
8
- tokens = editorUGCTokensRefreshed;
9
- } else {
10
- tokens = editorUGCTokensModernized;
11
- }
6
+ tokens = editorUGCTokensRefreshed;
12
7
  } else {
13
8
  tokens = editorUGCTokens;
14
9
  }
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "107.2.1";
16
+ const packageVersion = "107.2.3";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -186,4 +186,39 @@ export function isEmptyTextSelection(selection, schema) {
186
186
  return !hasContent;
187
187
  });
188
188
  return !hasContent;
189
+ }
190
+
191
+ /**
192
+ * This is a modified version of the `isEmptyTextSelection` function (above), fixing some unexpected behavior in the renderer.
193
+ *
194
+ * This function does NOT consider non-inline nodes as non-empty.
195
+ * With this change, the function continues descending into block nodes, like tables or expands. Without this change for
196
+ * the renderer, block nodes containing empty text were not considered empty.
197
+ */
198
+ export function isEmptyTextSelectionRenderer(selection, schema) {
199
+ const {
200
+ text,
201
+ paragraph
202
+ } = schema.nodes;
203
+ let hasContent = false;
204
+ selection.content().content.descendants(node => {
205
+ // for empty paragraph - consider empty (nothing to comment on)
206
+ if (node.type === paragraph && !node.content.size) {
207
+ return false;
208
+ }
209
+
210
+ // for inline elements - consider nonempty
211
+ if (node.type !== text && node.type.isInline) {
212
+ hasContent = true;
213
+ }
214
+
215
+ // for nonempty text - consider nonempty (can comment if the node is supported for annotations)
216
+ if (node.type === text && !!node.textContent) {
217
+ hasContent = true;
218
+ }
219
+
220
+ // for other non-text nodes - continue descending
221
+ return !hasContent;
222
+ });
223
+ return !hasContent;
189
224
  }
@@ -5,7 +5,7 @@ import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
5
5
  import { hasDocAsParent } from './document';
6
6
  import { isEmptyParagraph } from './editor-core-utils';
7
7
  export { shouldAutoLinkifyMatch } from './should-auto-linkify-tld';
8
- export { getAnnotationMarksForPos, canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, getAnnotationInlineNodeTypes, hasAnnotationMark, getRangeInlineNodeNames, isEmptyTextSelection } from './annotation';
8
+ export { getAnnotationMarksForPos, canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, getAnnotationInlineNodeTypes, hasAnnotationMark, getRangeInlineNodeNames, isEmptyTextSelection, isEmptyTextSelectionRenderer } from './annotation';
9
9
  export { getExtensionLozengeData } from './macro';
10
10
  export {
11
11
  /**
@@ -86,6 +86,7 @@ export var ACTION = /*#__PURE__*/function (ACTION) {
86
86
  ACTION["MEDIA_LINK_TRANSFORMED"] = "mediaLinkTransformed";
87
87
  ACTION["NODE_CONTENT_SANITIZED"] = "nodeContentSanitized";
88
88
  ACTION["OFFLINE_STORAGE_TOO_MANY_RETRIES_ERROR"] = "offlineStorageTooManyRetriesError";
89
+ ACTION["OFFLINE_STORAGE_FAILED_STEPS"] = "offlineStorageFailedSteps";
89
90
  ACTION["OFFLINE_STORAGE_STEPS_DATABASE_ERROR"] = "offlineStorageStepsDatabaseError";
90
91
  ACTION["OFFLINE_STORAGE_RESYNC_ONLINE"] = "offlineStorageResyncOnline";
91
92
  ACTION["OFFLINE_STORAGE_BROADCAST_CHANNEL_FIRST_UPDATE"] = "offlineStorageBroadcastChannelFirstUpdate";
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "107.2.1";
10
+ var packageVersion = "107.2.3";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -1,10 +1,9 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
2
+ var _templateObject, _templateObject2;
3
3
  /* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression -- Should be safe to autofix, but ignoring for now */
4
4
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
5
5
  import { css } from '@emotion/react';
6
6
  import { akEditorCodeFontFamily, akEditorLineHeight, akEditorTableCellMinWidth, blockNodesVerticalMargin, overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
7
- import { fg } from '@atlaskit/platform-feature-flags';
8
7
  export var CodeBlockSharedCssClassName = {
9
8
  CODEBLOCK_CONTAINER: 'code-block',
10
9
  CODEBLOCK_START: 'code-block--start',
@@ -17,10 +16,10 @@ export var CodeBlockSharedCssClassName = {
17
16
  CODEBLOCK_CONTAINER_LINE_NUMBER_WIDGET: 'code-content__line-number--wrapped'
18
17
  };
19
18
  export var codeBlockSharedStyles = function codeBlockSharedStyles() {
20
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t.", "\n\t\t> .", "\n\t\t> .", " {\n\t\tmargin-right: ", ";\n\n\t\tcode {\n\t\t\tdisplay: block;\n\t\t\tword-break: break-word;\n\t\t\twhite-space: pre-wrap;\n\t\t}\n\t}\n\n\t.", "\n\t\t> .", " {\n\t\tdisplay: flex;\n\t\tflex: 1;\n\n\t\tcode {\n\t\t\tflex-grow: 1;\n\n\t\t\twhite-space: pre;\n\t\t}\n\t}\n\n\t.", " {\n\t\tposition: relative;\n\t\tbackground-color: ", ";\n\t\tborder-radius: ", ";\n\t\tmargin: ", " 0 0 0;\n\t\tfont-family: ", ";\n\t\tmin-width: ", "px;\n\t\tcursor: pointer;\n\t\tclear: both;\n\n\t\t", "\n\n\t\t.code-block-gutter-pseudo-element::before {\n\t\t\tcontent: attr(data-label);\n\t\t}\n\n\t\t/* This is necessary to allow for arrow key navigation in/out of code blocks in Firefox. */\n\t\twhite-space: normal;\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\ttop: 0px;\n\t\t\tleft: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\tbottom: 0px;\n\t\t\tright: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tposition: relative;\n\t\t\tbackground-color: ", ";\n\t\t\tdisplay: flex;\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 100%;\n\t\t\tcounter-reset: line;\n\t\t\toverflow-x: auto;\n\n\t\t\tbackground-image: ", ";\n\n\t\t\tbackground-repeat: no-repeat;\n\t\t\tbackground-attachment: local, local, local, local, scroll, scroll, scroll, scroll;\n\t\t\tbackground-size:\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%;\n\t\t\tbackground-position:\n\t\t\t\t0 0,\n\t\t\t\t0 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t0 0,\n\t\t\t\t0 0;\n\n\t\t\t/* Be careful if refactoring this; it is needed to keep arrow key navigation in Firefox consistent with other browsers. */\n\t\t\toverflow-y: hidden;\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tposition: relative;\n\t\t\twidth: var(--lineNumberGutterWidth, 2rem);\n\t\t\tpadding: ", ";\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: ", ";\n\t\t\tbox-sizing: content-box;\n\t\t}\n\n\t\t/* This is a fix of marker of list item with code block.\n\t\t The list item marker in Chrome is aligned by the baseline of the text,\n\t\t that's why we need to add a text (content: \"1\") to the line number gutter to align\n\t\t the list item marker with the text.\n\t\t Without it, the list item marker will be aligned by the bottom of the code block. */\n\t\t.", "::before {\n\t\t\tcontent: '1';\n\t\t\tvisibility: hidden;\n\t\t\tfont-size: ", ";\n\t\t\tline-height: 1.5rem;\n\t\t}\n\n\t\t.", " {\n\t\t\tcode {\n\t\t\t\ttab-size: 4;\n\t\t\t\tcursor: text;\n\t\t\t\tcolor: ", ";\n\t\t\t\tborder-radius: ", ";\n\t\t\t\tmargin: ", ";\n\t\t\t\tfont-size: ", ";\n\t\t\t\tline-height: 1.5rem;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tpointer-events: none;\n\t\t\tuser-select: none;\n\t\t\twidth: var(--lineNumberGutterWidth, 2rem);\n\t\t\tleft: 0;\n\t\t\tposition: absolute;\n\t\t\tfont-size: ", ";\n\t\t\tpadding: 0px ", ";\n\t\t\tline-height: 1.5rem;\n\t\t\ttext-align: right;\n\t\t\tcolor: ", ";\n\t\t\tbox-sizing: content-box;\n\t\t}\n\t}\n"])), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPED, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-space-100, 8px)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, #FFFFFF)", "var(--ds-border-radius, 3px)", blockNodesVerticalMargin, akEditorCodeFontFamily, akEditorTableCellMinWidth, fg('platform_editor_fix_code_block_bg_color_in_macro') ? css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral([""]))) : css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t\t\t\t\t--ds--code--bg-color: transparent;\n\t\t\t\t"]))), CodeBlockSharedCssClassName.CODEBLOCK_START, CodeBlockSharedCssClassName.CODEBLOCK_END, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "var(--ds-background-neutral, #091E420F)", "var(--ds-border-radius, 3px)", overflowShadow({
19
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t.", "\n\t\t> .", "\n\t\t> .", " {\n\t\tmargin-right: ", ";\n\n\t\tcode {\n\t\t\tdisplay: block;\n\t\t\tword-break: break-word;\n\t\t\twhite-space: pre-wrap;\n\t\t}\n\t}\n\n\t.", "\n\t\t> .", " {\n\t\tdisplay: flex;\n\t\tflex: 1;\n\n\t\tcode {\n\t\t\tflex-grow: 1;\n\n\t\t\twhite-space: pre;\n\t\t}\n\t}\n\n\t.", " {\n\t\tposition: relative;\n\t\tbackground-color: ", ";\n\t\tborder-radius: ", ";\n\t\tmargin: ", " 0 0 0;\n\t\tfont-family: ", ";\n\t\tmin-width: ", "px;\n\t\tcursor: pointer;\n\t\tclear: both;\n\n\t\t.code-block-gutter-pseudo-element::before {\n\t\t\tcontent: attr(data-label);\n\t\t}\n\n\t\t/* This is necessary to allow for arrow key navigation in/out of code blocks in Firefox. */\n\t\twhite-space: normal;\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\ttop: 0px;\n\t\t\tleft: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\tbottom: 0px;\n\t\t\tright: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tposition: relative;\n\t\t\tbackground-color: ", ";\n\t\t\tdisplay: flex;\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 100%;\n\t\t\tcounter-reset: line;\n\t\t\toverflow-x: auto;\n\n\t\t\tbackground-image: ", ";\n\n\t\t\tbackground-repeat: no-repeat;\n\t\t\tbackground-attachment: local, local, local, local, scroll, scroll, scroll, scroll;\n\t\t\tbackground-size:\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%;\n\t\t\tbackground-position:\n\t\t\t\t0 0,\n\t\t\t\t0 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t0 0,\n\t\t\t\t0 0;\n\n\t\t\t/* Be careful if refactoring this; it is needed to keep arrow key navigation in Firefox consistent with other browsers. */\n\t\t\toverflow-y: hidden;\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tposition: relative;\n\t\t\twidth: var(--lineNumberGutterWidth, 2rem);\n\t\t\tpadding: ", ";\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: ", ";\n\t\t\tbox-sizing: content-box;\n\t\t}\n\n\t\t/* This is a fix of marker of list item with code block.\n\t\t The list item marker in Chrome is aligned by the baseline of the text,\n\t\t that's why we need to add a text (content: \"1\") to the line number gutter to align\n\t\t the list item marker with the text.\n\t\t Without it, the list item marker will be aligned by the bottom of the code block. */\n\t\t.", "::before {\n\t\t\tcontent: '1';\n\t\t\tvisibility: hidden;\n\t\t\tfont-size: ", ";\n\t\t\tline-height: 1.5rem;\n\t\t}\n\n\t\t.", " {\n\t\t\tcode {\n\t\t\t\ttab-size: 4;\n\t\t\t\tcursor: text;\n\t\t\t\tcolor: ", ";\n\t\t\t\tborder-radius: ", ";\n\t\t\t\tmargin: ", ";\n\t\t\t\tfont-size: ", ";\n\t\t\t\tline-height: 1.5rem;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tpointer-events: none;\n\t\t\tuser-select: none;\n\t\t\twidth: var(--lineNumberGutterWidth, 2rem);\n\t\t\tleft: 0;\n\t\t\tposition: absolute;\n\t\t\tfont-size: ", ";\n\t\t\tpadding: 0px ", ";\n\t\t\tline-height: 1.5rem;\n\t\t\ttext-align: right;\n\t\t\tcolor: ", ";\n\t\t\tbox-sizing: content-box;\n\t\t}\n\t}\n"])), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPED, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-space-100, 8px)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, #FFFFFF)", "var(--ds-border-radius, 3px)", blockNodesVerticalMargin, akEditorCodeFontFamily, akEditorTableCellMinWidth, CodeBlockSharedCssClassName.CODEBLOCK_START, CodeBlockSharedCssClassName.CODEBLOCK_END, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "var(--ds-background-neutral, #091E420F)", "var(--ds-border-radius, 3px)", overflowShadow({
21
20
  leftCoverWidth: "var(--ds-space-300, 24px)"
22
21
  }), "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-neutral, #091E420F)", "var(--ds-space-100, 8px)", relativeFontSizeToBase16(14), CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, relativeFontSizeToBase16(14), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-text, #172B4D)", "var(--ds-border-radius, 3px)", "var(--ds-space-100, 8px)", relativeFontSizeToBase16(14), CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER_LINE_NUMBER_WIDGET, relativeFontSizeToBase16(14), "var(--ds-space-100, 8px)", "var(--ds-text-subtlest, #505F79)");
23
22
  };
24
23
 
25
24
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
26
- export var codeBlockInListSafariFix = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n\t::before {\n\t\tcontent: ' ';\n\t\tline-height: ", ";\n\t}\n\n\t> p:first-child,\n\t> .code-block:first-child,\n\t> .ProseMirror-gapcursor:first-child + .code-block {\n\t\tmargin-top: -", "em !important;\n\t}\n"])), akEditorLineHeight, akEditorLineHeight);
25
+ export var codeBlockInListSafariFix = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t::before {\n\t\tcontent: ' ';\n\t\tline-height: ", ";\n\t}\n\n\t> p:first-child,\n\t> .code-block:first-child,\n\t> .ProseMirror-gapcursor:first-child + .code-block {\n\t\tmargin-top: -", "em !important;\n\t}\n"])), akEditorLineHeight, akEditorLineHeight);
@@ -1,14 +1,9 @@
1
1
  import { fg } from '@atlaskit/platform-feature-flags';
2
- import { editorUGCTokens, editorUGCTokensModernized, editorUGCTokensRefreshed } from './editor-ugc-token-names';
2
+ import { editorUGCTokens, editorUGCTokensRefreshed } from './editor-ugc-token-names';
3
3
  function editorUGCToken(path) {
4
4
  var tokens;
5
5
  if (fg('platform_editor_typography_ugc')) {
6
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
7
- if (fg('platform-dst-jira-web-fonts') || fg('confluence_typography_refreshed') || fg('atlas_editor_typography_refreshed')) {
8
- tokens = editorUGCTokensRefreshed;
9
- } else {
10
- tokens = editorUGCTokensModernized;
11
- }
6
+ tokens = editorUGCTokensRefreshed;
12
7
  } else {
13
8
  tokens = editorUGCTokens;
14
9
  }
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "107.2.1";
23
+ var packageVersion = "107.2.3";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -177,4 +177,38 @@ export function isEmptyTextSelection(selection, schema) {
177
177
  return !hasContent;
178
178
  });
179
179
  return !hasContent;
180
+ }
181
+
182
+ /**
183
+ * This is a modified version of the `isEmptyTextSelection` function (above), fixing some unexpected behavior in the renderer.
184
+ *
185
+ * This function does NOT consider non-inline nodes as non-empty.
186
+ * With this change, the function continues descending into block nodes, like tables or expands. Without this change for
187
+ * the renderer, block nodes containing empty text were not considered empty.
188
+ */
189
+ export function isEmptyTextSelectionRenderer(selection, schema) {
190
+ var _schema$nodes2 = schema.nodes,
191
+ text = _schema$nodes2.text,
192
+ paragraph = _schema$nodes2.paragraph;
193
+ var hasContent = false;
194
+ selection.content().content.descendants(function (node) {
195
+ // for empty paragraph - consider empty (nothing to comment on)
196
+ if (node.type === paragraph && !node.content.size) {
197
+ return false;
198
+ }
199
+
200
+ // for inline elements - consider nonempty
201
+ if (node.type !== text && node.type.isInline) {
202
+ hasContent = true;
203
+ }
204
+
205
+ // for nonempty text - consider nonempty (can comment if the node is supported for annotations)
206
+ if (node.type === text && !!node.textContent) {
207
+ hasContent = true;
208
+ }
209
+
210
+ // for other non-text nodes - continue descending
211
+ return !hasContent;
212
+ });
213
+ return !hasContent;
180
214
  }
@@ -5,7 +5,7 @@ import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
5
5
  import { hasDocAsParent } from './document';
6
6
  import { isEmptyParagraph } from './editor-core-utils';
7
7
  export { shouldAutoLinkifyMatch } from './should-auto-linkify-tld';
8
- export { getAnnotationMarksForPos, canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, getAnnotationInlineNodeTypes, hasAnnotationMark, getRangeInlineNodeNames, isEmptyTextSelection } from './annotation';
8
+ export { getAnnotationMarksForPos, canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, getAnnotationInlineNodeTypes, hasAnnotationMark, getRangeInlineNodeNames, isEmptyTextSelection, isEmptyTextSelectionRenderer } from './annotation';
9
9
  export { getExtensionLozengeData } from './macro';
10
10
  export {
11
11
  /**
@@ -85,6 +85,7 @@ export declare enum ACTION {
85
85
  MEDIA_LINK_TRANSFORMED = "mediaLinkTransformed",
86
86
  NODE_CONTENT_SANITIZED = "nodeContentSanitized",
87
87
  OFFLINE_STORAGE_TOO_MANY_RETRIES_ERROR = "offlineStorageTooManyRetriesError",
88
+ OFFLINE_STORAGE_FAILED_STEPS = "offlineStorageFailedSteps",
88
89
  OFFLINE_STORAGE_STEPS_DATABASE_ERROR = "offlineStorageStepsDatabaseError",
89
90
  OFFLINE_STORAGE_RESYNC_ONLINE = "offlineStorageResyncOnline",
90
91
  OFFLINE_STORAGE_BROADCAST_CHANNEL_FIRST_UPDATE = "offlineStorageBroadcastChannelFirstUpdate",
@@ -1,6 +1,6 @@
1
1
  import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID } from './enums';
2
2
  import type { TrackAEP } from './utils';
3
- type OfflineEditingAEP = TrackAEP<ACTION.OFFLINE_STORAGE_TOO_MANY_RETRIES_ERROR | ACTION.OFFLINE_STORAGE_STEPS_DATABASE_ERROR | ACTION.OFFLINE_STORAGE_RESYNC_ONLINE | ACTION.OFFLINE_STORAGE_BROADCAST_CHANNEL_FIRST_UPDATE, ACTION_SUBJECT.OFFLINE_EDITING, ACTION_SUBJECT_ID.OFFLINE_EDITING, {
3
+ type OfflineEditingAEP = TrackAEP<ACTION.OFFLINE_STORAGE_TOO_MANY_RETRIES_ERROR | ACTION.OFFLINE_STORAGE_STEPS_DATABASE_ERROR | ACTION.OFFLINE_STORAGE_RESYNC_ONLINE | ACTION.OFFLINE_STORAGE_BROADCAST_CHANNEL_FIRST_UPDATE | ACTION.OFFLINE_STORAGE_FAILED_STEPS, ACTION_SUBJECT.OFFLINE_EDITING, ACTION_SUBJECT_ID.OFFLINE_EDITING, {
4
4
  errorMessage?: string;
5
5
  version?: number;
6
6
  stepsCount?: number;
@@ -36,4 +36,12 @@ export declare function getAnnotationMarksForPos(pos: ResolvedPos): Mark[] | und
36
36
  * e.g. when you select across multiple empty paragraphs
37
37
  */
38
38
  export declare function isEmptyTextSelection(selection: TextSelection | AllSelection, schema: Schema): boolean;
39
+ /**
40
+ * This is a modified version of the `isEmptyTextSelection` function (above), fixing some unexpected behavior in the renderer.
41
+ *
42
+ * This function does NOT consider non-inline nodes as non-empty.
43
+ * With this change, the function continues descending into block nodes, like tables or expands. Without this change for
44
+ * the renderer, block nodes containing empty text were not considered empty.
45
+ */
46
+ export declare function isEmptyTextSelectionRenderer(selection: TextSelection | AllSelection, schema: Schema): boolean;
39
47
  export {};
@@ -2,7 +2,7 @@ import type { Node as PMNode, ResolvedPos, Schema } from '@atlaskit/editor-prose
2
2
  import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
4
4
  export { shouldAutoLinkifyMatch } from './should-auto-linkify-tld';
5
- export { getAnnotationMarksForPos, canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, getAnnotationInlineNodeTypes, hasAnnotationMark, getRangeInlineNodeNames, isEmptyTextSelection, } from './annotation';
5
+ export { getAnnotationMarksForPos, canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, getAnnotationInlineNodeTypes, hasAnnotationMark, getRangeInlineNodeNames, isEmptyTextSelection, isEmptyTextSelectionRenderer, } from './annotation';
6
6
  export { getExtensionLozengeData } from './macro';
7
7
  export type { Params } from './macro';
8
8
  export {
@@ -85,6 +85,7 @@ export declare enum ACTION {
85
85
  MEDIA_LINK_TRANSFORMED = "mediaLinkTransformed",
86
86
  NODE_CONTENT_SANITIZED = "nodeContentSanitized",
87
87
  OFFLINE_STORAGE_TOO_MANY_RETRIES_ERROR = "offlineStorageTooManyRetriesError",
88
+ OFFLINE_STORAGE_FAILED_STEPS = "offlineStorageFailedSteps",
88
89
  OFFLINE_STORAGE_STEPS_DATABASE_ERROR = "offlineStorageStepsDatabaseError",
89
90
  OFFLINE_STORAGE_RESYNC_ONLINE = "offlineStorageResyncOnline",
90
91
  OFFLINE_STORAGE_BROADCAST_CHANNEL_FIRST_UPDATE = "offlineStorageBroadcastChannelFirstUpdate",
@@ -1,6 +1,6 @@
1
1
  import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID } from './enums';
2
2
  import type { TrackAEP } from './utils';
3
- type OfflineEditingAEP = TrackAEP<ACTION.OFFLINE_STORAGE_TOO_MANY_RETRIES_ERROR | ACTION.OFFLINE_STORAGE_STEPS_DATABASE_ERROR | ACTION.OFFLINE_STORAGE_RESYNC_ONLINE | ACTION.OFFLINE_STORAGE_BROADCAST_CHANNEL_FIRST_UPDATE, ACTION_SUBJECT.OFFLINE_EDITING, ACTION_SUBJECT_ID.OFFLINE_EDITING, {
3
+ type OfflineEditingAEP = TrackAEP<ACTION.OFFLINE_STORAGE_TOO_MANY_RETRIES_ERROR | ACTION.OFFLINE_STORAGE_STEPS_DATABASE_ERROR | ACTION.OFFLINE_STORAGE_RESYNC_ONLINE | ACTION.OFFLINE_STORAGE_BROADCAST_CHANNEL_FIRST_UPDATE | ACTION.OFFLINE_STORAGE_FAILED_STEPS, ACTION_SUBJECT.OFFLINE_EDITING, ACTION_SUBJECT_ID.OFFLINE_EDITING, {
4
4
  errorMessage?: string;
5
5
  version?: number;
6
6
  stepsCount?: number;
@@ -36,4 +36,12 @@ export declare function getAnnotationMarksForPos(pos: ResolvedPos): Mark[] | und
36
36
  * e.g. when you select across multiple empty paragraphs
37
37
  */
38
38
  export declare function isEmptyTextSelection(selection: TextSelection | AllSelection, schema: Schema): boolean;
39
+ /**
40
+ * This is a modified version of the `isEmptyTextSelection` function (above), fixing some unexpected behavior in the renderer.
41
+ *
42
+ * This function does NOT consider non-inline nodes as non-empty.
43
+ * With this change, the function continues descending into block nodes, like tables or expands. Without this change for
44
+ * the renderer, block nodes containing empty text were not considered empty.
45
+ */
46
+ export declare function isEmptyTextSelectionRenderer(selection: TextSelection | AllSelection, schema: Schema): boolean;
39
47
  export {};
@@ -2,7 +2,7 @@ import type { Node as PMNode, ResolvedPos, Schema } from '@atlaskit/editor-prose
2
2
  import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
4
4
  export { shouldAutoLinkifyMatch } from './should-auto-linkify-tld';
5
- export { getAnnotationMarksForPos, canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, getAnnotationInlineNodeTypes, hasAnnotationMark, getRangeInlineNodeNames, isEmptyTextSelection, } from './annotation';
5
+ export { getAnnotationMarksForPos, canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, getAnnotationInlineNodeTypes, hasAnnotationMark, getRangeInlineNodeNames, isEmptyTextSelection, isEmptyTextSelectionRenderer, } from './annotation';
6
6
  export { getExtensionLozengeData } from './macro';
7
7
  export type { Params } from './macro';
8
8
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "107.2.2",
3
+ "version": "107.2.4",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -152,7 +152,7 @@
152
152
  "@atlaskit/media-common": "^12.2.0",
153
153
  "@atlaskit/media-file-preview": "^0.11.0",
154
154
  "@atlaskit/media-picker": "^70.0.0",
155
- "@atlaskit/media-ui": "^28.4.0",
155
+ "@atlaskit/media-ui": "^28.5.0",
156
156
  "@atlaskit/media-viewer": "^52.3.0",
157
157
  "@atlaskit/mention": "^24.2.0",
158
158
  "@atlaskit/menu": "^8.0.0",
@@ -164,13 +164,13 @@
164
164
  "@atlaskit/profilecard": "^23.21.0",
165
165
  "@atlaskit/react-ufo": "^3.14.0",
166
166
  "@atlaskit/section-message": "^8.2.0",
167
- "@atlaskit/smart-card": "^38.14.0",
167
+ "@atlaskit/smart-card": "^38.16.0",
168
168
  "@atlaskit/smart-user-picker": "^8.0.0",
169
169
  "@atlaskit/spinner": "^18.0.0",
170
170
  "@atlaskit/task-decision": "^19.2.0",
171
171
  "@atlaskit/textfield": "^8.0.0",
172
172
  "@atlaskit/theme": "^18.0.0",
173
- "@atlaskit/tmp-editor-statsig": "^8.2.0",
173
+ "@atlaskit/tmp-editor-statsig": "^8.3.0",
174
174
  "@atlaskit/tokens": "^5.4.0",
175
175
  "@atlaskit/tooltip": "^20.3.0",
176
176
  "@atlaskit/width-detector": "^5.0.0",
@@ -308,9 +308,6 @@
308
308
  "platform-dst-jira-web-fonts": {
309
309
  "type": "boolean"
310
310
  },
311
- "confluence_typography_refreshed": {
312
- "type": "boolean"
313
- },
314
311
  "atlas_editor_typography_refreshed": {
315
312
  "type": "boolean"
316
313
  },
@@ -344,9 +341,6 @@
344
341
  "platform_editor_bordered_panel_nested_in_table": {
345
342
  "type": "boolean"
346
343
  },
347
- "platform_editor_fix_code_block_bg_color_in_macro": {
348
- "type": "boolean"
349
- },
350
344
  "confluence_preload_extension_providers": {
351
345
  "type": "boolean"
352
346
  },