@atlaskit/editor-core 185.9.5 → 185.10.3

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/cjs/labs/next/presets/universal.js +4 -1
  3. package/dist/cjs/plugins/collab-edit/index.js +1 -8
  4. package/dist/cjs/plugins/collab-edit/plugin.js +8 -1
  5. package/dist/cjs/plugins/date/index.js +9 -4
  6. package/dist/cjs/plugins/date/ui/DatePicker/index.js +4 -2
  7. package/dist/cjs/version-wrapper.js +1 -1
  8. package/dist/cjs/version.json +1 -1
  9. package/dist/es2019/labs/next/presets/universal.js +4 -1
  10. package/dist/es2019/plugins/collab-edit/index.js +1 -6
  11. package/dist/es2019/plugins/collab-edit/plugin.js +6 -1
  12. package/dist/es2019/plugins/date/index.js +7 -4
  13. package/dist/es2019/plugins/date/ui/DatePicker/index.js +4 -2
  14. package/dist/es2019/version-wrapper.js +1 -1
  15. package/dist/es2019/version.json +1 -1
  16. package/dist/esm/labs/next/presets/universal.js +4 -1
  17. package/dist/esm/plugins/collab-edit/index.js +1 -8
  18. package/dist/esm/plugins/collab-edit/plugin.js +8 -1
  19. package/dist/esm/plugins/date/index.js +9 -4
  20. package/dist/esm/plugins/date/ui/DatePicker/index.js +4 -2
  21. package/dist/esm/version-wrapper.js +1 -1
  22. package/dist/esm/version.json +1 -1
  23. package/dist/types/plugins/collab-edit/plugin.d.ts +2 -1
  24. package/dist/types/plugins/date/index.d.ts +2 -0
  25. package/dist/types/plugins/date/types.d.ts +4 -0
  26. package/dist/types/plugins/date/ui/DatePicker/index.d.ts +2 -0
  27. package/dist/types/types/editor-props.d.ts +2 -1
  28. package/dist/types-ts4.5/plugins/collab-edit/plugin.d.ts +2 -1
  29. package/dist/types-ts4.5/plugins/date/index.d.ts +2 -0
  30. package/dist/types-ts4.5/plugins/date/types.d.ts +4 -0
  31. package/dist/types-ts4.5/plugins/date/ui/DatePicker/index.d.ts +2 -0
  32. package/dist/types-ts4.5/types/editor-props.d.ts +2 -1
  33. package/package.json +2 -2
  34. package/report.api.md +8 -1
  35. package/tmp/api-report-tmp.d.ts +8 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 185.10.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`6c6c3491dfa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6c6c3491dfa) - Move collab provider subscription into plugin#view methods to avoid race conditions with re-configuring editor state
8
+
9
+ ## 185.10.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`41820924223`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41820924223) - [ux] [ED-15876] Add additional value option to `allowDate` editor prop. Previously it could only be a boolean (true or false) but now it can be a boolean OR an object with `weekStartDay` and `WeekDay` (from `@atlaskit/calendar/types`) type as the value.
14
+
15
+ Example Usage:
16
+
17
+ ```tsx
18
+ const startOfWeekDay = get(
19
+ getLocale(locale),
20
+ 'options.weekStartsOn',
21
+ DEFAULT_WEEK_START_DAY,
22
+ );
23
+
24
+ <Editor
25
+ editorProps={{
26
+ allowDate: { weekStartDay: 5 },
27
+ }}
28
+ />;
29
+ ```
30
+
31
+ OR
32
+
33
+ ```tsx
34
+ <Editor
35
+ editorProps={{
36
+ allowDate: false,
37
+ }}
38
+ />
39
+ ```
40
+
41
+ is also still valid.
42
+
43
+ This allows the users preferred day for the week to begin in the date calendar picker to be passed in to the editor. Eg. instead of it always defaulting to the week starting on Sunday (0), we could pass in 1 to make it Monday.
44
+
3
45
  ## 185.9.5
4
46
 
5
47
  ### Patch Changes
@@ -263,7 +263,10 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
263
263
  return builder;
264
264
  }).maybeAdd(_plugins.datePlugin, function (plugin, builder) {
265
265
  if (props.allowDate) {
266
- return builder.add(plugin);
266
+ var dateConfig = (0, _typeof2.default)(props.allowDate) === 'object' ? props.allowDate : {};
267
+ return builder.add([plugin, {
268
+ weekStartDay: dateConfig.weekStartDay
269
+ }]);
267
270
  }
268
271
  return builder;
269
272
  }).maybeAdd(_plugins.placeholderTextPlugin, function (plugin, builder) {
@@ -94,14 +94,7 @@ var collabEditPlugin = function collabEditPlugin(options, api) {
94
94
  plugin: function plugin(_ref3) {
95
95
  var dispatch = _ref3.dispatch,
96
96
  providerFactory = _ref3.providerFactory;
97
- providerFactory && providerFactory.subscribe('collabEditProvider', function (_name, providerPromise) {
98
- if (providerPromise) {
99
- providerPromise.then(function (provider) {
100
- return providerResolver(provider);
101
- });
102
- }
103
- });
104
- return (0, _plugin.createPlugin)(dispatch, providerFactory, executeProviderCode, options, featureFlags);
97
+ return (0, _plugin.createPlugin)(dispatch, providerFactory, providerResolver, executeProviderCode, options, featureFlags);
105
98
  }
106
99
  }]);
107
100
  },
@@ -22,7 +22,7 @@ var _pluginState = require("./plugin-state");
22
22
  var _pluginKey = require("./plugin-key");
23
23
  var _analytics = require("./analytics");
24
24
  var _analytics2 = require("@atlaskit/editor-common/analytics");
25
- var createPlugin = function createPlugin(dispatch, providerFactory, collabProviderCallback, options, featureFlags) {
25
+ var createPlugin = function createPlugin(dispatch, providerFactory, providerResolver, collabProviderCallback, options, featureFlags) {
26
26
  var fireAnalyticsCallback = (0, _analytics2.fireAnalyticsEvent)(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
27
27
  return new _safePlugin.SafePlugin({
28
28
  key: _pluginKey.pluginKey,
@@ -75,6 +75,13 @@ var createPlugin = function createPlugin(dispatch, providerFactory, collabProvid
75
75
  providerFactory: providerFactory,
76
76
  featureFlags: featureFlags
77
77
  }), addErrorAnalytics);
78
+ providerFactory && providerFactory.subscribe('collabEditProvider', function (_name, providerPromise) {
79
+ if (providerPromise) {
80
+ providerPromise.then(function (provider) {
81
+ return providerResolver(provider);
82
+ });
83
+ }
84
+ });
78
85
  return {
79
86
  destroy: function destroy() {
80
87
  providerFactory.unsubscribeAll('collabEditProvider');
@@ -38,7 +38,8 @@ function ContentComponent(_ref) {
38
38
  popupsMountPoint = _ref.popupsMountPoint,
39
39
  popupsBoundariesElement = _ref.popupsBoundariesElement,
40
40
  popupsScrollableElement = _ref.popupsScrollableElement,
41
- dependencyApi = _ref.dependencyApi;
41
+ dependencyApi = _ref.dependencyApi,
42
+ weekStartDay = _ref.weekStartDay;
42
43
  var dispatch = editorView.dispatch;
43
44
  var domAtPos = editorView.domAtPos.bind(editorView);
44
45
  var _useSharedPluginState = (0, _hooks.useSharedPluginState)(dependencyApi, ['date', 'editorDisabled']),
@@ -86,10 +87,13 @@ function ContentComponent(_ref) {
86
87
  })(editorView.state, dispatch);
87
88
  editorView.focus();
88
89
  },
89
- dispatchAnalyticsEvent: dispatchAnalyticsEvent
90
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
91
+ weekStartDay: weekStartDay
90
92
  });
91
93
  }
92
- var datePlugin = function datePlugin(_, api) {
94
+ var datePlugin = function datePlugin() {
95
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
96
+ var api = arguments.length > 1 ? arguments[1] : undefined;
93
97
  return {
94
98
  name: 'date',
95
99
  getSharedState: function getSharedState(editorState) {
@@ -143,7 +147,8 @@ var datePlugin = function datePlugin(_, api) {
143
147
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
144
148
  popupsMountPoint: popupsMountPoint,
145
149
  popupsBoundariesElement: popupsBoundariesElement,
146
- popupsScrollableElement: popupsScrollableElement
150
+ popupsScrollableElement: popupsScrollableElement,
151
+ weekStartDay: options.weekStartDay
147
152
  });
148
153
  },
149
154
  pluginsOptions: {
@@ -108,7 +108,8 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
108
108
  intl = _this$props.intl,
109
109
  dispatchAnalyticsEvent = _this$props.dispatchAnalyticsEvent,
110
110
  isNew = _this$props.isNew,
111
- autoFocus = _this$props.autoFocus;
111
+ autoFocus = _this$props.autoFocus,
112
+ weekStartDay = _this$props.weekStartDay;
112
113
  var timestamp = element.getAttribute('timestamp');
113
114
  if (this.state === null) {
114
115
  // Without this, you can blow up the page by slowing down cpu, opening date, typing after date
@@ -156,7 +157,8 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
156
157
  month: month,
157
158
  year: year,
158
159
  selected: selected,
159
- ref: this.handleRef
160
+ ref: this.handleRef,
161
+ weekStartDay: weekStartDay
160
162
  })));
161
163
  }
162
164
  }]);
@@ -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 = "185.9.5";
9
+ var version = "185.10.3";
10
10
  exports.version = version;
11
11
  var nextMajorVersion = function nextMajorVersion() {
12
12
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.9.5",
3
+ "version": "185.10.3",
4
4
  "sideEffects": false
5
5
  }
@@ -258,7 +258,10 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
258
258
  return builder;
259
259
  }).maybeAdd(datePlugin, (plugin, builder) => {
260
260
  if (props.allowDate) {
261
- return builder.add(plugin);
261
+ const dateConfig = typeof props.allowDate === 'object' ? props.allowDate : {};
262
+ return builder.add([plugin, {
263
+ weekStartDay: dateConfig.weekStartDay
264
+ }]);
262
265
  }
263
266
  return builder;
264
267
  }).maybeAdd(placeholderTextPlugin, (plugin, builder) => {
@@ -50,12 +50,7 @@ const collabEditPlugin = (options, api) => {
50
50
  dispatch,
51
51
  providerFactory
52
52
  }) => {
53
- providerFactory && providerFactory.subscribe('collabEditProvider', (_name, providerPromise) => {
54
- if (providerPromise) {
55
- providerPromise.then(provider => providerResolver(provider));
56
- }
57
- });
58
- return createPlugin(dispatch, providerFactory, executeProviderCode, options, featureFlags);
53
+ return createPlugin(dispatch, providerFactory, providerResolver, executeProviderCode, options, featureFlags);
59
54
  }
60
55
  }];
61
56
  },
@@ -5,7 +5,7 @@ import { pluginKey } from './plugin-key';
5
5
  import { addSynchronyErrorAnalytics } from './analytics';
6
6
  import { fireAnalyticsEvent, ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
7
7
  export { PluginState, pluginKey };
8
- export const createPlugin = (dispatch, providerFactory, collabProviderCallback, options, featureFlags) => {
8
+ export const createPlugin = (dispatch, providerFactory, providerResolver, collabProviderCallback, options, featureFlags) => {
9
9
  const fireAnalyticsCallback = fireAnalyticsEvent(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
10
10
  return new SafePlugin({
11
11
  key: pluginKey,
@@ -58,6 +58,11 @@ export const createPlugin = (dispatch, providerFactory, collabProviderCallback,
58
58
  providerFactory,
59
59
  featureFlags
60
60
  }), addErrorAnalytics);
61
+ providerFactory && providerFactory.subscribe('collabEditProvider', (_name, providerPromise) => {
62
+ if (providerPromise) {
63
+ providerPromise.then(provider => providerResolver(provider));
64
+ }
65
+ });
61
66
  return {
62
67
  destroy() {
63
68
  providerFactory.unsubscribeAll('collabEditProvider');
@@ -20,7 +20,8 @@ function ContentComponent({
20
20
  popupsMountPoint,
21
21
  popupsBoundariesElement,
22
22
  popupsScrollableElement,
23
- dependencyApi
23
+ dependencyApi,
24
+ weekStartDay
24
25
  }) {
25
26
  const {
26
27
  dispatch
@@ -75,10 +76,11 @@ function ContentComponent({
75
76
  })(editorView.state, dispatch);
76
77
  editorView.focus();
77
78
  },
78
- dispatchAnalyticsEvent: dispatchAnalyticsEvent
79
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
80
+ weekStartDay: weekStartDay
79
81
  });
80
82
  }
81
- const datePlugin = (_, api) => ({
83
+ const datePlugin = (options = {}, api) => ({
82
84
  name: 'date',
83
85
  getSharedState(editorState) {
84
86
  if (!editorState) {
@@ -133,7 +135,8 @@ const datePlugin = (_, api) => ({
133
135
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
134
136
  popupsMountPoint: popupsMountPoint,
135
137
  popupsBoundariesElement: popupsBoundariesElement,
136
- popupsScrollableElement: popupsScrollableElement
138
+ popupsScrollableElement: popupsScrollableElement,
139
+ weekStartDay: options.weekStartDay
137
140
  });
138
141
  },
139
142
  pluginsOptions: {
@@ -91,7 +91,8 @@ class DatePicker extends React.Component {
91
91
  intl,
92
92
  dispatchAnalyticsEvent,
93
93
  isNew,
94
- autoFocus
94
+ autoFocus,
95
+ weekStartDay
95
96
  } = this.props;
96
97
  const timestamp = element.getAttribute('timestamp');
97
98
  if (this.state === null) {
@@ -141,7 +142,8 @@ class DatePicker extends React.Component {
141
142
  month: month,
142
143
  year: year,
143
144
  selected: selected,
144
- ref: this.handleRef
145
+ ref: this.handleRef,
146
+ weekStartDay: weekStartDay
145
147
  })));
146
148
  }
147
149
  }
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "185.9.5";
2
+ export const version = "185.10.3";
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": "185.9.5",
3
+ "version": "185.10.3",
4
4
  "sideEffects": false
5
5
  }
@@ -256,7 +256,10 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
256
256
  return builder;
257
257
  }).maybeAdd(datePlugin, function (plugin, builder) {
258
258
  if (props.allowDate) {
259
- return builder.add(plugin);
259
+ var dateConfig = _typeof(props.allowDate) === 'object' ? props.allowDate : {};
260
+ return builder.add([plugin, {
261
+ weekStartDay: dateConfig.weekStartDay
262
+ }]);
260
263
  }
261
264
  return builder;
262
265
  }).maybeAdd(placeholderTextPlugin, function (plugin, builder) {
@@ -82,14 +82,7 @@ var collabEditPlugin = function collabEditPlugin(options, api) {
82
82
  plugin: function plugin(_ref3) {
83
83
  var dispatch = _ref3.dispatch,
84
84
  providerFactory = _ref3.providerFactory;
85
- providerFactory && providerFactory.subscribe('collabEditProvider', function (_name, providerPromise) {
86
- if (providerPromise) {
87
- providerPromise.then(function (provider) {
88
- return providerResolver(provider);
89
- });
90
- }
91
- });
92
- return createPlugin(dispatch, providerFactory, executeProviderCode, options, featureFlags);
85
+ return createPlugin(dispatch, providerFactory, providerResolver, executeProviderCode, options, featureFlags);
93
86
  }
94
87
  }]);
95
88
  },
@@ -5,7 +5,7 @@ import { pluginKey } from './plugin-key';
5
5
  import { addSynchronyErrorAnalytics } from './analytics';
6
6
  import { fireAnalyticsEvent, ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
7
7
  export { PluginState, pluginKey };
8
- export var createPlugin = function createPlugin(dispatch, providerFactory, collabProviderCallback, options, featureFlags) {
8
+ export var createPlugin = function createPlugin(dispatch, providerFactory, providerResolver, collabProviderCallback, options, featureFlags) {
9
9
  var fireAnalyticsCallback = fireAnalyticsEvent(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
10
10
  return new SafePlugin({
11
11
  key: pluginKey,
@@ -58,6 +58,13 @@ export var createPlugin = function createPlugin(dispatch, providerFactory, colla
58
58
  providerFactory: providerFactory,
59
59
  featureFlags: featureFlags
60
60
  }), addErrorAnalytics);
61
+ providerFactory && providerFactory.subscribe('collabEditProvider', function (_name, providerPromise) {
62
+ if (providerPromise) {
63
+ providerPromise.then(function (provider) {
64
+ return providerResolver(provider);
65
+ });
66
+ }
67
+ });
61
68
  return {
62
69
  destroy: function destroy() {
63
70
  providerFactory.unsubscribeAll('collabEditProvider');
@@ -26,7 +26,8 @@ function ContentComponent(_ref) {
26
26
  popupsMountPoint = _ref.popupsMountPoint,
27
27
  popupsBoundariesElement = _ref.popupsBoundariesElement,
28
28
  popupsScrollableElement = _ref.popupsScrollableElement,
29
- dependencyApi = _ref.dependencyApi;
29
+ dependencyApi = _ref.dependencyApi,
30
+ weekStartDay = _ref.weekStartDay;
30
31
  var dispatch = editorView.dispatch;
31
32
  var domAtPos = editorView.domAtPos.bind(editorView);
32
33
  var _useSharedPluginState = useSharedPluginState(dependencyApi, ['date', 'editorDisabled']),
@@ -74,10 +75,13 @@ function ContentComponent(_ref) {
74
75
  })(editorView.state, dispatch);
75
76
  editorView.focus();
76
77
  },
77
- dispatchAnalyticsEvent: dispatchAnalyticsEvent
78
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
79
+ weekStartDay: weekStartDay
78
80
  });
79
81
  }
80
- var datePlugin = function datePlugin(_, api) {
82
+ var datePlugin = function datePlugin() {
83
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
84
+ var api = arguments.length > 1 ? arguments[1] : undefined;
81
85
  return {
82
86
  name: 'date',
83
87
  getSharedState: function getSharedState(editorState) {
@@ -131,7 +135,8 @@ var datePlugin = function datePlugin(_, api) {
131
135
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
132
136
  popupsMountPoint: popupsMountPoint,
133
137
  popupsBoundariesElement: popupsBoundariesElement,
134
- popupsScrollableElement: popupsScrollableElement
138
+ popupsScrollableElement: popupsScrollableElement,
139
+ weekStartDay: options.weekStartDay
135
140
  });
136
141
  },
137
142
  pluginsOptions: {
@@ -101,7 +101,8 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
101
101
  intl = _this$props.intl,
102
102
  dispatchAnalyticsEvent = _this$props.dispatchAnalyticsEvent,
103
103
  isNew = _this$props.isNew,
104
- autoFocus = _this$props.autoFocus;
104
+ autoFocus = _this$props.autoFocus,
105
+ weekStartDay = _this$props.weekStartDay;
105
106
  var timestamp = element.getAttribute('timestamp');
106
107
  if (this.state === null) {
107
108
  // Without this, you can blow up the page by slowing down cpu, opening date, typing after date
@@ -149,7 +150,8 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
149
150
  month: month,
150
151
  year: year,
151
152
  selected: selected,
152
- ref: this.handleRef
153
+ ref: this.handleRef,
154
+ weekStartDay: weekStartDay
153
155
  })));
154
156
  }
155
157
  }]);
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "185.9.5";
2
+ export var version = "185.10.3";
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": "185.9.5",
3
+ "version": "185.10.3",
4
4
  "sideEffects": false
5
5
  }
@@ -5,5 +5,6 @@ import { PrivateCollabEditOptions, ProviderCallback } from './types';
5
5
  import { PluginState } from './plugin-state';
6
6
  import { pluginKey } from './plugin-key';
7
7
  import { FeatureFlags } from '@atlaskit/editor-common/types';
8
+ import type { CollabEditProvider } from '@atlaskit/collab-provider/types';
8
9
  export { PluginState, pluginKey };
9
- export declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, collabProviderCallback: ProviderCallback, options: PrivateCollabEditOptions, featureFlags: FeatureFlags) => SafePlugin<PluginState>;
10
+ export declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, providerResolver: (value: CollabEditProvider) => void, collabProviderCallback: ProviderCallback, options: PrivateCollabEditOptions, featureFlags: FeatureFlags) => SafePlugin<PluginState>;
@@ -1,7 +1,9 @@
1
1
  import { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
2
  import type editorDisabledPlugin from '../editor-disabled';
3
+ import { DatePluginConfig } from './types';
3
4
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
5
  declare const datePlugin: NextEditorPlugin<'date', {
6
+ pluginConfiguration: DatePluginConfig | undefined;
5
7
  dependencies: [typeof analyticsPlugin, typeof editorDisabledPlugin];
6
8
  sharedState: {
7
9
  showDatePickerAt?: number | null;
@@ -1,6 +1,10 @@
1
+ import type { WeekDay } from '@atlaskit/calendar/types';
1
2
  export type DateType = {
2
3
  year: number;
3
4
  month: number;
4
5
  day?: number;
5
6
  };
6
7
  export type DateSegment = 'day' | 'month' | 'year';
8
+ export interface DatePluginConfig {
9
+ weekStartDay?: WeekDay;
10
+ }
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
+ import type { WeekDay } from '@atlaskit/calendar/types';
3
4
  import { DateType } from '../../types';
4
5
  import { INPUT_METHOD } from '../../../analytics/types/enums';
5
6
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
@@ -21,6 +22,7 @@ export interface Props {
21
22
  }) => void;
22
23
  onTextChanged: (date: DateType) => void;
23
24
  dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
25
+ weekStartDay?: WeekDay;
24
26
  }
25
27
  export interface State {
26
28
  date: DateType;
@@ -15,6 +15,7 @@ import { AnnotationProviders } from '../plugins/annotation/types';
15
15
  import { BlockTypePluginOptions } from '../plugins/block-type/types';
16
16
  import { CodeBlockOptions } from '../plugins/code-block/types';
17
17
  import { CollabEditOptions } from '../plugins/collab-edit/types';
18
+ import { DatePluginConfig } from '../plugins/date/types';
18
19
  import { FindReplaceOptions } from '../plugins/find-replace/types';
19
20
  import type { LinkingOptions } from '@atlaskit/editor-common/types';
20
21
  import { LayoutPluginOptions } from '../plugins/layout/types';
@@ -208,7 +209,7 @@ export interface EditorPluginFeatureProps {
208
209
  allowExtension?: boolean | ExtensionConfig;
209
210
  allowConfluenceInlineComment?: boolean;
210
211
  allowTemplatePlaceholders?: boolean | PlaceholderTextOptions;
211
- allowDate?: boolean;
212
+ allowDate?: boolean | DatePluginConfig;
212
213
  allowLayouts?: boolean | LayoutPluginOptions;
213
214
  allowStatus?: boolean | {
214
215
  menuDisabled: boolean;
@@ -5,5 +5,6 @@ import { PrivateCollabEditOptions, ProviderCallback } from './types';
5
5
  import { PluginState } from './plugin-state';
6
6
  import { pluginKey } from './plugin-key';
7
7
  import { FeatureFlags } from '@atlaskit/editor-common/types';
8
+ import type { CollabEditProvider } from '@atlaskit/collab-provider/types';
8
9
  export { PluginState, pluginKey };
9
- export declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, collabProviderCallback: ProviderCallback, options: PrivateCollabEditOptions, featureFlags: FeatureFlags) => SafePlugin<PluginState>;
10
+ export declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, providerResolver: (value: CollabEditProvider) => void, collabProviderCallback: ProviderCallback, options: PrivateCollabEditOptions, featureFlags: FeatureFlags) => SafePlugin<PluginState>;
@@ -1,7 +1,9 @@
1
1
  import { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
2
  import type editorDisabledPlugin from '../editor-disabled';
3
+ import { DatePluginConfig } from './types';
3
4
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
5
  declare const datePlugin: NextEditorPlugin<'date', {
6
+ pluginConfiguration: DatePluginConfig | undefined;
5
7
  dependencies: [
6
8
  typeof analyticsPlugin,
7
9
  typeof editorDisabledPlugin
@@ -1,6 +1,10 @@
1
+ import type { WeekDay } from '@atlaskit/calendar/types';
1
2
  export type DateType = {
2
3
  year: number;
3
4
  month: number;
4
5
  day?: number;
5
6
  };
6
7
  export type DateSegment = 'day' | 'month' | 'year';
8
+ export interface DatePluginConfig {
9
+ weekStartDay?: WeekDay;
10
+ }
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
+ import type { WeekDay } from '@atlaskit/calendar/types';
3
4
  import { DateType } from '../../types';
4
5
  import { INPUT_METHOD } from '../../../analytics/types/enums';
5
6
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
@@ -21,6 +22,7 @@ export interface Props {
21
22
  }) => void;
22
23
  onTextChanged: (date: DateType) => void;
23
24
  dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
25
+ weekStartDay?: WeekDay;
24
26
  }
25
27
  export interface State {
26
28
  date: DateType;
@@ -15,6 +15,7 @@ import { AnnotationProviders } from '../plugins/annotation/types';
15
15
  import { BlockTypePluginOptions } from '../plugins/block-type/types';
16
16
  import { CodeBlockOptions } from '../plugins/code-block/types';
17
17
  import { CollabEditOptions } from '../plugins/collab-edit/types';
18
+ import { DatePluginConfig } from '../plugins/date/types';
18
19
  import { FindReplaceOptions } from '../plugins/find-replace/types';
19
20
  import type { LinkingOptions } from '@atlaskit/editor-common/types';
20
21
  import { LayoutPluginOptions } from '../plugins/layout/types';
@@ -208,7 +209,7 @@ export interface EditorPluginFeatureProps {
208
209
  allowExtension?: boolean | ExtensionConfig;
209
210
  allowConfluenceInlineComment?: boolean;
210
211
  allowTemplatePlaceholders?: boolean | PlaceholderTextOptions;
211
- allowDate?: boolean;
212
+ allowDate?: boolean | DatePluginConfig;
212
213
  allowLayouts?: boolean | LayoutPluginOptions;
213
214
  allowStatus?: boolean | {
214
215
  menuDisabled: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.9.5",
3
+ "version": "185.10.3",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -71,7 +71,7 @@
71
71
  "@atlaskit/icon-object": "^6.3.0",
72
72
  "@atlaskit/link-analytics": "^8.2.0",
73
73
  "@atlaskit/link-datasource": "^0.27.0",
74
- "@atlaskit/link-picker": "^1.25.0",
74
+ "@atlaskit/link-picker": "^1.26.0",
75
75
  "@atlaskit/locale": "^2.5.0",
76
76
  "@atlaskit/logo": "^13.14.0",
77
77
  "@atlaskit/media-card": "^76.0.0",
package/report.api.md CHANGED
@@ -164,6 +164,7 @@ import { UploadEndEventPayload } from '@atlaskit/media-picker/types';
164
164
  import { UploadErrorEventPayload } from '@atlaskit/media-picker/types';
165
165
  import { UploadParams } from '@atlaskit/media-picker/types';
166
166
  import { UploadPreviewUpdateEventPayload } from '@atlaskit/media-picker/types';
167
+ import type { WeekDay } from '@atlaskit/calendar/types';
167
168
  import type { widthPlugin } from '@atlaskit/editor-plugin-width';
168
169
  import { WithIntlProps } from 'react-intl-next';
169
170
  import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
@@ -525,6 +526,12 @@ export const dateMessages: {
525
526
  };
526
527
  };
527
528
 
529
+ // @public (undocumented)
530
+ interface DatePluginConfig {
531
+ // (undocumented)
532
+ weekStartDay?: WeekDay;
533
+ }
534
+
528
535
  // @public (undocumented)
529
536
  export const datePluginKey: PluginKey<DatePluginState>;
530
537
 
@@ -859,7 +866,7 @@ interface EditorPluginFeatureProps {
859
866
  // (undocumented)
860
867
  allowConfluenceInlineComment?: boolean;
861
868
  // (undocumented)
862
- allowDate?: boolean;
869
+ allowDate?: DatePluginConfig | boolean;
863
870
  // (undocumented)
864
871
  allowExpand?:
865
872
  | boolean
@@ -153,6 +153,7 @@ import { UploadEndEventPayload } from '@atlaskit/media-picker/types';
153
153
  import { UploadErrorEventPayload } from '@atlaskit/media-picker/types';
154
154
  import { UploadParams } from '@atlaskit/media-picker/types';
155
155
  import { UploadPreviewUpdateEventPayload } from '@atlaskit/media-picker/types';
156
+ import type { WeekDay } from '@atlaskit/calendar/types';
156
157
  import type { widthPlugin } from '@atlaskit/editor-plugin-width';
157
158
  import { WithIntlProps } from 'react-intl-next';
158
159
  import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
@@ -479,6 +480,12 @@ export const dateMessages: {
479
480
  };
480
481
  };
481
482
 
483
+ // @public (undocumented)
484
+ interface DatePluginConfig {
485
+ // (undocumented)
486
+ weekStartDay?: WeekDay;
487
+ }
488
+
482
489
  // @public (undocumented)
483
490
  export const datePluginKey: PluginKey<DatePluginState>;
484
491
 
@@ -784,7 +791,7 @@ interface EditorPluginFeatureProps {
784
791
  // (undocumented)
785
792
  allowConfluenceInlineComment?: boolean;
786
793
  // (undocumented)
787
- allowDate?: boolean;
794
+ allowDate?: DatePluginConfig | boolean;
788
795
  // (undocumented)
789
796
  allowExpand?: boolean | {
790
797
  allowInsertion?: boolean;