@atlaskit/editor-plugin-date 4.3.1 → 4.3.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.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/datePlugin.js +6 -3
- package/dist/cjs/pm-plugins/actions.js +2 -1
- package/dist/cjs/pm-plugins/main.js +2 -1
- package/dist/cjs/pm-plugins/utils.js +6 -3
- package/dist/es2019/datePlugin.js +6 -3
- package/dist/es2019/pm-plugins/actions.js +2 -1
- package/dist/es2019/pm-plugins/main.js +2 -1
- package/dist/es2019/pm-plugins/utils.js +6 -3
- package/dist/esm/datePlugin.js +6 -3
- package/dist/esm/pm-plugins/actions.js +2 -1
- package/dist/esm/pm-plugins/main.js +2 -1
- package/dist/esm/pm-plugins/utils.js +6 -3
- package/dist/types/pm-plugins/types.d.ts +2 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/types.d.ts +2 -0
- package/dist/types-ts4.5/types/index.d.ts +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-date
|
|
2
2
|
|
|
3
|
+
## 4.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 4.3.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#149315](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149315)
|
|
14
|
+
[`48b82f7847cb0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/48b82f7847cb0) -
|
|
15
|
+
Adds an isInitialised variable to date plugin shared state
|
|
16
|
+
|
|
3
17
|
## 4.3.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/cjs/datePlugin.js
CHANGED
|
@@ -121,17 +121,20 @@ var datePlugin = function datePlugin(_ref3) {
|
|
|
121
121
|
return {
|
|
122
122
|
showDatePickerAt: null,
|
|
123
123
|
isNew: false,
|
|
124
|
-
focusDateInput: false
|
|
124
|
+
focusDateInput: false,
|
|
125
|
+
isInitialised: true
|
|
125
126
|
};
|
|
126
127
|
}
|
|
127
128
|
var _ref4 = _pluginKey.pluginKey.getState(editorState) || {},
|
|
128
129
|
showDatePickerAt = _ref4.showDatePickerAt,
|
|
129
130
|
isNew = _ref4.isNew,
|
|
130
|
-
focusDateInput = _ref4.focusDateInput
|
|
131
|
+
focusDateInput = _ref4.focusDateInput,
|
|
132
|
+
isInitialised = _ref4.isInitialised;
|
|
131
133
|
return {
|
|
132
134
|
showDatePickerAt: showDatePickerAt,
|
|
133
135
|
isNew: !!isNew,
|
|
134
|
-
focusDateInput: !!focusDateInput
|
|
136
|
+
focusDateInput: !!focusDateInput,
|
|
137
|
+
isInitialised: !!isInitialised
|
|
135
138
|
};
|
|
136
139
|
},
|
|
137
140
|
commands: {
|
|
@@ -32,7 +32,8 @@ var createDate = exports.createDate = function createDate(isQuickInsertAction) {
|
|
|
32
32
|
showDatePickerAt: tr.selection.from,
|
|
33
33
|
isNew: true,
|
|
34
34
|
isDateEmpty: false,
|
|
35
|
-
focusDateInput: false
|
|
35
|
+
focusDateInput: false,
|
|
36
|
+
isInitialised: true
|
|
36
37
|
};
|
|
37
38
|
return tr.setMeta(_pluginKey.pluginKey, newPluginState);
|
|
38
39
|
};
|
|
@@ -24,7 +24,8 @@ var createPlugin = function createPlugin(pmPluginFactoryParams) {
|
|
|
24
24
|
showDatePickerAt: null,
|
|
25
25
|
isNew: false,
|
|
26
26
|
isDateEmpty: false,
|
|
27
|
-
focusDateInput: false
|
|
27
|
+
focusDateInput: false,
|
|
28
|
+
isInitialised: true
|
|
28
29
|
};
|
|
29
30
|
return new _safePlugin.SafePlugin({
|
|
30
31
|
state: createPluginState(dispatch, newPluginState),
|
|
@@ -42,14 +42,16 @@ function mapping(tr, pluginState) {
|
|
|
42
42
|
showDatePickerAt: deleted ? null : pos,
|
|
43
43
|
isNew: pluginState.isNew,
|
|
44
44
|
isDateEmpty: pluginState.isDateEmpty,
|
|
45
|
-
focusDateInput: pluginState.focusDateInput
|
|
45
|
+
focusDateInput: pluginState.focusDateInput,
|
|
46
|
+
isInitialised: pluginState.isInitialised
|
|
46
47
|
};
|
|
47
48
|
} else {
|
|
48
49
|
return {
|
|
49
50
|
showDatePickerAt: pos,
|
|
50
51
|
isNew: pluginState.isNew,
|
|
51
52
|
isDateEmpty: pluginState.isDateEmpty,
|
|
52
|
-
focusDateInput: pluginState.focusDateInput
|
|
53
|
+
focusDateInput: pluginState.focusDateInput,
|
|
54
|
+
isInitialised: pluginState.isInitialised
|
|
53
55
|
};
|
|
54
56
|
}
|
|
55
57
|
}
|
|
@@ -65,7 +67,8 @@ function onSelectionChanged(tr, pluginState) {
|
|
|
65
67
|
showDatePickerAt: null,
|
|
66
68
|
isNew: false,
|
|
67
69
|
isDateEmpty: false,
|
|
68
|
-
focusDateInput: false
|
|
70
|
+
focusDateInput: false,
|
|
71
|
+
isInitialised: true
|
|
69
72
|
};
|
|
70
73
|
}
|
|
71
74
|
return pluginState;
|
|
@@ -109,18 +109,21 @@ const datePlugin = ({
|
|
|
109
109
|
return {
|
|
110
110
|
showDatePickerAt: null,
|
|
111
111
|
isNew: false,
|
|
112
|
-
focusDateInput: false
|
|
112
|
+
focusDateInput: false,
|
|
113
|
+
isInitialised: true
|
|
113
114
|
};
|
|
114
115
|
}
|
|
115
116
|
const {
|
|
116
117
|
showDatePickerAt,
|
|
117
118
|
isNew,
|
|
118
|
-
focusDateInput
|
|
119
|
+
focusDateInput,
|
|
120
|
+
isInitialised
|
|
119
121
|
} = datePluginKey.getState(editorState) || {};
|
|
120
122
|
return {
|
|
121
123
|
showDatePickerAt,
|
|
122
124
|
isNew: !!isNew,
|
|
123
|
-
focusDateInput: !!focusDateInput
|
|
125
|
+
focusDateInput: !!focusDateInput,
|
|
126
|
+
isInitialised: !!isInitialised
|
|
124
127
|
};
|
|
125
128
|
},
|
|
126
129
|
commands: {
|
|
@@ -25,7 +25,8 @@ export const createDate = isQuickInsertAction => state => {
|
|
|
25
25
|
showDatePickerAt: tr.selection.from,
|
|
26
26
|
isNew: true,
|
|
27
27
|
isDateEmpty: false,
|
|
28
|
-
focusDateInput: false
|
|
28
|
+
focusDateInput: false,
|
|
29
|
+
isInitialised: true
|
|
29
30
|
};
|
|
30
31
|
return tr.setMeta(pluginKey, newPluginState);
|
|
31
32
|
};
|
|
@@ -21,7 +21,8 @@ const createPlugin = pmPluginFactoryParams => {
|
|
|
21
21
|
showDatePickerAt: null,
|
|
22
22
|
isNew: false,
|
|
23
23
|
isDateEmpty: false,
|
|
24
|
-
focusDateInput: false
|
|
24
|
+
focusDateInput: false,
|
|
25
|
+
isInitialised: true
|
|
25
26
|
};
|
|
26
27
|
return new SafePlugin({
|
|
27
28
|
state: createPluginState(dispatch, newPluginState),
|
|
@@ -41,14 +41,16 @@ export function mapping(tr, pluginState) {
|
|
|
41
41
|
showDatePickerAt: deleted ? null : pos,
|
|
42
42
|
isNew: pluginState.isNew,
|
|
43
43
|
isDateEmpty: pluginState.isDateEmpty,
|
|
44
|
-
focusDateInput: pluginState.focusDateInput
|
|
44
|
+
focusDateInput: pluginState.focusDateInput,
|
|
45
|
+
isInitialised: pluginState.isInitialised
|
|
45
46
|
};
|
|
46
47
|
} else {
|
|
47
48
|
return {
|
|
48
49
|
showDatePickerAt: pos,
|
|
49
50
|
isNew: pluginState.isNew,
|
|
50
51
|
isDateEmpty: pluginState.isDateEmpty,
|
|
51
|
-
focusDateInput: pluginState.focusDateInput
|
|
52
|
+
focusDateInput: pluginState.focusDateInput,
|
|
53
|
+
isInitialised: pluginState.isInitialised
|
|
52
54
|
};
|
|
53
55
|
}
|
|
54
56
|
}
|
|
@@ -65,7 +67,8 @@ export function onSelectionChanged(tr, pluginState) {
|
|
|
65
67
|
showDatePickerAt: null,
|
|
66
68
|
isNew: false,
|
|
67
69
|
isDateEmpty: false,
|
|
68
|
-
focusDateInput: false
|
|
70
|
+
focusDateInput: false,
|
|
71
|
+
isInitialised: true
|
|
69
72
|
};
|
|
70
73
|
}
|
|
71
74
|
return pluginState;
|
package/dist/esm/datePlugin.js
CHANGED
|
@@ -109,17 +109,20 @@ var datePlugin = function datePlugin(_ref3) {
|
|
|
109
109
|
return {
|
|
110
110
|
showDatePickerAt: null,
|
|
111
111
|
isNew: false,
|
|
112
|
-
focusDateInput: false
|
|
112
|
+
focusDateInput: false,
|
|
113
|
+
isInitialised: true
|
|
113
114
|
};
|
|
114
115
|
}
|
|
115
116
|
var _ref4 = datePluginKey.getState(editorState) || {},
|
|
116
117
|
showDatePickerAt = _ref4.showDatePickerAt,
|
|
117
118
|
isNew = _ref4.isNew,
|
|
118
|
-
focusDateInput = _ref4.focusDateInput
|
|
119
|
+
focusDateInput = _ref4.focusDateInput,
|
|
120
|
+
isInitialised = _ref4.isInitialised;
|
|
119
121
|
return {
|
|
120
122
|
showDatePickerAt: showDatePickerAt,
|
|
121
123
|
isNew: !!isNew,
|
|
122
|
-
focusDateInput: !!focusDateInput
|
|
124
|
+
focusDateInput: !!focusDateInput,
|
|
125
|
+
isInitialised: !!isInitialised
|
|
123
126
|
};
|
|
124
127
|
},
|
|
125
128
|
commands: {
|
|
@@ -26,7 +26,8 @@ export var createDate = function createDate(isQuickInsertAction) {
|
|
|
26
26
|
showDatePickerAt: tr.selection.from,
|
|
27
27
|
isNew: true,
|
|
28
28
|
isDateEmpty: false,
|
|
29
|
-
focusDateInput: false
|
|
29
|
+
focusDateInput: false,
|
|
30
|
+
isInitialised: true
|
|
30
31
|
};
|
|
31
32
|
return tr.setMeta(pluginKey, newPluginState);
|
|
32
33
|
};
|
|
@@ -18,7 +18,8 @@ var createPlugin = function createPlugin(pmPluginFactoryParams) {
|
|
|
18
18
|
showDatePickerAt: null,
|
|
19
19
|
isNew: false,
|
|
20
20
|
isDateEmpty: false,
|
|
21
|
-
focusDateInput: false
|
|
21
|
+
focusDateInput: false,
|
|
22
|
+
isInitialised: true
|
|
22
23
|
};
|
|
23
24
|
return new SafePlugin({
|
|
24
25
|
state: createPluginState(dispatch, newPluginState),
|
|
@@ -33,14 +33,16 @@ export function mapping(tr, pluginState) {
|
|
|
33
33
|
showDatePickerAt: deleted ? null : pos,
|
|
34
34
|
isNew: pluginState.isNew,
|
|
35
35
|
isDateEmpty: pluginState.isDateEmpty,
|
|
36
|
-
focusDateInput: pluginState.focusDateInput
|
|
36
|
+
focusDateInput: pluginState.focusDateInput,
|
|
37
|
+
isInitialised: pluginState.isInitialised
|
|
37
38
|
};
|
|
38
39
|
} else {
|
|
39
40
|
return {
|
|
40
41
|
showDatePickerAt: pos,
|
|
41
42
|
isNew: pluginState.isNew,
|
|
42
43
|
isDateEmpty: pluginState.isDateEmpty,
|
|
43
|
-
focusDateInput: pluginState.focusDateInput
|
|
44
|
+
focusDateInput: pluginState.focusDateInput,
|
|
45
|
+
isInitialised: pluginState.isInitialised
|
|
44
46
|
};
|
|
45
47
|
}
|
|
46
48
|
}
|
|
@@ -56,7 +58,8 @@ export function onSelectionChanged(tr, pluginState) {
|
|
|
56
58
|
showDatePickerAt: null,
|
|
57
59
|
isNew: false,
|
|
58
60
|
isDateEmpty: false,
|
|
59
|
-
focusDateInput: false
|
|
61
|
+
focusDateInput: false,
|
|
62
|
+
isInitialised: true
|
|
60
63
|
};
|
|
61
64
|
}
|
|
62
65
|
return pluginState;
|
|
@@ -4,9 +4,11 @@ export type DatePluginState = {
|
|
|
4
4
|
showDatePickerAt: number | null;
|
|
5
5
|
isDateEmpty: boolean;
|
|
6
6
|
focusDateInput: boolean;
|
|
7
|
+
isInitialised: boolean;
|
|
7
8
|
};
|
|
8
9
|
export type DatePluginMeta = {
|
|
9
10
|
isNew?: boolean;
|
|
10
11
|
showDatePickerAt?: number | null;
|
|
11
12
|
isDateEmpty?: boolean;
|
|
13
|
+
isInitialised: boolean;
|
|
12
14
|
};
|
|
@@ -4,9 +4,11 @@ export type DatePluginState = {
|
|
|
4
4
|
showDatePickerAt: number | null;
|
|
5
5
|
isDateEmpty: boolean;
|
|
6
6
|
focusDateInput: boolean;
|
|
7
|
+
isInitialised: boolean;
|
|
7
8
|
};
|
|
8
9
|
export type DatePluginMeta = {
|
|
9
10
|
isNew?: boolean;
|
|
10
11
|
showDatePickerAt?: number | null;
|
|
11
12
|
isDateEmpty?: boolean;
|
|
13
|
+
isInitialised: boolean;
|
|
12
14
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-date",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.3",
|
|
4
4
|
"description": "Date plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
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": "^104.
|
|
40
|
+
"@atlaskit/editor-common": "^104.1.0",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
42
42
|
"@atlaskit/editor-plugin-annotation": "^2.7.0",
|
|
43
43
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
46
46
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
47
47
|
"@atlaskit/form": "^12.0.0",
|
|
48
|
-
"@atlaskit/icon": "^
|
|
48
|
+
"@atlaskit/icon": "^26.0.0",
|
|
49
49
|
"@atlaskit/locale": "^3.0.0",
|
|
50
50
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
51
51
|
"@atlaskit/textfield": "^8.0.0",
|
|
52
52
|
"@atlaskit/theme": "^18.0.0",
|
|
53
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
53
|
+
"@atlaskit/tmp-editor-statsig": "^4.19.0",
|
|
54
54
|
"@atlaskit/tokens": "^4.8.0",
|
|
55
55
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
56
56
|
"@babel/runtime": "^7.0.0",
|