@atlaskit/editor-core 185.9.2 → 185.10.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/cjs/labs/next/presets/universal.js +4 -1
  3. package/dist/cjs/plugins/date/index.js +9 -4
  4. package/dist/cjs/plugins/date/ui/DatePicker/index.js +4 -2
  5. package/dist/cjs/plugins/paste/handlers.js +3 -1
  6. package/dist/cjs/plugins/paste/pm-plugins/main.js +1 -1
  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/date/index.js +7 -4
  11. package/dist/es2019/plugins/date/ui/DatePicker/index.js +4 -2
  12. package/dist/es2019/plugins/paste/handlers.js +3 -1
  13. package/dist/es2019/plugins/paste/pm-plugins/main.js +1 -1
  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/date/index.js +9 -4
  18. package/dist/esm/plugins/date/ui/DatePicker/index.js +4 -2
  19. package/dist/esm/plugins/paste/handlers.js +3 -1
  20. package/dist/esm/plugins/paste/pm-plugins/main.js +1 -1
  21. package/dist/esm/version-wrapper.js +1 -1
  22. package/dist/esm/version.json +1 -1
  23. package/dist/types/plugins/date/index.d.ts +2 -0
  24. package/dist/types/plugins/date/types.d.ts +4 -0
  25. package/dist/types/plugins/date/ui/DatePicker/index.d.ts +2 -0
  26. package/dist/types/types/editor-props.d.ts +2 -1
  27. package/dist/types-ts4.5/plugins/date/index.d.ts +2 -0
  28. package/dist/types-ts4.5/plugins/date/types.d.ts +4 -0
  29. package/dist/types-ts4.5/plugins/date/ui/DatePicker/index.d.ts +2 -0
  30. package/dist/types-ts4.5/types/editor-props.d.ts +2 -1
  31. package/package.json +8 -4
  32. package/report.api.md +8 -1
  33. package/tmp/api-report-tmp.d.ts +0 -2356
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 185.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`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.
8
+
9
+ Example Usage:
10
+
11
+ ```tsx
12
+ const startOfWeekDay = get(
13
+ getLocale(locale),
14
+ 'options.weekStartsOn',
15
+ DEFAULT_WEEK_START_DAY,
16
+ );
17
+
18
+ <Editor
19
+ editorProps={{
20
+ allowDate: { weekStartDay: 5 },
21
+ }}
22
+ />;
23
+ ```
24
+
25
+ OR
26
+
27
+ ```tsx
28
+ <Editor
29
+ editorProps={{
30
+ allowDate: false,
31
+ }}
32
+ />
33
+ ```
34
+
35
+ is also still valid.
36
+
37
+ 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.
38
+
39
+ ## 185.9.5
40
+
41
+ ### Patch Changes
42
+
43
+ - [`dbfd6704c14`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dbfd6704c14) - [ux] ED-18061 - Safe insert node selected codeblock in paste handler logic
44
+ - Updated dependencies
45
+
3
46
  ## 185.9.2
4
47
 
5
48
  ### 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) {
@@ -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
  }]);
@@ -121,7 +121,9 @@ function handlePasteIntoTaskOrDecisionOrPanel(slice, queueCardsFromChangedTr) {
121
121
  // and the slice is not a whole node (i.e. openStart is 1 and openEnd is 0)
122
122
  // or the slice's first node is a paragraph,
123
123
  // then we can replace the selection with our slice.
124
- if ((transformedSliceIsValidNode || selectionIsValidNode) && !(transformedSlice.openStart === 1 && transformedSlice.openEnd === 0) || ((_transformedSlice$con = transformedSlice.content.firstChild) === null || _transformedSlice$con === void 0 ? void 0 : _transformedSlice$con.type) === paragraph) {
124
+ if ((transformedSliceIsValidNode || selectionIsValidNode) && !(transformedSlice.openStart === 1 && transformedSlice.openEnd === 0 ||
125
+ // Whole codeblock node has reverse slice depths.
126
+ transformedSlice.openStart === 0 && transformedSlice.openEnd === 1) || ((_transformedSlice$con = transformedSlice.content.firstChild) === null || _transformedSlice$con === void 0 ? void 0 : _transformedSlice$con.type) === paragraph) {
125
127
  tr.replaceSelection(transformedSlice).scrollIntoView();
126
128
  } else {
127
129
  // This maintains both the selection (destination) and the slice (paste content).
@@ -268,7 +268,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
268
268
  var selectionParentNode = state.selection.$head.node(selectionDepth - 1);
269
269
  var selectionParentType = selectionParentNode === null || selectionParentNode === void 0 ? void 0 : selectionParentNode.type;
270
270
  var edgeCaseNodeTypes = [(_schema$nodes = schema.nodes) === null || _schema$nodes === void 0 ? void 0 : _schema$nodes.panel, (_schema$nodes2 = schema.nodes) === null || _schema$nodes2 === void 0 ? void 0 : _schema$nodes2.taskList, (_schema$nodes3 = schema.nodes) === null || _schema$nodes3 === void 0 ? void 0 : _schema$nodes3.decisionList];
271
- if (slice.openStart === 0 && selectionParentNode && edgeCaseNodeTypes.includes(selectionParentType)) {
271
+ if (slice.openStart === 0 && slice.openEnd !== 1 && selectionParentNode && edgeCaseNodeTypes.includes(selectionParentType)) {
272
272
  // @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
273
273
  slice.openStart = 1;
274
274
  }
@@ -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.2";
9
+ var version = "185.10.0";
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.2",
3
+ "version": "185.10.0",
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) => {
@@ -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
  }
@@ -101,7 +101,9 @@ export function handlePasteIntoTaskOrDecisionOrPanel(slice, queueCardsFromChange
101
101
  // and the slice is not a whole node (i.e. openStart is 1 and openEnd is 0)
102
102
  // or the slice's first node is a paragraph,
103
103
  // then we can replace the selection with our slice.
104
- if ((transformedSliceIsValidNode || selectionIsValidNode) && !(transformedSlice.openStart === 1 && transformedSlice.openEnd === 0) || ((_transformedSlice$con = transformedSlice.content.firstChild) === null || _transformedSlice$con === void 0 ? void 0 : _transformedSlice$con.type) === paragraph) {
104
+ if ((transformedSliceIsValidNode || selectionIsValidNode) && !(transformedSlice.openStart === 1 && transformedSlice.openEnd === 0 ||
105
+ // Whole codeblock node has reverse slice depths.
106
+ transformedSlice.openStart === 0 && transformedSlice.openEnd === 1) || ((_transformedSlice$con = transformedSlice.content.firstChild) === null || _transformedSlice$con === void 0 ? void 0 : _transformedSlice$con.type) === paragraph) {
105
107
  tr.replaceSelection(transformedSlice).scrollIntoView();
106
108
  } else {
107
109
  // This maintains both the selection (destination) and the slice (paste content).
@@ -234,7 +234,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
234
234
  const selectionParentNode = state.selection.$head.node(selectionDepth - 1);
235
235
  const selectionParentType = selectionParentNode === null || selectionParentNode === void 0 ? void 0 : selectionParentNode.type;
236
236
  const edgeCaseNodeTypes = [(_schema$nodes = schema.nodes) === null || _schema$nodes === void 0 ? void 0 : _schema$nodes.panel, (_schema$nodes2 = schema.nodes) === null || _schema$nodes2 === void 0 ? void 0 : _schema$nodes2.taskList, (_schema$nodes3 = schema.nodes) === null || _schema$nodes3 === void 0 ? void 0 : _schema$nodes3.decisionList];
237
- if (slice.openStart === 0 && selectionParentNode && edgeCaseNodeTypes.includes(selectionParentType)) {
237
+ if (slice.openStart === 0 && slice.openEnd !== 1 && selectionParentNode && edgeCaseNodeTypes.includes(selectionParentType)) {
238
238
  // @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
239
239
  slice.openStart = 1;
240
240
  }
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "185.9.2";
2
+ export const version = "185.10.0";
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.2",
3
+ "version": "185.10.0",
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) {
@@ -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
  }]);
@@ -99,7 +99,9 @@ export function handlePasteIntoTaskOrDecisionOrPanel(slice, queueCardsFromChange
99
99
  // and the slice is not a whole node (i.e. openStart is 1 and openEnd is 0)
100
100
  // or the slice's first node is a paragraph,
101
101
  // then we can replace the selection with our slice.
102
- if ((transformedSliceIsValidNode || selectionIsValidNode) && !(transformedSlice.openStart === 1 && transformedSlice.openEnd === 0) || ((_transformedSlice$con = transformedSlice.content.firstChild) === null || _transformedSlice$con === void 0 ? void 0 : _transformedSlice$con.type) === paragraph) {
102
+ if ((transformedSliceIsValidNode || selectionIsValidNode) && !(transformedSlice.openStart === 1 && transformedSlice.openEnd === 0 ||
103
+ // Whole codeblock node has reverse slice depths.
104
+ transformedSlice.openStart === 0 && transformedSlice.openEnd === 1) || ((_transformedSlice$con = transformedSlice.content.firstChild) === null || _transformedSlice$con === void 0 ? void 0 : _transformedSlice$con.type) === paragraph) {
103
105
  tr.replaceSelection(transformedSlice).scrollIntoView();
104
106
  } else {
105
107
  // This maintains both the selection (destination) and the slice (paste content).
@@ -254,7 +254,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
254
254
  var selectionParentNode = state.selection.$head.node(selectionDepth - 1);
255
255
  var selectionParentType = selectionParentNode === null || selectionParentNode === void 0 ? void 0 : selectionParentNode.type;
256
256
  var edgeCaseNodeTypes = [(_schema$nodes = schema.nodes) === null || _schema$nodes === void 0 ? void 0 : _schema$nodes.panel, (_schema$nodes2 = schema.nodes) === null || _schema$nodes2 === void 0 ? void 0 : _schema$nodes2.taskList, (_schema$nodes3 = schema.nodes) === null || _schema$nodes3 === void 0 ? void 0 : _schema$nodes3.decisionList];
257
- if (slice.openStart === 0 && selectionParentNode && edgeCaseNodeTypes.includes(selectionParentType)) {
257
+ if (slice.openStart === 0 && slice.openEnd !== 1 && selectionParentNode && edgeCaseNodeTypes.includes(selectionParentType)) {
258
258
  // @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
259
259
  slice.openStart = 1;
260
260
  }
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "185.9.2";
2
+ export var version = "185.10.0";
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.2",
3
+ "version": "185.10.0",
4
4
  "sideEffects": false
5
5
  }
@@ -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;
@@ -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.2",
3
+ "version": "185.10.0",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -49,7 +49,7 @@
49
49
  "@atlaskit/code": "^14.6.0",
50
50
  "@atlaskit/date": "^0.10.0",
51
51
  "@atlaskit/datetime-picker": "^12.7.0",
52
- "@atlaskit/editor-common": "^74.15.0",
52
+ "@atlaskit/editor-common": "^74.17.0",
53
53
  "@atlaskit/editor-json-transformer": "^8.10.0",
54
54
  "@atlaskit/editor-markdown-transformer": "^5.2.0",
55
55
  "@atlaskit/editor-palette": "1.5.1",
@@ -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",
@@ -95,7 +95,7 @@
95
95
  "@atlaskit/spinner": "^15.5.0",
96
96
  "@atlaskit/status": "^1.3.0",
97
97
  "@atlaskit/tabs": "^13.4.0",
98
- "@atlaskit/task-decision": "^17.6.0",
98
+ "@atlaskit/task-decision": "^17.7.0",
99
99
  "@atlaskit/textarea": "^4.7.0",
100
100
  "@atlaskit/textfield": "^5.6.0",
101
101
  "@atlaskit/theme": "^12.5.0",
@@ -243,6 +243,10 @@
243
243
  },
244
244
  "platform.editor.media.extended-resize-experience": {
245
245
  "type": "boolean"
246
+ },
247
+ "platform.design-system-team.border-checkbox_nyoiu": {
248
+ "type": "boolean",
249
+ "referenceOnly": "true"
246
250
  }
247
251
  },
248
252
  "tests": {
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