@atlaskit/editor-plugin-date 2.0.2 → 2.0.4

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,20 @@
1
1
  # @atlaskit/editor-plugin-date
2
2
 
3
+ ## 2.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#122612](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/122612)
8
+ [`01a85ce0a88ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/01a85ce0a88ec) -
9
+ [ux] ED-23705 Add logic to handle annotations on inline nodes when they are inserted or pasted.
10
+ Covers the following inline nodes: emoji, status, mention, date, inlineCard
11
+
12
+ ## 2.0.3
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 2.0.2
4
19
 
5
20
  ### Patch Changes
@@ -9,15 +9,17 @@ var _utils = require("@atlaskit/editor-common/utils");
9
9
  var _model = require("@atlaskit/editor-prosemirror/model");
10
10
  var _state = require("@atlaskit/editor-prosemirror/state");
11
11
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _pluginKey = require("./pm-plugins/plugin-key");
13
14
  var _internal = require("./utils/internal");
14
15
  var createDate = exports.createDate = function createDate(isQuickInsertAction) {
15
16
  return function (state) {
17
+ var tr = state.tr;
18
+ var annotationMarksForPos = (0, _platformFeatureFlags.fg)('editor_inline_comments_paste_insert_nodes') ? (0, _utils.getAnnotationMarksForPos)(tr.selection.$head) : undefined;
16
19
  var dateNode = state.schema.nodes.date.createChecked({
17
20
  timestamp: (0, _utils.todayTimestampInUTC)()
18
- });
19
- var fragment = _model.Fragment.fromArray([dateNode, state.schema.text(' ')]);
20
- var tr = state.tr;
21
+ }, null, (0, _platformFeatureFlags.fg)('editor_inline_comments_paste_insert_nodes') ? annotationMarksForPos : undefined);
22
+ var fragment = _model.Fragment.fromArray([dateNode, state.schema.text(' ', (0, _platformFeatureFlags.fg)('editor_inline_comments_paste_insert_nodes') ? annotationMarksForPos : undefined)]);
21
23
  var insertable = (0, _utils2.canInsert)(tr.selection.$from, fragment);
22
24
  if (!insertable) {
23
25
  var parentSelection = _state.NodeSelection.create(tr.doc, tr.selection.from - tr.selection.$anchor.parentOffset - 1);
@@ -22,7 +22,10 @@ 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 */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
26
+ * @jsxRuntime classic
27
+ * @jsx jsx
28
+ */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
29
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
27
30
  var dateTextFieldWrapper = (0, _react2.css)({
28
31
  // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
@@ -25,7 +25,10 @@ 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 */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
28
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
29
+ * @jsxRuntime classic
30
+ * @jsx jsx
31
+ */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
29
32
  var PopupWithListeners = (0, _ui.withOuterListeners)(_ui.Popup);
30
33
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
31
34
  var popupContentWrapper = (0, _react2.css)({
@@ -1,16 +1,18 @@
1
1
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import { todayTimestampInUTC } from '@atlaskit/editor-common/utils';
2
+ import { getAnnotationMarksForPos, todayTimestampInUTC } from '@atlaskit/editor-common/utils';
3
3
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
4
4
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { canInsert } from '@atlaskit/editor-prosemirror/utils';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import { pluginKey } from './pm-plugins/plugin-key';
7
8
  import { isToday } from './utils/internal';
8
9
  export const createDate = isQuickInsertAction => state => {
10
+ const tr = state.tr;
11
+ const annotationMarksForPos = fg('editor_inline_comments_paste_insert_nodes') ? getAnnotationMarksForPos(tr.selection.$head) : undefined;
9
12
  const dateNode = state.schema.nodes.date.createChecked({
10
13
  timestamp: todayTimestampInUTC()
11
- });
12
- const fragment = Fragment.fromArray([dateNode, state.schema.text(' ')]);
13
- const tr = state.tr;
14
+ }, null, fg('editor_inline_comments_paste_insert_nodes') ? annotationMarksForPos : undefined);
15
+ const fragment = Fragment.fromArray([dateNode, state.schema.text(' ', fg('editor_inline_comments_paste_insert_nodes') ? annotationMarksForPos : undefined)]);
14
16
  const insertable = canInsert(tr.selection.$from, fragment);
15
17
  if (!insertable) {
16
18
  const parentSelection = NodeSelection.create(tr.doc, tr.selection.from - tr.selection.$anchor.parentOffset - 1);
@@ -1,5 +1,8 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- /** @jsx jsx */
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
3
6
  import React from 'react';
4
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
5
8
  import { css, jsx } from '@emotion/react';
@@ -1,5 +1,8 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- /** @jsx jsx */
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
3
6
  import React from 'react';
4
7
 
5
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -1,17 +1,19 @@
1
1
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import { todayTimestampInUTC } from '@atlaskit/editor-common/utils';
2
+ import { getAnnotationMarksForPos, todayTimestampInUTC } from '@atlaskit/editor-common/utils';
3
3
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
4
4
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { canInsert } from '@atlaskit/editor-prosemirror/utils';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import { pluginKey } from './pm-plugins/plugin-key';
7
8
  import { isToday } from './utils/internal';
8
9
  export var createDate = function createDate(isQuickInsertAction) {
9
10
  return function (state) {
11
+ var tr = state.tr;
12
+ var annotationMarksForPos = fg('editor_inline_comments_paste_insert_nodes') ? getAnnotationMarksForPos(tr.selection.$head) : undefined;
10
13
  var dateNode = state.schema.nodes.date.createChecked({
11
14
  timestamp: todayTimestampInUTC()
12
- });
13
- var fragment = Fragment.fromArray([dateNode, state.schema.text(' ')]);
14
- var tr = state.tr;
15
+ }, null, fg('editor_inline_comments_paste_insert_nodes') ? annotationMarksForPos : undefined);
16
+ var fragment = Fragment.fromArray([dateNode, state.schema.text(' ', fg('editor_inline_comments_paste_insert_nodes') ? annotationMarksForPos : undefined)]);
15
17
  var insertable = canInsert(tr.selection.$from, fragment);
16
18
  if (!insertable) {
17
19
  var parentSelection = NodeSelection.create(tr.doc, tr.selection.from - tr.selection.$anchor.parentOffset - 1);
@@ -7,7 +7,10 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
9
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
- /** @jsx jsx */
10
+ /**
11
+ * @jsxRuntime classic
12
+ * @jsx jsx
13
+ */
11
14
  import React from 'react';
12
15
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
13
16
  import { css, jsx } from '@emotion/react';
@@ -7,7 +7,10 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
9
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
- /** @jsx jsx */
10
+ /**
11
+ * @jsxRuntime classic
12
+ * @jsx jsx
13
+ */
11
14
  import React from 'react';
12
15
 
13
16
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -1,4 +1,7 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  import React from 'react';
3
6
  import type { WrappedComponentProps } from 'react-intl-next';
4
7
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
@@ -1,4 +1,7 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  import React from 'react';
3
6
  import type { WrappedComponentProps } from 'react-intl-next';
4
7
  import type { WeekDay } from '@atlaskit/calendar/types';
@@ -1,4 +1,7 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  import React from 'react';
3
6
  import type { WrappedComponentProps } from 'react-intl-next';
4
7
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
@@ -1,4 +1,7 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  import React from 'react';
3
6
  import type { WrappedComponentProps } from 'react-intl-next';
4
7
  import type { WeekDay } from '@atlaskit/calendar/types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-date",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "Date plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,16 +35,17 @@
35
35
  "@atlaskit/adf-schema": "^39.0.3",
36
36
  "@atlaskit/calendar": "^14.3.0",
37
37
  "@atlaskit/date": "^0.10.0",
38
- "@atlaskit/editor-common": "^85.0.0",
38
+ "@atlaskit/editor-common": "^86.4.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^1.4.0",
40
40
  "@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
41
41
  "@atlaskit/editor-prosemirror": "4.0.1",
42
42
  "@atlaskit/editor-shared-styles": "^2.13.0",
43
43
  "@atlaskit/form": "^10.4.0",
44
44
  "@atlaskit/locale": "^2.7.0",
45
+ "@atlaskit/platform-feature-flags": "^0.3.0",
45
46
  "@atlaskit/textfield": "6.4.2",
46
47
  "@atlaskit/theme": "^12.11.0",
47
- "@atlaskit/tokens": "^1.54.0",
48
+ "@atlaskit/tokens": "^1.56.0",
48
49
  "@babel/runtime": "^7.0.0",
49
50
  "@emotion/react": "^11.7.1",
50
51
  "date-fns": "^2.17.0",
@@ -60,7 +61,7 @@
60
61
  "@atlaskit/editor-plugin-guideline": "^1.1.0",
61
62
  "@atlaskit/editor-plugin-quick-insert": "^1.1.0",
62
63
  "@atlaskit/editor-plugin-selection": "^1.2.0",
63
- "@atlaskit/editor-plugin-table": "^7.20.0",
64
+ "@atlaskit/editor-plugin-table": "^7.21.0",
64
65
  "@atlaskit/editor-plugin-tasks-and-decisions": "^2.1.0",
65
66
  "@atlaskit/editor-plugin-type-ahead": "^1.4.0",
66
67
  "@atlaskit/editor-plugin-width": "^1.1.0",
@@ -101,5 +102,10 @@
101
102
  "import-no-extraneous-disable-for-examples-and-docs"
102
103
  ]
103
104
  }
105
+ },
106
+ "platform-feature-flags": {
107
+ "editor_inline_comments_paste_insert_nodes": {
108
+ "type": "boolean"
109
+ }
104
110
  }
105
111
  }