@atlaskit/editor-common 74.2.1 → 74.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 74.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 74.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`602d003d7e5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/602d003d7e5) - [ux] The table column sort compartor method would previously only look at the first word when sorting the column. This means when words are joined with special characters they would not sort correctly. This now looks at all the text in the cell when calculating the sort order.
14
+
15
+ ### Patch Changes
16
+
17
+ - [`26d9c8cb4b1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/26d9c8cb4b1) - Extract decorations plugin from editor-core to its own package.
18
+ - [`077e086c53f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/077e086c53f) - [ux] ED-17971 Changes the color token used for table borders and background of table controls and numbered column.
19
+ - [`8502175cafc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8502175cafc) - [ux] Updated top margin of Expand component from ~4.57px to 4px to align to spacing scale.
20
+ - [`741b3acd455`](https://bitbucket.org/atlassian/atlassian-frontend/commits/741b3acd455) - This major change includes:
21
+
22
+ - `EditorMigrationComponent` being renamed to `Editor`. This includes making component methods which should never be used private (which should never be used in normal operation and have been deprecated for several releases).
23
+ - `EditorMigrationComponent` is now removed
24
+ - Removing `useEditorNext` feature flag
25
+
26
+ This change was made as part of our strategy to move to a new architecture with `EditorMigrationComponent`, now that the component has served its purpose it is no longer required.
27
+
28
+ Any references to this component can be updated like so:
29
+
30
+ Before:
31
+
32
+ ```ts
33
+ import { EditorMigrationComponent } from '@atlaskit/editor-core';
34
+ ```
35
+
36
+ After:
37
+
38
+ ```ts
39
+ import { Editor } from '@atlaskit/editor-core';
40
+ ```
41
+
3
42
  ## 74.2.1
4
43
 
5
44
  ### Patch Changes
@@ -15,6 +15,7 @@ exports.default = void 0;
15
15
  var _default = {
16
16
  'fabric.editor.action': '⁣⁢Action item؜‍⁠⁠؜⁡‌‍⁡‍‌⁣⁤',
17
17
  'fabric.editor.action.description': '⁣⁢Create and assign action items‌‌⁡‌⁡‌؜⁠⁡⁣⁤',
18
+ 'fabric.editor.addMediaFiles': '⁣⁢Add image, video, or file‌‍؜؜‍‍؜‍؜؜‍⁣⁤',
18
19
  'fabric.editor.alignImageCenter': '⁣⁢Align center⁡⁡‍⁠‌⁡⁠⁡⁡‌⁡⁣⁤',
19
20
  'fabric.editor.alignImageLeft': '⁣⁢Align left⁠⁠‍؜⁡⁡⁠⁡⁠‍؜‌⁡⁣⁤',
20
21
  'fabric.editor.alignImageRight': '⁣⁢Align right⁠⁠⁡؜⁡؜⁡؜؜⁣⁤',
@@ -24,6 +25,8 @@ var _default = {
24
25
  'fabric.editor.codeBidiWarningLabel': '⁣⁢Bidirectional characters change the order that text is rendered. This could be used to obscure malicious code.‌⁡؜‍⁠⁠‌؜‌⁣⁤',
25
26
  'fabric.editor.codeBlockCopyButton.copiedToClipboard': '⁣⁢Copied!؜⁡‌⁡‍⁡⁠‍⁡⁡⁡⁣⁤',
26
27
  'fabric.editor.codeBlockCopyButton.copyToClipboard': '⁣⁢Copy as text‍⁠‌‍؜‍‌⁡⁡‍‍⁣⁤',
28
+ 'fabric.editor.codeBlockWrapButton.unwrapCodeBlock': '⁣⁢Turn off wrap⁠‍⁠‌‌؜‌‍‍‌⁠؜⁣⁤',
29
+ 'fabric.editor.codeBlockWrapButton.wrapCodeBlock': '⁣⁢Turn on wrap⁡‍‍⁠‌‍⁡؜‍‌⁣⁤',
27
30
  'fabric.editor.collapseNode': '⁣⁢Collapse content‍⁡‌⁠؜‍‍‌؜⁠‌⁡‍⁡‌⁣⁤',
28
31
  'fabric.editor.columns': '⁣⁢Layouts⁡⁠‍⁠⁡‌⁠‍⁡⁣⁤',
29
32
  'fabric.editor.columns.description': '⁣⁢Structure your page using sections‌‍⁠⁠‍؜‍⁡⁡⁡⁣⁤',
@@ -43,8 +46,6 @@ var _default = {
43
46
  'fabric.editor.expandPlaceholder': '⁣⁢Give this expand a title...؜⁠⁡‍؜؜؜⁡⁣⁤',
44
47
  'fabric.editor.feedbackDialog': '⁣⁢Give feedback؜⁡؜⁠‍‌‌‍⁡⁣⁤',
45
48
  'fabric.editor.feedbackDialog.description': '⁣⁢Tell us about your experience using the new editor‌‌؜؜؜؜؜⁡‍‍‍‌⁣⁤',
46
- 'fabric.editor.filesAndImages': '⁣⁢Files & images؜⁡‌⁡⁠⁡‍‍⁡؜‌⁡؜⁠‍‌⁠‌⁣⁤',
47
- 'fabric.editor.filesAndImages.description': '⁣⁢Add images and other files to your page؜⁡‍‌‍‌؜⁠⁠؜؜⁣⁤',
48
49
  'fabric.editor.help': '⁣⁢Help⁡‌‍‌⁡‌⁠⁠‍‍⁡⁣⁤',
49
50
  'fabric.editor.help.description': '⁣⁢Browse all the keyboard shortcuts and markdown options‌⁡⁠‍⁡⁠⁣⁤',
50
51
  'fabric.editor.horizontalRule': '⁣⁢Divider‍‌⁠‌⁡‌⁡؜‌⁡‍⁠‍⁣⁤',
@@ -56,6 +57,8 @@ var _default = {
56
57
  'fabric.editor.layoutWide': '⁣⁢Go wide‌؜؜‍‍⁡⁡؜⁣⁤',
57
58
  'fabric.editor.link': '⁣⁢Link⁡‍⁡‍؜؜؜⁠⁠⁣⁤',
58
59
  'fabric.editor.link.description': '⁣⁢Insert a link‌⁠⁠‌؜‍؜⁠؜⁣⁤',
60
+ 'fabric.editor.mediaFiles': '⁣⁢Image, video, or file⁠‍‌؜⁠‌‍⁣⁤',
61
+ 'fabric.editor.mediaFiles.description': '⁣⁢Add images and other files to your page⁠‍‌؜؜؜‍⁠⁠⁠⁠‍⁣⁤',
59
62
  'fabric.editor.mention': '⁣⁢Mention‌؜‌⁡⁡؜⁠⁣⁤',
60
63
  'fabric.editor.mention.description': '⁣⁢Mention someone to send them a notification‍؜‌‌⁡؜‌‌؜⁠⁠؜⁣⁤',
61
64
  'fabric.editor.openLink': '⁣⁢Open link in a new tab⁠⁡⁡‌‍‌⁠‌‌⁡⁡⁣⁤',
@@ -83,12 +86,32 @@ var _default = {
83
86
  'fabric.editor.viewMore': '⁣⁢View more⁠⁠⁡‌‍‌‌‌؜‍‌⁣⁤',
84
87
  'fabric.editor.visit': '⁣⁢Open link in a new window⁡⁠‍⁠⁠⁡‍⁡⁣⁤',
85
88
  'fabric.theme.blue': '⁣⁢Blue‍⁠‍؜‌⁠⁡‍؜⁣⁤',
89
+ 'fabric.theme.bold-blue': '⁣⁢Bold blue⁠⁡؜؜‍‍‌‌⁠‍⁣⁤',
90
+ 'fabric.theme.bold-gray': '⁣⁢Bold gray‌⁠⁠‌⁠⁠⁡‍‌⁣⁤',
91
+ 'fabric.theme.bold-green': '⁣⁢Bold green؜⁡؜؜‌⁡‍‌⁡⁣⁤',
92
+ 'fabric.theme.bold-magenta': '⁣⁢Bold magenta‍؜‌؜⁡⁠‍⁡‌‌‍‌⁣⁤',
93
+ 'fabric.theme.bold-orange': '⁣⁢Bold orange؜⁡؜⁡⁠⁡⁡؜؜‌⁡؜‍⁣⁤',
94
+ 'fabric.theme.bold-purple': '⁣⁢Bold purple‍‌‍‌؜‍⁡؜⁠‍‌⁣⁤',
95
+ 'fabric.theme.bold-red': '⁣⁢Bold red‌؜؜⁡⁡‍⁡⁠⁣⁤',
96
+ 'fabric.theme.bold-teal': '⁣⁢Bold teal‌؜‍‍⁡⁠⁠؜⁠؜؜؜⁣⁤',
97
+ 'fabric.theme.bold-yellow': '⁣⁢Bold yellow⁠‌‌‌⁠⁠⁡⁡⁡؜‌‌‌؜⁠‌؜⁠⁣⁤',
98
+ 'fabric.theme.bolder-blue': '⁣⁢Bolder blue⁡⁡‍‌‍⁠‍‌⁠⁣⁤',
99
+ 'fabric.theme.bolder-gray': '⁣⁢Bolder gray؜‍؜⁠‌⁡⁠⁣⁤',
100
+ 'fabric.theme.bolder-green': '⁣⁢Bolder green‌؜؜‍؜⁡⁡‍⁣⁤',
101
+ 'fabric.theme.bolder-magenta': '⁣⁢Bolder magenta؜‌؜⁡؜؜⁠⁣⁤',
102
+ 'fabric.theme.bolder-orange': '⁣⁢Bolder orange؜‍‌‍⁣⁤',
103
+ 'fabric.theme.bolder-purple': '⁣⁢Bolder purple؜⁠⁠⁠⁡⁡⁣⁤',
104
+ 'fabric.theme.bolder-red': '⁣⁢Bolder red‍⁡؜؜⁠؜⁠؜‍‍‍⁣⁤',
105
+ 'fabric.theme.bolder-teal': '⁣⁢Bolder teal⁡‌‌‌؜‍⁠‌‍⁡⁡⁣⁤',
106
+ 'fabric.theme.bolder-yellow': '⁣⁢Bolder yellow؜؜‍⁡⁠⁡‌‌⁡⁠⁣⁤',
86
107
  'fabric.theme.dark-blue': '⁣⁢Dark blue⁠‍⁠⁠⁠⁠‌‍⁠‍؜⁠⁡‍⁣⁤',
108
+ 'fabric.theme.dark-gray': '⁣⁢Dark gray⁡‍؜‍‌⁠؜‍‌⁡‌‌⁣⁤',
87
109
  'fabric.theme.dark-green': '⁣⁢Dark green‍‌‍⁡؜‍⁡‌‌؜⁡؜⁣⁤',
88
110
  'fabric.theme.dark-purple': '⁣⁢Dark purple⁡⁠‌؜؜⁠‍⁠؜⁣⁤',
89
111
  'fabric.theme.dark-red': '⁣⁢Dark red‌‍⁡‌‌‍‌⁡‌⁡‍⁠‌⁠⁣⁤',
90
112
  'fabric.theme.dark-teal': '⁣⁢Dark teal⁠⁠⁡⁠⁠⁠⁡⁣⁤',
91
113
  'fabric.theme.dark-yellow': '⁣⁢Dark yellow⁠‌⁠؜‌⁡؜⁣⁤',
114
+ 'fabric.theme.default': '⁣⁢Default⁡‍؜⁠‌؜⁠⁣⁤',
92
115
  'fabric.theme.gray': '⁣⁢Gray؜⁠⁡‌⁠⁡؜⁠‌؜؜؜⁡⁠⁠⁣⁤',
93
116
  'fabric.theme.green': '⁣⁢Green‍‍‌⁡⁡‍⁡⁠⁠⁣⁤',
94
117
  'fabric.theme.light-blue': '⁣⁢Light blue‍⁠⁡‌⁡؜؜‌⁡⁡⁠⁣⁤',
@@ -98,9 +121,19 @@ var _default = {
98
121
  'fabric.theme.light-red': '⁣⁢Light red‌؜‌؜‌؜⁡؜⁡⁡⁣⁤',
99
122
  'fabric.theme.light-teal': '⁣⁢Light teal‍‍‍‍‌‍⁠⁡⁣⁤',
100
123
  'fabric.theme.light-yellow': '⁣⁢Light yellow‌‌‌‌‍⁠؜⁠‍⁣⁤',
124
+ 'fabric.theme.magenta': '⁣⁢Magenta‍؜⁠؜⁡‌‍⁡‍⁠⁣⁤',
101
125
  'fabric.theme.orange': '⁣⁢Orange؜⁡‍⁠؜‍⁠⁠‍⁠⁣⁤',
102
126
  'fabric.theme.purple': '⁣⁢Purple⁠؜‍‍؜؜⁠⁠‌‌⁡⁣⁤',
103
127
  'fabric.theme.red': '⁣⁢Red‌‍؜⁡؜‍‌⁡⁡⁣⁤',
128
+ 'fabric.theme.subtle-blue': '⁣⁢Subtle blue⁡‌⁠⁡⁠⁠⁣⁤',
129
+ 'fabric.theme.subtle-gray': '⁣⁢Subtle gray‍‍‍⁡⁠‍⁠‍⁡⁠⁣⁤',
130
+ 'fabric.theme.subtle-green': '⁣⁢Subtle green؜⁡⁡‍‌؜⁡⁣⁤',
131
+ 'fabric.theme.subtle-magenta': '⁣⁢Subtle magenta‌⁡⁡⁠⁡⁠⁡؜⁠⁣⁤',
132
+ 'fabric.theme.subtle-orange': '⁣⁢Subtle orange‌⁡⁠⁡⁡⁡⁠⁣⁤',
133
+ 'fabric.theme.subtle-purple': '⁣⁢Subtle purple⁠⁠‍‍⁠‍؜⁡⁠⁡⁣⁤',
134
+ 'fabric.theme.subtle-red': '⁣⁢Subtle red⁠‌‍‌⁡‍⁣⁤',
135
+ 'fabric.theme.subtle-teal': '⁣⁢Subtle teal‍‌‍⁠⁡؜‍؜؜⁣⁤',
136
+ 'fabric.theme.subtle-yellow': '⁣⁢Subtle yellow‍‍⁡⁠⁡؜؜‌؜؜؜⁣⁤',
104
137
  'fabric.theme.teal': '⁣⁢Teal⁡⁡⁠‍؜‍‌؜⁣⁤',
105
138
  'fabric.theme.white': '⁣⁢White⁡‌‌؜⁠⁡⁠‌‌؜⁣⁤',
106
139
  'fabric.theme.yellow': '⁣⁢Yellow‌⁡⁠‍؜⁡‌‌⁠‌‌‍⁡⁠‍؜⁣⁤'
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
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 = "74.2.1";
19
+ var packageVersion = "74.3.1";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // TODO: Sanitise the URL instead of just removing it
@@ -54,11 +54,11 @@ var TableSharedCssClassName = {
54
54
  exports.TableSharedCssClassName = TableSharedCssClassName;
55
55
  var tableSharedStyle = function tableSharedStyle(props) {
56
56
  return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n .", " {\n position: relative;\n margin: 0 auto ", "px;\n box-sizing: border-box;\n\n /**\n * Fix block top alignment inside table cells.\n */\n .decisionItemView-content-wrap:first-of-type > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n clear: both;\n }\n .", " > table {\n margin: ", "px 0 0 0;\n }\n\n .", " > table,\n .", " > table {\n margin: ", "px ", "px 0 0;\n }\n\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\n border: ", "px solid\n ", ";\n table-layout: fixed;\n font-size: 1em;\n width: 100%;\n\n &[data-autosize='true'] {\n table-layout: auto;\n }\n\n & {\n * {\n box-sizing: border-box;\n }\n hr {\n box-sizing: content-box;\n }\n\n tbody {\n border-bottom: none;\n }\n th td {\n background-color: ", ";\n }\n th,\n td {\n min-width: ", "px;\n font-weight: normal;\n vertical-align: top;\n border: 1px solid\n ", ";\n border-right-width: 0;\n border-bottom-width: 0;\n padding: ", "px;\n /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n ", "\n\n ", ";\n\n > :first-child:not(style),\n > style:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + *,\n > style:first-child + .ProseMirror-gapcursor + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + *,\n > style:first-child + .ProseMirror-gapcursor + span + * {\n margin-top: 0;\n }\n\n th p:not(:first-of-type),\n td p:not(:first-of-type) {\n margin-top: 12px;\n }\n }\n th {\n background-color: ", ";\n text-align: left;\n\n /* only apply this styling to codeblocks in default background headercells */\n /* TODO this needs to be overhauled as it relies on unsafe selectors */\n &:not([style]):not(.danger) {\n .", ":not(.danger) {\n background-color: ", ";\n\n :not(.", ") {\n box-shadow: 0px 0px 0px 1px\n ", ";\n }\n\n .", " {\n background-image: ", ";\n\n background-color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n\n /* this is only relevant to the element taken care of by renderer */\n > [data-ds--code--code-block] {\n background-image: ", "!important;\n\n background-color: ", "!important;\n\n // selector lives inside @atlaskit/code\n --ds--code--line-number-bg-color: ", ";\n }\n }\n }\n }\n }\n }\n"])), (0, _tableCell.tableCellBackgroundStyleOverride)(), TableSharedCssClassName.TABLE_CONTAINER, tableMarginBottom, TableSharedCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableMarginTop, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableMarginTop, tableMarginSides, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, (0, _components.themed)({
57
- light: "var(--ds-border, ".concat(_editorSharedStyles.akEditorTableBorder, ")"),
58
- dark: "var(--ds-border, ".concat(_editorSharedStyles.akEditorTableBorderDark, ")")
57
+ light: "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"),
58
+ dark: "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorderDark, ")")
59
59
  })(props), "var(--ds-background-neutral-subtle, white)", tableCellMinWidth, (0, _components.themed)({
60
- light: "var(--ds-border, ".concat(_editorSharedStyles.akEditorTableBorder, ")"),
61
- dark: "var(--ds-border, ".concat(_editorSharedStyles.akEditorTableBorderDark, ")")
60
+ light: "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"),
61
+ dark: "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorderDark, ")")
62
62
  })(props), tableCellPadding, _browser.default.gecko || _browser.default.ie || _browser.default.mac && _browser.default.chrome ? 'background-clip: padding-box;' : '', (0, _components.themed)({
63
63
  dark: _editorSharedStyles.getTableCellBackgroundDarkModeColors
64
64
  })(props), (0, _components.themed)({
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
24
24
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
25
25
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "74.2.1";
27
+ var packageVersion = "74.3.1";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -89,9 +89,7 @@ exports.ExpandLayoutWrapperWithRef = ExpandLayoutWrapperWithRef;
89
89
  var containerStyles = function containerStyles(styleProps) {
90
90
  var expanded = styleProps.expanded,
91
91
  focused = styleProps.focused;
92
- // TODO: Migrate away from gridSize
93
- // Recommendation: Verify if this is intentional: 8 / 4 / 14 rem = 4.57px?
94
- var marginTop = "".concat((0, _constants.gridSize)() / 2 / (0, _constants.fontSize)(), "rem");
92
+ var marginTop = "var(--ds-space-050, 0.25rem)";
95
93
  var marginBottom = 0;
96
94
  // Only only these margins if the expand isn't editable
97
95
  // and is the root level expand.
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.createCompareNodes = exports.ContentType = void 0;
8
+ exports.createNormalizeTextParser = createNormalizeTextParser;
8
9
  exports.extractMetaFromTextNode = extractMetaFromTextNode;
9
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
11
  var _types = require("../types");
@@ -26,46 +27,59 @@ function getLinkMark(node) {
26
27
  linkMark = _node$marks$filter2[0];
27
28
  return linkMark || null;
28
29
  }
29
-
30
- // Source: https://stackoverflow.com/questions/12004808/does-javascript-take-local-decimal-separators-into-account
31
- function parseLocaleNumber(stringNumber) {
32
- if (stringNumber.trim() === '') {
30
+ function parseLocaleNumber(stringNumber, groupPattern, fractionPattern) {
31
+ if (!stringNumber.trim().length) {
33
32
  return null;
34
33
  }
35
- var locale = window.navigator.language;
36
- var thousandSeparator = Intl.NumberFormat(locale).format(11111).replace(/(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/g, '');
37
- var decimalSeparator = Intl.NumberFormat(locale).format(1.1).replace(/(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/g, '');
38
- var maybeANumber = Number(stringNumber.replace(new RegExp('\\' + thousandSeparator, 'g'), '').replace(new RegExp('\\' + decimalSeparator), '.'));
39
- var isANumber = !Number.isNaN(maybeANumber);
40
- if (!isANumber) {
34
+ var maybeANumber = Number.parseFloat(stringNumber.replace(groupPattern, '').replace(fractionPattern, '.'));
35
+ if (Number.isNaN(maybeANumber)) {
41
36
  return null;
42
37
  }
43
38
  return maybeANumber;
44
39
  }
45
- function extractFirstWordFromString(text) {
46
- // Firefox is the only browser that doesn't support it
47
- if (!Intl || !Intl.Segmenter) {
48
- // If the Segment API is not available
49
- // let's fallback to a dumb way to extract the first word.
50
- // However, this method doesn't cover some languages like Japanase
51
- var firstEmptySpace = text.indexOf(' ');
52
- var firstWord = firstEmptySpace !== -1 ? text.substring(0, firstEmptySpace) : text;
53
- return firstWord;
54
- }
55
- var languageSegment = new Intl.Segmenter(window.navigator.language, {
56
- granularity: 'word'
57
- });
58
- var segmentsIterator = languageSegment.segment(text);
59
- if (!segmentsIterator) {
60
- return text;
61
- }
62
- var segmentsArray = Array.from(segmentsIterator);
63
- if (segmentsArray.length === 0) {
64
- return text;
65
- }
66
- return segmentsArray[0].segment;
40
+ function createNormalizeTextParser() {
41
+ // Source: https://stackoverflow.com/questions/12004808/does-javascript-take-local-decimal-separators-into-account
42
+ var locale = window.navigator.language;
43
+ var thousandSeparator = Intl.NumberFormat(locale).format(11111).replace(/(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/g, '');
44
+ var decimalSeparator = Intl.NumberFormat(locale).format(1.1).replace(/(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/g, '');
45
+ var numericPattern = new RegExp("(\\d+(?:[".concat(thousandSeparator).concat(decimalSeparator, "]?\\d+)*)"), 'g');
46
+ var thousandSeparatorPattern = new RegExp('\\' + thousandSeparator, 'g');
47
+ var decimalSeparatorPattern = new RegExp('\\' + decimalSeparator);
48
+ return function (text) {
49
+ if (!text.trim().length) {
50
+ return null;
51
+ }
52
+
53
+ // This will break the text apart at the locations of the formatted numbers
54
+ var result = text.split(numericPattern);
55
+
56
+ // We then put the text back together but with all the formatted numbers converted back to plain numerals,
57
+ // for example a sentence like "What is 1,000.01% of 10,000.01" would be normalized and sorted as
58
+ // if it's saying "What is 1000.01% of 10000.01". This way the Intl.Collator can use the numeric setting to sort
59
+ // numeral values within string correctly.
60
+ var tokens = result.reduce(function (acc, stringNumber) {
61
+ if (!(stringNumber !== null && stringNumber !== void 0 && stringNumber.length)) {
62
+ return acc;
63
+ }
64
+ var maybeANumber = parseLocaleNumber(stringNumber, thousandSeparatorPattern, decimalSeparatorPattern);
65
+
66
+ // NOTE: We know there can only be a single decimal separator. So we can assume that if the first found separator
67
+ // is not at the same position as the last found one, then we can assume the locale used to format the number
68
+ // is different to our locale. This will result in the value being treated as a string.
69
+ if (maybeANumber !== null && stringNumber.indexOf(decimalSeparator) === stringNumber.lastIndexOf(decimalSeparator)) {
70
+ acc.push(maybeANumber);
71
+ } else {
72
+ acc.push(stringNumber);
73
+ }
74
+ return acc;
75
+ }, []);
76
+ if (tokens.length === 1) {
77
+ return tokens[0];
78
+ }
79
+ return tokens.join('');
80
+ };
67
81
  }
68
- function extractMetaFromTextNode(textNode) {
82
+ function extractMetaFromTextNode(textNode, normalizeTextParser) {
69
83
  // treat as a link if contain a link
70
84
  var linkMark = getLinkMark(textNode);
71
85
  if (linkMark) {
@@ -76,20 +90,19 @@ function extractMetaFromTextNode(textNode) {
76
90
  };
77
91
  }
78
92
  var text = textNode.text || '';
79
- var firstWord = extractFirstWordFromString(text);
80
- var maybeANumber = parseLocaleNumber(firstWord);
81
- if (maybeANumber !== null) {
93
+ var normalizedText = normalizeTextParser(text);
94
+ if (typeof normalizedText === 'number') {
82
95
  return {
83
96
  type: ContentType.NUMBER,
84
- value: maybeANumber
97
+ value: normalizedText
85
98
  };
86
99
  }
87
100
  return {
88
101
  type: ContentType.TEXT,
89
- value: firstWord
102
+ value: normalizedText !== null && normalizedText !== void 0 ? normalizedText : text
90
103
  };
91
104
  }
92
- function getMetaFromNode(node, options) {
105
+ function getMetaFromNode(node, options, normalizeTextParser) {
93
106
  if (!node) {
94
107
  return null;
95
108
  }
@@ -102,12 +115,12 @@ function getMetaFromNode(node, options) {
102
115
  /*
103
116
  Get Meta value from the first child if the cell is of type
104
117
  * Heading (Any cell where the text is set to a heading type)
105
- * Paragraph (Normal text)
118
+ * Paragraph (Normal text)
106
119
  */
107
120
  case 'heading':
108
121
  case 'paragraph':
109
122
  {
110
- return getMetaFromNode(firstChild, options);
123
+ return getMetaFromNode(firstChild, options, normalizeTextParser);
111
124
  }
112
125
  case 'inlineCard':
113
126
  {
@@ -127,14 +140,14 @@ function getMetaFromNode(node, options) {
127
140
  }
128
141
  case 'text':
129
142
  {
130
- return extractMetaFromTextNode(firstChild);
143
+ return extractMetaFromTextNode(firstChild, normalizeTextParser);
131
144
  }
132
145
  case 'status':
133
146
  {
134
- var text = firstChild.attrs.text;
147
+ var _text = firstChild.attrs.text;
135
148
  return {
136
149
  type: ContentType.STATUS,
137
- value: text
150
+ value: _text
138
151
  };
139
152
  }
140
153
  case 'date':
@@ -148,10 +161,10 @@ function getMetaFromNode(node, options) {
148
161
  case 'mention':
149
162
  {
150
163
  // TODO: Check what should be the fallback when mention does not have a text
151
- var _text = firstChild.attrs.text || '';
164
+ var _text2 = firstChild.attrs.text || '';
152
165
  return {
153
166
  type: ContentType.MENTION,
154
- value: _text.toLowerCase()
167
+ value: _text2.toLowerCase()
155
168
  };
156
169
  }
157
170
  default:
@@ -164,7 +177,8 @@ function compareValue(valueA, valueB) {
164
177
  }
165
178
  if (typeof valueA === 'string' && typeof valueB === 'string') {
166
179
  return valueA.localeCompare(valueB, window.navigator.language, {
167
- caseFirst: 'upper'
180
+ caseFirst: 'upper',
181
+ numeric: true
168
182
  });
169
183
  }
170
184
  return valueA > valueB ? 1 : -1;
@@ -196,11 +210,12 @@ function compareValue(valueA, valueB) {
196
210
  */
197
211
  var createCompareNodes = function createCompareNodes(options) {
198
212
  var order = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _types.SortOrder.ASC;
213
+ var normalizeTextParser = createNormalizeTextParser();
199
214
  return function (nodeA, nodeB) {
200
- var metaNodeA = getMetaFromNode(nodeA, options);
201
- var metaNodeB = getMetaFromNode(nodeB, options);
202
- /*
203
- Donot switch the order (Asec or Desc) if either node is null.
215
+ var metaNodeA = getMetaFromNode(nodeA, options, normalizeTextParser);
216
+ var metaNodeB = getMetaFromNode(nodeB, options, normalizeTextParser);
217
+ /*
218
+ Donot switch the order (Asec or Desc) if either node is null.
204
219
  This will ensure that empty cells are always at the bottom during sorting.
205
220
  */
206
221
  if (metaNodeA === null || metaNodeB === null) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.2.1",
3
+ "version": "74.3.1",
4
4
  "sideEffects": false
5
5
  }
@@ -9,6 +9,7 @@
9
9
  export default {
10
10
  'fabric.editor.action': '⁣⁢Action item؜‍⁠⁠؜⁡‌‍⁡‍‌⁣⁤',
11
11
  'fabric.editor.action.description': '⁣⁢Create and assign action items‌‌⁡‌⁡‌؜⁠⁡⁣⁤',
12
+ 'fabric.editor.addMediaFiles': '⁣⁢Add image, video, or file‌‍؜؜‍‍؜‍؜؜‍⁣⁤',
12
13
  'fabric.editor.alignImageCenter': '⁣⁢Align center⁡⁡‍⁠‌⁡⁠⁡⁡‌⁡⁣⁤',
13
14
  'fabric.editor.alignImageLeft': '⁣⁢Align left⁠⁠‍؜⁡⁡⁠⁡⁠‍؜‌⁡⁣⁤',
14
15
  'fabric.editor.alignImageRight': '⁣⁢Align right⁠⁠⁡؜⁡؜⁡؜؜⁣⁤',
@@ -18,6 +19,8 @@ export default {
18
19
  'fabric.editor.codeBidiWarningLabel': '⁣⁢Bidirectional characters change the order that text is rendered. This could be used to obscure malicious code.‌⁡؜‍⁠⁠‌؜‌⁣⁤',
19
20
  'fabric.editor.codeBlockCopyButton.copiedToClipboard': '⁣⁢Copied!؜⁡‌⁡‍⁡⁠‍⁡⁡⁡⁣⁤',
20
21
  'fabric.editor.codeBlockCopyButton.copyToClipboard': '⁣⁢Copy as text‍⁠‌‍؜‍‌⁡⁡‍‍⁣⁤',
22
+ 'fabric.editor.codeBlockWrapButton.unwrapCodeBlock': '⁣⁢Turn off wrap⁠‍⁠‌‌؜‌‍‍‌⁠؜⁣⁤',
23
+ 'fabric.editor.codeBlockWrapButton.wrapCodeBlock': '⁣⁢Turn on wrap⁡‍‍⁠‌‍⁡؜‍‌⁣⁤',
21
24
  'fabric.editor.collapseNode': '⁣⁢Collapse content‍⁡‌⁠؜‍‍‌؜⁠‌⁡‍⁡‌⁣⁤',
22
25
  'fabric.editor.columns': '⁣⁢Layouts⁡⁠‍⁠⁡‌⁠‍⁡⁣⁤',
23
26
  'fabric.editor.columns.description': '⁣⁢Structure your page using sections‌‍⁠⁠‍؜‍⁡⁡⁡⁣⁤',
@@ -37,8 +40,6 @@ export default {
37
40
  'fabric.editor.expandPlaceholder': '⁣⁢Give this expand a title...؜⁠⁡‍؜؜؜⁡⁣⁤',
38
41
  'fabric.editor.feedbackDialog': '⁣⁢Give feedback؜⁡؜⁠‍‌‌‍⁡⁣⁤',
39
42
  'fabric.editor.feedbackDialog.description': '⁣⁢Tell us about your experience using the new editor‌‌؜؜؜؜؜⁡‍‍‍‌⁣⁤',
40
- 'fabric.editor.filesAndImages': '⁣⁢Files & images؜⁡‌⁡⁠⁡‍‍⁡؜‌⁡؜⁠‍‌⁠‌⁣⁤',
41
- 'fabric.editor.filesAndImages.description': '⁣⁢Add images and other files to your page؜⁡‍‌‍‌؜⁠⁠؜؜⁣⁤',
42
43
  'fabric.editor.help': '⁣⁢Help⁡‌‍‌⁡‌⁠⁠‍‍⁡⁣⁤',
43
44
  'fabric.editor.help.description': '⁣⁢Browse all the keyboard shortcuts and markdown options‌⁡⁠‍⁡⁠⁣⁤',
44
45
  'fabric.editor.horizontalRule': '⁣⁢Divider‍‌⁠‌⁡‌⁡؜‌⁡‍⁠‍⁣⁤',
@@ -50,6 +51,8 @@ export default {
50
51
  'fabric.editor.layoutWide': '⁣⁢Go wide‌؜؜‍‍⁡⁡؜⁣⁤',
51
52
  'fabric.editor.link': '⁣⁢Link⁡‍⁡‍؜؜؜⁠⁠⁣⁤',
52
53
  'fabric.editor.link.description': '⁣⁢Insert a link‌⁠⁠‌؜‍؜⁠؜⁣⁤',
54
+ 'fabric.editor.mediaFiles': '⁣⁢Image, video, or file⁠‍‌؜⁠‌‍⁣⁤',
55
+ 'fabric.editor.mediaFiles.description': '⁣⁢Add images and other files to your page⁠‍‌؜؜؜‍⁠⁠⁠⁠‍⁣⁤',
53
56
  'fabric.editor.mention': '⁣⁢Mention‌؜‌⁡⁡؜⁠⁣⁤',
54
57
  'fabric.editor.mention.description': '⁣⁢Mention someone to send them a notification‍؜‌‌⁡؜‌‌؜⁠⁠؜⁣⁤',
55
58
  'fabric.editor.openLink': '⁣⁢Open link in a new tab⁠⁡⁡‌‍‌⁠‌‌⁡⁡⁣⁤',
@@ -77,12 +80,32 @@ export default {
77
80
  'fabric.editor.viewMore': '⁣⁢View more⁠⁠⁡‌‍‌‌‌؜‍‌⁣⁤',
78
81
  'fabric.editor.visit': '⁣⁢Open link in a new window⁡⁠‍⁠⁠⁡‍⁡⁣⁤',
79
82
  'fabric.theme.blue': '⁣⁢Blue‍⁠‍؜‌⁠⁡‍؜⁣⁤',
83
+ 'fabric.theme.bold-blue': '⁣⁢Bold blue⁠⁡؜؜‍‍‌‌⁠‍⁣⁤',
84
+ 'fabric.theme.bold-gray': '⁣⁢Bold gray‌⁠⁠‌⁠⁠⁡‍‌⁣⁤',
85
+ 'fabric.theme.bold-green': '⁣⁢Bold green؜⁡؜؜‌⁡‍‌⁡⁣⁤',
86
+ 'fabric.theme.bold-magenta': '⁣⁢Bold magenta‍؜‌؜⁡⁠‍⁡‌‌‍‌⁣⁤',
87
+ 'fabric.theme.bold-orange': '⁣⁢Bold orange؜⁡؜⁡⁠⁡⁡؜؜‌⁡؜‍⁣⁤',
88
+ 'fabric.theme.bold-purple': '⁣⁢Bold purple‍‌‍‌؜‍⁡؜⁠‍‌⁣⁤',
89
+ 'fabric.theme.bold-red': '⁣⁢Bold red‌؜؜⁡⁡‍⁡⁠⁣⁤',
90
+ 'fabric.theme.bold-teal': '⁣⁢Bold teal‌؜‍‍⁡⁠⁠؜⁠؜؜؜⁣⁤',
91
+ 'fabric.theme.bold-yellow': '⁣⁢Bold yellow⁠‌‌‌⁠⁠⁡⁡⁡؜‌‌‌؜⁠‌؜⁠⁣⁤',
92
+ 'fabric.theme.bolder-blue': '⁣⁢Bolder blue⁡⁡‍‌‍⁠‍‌⁠⁣⁤',
93
+ 'fabric.theme.bolder-gray': '⁣⁢Bolder gray؜‍؜⁠‌⁡⁠⁣⁤',
94
+ 'fabric.theme.bolder-green': '⁣⁢Bolder green‌؜؜‍؜⁡⁡‍⁣⁤',
95
+ 'fabric.theme.bolder-magenta': '⁣⁢Bolder magenta؜‌؜⁡؜؜⁠⁣⁤',
96
+ 'fabric.theme.bolder-orange': '⁣⁢Bolder orange؜‍‌‍⁣⁤',
97
+ 'fabric.theme.bolder-purple': '⁣⁢Bolder purple؜⁠⁠⁠⁡⁡⁣⁤',
98
+ 'fabric.theme.bolder-red': '⁣⁢Bolder red‍⁡؜؜⁠؜⁠؜‍‍‍⁣⁤',
99
+ 'fabric.theme.bolder-teal': '⁣⁢Bolder teal⁡‌‌‌؜‍⁠‌‍⁡⁡⁣⁤',
100
+ 'fabric.theme.bolder-yellow': '⁣⁢Bolder yellow؜؜‍⁡⁠⁡‌‌⁡⁠⁣⁤',
80
101
  'fabric.theme.dark-blue': '⁣⁢Dark blue⁠‍⁠⁠⁠⁠‌‍⁠‍؜⁠⁡‍⁣⁤',
102
+ 'fabric.theme.dark-gray': '⁣⁢Dark gray⁡‍؜‍‌⁠؜‍‌⁡‌‌⁣⁤',
81
103
  'fabric.theme.dark-green': '⁣⁢Dark green‍‌‍⁡؜‍⁡‌‌؜⁡؜⁣⁤',
82
104
  'fabric.theme.dark-purple': '⁣⁢Dark purple⁡⁠‌؜؜⁠‍⁠؜⁣⁤',
83
105
  'fabric.theme.dark-red': '⁣⁢Dark red‌‍⁡‌‌‍‌⁡‌⁡‍⁠‌⁠⁣⁤',
84
106
  'fabric.theme.dark-teal': '⁣⁢Dark teal⁠⁠⁡⁠⁠⁠⁡⁣⁤',
85
107
  'fabric.theme.dark-yellow': '⁣⁢Dark yellow⁠‌⁠؜‌⁡؜⁣⁤',
108
+ 'fabric.theme.default': '⁣⁢Default⁡‍؜⁠‌؜⁠⁣⁤',
86
109
  'fabric.theme.gray': '⁣⁢Gray؜⁠⁡‌⁠⁡؜⁠‌؜؜؜⁡⁠⁠⁣⁤',
87
110
  'fabric.theme.green': '⁣⁢Green‍‍‌⁡⁡‍⁡⁠⁠⁣⁤',
88
111
  'fabric.theme.light-blue': '⁣⁢Light blue‍⁠⁡‌⁡؜؜‌⁡⁡⁠⁣⁤',
@@ -92,9 +115,19 @@ export default {
92
115
  'fabric.theme.light-red': '⁣⁢Light red‌؜‌؜‌؜⁡؜⁡⁡⁣⁤',
93
116
  'fabric.theme.light-teal': '⁣⁢Light teal‍‍‍‍‌‍⁠⁡⁣⁤',
94
117
  'fabric.theme.light-yellow': '⁣⁢Light yellow‌‌‌‌‍⁠؜⁠‍⁣⁤',
118
+ 'fabric.theme.magenta': '⁣⁢Magenta‍؜⁠؜⁡‌‍⁡‍⁠⁣⁤',
95
119
  'fabric.theme.orange': '⁣⁢Orange؜⁡‍⁠؜‍⁠⁠‍⁠⁣⁤',
96
120
  'fabric.theme.purple': '⁣⁢Purple⁠؜‍‍؜؜⁠⁠‌‌⁡⁣⁤',
97
121
  'fabric.theme.red': '⁣⁢Red‌‍؜⁡؜‍‌⁡⁡⁣⁤',
122
+ 'fabric.theme.subtle-blue': '⁣⁢Subtle blue⁡‌⁠⁡⁠⁠⁣⁤',
123
+ 'fabric.theme.subtle-gray': '⁣⁢Subtle gray‍‍‍⁡⁠‍⁠‍⁡⁠⁣⁤',
124
+ 'fabric.theme.subtle-green': '⁣⁢Subtle green؜⁡⁡‍‌؜⁡⁣⁤',
125
+ 'fabric.theme.subtle-magenta': '⁣⁢Subtle magenta‌⁡⁡⁠⁡⁠⁡؜⁠⁣⁤',
126
+ 'fabric.theme.subtle-orange': '⁣⁢Subtle orange‌⁡⁠⁡⁡⁡⁠⁣⁤',
127
+ 'fabric.theme.subtle-purple': '⁣⁢Subtle purple⁠⁠‍‍⁠‍؜⁡⁠⁡⁣⁤',
128
+ 'fabric.theme.subtle-red': '⁣⁢Subtle red⁠‌‍‌⁡‍⁣⁤',
129
+ 'fabric.theme.subtle-teal': '⁣⁢Subtle teal‍‌‍⁠⁡؜‍؜؜⁣⁤',
130
+ 'fabric.theme.subtle-yellow': '⁣⁢Subtle yellow‍‍⁡⁠⁡؜؜‌؜؜؜⁣⁤',
98
131
  'fabric.theme.teal': '⁣⁢Teal⁡⁡⁠‍؜‍‌؜⁣⁤',
99
132
  'fabric.theme.white': '⁣⁢White⁡‌‌؜⁠⁡⁠‌‌؜⁣⁤',
100
133
  'fabric.theme.yellow': '⁣⁢Yellow‌⁡⁠‍؜⁡‌‌⁠‌‌‍⁡⁠‍؜⁣⁤'
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "74.2.1";
3
+ const packageVersion = "74.3.1";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -68,8 +68,8 @@ const tableSharedStyle = props => css`
68
68
  border-collapse: collapse;
69
69
  border: ${tableCellBorderWidth}px solid
70
70
  ${themed({
71
- light: `var(--ds-border, ${akEditorTableBorder})`,
72
- dark: `var(--ds-border, ${akEditorTableBorderDark})`
71
+ light: `var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`,
72
+ dark: `var(--ds-background-accent-gray-subtler, ${akEditorTableBorderDark})`
73
73
  })(props)};
74
74
  table-layout: fixed;
75
75
  font-size: 1em;
@@ -100,8 +100,8 @@ const tableSharedStyle = props => css`
100
100
  vertical-align: top;
101
101
  border: 1px solid
102
102
  ${themed({
103
- light: `var(--ds-border, ${akEditorTableBorder})`,
104
- dark: `var(--ds-border, ${akEditorTableBorderDark})`
103
+ light: `var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`,
104
+ dark: `var(--ds-background-accent-gray-subtler, ${akEditorTableBorderDark})`
105
105
  })(props)};
106
106
  border-right-width: 0;
107
107
  border-bottom-width: 0;
@@ -8,7 +8,7 @@ import { themed } from '@atlaskit/theme/components';
8
8
  import { borderRadius } from '@atlaskit/theme/constants';
9
9
  import Layer from '../Layer';
10
10
  const packageName = "@atlaskit/editor-common";
11
- const packageVersion = "74.2.1";
11
+ const packageVersion = "74.3.1";
12
12
  const halfFocusRing = 1;
13
13
  const dropOffset = '0, 8';
14
14
  class DropList extends Component {
@@ -94,9 +94,7 @@ const containerStyles = styleProps => {
94
94
  expanded,
95
95
  focused
96
96
  } = styleProps;
97
- // TODO: Migrate away from gridSize
98
- // Recommendation: Verify if this is intentional: 8 / 4 / 14 rem = 4.57px?
99
- const marginTop = `${gridSize() / 2 / fontSize()}rem`;
97
+ const marginTop = "var(--ds-space-050, 0.25rem)";
100
98
  const marginBottom = 0;
101
99
  // Only only these margins if the expand isn't editable
102
100
  // and is the root level expand.