@atlaskit/editor-plugin-card 8.1.0 → 9.0.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,22 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 9.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 9.0.0
10
+
11
+ ### Patch Changes
12
+
13
+ - [`0d0fe7a300841`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0d0fe7a300841) -
14
+ Cleanup platform_editor_usesharedpluginstatewithselector experiment
15
+
16
+ - BREAKING CHANGE: sharedPluginStateHookMigratorFactory is deleted from @atlaskit/editor-common
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 8.1.0
4
21
 
5
22
  ### Minor Changes
@@ -27,28 +27,18 @@ var _WithCardContext = require("../ui/WithCardContext");
27
27
  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); }
28
28
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
29
29
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
30
- var selector = function selector(states) {
31
- var _states$editorViewMod;
32
- return {
33
- mode: (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode
34
- };
35
- };
36
- var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (pluginInjectionApi) {
37
- return (0, _hooks.useSharedPluginStateWithSelector)(pluginInjectionApi, ['editorViewMode'], selector);
38
- }, function (pluginInjectionApi) {
39
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['editorViewMode']),
40
- editorViewModeState = _useSharedPluginState.editorViewModeState;
41
- return {
42
- mode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode
43
- };
44
- });
45
30
  var WithClickHandler = function WithClickHandler(_ref) {
46
31
  var pluginInjectionApi = _ref.pluginInjectionApi,
47
32
  url = _ref.url,
48
33
  onClickCallback = _ref.onClickCallback,
49
34
  children = _ref.children;
50
- var _useSharedState = useSharedState(pluginInjectionApi),
51
- mode = _useSharedState.mode;
35
+ var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(pluginInjectionApi, ['editorViewMode'], function (states) {
36
+ var _states$editorViewMod;
37
+ return {
38
+ mode: (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode
39
+ };
40
+ }),
41
+ mode = _useSharedPluginState.mode;
52
42
  var onClick = (0, _react.useCallback)(function (event) {
53
43
  if (typeof onClickCallback === 'function') {
54
44
  try {
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import React, { useCallback } from 'react';
4
4
  import { isSafeUrl } from '@atlaskit/adf-schema';
5
5
  import { AnalyticsContext } from '@atlaskit/analytics-next';
6
- import { sharedPluginStateHookMigratorFactory, useSharedPluginState, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
6
+ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
7
7
  import { getAnalyticsEditorAppearance } from '@atlaskit/editor-common/utils';
8
8
  import Link from '@atlaskit/link';
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -11,22 +11,6 @@ import { changeSelectedCardToLinkFallback } from '../pm-plugins/doc';
11
11
  import { getPluginState } from '../pm-plugins/util/state';
12
12
  import { titleUrlPairFromNode } from '../pm-plugins/utils';
13
13
  import { WithCardContext } from '../ui/WithCardContext';
14
- const selector = states => {
15
- var _states$editorViewMod;
16
- return {
17
- mode: (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode
18
- };
19
- };
20
- const useSharedState = sharedPluginStateHookMigratorFactory(pluginInjectionApi => {
21
- return useSharedPluginStateWithSelector(pluginInjectionApi, ['editorViewMode'], selector);
22
- }, pluginInjectionApi => {
23
- const {
24
- editorViewModeState
25
- } = useSharedPluginState(pluginInjectionApi, ['editorViewMode']);
26
- return {
27
- mode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode
28
- };
29
- });
30
14
  const WithClickHandler = ({
31
15
  pluginInjectionApi,
32
16
  url,
@@ -35,7 +19,12 @@ const WithClickHandler = ({
35
19
  }) => {
36
20
  const {
37
21
  mode
38
- } = useSharedState(pluginInjectionApi);
22
+ } = useSharedPluginStateWithSelector(pluginInjectionApi, ['editorViewMode'], states => {
23
+ var _states$editorViewMod;
24
+ return {
25
+ mode: (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode
26
+ };
27
+ });
39
28
  const onClick = useCallback(event => {
40
29
  if (typeof onClickCallback === 'function') {
41
30
  try {
@@ -10,7 +10,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
10
10
  import React, { useCallback } from 'react';
11
11
  import { isSafeUrl } from '@atlaskit/adf-schema';
12
12
  import { AnalyticsContext } from '@atlaskit/analytics-next';
13
- import { sharedPluginStateHookMigratorFactory, useSharedPluginState, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
13
+ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
14
14
  import { getAnalyticsEditorAppearance } from '@atlaskit/editor-common/utils';
15
15
  import Link from '@atlaskit/link';
16
16
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -18,28 +18,18 @@ import { changeSelectedCardToLinkFallback } from '../pm-plugins/doc';
18
18
  import { getPluginState } from '../pm-plugins/util/state';
19
19
  import { titleUrlPairFromNode } from '../pm-plugins/utils';
20
20
  import { WithCardContext } from '../ui/WithCardContext';
21
- var selector = function selector(states) {
22
- var _states$editorViewMod;
23
- return {
24
- mode: (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode
25
- };
26
- };
27
- var useSharedState = sharedPluginStateHookMigratorFactory(function (pluginInjectionApi) {
28
- return useSharedPluginStateWithSelector(pluginInjectionApi, ['editorViewMode'], selector);
29
- }, function (pluginInjectionApi) {
30
- var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['editorViewMode']),
31
- editorViewModeState = _useSharedPluginState.editorViewModeState;
32
- return {
33
- mode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode
34
- };
35
- });
36
21
  var WithClickHandler = function WithClickHandler(_ref) {
37
22
  var pluginInjectionApi = _ref.pluginInjectionApi,
38
23
  url = _ref.url,
39
24
  onClickCallback = _ref.onClickCallback,
40
25
  children = _ref.children;
41
- var _useSharedState = useSharedState(pluginInjectionApi),
42
- mode = _useSharedState.mode;
26
+ var _useSharedPluginState = useSharedPluginStateWithSelector(pluginInjectionApi, ['editorViewMode'], function (states) {
27
+ var _states$editorViewMod;
28
+ return {
29
+ mode: (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode
30
+ };
31
+ }),
32
+ mode = _useSharedPluginState.mode;
43
33
  var onClick = useCallback(function (event) {
44
34
  if (typeof onClickCallback === 'function') {
45
35
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "8.1.0",
3
+ "version": "9.0.1",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,22 +29,22 @@
29
29
  ],
30
30
  "atlaskit:src": "src/index.ts",
31
31
  "dependencies": {
32
- "@atlaskit/adf-schema": "^50.2.3",
32
+ "@atlaskit/adf-schema": "^51.0.0",
33
33
  "@atlaskit/analytics-next": "^11.1.0",
34
34
  "@atlaskit/button": "^23.4.0",
35
35
  "@atlaskit/custom-steps": "^0.11.0",
36
36
  "@atlaskit/editor-card-provider": "^5.6.0",
37
- "@atlaskit/editor-plugin-analytics": "^4.0.0",
38
- "@atlaskit/editor-plugin-base": "^5.0.0",
39
- "@atlaskit/editor-plugin-connectivity": "^4.0.0",
40
- "@atlaskit/editor-plugin-decorations": "^4.0.0",
41
- "@atlaskit/editor-plugin-editor-disabled": "^4.0.0",
42
- "@atlaskit/editor-plugin-editor-viewmode": "^6.0.0",
43
- "@atlaskit/editor-plugin-feature-flags": "^3.0.0",
44
- "@atlaskit/editor-plugin-floating-toolbar": "^6.1.0",
45
- "@atlaskit/editor-plugin-grid": "^4.0.0",
46
- "@atlaskit/editor-plugin-toolbar": "^1.2.0",
47
- "@atlaskit/editor-plugin-width": "^5.0.0",
37
+ "@atlaskit/editor-plugin-analytics": "^5.0.0",
38
+ "@atlaskit/editor-plugin-base": "^6.0.0",
39
+ "@atlaskit/editor-plugin-connectivity": "^5.0.0",
40
+ "@atlaskit/editor-plugin-decorations": "^5.0.0",
41
+ "@atlaskit/editor-plugin-editor-disabled": "^5.0.0",
42
+ "@atlaskit/editor-plugin-editor-viewmode": "^7.0.0",
43
+ "@atlaskit/editor-plugin-feature-flags": "^4.0.0",
44
+ "@atlaskit/editor-plugin-floating-toolbar": "^7.0.0",
45
+ "@atlaskit/editor-plugin-grid": "^5.0.0",
46
+ "@atlaskit/editor-plugin-toolbar": "^2.1.0",
47
+ "@atlaskit/editor-plugin-width": "^6.0.0",
48
48
  "@atlaskit/editor-prosemirror": "7.0.0",
49
49
  "@atlaskit/editor-shared-styles": "^3.6.0",
50
50
  "@atlaskit/frontend-utilities": "^3.1.0",
@@ -59,9 +59,9 @@
59
59
  "@atlaskit/platform-feature-flags": "^1.1.0",
60
60
  "@atlaskit/platform-feature-flags-react": "^0.3.0",
61
61
  "@atlaskit/primitives": "^14.14.0",
62
- "@atlaskit/smart-card": "^40.21.0",
63
- "@atlaskit/theme": "^20.0.0",
64
- "@atlaskit/tmp-editor-statsig": "^12.8.0",
62
+ "@atlaskit/smart-card": "^40.22.0",
63
+ "@atlaskit/theme": "^21.0.0",
64
+ "@atlaskit/tmp-editor-statsig": "^12.10.0",
65
65
  "@atlaskit/tokens": "^6.3.0",
66
66
  "@babel/runtime": "^7.0.0",
67
67
  "@emotion/react": "^11.7.1",
@@ -71,7 +71,7 @@
71
71
  "uuid": "^3.1.0"
72
72
  },
73
73
  "peerDependencies": {
74
- "@atlaskit/editor-common": "^108.6.0",
74
+ "@atlaskit/editor-common": "^109.1.0",
75
75
  "@atlaskit/link-provider": "^3.7.0",
76
76
  "react": "^18.2.0",
77
77
  "react-intl-next": "npm:react-intl@^5.18.1"