@atlaskit/editor-plugin-date 2.4.4 → 2.4.5

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-plugin-date
2
2
 
3
+ ## 2.4.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#157489](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/157489)
8
+ [`00657197923b2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/00657197923b2) -
9
+ We are testing replacing findDOMNode with an explicit ref behind a feature flag. If this fix is
10
+ successful it will be available in a later release.
11
+ - Updated dependencies
12
+
3
13
  ## 2.4.4
4
14
 
5
15
  ### Patch Changes
@@ -105,6 +105,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
105
105
  (0, _createClass2.default)(DatePicker, [{
106
106
  key: "render",
107
107
  value: function render() {
108
+ var _this2 = this;
108
109
  var _this$props = this.props,
109
110
  element = _this$props.element,
110
111
  _onSelect = _this$props.onSelect,
@@ -145,30 +146,36 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
145
146
  scrollableElement: scrollableElement,
146
147
  ariaLabel: null,
147
148
  preventOverflow: true
148
- }, (0, _react2.jsx)("div", {
149
- css: popupContentWrapper
150
- }, (0, _react2.jsx)(_datePickerInput.default, {
151
- date: date,
152
- onNewDate: this.handleNewDate,
153
- onSubmitDate: this.handleKeyboardSubmitDate,
154
- onEmptySubmit: this.handleEmptySubmitDate,
155
- locale: intl.locale,
156
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
157
- autoFocus: autoFocus,
158
- autoSelectAll: isNew
159
- }), (0, _react2.jsx)(_calendar.default, {
160
- onChange: this.handleOnChange,
161
- onSelect: function onSelect(date) {
162
- return _onSelect(date, _analytics.INPUT_METHOD.PICKER);
163
- },
164
- day: day,
165
- month: month,
166
- year: year,
167
- selected: selected,
168
- ref: this.handleRef,
169
- weekStartDay: weekStartDay,
170
- testId: 'datepicker'
171
- })));
149
+ }, (0, _react2.jsx)(_ui.PlainOutsideClickTargetRefContext.Consumer, null, function (setOutsideClickTargetRef) {
150
+ return (0, _react2.jsx)("div", {
151
+ css: popupContentWrapper,
152
+ ref: setOutsideClickTargetRef
153
+ }, (0, _react2.jsx)(_datePickerInput.default, {
154
+ date: date,
155
+ onNewDate: _this2.handleNewDate,
156
+ onSubmitDate: _this2.handleKeyboardSubmitDate,
157
+ onEmptySubmit: _this2.handleEmptySubmitDate,
158
+ locale: intl.locale,
159
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent
160
+ // Passthrough prop here
161
+ // eslint-disable-next-line jsx-a11y/no-autofocus
162
+ ,
163
+ autoFocus: autoFocus,
164
+ autoSelectAll: isNew
165
+ }), (0, _react2.jsx)(_calendar.default, {
166
+ onChange: _this2.handleOnChange,
167
+ onSelect: function onSelect(date) {
168
+ return _onSelect(date, _analytics.INPUT_METHOD.PICKER);
169
+ },
170
+ day: day,
171
+ month: month,
172
+ year: year,
173
+ selected: selected,
174
+ ref: _this2.handleRef,
175
+ weekStartDay: weekStartDay,
176
+ testId: 'datepicker'
177
+ }));
178
+ }));
172
179
  }
173
180
  }]);
174
181
  return DatePicker;
@@ -10,7 +10,7 @@ import { css, jsx } from '@emotion/react';
10
10
  import { injectIntl } from 'react-intl-next';
11
11
  import Calendar from '@atlaskit/calendar';
12
12
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
13
- import { Popup, withOuterListeners } from '@atlaskit/editor-common/ui';
13
+ import { PlainOutsideClickTargetRefContext, Popup, withOuterListeners } from '@atlaskit/editor-common/ui';
14
14
  import { timestampToIsoFormat, timestampToUTCDate } from '@atlaskit/editor-common/utils';
15
15
  import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
16
16
  import { N0, N60A } from '@atlaskit/theme/colors';
@@ -133,15 +133,19 @@ class DatePicker extends React.Component {
133
133
  scrollableElement: scrollableElement,
134
134
  ariaLabel: null,
135
135
  preventOverflow: true
136
- }, jsx("div", {
137
- css: popupContentWrapper
136
+ }, jsx(PlainOutsideClickTargetRefContext.Consumer, null, setOutsideClickTargetRef => jsx("div", {
137
+ css: popupContentWrapper,
138
+ ref: setOutsideClickTargetRef
138
139
  }, jsx(DatePickerInput, {
139
140
  date: date,
140
141
  onNewDate: this.handleNewDate,
141
142
  onSubmitDate: this.handleKeyboardSubmitDate,
142
143
  onEmptySubmit: this.handleEmptySubmitDate,
143
144
  locale: intl.locale,
144
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
145
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent
146
+ // Passthrough prop here
147
+ // eslint-disable-next-line jsx-a11y/no-autofocus
148
+ ,
145
149
  autoFocus: autoFocus,
146
150
  autoSelectAll: isNew
147
151
  }), jsx(Calendar, {
@@ -154,7 +158,7 @@ class DatePicker extends React.Component {
154
158
  ref: this.handleRef,
155
159
  weekStartDay: weekStartDay,
156
160
  testId: 'datepicker'
157
- })));
161
+ }))));
158
162
  }
159
163
  }
160
164
  export default injectIntl(DatePicker);
@@ -18,7 +18,7 @@ import { css, jsx } from '@emotion/react';
18
18
  import { injectIntl } from 'react-intl-next';
19
19
  import Calendar from '@atlaskit/calendar';
20
20
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
21
- import { Popup, withOuterListeners } from '@atlaskit/editor-common/ui';
21
+ import { PlainOutsideClickTargetRefContext, Popup, withOuterListeners } from '@atlaskit/editor-common/ui';
22
22
  import { timestampToIsoFormat, timestampToUTCDate } from '@atlaskit/editor-common/utils';
23
23
  import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
24
24
  import { N0, N60A } from '@atlaskit/theme/colors';
@@ -102,6 +102,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
102
102
  _createClass(DatePicker, [{
103
103
  key: "render",
104
104
  value: function render() {
105
+ var _this2 = this;
105
106
  var _this$props = this.props,
106
107
  element = _this$props.element,
107
108
  _onSelect = _this$props.onSelect,
@@ -142,30 +143,36 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
142
143
  scrollableElement: scrollableElement,
143
144
  ariaLabel: null,
144
145
  preventOverflow: true
145
- }, jsx("div", {
146
- css: popupContentWrapper
147
- }, jsx(DatePickerInput, {
148
- date: date,
149
- onNewDate: this.handleNewDate,
150
- onSubmitDate: this.handleKeyboardSubmitDate,
151
- onEmptySubmit: this.handleEmptySubmitDate,
152
- locale: intl.locale,
153
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
154
- autoFocus: autoFocus,
155
- autoSelectAll: isNew
156
- }), jsx(Calendar, {
157
- onChange: this.handleOnChange,
158
- onSelect: function onSelect(date) {
159
- return _onSelect(date, INPUT_METHOD.PICKER);
160
- },
161
- day: day,
162
- month: month,
163
- year: year,
164
- selected: selected,
165
- ref: this.handleRef,
166
- weekStartDay: weekStartDay,
167
- testId: 'datepicker'
168
- })));
146
+ }, jsx(PlainOutsideClickTargetRefContext.Consumer, null, function (setOutsideClickTargetRef) {
147
+ return jsx("div", {
148
+ css: popupContentWrapper,
149
+ ref: setOutsideClickTargetRef
150
+ }, jsx(DatePickerInput, {
151
+ date: date,
152
+ onNewDate: _this2.handleNewDate,
153
+ onSubmitDate: _this2.handleKeyboardSubmitDate,
154
+ onEmptySubmit: _this2.handleEmptySubmitDate,
155
+ locale: intl.locale,
156
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent
157
+ // Passthrough prop here
158
+ // eslint-disable-next-line jsx-a11y/no-autofocus
159
+ ,
160
+ autoFocus: autoFocus,
161
+ autoSelectAll: isNew
162
+ }), jsx(Calendar, {
163
+ onChange: _this2.handleOnChange,
164
+ onSelect: function onSelect(date) {
165
+ return _onSelect(date, INPUT_METHOD.PICKER);
166
+ },
167
+ day: day,
168
+ month: month,
169
+ year: year,
170
+ selected: selected,
171
+ ref: _this2.handleRef,
172
+ weekStartDay: weekStartDay,
173
+ testId: 'datepicker'
174
+ }));
175
+ }));
169
176
  }
170
177
  }]);
171
178
  return DatePicker;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-date",
3
- "version": "2.4.4",
3
+ "version": "2.4.5",
4
4
  "description": "Date plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,11 +34,11 @@
34
34
  "@atlaskit/adf-schema": "^42.3.1",
35
35
  "@atlaskit/calendar": "^15.0.0",
36
36
  "@atlaskit/date": "^0.10.0",
37
- "@atlaskit/editor-common": "^94.2.0",
37
+ "@atlaskit/editor-common": "^94.6.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
39
39
  "@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
40
40
  "@atlaskit/editor-prosemirror": "6.0.0",
41
- "@atlaskit/editor-shared-styles": "^3.0.0",
41
+ "@atlaskit/editor-shared-styles": "^3.1.0",
42
42
  "@atlaskit/form": "^10.5.0",
43
43
  "@atlaskit/locale": "^2.8.0",
44
44
  "@atlaskit/platform-feature-flags": "^0.3.0",