@atlaskit/editor-common 93.2.4 → 93.3.0

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,26 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 93.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#151190](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/151190)
8
+ [`a3723b1cdede2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a3723b1cdede2) -
9
+ [ux] [ED-25037] this change bumps @atlaskit/adf-schema from 40.9.0 to 40.9.4 which makes the
10
+ blockquote selectable, adds missing marks to the PM node spec and fixes a bug that converted
11
+ pasted external images to media groups.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
17
+ ## 93.2.5
18
+
19
+ ### Patch Changes
20
+
21
+ - [`3bfc9e68e4668`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3bfc9e68e4668) -
22
+ add a helper to switch component based on feature flag value
23
+
3
24
  ## 93.2.4
4
25
 
5
26
  ### Patch Changes
@@ -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 && {}.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 = "93.2.4";
20
+ var packageVersion = "93.3.0";
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
@@ -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 = "93.2.4";
27
+ var packageVersion = "93.3.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1118,6 +1118,12 @@ Object.defineProperty(exports, "walkUpTreeUntil", {
1118
1118
  return _dom.walkUpTreeUntil;
1119
1119
  }
1120
1120
  });
1121
+ Object.defineProperty(exports, "withFeatureFlaggedComponent", {
1122
+ enumerable: true,
1123
+ get: function get() {
1124
+ return _withFeatureFlaggedComponent.withFeatureFlaggedComponent;
1125
+ }
1126
+ });
1121
1127
  Object.defineProperty(exports, "withImageLoader", {
1122
1128
  enumerable: true,
1123
1129
  get: function get() {
@@ -1190,6 +1196,7 @@ var _wrapSelectionIn = require("./wrap-selection-in");
1190
1196
  var _calculateToolbarPosition = require("./calculate-toolbar-position");
1191
1197
  var _nodesByLocalIds = require("./nodes-by-localIds");
1192
1198
  var _pageElementCounts = require("./page-element-counts");
1199
+ var _withFeatureFlaggedComponent = require("./withFeatureFlaggedComponent");
1193
1200
  /**
1194
1201
  * @private
1195
1202
  * @deprecated
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.withFeatureFlaggedComponent = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ /**
10
+ * This function is used to switch between two components based on a feature flag
11
+ * @param ComponentOld
12
+ * @param ComponentNext
13
+ * @param featureFlagFn function that returns a boolean value to switch to the next component, e.g. () => fg('platform_editor_react18_phase2')
14
+ * @returns
15
+ */
16
+ var withFeatureFlaggedComponent = exports.withFeatureFlaggedComponent = function withFeatureFlaggedComponent(ComponentOld, ComponentNext, featureFlagFn) {
17
+ return function (props) {
18
+ return featureFlagFn() ? /*#__PURE__*/_react.default.createElement(ComponentNext, props) : /*#__PURE__*/_react.default.createElement(ComponentOld, props);
19
+ };
20
+ };
@@ -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 = "93.2.4";
4
+ const packageVersion = "93.3.0";
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
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "93.2.4";
16
+ const packageVersion = "93.3.0";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  class DropList extends Component {
@@ -348,4 +348,5 @@ export { wrapSelectionIn } from './wrap-selection-in';
348
348
  export { toJSON, nodeToJSON } from './nodes';
349
349
  export { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead } from './calculate-toolbar-position';
350
350
  export { findNodePosByLocalIds } from './nodes-by-localIds';
351
- export { getPageElementCounts } from './page-element-counts';
351
+ export { getPageElementCounts } from './page-element-counts';
352
+ export { withFeatureFlaggedComponent } from './withFeatureFlaggedComponent';
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * This function is used to switch between two components based on a feature flag
5
+ * @param ComponentOld
6
+ * @param ComponentNext
7
+ * @param featureFlagFn function that returns a boolean value to switch to the next component, e.g. () => fg('platform_editor_react18_phase2')
8
+ * @returns
9
+ */
10
+ export const withFeatureFlaggedComponent = (ComponentOld, ComponentNext, featureFlagFn) => {
11
+ return props => {
12
+ return featureFlagFn() ? /*#__PURE__*/React.createElement(ComponentNext, props) : /*#__PURE__*/React.createElement(ComponentOld, props);
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 = "93.2.4";
10
+ var packageVersion = "93.3.0";
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
@@ -21,7 +21,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
21
21
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "93.2.4";
24
+ var packageVersion = "93.3.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var DropList = /*#__PURE__*/function (_Component) {
@@ -351,4 +351,5 @@ export { wrapSelectionIn } from './wrap-selection-in';
351
351
  export { toJSON, nodeToJSON } from './nodes';
352
352
  export { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead } from './calculate-toolbar-position';
353
353
  export { findNodePosByLocalIds } from './nodes-by-localIds';
354
- export { getPageElementCounts } from './page-element-counts';
354
+ export { getPageElementCounts } from './page-element-counts';
355
+ export { withFeatureFlaggedComponent } from './withFeatureFlaggedComponent';
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * This function is used to switch between two components based on a feature flag
5
+ * @param ComponentOld
6
+ * @param ComponentNext
7
+ * @param featureFlagFn function that returns a boolean value to switch to the next component, e.g. () => fg('platform_editor_react18_phase2')
8
+ * @returns
9
+ */
10
+ export var withFeatureFlaggedComponent = function withFeatureFlaggedComponent(ComponentOld, ComponentNext, featureFlagFn) {
11
+ return function (props) {
12
+ return featureFlagFn() ? /*#__PURE__*/React.createElement(ComponentNext, props) : /*#__PURE__*/React.createElement(ComponentOld, props);
13
+ };
14
+ };
@@ -214,3 +214,4 @@ export { toJSON, nodeToJSON } from './nodes';
214
214
  export { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead, } from './calculate-toolbar-position';
215
215
  export { findNodePosByLocalIds } from './nodes-by-localIds';
216
216
  export { getPageElementCounts } from './page-element-counts';
217
+ export { withFeatureFlaggedComponent } from './withFeatureFlaggedComponent';
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ /**
3
+ * This function is used to switch between two components based on a feature flag
4
+ * @param ComponentOld
5
+ * @param ComponentNext
6
+ * @param featureFlagFn function that returns a boolean value to switch to the next component, e.g. () => fg('platform_editor_react18_phase2')
7
+ * @returns
8
+ */
9
+ export declare const withFeatureFlaggedComponent: <P extends object>(ComponentOld: React.ComponentType<P>, ComponentNext: React.ComponentType<P>, featureFlagFn: () => boolean) => (props: P) => JSX.Element;
@@ -214,3 +214,4 @@ export { toJSON, nodeToJSON } from './nodes';
214
214
  export { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead, } from './calculate-toolbar-position';
215
215
  export { findNodePosByLocalIds } from './nodes-by-localIds';
216
216
  export { getPageElementCounts } from './page-element-counts';
217
+ export { withFeatureFlaggedComponent } from './withFeatureFlaggedComponent';
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ /**
3
+ * This function is used to switch between two components based on a feature flag
4
+ * @param ComponentOld
5
+ * @param ComponentNext
6
+ * @param featureFlagFn function that returns a boolean value to switch to the next component, e.g. () => fg('platform_editor_react18_phase2')
7
+ * @returns
8
+ */
9
+ export declare const withFeatureFlaggedComponent: <P extends object>(ComponentOld: React.ComponentType<P>, ComponentNext: React.ComponentType<P>, featureFlagFn: () => boolean) => (props: P) => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "93.2.4",
3
+ "version": "93.3.0",
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/"
@@ -109,8 +109,8 @@
109
109
  },
110
110
  "dependencies": {
111
111
  "@atlaskit/activity-provider": "^2.4.0",
112
- "@atlaskit/adf-schema": "^40.9.0",
113
- "@atlaskit/adf-utils": "^19.8.0",
112
+ "@atlaskit/adf-schema": "^40.9.4",
113
+ "@atlaskit/adf-utils": "^19.9.0",
114
114
  "@atlaskit/analytics-listeners": "^8.11.0",
115
115
  "@atlaskit/analytics-namespaced-context": "^6.12.0",
116
116
  "@atlaskit/analytics-next": "^10.1.0",
@@ -118,9 +118,9 @@
118
118
  "@atlaskit/button": "^20.2.0",
119
119
  "@atlaskit/code": "^15.6.0",
120
120
  "@atlaskit/codemod-utils": "^4.2.0",
121
- "@atlaskit/custom-steps": "^0.7.0",
121
+ "@atlaskit/custom-steps": "^0.8.0",
122
122
  "@atlaskit/dropdown-menu": "^12.19.0",
123
- "@atlaskit/editor-json-transformer": "^8.18.0",
123
+ "@atlaskit/editor-json-transformer": "^8.19.0",
124
124
  "@atlaskit/editor-palette": "1.6.1",
125
125
  "@atlaskit/editor-prosemirror": "6.0.0",
126
126
  "@atlaskit/editor-shared-styles": "^3.0.0",
@@ -128,7 +128,7 @@
128
128
  "@atlaskit/emoji": "^67.8.0",
129
129
  "@atlaskit/icon": "^22.22.0",
130
130
  "@atlaskit/icon-object": "^6.5.0",
131
- "@atlaskit/link-datasource": "^3.5.0",
131
+ "@atlaskit/link-datasource": "^3.6.0",
132
132
  "@atlaskit/link-picker": "^1.47.0",
133
133
  "@atlaskit/media-card": "^78.5.0",
134
134
  "@atlaskit/media-client": "^28.0.0",