@atlaskit/editor-common 111.8.8 → 111.8.10

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,21 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 111.8.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2c3c92548bb9c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2c3c92548bb9c) -
8
+ EDITOR-4639 cleanup cc_editor_limited_mode, cc_editor_limited_mode_include_lcm and unshipped code.
9
+ - Updated dependencies
10
+
11
+ ## 111.8.9
12
+
13
+ ### Patch Changes
14
+
15
+ - [`33f11753a7104`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/33f11753a7104) -
16
+ [ux] Added i18n for sections' titles in the Turn into menu.
17
+ - Updated dependencies
18
+
3
19
  ## 111.8.8
4
20
 
5
21
  ### Patch Changes
@@ -90,5 +90,25 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
90
90
  id: 'fabric.editor.block.menu.wrap.icon',
91
91
  defaultMessage: 'Wrap',
92
92
  description: 'Aria label for the wrap icon in code block toolbar'
93
+ },
94
+ create: {
95
+ id: 'fabric.editor.block.menu.create',
96
+ defaultMessage: 'Create',
97
+ description: 'Menu section title'
98
+ },
99
+ headings: {
100
+ id: 'fabric.editor.block.menu.headings',
101
+ defaultMessage: 'Headings',
102
+ description: 'Menu section title'
103
+ },
104
+ suggested: {
105
+ id: 'fabric.editor.block.menu.suggested',
106
+ defaultMessage: 'Suggested',
107
+ description: 'Menu section title'
108
+ },
109
+ structure: {
110
+ id: 'fabric.editor.block.menu.structure',
111
+ defaultMessage: 'Structure',
112
+ description: 'Menu section title'
93
113
  }
94
114
  });
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
19
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
20
20
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
21
21
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
22
- var packageVersion = "111.8.7";
22
+ var packageVersion = "0.0.0-development";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -9,7 +9,6 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
- var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
13
12
  var _utils = require("../utils");
14
13
  var _dynamicBitArray = require("./dynamic-bit-array");
15
14
  var NodeAnchorProvider = exports.NodeAnchorProvider = /*#__PURE__*/function () {
@@ -85,31 +84,20 @@ var NodeAnchorProvider = exports.NodeAnchorProvider = /*#__PURE__*/function () {
85
84
  }]);
86
85
  }();
87
86
  var nodeIdProviderMap = new WeakMap();
87
+ var LIMITED_MODE_NODE_SIZE_THRESHOLD = 40000;
88
88
 
89
89
  // This is duplicate from the limited mode plugin to avoid circular dependency
90
90
  // We can refactor this later to have a shared util package
91
91
  var isLimitedModeEnabled = function isLimitedModeEnabled(editorView) {
92
- var nodeSizeLimit = (0, _expVal.expVal)('cc_editor_limited_mode', 'nodeSize', 100);
93
- var limitedMode = false;
94
- // some tests have nodeSizeLimit as boolean
95
- if (typeof nodeSizeLimit === 'number') {
96
- // duplicate logic from limited mode plugin to determine if we're in limited mode
97
- // @ts-expect-error - true is not allowed as a default value
98
- if ((0, _expVal.expVal)('cc_editor_limited_mode_include_lcm', 'isEnabled', true)) {
99
- var customDocSize = editorView.state.doc.nodeSize;
100
- editorView.state.doc.descendants(function (node) {
101
- var _node$attrs;
102
- if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
103
- var _node$attrs$parameter, _node$attrs2;
104
- customDocSize += (_node$attrs$parameter = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.parameters) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.adf) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.length) !== null && _node$attrs$parameter !== void 0 ? _node$attrs$parameter : 0;
105
- }
106
- });
107
- limitedMode = customDocSize > nodeSizeLimit;
108
- } else {
109
- limitedMode = editorView.state.doc.nodeSize > nodeSizeLimit;
92
+ var customDocSize = editorView.state.doc.nodeSize;
93
+ editorView.state.doc.descendants(function (node) {
94
+ var _node$attrs;
95
+ if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
96
+ var _node$attrs$parameter, _node$attrs2;
97
+ customDocSize += (_node$attrs$parameter = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.parameters) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.adf) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.length) !== null && _node$attrs$parameter !== void 0 ? _node$attrs$parameter : 0;
110
98
  }
111
- }
112
- return limitedMode;
99
+ });
100
+ return customDocSize > LIMITED_MODE_NODE_SIZE_THRESHOLD;
113
101
  };
114
102
 
115
103
  // Get the NodeIdProvider for a specific EditorView instance.
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "111.8.7";
27
+ var packageVersion = "0.0.0-development";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -84,5 +84,25 @@ export const messages = defineMessages({
84
84
  id: 'fabric.editor.block.menu.wrap.icon',
85
85
  defaultMessage: 'Wrap',
86
86
  description: 'Aria label for the wrap icon in code block toolbar'
87
+ },
88
+ create: {
89
+ id: 'fabric.editor.block.menu.create',
90
+ defaultMessage: 'Create',
91
+ description: 'Menu section title'
92
+ },
93
+ headings: {
94
+ id: 'fabric.editor.block.menu.headings',
95
+ defaultMessage: 'Headings',
96
+ description: 'Menu section title'
97
+ },
98
+ suggested: {
99
+ id: 'fabric.editor.block.menu.suggested',
100
+ defaultMessage: 'Suggested',
101
+ description: 'Menu section title'
102
+ },
103
+ structure: {
104
+ id: 'fabric.editor.block.menu.structure',
105
+ defaultMessage: 'Structure',
106
+ description: 'Menu section title'
87
107
  }
88
108
  });
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
4
4
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
5
5
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
6
6
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
7
- const packageVersion = "111.8.7";
7
+ const packageVersion = "0.0.0-development";
8
8
  const sanitiseSentryEvents = (data, _hint) => {
9
9
  // Remove URL as it has UGC
10
10
  // Ignored via go/ees007
@@ -1,6 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
- import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
4
3
  import { isEmptyDocument } from '../utils';
5
4
  import { DynamicBitArray } from './dynamic-bit-array';
6
5
  export class NodeAnchorProvider {
@@ -60,31 +59,20 @@ export class NodeAnchorProvider {
60
59
  }
61
60
  }
62
61
  const nodeIdProviderMap = new WeakMap();
62
+ const LIMITED_MODE_NODE_SIZE_THRESHOLD = 40000;
63
63
 
64
64
  // This is duplicate from the limited mode plugin to avoid circular dependency
65
65
  // We can refactor this later to have a shared util package
66
66
  const isLimitedModeEnabled = editorView => {
67
- const nodeSizeLimit = expVal('cc_editor_limited_mode', 'nodeSize', 100);
68
- let limitedMode = false;
69
- // some tests have nodeSizeLimit as boolean
70
- if (typeof nodeSizeLimit === 'number') {
71
- // duplicate logic from limited mode plugin to determine if we're in limited mode
72
- // @ts-expect-error - true is not allowed as a default value
73
- if (expVal('cc_editor_limited_mode_include_lcm', 'isEnabled', true)) {
74
- let customDocSize = editorView.state.doc.nodeSize;
75
- editorView.state.doc.descendants(node => {
76
- var _node$attrs;
77
- if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
78
- var _node$attrs$parameter, _node$attrs2, _node$attrs2$paramete, _node$attrs2$paramete2;
79
- customDocSize += (_node$attrs$parameter = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : (_node$attrs2$paramete = _node$attrs2.parameters) === null || _node$attrs2$paramete === void 0 ? void 0 : (_node$attrs2$paramete2 = _node$attrs2$paramete.adf) === null || _node$attrs2$paramete2 === void 0 ? void 0 : _node$attrs2$paramete2.length) !== null && _node$attrs$parameter !== void 0 ? _node$attrs$parameter : 0;
80
- }
81
- });
82
- limitedMode = customDocSize > nodeSizeLimit;
83
- } else {
84
- limitedMode = editorView.state.doc.nodeSize > nodeSizeLimit;
67
+ let customDocSize = editorView.state.doc.nodeSize;
68
+ editorView.state.doc.descendants(node => {
69
+ var _node$attrs;
70
+ if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
71
+ var _node$attrs$parameter, _node$attrs2, _node$attrs2$paramete, _node$attrs2$paramete2;
72
+ customDocSize += (_node$attrs$parameter = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : (_node$attrs2$paramete = _node$attrs2.parameters) === null || _node$attrs2$paramete === void 0 ? void 0 : (_node$attrs2$paramete2 = _node$attrs2$paramete.adf) === null || _node$attrs2$paramete2 === void 0 ? void 0 : _node$attrs2$paramete2.length) !== null && _node$attrs$parameter !== void 0 ? _node$attrs$parameter : 0;
85
73
  }
86
- }
87
- return limitedMode;
74
+ });
75
+ return customDocSize > LIMITED_MODE_NODE_SIZE_THRESHOLD;
88
76
  };
89
77
 
90
78
  // Get the NodeIdProvider for a specific EditorView instance.
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "111.8.7";
17
+ const packageVersion = "0.0.0-development";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -84,5 +84,25 @@ export var messages = defineMessages({
84
84
  id: 'fabric.editor.block.menu.wrap.icon',
85
85
  defaultMessage: 'Wrap',
86
86
  description: 'Aria label for the wrap icon in code block toolbar'
87
+ },
88
+ create: {
89
+ id: 'fabric.editor.block.menu.create',
90
+ defaultMessage: 'Create',
91
+ description: 'Menu section title'
92
+ },
93
+ headings: {
94
+ id: 'fabric.editor.block.menu.headings',
95
+ defaultMessage: 'Headings',
96
+ description: 'Menu section title'
97
+ },
98
+ suggested: {
99
+ id: 'fabric.editor.block.menu.suggested',
100
+ defaultMessage: 'Suggested',
101
+ description: 'Menu section title'
102
+ },
103
+ structure: {
104
+ id: 'fabric.editor.block.menu.structure',
105
+ defaultMessage: 'Structure',
106
+ description: 'Menu section title'
87
107
  }
88
108
  });
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
10
10
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
11
11
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
12
12
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
13
- var packageVersion = "111.8.7";
13
+ var packageVersion = "0.0.0-development";
14
14
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
15
15
  // Remove URL as it has UGC
16
16
  // Ignored via go/ees007
@@ -2,7 +2,6 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import { fg } from '@atlaskit/platform-feature-flags';
5
- import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
6
5
  import { isEmptyDocument } from '../utils';
7
6
  import { DynamicBitArray } from './dynamic-bit-array';
8
7
  export var NodeAnchorProvider = /*#__PURE__*/function () {
@@ -78,31 +77,20 @@ export var NodeAnchorProvider = /*#__PURE__*/function () {
78
77
  }]);
79
78
  }();
80
79
  var nodeIdProviderMap = new WeakMap();
80
+ var LIMITED_MODE_NODE_SIZE_THRESHOLD = 40000;
81
81
 
82
82
  // This is duplicate from the limited mode plugin to avoid circular dependency
83
83
  // We can refactor this later to have a shared util package
84
84
  var isLimitedModeEnabled = function isLimitedModeEnabled(editorView) {
85
- var nodeSizeLimit = expVal('cc_editor_limited_mode', 'nodeSize', 100);
86
- var limitedMode = false;
87
- // some tests have nodeSizeLimit as boolean
88
- if (typeof nodeSizeLimit === 'number') {
89
- // duplicate logic from limited mode plugin to determine if we're in limited mode
90
- // @ts-expect-error - true is not allowed as a default value
91
- if (expVal('cc_editor_limited_mode_include_lcm', 'isEnabled', true)) {
92
- var customDocSize = editorView.state.doc.nodeSize;
93
- editorView.state.doc.descendants(function (node) {
94
- var _node$attrs;
95
- if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
96
- var _node$attrs$parameter, _node$attrs2;
97
- customDocSize += (_node$attrs$parameter = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.parameters) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.adf) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.length) !== null && _node$attrs$parameter !== void 0 ? _node$attrs$parameter : 0;
98
- }
99
- });
100
- limitedMode = customDocSize > nodeSizeLimit;
101
- } else {
102
- limitedMode = editorView.state.doc.nodeSize > nodeSizeLimit;
85
+ var customDocSize = editorView.state.doc.nodeSize;
86
+ editorView.state.doc.descendants(function (node) {
87
+ var _node$attrs;
88
+ if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
89
+ var _node$attrs$parameter, _node$attrs2;
90
+ customDocSize += (_node$attrs$parameter = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.parameters) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.adf) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.length) !== null && _node$attrs$parameter !== void 0 ? _node$attrs$parameter : 0;
103
91
  }
104
- }
105
- return limitedMode;
92
+ });
93
+ return customDocSize > LIMITED_MODE_NODE_SIZE_THRESHOLD;
106
94
  };
107
95
 
108
96
  // Get the NodeIdProvider for a specific EditorView instance.
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "111.8.7";
24
+ var packageVersion = "0.0.0-development";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -84,4 +84,24 @@ export declare const messages: {
84
84
  defaultMessage: string;
85
85
  description: string;
86
86
  };
87
+ create: {
88
+ id: string;
89
+ defaultMessage: string;
90
+ description: string;
91
+ };
92
+ headings: {
93
+ id: string;
94
+ defaultMessage: string;
95
+ description: string;
96
+ };
97
+ suggested: {
98
+ id: string;
99
+ defaultMessage: string;
100
+ description: string;
101
+ };
102
+ structure: {
103
+ id: string;
104
+ defaultMessage: string;
105
+ description: string;
106
+ };
87
107
  };
@@ -84,4 +84,24 @@ export declare const messages: {
84
84
  defaultMessage: string;
85
85
  description: string;
86
86
  };
87
+ create: {
88
+ id: string;
89
+ defaultMessage: string;
90
+ description: string;
91
+ };
92
+ headings: {
93
+ id: string;
94
+ defaultMessage: string;
95
+ description: string;
96
+ };
97
+ suggested: {
98
+ id: string;
99
+ defaultMessage: string;
100
+ description: string;
101
+ };
102
+ structure: {
103
+ id: string;
104
+ defaultMessage: string;
105
+ description: string;
106
+ };
87
107
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "111.8.8",
3
+ "version": "111.8.10",
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/"
@@ -74,14 +74,14 @@
74
74
  "@atlaskit/prosemirror-history": "^0.2.0",
75
75
  "@atlaskit/react-ufo": "^5.0.0",
76
76
  "@atlaskit/section-message": "^8.12.0",
77
- "@atlaskit/smart-card": "^43.21.0",
77
+ "@atlaskit/smart-card": "^43.22.0",
78
78
  "@atlaskit/smart-user-picker": "^8.9.0",
79
79
  "@atlaskit/spinner": "^19.0.0",
80
80
  "@atlaskit/status": "^3.1.0",
81
81
  "@atlaskit/task-decision": "^19.2.0",
82
82
  "@atlaskit/textfield": "^8.2.0",
83
83
  "@atlaskit/theme": "^21.0.0",
84
- "@atlaskit/tmp-editor-statsig": "^16.28.0",
84
+ "@atlaskit/tmp-editor-statsig": "^16.29.0",
85
85
  "@atlaskit/tokens": "^10.1.0",
86
86
  "@atlaskit/tooltip": "^20.14.0",
87
87
  "@atlaskit/width-detector": "^5.0.0",
@@ -120,6 +120,7 @@
120
120
  },
121
121
  "devDependencies": {
122
122
  "@atlaskit/media-core": "^37.0.0",
123
+ "@atlassian/a11y-jest-testing": "^0.7.0",
123
124
  "@testing-library/dom": "^10.1.0",
124
125
  "@testing-library/jest-dom": "^6.4.5",
125
126
  "@testing-library/react": "^16.3.0",