@atlaskit/editor-plugin-date 5.1.9 → 5.1.11
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 +16 -0
- package/dist/cjs/nodeviews/utils.js +14 -1
- package/dist/es2019/nodeviews/utils.js +14 -2
- package/dist/esm/nodeviews/utils.js +14 -1
- package/dist/types/datePluginType.d.ts +4 -4
- package/dist/types/pm-plugins/types.d.ts +6 -6
- package/dist/types/types/index.d.ts +11 -11
- package/dist/types/ui/DatePicker/date-picker-input.d.ts +7 -7
- package/dist/types/ui/DatePicker/index.d.ts +10 -10
- package/dist/types-ts4.5/datePluginType.d.ts +4 -4
- package/dist/types-ts4.5/pm-plugins/types.d.ts +6 -6
- package/dist/types-ts4.5/types/index.d.ts +11 -11
- package/dist/types-ts4.5/ui/DatePicker/date-picker-input.d.ts +7 -7
- package/dist/types-ts4.5/ui/DatePicker/index.d.ts +10 -10
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-date
|
|
2
2
|
|
|
3
|
+
## 5.1.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`db857b08dd89a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/db857b08dd89a) -
|
|
8
|
+
[EDITOR-1202] Make dates in blockTaskItem be formatted correctly
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 5.1.10
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
|
|
16
|
+
Sorted type and interface props to improve Atlaskit docs
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 5.1.9
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getDateInformation = void 0;
|
|
7
7
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
8
|
+
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
8
9
|
var getDateInformation = exports.getDateInformation = function getDateInformation(timestamp, intl, state, pos) {
|
|
9
10
|
if (!state) {
|
|
10
11
|
return {
|
|
@@ -14,13 +15,25 @@ var getDateInformation = exports.getDateInformation = function getDateInformatio
|
|
|
14
15
|
}
|
|
15
16
|
var doc = state.doc,
|
|
16
17
|
selection = state.selection;
|
|
17
|
-
var
|
|
18
|
+
var _state$schema$nodes = state.schema.nodes,
|
|
19
|
+
taskItem = _state$schema$nodes.taskItem,
|
|
20
|
+
blockTaskItem = _state$schema$nodes.blockTaskItem;
|
|
18
21
|
|
|
19
22
|
// We fall back to selection.$from even though it does not cover all use cases
|
|
20
23
|
// eg. upon Editor init, selection is at the start, not at the Date node
|
|
21
24
|
var $nodePos = typeof pos === 'number' ? doc.resolve(pos) : selection.$from;
|
|
22
25
|
var parent = $nodePos.parent;
|
|
23
26
|
var withinIncompleteTask = parent.type === taskItem && parent.attrs.state !== 'DONE';
|
|
27
|
+
|
|
28
|
+
// If there is blockTaskItem in the schema and it's not nested in an incomplete task item,
|
|
29
|
+
// check if it's nested in an incomplete block task item
|
|
30
|
+
if (blockTaskItem && !withinIncompleteTask) {
|
|
31
|
+
var blockTaskItemParent = (0, _utils2.findParentNodeOfTypeClosestToPos)($nodePos, blockTaskItem);
|
|
32
|
+
// If nested in a blockTaskItem that is incomplete
|
|
33
|
+
if (blockTaskItemParent) {
|
|
34
|
+
withinIncompleteTask = blockTaskItemParent.node.attrs.state !== 'DONE';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
24
37
|
var color = withinIncompleteTask && (0, _utils.isPastDate)(timestamp) ? 'red' : undefined;
|
|
25
38
|
var displayString = withinIncompleteTask ? (0, _utils.timestampToTaskContext)(timestamp, intl) : (0, _utils.timestampToString)(timestamp, intl);
|
|
26
39
|
return {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isPastDate, timestampToString, timestampToTaskContext } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
2
3
|
export const getDateInformation = (timestamp, intl, state, pos) => {
|
|
3
4
|
if (!state) {
|
|
4
5
|
return {
|
|
@@ -11,14 +12,25 @@ export const getDateInformation = (timestamp, intl, state, pos) => {
|
|
|
11
12
|
selection
|
|
12
13
|
} = state;
|
|
13
14
|
const {
|
|
14
|
-
taskItem
|
|
15
|
+
taskItem,
|
|
16
|
+
blockTaskItem
|
|
15
17
|
} = state.schema.nodes;
|
|
16
18
|
|
|
17
19
|
// We fall back to selection.$from even though it does not cover all use cases
|
|
18
20
|
// eg. upon Editor init, selection is at the start, not at the Date node
|
|
19
21
|
const $nodePos = typeof pos === 'number' ? doc.resolve(pos) : selection.$from;
|
|
20
22
|
const parent = $nodePos.parent;
|
|
21
|
-
|
|
23
|
+
let withinIncompleteTask = parent.type === taskItem && parent.attrs.state !== 'DONE';
|
|
24
|
+
|
|
25
|
+
// If there is blockTaskItem in the schema and it's not nested in an incomplete task item,
|
|
26
|
+
// check if it's nested in an incomplete block task item
|
|
27
|
+
if (blockTaskItem && !withinIncompleteTask) {
|
|
28
|
+
const blockTaskItemParent = findParentNodeOfTypeClosestToPos($nodePos, blockTaskItem);
|
|
29
|
+
// If nested in a blockTaskItem that is incomplete
|
|
30
|
+
if (blockTaskItemParent) {
|
|
31
|
+
withinIncompleteTask = blockTaskItemParent.node.attrs.state !== 'DONE';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
22
34
|
const color = withinIncompleteTask && isPastDate(timestamp) ? 'red' : undefined;
|
|
23
35
|
const displayString = withinIncompleteTask ? timestampToTaskContext(timestamp, intl) : timestampToString(timestamp, intl);
|
|
24
36
|
return {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isPastDate, timestampToString, timestampToTaskContext } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
2
3
|
export var getDateInformation = function getDateInformation(timestamp, intl, state, pos) {
|
|
3
4
|
if (!state) {
|
|
4
5
|
return {
|
|
@@ -8,13 +9,25 @@ export var getDateInformation = function getDateInformation(timestamp, intl, sta
|
|
|
8
9
|
}
|
|
9
10
|
var doc = state.doc,
|
|
10
11
|
selection = state.selection;
|
|
11
|
-
var
|
|
12
|
+
var _state$schema$nodes = state.schema.nodes,
|
|
13
|
+
taskItem = _state$schema$nodes.taskItem,
|
|
14
|
+
blockTaskItem = _state$schema$nodes.blockTaskItem;
|
|
12
15
|
|
|
13
16
|
// We fall back to selection.$from even though it does not cover all use cases
|
|
14
17
|
// eg. upon Editor init, selection is at the start, not at the Date node
|
|
15
18
|
var $nodePos = typeof pos === 'number' ? doc.resolve(pos) : selection.$from;
|
|
16
19
|
var parent = $nodePos.parent;
|
|
17
20
|
var withinIncompleteTask = parent.type === taskItem && parent.attrs.state !== 'DONE';
|
|
21
|
+
|
|
22
|
+
// If there is blockTaskItem in the schema and it's not nested in an incomplete task item,
|
|
23
|
+
// check if it's nested in an incomplete block task item
|
|
24
|
+
if (blockTaskItem && !withinIncompleteTask) {
|
|
25
|
+
var blockTaskItemParent = findParentNodeOfTypeClosestToPos($nodePos, blockTaskItem);
|
|
26
|
+
// If nested in a blockTaskItem that is incomplete
|
|
27
|
+
if (blockTaskItemParent) {
|
|
28
|
+
withinIncompleteTask = blockTaskItemParent.node.attrs.state !== 'DONE';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
18
31
|
var color = withinIncompleteTask && isPastDate(timestamp) ? 'red' : undefined;
|
|
19
32
|
var displayString = withinIncompleteTask ? timestampToTaskContext(timestamp, intl) : timestampToString(timestamp, intl);
|
|
20
33
|
return {
|
|
@@ -11,11 +11,11 @@ export type DatePluginDependencies = [
|
|
|
11
11
|
OptionalPlugin<EditorViewModePlugin>
|
|
12
12
|
];
|
|
13
13
|
export type DatePlugin = NextEditorPlugin<'date', {
|
|
14
|
-
pluginConfiguration: DatePluginOptions | undefined;
|
|
15
|
-
dependencies: DatePluginDependencies;
|
|
16
|
-
sharedState: DatePluginSharedState;
|
|
17
14
|
commands: {
|
|
18
|
-
insertDate: InsertDate;
|
|
19
15
|
deleteDate: DeleteDate;
|
|
16
|
+
insertDate: InsertDate;
|
|
20
17
|
};
|
|
18
|
+
dependencies: DatePluginDependencies;
|
|
19
|
+
pluginConfiguration: DatePluginOptions | undefined;
|
|
20
|
+
sharedState: DatePluginSharedState;
|
|
21
21
|
}>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export type DatePluginState = {
|
|
2
|
-
isQuickInsertAction?: boolean;
|
|
3
|
-
isNew: boolean;
|
|
4
|
-
showDatePickerAt: number | null;
|
|
5
|
-
isDateEmpty: boolean;
|
|
6
2
|
focusDateInput: boolean;
|
|
3
|
+
isDateEmpty: boolean;
|
|
7
4
|
isInitialised: boolean;
|
|
5
|
+
isNew: boolean;
|
|
6
|
+
isQuickInsertAction?: boolean;
|
|
7
|
+
showDatePickerAt: number | null;
|
|
8
8
|
};
|
|
9
9
|
export type DatePluginMeta = {
|
|
10
|
-
isNew?: boolean;
|
|
11
|
-
showDatePickerAt?: number | null;
|
|
12
10
|
isDateEmpty?: boolean;
|
|
13
11
|
isInitialised: boolean;
|
|
12
|
+
isNew?: boolean;
|
|
13
|
+
showDatePickerAt?: number | null;
|
|
14
14
|
};
|
|
@@ -7,9 +7,9 @@ import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabl
|
|
|
7
7
|
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
8
8
|
export type DateSegment = 'day' | 'month' | 'year';
|
|
9
9
|
export type DateType = {
|
|
10
|
-
year: number;
|
|
11
|
-
month: number;
|
|
12
10
|
day?: number;
|
|
11
|
+
month: number;
|
|
12
|
+
year: number;
|
|
13
13
|
};
|
|
14
14
|
export interface DatePluginOptions {
|
|
15
15
|
weekStartDay?: WeekDay;
|
|
@@ -21,29 +21,29 @@ export interface DatePluginOptions {
|
|
|
21
21
|
*/
|
|
22
22
|
export type DatePluginConfig = DatePluginOptions;
|
|
23
23
|
export type DatePluginSharedState = {
|
|
24
|
-
showDatePickerAt?: number | null;
|
|
25
|
-
isNew: boolean;
|
|
26
24
|
focusDateInput: boolean;
|
|
27
25
|
isInitialised: boolean;
|
|
26
|
+
isNew: boolean;
|
|
27
|
+
showDatePickerAt?: number | null;
|
|
28
28
|
};
|
|
29
29
|
export type InsertDate = (props: {
|
|
30
|
-
date?: DateType;
|
|
31
|
-
inputMethod?: TOOLBAR_MENU_TYPE;
|
|
32
30
|
commitMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.KEYBOARD;
|
|
31
|
+
date?: DateType;
|
|
33
32
|
enterPressed?: boolean;
|
|
33
|
+
inputMethod?: TOOLBAR_MENU_TYPE;
|
|
34
34
|
}) => EditorCommand;
|
|
35
35
|
export type DeleteDate = EditorCommand;
|
|
36
36
|
export type DatePlugin = NextEditorPlugin<'date', {
|
|
37
|
-
|
|
37
|
+
commands: {
|
|
38
|
+
deleteDate: DeleteDate;
|
|
39
|
+
insertDate: InsertDate;
|
|
40
|
+
};
|
|
38
41
|
dependencies: [
|
|
39
42
|
typeof analyticsPlugin,
|
|
40
43
|
EditorDisabledPlugin,
|
|
41
44
|
OptionalPlugin<AnnotationPlugin>,
|
|
42
45
|
OptionalPlugin<EditorViewModePlugin>
|
|
43
46
|
];
|
|
47
|
+
pluginConfiguration: DatePluginOptions | undefined;
|
|
44
48
|
sharedState: DatePluginSharedState;
|
|
45
|
-
commands: {
|
|
46
|
-
insertDate: InsertDate;
|
|
47
|
-
deleteDate: DeleteDate;
|
|
48
|
-
};
|
|
49
49
|
}>;
|
|
@@ -7,17 +7,17 @@ import type { WrappedComponentProps } from 'react-intl-next';
|
|
|
7
7
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
import type { DateType } from '../../types';
|
|
9
9
|
export interface InputProps {
|
|
10
|
-
/** Locale code string (eg. "en-AU") */
|
|
11
|
-
locale: string;
|
|
12
|
-
date: DateType;
|
|
13
|
-
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
14
|
-
onNewDate: (date: DateType) => void;
|
|
15
|
-
onSubmitDate: (date: DateType | null) => void;
|
|
16
|
-
onEmptySubmit: () => void;
|
|
17
10
|
/** Automatically focus the text field */
|
|
18
11
|
autoFocus?: boolean;
|
|
19
12
|
/** Automatically select all text in the field. Requires autoFocus to be true. */
|
|
20
13
|
autoSelectAll?: boolean;
|
|
14
|
+
date: DateType;
|
|
15
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
16
|
+
/** Locale code string (eg. "en-AU") */
|
|
17
|
+
locale: string;
|
|
18
|
+
onEmptySubmit: () => void;
|
|
19
|
+
onNewDate: (date: DateType) => void;
|
|
20
|
+
onSubmitDate: (date: DateType | null) => void;
|
|
21
21
|
}
|
|
22
22
|
export interface InputState {
|
|
23
23
|
inputText: string;
|
|
@@ -9,29 +9,29 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
9
9
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import type { DateType } from '../../types';
|
|
11
11
|
export interface Props {
|
|
12
|
-
element: HTMLElement | null;
|
|
13
|
-
closeDatePicker: () => void;
|
|
14
|
-
/** Whether the date is newly created, selcting and focusing the input */
|
|
15
|
-
isNew: boolean;
|
|
16
12
|
/** Whether to automatically focus the input */
|
|
17
13
|
autoFocus?: boolean;
|
|
18
|
-
onSelect: (date: DateType | null, commitMethod: INPUT_METHOD.PICKER | INPUT_METHOD.KEYBOARD) => void;
|
|
19
|
-
onDelete: () => void;
|
|
20
|
-
mountTo?: HTMLElement;
|
|
21
14
|
boundariesElement?: HTMLElement;
|
|
22
|
-
|
|
15
|
+
closeDatePicker: () => void;
|
|
23
16
|
closeDatePickerWithAnalytics: ({ date }: {
|
|
24
17
|
date?: DateType;
|
|
25
18
|
}) => void;
|
|
26
|
-
onTextChanged: (date: DateType) => void;
|
|
27
19
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
20
|
+
element: HTMLElement | null;
|
|
21
|
+
/** Whether the date is newly created, selcting and focusing the input */
|
|
22
|
+
isNew: boolean;
|
|
23
|
+
mountTo?: HTMLElement;
|
|
24
|
+
onDelete: () => void;
|
|
25
|
+
onSelect: (date: DateType | null, commitMethod: INPUT_METHOD.PICKER | INPUT_METHOD.KEYBOARD) => void;
|
|
26
|
+
onTextChanged: (date: DateType) => void;
|
|
27
|
+
scrollableElement?: HTMLElement;
|
|
28
28
|
weekStartDay?: WeekDay;
|
|
29
29
|
}
|
|
30
30
|
export interface State {
|
|
31
31
|
date: DateType;
|
|
32
|
+
latestValidDate: DateType;
|
|
32
33
|
selected: Array<string>;
|
|
33
34
|
setInputSelectionPos?: number;
|
|
34
|
-
latestValidDate: DateType;
|
|
35
35
|
}
|
|
36
36
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
37
37
|
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
@@ -11,11 +11,11 @@ export type DatePluginDependencies = [
|
|
|
11
11
|
OptionalPlugin<EditorViewModePlugin>
|
|
12
12
|
];
|
|
13
13
|
export type DatePlugin = NextEditorPlugin<'date', {
|
|
14
|
-
pluginConfiguration: DatePluginOptions | undefined;
|
|
15
|
-
dependencies: DatePluginDependencies;
|
|
16
|
-
sharedState: DatePluginSharedState;
|
|
17
14
|
commands: {
|
|
18
|
-
insertDate: InsertDate;
|
|
19
15
|
deleteDate: DeleteDate;
|
|
16
|
+
insertDate: InsertDate;
|
|
20
17
|
};
|
|
18
|
+
dependencies: DatePluginDependencies;
|
|
19
|
+
pluginConfiguration: DatePluginOptions | undefined;
|
|
20
|
+
sharedState: DatePluginSharedState;
|
|
21
21
|
}>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export type DatePluginState = {
|
|
2
|
-
isQuickInsertAction?: boolean;
|
|
3
|
-
isNew: boolean;
|
|
4
|
-
showDatePickerAt: number | null;
|
|
5
|
-
isDateEmpty: boolean;
|
|
6
2
|
focusDateInput: boolean;
|
|
3
|
+
isDateEmpty: boolean;
|
|
7
4
|
isInitialised: boolean;
|
|
5
|
+
isNew: boolean;
|
|
6
|
+
isQuickInsertAction?: boolean;
|
|
7
|
+
showDatePickerAt: number | null;
|
|
8
8
|
};
|
|
9
9
|
export type DatePluginMeta = {
|
|
10
|
-
isNew?: boolean;
|
|
11
|
-
showDatePickerAt?: number | null;
|
|
12
10
|
isDateEmpty?: boolean;
|
|
13
11
|
isInitialised: boolean;
|
|
12
|
+
isNew?: boolean;
|
|
13
|
+
showDatePickerAt?: number | null;
|
|
14
14
|
};
|
|
@@ -7,9 +7,9 @@ import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabl
|
|
|
7
7
|
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
8
8
|
export type DateSegment = 'day' | 'month' | 'year';
|
|
9
9
|
export type DateType = {
|
|
10
|
-
year: number;
|
|
11
|
-
month: number;
|
|
12
10
|
day?: number;
|
|
11
|
+
month: number;
|
|
12
|
+
year: number;
|
|
13
13
|
};
|
|
14
14
|
export interface DatePluginOptions {
|
|
15
15
|
weekStartDay?: WeekDay;
|
|
@@ -21,29 +21,29 @@ export interface DatePluginOptions {
|
|
|
21
21
|
*/
|
|
22
22
|
export type DatePluginConfig = DatePluginOptions;
|
|
23
23
|
export type DatePluginSharedState = {
|
|
24
|
-
showDatePickerAt?: number | null;
|
|
25
|
-
isNew: boolean;
|
|
26
24
|
focusDateInput: boolean;
|
|
27
25
|
isInitialised: boolean;
|
|
26
|
+
isNew: boolean;
|
|
27
|
+
showDatePickerAt?: number | null;
|
|
28
28
|
};
|
|
29
29
|
export type InsertDate = (props: {
|
|
30
|
-
date?: DateType;
|
|
31
|
-
inputMethod?: TOOLBAR_MENU_TYPE;
|
|
32
30
|
commitMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.KEYBOARD;
|
|
31
|
+
date?: DateType;
|
|
33
32
|
enterPressed?: boolean;
|
|
33
|
+
inputMethod?: TOOLBAR_MENU_TYPE;
|
|
34
34
|
}) => EditorCommand;
|
|
35
35
|
export type DeleteDate = EditorCommand;
|
|
36
36
|
export type DatePlugin = NextEditorPlugin<'date', {
|
|
37
|
-
|
|
37
|
+
commands: {
|
|
38
|
+
deleteDate: DeleteDate;
|
|
39
|
+
insertDate: InsertDate;
|
|
40
|
+
};
|
|
38
41
|
dependencies: [
|
|
39
42
|
typeof analyticsPlugin,
|
|
40
43
|
EditorDisabledPlugin,
|
|
41
44
|
OptionalPlugin<AnnotationPlugin>,
|
|
42
45
|
OptionalPlugin<EditorViewModePlugin>
|
|
43
46
|
];
|
|
47
|
+
pluginConfiguration: DatePluginOptions | undefined;
|
|
44
48
|
sharedState: DatePluginSharedState;
|
|
45
|
-
commands: {
|
|
46
|
-
insertDate: InsertDate;
|
|
47
|
-
deleteDate: DeleteDate;
|
|
48
|
-
};
|
|
49
49
|
}>;
|
|
@@ -7,17 +7,17 @@ import type { WrappedComponentProps } from 'react-intl-next';
|
|
|
7
7
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
import type { DateType } from '../../types';
|
|
9
9
|
export interface InputProps {
|
|
10
|
-
/** Locale code string (eg. "en-AU") */
|
|
11
|
-
locale: string;
|
|
12
|
-
date: DateType;
|
|
13
|
-
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
14
|
-
onNewDate: (date: DateType) => void;
|
|
15
|
-
onSubmitDate: (date: DateType | null) => void;
|
|
16
|
-
onEmptySubmit: () => void;
|
|
17
10
|
/** Automatically focus the text field */
|
|
18
11
|
autoFocus?: boolean;
|
|
19
12
|
/** Automatically select all text in the field. Requires autoFocus to be true. */
|
|
20
13
|
autoSelectAll?: boolean;
|
|
14
|
+
date: DateType;
|
|
15
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
16
|
+
/** Locale code string (eg. "en-AU") */
|
|
17
|
+
locale: string;
|
|
18
|
+
onEmptySubmit: () => void;
|
|
19
|
+
onNewDate: (date: DateType) => void;
|
|
20
|
+
onSubmitDate: (date: DateType | null) => void;
|
|
21
21
|
}
|
|
22
22
|
export interface InputState {
|
|
23
23
|
inputText: string;
|
|
@@ -9,29 +9,29 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
9
9
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import type { DateType } from '../../types';
|
|
11
11
|
export interface Props {
|
|
12
|
-
element: HTMLElement | null;
|
|
13
|
-
closeDatePicker: () => void;
|
|
14
|
-
/** Whether the date is newly created, selcting and focusing the input */
|
|
15
|
-
isNew: boolean;
|
|
16
12
|
/** Whether to automatically focus the input */
|
|
17
13
|
autoFocus?: boolean;
|
|
18
|
-
onSelect: (date: DateType | null, commitMethod: INPUT_METHOD.PICKER | INPUT_METHOD.KEYBOARD) => void;
|
|
19
|
-
onDelete: () => void;
|
|
20
|
-
mountTo?: HTMLElement;
|
|
21
14
|
boundariesElement?: HTMLElement;
|
|
22
|
-
|
|
15
|
+
closeDatePicker: () => void;
|
|
23
16
|
closeDatePickerWithAnalytics: ({ date }: {
|
|
24
17
|
date?: DateType;
|
|
25
18
|
}) => void;
|
|
26
|
-
onTextChanged: (date: DateType) => void;
|
|
27
19
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
20
|
+
element: HTMLElement | null;
|
|
21
|
+
/** Whether the date is newly created, selcting and focusing the input */
|
|
22
|
+
isNew: boolean;
|
|
23
|
+
mountTo?: HTMLElement;
|
|
24
|
+
onDelete: () => void;
|
|
25
|
+
onSelect: (date: DateType | null, commitMethod: INPUT_METHOD.PICKER | INPUT_METHOD.KEYBOARD) => void;
|
|
26
|
+
onTextChanged: (date: DateType) => void;
|
|
27
|
+
scrollableElement?: HTMLElement;
|
|
28
28
|
weekStartDay?: WeekDay;
|
|
29
29
|
}
|
|
30
30
|
export interface State {
|
|
31
31
|
date: DateType;
|
|
32
|
+
latestValidDate: DateType;
|
|
32
33
|
selected: Array<string>;
|
|
33
34
|
setInputSelectionPos?: number;
|
|
34
|
-
latestValidDate: DateType;
|
|
35
35
|
}
|
|
36
36
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
37
37
|
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-date",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.11",
|
|
4
4
|
"description": "Date plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
".": "./src/index.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/adf-schema": "^50.2.
|
|
35
|
+
"@atlaskit/adf-schema": "^50.2.2",
|
|
36
36
|
"@atlaskit/calendar": "^17.1.0",
|
|
37
37
|
"@atlaskit/css": "^0.12.0",
|
|
38
38
|
"@atlaskit/date": "^2.0.0",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
|
|
43
43
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
44
44
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
45
|
-
"@atlaskit/form": "^12.
|
|
45
|
+
"@atlaskit/form": "^12.2.0",
|
|
46
46
|
"@atlaskit/icon": "^28.0.0",
|
|
47
47
|
"@atlaskit/locale": "^3.0.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
49
|
"@atlaskit/textfield": "^8.0.0",
|
|
50
50
|
"@atlaskit/theme": "^19.0.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^11.6.0",
|
|
52
52
|
"@atlaskit/tokens": "^6.0.0",
|
|
53
53
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
@@ -60,19 +60,19 @@
|
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@atlaskit/editor-plugin-composition": "^2.0.0",
|
|
62
62
|
"@atlaskit/editor-plugin-content-insertion": "^3.1.0",
|
|
63
|
-
"@atlaskit/editor-plugin-decorations": "^3.
|
|
63
|
+
"@atlaskit/editor-plugin-decorations": "^3.1.0",
|
|
64
64
|
"@atlaskit/editor-plugin-feature-flags": "^2.0.0",
|
|
65
65
|
"@atlaskit/editor-plugin-guideline": "^3.0.0",
|
|
66
66
|
"@atlaskit/editor-plugin-quick-insert": "^3.0.0",
|
|
67
|
-
"@atlaskit/editor-plugin-selection": "^3.
|
|
68
|
-
"@atlaskit/editor-plugin-table": "^12.
|
|
67
|
+
"@atlaskit/editor-plugin-selection": "^3.2.0",
|
|
68
|
+
"@atlaskit/editor-plugin-table": "^12.3.0",
|
|
69
69
|
"@atlaskit/editor-plugin-tasks-and-decisions": "^6.4.0",
|
|
70
70
|
"@atlaskit/editor-plugin-type-ahead": "^3.1.0",
|
|
71
71
|
"@atlaskit/editor-plugin-width": "^4.0.0",
|
|
72
72
|
"@testing-library/react": "^13.4.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@atlaskit/editor-common": "^107.
|
|
75
|
+
"@atlaskit/editor-common": "^107.30.0",
|
|
76
76
|
"react": "^18.2.0",
|
|
77
77
|
"react-dom": "^18.2.0"
|
|
78
78
|
},
|