@atlaskit/editor-plugin-card 10.1.0 → 10.1.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,21 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 10.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`13e707b0d5324`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/13e707b0d5324) -
8
+ Hydration fixes for card plugin ContentComponent
9
+ - Updated dependencies
10
+
11
+ ## 10.1.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`910ca893a9910`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/910ca893a9910) -
16
+ ED-29307: experiment config clean up
17
+ - Updated dependencies
18
+
3
19
  ## 10.1.0
4
20
 
5
21
  ### Minor Changes
@@ -12,6 +12,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
12
12
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
13
  var _react = _interopRequireDefault(require("react"));
14
14
  var _linkProvider = require("@atlaskit/link-provider");
15
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
15
16
  var _EditorAnalyticsContext = require("../EditorAnalyticsContext");
16
17
  var _DatasourceEvents = require("./DatasourceEvents");
17
18
  var _LinkEvents = require("./LinkEvents");
@@ -27,6 +28,9 @@ var EditorLinkingPlatformAnalytics = exports.EditorLinkingPlatformAnalytics = /*
27
28
  return (0, _createClass2.default)(EditorLinkingPlatformAnalytics, [{
28
29
  key: "render",
29
30
  value: function render() {
31
+ if ((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) && !this.props.editorView) {
32
+ return null;
33
+ }
30
34
  return /*#__PURE__*/_react.default.createElement(_linkProvider.EditorSmartCardProvider, null, /*#__PURE__*/_react.default.createElement(_linkProvider.EditorSmartCardProviderValueGuard, null, /*#__PURE__*/_react.default.createElement(_EditorAnalyticsContext.EditorAnalyticsContext, {
31
35
  editorView: this.props.editorView
32
36
  }, /*#__PURE__*/_react.default.createElement(_LinkEvents.LinkEventsBinding
@@ -6,12 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.EditorSmartCardEvents = void 0;
7
7
  var _react = require("react");
8
8
  var _smartCard = require("@atlaskit/smart-card");
9
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
9
10
  var _actions = require("../pm-plugins/actions");
10
11
  var EditorSmartCardEvents = exports.EditorSmartCardEvents = function EditorSmartCardEvents(_ref) {
11
12
  var editorView = _ref.editorView;
12
13
  var events = (0, _smartCard.useSmartLinkEvents)();
13
14
  (0, _react.useEffect)(function () {
14
- if (!events) {
15
+ if (!events || (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) && !editorView) {
15
16
  return;
16
17
  }
17
18
  editorView.dispatch((0, _actions.registerSmartCardEvents)(events)(editorView.state.tr));
@@ -12,15 +12,17 @@ var _types = require("./types");
12
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
13
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
14
  var getDatasource = exports.getDatasource = function getDatasource(editorView) {
15
- var _editorView$state = editorView.state,
16
- selection = _editorView$state.selection,
17
- schema = _editorView$state.schema;
18
- var blockCard = schema.nodes.blockCard;
19
- var findResult = (0, _utils.findSelectedNodeOfType)([blockCard])(selection);
20
- if (findResult && (0, _utils2.isDatasourceNode)(findResult.node)) {
21
- return _objectSpread(_objectSpread({}, findResult), {}, {
22
- node: findResult.node
23
- });
15
+ if (editorView) {
16
+ var _editorView$state = editorView.state,
17
+ selection = _editorView$state.selection,
18
+ schema = _editorView$state.schema;
19
+ var blockCard = schema.nodes.blockCard;
20
+ var findResult = (0, _utils.findSelectedNodeOfType)([blockCard])(selection);
21
+ if (findResult && (0, _utils2.isDatasourceNode)(findResult.node)) {
22
+ return _objectSpread(_objectSpread({}, findResult), {}, {
23
+ node: findResult.node
24
+ });
25
+ }
24
26
  }
25
27
  return {
26
28
  node: undefined,
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { EditorSmartCardProvider, EditorSmartCardProviderValueGuard } from '@atlaskit/link-provider';
3
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
4
  import { EditorAnalyticsContext } from '../EditorAnalyticsContext';
4
5
  import { DatasourceEventsBinding } from './DatasourceEvents';
5
6
  import { LinkEventsBinding } from './LinkEvents';
@@ -7,6 +8,9 @@ import { LinkEventsBinding } from './LinkEvents';
7
8
  // eslint-disable-next-line @repo/internal/react/no-class-components
8
9
  export class EditorLinkingPlatformAnalytics extends React.PureComponent {
9
10
  render() {
11
+ if (expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) && !this.props.editorView) {
12
+ return null;
13
+ }
10
14
  return /*#__PURE__*/React.createElement(EditorSmartCardProvider, null, /*#__PURE__*/React.createElement(EditorSmartCardProviderValueGuard, null, /*#__PURE__*/React.createElement(EditorAnalyticsContext, {
11
15
  editorView: this.props.editorView
12
16
  }, /*#__PURE__*/React.createElement(LinkEventsBinding
@@ -1,12 +1,13 @@
1
1
  import { useEffect } from 'react';
2
2
  import { useSmartLinkEvents } from '@atlaskit/smart-card';
3
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
4
  import { registerSmartCardEvents } from '../pm-plugins/actions';
4
5
  export const EditorSmartCardEvents = ({
5
6
  editorView
6
7
  }) => {
7
8
  const events = useSmartLinkEvents();
8
9
  useEffect(() => {
9
- if (!events) {
10
+ if (!events || expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) && !editorView) {
10
11
  return;
11
12
  }
12
13
  editorView.dispatch(registerSmartCardEvents(events)(editorView.state.tr));
@@ -2,19 +2,21 @@ import { findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
2
2
  import { isDatasourceNode } from '../../pm-plugins/utils';
3
3
  import { DATASOURCE_TABLE_LAYOUTS } from './types';
4
4
  export const getDatasource = editorView => {
5
- const {
6
- selection,
7
- schema
8
- } = editorView.state;
9
- const {
10
- blockCard
11
- } = schema.nodes;
12
- const findResult = findSelectedNodeOfType([blockCard])(selection);
13
- if (findResult && isDatasourceNode(findResult.node)) {
14
- return {
15
- ...findResult,
16
- node: findResult.node
17
- };
5
+ if (editorView) {
6
+ const {
7
+ selection,
8
+ schema
9
+ } = editorView.state;
10
+ const {
11
+ blockCard
12
+ } = schema.nodes;
13
+ const findResult = findSelectedNodeOfType([blockCard])(selection);
14
+ if (findResult && isDatasourceNode(findResult.node)) {
15
+ return {
16
+ ...findResult,
17
+ node: findResult.node
18
+ };
19
+ }
18
20
  }
19
21
  return {
20
22
  node: undefined,
@@ -7,6 +7,7 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
7
7
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
8
8
  import React from 'react';
9
9
  import { EditorSmartCardProvider, EditorSmartCardProviderValueGuard } from '@atlaskit/link-provider';
10
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
11
  import { EditorAnalyticsContext } from '../EditorAnalyticsContext';
11
12
  import { DatasourceEventsBinding } from './DatasourceEvents';
12
13
  import { LinkEventsBinding } from './LinkEvents';
@@ -21,6 +22,9 @@ export var EditorLinkingPlatformAnalytics = /*#__PURE__*/function (_React$PureCo
21
22
  return _createClass(EditorLinkingPlatformAnalytics, [{
22
23
  key: "render",
23
24
  value: function render() {
25
+ if (expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) && !this.props.editorView) {
26
+ return null;
27
+ }
24
28
  return /*#__PURE__*/React.createElement(EditorSmartCardProvider, null, /*#__PURE__*/React.createElement(EditorSmartCardProviderValueGuard, null, /*#__PURE__*/React.createElement(EditorAnalyticsContext, {
25
29
  editorView: this.props.editorView
26
30
  }, /*#__PURE__*/React.createElement(LinkEventsBinding
@@ -1,11 +1,12 @@
1
1
  import { useEffect } from 'react';
2
2
  import { useSmartLinkEvents } from '@atlaskit/smart-card';
3
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
4
  import { registerSmartCardEvents } from '../pm-plugins/actions';
4
5
  export var EditorSmartCardEvents = function EditorSmartCardEvents(_ref) {
5
6
  var editorView = _ref.editorView;
6
7
  var events = useSmartLinkEvents();
7
8
  useEffect(function () {
8
- if (!events) {
9
+ if (!events || expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) && !editorView) {
9
10
  return;
10
11
  }
11
12
  editorView.dispatch(registerSmartCardEvents(events)(editorView.state.tr));
@@ -5,15 +5,17 @@ import { findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
5
5
  import { isDatasourceNode } from '../../pm-plugins/utils';
6
6
  import { DATASOURCE_TABLE_LAYOUTS } from './types';
7
7
  export var getDatasource = function getDatasource(editorView) {
8
- var _editorView$state = editorView.state,
9
- selection = _editorView$state.selection,
10
- schema = _editorView$state.schema;
11
- var blockCard = schema.nodes.blockCard;
12
- var findResult = findSelectedNodeOfType([blockCard])(selection);
13
- if (findResult && isDatasourceNode(findResult.node)) {
14
- return _objectSpread(_objectSpread({}, findResult), {}, {
15
- node: findResult.node
16
- });
8
+ if (editorView) {
9
+ var _editorView$state = editorView.state,
10
+ selection = _editorView$state.selection,
11
+ schema = _editorView$state.schema;
12
+ var blockCard = schema.nodes.blockCard;
13
+ var findResult = findSelectedNodeOfType([blockCard])(selection);
14
+ if (findResult && isDatasourceNode(findResult.node)) {
15
+ return _objectSpread(_objectSpread({}, findResult), {}, {
16
+ node: findResult.node
17
+ });
18
+ }
17
19
  }
18
20
  return {
19
21
  node: undefined,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import type { AnalyticsBindingsProps } from './common';
3
3
  export declare class EditorLinkingPlatformAnalytics extends React.PureComponent<AnalyticsBindingsProps> {
4
- render(): React.JSX.Element;
4
+ render(): React.JSX.Element | null;
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
2
  import { type DatasourceTableLayout } from './types';
3
- export declare const getDatasource: (editorView: EditorView) => {
3
+ export declare const getDatasource: (editorView: EditorView | undefined) => {
4
4
  node: import("../../types").DatasourceNode;
5
5
  start: number;
6
6
  depth: number;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import type { AnalyticsBindingsProps } from './common';
3
3
  export declare class EditorLinkingPlatformAnalytics extends React.PureComponent<AnalyticsBindingsProps> {
4
- render(): React.JSX.Element;
4
+ render(): React.JSX.Element | null;
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
2
  import { type DatasourceTableLayout } from './types';
3
- export declare const getDatasource: (editorView: EditorView) => {
3
+ export declare const getDatasource: (editorView: EditorView | undefined) => {
4
4
  node: import("../../types").DatasourceNode;
5
5
  start: number;
6
6
  depth: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "10.1.0",
3
+ "version": "10.1.2",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -48,12 +48,12 @@
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",
51
- "@atlaskit/icon": "^28.1.0",
51
+ "@atlaskit/icon": "^28.2.0",
52
52
  "@atlaskit/link": "^3.2.0",
53
53
  "@atlaskit/link-analytics": "^11.0.0",
54
54
  "@atlaskit/link-client-extension": "^6.0.0",
55
55
  "@atlaskit/link-datasource": "^4.23.0",
56
- "@atlaskit/linking-common": "^9.5.0",
56
+ "@atlaskit/linking-common": "^9.6.0",
57
57
  "@atlaskit/linking-types": "^14.0.0",
58
58
  "@atlaskit/menu": "^8.4.0",
59
59
  "@atlaskit/platform-feature-flags": "^1.1.0",
@@ -61,7 +61,7 @@
61
61
  "@atlaskit/primitives": "^14.14.0",
62
62
  "@atlaskit/smart-card": "^41.0.0",
63
63
  "@atlaskit/theme": "^21.0.0",
64
- "@atlaskit/tmp-editor-statsig": "^12.18.0",
64
+ "@atlaskit/tmp-editor-statsig": "^12.22.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": "^109.5.0",
74
+ "@atlaskit/editor-common": "^109.7.0",
75
75
  "@atlaskit/link-provider": "^4.0.0",
76
76
  "react": "^18.2.0",
77
77
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -122,9 +122,6 @@
122
122
  "dst-a11y__replace-anchor-with-link__linking-platfo": {
123
123
  "type": "boolean"
124
124
  },
125
- "platform_editor_cards_maxcallstackfix": {
126
- "type": "boolean"
127
- },
128
125
  "platform_editor_controls_patch_15": {
129
126
  "type": "boolean"
130
127
  },