@atlaskit/editor-plugin-date 8.1.4 → 8.1.6
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,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-date
|
|
2
2
|
|
|
3
|
+
## 8.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a05464ea42678`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a05464ea42678) -
|
|
8
|
+
EDITOR-2791 bump adf-schema
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 8.1.5
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`4cab7924c4af0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4cab7924c4af0) -
|
|
16
|
+
[ux] Clean up editor_inline_comments_paste_insert_nodes
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 8.1.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -9,17 +9,16 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
9
9
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
10
10
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
11
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
var _internal = require("../ui/DatePicker/utils/internal");
|
|
14
13
|
var _pluginKey = require("./plugin-key");
|
|
15
14
|
var createDate = exports.createDate = function createDate(isQuickInsertAction) {
|
|
16
15
|
return function (state) {
|
|
17
16
|
var tr = state.tr;
|
|
18
|
-
var annotationMarksForPos = (0,
|
|
17
|
+
var annotationMarksForPos = (0, _utils.getAnnotationMarksForPos)(tr.selection.$head);
|
|
19
18
|
var dateNode = state.schema.nodes.date.createChecked({
|
|
20
19
|
timestamp: (0, _utils.todayTimestampInUTC)()
|
|
21
|
-
}, null,
|
|
22
|
-
var fragment = _model.Fragment.fromArray([dateNode, state.schema.text(' ',
|
|
20
|
+
}, null, annotationMarksForPos);
|
|
21
|
+
var fragment = _model.Fragment.fromArray([dateNode, state.schema.text(' ', annotationMarksForPos)]);
|
|
23
22
|
var insertable = (0, _utils2.canInsert)(tr.selection.$from, fragment);
|
|
24
23
|
if (!insertable) {
|
|
25
24
|
var parentSelection = _state.NodeSelection.create(tr.doc, tr.selection.from - tr.selection.$anchor.parentOffset - 1);
|
|
@@ -3,16 +3,15 @@ import { getAnnotationMarksForPos, todayTimestampInUTC } from '@atlaskit/editor-
|
|
|
3
3
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { canInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { isToday } from '../ui/DatePicker/utils/internal';
|
|
8
7
|
import { pluginKey } from './plugin-key';
|
|
9
8
|
export const createDate = isQuickInsertAction => state => {
|
|
10
9
|
const tr = state.tr;
|
|
11
|
-
const annotationMarksForPos =
|
|
10
|
+
const annotationMarksForPos = getAnnotationMarksForPos(tr.selection.$head);
|
|
12
11
|
const dateNode = state.schema.nodes.date.createChecked({
|
|
13
12
|
timestamp: todayTimestampInUTC()
|
|
14
|
-
}, null,
|
|
15
|
-
const fragment = Fragment.fromArray([dateNode, state.schema.text(' ',
|
|
13
|
+
}, null, annotationMarksForPos);
|
|
14
|
+
const fragment = Fragment.fromArray([dateNode, state.schema.text(' ', annotationMarksForPos)]);
|
|
16
15
|
const insertable = canInsert(tr.selection.$from, fragment);
|
|
17
16
|
if (!insertable) {
|
|
18
17
|
const parentSelection = NodeSelection.create(tr.doc, tr.selection.from - tr.selection.$anchor.parentOffset - 1);
|
|
@@ -3,17 +3,16 @@ import { getAnnotationMarksForPos, todayTimestampInUTC } from '@atlaskit/editor-
|
|
|
3
3
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { canInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { isToday } from '../ui/DatePicker/utils/internal';
|
|
8
7
|
import { pluginKey } from './plugin-key';
|
|
9
8
|
export var createDate = function createDate(isQuickInsertAction) {
|
|
10
9
|
return function (state) {
|
|
11
10
|
var tr = state.tr;
|
|
12
|
-
var annotationMarksForPos =
|
|
11
|
+
var annotationMarksForPos = getAnnotationMarksForPos(tr.selection.$head);
|
|
13
12
|
var dateNode = state.schema.nodes.date.createChecked({
|
|
14
13
|
timestamp: todayTimestampInUTC()
|
|
15
|
-
}, null,
|
|
16
|
-
var fragment = Fragment.fromArray([dateNode, state.schema.text(' ',
|
|
14
|
+
}, null, annotationMarksForPos);
|
|
15
|
+
var fragment = Fragment.fromArray([dateNode, state.schema.text(' ', annotationMarksForPos)]);
|
|
17
16
|
var insertable = canInsert(tr.selection.$from, fragment);
|
|
18
17
|
if (!insertable) {
|
|
19
18
|
var parentSelection = NodeSelection.create(tr.doc, tr.selection.from - tr.selection.$anchor.parentOffset - 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-date",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.6",
|
|
4
4
|
"description": "Date plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"atlaskit:src": "src/index.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/adf-schema": "^51.
|
|
32
|
+
"@atlaskit/adf-schema": "^51.4.0",
|
|
33
33
|
"@atlaskit/calendar": "^17.1.0",
|
|
34
34
|
"@atlaskit/css": "^0.15.0",
|
|
35
35
|
"@atlaskit/date": "^2.0.0",
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"@atlaskit/editor-plugin-editor-disabled": "^6.1.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-viewmode": "^8.0.0",
|
|
40
40
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
41
|
-
"@atlaskit/editor-shared-styles": "^3.
|
|
41
|
+
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
42
42
|
"@atlaskit/form": "^14.2.0",
|
|
43
43
|
"@atlaskit/icon": "^29.0.0",
|
|
44
44
|
"@atlaskit/locale": "^3.0.0",
|
|
45
45
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
46
|
-
"@atlaskit/textfield": "^8.
|
|
46
|
+
"@atlaskit/textfield": "^8.1.0",
|
|
47
47
|
"@atlaskit/theme": "^21.0.0",
|
|
48
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
48
|
+
"@atlaskit/tmp-editor-statsig": "^13.38.0",
|
|
49
49
|
"@atlaskit/tokens": "^8.0.0",
|
|
50
50
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@testing-library/react": "^13.4.0"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"@atlaskit/editor-common": "^110.
|
|
72
|
+
"@atlaskit/editor-common": "^110.32.0",
|
|
73
73
|
"react": "^18.2.0",
|
|
74
74
|
"react-dom": "^18.2.0"
|
|
75
75
|
},
|
|
@@ -109,9 +109,6 @@
|
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
111
|
"platform-feature-flags": {
|
|
112
|
-
"editor_inline_comments_paste_insert_nodes": {
|
|
113
|
-
"type": "boolean"
|
|
114
|
-
},
|
|
115
112
|
"editor_a11y_announce_date_picker_open": {
|
|
116
113
|
"type": "boolean"
|
|
117
114
|
},
|