@atlaskit/editor-plugin-date 4.3.5 → 4.3.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 +6 -0
- package/dist/cjs/nodeviews/DateNodeView.js +18 -0
- package/dist/cjs/nodeviews/dateNodeSpec.js +4 -2
- package/dist/es2019/nodeviews/DateNodeView.js +19 -0
- package/dist/es2019/nodeviews/dateNodeSpec.js +4 -2
- package/dist/esm/nodeviews/DateNodeView.js +19 -0
- package/dist/esm/nodeviews/dateNodeSpec.js +4 -2
- package/dist/types/nodeviews/DateNodeView.d.ts +19 -1
- package/dist/types/nodeviews/dateNodeSpec.d.ts +3 -3
- package/dist/types/pm-plugins/actions.d.ts +0 -1
- package/dist/types-ts4.5/nodeviews/DateNodeView.d.ts +19 -1
- package/dist/types-ts4.5/nodeviews/dateNodeSpec.d.ts +3 -3
- package/dist/types-ts4.5/pm-plugins/actions.d.ts +0 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -11,7 +11,19 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
11
11
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
12
12
|
var _actions = require("../pm-plugins/actions");
|
|
13
13
|
var _dateNodeSpec = require("./dateNodeSpec");
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
14
17
|
var DateNodeView = exports.DateNodeView = /*#__PURE__*/function () {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @param node
|
|
21
|
+
* @param view
|
|
22
|
+
* @param getPos
|
|
23
|
+
* @param intl
|
|
24
|
+
* @param decorations
|
|
25
|
+
* @example
|
|
26
|
+
*/
|
|
15
27
|
function DateNodeView(node, view, getPos, intl, decorations) {
|
|
16
28
|
var _this = this;
|
|
17
29
|
(0, _classCallCheck2.default)(this, DateNodeView);
|
|
@@ -35,6 +47,12 @@ var DateNodeView = exports.DateNodeView = /*#__PURE__*/function () {
|
|
|
35
47
|
});
|
|
36
48
|
this.parentTaskState = DateNodeView.getParentTaskState(decorations);
|
|
37
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @param node
|
|
53
|
+
* @param decorations
|
|
54
|
+
* @example
|
|
55
|
+
*/
|
|
38
56
|
return (0, _createClass2.default)(DateNodeView, [{
|
|
39
57
|
key: "update",
|
|
40
58
|
value: function update(node, decorations) {
|
|
@@ -23,6 +23,7 @@ var intlRef;
|
|
|
23
23
|
* with fallback UI for lazy node view rendering / window virtualization
|
|
24
24
|
* @nodeSpecException:toDOM patch
|
|
25
25
|
* @returns
|
|
26
|
+
* @example
|
|
26
27
|
*/
|
|
27
28
|
var dateNodeSpec = exports.dateNodeSpec = function dateNodeSpec() {
|
|
28
29
|
if ((0, _coreUtils.isSSR)()) {
|
|
@@ -77,8 +78,9 @@ var dateToDOM = exports.dateToDOM = function dateToDOM(node, state, getPos, intl
|
|
|
77
78
|
'data-node-type': 'date',
|
|
78
79
|
'data-timestamp': timestamp
|
|
79
80
|
};
|
|
80
|
-
var attrs =
|
|
81
|
-
class: "date-node-color-".concat(color)
|
|
81
|
+
var attrs = {
|
|
82
|
+
class: !color ? '' : "date-node-color-".concat(color),
|
|
83
|
+
style: "white-space: unset"
|
|
82
84
|
};
|
|
83
85
|
return ['span', nodeWrapperAttrs, ['span', {
|
|
84
86
|
class: 'zeroWidthSpaceContainer'
|
|
@@ -2,7 +2,20 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import { setDatePickerAt } from '../pm-plugins/actions';
|
|
4
4
|
import { dateToDOM } from './dateNodeSpec';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
5
9
|
export class DateNodeView {
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param node
|
|
13
|
+
* @param view
|
|
14
|
+
* @param getPos
|
|
15
|
+
* @param intl
|
|
16
|
+
* @param decorations
|
|
17
|
+
* @example
|
|
18
|
+
*/
|
|
6
19
|
constructor(node, view, getPos, intl, decorations) {
|
|
7
20
|
_defineProperty(this, "parentTaskState", '');
|
|
8
21
|
this.node = node;
|
|
@@ -26,6 +39,12 @@ export class DateNodeView {
|
|
|
26
39
|
});
|
|
27
40
|
this.parentTaskState = DateNodeView.getParentTaskState(decorations);
|
|
28
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @param node
|
|
45
|
+
* @param decorations
|
|
46
|
+
* @example
|
|
47
|
+
*/
|
|
29
48
|
update(node, decorations) {
|
|
30
49
|
// we're only interested in two scenarios to trigger a DOM update:
|
|
31
50
|
// 1. the date value (timestamp) has changed
|
|
@@ -13,6 +13,7 @@ let intlRef;
|
|
|
13
13
|
* with fallback UI for lazy node view rendering / window virtualization
|
|
14
14
|
* @nodeSpecException:toDOM patch
|
|
15
15
|
* @returns
|
|
16
|
+
* @example
|
|
16
17
|
*/
|
|
17
18
|
export const dateNodeSpec = () => {
|
|
18
19
|
if (isSSR()) {
|
|
@@ -69,8 +70,9 @@ export const dateToDOM = (node, state, getPos, intl) => {
|
|
|
69
70
|
'data-node-type': 'date',
|
|
70
71
|
'data-timestamp': timestamp
|
|
71
72
|
};
|
|
72
|
-
const attrs =
|
|
73
|
-
class: `date-node-color-${color}
|
|
73
|
+
const attrs = {
|
|
74
|
+
class: !color ? '' : `date-node-color-${color}`,
|
|
75
|
+
style: `white-space: unset`
|
|
74
76
|
};
|
|
75
77
|
return ['span', nodeWrapperAttrs, ['span', {
|
|
76
78
|
class: 'zeroWidthSpaceContainer'
|
|
@@ -4,7 +4,20 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
4
4
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import { setDatePickerAt } from '../pm-plugins/actions';
|
|
6
6
|
import { dateToDOM } from './dateNodeSpec';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
7
11
|
export var DateNodeView = /*#__PURE__*/function () {
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @param node
|
|
15
|
+
* @param view
|
|
16
|
+
* @param getPos
|
|
17
|
+
* @param intl
|
|
18
|
+
* @param decorations
|
|
19
|
+
* @example
|
|
20
|
+
*/
|
|
8
21
|
function DateNodeView(node, view, getPos, intl, decorations) {
|
|
9
22
|
var _this = this;
|
|
10
23
|
_classCallCheck(this, DateNodeView);
|
|
@@ -28,6 +41,12 @@ export var DateNodeView = /*#__PURE__*/function () {
|
|
|
28
41
|
});
|
|
29
42
|
this.parentTaskState = DateNodeView.getParentTaskState(decorations);
|
|
30
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @param node
|
|
47
|
+
* @param decorations
|
|
48
|
+
* @example
|
|
49
|
+
*/
|
|
31
50
|
return _createClass(DateNodeView, [{
|
|
32
51
|
key: "update",
|
|
33
52
|
value: function update(node, decorations) {
|
|
@@ -16,6 +16,7 @@ var intlRef;
|
|
|
16
16
|
* with fallback UI for lazy node view rendering / window virtualization
|
|
17
17
|
* @nodeSpecException:toDOM patch
|
|
18
18
|
* @returns
|
|
19
|
+
* @example
|
|
19
20
|
*/
|
|
20
21
|
export var dateNodeSpec = function dateNodeSpec() {
|
|
21
22
|
if (isSSR()) {
|
|
@@ -70,8 +71,9 @@ export var dateToDOM = function dateToDOM(node, state, getPos, intl) {
|
|
|
70
71
|
'data-node-type': 'date',
|
|
71
72
|
'data-timestamp': timestamp
|
|
72
73
|
};
|
|
73
|
-
var attrs =
|
|
74
|
-
class: "date-node-color-".concat(color)
|
|
74
|
+
var attrs = {
|
|
75
|
+
class: !color ? '' : "date-node-color-".concat(color),
|
|
76
|
+
style: "white-space: unset"
|
|
75
77
|
};
|
|
76
78
|
return ['span', nodeWrapperAttrs, ['span', {
|
|
77
79
|
class: 'zeroWidthSpaceContainer'
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { IntlShape } from 'react-intl-next';
|
|
1
|
+
import { type IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { Decoration, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
6
9
|
export declare class DateNodeView implements NodeView {
|
|
7
10
|
dom: Node;
|
|
8
11
|
private node;
|
|
@@ -10,7 +13,22 @@ export declare class DateNodeView implements NodeView {
|
|
|
10
13
|
private readonly view;
|
|
11
14
|
private readonly getPos;
|
|
12
15
|
private parentTaskState;
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param node
|
|
19
|
+
* @param view
|
|
20
|
+
* @param getPos
|
|
21
|
+
* @param intl
|
|
22
|
+
* @param decorations
|
|
23
|
+
* @example
|
|
24
|
+
*/
|
|
13
25
|
constructor(node: PMNode, view: EditorView, getPos: getPosHandlerNode, intl: IntlShape, decorations: ReadonlyArray<Decoration>);
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @param node
|
|
29
|
+
* @param decorations
|
|
30
|
+
* @example
|
|
31
|
+
*/
|
|
14
32
|
update(node: PMNode, decorations: ReadonlyArray<Decoration>): boolean;
|
|
15
33
|
private static getParentTaskState;
|
|
16
34
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
|
-
import { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
/**
|
|
@@ -7,6 +7,7 @@ import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
|
7
7
|
* with fallback UI for lazy node view rendering / window virtualization
|
|
8
8
|
* @nodeSpecException:toDOM patch
|
|
9
9
|
* @returns
|
|
10
|
+
* @example
|
|
10
11
|
*/
|
|
11
12
|
export declare const dateNodeSpec: () => import("prosemirror-model").NodeSpec;
|
|
12
13
|
export declare const dateToDOMvirtualization: (node: PMNode) => DOMOutputSpec;
|
|
@@ -15,9 +16,8 @@ export declare const dateToDOM: (node: PMNode, state: EditorState, getPos: getPo
|
|
|
15
16
|
} | (string | {
|
|
16
17
|
class: string;
|
|
17
18
|
})[])[], (string | Record<string, string> | (string | {
|
|
18
|
-
class?: undefined;
|
|
19
|
-
} | {
|
|
20
19
|
class: string;
|
|
20
|
+
style: string;
|
|
21
21
|
})[])[], (string | {
|
|
22
22
|
class: string;
|
|
23
23
|
contentEditable: string;
|
|
@@ -40,7 +40,6 @@ export declare const closeDatePickerWithAnalytics: ({ date, pluginInjectionApi,
|
|
|
40
40
|
pluginConfiguration?: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginOptions | undefined;
|
|
41
41
|
commands: {
|
|
42
42
|
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
43
|
-
updateContentMode: (action: import("packages/editor/editor-plugin-editor-viewmode/dist/types/editorViewmodePluginType").UpdateContentModeAction) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
44
43
|
};
|
|
45
44
|
}, import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginOptions | undefined>>];
|
|
46
45
|
sharedState: import("../types").DatePluginSharedState;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { IntlShape } from 'react-intl-next';
|
|
1
|
+
import { type IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { Decoration, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
6
9
|
export declare class DateNodeView implements NodeView {
|
|
7
10
|
dom: Node;
|
|
8
11
|
private node;
|
|
@@ -10,7 +13,22 @@ export declare class DateNodeView implements NodeView {
|
|
|
10
13
|
private readonly view;
|
|
11
14
|
private readonly getPos;
|
|
12
15
|
private parentTaskState;
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param node
|
|
19
|
+
* @param view
|
|
20
|
+
* @param getPos
|
|
21
|
+
* @param intl
|
|
22
|
+
* @param decorations
|
|
23
|
+
* @example
|
|
24
|
+
*/
|
|
13
25
|
constructor(node: PMNode, view: EditorView, getPos: getPosHandlerNode, intl: IntlShape, decorations: ReadonlyArray<Decoration>);
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @param node
|
|
29
|
+
* @param decorations
|
|
30
|
+
* @example
|
|
31
|
+
*/
|
|
14
32
|
update(node: PMNode, decorations: ReadonlyArray<Decoration>): boolean;
|
|
15
33
|
private static getParentTaskState;
|
|
16
34
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
|
-
import { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
/**
|
|
@@ -7,6 +7,7 @@ import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
|
7
7
|
* with fallback UI for lazy node view rendering / window virtualization
|
|
8
8
|
* @nodeSpecException:toDOM patch
|
|
9
9
|
* @returns
|
|
10
|
+
* @example
|
|
10
11
|
*/
|
|
11
12
|
export declare const dateNodeSpec: () => import("prosemirror-model").NodeSpec;
|
|
12
13
|
export declare const dateToDOMvirtualization: (node: PMNode) => DOMOutputSpec;
|
|
@@ -19,9 +20,8 @@ export declare const dateToDOM: (node: PMNode, state: EditorState, getPos: getPo
|
|
|
19
20
|
class: string;
|
|
20
21
|
})[])[],
|
|
21
22
|
(string | Record<string, string> | (string | {
|
|
22
|
-
class?: undefined;
|
|
23
|
-
} | {
|
|
24
23
|
class: string;
|
|
24
|
+
style: string;
|
|
25
25
|
})[])[],
|
|
26
26
|
(string | {
|
|
27
27
|
class: string;
|
|
@@ -47,7 +47,6 @@ export declare const closeDatePickerWithAnalytics: ({ date, pluginInjectionApi,
|
|
|
47
47
|
pluginConfiguration?: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginOptions | undefined;
|
|
48
48
|
commands: {
|
|
49
49
|
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
50
|
-
updateContentMode: (action: import("packages/editor/editor-plugin-editor-viewmode/dist/types/editorViewmodePluginType").UpdateContentModeAction) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
51
50
|
};
|
|
52
51
|
}, import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginOptions | undefined>>
|
|
53
52
|
];
|
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.6",
|
|
4
4
|
"description": "Date plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,21 +37,21 @@
|
|
|
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": "^105.
|
|
40
|
+
"@atlaskit/editor-common": "^105.10.0",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
42
42
|
"@atlaskit/editor-plugin-annotation": "^2.8.0",
|
|
43
43
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
44
|
-
"@atlaskit/editor-plugin-editor-viewmode": "^
|
|
44
|
+
"@atlaskit/editor-plugin-editor-viewmode": "^4.0.0",
|
|
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": "^26.
|
|
48
|
+
"@atlaskit/icon": "^26.3.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": "^
|
|
54
|
-
"@atlaskit/tokens": "^4.
|
|
53
|
+
"@atlaskit/tmp-editor-statsig": "^5.0.0",
|
|
54
|
+
"@atlaskit/tokens": "^4.9.0",
|
|
55
55
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
56
56
|
"@babel/runtime": "^7.0.0",
|
|
57
57
|
"bind-event-listener": "^3.0.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@atlaskit/editor-plugin-guideline": "^2.0.0",
|
|
68
68
|
"@atlaskit/editor-plugin-quick-insert": "^2.5.0",
|
|
69
69
|
"@atlaskit/editor-plugin-selection": "^2.2.0",
|
|
70
|
-
"@atlaskit/editor-plugin-table": "^10.
|
|
70
|
+
"@atlaskit/editor-plugin-table": "^10.11.0",
|
|
71
71
|
"@atlaskit/editor-plugin-tasks-and-decisions": "^5.1.0",
|
|
72
72
|
"@atlaskit/editor-plugin-type-ahead": "^2.7.0",
|
|
73
73
|
"@atlaskit/editor-plugin-width": "^3.0.0",
|