@atlaskit/editor-common 88.8.0 → 88.8.2

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 (35) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cjs/code-block/index.js +34 -4
  3. package/dist/cjs/core-utils/index.js +8 -1
  4. package/dist/cjs/core-utils/is-ssr.js +20 -0
  5. package/dist/cjs/monitoring/error.js +1 -1
  6. package/dist/cjs/styles/shared/table.js +2 -2
  7. package/dist/cjs/ui/DropList/index.js +1 -1
  8. package/dist/cjs/ui/WidthProvider/index.js +2 -2
  9. package/dist/cjs/ui/WidthProvider/isSsrButNoBreakoutScriptObserved.js +2 -2
  10. package/dist/es2019/code-block/index.js +33 -3
  11. package/dist/es2019/core-utils/index.js +2 -1
  12. package/dist/es2019/core-utils/is-ssr.js +14 -0
  13. package/dist/es2019/monitoring/error.js +1 -1
  14. package/dist/es2019/styles/shared/table.js +2 -2
  15. package/dist/es2019/ui/DropList/index.js +1 -1
  16. package/dist/es2019/ui/WidthProvider/index.js +1 -1
  17. package/dist/es2019/ui/WidthProvider/isSsrButNoBreakoutScriptObserved.js +1 -1
  18. package/dist/esm/code-block/index.js +33 -3
  19. package/dist/esm/core-utils/index.js +2 -1
  20. package/dist/esm/core-utils/is-ssr.js +14 -0
  21. package/dist/esm/monitoring/error.js +1 -1
  22. package/dist/esm/styles/shared/table.js +2 -2
  23. package/dist/esm/ui/DropList/index.js +1 -1
  24. package/dist/esm/ui/WidthProvider/index.js +1 -1
  25. package/dist/esm/ui/WidthProvider/isSsrButNoBreakoutScriptObserved.js +1 -1
  26. package/dist/types/code-block/index.d.ts +10 -2
  27. package/dist/types/core-utils/index.d.ts +1 -0
  28. package/dist/types-ts4.5/code-block/index.d.ts +10 -2
  29. package/dist/types-ts4.5/core-utils/index.d.ts +1 -0
  30. package/package.json +7 -7
  31. package/dist/cjs/ui/WidthProvider/isSSR.js +0 -15
  32. package/dist/es2019/ui/WidthProvider/isSSR.js +0 -9
  33. package/dist/esm/ui/WidthProvider/isSSR.js +0 -9
  34. /package/dist/types/{ui/WidthProvider/isSSR.d.ts → core-utils/is-ssr.d.ts} +0 -0
  35. /package/dist/types-ts4.5/{ui/WidthProvider/isSSR.d.ts → core-utils/is-ssr.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 88.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#137244](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/137244)
8
+ [`e6f32d1f22896`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e6f32d1f22896) -
9
+ Control show or hide editor toolbar in SSR environment
10
+ - [#136871](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136871)
11
+ [`87a30d5cb3ffb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/87a30d5cb3ffb) -
12
+ ED-24814 - Addressing a bug where changing the language on a wrapped code block caused the wrapped
13
+ decorator to disappear. Required changing the sequence in which we update the keys on the wrapped
14
+ states WeakMap. Due to the amount of changes, it has all be placed behind a bug fix feature gate
15
+ (editor_code_block_wrapping_language_change_bug) and the original feature gate
16
+ (editor_support_code_block_wrapping).
17
+ - Updated dependencies
18
+
19
+ ## 88.8.1
20
+
21
+ ### Patch Changes
22
+
23
+ - [#136410](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136410)
24
+ [`52083ca79b5dc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/52083ca79b5dc) -
25
+ [ux] ED-24603 Disable dragging nested nodes within table behind FF
26
+
3
27
  ## 88.8.0
4
28
 
5
29
  ### Minor Changes
@@ -3,8 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.transferCodeBlockWrappedValue = exports.isCodeBlockWordWrapEnabled = exports.defaultWordWrapState = exports.codeBlockWrappedStates = void 0;
6
+ exports.updateCodeBlockWrappedStateNodeKeys = exports.transferCodeBlockWrappedValue = exports.isCodeBlockWordWrapEnabled = exports.defaultWordWrapState = exports.codeBlockWrappedStates = void 0;
7
7
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
8
+ /* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
9
+
8
10
  var defaultWordWrapState = exports.defaultWordWrapState = false;
9
11
  var codeBlockWrappedStates = exports.codeBlockWrappedStates = new WeakMap();
10
12
  var isCodeBlockWordWrapEnabled = exports.isCodeBlockWordWrapEnabled = function isCodeBlockWordWrapEnabled(codeBlockNode) {
@@ -16,14 +18,13 @@ var isCodeBlockWordWrapEnabled = exports.isCodeBlockWordWrapEnabled = function i
16
18
  };
17
19
 
18
20
  /**
19
- * As the code block node is used as the key, there is instances where the node will be destroyed & recreated and is no longer a valid key.
20
- * In these instances, we must get the value from that old node and set it to the value of the new node.
21
+ * Swap the old node key with the new node key in the wrapped states WeakMap.
22
+ * Replaced with updateCodeBlockWrappedStateNodeKeys() under 'editor_code_block_wrapping_language_change_bug' feature gate.
21
23
  */
22
24
  var transferCodeBlockWrappedValue = exports.transferCodeBlockWrappedValue = function transferCodeBlockWrappedValue(oldCodeBlockNode, newCodeBlockNode) {
23
25
  if (!(0, _platformFeatureFlags.fg)('editor_support_code_block_wrapping')) {
24
26
  return;
25
27
  }
26
-
27
28
  // Don't overwrite the value for the new node if it already exists.
28
29
  // This can happen when a drag&drop is swapping nodes.
29
30
  if (codeBlockWrappedStates.has(newCodeBlockNode)) {
@@ -32,4 +33,33 @@ var transferCodeBlockWrappedValue = exports.transferCodeBlockWrappedValue = func
32
33
  var previousValue = isCodeBlockWordWrapEnabled(oldCodeBlockNode);
33
34
  codeBlockWrappedStates.set(newCodeBlockNode, previousValue);
34
35
  codeBlockWrappedStates.delete(oldCodeBlockNode);
36
+ };
37
+
38
+ /**
39
+ * As the code block node is used as the wrapped state key, there is instances where the node will be destroyed & recreated and is no longer a valid key.
40
+ * In these instances, we must get the value from that old node and set it to the value of the new node.
41
+ * This function takes all the given nodes, finds their old nodes from the old state and updates these old node keys.
42
+ */
43
+ var updateCodeBlockWrappedStateNodeKeys = exports.updateCodeBlockWrappedStateNodeKeys = function updateCodeBlockWrappedStateNodeKeys(newCodeBlockNodes, oldState) {
44
+ if (!(0, _platformFeatureFlags.fg)('editor_support_code_block_wrapping') || !(0, _platformFeatureFlags.fg)('editor_code_block_wrapping_language_change_bug')) {
45
+ return;
46
+ }
47
+ newCodeBlockNodes.forEach(function (newCodeBlockNode) {
48
+ // Don't overwrite the value for the new node if it already exists.
49
+ // This can happen when a drag&drop is swapping nodes.
50
+ if (codeBlockWrappedStates.has(newCodeBlockNode.node)) {
51
+ return;
52
+ }
53
+
54
+ // Do not go out of range on the oldState doc. Happens on initial load.
55
+ if (oldState.doc.nodeSize <= newCodeBlockNode.pos) {
56
+ return;
57
+ }
58
+ var oldCodeBlockNode = oldState.doc.nodeAt(newCodeBlockNode.pos);
59
+ if (!oldCodeBlockNode || oldCodeBlockNode.type !== oldState.schema.nodes.codeBlock) {
60
+ return;
61
+ }
62
+ var previousValue = isCodeBlockWordWrapEnabled(oldCodeBlockNode);
63
+ codeBlockWrappedStates.set(newCodeBlockNode.node, previousValue);
64
+ });
35
65
  };
@@ -15,5 +15,12 @@ Object.defineProperty(exports, "insideTable", {
15
15
  return _inside.insideTable;
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "isSSR", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _isSsr.isSSR;
22
+ }
23
+ });
18
24
  var _inside = require("./inside");
19
- var _documentLogger = require("./document-logger");
25
+ var _documentLogger = require("./document-logger");
26
+ var _isSsr = require("./is-ssr");
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isSSR = isSSR;
7
+ function isSSR() {
8
+ try {
9
+ var _process;
10
+ return Boolean(
11
+ // In most places there is no document when running on server-side
12
+ typeof document === 'undefined' ||
13
+ // When SSRing editor with full cycle mode we define the document
14
+ // Check Confluence specific environment variable
15
+ typeof process !== 'undefined' && ((_process = process) === null || _process === void 0 || (_process = _process.env) === null || _process === void 0 ? void 0 : _process.REACT_SSR));
16
+ } catch (e) {
17
+ // Catch possible error that might occur and just return false
18
+ return false;
19
+ }
20
+ }
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "88.8.0";
20
+ var packageVersion = "88.8.2";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // TODO: Sanitise the URL instead of just removing it
@@ -9,7 +9,7 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
9
9
  var _react = require("@emotion/react");
10
10
  var _adfSchema = require("@atlaskit/adf-schema");
11
11
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
12
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
13
13
  var _browser = require("../../utils/browser");
14
14
  var _codeBlock = require("./code-block");
15
15
  var _tableCell = require("./tableCell");
@@ -47,7 +47,7 @@ var TableSharedCssClassName = exports.TableSharedCssClassName = {
47
47
 
48
48
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Appears safe to auto-fix, but leaving it up to the team to remediate as the readability only gets worse with autofixing
49
49
  var tableSharedStyle = exports.tableSharedStyle = function tableSharedStyle() {
50
- return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t", "\n\t.", " {\n\t\tposition: relative;\n\t\tmargin: 0 auto ", ";\n\t\tbox-sizing: border-box;\n\n\t\t/**\n * Fix block top alignment inside table cells.\n */\n\t\t.decisionItemView-content-wrap:first-of-type > div {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.", "[data-number-column='true'] {\n\t\tpadding-left: ", "px;\n\t\tclear: both;\n\t}\n\n\t.", " {\n\t\twill-change: width, margin-left;\n\t}\n\n\t.", " table {\n\t\twill-change: width;\n\t}\n\n\t.", " > table {\n\t\tmargin: ", " 0 0 0;\n\t}\n\n\t.", " > table,\n\t.", " > table {\n\t\tmargin: ", " ", " 0 0;\n\t}\n\n\t/* avoid applying styles to nested tables (possible via extensions) */\n\t.", " > table,\n\t.", " > table,\n\t.", " > table {\n\t\tborder-collapse: collapse;\n\t\tborder: ", "px solid\n\t\t\t", ";\n\t\ttable-layout: fixed;\n\t\tfont-size: 1em;\n\t\twidth: 100%;\n\n\t\t&[data-autosize='true'] {\n\t\t\ttable-layout: auto;\n\t\t}\n\n\t\t& {\n\t\t\t* {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\thr {\n\t\t\t\tbox-sizing: content-box;\n\t\t\t}\n\n\t\t\ttbody {\n\t\t\t\tborder-bottom: none;\n\t\t\t}\n\t\t\tth td {\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\t\t\tth,\n\t\t\ttd {\n\t\t\t\tmin-width: ", "px;\n\t\t\t\tfont-weight: normal;\n\t\t\t\tvertical-align: top;\n\t\t\t\tborder: 1px solid ", ";\n\t\t\t\tborder-right-width: 0;\n\t\t\t\tborder-bottom-width: 0;\n\n\t\t\t\tpadding: ", ";\n\t\t\t\t/* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n\t\t\t\t", "\n\n\t\t\t\t> :first-child:not(style),\n > style:first-child + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + span + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + span + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\tth p:not(:first-of-type),\n\t\t\t\ttd p:not(:first-of-type) {\n\t\t\t\t\tmargin-top: ", ";\n\t\t\t\t}\n\t\t\t}\n\t\t\tth {\n\t\t\t\tbackground-color: ", ";\n\t\t\t\ttext-align: left;\n\n\t\t\t\t/* only apply this styling to codeblocks in default background headercells */\n\t\t\t\t/* TODO this needs to be overhauled as it relies on unsafe selectors */\n\t\t\t\t&:not([style]):not(.danger) {\n\t\t\t\t\t.", ":not(.danger) {\n\t\t\t\t\t\tbackground-color: ", ";\n\n\t\t\t\t\t\t:not(.", ") {\n\t\t\t\t\t\t\tbox-shadow: 0px 0px 0px 1px ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tbackground-image: ", ";\n\n\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* this is only relevant to the element taken care of by renderer */\n\t\t\t\t\t\t> [data-ds--code--code-block] {\n\t\t\t\t\t\t\tbackground-image: ", "!important;\n\n\t\t\t\t\t\t\tbackground-color: ", "!important;\n\n\t\t\t\t\t\t\t// selector lives inside @atlaskit/code\n\t\t\t\t\t\t\t--ds--code--line-number-bg-color: ", ";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n"])), (0, _tableCell.tableCellBackgroundStyleOverride)(), TableSharedCssClassName.TABLE_CONTAINER, "var(--ds-space-200, 16px)", TableSharedCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, "var(--ds-space-300, 24px)", TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), "var(--ds-background-neutral-subtle, white)", tableCellMinWidth, "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), (0, _platformFeatureFlags.fg)('platform_editor_tables_padding_increase') ? "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-250, 20px)") : "var(--ds-space-100, 8px)", _browser.browser.gecko || _browser.browser.ie || _browser.browser.mac && _browser.browser.chrome ? 'background-clip: padding-box;' : '', "var(--ds-space-150, 12px)", "var(--ds-background-accent-gray-subtlest, ".concat(_editorSharedStyles.akEditorTableToolbar, ")"), _codeBlock.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, rgb(235, 237, 240))", _editorSharedStyles.akEditorSelectedNodeClassName, "var(--ds-border, transparent)", _codeBlock.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, (0, _editorSharedStyles.overflowShadow)({
50
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t", "\n\t.", " {\n\t\tposition: relative;\n\t\tmargin: 0 auto ", ";\n\t\tbox-sizing: border-box;\n\n\t\t/**\n * Fix block top alignment inside table cells.\n */\n\t\t.decisionItemView-content-wrap:first-of-type > div {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.", "[data-number-column='true'] {\n\t\tpadding-left: ", "px;\n\t\tclear: both;\n\t}\n\n\t.", " {\n\t\twill-change: width, margin-left;\n\t}\n\n\t.", " table {\n\t\twill-change: width;\n\t}\n\n\t.", " > table {\n\t\tmargin: ", " 0 0 0;\n\t}\n\n\t.", " > table,\n\t.", " > table {\n\t\tmargin: ", " ", " 0 0;\n\t}\n\n\t/* avoid applying styles to nested tables (possible via extensions) */\n\t.", " > table,\n\t.", " > table,\n\t.", " > table {\n\t\tborder-collapse: collapse;\n\t\tborder: ", "px solid\n\t\t\t", ";\n\t\ttable-layout: fixed;\n\t\tfont-size: 1em;\n\t\twidth: 100%;\n\n\t\t&[data-autosize='true'] {\n\t\t\ttable-layout: auto;\n\t\t}\n\n\t\t& {\n\t\t\t* {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\thr {\n\t\t\t\tbox-sizing: content-box;\n\t\t\t}\n\n\t\t\ttbody {\n\t\t\t\tborder-bottom: none;\n\t\t\t}\n\t\t\tth td {\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\t\t\tth,\n\t\t\ttd {\n\t\t\t\tmin-width: ", "px;\n\t\t\t\tfont-weight: normal;\n\t\t\t\tvertical-align: top;\n\t\t\t\tborder: 1px solid ", ";\n\t\t\t\tborder-right-width: 0;\n\t\t\t\tborder-bottom-width: 0;\n\n\t\t\t\tpadding: ", ";\n\t\t\t\t/* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n\t\t\t\t", "\n\n\t\t\t\t> :first-child:not(style),\n > style:first-child + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + span + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + span + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\tth p:not(:first-of-type),\n\t\t\t\ttd p:not(:first-of-type) {\n\t\t\t\t\tmargin-top: ", ";\n\t\t\t\t}\n\t\t\t}\n\t\t\tth {\n\t\t\t\tbackground-color: ", ";\n\t\t\t\ttext-align: left;\n\n\t\t\t\t/* only apply this styling to codeblocks in default background headercells */\n\t\t\t\t/* TODO this needs to be overhauled as it relies on unsafe selectors */\n\t\t\t\t&:not([style]):not(.danger) {\n\t\t\t\t\t.", ":not(.danger) {\n\t\t\t\t\t\tbackground-color: ", ";\n\n\t\t\t\t\t\t:not(.", ") {\n\t\t\t\t\t\t\tbox-shadow: 0px 0px 0px 1px ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tbackground-image: ", ";\n\n\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* this is only relevant to the element taken care of by renderer */\n\t\t\t\t\t\t> [data-ds--code--code-block] {\n\t\t\t\t\t\t\tbackground-image: ", "!important;\n\n\t\t\t\t\t\t\tbackground-color: ", "!important;\n\n\t\t\t\t\t\t\t// selector lives inside @atlaskit/code\n\t\t\t\t\t\t\t--ds--code--line-number-bg-color: ", ";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n"])), (0, _tableCell.tableCellBackgroundStyleOverride)(), TableSharedCssClassName.TABLE_CONTAINER, "var(--ds-space-200, 16px)", TableSharedCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, "var(--ds-space-300, 24px)", TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), "var(--ds-background-neutral-subtle, white)", tableCellMinWidth, "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), (0, _experiments.editorExperiment)('table-nested-dnd', true) ? "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-250, 20px)") : "var(--ds-space-100, 8px)", _browser.browser.gecko || _browser.browser.ie || _browser.browser.mac && _browser.browser.chrome ? 'background-clip: padding-box;' : '', "var(--ds-space-150, 12px)", "var(--ds-background-accent-gray-subtlest, ".concat(_editorSharedStyles.akEditorTableToolbar, ")"), _codeBlock.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, rgb(235, 237, 240))", _editorSharedStyles.akEditorSelectedNodeClassName, "var(--ds-border, transparent)", _codeBlock.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, (0, _editorSharedStyles.overflowShadow)({
51
51
  leftCoverWidth: "var(--ds-space-300, 24px)"
52
52
  }), "var(--ds-background-neutral, rgb(235, 237, 240))", _codeBlock.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-neutral, rgb(226, 229, 233))", (0, _editorSharedStyles.overflowShadow)({
53
53
  leftCoverWidth: "var(--ds-space-300, 24px)"
@@ -25,7 +25,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
25
25
  * @jsx jsx
26
26
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
27
27
  var packageName = "@atlaskit/editor-common";
28
- var packageVersion = "88.8.0";
28
+ var packageVersion = "88.8.2";
29
29
  var halfFocusRing = 1;
30
30
  var dropOffset = '0, 8';
31
31
  var DropList = /*#__PURE__*/function (_Component) {
@@ -16,7 +16,7 @@ var _memoizeOne = _interopRequireDefault(require("memoize-one"));
16
16
  var _rafSchd = _interopRequireDefault(require("raf-schd"));
17
17
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
18
  var _widthDetector = require("@atlaskit/width-detector");
19
- var _isSSR = require("./isSSR");
19
+ var _isSsr = require("../../core-utils/is-ssr");
20
20
  var _isSsrButNoBreakoutScriptObserved = require("./isSsrButNoBreakoutScriptObserved");
21
21
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
22
22
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -67,7 +67,7 @@ var Provider = WidthContext.Provider,
67
67
  */
68
68
  var getBodyWidth = exports.getBodyWidth = (0, _memoizeOne.default)(function () {
69
69
  var _document$body$offset, _document$body;
70
- return (0, _isSSR.isSSR)() ? 0 : (_document$body$offset = (_document$body = document.body) === null || _document$body === void 0 ? void 0 : _document$body.offsetWidth) !== null && _document$body$offset !== void 0 ? _document$body$offset : 0;
70
+ return (0, _isSsr.isSSR)() ? 0 : (_document$body$offset = (_document$body = document.body) === null || _document$body === void 0 ? void 0 : _document$body.offsetWidth) !== null && _document$body$offset !== void 0 ? _document$body$offset : 0;
71
71
  });
72
72
  var WidthProvider = exports.WidthProvider = function WidthProvider(_ref) {
73
73
  var className = _ref.className,
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.isSsrButNoBreakoutScriptObserved = isSsrButNoBreakoutScriptObserved;
7
- var _isSSR = require("./isSSR");
7
+ var _isSsr = require("../../core-utils/is-ssr");
8
8
  // export for testing
9
9
  function isSsrButNoBreakoutScriptObserved() {
10
- return (0, _isSSR.isSSR)() && !window.__SSR_BREAKOUT_OBSERVED;
10
+ return (0, _isSsr.isSSR)() && !window.__SSR_BREAKOUT_OBSERVED;
11
11
  }
@@ -1,3 +1,5 @@
1
+ /* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
2
+
1
3
  import { fg } from '@atlaskit/platform-feature-flags';
2
4
  export const defaultWordWrapState = false;
3
5
  export const codeBlockWrappedStates = new WeakMap();
@@ -10,14 +12,13 @@ export const isCodeBlockWordWrapEnabled = codeBlockNode => {
10
12
  };
11
13
 
12
14
  /**
13
- * As the code block node is used as the key, there is instances where the node will be destroyed & recreated and is no longer a valid key.
14
- * In these instances, we must get the value from that old node and set it to the value of the new node.
15
+ * Swap the old node key with the new node key in the wrapped states WeakMap.
16
+ * Replaced with updateCodeBlockWrappedStateNodeKeys() under 'editor_code_block_wrapping_language_change_bug' feature gate.
15
17
  */
16
18
  export const transferCodeBlockWrappedValue = (oldCodeBlockNode, newCodeBlockNode) => {
17
19
  if (!fg('editor_support_code_block_wrapping')) {
18
20
  return;
19
21
  }
20
-
21
22
  // Don't overwrite the value for the new node if it already exists.
22
23
  // This can happen when a drag&drop is swapping nodes.
23
24
  if (codeBlockWrappedStates.has(newCodeBlockNode)) {
@@ -26,4 +27,33 @@ export const transferCodeBlockWrappedValue = (oldCodeBlockNode, newCodeBlockNode
26
27
  const previousValue = isCodeBlockWordWrapEnabled(oldCodeBlockNode);
27
28
  codeBlockWrappedStates.set(newCodeBlockNode, previousValue);
28
29
  codeBlockWrappedStates.delete(oldCodeBlockNode);
30
+ };
31
+
32
+ /**
33
+ * As the code block node is used as the wrapped state key, there is instances where the node will be destroyed & recreated and is no longer a valid key.
34
+ * In these instances, we must get the value from that old node and set it to the value of the new node.
35
+ * This function takes all the given nodes, finds their old nodes from the old state and updates these old node keys.
36
+ */
37
+ export const updateCodeBlockWrappedStateNodeKeys = (newCodeBlockNodes, oldState) => {
38
+ if (!fg('editor_support_code_block_wrapping') || !fg('editor_code_block_wrapping_language_change_bug')) {
39
+ return;
40
+ }
41
+ newCodeBlockNodes.forEach(newCodeBlockNode => {
42
+ // Don't overwrite the value for the new node if it already exists.
43
+ // This can happen when a drag&drop is swapping nodes.
44
+ if (codeBlockWrappedStates.has(newCodeBlockNode.node)) {
45
+ return;
46
+ }
47
+
48
+ // Do not go out of range on the oldState doc. Happens on initial load.
49
+ if (oldState.doc.nodeSize <= newCodeBlockNode.pos) {
50
+ return;
51
+ }
52
+ const oldCodeBlockNode = oldState.doc.nodeAt(newCodeBlockNode.pos);
53
+ if (!oldCodeBlockNode || oldCodeBlockNode.type !== oldState.schema.nodes.codeBlock) {
54
+ return;
55
+ }
56
+ const previousValue = isCodeBlockWordWrapEnabled(oldCodeBlockNode);
57
+ codeBlockWrappedStates.set(newCodeBlockNode.node, previousValue);
58
+ });
29
59
  };
@@ -1,2 +1,3 @@
1
1
  export { insideTable } from './inside';
2
- export { getDocStructure } from './document-logger';
2
+ export { getDocStructure } from './document-logger';
3
+ export { isSSR } from './is-ssr';
@@ -0,0 +1,14 @@
1
+ export function isSSR() {
2
+ try {
3
+ var _process, _process$env;
4
+ return Boolean(
5
+ // In most places there is no document when running on server-side
6
+ typeof document === 'undefined' ||
7
+ // When SSRing editor with full cycle mode we define the document
8
+ // Check Confluence specific environment variable
9
+ typeof process !== 'undefined' && ((_process = process) === null || _process === void 0 ? void 0 : (_process$env = _process.env) === null || _process$env === void 0 ? void 0 : _process$env.REACT_SSR));
10
+ } catch (e) {
11
+ // Catch possible error that might occur and just return false
12
+ return false;
13
+ }
14
+ }
@@ -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 = "88.8.0";
4
+ const packageVersion = "88.8.2";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // TODO: Sanitise the URL instead of just removing it
@@ -2,7 +2,7 @@
2
2
  import { css } from '@emotion/react';
3
3
  import { tableCellContentDomSelector, tableCellSelector, tableHeaderSelector, tablePrefixSelector } from '@atlaskit/adf-schema';
4
4
  import { akEditorBreakoutPadding, akEditorFullWidthLayoutWidth, akEditorSelectedNodeClassName, akEditorTableBorder, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorWideLayoutWidth, overflowShadow } from '@atlaskit/editor-shared-styles';
5
- import { fg } from '@atlaskit/platform-feature-flags';
5
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
6
6
  import { browser } from '../../utils/browser';
7
7
  import { CodeBlockSharedCssClassName } from './code-block';
8
8
  import { tableCellBackgroundStyleOverride } from './tableCell';
@@ -112,7 +112,7 @@ const tableSharedStyle = () => css`
112
112
  border-right-width: 0;
113
113
  border-bottom-width: 0;
114
114
 
115
- padding: ${fg('platform_editor_tables_padding_increase') ? `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-250, 20px)"}` : "var(--ds-space-100, 8px)"};
115
+ padding: ${editorExperiment('table-nested-dnd', true) ? `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-250, 20px)"}` : "var(--ds-space-100, 8px)"};
116
116
  /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */
117
117
  ${browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : ''}
118
118
 
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "88.8.0";
17
+ const packageVersion = "88.8.2";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  class DropList extends Component {
@@ -10,7 +10,7 @@ import memoizeOne from 'memoize-one';
10
10
  import rafSchedule from 'raf-schd';
11
11
  import { fg } from '@atlaskit/platform-feature-flags';
12
12
  import { WidthObserver } from '@atlaskit/width-detector';
13
- import { isSSR } from './isSSR';
13
+ import { isSSR } from '../../core-utils/is-ssr';
14
14
  import { isSsrButNoBreakoutScriptObserved } from './isSsrButNoBreakoutScriptObserved';
15
15
  const styles = css({
16
16
  position: 'relative',
@@ -1,4 +1,4 @@
1
- import { isSSR } from './isSSR';
1
+ import { isSSR } from '../../core-utils/is-ssr';
2
2
 
3
3
  // export for testing
4
4
  export function isSsrButNoBreakoutScriptObserved() {
@@ -1,3 +1,5 @@
1
+ /* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
2
+
1
3
  import { fg } from '@atlaskit/platform-feature-flags';
2
4
  export var defaultWordWrapState = false;
3
5
  export var codeBlockWrappedStates = new WeakMap();
@@ -10,14 +12,13 @@ export var isCodeBlockWordWrapEnabled = function isCodeBlockWordWrapEnabled(code
10
12
  };
11
13
 
12
14
  /**
13
- * As the code block node is used as the key, there is instances where the node will be destroyed & recreated and is no longer a valid key.
14
- * In these instances, we must get the value from that old node and set it to the value of the new node.
15
+ * Swap the old node key with the new node key in the wrapped states WeakMap.
16
+ * Replaced with updateCodeBlockWrappedStateNodeKeys() under 'editor_code_block_wrapping_language_change_bug' feature gate.
15
17
  */
16
18
  export var transferCodeBlockWrappedValue = function transferCodeBlockWrappedValue(oldCodeBlockNode, newCodeBlockNode) {
17
19
  if (!fg('editor_support_code_block_wrapping')) {
18
20
  return;
19
21
  }
20
-
21
22
  // Don't overwrite the value for the new node if it already exists.
22
23
  // This can happen when a drag&drop is swapping nodes.
23
24
  if (codeBlockWrappedStates.has(newCodeBlockNode)) {
@@ -26,4 +27,33 @@ export var transferCodeBlockWrappedValue = function transferCodeBlockWrappedValu
26
27
  var previousValue = isCodeBlockWordWrapEnabled(oldCodeBlockNode);
27
28
  codeBlockWrappedStates.set(newCodeBlockNode, previousValue);
28
29
  codeBlockWrappedStates.delete(oldCodeBlockNode);
30
+ };
31
+
32
+ /**
33
+ * As the code block node is used as the wrapped state key, there is instances where the node will be destroyed & recreated and is no longer a valid key.
34
+ * In these instances, we must get the value from that old node and set it to the value of the new node.
35
+ * This function takes all the given nodes, finds their old nodes from the old state and updates these old node keys.
36
+ */
37
+ export var updateCodeBlockWrappedStateNodeKeys = function updateCodeBlockWrappedStateNodeKeys(newCodeBlockNodes, oldState) {
38
+ if (!fg('editor_support_code_block_wrapping') || !fg('editor_code_block_wrapping_language_change_bug')) {
39
+ return;
40
+ }
41
+ newCodeBlockNodes.forEach(function (newCodeBlockNode) {
42
+ // Don't overwrite the value for the new node if it already exists.
43
+ // This can happen when a drag&drop is swapping nodes.
44
+ if (codeBlockWrappedStates.has(newCodeBlockNode.node)) {
45
+ return;
46
+ }
47
+
48
+ // Do not go out of range on the oldState doc. Happens on initial load.
49
+ if (oldState.doc.nodeSize <= newCodeBlockNode.pos) {
50
+ return;
51
+ }
52
+ var oldCodeBlockNode = oldState.doc.nodeAt(newCodeBlockNode.pos);
53
+ if (!oldCodeBlockNode || oldCodeBlockNode.type !== oldState.schema.nodes.codeBlock) {
54
+ return;
55
+ }
56
+ var previousValue = isCodeBlockWordWrapEnabled(oldCodeBlockNode);
57
+ codeBlockWrappedStates.set(newCodeBlockNode.node, previousValue);
58
+ });
29
59
  };
@@ -1,2 +1,3 @@
1
1
  export { insideTable } from './inside';
2
- export { getDocStructure } from './document-logger';
2
+ export { getDocStructure } from './document-logger';
3
+ export { isSSR } from './is-ssr';
@@ -0,0 +1,14 @@
1
+ export function isSSR() {
2
+ try {
3
+ var _process;
4
+ return Boolean(
5
+ // In most places there is no document when running on server-side
6
+ typeof document === 'undefined' ||
7
+ // When SSRing editor with full cycle mode we define the document
8
+ // Check Confluence specific environment variable
9
+ typeof process !== 'undefined' && ((_process = process) === null || _process === void 0 || (_process = _process.env) === null || _process === void 0 ? void 0 : _process.REACT_SSR));
10
+ } catch (e) {
11
+ // Catch possible error that might occur and just return false
12
+ return false;
13
+ }
14
+ }
@@ -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 = "88.8.0";
10
+ var packageVersion = "88.8.2";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // TODO: Sanitise the URL instead of just removing it
@@ -4,7 +4,7 @@ var _templateObject;
4
4
  import { css } from '@emotion/react';
5
5
  import { tableCellContentDomSelector, tableCellSelector, tableHeaderSelector, tablePrefixSelector } from '@atlaskit/adf-schema';
6
6
  import { akEditorBreakoutPadding, akEditorFullWidthLayoutWidth, akEditorSelectedNodeClassName, akEditorTableBorder, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorWideLayoutWidth, overflowShadow } from '@atlaskit/editor-shared-styles';
7
- import { fg } from '@atlaskit/platform-feature-flags';
7
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
8
  import { browser } from '../../utils/browser';
9
9
  import { CodeBlockSharedCssClassName } from './code-block';
10
10
  import { tableCellBackgroundStyleOverride } from './tableCell';
@@ -41,7 +41,7 @@ export var TableSharedCssClassName = {
41
41
 
42
42
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Appears safe to auto-fix, but leaving it up to the team to remediate as the readability only gets worse with autofixing
43
43
  var tableSharedStyle = function tableSharedStyle() {
44
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t", "\n\t.", " {\n\t\tposition: relative;\n\t\tmargin: 0 auto ", ";\n\t\tbox-sizing: border-box;\n\n\t\t/**\n * Fix block top alignment inside table cells.\n */\n\t\t.decisionItemView-content-wrap:first-of-type > div {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.", "[data-number-column='true'] {\n\t\tpadding-left: ", "px;\n\t\tclear: both;\n\t}\n\n\t.", " {\n\t\twill-change: width, margin-left;\n\t}\n\n\t.", " table {\n\t\twill-change: width;\n\t}\n\n\t.", " > table {\n\t\tmargin: ", " 0 0 0;\n\t}\n\n\t.", " > table,\n\t.", " > table {\n\t\tmargin: ", " ", " 0 0;\n\t}\n\n\t/* avoid applying styles to nested tables (possible via extensions) */\n\t.", " > table,\n\t.", " > table,\n\t.", " > table {\n\t\tborder-collapse: collapse;\n\t\tborder: ", "px solid\n\t\t\t", ";\n\t\ttable-layout: fixed;\n\t\tfont-size: 1em;\n\t\twidth: 100%;\n\n\t\t&[data-autosize='true'] {\n\t\t\ttable-layout: auto;\n\t\t}\n\n\t\t& {\n\t\t\t* {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\thr {\n\t\t\t\tbox-sizing: content-box;\n\t\t\t}\n\n\t\t\ttbody {\n\t\t\t\tborder-bottom: none;\n\t\t\t}\n\t\t\tth td {\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\t\t\tth,\n\t\t\ttd {\n\t\t\t\tmin-width: ", "px;\n\t\t\t\tfont-weight: normal;\n\t\t\t\tvertical-align: top;\n\t\t\t\tborder: 1px solid ", ";\n\t\t\t\tborder-right-width: 0;\n\t\t\t\tborder-bottom-width: 0;\n\n\t\t\t\tpadding: ", ";\n\t\t\t\t/* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n\t\t\t\t", "\n\n\t\t\t\t> :first-child:not(style),\n > style:first-child + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + span + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + span + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\tth p:not(:first-of-type),\n\t\t\t\ttd p:not(:first-of-type) {\n\t\t\t\t\tmargin-top: ", ";\n\t\t\t\t}\n\t\t\t}\n\t\t\tth {\n\t\t\t\tbackground-color: ", ";\n\t\t\t\ttext-align: left;\n\n\t\t\t\t/* only apply this styling to codeblocks in default background headercells */\n\t\t\t\t/* TODO this needs to be overhauled as it relies on unsafe selectors */\n\t\t\t\t&:not([style]):not(.danger) {\n\t\t\t\t\t.", ":not(.danger) {\n\t\t\t\t\t\tbackground-color: ", ";\n\n\t\t\t\t\t\t:not(.", ") {\n\t\t\t\t\t\t\tbox-shadow: 0px 0px 0px 1px ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tbackground-image: ", ";\n\n\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* this is only relevant to the element taken care of by renderer */\n\t\t\t\t\t\t> [data-ds--code--code-block] {\n\t\t\t\t\t\t\tbackground-image: ", "!important;\n\n\t\t\t\t\t\t\tbackground-color: ", "!important;\n\n\t\t\t\t\t\t\t// selector lives inside @atlaskit/code\n\t\t\t\t\t\t\t--ds--code--line-number-bg-color: ", ";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n"])), tableCellBackgroundStyleOverride(), TableSharedCssClassName.TABLE_CONTAINER, "var(--ds-space-200, 16px)", TableSharedCssClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, "var(--ds-space-300, 24px)", TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-neutral-subtle, white)", tableCellMinWidth, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), fg('platform_editor_tables_padding_increase') ? "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-250, 20px)") : "var(--ds-space-100, 8px)", browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : '', "var(--ds-space-150, 12px)", "var(--ds-background-accent-gray-subtlest, ".concat(akEditorTableToolbar, ")"), CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, rgb(235, 237, 240))", akEditorSelectedNodeClassName, "var(--ds-border, transparent)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, overflowShadow({
44
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t", "\n\t.", " {\n\t\tposition: relative;\n\t\tmargin: 0 auto ", ";\n\t\tbox-sizing: border-box;\n\n\t\t/**\n * Fix block top alignment inside table cells.\n */\n\t\t.decisionItemView-content-wrap:first-of-type > div {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.", "[data-number-column='true'] {\n\t\tpadding-left: ", "px;\n\t\tclear: both;\n\t}\n\n\t.", " {\n\t\twill-change: width, margin-left;\n\t}\n\n\t.", " table {\n\t\twill-change: width;\n\t}\n\n\t.", " > table {\n\t\tmargin: ", " 0 0 0;\n\t}\n\n\t.", " > table,\n\t.", " > table {\n\t\tmargin: ", " ", " 0 0;\n\t}\n\n\t/* avoid applying styles to nested tables (possible via extensions) */\n\t.", " > table,\n\t.", " > table,\n\t.", " > table {\n\t\tborder-collapse: collapse;\n\t\tborder: ", "px solid\n\t\t\t", ";\n\t\ttable-layout: fixed;\n\t\tfont-size: 1em;\n\t\twidth: 100%;\n\n\t\t&[data-autosize='true'] {\n\t\t\ttable-layout: auto;\n\t\t}\n\n\t\t& {\n\t\t\t* {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\thr {\n\t\t\t\tbox-sizing: content-box;\n\t\t\t}\n\n\t\t\ttbody {\n\t\t\t\tborder-bottom: none;\n\t\t\t}\n\t\t\tth td {\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\t\t\tth,\n\t\t\ttd {\n\t\t\t\tmin-width: ", "px;\n\t\t\t\tfont-weight: normal;\n\t\t\t\tvertical-align: top;\n\t\t\t\tborder: 1px solid ", ";\n\t\t\t\tborder-right-width: 0;\n\t\t\t\tborder-bottom-width: 0;\n\n\t\t\t\tpadding: ", ";\n\t\t\t\t/* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n\t\t\t\t", "\n\n\t\t\t\t> :first-child:not(style),\n > style:first-child + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + span + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + span + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\tth p:not(:first-of-type),\n\t\t\t\ttd p:not(:first-of-type) {\n\t\t\t\t\tmargin-top: ", ";\n\t\t\t\t}\n\t\t\t}\n\t\t\tth {\n\t\t\t\tbackground-color: ", ";\n\t\t\t\ttext-align: left;\n\n\t\t\t\t/* only apply this styling to codeblocks in default background headercells */\n\t\t\t\t/* TODO this needs to be overhauled as it relies on unsafe selectors */\n\t\t\t\t&:not([style]):not(.danger) {\n\t\t\t\t\t.", ":not(.danger) {\n\t\t\t\t\t\tbackground-color: ", ";\n\n\t\t\t\t\t\t:not(.", ") {\n\t\t\t\t\t\t\tbox-shadow: 0px 0px 0px 1px ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tbackground-image: ", ";\n\n\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* this is only relevant to the element taken care of by renderer */\n\t\t\t\t\t\t> [data-ds--code--code-block] {\n\t\t\t\t\t\t\tbackground-image: ", "!important;\n\n\t\t\t\t\t\t\tbackground-color: ", "!important;\n\n\t\t\t\t\t\t\t// selector lives inside @atlaskit/code\n\t\t\t\t\t\t\t--ds--code--line-number-bg-color: ", ";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n"])), tableCellBackgroundStyleOverride(), TableSharedCssClassName.TABLE_CONTAINER, "var(--ds-space-200, 16px)", TableSharedCssClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, "var(--ds-space-300, 24px)", TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-neutral-subtle, white)", tableCellMinWidth, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), editorExperiment('table-nested-dnd', true) ? "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-250, 20px)") : "var(--ds-space-100, 8px)", browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : '', "var(--ds-space-150, 12px)", "var(--ds-background-accent-gray-subtlest, ".concat(akEditorTableToolbar, ")"), CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, rgb(235, 237, 240))", akEditorSelectedNodeClassName, "var(--ds-border, transparent)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, overflowShadow({
45
45
  leftCoverWidth: "var(--ds-space-300, 24px)"
46
46
  }), "var(--ds-background-neutral, rgb(235, 237, 240))", CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-neutral, rgb(226, 229, 233))", overflowShadow({
47
47
  leftCoverWidth: "var(--ds-space-300, 24px)"
@@ -22,7 +22,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
22
22
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
23
23
  import Layer from '../Layer';
24
24
  var packageName = "@atlaskit/editor-common";
25
- var packageVersion = "88.8.0";
25
+ var packageVersion = "88.8.2";
26
26
  var halfFocusRing = 1;
27
27
  var dropOffset = '0, 8';
28
28
  var DropList = /*#__PURE__*/function (_Component) {
@@ -11,7 +11,7 @@ import memoizeOne from 'memoize-one';
11
11
  import rafSchedule from 'raf-schd';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
13
  import { WidthObserver } from '@atlaskit/width-detector';
14
- import { isSSR } from './isSSR';
14
+ import { isSSR } from '../../core-utils/is-ssr';
15
15
  import { isSsrButNoBreakoutScriptObserved } from './isSsrButNoBreakoutScriptObserved';
16
16
  var styles = css({
17
17
  position: 'relative',
@@ -1,4 +1,4 @@
1
- import { isSSR } from './isSSR';
1
+ import { isSSR } from '../../core-utils/is-ssr';
2
2
 
3
3
  // export for testing
4
4
  export function isSsrButNoBreakoutScriptObserved() {
@@ -1,9 +1,17 @@
1
1
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
2
+ import { type EditorState } from '@atlaskit/editor-prosemirror/state';
3
+ import { type NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
2
4
  export declare const defaultWordWrapState = false;
3
5
  export declare const codeBlockWrappedStates: WeakMap<PmNode, boolean | undefined>;
4
6
  export declare const isCodeBlockWordWrapEnabled: (codeBlockNode: PmNode) => boolean;
5
7
  /**
6
- * As the code block node is used as the key, there is instances where the node will be destroyed & recreated and is no longer a valid key.
7
- * In these instances, we must get the value from that old node and set it to the value of the new node.
8
+ * Swap the old node key with the new node key in the wrapped states WeakMap.
9
+ * Replaced with updateCodeBlockWrappedStateNodeKeys() under 'editor_code_block_wrapping_language_change_bug' feature gate.
8
10
  */
9
11
  export declare const transferCodeBlockWrappedValue: (oldCodeBlockNode: PmNode, newCodeBlockNode: PmNode) => void;
12
+ /**
13
+ * As the code block node is used as the wrapped state key, there is instances where the node will be destroyed & recreated and is no longer a valid key.
14
+ * In these instances, we must get the value from that old node and set it to the value of the new node.
15
+ * This function takes all the given nodes, finds their old nodes from the old state and updates these old node keys.
16
+ */
17
+ export declare const updateCodeBlockWrappedStateNodeKeys: (newCodeBlockNodes: NodeWithPos[], oldState: EditorState) => void;
@@ -1,2 +1,3 @@
1
1
  export { insideTable } from './inside';
2
2
  export { getDocStructure } from './document-logger';
3
+ export { isSSR } from './is-ssr';
@@ -1,9 +1,17 @@
1
1
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
2
+ import { type EditorState } from '@atlaskit/editor-prosemirror/state';
3
+ import { type NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
2
4
  export declare const defaultWordWrapState = false;
3
5
  export declare const codeBlockWrappedStates: WeakMap<PmNode, boolean | undefined>;
4
6
  export declare const isCodeBlockWordWrapEnabled: (codeBlockNode: PmNode) => boolean;
5
7
  /**
6
- * As the code block node is used as the key, there is instances where the node will be destroyed & recreated and is no longer a valid key.
7
- * In these instances, we must get the value from that old node and set it to the value of the new node.
8
+ * Swap the old node key with the new node key in the wrapped states WeakMap.
9
+ * Replaced with updateCodeBlockWrappedStateNodeKeys() under 'editor_code_block_wrapping_language_change_bug' feature gate.
8
10
  */
9
11
  export declare const transferCodeBlockWrappedValue: (oldCodeBlockNode: PmNode, newCodeBlockNode: PmNode) => void;
12
+ /**
13
+ * As the code block node is used as the wrapped state key, there is instances where the node will be destroyed & recreated and is no longer a valid key.
14
+ * In these instances, we must get the value from that old node and set it to the value of the new node.
15
+ * This function takes all the given nodes, finds their old nodes from the old state and updates these old node keys.
16
+ */
17
+ export declare const updateCodeBlockWrappedStateNodeKeys: (newCodeBlockNodes: NodeWithPos[], oldState: EditorState) => void;
@@ -1,2 +1,3 @@
1
1
  export { insideTable } from './inside';
2
2
  export { getDocStructure } from './document-logger';
3
+ export { isSSR } from './is-ssr';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "88.8.0",
3
+ "version": "88.8.2",
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/"
@@ -119,7 +119,7 @@
119
119
  "@atlaskit/emoji": "^67.7.0",
120
120
  "@atlaskit/icon": "^22.15.0",
121
121
  "@atlaskit/icon-object": "^6.5.0",
122
- "@atlaskit/link-datasource": "^2.11.0",
122
+ "@atlaskit/link-datasource": "^2.12.0",
123
123
  "@atlaskit/link-picker": "^1.45.0",
124
124
  "@atlaskit/media-card": "^78.2.0",
125
125
  "@atlaskit/media-client": "^27.6.0",
@@ -133,9 +133,9 @@
133
133
  "@atlaskit/menu": "^2.12.0",
134
134
  "@atlaskit/platform-feature-flags": "^0.3.0",
135
135
  "@atlaskit/primitives": "^12.1.0",
136
- "@atlaskit/profilecard": "^19.25.0",
136
+ "@atlaskit/profilecard": "^19.26.0",
137
137
  "@atlaskit/section-message": "^6.6.0",
138
- "@atlaskit/smart-card": "^27.19.0",
138
+ "@atlaskit/smart-card": "^27.20.0",
139
139
  "@atlaskit/smart-user-picker": "^6.10.0",
140
140
  "@atlaskit/spinner": "^16.3.0",
141
141
  "@atlaskit/task-decision": "^17.10.0",
@@ -238,9 +238,6 @@
238
238
  "platform.editor.mbe-update-params-change": {
239
239
  "type": "boolean"
240
240
  },
241
- "platform_editor_tables_padding_increase": {
242
- "type": "boolean"
243
- },
244
241
  "annotations_align_editor_and_renderer_styles": {
245
242
  "type": "boolean"
246
243
  },
@@ -259,6 +256,9 @@
259
256
  "editor_support_code_block_wrapping": {
260
257
  "type": "boolean"
261
258
  },
259
+ "editor_code_block_wrapping_language_change_bug": {
260
+ "type": "boolean"
261
+ },
262
262
  "cc_page_experiences_live_search_wysiwyg": {
263
263
  "type": "boolean"
264
264
  },
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isSSR = isSSR;
7
- function isSSR() {
8
- var _process;
9
- return Boolean(
10
- // In most places there is no document when running on server-side
11
- typeof document === 'undefined' ||
12
- // When SSRing editor with full cycle mode we define the document
13
- // Check Confluence specific environment variable
14
- typeof process !== 'undefined' && ((_process = process) === null || _process === void 0 || (_process = _process.env) === null || _process === void 0 ? void 0 : _process.REACT_SSR));
15
- }
@@ -1,9 +0,0 @@
1
- export function isSSR() {
2
- var _process, _process$env;
3
- return Boolean(
4
- // In most places there is no document when running on server-side
5
- typeof document === 'undefined' ||
6
- // When SSRing editor with full cycle mode we define the document
7
- // Check Confluence specific environment variable
8
- typeof process !== 'undefined' && ((_process = process) === null || _process === void 0 ? void 0 : (_process$env = _process.env) === null || _process$env === void 0 ? void 0 : _process$env.REACT_SSR));
9
- }
@@ -1,9 +0,0 @@
1
- export function isSSR() {
2
- var _process;
3
- return Boolean(
4
- // In most places there is no document when running on server-side
5
- typeof document === 'undefined' ||
6
- // When SSRing editor with full cycle mode we define the document
7
- // Check Confluence specific environment variable
8
- typeof process !== 'undefined' && ((_process = process) === null || _process === void 0 || (_process = _process.env) === null || _process === void 0 ? void 0 : _process.REACT_SSR));
9
- }