@atlaskit/editor-plugin-date 1.2.4 → 1.2.6

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,19 @@
1
1
  # @atlaskit/editor-plugin-date
2
2
 
3
+ ## 1.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#112831](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/112831)
8
+ [`4449002c52e44`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4449002c52e44) -
9
+ [ux] [ED-23702] Open date picker when it is the first node in an inline comment
10
+
11
+ ## 1.2.5
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 1.2.4
4
18
 
5
19
  ### Patch Changes
@@ -13,6 +13,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
13
13
  var _hooks = require("@atlaskit/editor-common/hooks");
14
14
  var _messages = require("@atlaskit/editor-common/messages");
15
15
  var _quickInsert = require("@atlaskit/editor-common/quick-insert");
16
+ var _styles = require("@atlaskit/editor-common/styles");
16
17
  var _utils = require("@atlaskit/editor-prosemirror/utils");
17
18
  var _actions = require("./actions");
18
19
  var _commands = require("./commands");
@@ -53,12 +54,15 @@ function ContentComponent(_ref) {
53
54
  isNew = dateState.isNew,
54
55
  focusDateInput = dateState.focusDateInput;
55
56
  var element = (0, _utils.findDomRefAtPos)(showDatePickerAt, domAtPos);
57
+
58
+ // Resolves ED-23702 for when the date is wrapped in an inline comment
59
+ var dateNode = element !== null && element !== void 0 && element.classList.contains(_styles.DateSharedCssClassName.DATE_CONTAINER) ? element : element === null || element === void 0 ? void 0 : element.querySelector(".".concat(_styles.DateSharedCssClassName.DATE_CONTAINER));
56
60
  return /*#__PURE__*/_react.default.createElement(DatePicker, {
57
61
  mountTo: popupsMountPoint,
58
62
  boundariesElement: popupsBoundariesElement,
59
63
  scrollableElement: popupsScrollableElement,
60
64
  key: showDatePickerAt,
61
- element: element,
65
+ element: dateNode || element,
62
66
  isNew: isNew,
63
67
  autoFocus: focusDateInput,
64
68
  onDelete: function onDelete() {
@@ -22,7 +22,7 @@ var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
22
22
  var _formatParse = require("../../utils/formatParse");
23
23
  var _internal = require("../../utils/internal");
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
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
25
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
27
27
  var dateTextFieldWrapper = (0, _react2.css)({
28
28
  // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
@@ -25,7 +25,7 @@ var _colors = require("@atlaskit/theme/colors");
25
25
  var _constants = require("@atlaskit/theme/constants");
26
26
  var _datePickerInput = _interopRequireDefault(require("./date-picker-input"));
27
27
  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); }; }
28
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
28
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
29
29
  var PopupWithListeners = (0, _ui.withOuterListeners)(_ui.Popup);
30
30
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
31
31
  var popupContentWrapper = (0, _react2.css)({
@@ -5,6 +5,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
5
5
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
6
6
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
7
7
  import { IconDate } from '@atlaskit/editor-common/quick-insert';
8
+ import { DateSharedCssClassName } from '@atlaskit/editor-common/styles';
8
9
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
9
10
  import { closeDatePicker, closeDatePickerWithAnalytics, createDate } from './actions';
10
11
  import { deleteDateCommand, insertDateCommand } from './commands';
@@ -41,12 +42,15 @@ function ContentComponent({
41
42
  focusDateInput
42
43
  } = dateState;
43
44
  const element = findDomRefAtPos(showDatePickerAt, domAtPos);
45
+
46
+ // Resolves ED-23702 for when the date is wrapped in an inline comment
47
+ const dateNode = element !== null && element !== void 0 && element.classList.contains(DateSharedCssClassName.DATE_CONTAINER) ? element : element === null || element === void 0 ? void 0 : element.querySelector(`.${DateSharedCssClassName.DATE_CONTAINER}`);
44
48
  return /*#__PURE__*/React.createElement(DatePicker, {
45
49
  mountTo: popupsMountPoint,
46
50
  boundariesElement: popupsBoundariesElement,
47
51
  scrollableElement: popupsScrollableElement,
48
52
  key: showDatePickerAt,
49
- element: element,
53
+ element: dateNode || element,
50
54
  isNew: isNew,
51
55
  autoFocus: focusDateInput,
52
56
  onDelete: () => {
@@ -1,6 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  /** @jsx jsx */
3
3
  import React from 'react';
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
5
  import { css, jsx } from '@emotion/react';
5
6
  import { injectIntl } from 'react-intl-next';
6
7
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
@@ -1,6 +1,8 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  /** @jsx jsx */
3
3
  import React from 'react';
4
+
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
6
  import { css, jsx } from '@emotion/react';
5
7
  import ReactDOM from 'react-dom';
6
8
  import { injectIntl } from 'react-intl-next';
@@ -5,6 +5,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
5
5
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
6
6
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
7
7
  import { IconDate } from '@atlaskit/editor-common/quick-insert';
8
+ import { DateSharedCssClassName } from '@atlaskit/editor-common/styles';
8
9
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
9
10
  import { closeDatePicker as _closeDatePicker, closeDatePickerWithAnalytics as _closeDatePickerWithAnalytics, createDate } from './actions';
10
11
  import { deleteDateCommand, insertDateCommand } from './commands';
@@ -41,12 +42,15 @@ function ContentComponent(_ref) {
41
42
  isNew = dateState.isNew,
42
43
  focusDateInput = dateState.focusDateInput;
43
44
  var element = findDomRefAtPos(showDatePickerAt, domAtPos);
45
+
46
+ // Resolves ED-23702 for when the date is wrapped in an inline comment
47
+ var dateNode = element !== null && element !== void 0 && element.classList.contains(DateSharedCssClassName.DATE_CONTAINER) ? element : element === null || element === void 0 ? void 0 : element.querySelector(".".concat(DateSharedCssClassName.DATE_CONTAINER));
44
48
  return /*#__PURE__*/React.createElement(DatePicker, {
45
49
  mountTo: popupsMountPoint,
46
50
  boundariesElement: popupsBoundariesElement,
47
51
  scrollableElement: popupsScrollableElement,
48
52
  key: showDatePickerAt,
49
- element: element,
53
+ element: dateNode || element,
50
54
  isNew: isNew,
51
55
  autoFocus: focusDateInput,
52
56
  onDelete: function onDelete() {
@@ -9,6 +9,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
9
9
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
10
  /** @jsx jsx */
11
11
  import React from 'react';
12
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
12
13
  import { css, jsx } from '@emotion/react';
13
14
  import { injectIntl } from 'react-intl-next';
14
15
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
@@ -9,6 +9,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
9
9
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
10
  /** @jsx jsx */
11
11
  import React from 'react';
12
+
13
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
12
14
  import { css, jsx } from '@emotion/react';
13
15
  import ReactDOM from 'react-dom';
14
16
  import { injectIntl } from 'react-intl-next';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-date",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "Date plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -20,7 +20,10 @@
20
20
  "types": "dist/types/index.d.ts",
21
21
  "typesVersions": {
22
22
  ">=4.5 <4.9": {
23
- "*": ["dist/types-ts4.5/*", "dist/types-ts4.5/index.d.ts"]
23
+ "*": [
24
+ "dist/types-ts4.5/*",
25
+ "dist/types-ts4.5/index.d.ts"
26
+ ]
24
27
  }
25
28
  },
26
29
  "sideEffects": false,
@@ -30,18 +33,18 @@
30
33
  },
31
34
  "dependencies": {
32
35
  "@atlaskit/adf-schema": "^36.10.7",
33
- "@atlaskit/calendar": "^14.2.0",
36
+ "@atlaskit/calendar": "^14.3.0",
34
37
  "@atlaskit/date": "^0.10.0",
35
- "@atlaskit/editor-common": "^82.6.0",
38
+ "@atlaskit/editor-common": "^82.9.0",
36
39
  "@atlaskit/editor-plugin-analytics": "^1.2.0",
37
40
  "@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
38
41
  "@atlaskit/editor-prosemirror": "4.0.1",
39
42
  "@atlaskit/editor-shared-styles": "^2.12.0",
40
- "@atlaskit/form": "^10.3.0",
43
+ "@atlaskit/form": "^10.4.0",
41
44
  "@atlaskit/locale": "^2.7.0",
42
- "@atlaskit/textfield": "6.3.1",
43
- "@atlaskit/theme": "^12.9.0",
44
- "@atlaskit/tokens": "^1.50.0",
45
+ "@atlaskit/textfield": "6.4.0",
46
+ "@atlaskit/theme": "^12.11.0",
47
+ "@atlaskit/tokens": "^1.51.0",
45
48
  "@babel/runtime": "^7.0.0",
46
49
  "@emotion/react": "^11.7.1",
47
50
  "date-fns": "^2.17.0",
@@ -68,18 +71,35 @@
68
71
  },
69
72
  "techstack": {
70
73
  "@atlassian/frontend": {
71
- "import-structure": ["atlassian-conventions"],
72
- "circular-dependencies": ["file-and-folder-level"]
74
+ "import-structure": [
75
+ "atlassian-conventions"
76
+ ],
77
+ "circular-dependencies": [
78
+ "file-and-folder-level"
79
+ ]
73
80
  },
74
81
  "@repo/internal": {
75
82
  "dom-events": "use-bind-event-listener",
76
- "analytics": ["analytics-next"],
77
- "design-tokens": ["color"],
78
- "theming": ["react-context"],
79
- "ui-components": ["lite-mode"],
83
+ "analytics": [
84
+ "analytics-next"
85
+ ],
86
+ "design-tokens": [
87
+ "color"
88
+ ],
89
+ "theming": [
90
+ "react-context"
91
+ ],
92
+ "ui-components": [
93
+ "lite-mode"
94
+ ],
80
95
  "deprecation": "no-deprecated-imports",
81
- "styling": ["emotion", "emotion"],
82
- "imports": ["import-no-extraneous-disable-for-examples-and-docs"]
96
+ "styling": [
97
+ "emotion",
98
+ "emotion"
99
+ ],
100
+ "imports": [
101
+ "import-no-extraneous-disable-for-examples-and-docs"
102
+ ]
83
103
  }
84
104
  }
85
105
  }