@atlaskit/editor-plugin-date 4.3.1 → 4.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-plugin-date
2
2
 
3
+ ## 4.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#149315](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149315)
8
+ [`48b82f7847cb0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/48b82f7847cb0) -
9
+ Adds an isInitialised variable to date plugin shared state
10
+
3
11
  ## 4.3.1
4
12
 
5
13
  ### Patch Changes
@@ -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;
@@ -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
  };
@@ -24,6 +24,7 @@ export type DatePluginSharedState = {
24
24
  showDatePickerAt?: number | null;
25
25
  isNew: boolean;
26
26
  focusDateInput: boolean;
27
+ isInitialised: boolean;
27
28
  };
28
29
  export type InsertDate = (props: {
29
30
  date?: DateType;
@@ -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
  };
@@ -24,6 +24,7 @@ export type DatePluginSharedState = {
24
24
  showDatePickerAt?: number | null;
25
25
  isNew: boolean;
26
26
  focusDateInput: boolean;
27
+ isInitialised: boolean;
27
28
  };
28
29
  export type InsertDate = (props: {
29
30
  date?: DateType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-date",
3
- "version": "4.3.1",
3
+ "version": "4.3.2",
4
4
  "description": "Date plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",