@atlaskit/editor-core 172.0.1 → 172.0.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,15 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 172.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8ed516834c1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8ed516834c1) - [ux] ED-15407: Bring forward patches below to master:
8
+
9
+ - ED-14988: Patch dark mode in mobile-bridge by ensuring theme context is not stale. Repaints editor nodes when theme mode changes.
10
+ - ME-2511: Revert the premature optimisation that introduces race condition.
11
+ - Partly from ED-15327: PortalProvider fix to ensure theme toggling updates nested mentions, nodes
12
+
3
13
  ## 172.0.1
4
14
 
5
15
  ### Patch Changes
@@ -46,7 +46,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
46
46
  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; } }
47
47
 
48
48
  var packageName = "@atlaskit/editor-core";
49
- var packageVersion = "172.0.1";
49
+ var packageVersion = "172.0.2";
50
50
  var halfFocusRing = 1;
51
51
  var dropOffset = "0, ".concat((0, _constants.gridSize)(), "px");
52
52
 
@@ -75,6 +75,11 @@ var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
75
75
 
76
76
  var hasAnalyticsContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
77
77
  var hasIntlContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
78
+ this.portals.set(container, {
79
+ children: children,
80
+ hasAnalyticsContext: hasAnalyticsContext,
81
+ hasIntlContext: hasIntlContext
82
+ });
78
83
 
79
84
  var childrenWithThemeProviders = function childrenWithThemeProviders() {
80
85
  return /*#__PURE__*/_react.default.createElement(_PortalProviderThemesProvider.PortalProviderThemeProviders, {
@@ -82,11 +87,6 @@ var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
82
87
  }, children());
83
88
  };
84
89
 
85
- this.portals.set(container, {
86
- children: childrenWithThemeProviders,
87
- hasAnalyticsContext: hasAnalyticsContext,
88
- hasIntlContext: hasIntlContext
89
- });
90
90
  var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders()) : childrenWithThemeProviders();
91
91
 
92
92
  if (hasIntlContext) {
@@ -105,8 +105,10 @@ var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
105
105
  value: function forceUpdate(_ref) {
106
106
  var _this3 = this;
107
107
 
108
- var intl = _ref.intl;
108
+ var intl = _ref.intl,
109
+ themeMode = _ref.themeMode;
109
110
  this.intl = intl;
111
+ this.themeMode = themeMode;
110
112
  this.portals.forEach(function (portal, container) {
111
113
  if (!portal.hasAnalyticsContext && !_this3.useAnalyticsContext && !portal.hasIntlContext) {
112
114
  return;
@@ -114,14 +116,20 @@ var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
114
116
 
115
117
  var wrappedChildren = portal.children();
116
118
 
119
+ var childrenWithThemeProviders = function childrenWithThemeProviders() {
120
+ return /*#__PURE__*/_react.default.createElement(_PortalProviderThemesProvider.PortalProviderThemeProviders, {
121
+ mode: themeMode
122
+ }, wrappedChildren);
123
+ };
124
+
117
125
  if (portal.hasAnalyticsContext && _this3.useAnalyticsContext) {
118
- wrappedChildren = /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null, wrappedChildren);
126
+ wrappedChildren = /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders());
119
127
  }
120
128
 
121
129
  if (portal.hasIntlContext) {
122
130
  wrappedChildren = /*#__PURE__*/_react.default.createElement(_reactIntlNext.RawIntlProvider, {
123
131
  value: _this3.intl
124
- }, wrappedChildren);
132
+ }, childrenWithThemeProviders());
125
133
  }
126
134
 
127
135
  (0, _reactDom.unstable_renderSubtreeIntoContainer)(_this3.context, wrappedChildren, container);
@@ -188,7 +196,8 @@ var BasePortalProvider = /*#__PURE__*/function (_React$Component) {
188
196
  key: "componentDidUpdate",
189
197
  value: function componentDidUpdate() {
190
198
  this.portalProviderAPI.forceUpdate({
191
- intl: this.props.intl
199
+ intl: this.props.intl,
200
+ themeMode: this.props.themeMode
192
201
  });
193
202
  }
194
203
  }]);
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "172.0.1";
9
+ var version = "172.0.2";
10
10
  exports.version = version;
11
11
 
12
12
  var nextMajorVersion = function nextMajorVersion() {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "172.0.1",
3
+ "version": "172.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -10,7 +10,7 @@ import { N0, DN50, DN600, N50A, N60A, N900 } from '@atlaskit/theme/colors';
10
10
  import { themed } from '@atlaskit/theme/components';
11
11
  import { token } from '@atlaskit/tokens';
12
12
  const packageName = "@atlaskit/editor-core";
13
- const packageVersion = "172.0.1";
13
+ const packageVersion = "172.0.2";
14
14
  const halfFocusRing = 1;
15
15
  const dropOffset = `0, ${gridSize()}px`;
16
16
 
@@ -28,15 +28,16 @@ export class PortalProviderAPI extends EventDispatcher {
28
28
  }
29
29
 
30
30
  render(children, container, hasAnalyticsContext = false, hasIntlContext = false) {
31
- const childrenWithThemeProviders = () => /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
32
- mode: this.themeMode
33
- }, children());
34
-
35
31
  this.portals.set(container, {
36
- children: childrenWithThemeProviders,
32
+ children: children,
37
33
  hasAnalyticsContext,
38
34
  hasIntlContext
39
35
  });
36
+
37
+ const childrenWithThemeProviders = () => /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
38
+ mode: this.themeMode
39
+ }, children());
40
+
40
41
  let wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders()) : childrenWithThemeProviders();
41
42
 
42
43
  if (hasIntlContext) {
@@ -52,9 +53,11 @@ export class PortalProviderAPI extends EventDispatcher {
52
53
 
53
54
 
54
55
  forceUpdate({
55
- intl
56
+ intl,
57
+ themeMode
56
58
  }) {
57
59
  this.intl = intl;
60
+ this.themeMode = themeMode;
58
61
  this.portals.forEach((portal, container) => {
59
62
  if (!portal.hasAnalyticsContext && !this.useAnalyticsContext && !portal.hasIntlContext) {
60
63
  return;
@@ -62,14 +65,18 @@ export class PortalProviderAPI extends EventDispatcher {
62
65
 
63
66
  let wrappedChildren = portal.children();
64
67
 
68
+ const childrenWithThemeProviders = () => /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
69
+ mode: themeMode
70
+ }, wrappedChildren);
71
+
65
72
  if (portal.hasAnalyticsContext && this.useAnalyticsContext) {
66
- wrappedChildren = /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, wrappedChildren);
73
+ wrappedChildren = /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders());
67
74
  }
68
75
 
69
76
  if (portal.hasIntlContext) {
70
77
  wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
71
78
  value: this.intl
72
- }, wrappedChildren);
79
+ }, childrenWithThemeProviders());
73
80
  }
74
81
 
75
82
  unstable_renderSubtreeIntoContainer(this.context, wrappedChildren, container);
@@ -121,7 +128,8 @@ class BasePortalProvider extends React.Component {
121
128
 
122
129
  componentDidUpdate() {
123
130
  this.portalProviderAPI.forceUpdate({
124
- intl: this.props.intl
131
+ intl: this.props.intl,
132
+ themeMode: this.props.themeMode
125
133
  });
126
134
  }
127
135
 
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "172.0.1";
2
+ export const version = "172.0.2";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "172.0.1",
3
+ "version": "172.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -23,7 +23,7 @@ import { N0, DN50, DN600, N50A, N60A, N900 } from '@atlaskit/theme/colors';
23
23
  import { themed } from '@atlaskit/theme/components';
24
24
  import { token } from '@atlaskit/tokens';
25
25
  var packageName = "@atlaskit/editor-core";
26
- var packageVersion = "172.0.1";
26
+ var packageVersion = "172.0.2";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = "0, ".concat(gridSize(), "px");
29
29
 
@@ -54,6 +54,11 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
54
54
 
55
55
  var hasAnalyticsContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
56
56
  var hasIntlContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
57
+ this.portals.set(container, {
58
+ children: children,
59
+ hasAnalyticsContext: hasAnalyticsContext,
60
+ hasIntlContext: hasIntlContext
61
+ });
57
62
 
58
63
  var childrenWithThemeProviders = function childrenWithThemeProviders() {
59
64
  return /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
@@ -61,11 +66,6 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
61
66
  }, children());
62
67
  };
63
68
 
64
- this.portals.set(container, {
65
- children: childrenWithThemeProviders,
66
- hasAnalyticsContext: hasAnalyticsContext,
67
- hasIntlContext: hasIntlContext
68
- });
69
69
  var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders()) : childrenWithThemeProviders();
70
70
 
71
71
  if (hasIntlContext) {
@@ -84,8 +84,10 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
84
84
  value: function forceUpdate(_ref) {
85
85
  var _this3 = this;
86
86
 
87
- var intl = _ref.intl;
87
+ var intl = _ref.intl,
88
+ themeMode = _ref.themeMode;
88
89
  this.intl = intl;
90
+ this.themeMode = themeMode;
89
91
  this.portals.forEach(function (portal, container) {
90
92
  if (!portal.hasAnalyticsContext && !_this3.useAnalyticsContext && !portal.hasIntlContext) {
91
93
  return;
@@ -93,14 +95,20 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
93
95
 
94
96
  var wrappedChildren = portal.children();
95
97
 
98
+ var childrenWithThemeProviders = function childrenWithThemeProviders() {
99
+ return /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
100
+ mode: themeMode
101
+ }, wrappedChildren);
102
+ };
103
+
96
104
  if (portal.hasAnalyticsContext && _this3.useAnalyticsContext) {
97
- wrappedChildren = /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, wrappedChildren);
105
+ wrappedChildren = /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders());
98
106
  }
99
107
 
100
108
  if (portal.hasIntlContext) {
101
109
  wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
102
110
  value: _this3.intl
103
- }, wrappedChildren);
111
+ }, childrenWithThemeProviders());
104
112
  }
105
113
 
106
114
  unstable_renderSubtreeIntoContainer(_this3.context, wrappedChildren, container);
@@ -167,7 +175,8 @@ var BasePortalProvider = /*#__PURE__*/function (_React$Component) {
167
175
  key: "componentDidUpdate",
168
176
  value: function componentDidUpdate() {
169
177
  this.portalProviderAPI.forceUpdate({
170
- intl: this.props.intl
178
+ intl: this.props.intl,
179
+ themeMode: this.props.themeMode
171
180
  });
172
181
  }
173
182
  }]);
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "172.0.1";
2
+ export var version = "172.0.2";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "172.0.1",
3
+ "version": "172.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -28,8 +28,9 @@ export declare class PortalProviderAPI extends EventDispatcher {
28
28
  constructor(intl: IntlShape, onAnalyticsEvent?: FireAnalyticsCallback, analyticsContext?: boolean, themeMode?: ThemeModes);
29
29
  setContext: (context: any) => void;
30
30
  render(children: () => React.ReactChild | JSX.Element | null, container: HTMLElement, hasAnalyticsContext?: boolean, hasIntlContext?: boolean): void;
31
- forceUpdate({ intl }: {
31
+ forceUpdate({ intl, themeMode, }: {
32
32
  intl: IntlShape;
33
+ themeMode: ThemeModes | undefined;
33
34
  }): void;
34
35
  remove(container: HTMLElement): void;
35
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "172.0.1",
3
+ "version": "172.0.2",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -51,7 +51,7 @@
51
51
  "@atlaskit/form": "^8.5.0",
52
52
  "@atlaskit/icon": "^21.10.0",
53
53
  "@atlaskit/icon-object": "^6.2.0",
54
- "@atlaskit/link-picker": "^1.1.2",
54
+ "@atlaskit/link-picker": "^1.7.0",
55
55
  "@atlaskit/locale": "^2.3.0",
56
56
  "@atlaskit/logo": "^13.8.0",
57
57
  "@atlaskit/media-card": "^74.1.0",
@@ -151,14 +151,14 @@
151
151
  "@atlaskit/flag": "^14.6.0",
152
152
  "@atlaskit/inline-dialog": "^13.3.0",
153
153
  "@atlaskit/link-provider": "^1.0.0",
154
- "@atlaskit/link-test-helpers": "^1.1.0",
154
+ "@atlaskit/link-test-helpers": "^1.4.0",
155
155
  "@atlaskit/lozenge": "^11.1.0",
156
156
  "@atlaskit/media-core": "^33.0.0",
157
157
  "@atlaskit/media-integration-test-helpers": "^2.6.0",
158
158
  "@atlaskit/media-test-helpers": "^30.0.0",
159
159
  "@atlaskit/menu": "^1.3.0",
160
160
  "@atlaskit/page-layout": "^1.2.0",
161
- "@atlaskit/profilecard": "^16.11.0",
161
+ "@atlaskit/profilecard": "^16.12.0",
162
162
  "@atlaskit/pubsub": "^6.0.0",
163
163
  "@atlaskit/renderer": "^101.0.0",
164
164
  "@atlaskit/section-message": "^6.1.0",
@@ -172,7 +172,7 @@
172
172
  "@atlaskit/visual-regression": "*",
173
173
  "@atlaskit/webdriver-runner": "*",
174
174
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
175
- "@atlassian/link-picker-atlassian-plugin": "^16.0.0",
175
+ "@atlassian/link-picker-atlassian-plugin": "^17.0.0",
176
176
  "@atlassian/search-provider": "2.3.2",
177
177
  "@atlassian/ufo": "^0.1.0",
178
178
  "@emotion/jest": "^11.8.0",
package/tsconfig.json CHANGED
@@ -11,7 +11,6 @@
11
11
  "./example-helpers/**/*.tsx"
12
12
  ],
13
13
  "compilerOptions": {
14
- "baseUrl": "./",
15
- "noImplicitAny": true
14
+ "baseUrl": "./"
16
15
  }
17
16
  }