@atlaskit/editor-common 74.7.1 → 74.7.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 74.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b9c2562b357`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b9c2562b357) - Mark WithPluginState as deprecated.
8
+
3
9
  ## 74.7.1
4
10
 
5
11
  ### Patch Changes
@@ -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.7.1";
19
+ var packageVersion = "74.7.2";
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
@@ -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.7.1";
27
+ var packageVersion = "74.7.2";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.7.1",
3
+ "version": "74.7.2",
4
4
  "sideEffects": false
5
5
  }
@@ -30,20 +30,40 @@ var DEFAULT_SLOW_THRESHOLD = 4;
30
30
  // - EditorAction: packages/editor/editor-core/src/actions/index.ts
31
31
  // - EditorSharedConfig: packages/editor/editor-core/src/labs/next/internal/context/shared-config.tsx
32
32
  /**
33
- * Wraps component in a high order component that watches state changes of given plugins
34
- * and passes those states to the wrapped component.
33
+ * @private
34
+ * @deprecated
35
35
  *
36
- * Example:
36
+ * Using this component is deprecated. It should be replaced with `useSharedPluginState`.
37
+ * This requires having access to the injection API from the plugin itself.
38
+ *
39
+ * An example of the refactor with the new hook (using hyperlink as an example) is:
40
+ *
41
+ * Before:
42
+ * ```ts
37
43
  * <WithPluginState
38
- * eventDispatcher={eventDispatcher}
39
44
  * editorView={editorView}
40
45
  * plugins={{
41
- * hyperlink: hyperlinkPluginKey
46
+ * hyperlinkState: hyperlinkPluginKey
42
47
  * }}
43
- * render={renderComponent}
48
+ * render={({ hyperlinkState }) =>
49
+ * renderComponent({ hyperlinkState })
50
+ * }
44
51
  * />
52
+ * ```
53
+ *
54
+ * After:
55
+ * ```ts
56
+ * import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
57
+ * import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
58
+ *
59
+ * function ComponentWithState(
60
+ * api: ExtractInjectionAPI<typeof hyperlinkPlugin> | undefined
61
+ * ) {
62
+ * const { hyperlinkState } = useSharedPluginState(api, ['hyperlink']);
63
+ * return renderComponent({ hyperlinkState })
64
+ * }
65
+ * ```
45
66
  *
46
- * renderComponent: ({ hyperlink }) => React.Component;
47
67
  */
48
68
  var WithPluginState = /*#__PURE__*/function (_React$Component) {
49
69
  (0, _inherits2.default)(WithPluginState, _React$Component);
@@ -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.7.1";
3
+ const packageVersion = "74.7.2";
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
@@ -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.7.1";
11
+ const packageVersion = "74.7.2";
12
12
  const halfFocusRing = 1;
13
13
  const dropOffset = '0, 8';
14
14
  class DropList extends Component {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.7.1",
3
+ "version": "74.7.2",
4
4
  "sideEffects": false
5
5
  }
@@ -13,20 +13,40 @@ const DEFAULT_SLOW_THRESHOLD = 4;
13
13
  // - EditorAction: packages/editor/editor-core/src/actions/index.ts
14
14
  // - EditorSharedConfig: packages/editor/editor-core/src/labs/next/internal/context/shared-config.tsx
15
15
  /**
16
- * Wraps component in a high order component that watches state changes of given plugins
17
- * and passes those states to the wrapped component.
16
+ * @private
17
+ * @deprecated
18
18
  *
19
- * Example:
19
+ * Using this component is deprecated. It should be replaced with `useSharedPluginState`.
20
+ * This requires having access to the injection API from the plugin itself.
21
+ *
22
+ * An example of the refactor with the new hook (using hyperlink as an example) is:
23
+ *
24
+ * Before:
25
+ * ```ts
20
26
  * <WithPluginState
21
- * eventDispatcher={eventDispatcher}
22
27
  * editorView={editorView}
23
28
  * plugins={{
24
- * hyperlink: hyperlinkPluginKey
29
+ * hyperlinkState: hyperlinkPluginKey
25
30
  * }}
26
- * render={renderComponent}
31
+ * render={({ hyperlinkState }) =>
32
+ * renderComponent({ hyperlinkState })
33
+ * }
27
34
  * />
35
+ * ```
36
+ *
37
+ * After:
38
+ * ```ts
39
+ * import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
40
+ * import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
41
+ *
42
+ * function ComponentWithState(
43
+ * api: ExtractInjectionAPI<typeof hyperlinkPlugin> | undefined
44
+ * ) {
45
+ * const { hyperlinkState } = useSharedPluginState(api, ['hyperlink']);
46
+ * return renderComponent({ hyperlinkState })
47
+ * }
48
+ * ```
28
49
  *
29
- * renderComponent: ({ hyperlink }) => React.Component;
30
50
  */
31
51
  class WithPluginState extends React.Component {
32
52
  constructor(...args) {
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
8
8
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
9
- var packageVersion = "74.7.1";
9
+ var packageVersion = "74.7.2";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // TODO: Sanitise the URL instead of just removing it
@@ -18,7 +18,7 @@ import { themed } from '@atlaskit/theme/components';
18
18
  import { borderRadius } from '@atlaskit/theme/constants';
19
19
  import Layer from '../Layer';
20
20
  var packageName = "@atlaskit/editor-common";
21
- var packageVersion = "74.7.1";
21
+ var packageVersion = "74.7.2";
22
22
  var halfFocusRing = 1;
23
23
  var dropOffset = '0, 8';
24
24
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.7.1",
3
+ "version": "74.7.2",
4
4
  "sideEffects": false
5
5
  }
@@ -23,20 +23,40 @@ var DEFAULT_SLOW_THRESHOLD = 4;
23
23
  // - EditorAction: packages/editor/editor-core/src/actions/index.ts
24
24
  // - EditorSharedConfig: packages/editor/editor-core/src/labs/next/internal/context/shared-config.tsx
25
25
  /**
26
- * Wraps component in a high order component that watches state changes of given plugins
27
- * and passes those states to the wrapped component.
26
+ * @private
27
+ * @deprecated
28
28
  *
29
- * Example:
29
+ * Using this component is deprecated. It should be replaced with `useSharedPluginState`.
30
+ * This requires having access to the injection API from the plugin itself.
31
+ *
32
+ * An example of the refactor with the new hook (using hyperlink as an example) is:
33
+ *
34
+ * Before:
35
+ * ```ts
30
36
  * <WithPluginState
31
- * eventDispatcher={eventDispatcher}
32
37
  * editorView={editorView}
33
38
  * plugins={{
34
- * hyperlink: hyperlinkPluginKey
39
+ * hyperlinkState: hyperlinkPluginKey
35
40
  * }}
36
- * render={renderComponent}
41
+ * render={({ hyperlinkState }) =>
42
+ * renderComponent({ hyperlinkState })
43
+ * }
37
44
  * />
45
+ * ```
46
+ *
47
+ * After:
48
+ * ```ts
49
+ * import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
50
+ * import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
51
+ *
52
+ * function ComponentWithState(
53
+ * api: ExtractInjectionAPI<typeof hyperlinkPlugin> | undefined
54
+ * ) {
55
+ * const { hyperlinkState } = useSharedPluginState(api, ['hyperlink']);
56
+ * return renderComponent({ hyperlinkState })
57
+ * }
58
+ * ```
38
59
  *
39
- * renderComponent: ({ hyperlink }) => React.Component;
40
60
  */
41
61
  var WithPluginState = /*#__PURE__*/function (_React$Component) {
42
62
  _inherits(WithPluginState, _React$Component);
@@ -38,20 +38,40 @@ export interface Props<P extends NamedPluginKeys> {
38
38
  render: (pluginState: NamedPluginStates<P>) => React.ReactElement | null;
39
39
  }
40
40
  /**
41
- * Wraps component in a high order component that watches state changes of given plugins
42
- * and passes those states to the wrapped component.
41
+ * @private
42
+ * @deprecated
43
43
  *
44
- * Example:
44
+ * Using this component is deprecated. It should be replaced with `useSharedPluginState`.
45
+ * This requires having access to the injection API from the plugin itself.
46
+ *
47
+ * An example of the refactor with the new hook (using hyperlink as an example) is:
48
+ *
49
+ * Before:
50
+ * ```ts
45
51
  * <WithPluginState
46
- * eventDispatcher={eventDispatcher}
47
52
  * editorView={editorView}
48
53
  * plugins={{
49
- * hyperlink: hyperlinkPluginKey
54
+ * hyperlinkState: hyperlinkPluginKey
50
55
  * }}
51
- * render={renderComponent}
56
+ * render={({ hyperlinkState }) =>
57
+ * renderComponent({ hyperlinkState })
58
+ * }
52
59
  * />
60
+ * ```
61
+ *
62
+ * After:
63
+ * ```ts
64
+ * import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
65
+ * import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
66
+ *
67
+ * function ComponentWithState(
68
+ * api: ExtractInjectionAPI<typeof hyperlinkPlugin> | undefined
69
+ * ) {
70
+ * const { hyperlinkState } = useSharedPluginState(api, ['hyperlink']);
71
+ * return renderComponent({ hyperlinkState })
72
+ * }
73
+ * ```
53
74
  *
54
- * renderComponent: ({ hyperlink }) => React.Component;
55
75
  */
56
76
  declare class WithPluginState<P extends NamedPluginKeys> extends React.Component<Props<P>, State> {
57
77
  static displayName: string;
@@ -38,20 +38,40 @@ export interface Props<P extends NamedPluginKeys> {
38
38
  render: (pluginState: NamedPluginStates<P>) => React.ReactElement | null;
39
39
  }
40
40
  /**
41
- * Wraps component in a high order component that watches state changes of given plugins
42
- * and passes those states to the wrapped component.
41
+ * @private
42
+ * @deprecated
43
43
  *
44
- * Example:
44
+ * Using this component is deprecated. It should be replaced with `useSharedPluginState`.
45
+ * This requires having access to the injection API from the plugin itself.
46
+ *
47
+ * An example of the refactor with the new hook (using hyperlink as an example) is:
48
+ *
49
+ * Before:
50
+ * ```ts
45
51
  * <WithPluginState
46
- * eventDispatcher={eventDispatcher}
47
52
  * editorView={editorView}
48
53
  * plugins={{
49
- * hyperlink: hyperlinkPluginKey
54
+ * hyperlinkState: hyperlinkPluginKey
50
55
  * }}
51
- * render={renderComponent}
56
+ * render={({ hyperlinkState }) =>
57
+ * renderComponent({ hyperlinkState })
58
+ * }
52
59
  * />
60
+ * ```
61
+ *
62
+ * After:
63
+ * ```ts
64
+ * import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
65
+ * import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
66
+ *
67
+ * function ComponentWithState(
68
+ * api: ExtractInjectionAPI<typeof hyperlinkPlugin> | undefined
69
+ * ) {
70
+ * const { hyperlinkState } = useSharedPluginState(api, ['hyperlink']);
71
+ * return renderComponent({ hyperlinkState })
72
+ * }
73
+ * ```
53
74
  *
54
- * renderComponent: ({ hyperlink }) => React.Component;
55
75
  */
56
76
  declare class WithPluginState<P extends NamedPluginKeys> extends React.Component<Props<P>, State> {
57
77
  static displayName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.7.1",
3
+ "version": "74.7.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/"
@@ -87,7 +87,7 @@
87
87
  "@atlaskit/icon": "^21.12.0",
88
88
  "@atlaskit/in-product-testing": "^0.2.0",
89
89
  "@atlaskit/media-card": "^76.0.0",
90
- "@atlaskit/media-client": "^23.0.0",
90
+ "@atlaskit/media-client": "^23.1.0",
91
91
  "@atlaskit/media-picker": "^66.0.0",
92
92
  "@atlaskit/mention": "^22.1.0",
93
93
  "@atlaskit/menu": "^1.7.0",