@atlaskit/editor-plugin-date 4.3.14 → 4.3.16
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 +12 -0
- package/dist/cjs/datePlugin.js +2 -2
- package/dist/cjs/nodeviews/dateNodeSpec.js +2 -25
- package/dist/cjs/pm-plugins/main.js +1 -12
- package/dist/es2019/datePlugin.js +2 -2
- package/dist/es2019/nodeviews/dateNodeSpec.js +1 -21
- package/dist/es2019/pm-plugins/main.js +2 -13
- package/dist/esm/datePlugin.js +2 -2
- package/dist/esm/nodeviews/dateNodeSpec.js +1 -23
- package/dist/esm/pm-plugins/main.js +2 -13
- package/dist/types/nodeviews/dateNodeSpec.d.ts +1 -9
- package/dist/types-ts4.5/nodeviews/dateNodeSpec.d.ts +1 -9
- package/package.json +7 -7
- package/dist/cjs/nodeviews/date.js +0 -40
- package/dist/es2019/nodeviews/date.js +0 -37
- package/dist/esm/nodeviews/date.js +0 -33
- package/dist/types/nodeviews/date.d.ts +0 -3
- package/dist/types-ts4.5/nodeviews/date.d.ts +0 -3
package/CHANGELOG.md
CHANGED
package/dist/cjs/datePlugin.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
11
|
+
var _adfSchema = require("@atlaskit/adf-schema");
|
|
11
12
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
13
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
13
14
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
@@ -17,7 +18,6 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
17
18
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
18
19
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
19
20
|
var _comment = _interopRequireDefault(require("@atlaskit/icon/core/comment"));
|
|
20
|
-
var _dateNodeSpec = require("./nodeviews/dateNodeSpec");
|
|
21
21
|
var _actions = require("./pm-plugins/actions");
|
|
22
22
|
var _commands = require("./pm-plugins/commands");
|
|
23
23
|
var _keymap = _interopRequireDefault(require("./pm-plugins/keymap"));
|
|
@@ -143,7 +143,7 @@ var datePlugin = function datePlugin(_ref3) {
|
|
|
143
143
|
nodes: function nodes() {
|
|
144
144
|
return [{
|
|
145
145
|
name: 'date',
|
|
146
|
-
node:
|
|
146
|
+
node: _adfSchema.date
|
|
147
147
|
}];
|
|
148
148
|
},
|
|
149
149
|
pmPlugins: function pmPlugins() {
|
|
@@ -1,39 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
6
|
+
exports.dateToDOM = exports.dateNodeSpec = void 0;
|
|
9
7
|
var _reactIntlNext = require("react-intl-next");
|
|
10
|
-
var _adfSchema = require("@atlaskit/adf-schema");
|
|
11
|
-
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
12
8
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
13
9
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
14
10
|
var _whitespace = require("@atlaskit/editor-common/whitespace");
|
|
15
11
|
var _colors = require("@atlaskit/theme/colors");
|
|
16
12
|
var _utils2 = require("./utils");
|
|
17
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
13
|
var intlRef;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Wrapper for ADF date node spec to augment toDOM implementation
|
|
23
|
-
* with fallback UI for lazy node view rendering / window virtualization
|
|
24
|
-
* @nodeSpecException:toDOM patch
|
|
25
|
-
* @returns
|
|
26
|
-
* @example
|
|
27
|
-
*/
|
|
28
|
-
var dateNodeSpec = exports.dateNodeSpec = function dateNodeSpec() {
|
|
29
|
-
if ((0, _coreUtils.isSSR)()) {
|
|
30
|
-
return _adfSchema.date;
|
|
31
|
-
}
|
|
32
|
-
return _objectSpread(_objectSpread({}, _adfSchema.date), {}, {
|
|
33
|
-
toDOM: dateToDOMvirtualization
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
var dateToDOMvirtualization = exports.dateToDOMvirtualization = function dateToDOMvirtualization(node) {
|
|
14
|
+
var dateNodeSpec = exports.dateNodeSpec = function dateNodeSpec(node) {
|
|
37
15
|
intlRef = intlRef || (0, _reactIntlNext.createIntl)({
|
|
38
16
|
locale: document.documentElement.lang || 'en-US'
|
|
39
17
|
});
|
|
@@ -70,7 +48,6 @@ var dateToDOM = exports.dateToDOM = function dateToDOM(node, state, getPos, intl
|
|
|
70
48
|
'data-prosemirror-content-type': 'node',
|
|
71
49
|
'data-prosemirror-node-name': 'date',
|
|
72
50
|
'data-prosemirror-node-inline': 'true',
|
|
73
|
-
'data-prosemirror-node-view-type': 'vanilla',
|
|
74
51
|
draggable: 'true'
|
|
75
52
|
};
|
|
76
53
|
var wrapperAttrs = {
|
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getPluginState = exports.default = void 0;
|
|
7
|
-
var _reactNodeView = require("@atlaskit/editor-common/react-node-view");
|
|
8
7
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
9
8
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
10
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
11
|
-
var _date = require("../nodeviews/date");
|
|
12
9
|
var _DateNodeView = require("../nodeviews/DateNodeView");
|
|
13
10
|
var _pluginKey = require("./plugin-key");
|
|
14
11
|
var _utils2 = require("./utils");
|
|
@@ -33,15 +30,7 @@ var createPlugin = function createPlugin(pmPluginFactoryParams) {
|
|
|
33
30
|
props: {
|
|
34
31
|
nodeViews: {
|
|
35
32
|
date: function date(node, view, getPos, decorations) {
|
|
36
|
-
|
|
37
|
-
exposure: true
|
|
38
|
-
})) {
|
|
39
|
-
return new _DateNodeView.DateNodeView(node, view, getPos, pmPluginFactoryParams.getIntl(), decorations);
|
|
40
|
-
}
|
|
41
|
-
return (0, _reactNodeView.getInlineNodeViewProducer)({
|
|
42
|
-
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
43
|
-
Component: _date.DateNodeView
|
|
44
|
-
})(node, view, getPos, decorations);
|
|
33
|
+
return new _DateNodeView.DateNodeView(node, view, getPos, pmPluginFactoryParams.getIntl(), decorations);
|
|
45
34
|
}
|
|
46
35
|
}
|
|
47
36
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Loadable from 'react-loadable';
|
|
3
|
+
import { date } from '@atlaskit/adf-schema';
|
|
3
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
5
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
5
6
|
import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
@@ -9,7 +10,6 @@ import { DateSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
|
9
10
|
import { calculateToolbarPositionAboveSelection } from '@atlaskit/editor-common/utils';
|
|
10
11
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
11
12
|
import CommentIcon from '@atlaskit/icon/core/comment';
|
|
12
|
-
import { dateNodeSpec } from './nodeviews/dateNodeSpec';
|
|
13
13
|
import { closeDatePicker, closeDatePickerWithAnalytics, createDate } from './pm-plugins/actions';
|
|
14
14
|
import { deleteDateCommand, insertDateCommand } from './pm-plugins/commands';
|
|
15
15
|
import keymap from './pm-plugins/keymap';
|
|
@@ -133,7 +133,7 @@ const datePlugin = ({
|
|
|
133
133
|
nodes() {
|
|
134
134
|
return [{
|
|
135
135
|
name: 'date',
|
|
136
|
-
node:
|
|
136
|
+
node: date
|
|
137
137
|
}];
|
|
138
138
|
},
|
|
139
139
|
pmPlugins() {
|
|
@@ -1,30 +1,11 @@
|
|
|
1
1
|
import { createIntl } from 'react-intl-next';
|
|
2
|
-
import { date } from '@atlaskit/adf-schema';
|
|
3
|
-
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
4
2
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
5
3
|
import { browser, timestampToString } from '@atlaskit/editor-common/utils';
|
|
6
4
|
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
|
|
7
5
|
import { N30A, N800 } from '@atlaskit/theme/colors';
|
|
8
6
|
import { getDateInformation } from './utils';
|
|
9
7
|
let intlRef;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Wrapper for ADF date node spec to augment toDOM implementation
|
|
13
|
-
* with fallback UI for lazy node view rendering / window virtualization
|
|
14
|
-
* @nodeSpecException:toDOM patch
|
|
15
|
-
* @returns
|
|
16
|
-
* @example
|
|
17
|
-
*/
|
|
18
|
-
export const dateNodeSpec = () => {
|
|
19
|
-
if (isSSR()) {
|
|
20
|
-
return date;
|
|
21
|
-
}
|
|
22
|
-
return {
|
|
23
|
-
...date,
|
|
24
|
-
toDOM: dateToDOMvirtualization
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export const dateToDOMvirtualization = node => {
|
|
8
|
+
export const dateNodeSpec = node => {
|
|
28
9
|
intlRef = intlRef || createIntl({
|
|
29
10
|
locale: document.documentElement.lang || 'en-US'
|
|
30
11
|
});
|
|
@@ -62,7 +43,6 @@ export const dateToDOM = (node, state, getPos, intl) => {
|
|
|
62
43
|
'data-prosemirror-content-type': 'node',
|
|
63
44
|
'data-prosemirror-node-name': 'date',
|
|
64
45
|
'data-prosemirror-node-inline': 'true',
|
|
65
|
-
'data-prosemirror-node-view-type': 'vanilla',
|
|
66
46
|
draggable: 'true'
|
|
67
47
|
};
|
|
68
48
|
const wrapperAttrs = {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
|
|
2
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
2
|
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
4
|
-
import {
|
|
5
|
-
import { DateNodeView } from '../nodeviews/date';
|
|
6
|
-
import { DateNodeView as DateNodeViewVanilla } from '../nodeviews/DateNodeView';
|
|
3
|
+
import { DateNodeView } from '../nodeviews/DateNodeView';
|
|
7
4
|
import { pluginKey } from './plugin-key';
|
|
8
5
|
import { mapping, onSelectionChanged, reducer } from './utils';
|
|
9
6
|
const {
|
|
@@ -30,15 +27,7 @@ const createPlugin = pmPluginFactoryParams => {
|
|
|
30
27
|
props: {
|
|
31
28
|
nodeViews: {
|
|
32
29
|
date: (node, view, getPos, decorations) => {
|
|
33
|
-
|
|
34
|
-
exposure: true
|
|
35
|
-
})) {
|
|
36
|
-
return new DateNodeViewVanilla(node, view, getPos, pmPluginFactoryParams.getIntl(), decorations);
|
|
37
|
-
}
|
|
38
|
-
return getInlineNodeViewProducer({
|
|
39
|
-
pmPluginFactoryParams,
|
|
40
|
-
Component: DateNodeView
|
|
41
|
-
})(node, view, getPos, decorations);
|
|
30
|
+
return new DateNodeView(node, view, getPos, pmPluginFactoryParams.getIntl(), decorations);
|
|
42
31
|
}
|
|
43
32
|
}
|
|
44
33
|
}
|
package/dist/esm/datePlugin.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Loadable from 'react-loadable';
|
|
3
|
+
import { date } from '@atlaskit/adf-schema';
|
|
3
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
5
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
5
6
|
import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
@@ -9,7 +10,6 @@ import { DateSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
|
9
10
|
import { calculateToolbarPositionAboveSelection } from '@atlaskit/editor-common/utils';
|
|
10
11
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
11
12
|
import CommentIcon from '@atlaskit/icon/core/comment';
|
|
12
|
-
import { dateNodeSpec } from './nodeviews/dateNodeSpec';
|
|
13
13
|
import { closeDatePicker as _closeDatePicker, closeDatePickerWithAnalytics as _closeDatePickerWithAnalytics, createDate } from './pm-plugins/actions';
|
|
14
14
|
import { deleteDateCommand, insertDateCommand } from './pm-plugins/commands';
|
|
15
15
|
import keymap from './pm-plugins/keymap';
|
|
@@ -132,7 +132,7 @@ var datePlugin = function datePlugin(_ref3) {
|
|
|
132
132
|
nodes: function nodes() {
|
|
133
133
|
return [{
|
|
134
134
|
name: 'date',
|
|
135
|
-
node:
|
|
135
|
+
node: date
|
|
136
136
|
}];
|
|
137
137
|
},
|
|
138
138
|
pmPlugins: function pmPlugins() {
|
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
1
|
import { createIntl } from 'react-intl-next';
|
|
5
|
-
import { date } from '@atlaskit/adf-schema';
|
|
6
|
-
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
7
2
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
8
3
|
import { browser, timestampToString } from '@atlaskit/editor-common/utils';
|
|
9
4
|
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
|
|
10
5
|
import { N30A, N800 } from '@atlaskit/theme/colors';
|
|
11
6
|
import { getDateInformation } from './utils';
|
|
12
7
|
var intlRef;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Wrapper for ADF date node spec to augment toDOM implementation
|
|
16
|
-
* with fallback UI for lazy node view rendering / window virtualization
|
|
17
|
-
* @nodeSpecException:toDOM patch
|
|
18
|
-
* @returns
|
|
19
|
-
* @example
|
|
20
|
-
*/
|
|
21
|
-
export var dateNodeSpec = function dateNodeSpec() {
|
|
22
|
-
if (isSSR()) {
|
|
23
|
-
return date;
|
|
24
|
-
}
|
|
25
|
-
return _objectSpread(_objectSpread({}, date), {}, {
|
|
26
|
-
toDOM: dateToDOMvirtualization
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
export var dateToDOMvirtualization = function dateToDOMvirtualization(node) {
|
|
8
|
+
export var dateNodeSpec = function dateNodeSpec(node) {
|
|
30
9
|
intlRef = intlRef || createIntl({
|
|
31
10
|
locale: document.documentElement.lang || 'en-US'
|
|
32
11
|
});
|
|
@@ -63,7 +42,6 @@ export var dateToDOM = function dateToDOM(node, state, getPos, intl) {
|
|
|
63
42
|
'data-prosemirror-content-type': 'node',
|
|
64
43
|
'data-prosemirror-node-name': 'date',
|
|
65
44
|
'data-prosemirror-node-inline': 'true',
|
|
66
|
-
'data-prosemirror-node-view-type': 'vanilla',
|
|
67
45
|
draggable: 'true'
|
|
68
46
|
};
|
|
69
47
|
var wrapperAttrs = {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
|
|
2
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
2
|
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
4
|
-
import {
|
|
5
|
-
import { DateNodeView } from '../nodeviews/date';
|
|
6
|
-
import { DateNodeView as DateNodeViewVanilla } from '../nodeviews/DateNodeView';
|
|
3
|
+
import { DateNodeView } from '../nodeviews/DateNodeView';
|
|
7
4
|
import { pluginKey } from './plugin-key';
|
|
8
5
|
import { mapping, onSelectionChanged, reducer } from './utils';
|
|
9
6
|
var _pluginFactory = pluginFactory(pluginKey, reducer, {
|
|
@@ -27,15 +24,7 @@ var createPlugin = function createPlugin(pmPluginFactoryParams) {
|
|
|
27
24
|
props: {
|
|
28
25
|
nodeViews: {
|
|
29
26
|
date: function date(node, view, getPos, decorations) {
|
|
30
|
-
|
|
31
|
-
exposure: true
|
|
32
|
-
})) {
|
|
33
|
-
return new DateNodeViewVanilla(node, view, getPos, pmPluginFactoryParams.getIntl(), decorations);
|
|
34
|
-
}
|
|
35
|
-
return getInlineNodeViewProducer({
|
|
36
|
-
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
37
|
-
Component: DateNodeView
|
|
38
|
-
})(node, view, getPos, decorations);
|
|
27
|
+
return new DateNodeView(node, view, getPos, pmPluginFactoryParams.getIntl(), decorations);
|
|
39
28
|
}
|
|
40
29
|
}
|
|
41
30
|
}
|
|
@@ -2,15 +2,7 @@ import type { IntlShape } from 'react-intl-next';
|
|
|
2
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
|
-
|
|
6
|
-
* Wrapper for ADF date node spec to augment toDOM implementation
|
|
7
|
-
* with fallback UI for lazy node view rendering / window virtualization
|
|
8
|
-
* @nodeSpecException:toDOM patch
|
|
9
|
-
* @returns
|
|
10
|
-
* @example
|
|
11
|
-
*/
|
|
12
|
-
export declare const dateNodeSpec: () => import("prosemirror-model").NodeSpec;
|
|
13
|
-
export declare const dateToDOMvirtualization: (node: PMNode) => DOMOutputSpec;
|
|
5
|
+
export declare const dateNodeSpec: (node: PMNode) => DOMOutputSpec;
|
|
14
6
|
export declare const dateToDOM: (node: PMNode, state: EditorState, getPos: getPosHandlerNode, intl: IntlShape) => [string, Record<string, string>, (string | {
|
|
15
7
|
class: string;
|
|
16
8
|
} | (string | {
|
|
@@ -2,15 +2,7 @@ import type { IntlShape } from 'react-intl-next';
|
|
|
2
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
|
-
|
|
6
|
-
* Wrapper for ADF date node spec to augment toDOM implementation
|
|
7
|
-
* with fallback UI for lazy node view rendering / window virtualization
|
|
8
|
-
* @nodeSpecException:toDOM patch
|
|
9
|
-
* @returns
|
|
10
|
-
* @example
|
|
11
|
-
*/
|
|
12
|
-
export declare const dateNodeSpec: () => import("prosemirror-model").NodeSpec;
|
|
13
|
-
export declare const dateToDOMvirtualization: (node: PMNode) => DOMOutputSpec;
|
|
5
|
+
export declare const dateNodeSpec: (node: PMNode) => DOMOutputSpec;
|
|
14
6
|
export declare const dateToDOM: (node: PMNode, state: EditorState, getPos: getPosHandlerNode, intl: IntlShape) => [
|
|
15
7
|
string,
|
|
16
8
|
Record<string, string>,
|
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.16",
|
|
4
4
|
"description": "Date plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
37
37
|
"@atlaskit/calendar": "^17.1.0",
|
|
38
|
-
"@atlaskit/css": "^0.
|
|
38
|
+
"@atlaskit/css": "^0.12.0",
|
|
39
39
|
"@atlaskit/date": "^2.0.0",
|
|
40
|
-
"@atlaskit/editor-common": "^107.
|
|
40
|
+
"@atlaskit/editor-common": "^107.3.0",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
42
42
|
"@atlaskit/editor-plugin-annotation": "^2.9.0",
|
|
43
43
|
"@atlaskit/editor-plugin-editor-disabled": "^2.1.0",
|
|
@@ -45,13 +45,13 @@
|
|
|
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": "^27.
|
|
48
|
+
"@atlaskit/icon": "^27.2.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": "^5.
|
|
53
|
+
"@atlaskit/tmp-editor-statsig": "^8.4.0",
|
|
54
|
+
"@atlaskit/tokens": "^5.4.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.6.0",
|
|
69
69
|
"@atlaskit/editor-plugin-selection": "^2.2.0",
|
|
70
|
-
"@atlaskit/editor-plugin-table": "^10.
|
|
70
|
+
"@atlaskit/editor-plugin-table": "^10.13.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",
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.DateNodeView = DateNodeView;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _reactIntlNext = require("react-intl-next");
|
|
10
|
-
var _date = require("@atlaskit/date");
|
|
11
|
-
var _styles = require("@atlaskit/editor-common/styles");
|
|
12
|
-
var _actions = require("../pm-plugins/actions");
|
|
13
|
-
var _utils = require("./utils");
|
|
14
|
-
function DateNodeView(props) {
|
|
15
|
-
var _props$getPos;
|
|
16
|
-
var timestamp = props.node.attrs.timestamp;
|
|
17
|
-
var intl = (0, _reactIntlNext.useIntl)();
|
|
18
|
-
var pos = (_props$getPos = props.getPos) === null || _props$getPos === void 0 ? void 0 : _props$getPos.call(props);
|
|
19
|
-
var _getDateInformation = (0, _utils.getDateInformation)(timestamp, intl, props.view.state, pos),
|
|
20
|
-
displayString = _getDateInformation.displayString,
|
|
21
|
-
color = _getDateInformation.color;
|
|
22
|
-
return (
|
|
23
|
-
/*#__PURE__*/
|
|
24
|
-
// eslint-disable-next-line @atlassian/a11y/interactive-element-not-keyboard-focusable, @atlaskit/ui-styling-standard/no-classname-prop, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -- Ignored via go/DSP-18766
|
|
25
|
-
_react.default.createElement("span", {
|
|
26
|
-
className: _styles.DateSharedCssClassName.DATE_WRAPPER,
|
|
27
|
-
onClick: handleClick
|
|
28
|
-
}, /*#__PURE__*/_react.default.createElement(_date.Date, {
|
|
29
|
-
color: color,
|
|
30
|
-
value: timestamp
|
|
31
|
-
}, displayString))
|
|
32
|
-
);
|
|
33
|
-
function handleClick(event) {
|
|
34
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
35
|
-
var _props$view = props.view,
|
|
36
|
-
state = _props$view.state,
|
|
37
|
-
dispatch = _props$view.dispatch;
|
|
38
|
-
(0, _actions.setDatePickerAt)(state.selection.from)(state, dispatch);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useIntl } from 'react-intl-next';
|
|
3
|
-
import { Date } from '@atlaskit/date';
|
|
4
|
-
import { DateSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
5
|
-
import { setDatePickerAt } from '../pm-plugins/actions';
|
|
6
|
-
import { getDateInformation } from './utils';
|
|
7
|
-
export function DateNodeView(props) {
|
|
8
|
-
var _props$getPos;
|
|
9
|
-
const {
|
|
10
|
-
timestamp
|
|
11
|
-
} = props.node.attrs;
|
|
12
|
-
const intl = useIntl();
|
|
13
|
-
const pos = (_props$getPos = props.getPos) === null || _props$getPos === void 0 ? void 0 : _props$getPos.call(props);
|
|
14
|
-
const {
|
|
15
|
-
displayString,
|
|
16
|
-
color
|
|
17
|
-
} = getDateInformation(timestamp, intl, props.view.state, pos);
|
|
18
|
-
return (
|
|
19
|
-
/*#__PURE__*/
|
|
20
|
-
// eslint-disable-next-line @atlassian/a11y/interactive-element-not-keyboard-focusable, @atlaskit/ui-styling-standard/no-classname-prop, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -- Ignored via go/DSP-18766
|
|
21
|
-
React.createElement("span", {
|
|
22
|
-
className: DateSharedCssClassName.DATE_WRAPPER,
|
|
23
|
-
onClick: handleClick
|
|
24
|
-
}, /*#__PURE__*/React.createElement(Date, {
|
|
25
|
-
color: color,
|
|
26
|
-
value: timestamp
|
|
27
|
-
}, displayString))
|
|
28
|
-
);
|
|
29
|
-
function handleClick(event) {
|
|
30
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
31
|
-
const {
|
|
32
|
-
state,
|
|
33
|
-
dispatch
|
|
34
|
-
} = props.view;
|
|
35
|
-
setDatePickerAt(state.selection.from)(state, dispatch);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useIntl } from 'react-intl-next';
|
|
3
|
-
import { Date } from '@atlaskit/date';
|
|
4
|
-
import { DateSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
5
|
-
import { setDatePickerAt } from '../pm-plugins/actions';
|
|
6
|
-
import { getDateInformation } from './utils';
|
|
7
|
-
export function DateNodeView(props) {
|
|
8
|
-
var _props$getPos;
|
|
9
|
-
var timestamp = props.node.attrs.timestamp;
|
|
10
|
-
var intl = useIntl();
|
|
11
|
-
var pos = (_props$getPos = props.getPos) === null || _props$getPos === void 0 ? void 0 : _props$getPos.call(props);
|
|
12
|
-
var _getDateInformation = getDateInformation(timestamp, intl, props.view.state, pos),
|
|
13
|
-
displayString = _getDateInformation.displayString,
|
|
14
|
-
color = _getDateInformation.color;
|
|
15
|
-
return (
|
|
16
|
-
/*#__PURE__*/
|
|
17
|
-
// eslint-disable-next-line @atlassian/a11y/interactive-element-not-keyboard-focusable, @atlaskit/ui-styling-standard/no-classname-prop, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -- Ignored via go/DSP-18766
|
|
18
|
-
React.createElement("span", {
|
|
19
|
-
className: DateSharedCssClassName.DATE_WRAPPER,
|
|
20
|
-
onClick: handleClick
|
|
21
|
-
}, /*#__PURE__*/React.createElement(Date, {
|
|
22
|
-
color: color,
|
|
23
|
-
value: timestamp
|
|
24
|
-
}, displayString))
|
|
25
|
-
);
|
|
26
|
-
function handleClick(event) {
|
|
27
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
28
|
-
var _props$view = props.view,
|
|
29
|
-
state = _props$view.state,
|
|
30
|
-
dispatch = _props$view.dispatch;
|
|
31
|
-
setDatePickerAt(state.selection.from)(state, dispatch);
|
|
32
|
-
}
|
|
33
|
-
}
|