@atlaskit/editor-plugin-date 4.1.9 → 4.2.0

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,28 @@
1
1
  # @atlaskit/editor-plugin-date
2
2
 
3
+ ## 4.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#139139](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/139139)
8
+ [`7f6b665d778dd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7f6b665d778dd) -
9
+ [https://product-fabric.atlassian.net/browse/ED-27499](ED-27499) - the new
10
+ `@atlassian/confluence-presets` package with Confluence `full-page` preset is created
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 4.1.10
17
+
18
+ ### Patch Changes
19
+
20
+ - [#138373](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/138373)
21
+ [`3a6e2723e498c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3a6e2723e498c) -
22
+ [ux] [A11Y-10137] Add visually hidden alert for when the date picker opens letting screen reader
23
+ users know how to access the date picker popup
24
+ - Updated dependencies
25
+
3
26
  ## 4.1.9
4
27
 
5
28
  ### Patch Changes
@@ -18,10 +18,13 @@ var _react = _interopRequireDefault(require("react"));
18
18
  var _reactIntlNext = require("react-intl-next");
19
19
  var _calendar = _interopRequireDefault(require("@atlaskit/calendar"));
20
20
  var _analytics = require("@atlaskit/editor-common/analytics");
21
+ var _messages = require("@atlaskit/editor-common/messages");
21
22
  var _ui = require("@atlaskit/editor-common/ui");
22
23
  var _utils = require("@atlaskit/editor-common/utils");
23
24
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
25
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
24
26
  var _colors = require("@atlaskit/theme/colors");
27
+ var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
25
28
  var _datePickerInput = _interopRequireDefault(require("./date-picker-input"));
26
29
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
27
30
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
@@ -142,9 +145,11 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
142
145
  mountTo: mountTo,
143
146
  boundariesElement: boundariesElement,
144
147
  scrollableElement: scrollableElement,
145
- ariaLabel: null,
146
148
  preventOverflow: true
147
- }, /*#__PURE__*/_react.default.createElement(_ui.PlainOutsideClickTargetRefContext.Consumer, null, function (setOutsideClickTargetRef) {
149
+ }, (0, _platformFeatureFlags.fg)('editor_a11y_announce_date_picker_open') && /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, {
150
+ "aria-atomic": true,
151
+ role: "alert"
152
+ }, intl.formatMessage(_messages.dateMessages.datePickerOpenedAlert)), /*#__PURE__*/_react.default.createElement(_ui.PlainOutsideClickTargetRefContext.Consumer, null, function (setOutsideClickTargetRef) {
148
153
  return /*#__PURE__*/_react.default.createElement("div", {
149
154
  ref: setOutsideClickTargetRef,
150
155
  className: (0, _runtime.ax)(["_2rko1sit _ca0qv77o _n3tdv77o _19bvv77o _u5f3v77o _16qskkzs _bfhk13b4"]),
@@ -6,10 +6,13 @@ import React from 'react';
6
6
  import { injectIntl } from 'react-intl-next';
7
7
  import Calendar from '@atlaskit/calendar';
8
8
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
9
+ import { dateMessages as messages } from '@atlaskit/editor-common/messages';
9
10
  import { PlainOutsideClickTargetRefContext, Popup, withOuterListeners } from '@atlaskit/editor-common/ui';
10
11
  import { timestampToIsoFormat, timestampToUTCDate } from '@atlaskit/editor-common/utils';
11
12
  import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
13
+ import { fg } from '@atlaskit/platform-feature-flags';
12
14
  import { N0, N60A } from '@atlaskit/theme/colors';
15
+ import VisuallyHidden from '@atlaskit/visually-hidden';
13
16
  const PopupWithListeners = withOuterListeners(Popup);
14
17
  import DatePickerInput from './date-picker-input';
15
18
 
@@ -128,9 +131,11 @@ class DatePicker extends React.Component {
128
131
  mountTo: mountTo,
129
132
  boundariesElement: boundariesElement,
130
133
  scrollableElement: scrollableElement,
131
- ariaLabel: null,
132
134
  preventOverflow: true
133
- }, /*#__PURE__*/React.createElement(PlainOutsideClickTargetRefContext.Consumer, null, setOutsideClickTargetRef => /*#__PURE__*/React.createElement("div", {
135
+ }, fg('editor_a11y_announce_date_picker_open') && /*#__PURE__*/React.createElement(VisuallyHidden, {
136
+ "aria-atomic": true,
137
+ role: "alert"
138
+ }, intl.formatMessage(messages.datePickerOpenedAlert)), /*#__PURE__*/React.createElement(PlainOutsideClickTargetRefContext.Consumer, null, setOutsideClickTargetRef => /*#__PURE__*/React.createElement("div", {
134
139
  ref: setOutsideClickTargetRef,
135
140
  className: ax(["_2rko1sit _ca0qv77o _n3tdv77o _19bvv77o _u5f3v77o _16qsreen _bfhk1bhr"])
136
141
  }, /*#__PURE__*/React.createElement(DatePickerInput, {
@@ -13,10 +13,13 @@ import React from 'react';
13
13
  import { injectIntl } from 'react-intl-next';
14
14
  import Calendar from '@atlaskit/calendar';
15
15
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
16
+ import { dateMessages as messages } from '@atlaskit/editor-common/messages';
16
17
  import { PlainOutsideClickTargetRefContext, Popup, withOuterListeners } from '@atlaskit/editor-common/ui';
17
18
  import { timestampToIsoFormat, timestampToUTCDate } from '@atlaskit/editor-common/utils';
18
19
  import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
20
+ import { fg } from '@atlaskit/platform-feature-flags';
19
21
  import { N0, N60A } from '@atlaskit/theme/colors';
22
+ import VisuallyHidden from '@atlaskit/visually-hidden';
20
23
  var PopupWithListeners = withOuterListeners(Popup);
21
24
  import DatePickerInput from './date-picker-input';
22
25
 
@@ -136,9 +139,11 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
136
139
  mountTo: mountTo,
137
140
  boundariesElement: boundariesElement,
138
141
  scrollableElement: scrollableElement,
139
- ariaLabel: null,
140
142
  preventOverflow: true
141
- }, /*#__PURE__*/React.createElement(PlainOutsideClickTargetRefContext.Consumer, null, function (setOutsideClickTargetRef) {
143
+ }, fg('editor_a11y_announce_date_picker_open') && /*#__PURE__*/React.createElement(VisuallyHidden, {
144
+ "aria-atomic": true,
145
+ role: "alert"
146
+ }, intl.formatMessage(messages.datePickerOpenedAlert)), /*#__PURE__*/React.createElement(PlainOutsideClickTargetRefContext.Consumer, null, function (setOutsideClickTargetRef) {
142
147
  return /*#__PURE__*/React.createElement("div", {
143
148
  ref: setOutsideClickTargetRef,
144
149
  className: ax(["_2rko1sit _ca0qv77o _n3tdv77o _19bvv77o _u5f3v77o _16qskkzs _bfhk13b4"]),
@@ -1,3 +1,3 @@
1
1
  export { default as datePlugin } from './datePlugin';
2
2
  export type { DatePlugin } from './datePluginType';
3
- export type { DatePluginSharedState, DatePluginConfig, DateType, InsertDate } from './types';
3
+ export type { DatePluginSharedState, DatePluginConfig, DatePluginOptions, DateType, InsertDate, } from './types';
@@ -9,7 +9,7 @@ export declare const closeDatePicker: () => Command;
9
9
  export declare const closeDatePickerWithAnalytics: ({ date, pluginInjectionApi, }: {
10
10
  date?: DateType | undefined;
11
11
  pluginInjectionApi?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"date", {
12
- pluginConfiguration: import("../types").DatePluginConfig | undefined;
12
+ pluginConfiguration: import("../types").DatePluginOptions | undefined;
13
13
  dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
14
14
  pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
15
15
  sharedState: {
@@ -37,12 +37,12 @@ export declare const closeDatePickerWithAnalytics: ({ date, pluginInjectionApi,
37
37
  }, import("@atlaskit/editor-plugin-annotation").AnnotationProviders | undefined>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
38
38
  sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
39
39
  dependencies: [];
40
- pluginConfiguration?: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginConfig | undefined;
40
+ pluginConfiguration?: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginOptions | undefined;
41
41
  commands: {
42
42
  updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
43
43
  updateContentMode: (action: import("packages/editor/editor-plugin-editor-viewmode/dist/types/editorViewmodePluginType").UpdateContentModeAction) => import("@atlaskit/editor-common/types").EditorCommand;
44
44
  };
45
- }, import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginConfig | undefined>>];
45
+ }, import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginOptions | undefined>>];
46
46
  sharedState: import("../types").DatePluginSharedState;
47
47
  commands: {
48
48
  insertDate: import("../types").InsertDate;
@@ -11,9 +11,15 @@ export type DateType = {
11
11
  month: number;
12
12
  day?: number;
13
13
  };
14
- export interface DatePluginConfig {
14
+ export interface DatePluginOptions {
15
15
  weekStartDay?: WeekDay;
16
16
  }
17
+ /**
18
+ * @private
19
+ * @deprecated Use {@link DatePluginOptions} instead.
20
+ * @see https://product-fabric.atlassian.net/browse/ED-27496
21
+ */
22
+ export type DatePluginConfig = DatePluginOptions;
17
23
  export type DatePluginSharedState = {
18
24
  showDatePickerAt?: number | null;
19
25
  isNew: boolean;
@@ -27,7 +33,7 @@ export type InsertDate = (props: {
27
33
  }) => EditorCommand;
28
34
  export type DeleteDate = EditorCommand;
29
35
  export type DatePlugin = NextEditorPlugin<'date', {
30
- pluginConfiguration: DatePluginConfig | undefined;
36
+ pluginConfiguration: DatePluginOptions | undefined;
31
37
  dependencies: [
32
38
  typeof analyticsPlugin,
33
39
  EditorDisabledPlugin,
@@ -1,3 +1,3 @@
1
1
  export { default as datePlugin } from './datePlugin';
2
2
  export type { DatePlugin } from './datePluginType';
3
- export type { DatePluginSharedState, DatePluginConfig, DateType, InsertDate } from './types';
3
+ export type { DatePluginSharedState, DatePluginConfig, DatePluginOptions, DateType, InsertDate, } from './types';
@@ -9,7 +9,7 @@ export declare const closeDatePicker: () => Command;
9
9
  export declare const closeDatePickerWithAnalytics: ({ date, pluginInjectionApi, }: {
10
10
  date?: DateType | undefined;
11
11
  pluginInjectionApi?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"date", {
12
- pluginConfiguration: import("../types").DatePluginConfig | undefined;
12
+ pluginConfiguration: import("../types").DatePluginOptions | undefined;
13
13
  dependencies: [
14
14
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
15
15
  pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
@@ -44,12 +44,12 @@ export declare const closeDatePickerWithAnalytics: ({ date, pluginInjectionApi,
44
44
  sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
45
45
  dependencies: [
46
46
  ];
47
- pluginConfiguration?: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginConfig | undefined;
47
+ pluginConfiguration?: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginOptions | undefined;
48
48
  commands: {
49
49
  updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
50
50
  updateContentMode: (action: import("packages/editor/editor-plugin-editor-viewmode/dist/types/editorViewmodePluginType").UpdateContentModeAction) => import("@atlaskit/editor-common/types").EditorCommand;
51
51
  };
52
- }, import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginConfig | undefined>>
52
+ }, import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginOptions | undefined>>
53
53
  ];
54
54
  sharedState: import("../types").DatePluginSharedState;
55
55
  commands: {
@@ -11,9 +11,15 @@ export type DateType = {
11
11
  month: number;
12
12
  day?: number;
13
13
  };
14
- export interface DatePluginConfig {
14
+ export interface DatePluginOptions {
15
15
  weekStartDay?: WeekDay;
16
16
  }
17
+ /**
18
+ * @private
19
+ * @deprecated Use {@link DatePluginOptions} instead.
20
+ * @see https://product-fabric.atlassian.net/browse/ED-27496
21
+ */
22
+ export type DatePluginConfig = DatePluginOptions;
17
23
  export type DatePluginSharedState = {
18
24
  showDatePickerAt?: number | null;
19
25
  isNew: boolean;
@@ -27,7 +33,7 @@ export type InsertDate = (props: {
27
33
  }) => EditorCommand;
28
34
  export type DeleteDate = EditorCommand;
29
35
  export type DatePlugin = NextEditorPlugin<'date', {
30
- pluginConfiguration: DatePluginConfig | undefined;
36
+ pluginConfiguration: DatePluginOptions | undefined;
31
37
  dependencies: [
32
38
  typeof analyticsPlugin,
33
39
  EditorDisabledPlugin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-date",
3
- "version": "4.1.9",
3
+ "version": "4.2.0",
4
4
  "description": "Date plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -37,11 +37,11 @@
37
37
  "@atlaskit/calendar": "^17.1.0",
38
38
  "@atlaskit/css": "^0.10.0",
39
39
  "@atlaskit/date": "^2.0.0",
40
- "@atlaskit/editor-common": "^103.0.0",
40
+ "@atlaskit/editor-common": "^103.4.0",
41
41
  "@atlaskit/editor-plugin-analytics": "^2.2.0",
42
- "@atlaskit/editor-plugin-annotation": "^2.2.0",
42
+ "@atlaskit/editor-plugin-annotation": "^2.5.0",
43
43
  "@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
44
- "@atlaskit/editor-plugin-editor-viewmode": "^3.0.0",
44
+ "@atlaskit/editor-plugin-editor-viewmode": "^3.1.0",
45
45
  "@atlaskit/editor-prosemirror": "7.0.0",
46
46
  "@atlaskit/editor-shared-styles": "^3.4.0",
47
47
  "@atlaskit/form": "^12.0.0",
@@ -52,6 +52,7 @@
52
52
  "@atlaskit/theme": "^18.0.0",
53
53
  "@atlaskit/tmp-editor-statsig": "^4.6.0",
54
54
  "@atlaskit/tokens": "^4.7.0",
55
+ "@atlaskit/visually-hidden": "^3.0.0",
55
56
  "@babel/runtime": "^7.0.0",
56
57
  "bind-event-listener": "^3.0.0",
57
58
  "date-fns": "^2.17.0",
@@ -62,12 +63,12 @@
62
63
  "@atlaskit/editor-plugin-composition": "^1.3.0",
63
64
  "@atlaskit/editor-plugin-content-insertion": "^2.1.0",
64
65
  "@atlaskit/editor-plugin-decorations": "^2.0.0",
65
- "@atlaskit/editor-plugin-feature-flags": "^1.3.0",
66
+ "@atlaskit/editor-plugin-feature-flags": "^1.4.0",
66
67
  "@atlaskit/editor-plugin-guideline": "^2.0.0",
67
- "@atlaskit/editor-plugin-quick-insert": "^2.2.0",
68
+ "@atlaskit/editor-plugin-quick-insert": "^2.3.0",
68
69
  "@atlaskit/editor-plugin-selection": "^2.1.0",
69
- "@atlaskit/editor-plugin-table": "^10.6.0",
70
- "@atlaskit/editor-plugin-tasks-and-decisions": "^5.0.0",
70
+ "@atlaskit/editor-plugin-table": "^10.7.0",
71
+ "@atlaskit/editor-plugin-tasks-and-decisions": "^5.1.0",
71
72
  "@atlaskit/editor-plugin-type-ahead": "^2.3.0",
72
73
  "@atlaskit/editor-plugin-width": "^3.0.0",
73
74
  "@testing-library/react": "^13.4.0"
@@ -114,6 +115,9 @@
114
115
  "platform-feature-flags": {
115
116
  "editor_inline_comments_paste_insert_nodes": {
116
117
  "type": "boolean"
118
+ },
119
+ "editor_a11y_announce_date_picker_open": {
120
+ "type": "boolean"
117
121
  }
118
122
  }
119
123
  }