@atlaskit/editor-plugin-date 28.0.4 → 28.0.5
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/datePlugin.js +28 -27
- package/dist/cjs/nodeviews/dateNodeSpec.js +7 -7
- package/dist/cjs/nodeviews/utils.js +6 -6
- package/dist/cjs/pm-plugins/actions.js +14 -13
- package/dist/cjs/pm-plugins/commands.js +12 -12
- package/dist/cjs/pm-plugins/keymap.js +2 -1
- package/dist/cjs/pm-plugins/main.js +5 -5
- package/dist/cjs/ui/DatePicker/date-picker-input.js +16 -16
- package/dist/cjs/ui/DatePicker/index.js +13 -11
- package/dist/cjs/ui/quick-insert/DateQuickInsertMenuItem.js +11 -11
- package/dist/cjs/ui/quick-insert/getDateQuickInsertComponents.js +3 -3
- package/dist/es2019/datePlugin.js +7 -6
- package/dist/es2019/nodeviews/dateNodeSpec.js +3 -3
- package/dist/es2019/nodeviews/utils.js +1 -1
- package/dist/es2019/pm-plugins/actions.js +3 -2
- package/dist/es2019/pm-plugins/commands.js +2 -2
- package/dist/es2019/pm-plugins/keymap.js +2 -1
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/es2019/ui/DatePicker/date-picker-input.js +2 -2
- package/dist/es2019/ui/DatePicker/index.js +7 -5
- package/dist/es2019/ui/quick-insert/DateQuickInsertMenuItem.js +2 -2
- package/dist/es2019/ui/quick-insert/getDateQuickInsertComponents.js +1 -1
- package/dist/esm/datePlugin.js +7 -6
- package/dist/esm/nodeviews/dateNodeSpec.js +3 -3
- package/dist/esm/nodeviews/utils.js +1 -1
- package/dist/esm/pm-plugins/actions.js +3 -2
- package/dist/esm/pm-plugins/commands.js +2 -2
- package/dist/esm/pm-plugins/keymap.js +2 -1
- package/dist/esm/pm-plugins/main.js +1 -1
- package/dist/esm/ui/DatePicker/date-picker-input.js +2 -2
- package/dist/esm/ui/DatePicker/index.js +7 -5
- package/dist/esm/ui/quick-insert/DateQuickInsertMenuItem.js +2 -2
- package/dist/esm/ui/quick-insert/getDateQuickInsertComponents.js +1 -1
- package/dist/types/datePluginType.d.ts +5 -5
- package/dist/types/nodeviews/DateNodeView.d.ts +1 -1
- package/dist/types/nodeviews/dateNodeSpec.d.ts +1 -1
- package/dist/types/pm-plugins/actions.d.ts +2 -1
- package/dist/types/pm-plugins/commands.d.ts +1 -1
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/types/index.d.ts +8 -6
- package/dist/types/ui/DatePicker/date-picker-input.d.ts +1 -1
- package/dist/types/ui/DatePicker/index.d.ts +2 -2
- package/dist/types/ui/quick-insert/DateQuickInsertMenuItem.d.ts +1 -1
- package/dist/types/ui/quick-insert/getDateQuickInsertComponents.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/cjs/datePlugin.js
CHANGED
|
@@ -11,14 +11,15 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
12
12
|
var _reactLooselyLazy = require("react-loosely-lazy");
|
|
13
13
|
var _date = require("@atlaskit/adf-schema/date");
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
15
|
+
var _assets = require("@atlaskit/editor-common/assets");
|
|
16
16
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
17
|
+
var _annotation = require("@atlaskit/editor-common/messages/annotation");
|
|
18
|
+
var _insertBlock = require("@atlaskit/editor-common/messages/insert-block");
|
|
19
|
+
var _date2 = require("@atlaskit/editor-common/styles/date");
|
|
20
|
+
var _useSharedPluginState2 = require("@atlaskit/editor-common/useSharedPluginState");
|
|
21
|
+
var _calculateToolbarPosition = require("@atlaskit/editor-common/utils/calculate-toolbar-position");
|
|
22
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
22
23
|
var _comment = _interopRequireDefault(require("@atlaskit/icon/core/comment"));
|
|
23
24
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
24
25
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
@@ -70,10 +71,10 @@ function getDateNode(editorView, showDatePickerAt) {
|
|
|
70
71
|
|
|
71
72
|
// Ignored via go/ees005
|
|
72
73
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
73
|
-
var element = (0,
|
|
74
|
+
var element = (0, _utils.findDomRefAtPos)(showDatePickerAt, domAtPos);
|
|
74
75
|
|
|
75
76
|
// Resolves ED-23702 for when the date is wrapped in an inline comment
|
|
76
|
-
var dateNode = element !== null && element !== void 0 && element.classList.contains(
|
|
77
|
+
var dateNode = element !== null && element !== void 0 && element.classList.contains(_date2.DateSharedCssClassName.DATE_CONTAINER) ? element : element === null || element === void 0 ? void 0 : element.querySelector(".".concat(_date2.DateSharedCssClassName.DATE_CONTAINER));
|
|
77
78
|
return dateNode || element;
|
|
78
79
|
}
|
|
79
80
|
function ContentComponent(_ref) {
|
|
@@ -84,7 +85,7 @@ function ContentComponent(_ref) {
|
|
|
84
85
|
popupsScrollableElement = _ref.popupsScrollableElement,
|
|
85
86
|
dependencyApi = _ref.dependencyApi,
|
|
86
87
|
weekStartDay = _ref.weekStartDay;
|
|
87
|
-
var _useSharedPluginState = (0,
|
|
88
|
+
var _useSharedPluginState = (0, _useSharedPluginState2.useSharedPluginState)(dependencyApi, ['date', 'editorDisabled']),
|
|
88
89
|
editorDisabledState = _useSharedPluginState.editorDisabledState,
|
|
89
90
|
dateState = _useSharedPluginState.dateState;
|
|
90
91
|
if (!(dateState !== null && dateState !== void 0 && dateState.showDatePickerAt) || editorDisabledState !== null && editorDisabledState !== void 0 && editorDisabledState.editorDisabled) {
|
|
@@ -246,24 +247,24 @@ var datePlugin = function datePlugin(_ref3) {
|
|
|
246
247
|
var formatMessage = _ref6.formatMessage;
|
|
247
248
|
return [{
|
|
248
249
|
id: 'date',
|
|
249
|
-
title: formatMessage(
|
|
250
|
-
description: formatMessage(
|
|
250
|
+
title: formatMessage(_insertBlock.toolbarInsertBlockMessages.date),
|
|
251
|
+
description: formatMessage(_insertBlock.toolbarInsertBlockMessages.dateDescription),
|
|
251
252
|
priority: 800,
|
|
252
253
|
keywords: ['calendar', 'day', 'time', 'today', '/'],
|
|
253
254
|
keyshortcut: '//',
|
|
254
255
|
icon: function icon() {
|
|
255
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
256
|
+
return /*#__PURE__*/_react.default.createElement(_assets.IconDate, null);
|
|
256
257
|
},
|
|
257
258
|
action: function action(insert, state, source) {
|
|
258
259
|
var _api$analytics, _api$analytics$attach;
|
|
259
260
|
var tr = (0, _actions.createDate)(true)(state);
|
|
260
261
|
api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || (_api$analytics$attach = _api$analytics.attachAnalyticsEvent) === null || _api$analytics$attach === void 0 || _api$analytics$attach.call(_api$analytics, {
|
|
261
|
-
action:
|
|
262
|
-
actionSubject:
|
|
263
|
-
actionSubjectId:
|
|
264
|
-
eventType:
|
|
262
|
+
action: _enums.ACTION.INSERTED,
|
|
263
|
+
actionSubject: _enums.ACTION_SUBJECT.DOCUMENT,
|
|
264
|
+
actionSubjectId: _enums.ACTION_SUBJECT_ID.DATE,
|
|
265
|
+
eventType: _enums.EVENT_TYPE.TRACK,
|
|
265
266
|
attributes: {
|
|
266
|
-
inputMethod: source !== null && source !== void 0 ? source :
|
|
267
|
+
inputMethod: source !== null && source !== void 0 ? source : _enums.INPUT_METHOD.QUICK_INSERT
|
|
267
268
|
}
|
|
268
269
|
})(tr);
|
|
269
270
|
return tr;
|
|
@@ -287,10 +288,10 @@ var datePlugin = function datePlugin(_ref3) {
|
|
|
287
288
|
if (api !== null && api !== void 0 && (_api$analytics2 = api.analytics) !== null && _api$analytics2 !== void 0 && _api$analytics2.actions) {
|
|
288
289
|
var _api$analytics3;
|
|
289
290
|
api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 || (_api$analytics3 = _api$analytics3.actions) === null || _api$analytics3 === void 0 || _api$analytics3.fireAnalyticsEvent({
|
|
290
|
-
action:
|
|
291
|
-
actionSubject:
|
|
292
|
-
actionSubjectId:
|
|
293
|
-
eventType:
|
|
291
|
+
action: _enums.ACTION.CLICKED,
|
|
292
|
+
actionSubject: _enums.ACTION_SUBJECT.BUTTON,
|
|
293
|
+
actionSubjectId: _enums.ACTION_SUBJECT_ID.CREATE_INLINE_COMMENT_FROM_HIGHLIGHT_ACTIONS_MENU,
|
|
294
|
+
eventType: _enums.EVENT_TYPE.UI,
|
|
294
295
|
attributes: {
|
|
295
296
|
source: 'highlightActionsMenu',
|
|
296
297
|
pageMode: 'edit',
|
|
@@ -298,7 +299,7 @@ var datePlugin = function datePlugin(_ref3) {
|
|
|
298
299
|
}
|
|
299
300
|
});
|
|
300
301
|
}
|
|
301
|
-
var command = (_api$annotation = api.annotation) === null || _api$annotation === void 0 || (_api$annotation = _api$annotation.actions) === null || _api$annotation === void 0 ? void 0 : _api$annotation.setInlineCommentDraftState(true,
|
|
302
|
+
var command = (_api$annotation = api.annotation) === null || _api$annotation === void 0 || (_api$annotation = _api$annotation.actions) === null || _api$annotation === void 0 ? void 0 : _api$annotation.setInlineCommentDraftState(true, _enums.INPUT_METHOD.TOOLBAR);
|
|
302
303
|
return command(stateFromClickEvent, dispatch);
|
|
303
304
|
};
|
|
304
305
|
return {
|
|
@@ -311,7 +312,7 @@ var datePlugin = function datePlugin(_ref3) {
|
|
|
311
312
|
return undefined;
|
|
312
313
|
}
|
|
313
314
|
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
314
|
-
var domRef = (0,
|
|
315
|
+
var domRef = (0, _utils.findDomRefAtPos)(datePosition, domAtPos);
|
|
315
316
|
var isHTMLElement = function isHTMLElement(element) {
|
|
316
317
|
return element instanceof HTMLElement;
|
|
317
318
|
};
|
|
@@ -320,7 +321,7 @@ var datePlugin = function datePlugin(_ref3) {
|
|
|
320
321
|
}
|
|
321
322
|
return undefined;
|
|
322
323
|
},
|
|
323
|
-
onPositionCalculated: (0,
|
|
324
|
+
onPositionCalculated: (0, _calculateToolbarPosition.calculateToolbarPositionAboveSelection)('Date floating toolbar'),
|
|
324
325
|
items: function items(node) {
|
|
325
326
|
var _api$annotation2;
|
|
326
327
|
var annotationState = api === null || api === void 0 || (_api$annotation2 = api.annotation) === null || _api$annotation2 === void 0 ? void 0 : _api$annotation2.sharedState.currentState();
|
|
@@ -334,10 +335,10 @@ var datePlugin = function datePlugin(_ref3) {
|
|
|
334
335
|
showTitle: true,
|
|
335
336
|
testId: 'add-comment-date-button',
|
|
336
337
|
icon: _comment.default,
|
|
337
|
-
title: intl.formatMessage(
|
|
338
|
+
title: intl.formatMessage(_annotation.annotationMessages.createComment),
|
|
338
339
|
onClick: onClick,
|
|
339
340
|
tooltipContent: /*#__PURE__*/_react.default.createElement(_keymaps.ToolTipContent, {
|
|
340
|
-
description: intl.formatMessage(
|
|
341
|
+
description: intl.formatMessage(_annotation.annotationMessages.createComment)
|
|
341
342
|
}),
|
|
342
343
|
supportsViewMode: true
|
|
343
344
|
}];
|
|
@@ -6,18 +6,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.dateToDOM = exports.dateNodeSpec = void 0;
|
|
7
7
|
var _reactIntl = require("react-intl");
|
|
8
8
|
var _browser = require("@atlaskit/editor-common/browser");
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var _whitespace = require("@atlaskit/editor-common/whitespace");
|
|
9
|
+
var _cssHelper = require("@atlaskit/editor-common/css-helper");
|
|
10
|
+
var _date = require("@atlaskit/editor-common/utils/date");
|
|
11
|
+
var _whitespace = require("@atlaskit/editor-common/whitespace/whitespace");
|
|
12
12
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
13
|
-
var
|
|
13
|
+
var _utils = require("./utils");
|
|
14
14
|
var intlRef;
|
|
15
15
|
var dateNodeSpec = exports.dateNodeSpec = function dateNodeSpec(node) {
|
|
16
16
|
intlRef = intlRef || (0, _reactIntl.createIntl)({
|
|
17
17
|
locale: document.documentElement.lang || 'en-US'
|
|
18
18
|
});
|
|
19
19
|
var timestamp = node.attrs.timestamp;
|
|
20
|
-
var displayString = (0,
|
|
20
|
+
var displayString = (0, _date.timestampToString)(timestamp, intlRef);
|
|
21
21
|
var wrapperAttrs = {
|
|
22
22
|
class: 'date-lozenger-container',
|
|
23
23
|
'data-node-type': 'date',
|
|
@@ -25,7 +25,7 @@ var dateNodeSpec = exports.dateNodeSpec = function dateNodeSpec(node) {
|
|
|
25
25
|
'aria-busy': 'true'
|
|
26
26
|
};
|
|
27
27
|
var attrs = {
|
|
28
|
-
style: (0,
|
|
28
|
+
style: (0, _cssHelper.convertToInlineCss)({
|
|
29
29
|
// Taken from @atlaskit/date Component
|
|
30
30
|
backgroundColor: "var(--ds-background-neutral, #0515240F)",
|
|
31
31
|
color: "var(--ds-text, #292A2E)",
|
|
@@ -39,7 +39,7 @@ var dateNodeSpec = exports.dateNodeSpec = function dateNodeSpec(node) {
|
|
|
39
39
|
var dateToDOM = exports.dateToDOM = function dateToDOM(node, state, getPos, intl) {
|
|
40
40
|
var timestamp = node.attrs.timestamp;
|
|
41
41
|
var pos = getPos === null || getPos === void 0 ? void 0 : getPos();
|
|
42
|
-
var _getDateInformation = (0,
|
|
42
|
+
var _getDateInformation = (0, _utils.getDateInformation)(timestamp, intl, state, pos),
|
|
43
43
|
displayString = _getDateInformation.displayString,
|
|
44
44
|
color = _getDateInformation.color;
|
|
45
45
|
var nodeWrapperAttrs = {
|
|
@@ -4,13 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getDateInformation = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var _date = require("@atlaskit/editor-common/utils/date");
|
|
8
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
9
9
|
var getDateInformation = exports.getDateInformation = function getDateInformation(timestamp, intl, state, pos) {
|
|
10
10
|
if (!state) {
|
|
11
11
|
return {
|
|
12
12
|
color: undefined,
|
|
13
|
-
displayString: (0,
|
|
13
|
+
displayString: (0, _date.timestampToString)(timestamp, intl)
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
var doc = state.doc,
|
|
@@ -28,14 +28,14 @@ var getDateInformation = exports.getDateInformation = function getDateInformatio
|
|
|
28
28
|
// If there is blockTaskItem in the schema and it's not nested in an incomplete task item,
|
|
29
29
|
// check if it's nested in an incomplete block task item
|
|
30
30
|
if (blockTaskItem && !withinIncompleteTask) {
|
|
31
|
-
var blockTaskItemParent = (0,
|
|
31
|
+
var blockTaskItemParent = (0, _utils.findParentNodeOfTypeClosestToPos)($nodePos, blockTaskItem);
|
|
32
32
|
// If nested in a blockTaskItem that is incomplete
|
|
33
33
|
if (blockTaskItemParent) {
|
|
34
34
|
withinIncompleteTask = blockTaskItemParent.node.attrs.state !== 'DONE';
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
var color = withinIncompleteTask && (0,
|
|
38
|
-
var displayString = withinIncompleteTask ? (0,
|
|
37
|
+
var color = withinIncompleteTask && (0, _date.isPastDate)(timestamp) ? 'red' : undefined;
|
|
38
|
+
var displayString = withinIncompleteTask ? (0, _date.timestampToTaskContext)(timestamp, intl) : (0, _date.timestampToString)(timestamp, intl);
|
|
39
39
|
return {
|
|
40
40
|
displayString: displayString,
|
|
41
41
|
color: color
|
|
@@ -4,11 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.setDatePickerAt = exports.openDatePicker = exports.focusDateInput = exports.createDateAtTransaction = exports.createDate = exports.closeDatePickerWithAnalytics = exports.closeDatePicker = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
8
|
+
var _annotation = require("@atlaskit/editor-common/utils/annotation");
|
|
9
|
+
var _date = require("@atlaskit/editor-common/utils/date");
|
|
9
10
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
10
11
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
|
-
var
|
|
12
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
12
13
|
var _internal = require("../ui/DatePicker/utils/internal");
|
|
13
14
|
var _pluginKey = require("./plugin-key");
|
|
14
15
|
/**
|
|
@@ -20,12 +21,12 @@ var _pluginKey = require("./plugin-key");
|
|
|
20
21
|
var createDate = exports.createDate = function createDate(isQuickInsertAction) {
|
|
21
22
|
return function (state) {
|
|
22
23
|
var tr = state.tr;
|
|
23
|
-
var annotationMarksForPos = (0,
|
|
24
|
+
var annotationMarksForPos = (0, _annotation.getAnnotationMarksForPos)(tr.selection.$head);
|
|
24
25
|
var dateNode = state.schema.nodes.date.createChecked({
|
|
25
|
-
timestamp: (0,
|
|
26
|
+
timestamp: (0, _date.todayTimestampInUTC)()
|
|
26
27
|
}, null, annotationMarksForPos);
|
|
27
28
|
var fragment = _model.Fragment.fromArray([dateNode, state.schema.text(' ', annotationMarksForPos)]);
|
|
28
|
-
var insertable = (0,
|
|
29
|
+
var insertable = (0, _utils.canInsert)(tr.selection.$from, fragment);
|
|
29
30
|
if (!insertable) {
|
|
30
31
|
var parentSelection = _state.NodeSelection.create(tr.doc, tr.selection.from - tr.selection.$anchor.parentOffset - 1);
|
|
31
32
|
tr.insert(parentSelection.to, fragment).setSelection(_state.NodeSelection.create(tr.doc, parentSelection.to + 1));
|
|
@@ -46,12 +47,12 @@ var createDate = exports.createDate = function createDate(isQuickInsertAction) {
|
|
|
46
47
|
var createDateAtTransaction = exports.createDateAtTransaction = function createDateAtTransaction(isQuickInsertAction) {
|
|
47
48
|
return function (tr) {
|
|
48
49
|
var schema = tr.doc.type.schema;
|
|
49
|
-
var annotationMarksForPos = (0,
|
|
50
|
+
var annotationMarksForPos = (0, _annotation.getAnnotationMarksForPos)(tr.selection.$head);
|
|
50
51
|
var dateNode = schema.nodes.date.createChecked({
|
|
51
|
-
timestamp: (0,
|
|
52
|
+
timestamp: (0, _date.todayTimestampInUTC)()
|
|
52
53
|
}, null, annotationMarksForPos);
|
|
53
54
|
var fragment = _model.Fragment.fromArray([dateNode, schema.text(' ', annotationMarksForPos)]);
|
|
54
|
-
var insertable = (0,
|
|
55
|
+
var insertable = (0, _utils.canInsert)(tr.selection.$from, fragment);
|
|
55
56
|
if (!insertable) {
|
|
56
57
|
var parentSelection = _state.NodeSelection.create(tr.doc, tr.selection.from - tr.selection.$anchor.parentOffset - 1);
|
|
57
58
|
tr.insert(parentSelection.to, fragment).setSelection(_state.NodeSelection.create(tr.doc, parentSelection.to + 1));
|
|
@@ -117,11 +118,11 @@ var closeDatePickerWithAnalytics = exports.closeDatePickerWithAnalytics = functi
|
|
|
117
118
|
var date = _ref2.date,
|
|
118
119
|
pluginInjectionApi = _ref2.pluginInjectionApi;
|
|
119
120
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 || (_pluginInjectionApi$a = _pluginInjectionApi$a.actions) === null || _pluginInjectionApi$a === void 0 || _pluginInjectionApi$a.attachAnalyticsEvent({
|
|
120
|
-
eventType:
|
|
121
|
-
action:
|
|
122
|
-
actionSubject:
|
|
121
|
+
eventType: _enums.EVENT_TYPE.TRACK,
|
|
122
|
+
action: _enums.ACTION.COMMITTED,
|
|
123
|
+
actionSubject: _enums.ACTION_SUBJECT.DATE,
|
|
123
124
|
attributes: {
|
|
124
|
-
commitMethod:
|
|
125
|
+
commitMethod: _enums.INPUT_METHOD.BLUR,
|
|
125
126
|
isValid: date !== undefined,
|
|
126
127
|
isToday: (0, _internal.isToday)(date)
|
|
127
128
|
}
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.insertDateCommand = exports.deleteDateCommand = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
8
|
+
var _date = require("@atlaskit/editor-common/utils/date");
|
|
9
9
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
10
10
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
|
-
var
|
|
11
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
12
12
|
var _internal = require("../ui/DatePicker/utils/internal");
|
|
13
13
|
var _pluginKey = require("./plugin-key");
|
|
14
14
|
/** Delete the date and close the datepicker */
|
|
@@ -43,15 +43,15 @@ var insertDateCommand = exports.insertDateCommand = function insertDateCommand(p
|
|
|
43
43
|
if (date) {
|
|
44
44
|
timestamp = Date.UTC(date.year, date.month - 1, date.day).toString();
|
|
45
45
|
} else {
|
|
46
|
-
timestamp = (0,
|
|
46
|
+
timestamp = (0, _date.todayTimestampInUTC)();
|
|
47
47
|
}
|
|
48
48
|
if (inputMethod) {
|
|
49
49
|
var _pluginInjectionApi$a;
|
|
50
50
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 || (_pluginInjectionApi$a = _pluginInjectionApi$a.actions) === null || _pluginInjectionApi$a === void 0 || _pluginInjectionApi$a.attachAnalyticsEvent({
|
|
51
|
-
action:
|
|
52
|
-
actionSubject:
|
|
53
|
-
actionSubjectId:
|
|
54
|
-
eventType:
|
|
51
|
+
action: _enums.ACTION.INSERTED,
|
|
52
|
+
actionSubject: _enums.ACTION_SUBJECT.DOCUMENT,
|
|
53
|
+
actionSubjectId: _enums.ACTION_SUBJECT_ID.DATE,
|
|
54
|
+
eventType: _enums.EVENT_TYPE.TRACK,
|
|
55
55
|
attributes: {
|
|
56
56
|
inputMethod: inputMethod
|
|
57
57
|
}
|
|
@@ -60,9 +60,9 @@ var insertDateCommand = exports.insertDateCommand = function insertDateCommand(p
|
|
|
60
60
|
if (commitMethod) {
|
|
61
61
|
var _pluginInjectionApi$a2;
|
|
62
62
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 || (_pluginInjectionApi$a2 = _pluginInjectionApi$a2.actions) === null || _pluginInjectionApi$a2 === void 0 || _pluginInjectionApi$a2.attachAnalyticsEvent({
|
|
63
|
-
eventType:
|
|
64
|
-
action:
|
|
65
|
-
actionSubject:
|
|
63
|
+
eventType: _enums.EVENT_TYPE.TRACK,
|
|
64
|
+
action: _enums.ACTION.COMMITTED,
|
|
65
|
+
actionSubject: _enums.ACTION_SUBJECT.DATE,
|
|
66
66
|
attributes: {
|
|
67
67
|
commitMethod: commitMethod,
|
|
68
68
|
isValid: date !== undefined,
|
|
@@ -81,7 +81,7 @@ var insertDateCommand = exports.insertDateCommand = function insertDateCommand(p
|
|
|
81
81
|
var _tr$selection = tr.selection,
|
|
82
82
|
from = _tr$selection.from,
|
|
83
83
|
to = _tr$selection.to;
|
|
84
|
-
var insertable = (0,
|
|
84
|
+
var insertable = (0, _utils.canInsert)(tr.selection.$from, fragment);
|
|
85
85
|
if (!insertable) {
|
|
86
86
|
var parentSelection = _state.NodeSelection.create(tr.doc, tr.selection.from - tr.selection.$anchor.parentOffset - 1);
|
|
87
87
|
tr.insert(parentSelection.to, fragment).setSelection(_state.NodeSelection.create(tr.doc, parentSelection.to + 1));
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
exports.keymapPlugin = keymapPlugin;
|
|
8
|
+
var _keymap = require("@atlaskit/editor-common/keymap");
|
|
8
9
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
9
10
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
11
|
var _actions = require("./actions");
|
|
@@ -42,6 +43,6 @@ function keymapPlugin() {
|
|
|
42
43
|
}
|
|
43
44
|
return false;
|
|
44
45
|
}, list);
|
|
45
|
-
return (0,
|
|
46
|
+
return (0, _keymap.keymap)(list);
|
|
46
47
|
}
|
|
47
48
|
var _default = exports.default = keymapPlugin;
|
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getPluginState = exports.default = void 0;
|
|
7
7
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
|
-
var
|
|
8
|
+
var _pluginStateFactory = require("@atlaskit/editor-common/utils/plugin-state-factory");
|
|
9
9
|
var _DateNodeView = require("../nodeviews/DateNodeView");
|
|
10
10
|
var _pluginKey = require("./plugin-key");
|
|
11
|
-
var
|
|
12
|
-
var dest = (0,
|
|
13
|
-
mapping:
|
|
14
|
-
onSelectionChanged:
|
|
11
|
+
var _utils = require("./utils");
|
|
12
|
+
var dest = (0, _pluginStateFactory.pluginFactory)(_pluginKey.pluginKey, _utils.reducer, {
|
|
13
|
+
mapping: _utils.mapping,
|
|
14
|
+
onSelectionChanged: _utils.onSelectionChanged
|
|
15
15
|
});
|
|
16
16
|
var createPluginState = dest.createPluginState;
|
|
17
17
|
var getPluginState = exports.getPluginState = dest.getPluginState;
|
|
@@ -16,8 +16,8 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
16
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
17
|
var _react = _interopRequireDefault(require("react"));
|
|
18
18
|
var _reactIntl = require("react-intl");
|
|
19
|
-
var
|
|
20
|
-
var
|
|
19
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
20
|
+
var _date = require("@atlaskit/editor-common/messages/date");
|
|
21
21
|
var _errorMessage = require("@atlaskit/form/error-message");
|
|
22
22
|
var _textField = _interopRequireDefault(require("@atlaskit/textfield/text-field"));
|
|
23
23
|
var _formatParse = require("./utils/formatParse");
|
|
@@ -85,9 +85,9 @@ var DatePickerInput = /*#__PURE__*/function (_React$Component) {
|
|
|
85
85
|
_this.props.onNewDate(newDate);
|
|
86
86
|
if (dispatchAnalyticsEvent) {
|
|
87
87
|
dispatchAnalyticsEvent({
|
|
88
|
-
eventType:
|
|
89
|
-
action:
|
|
90
|
-
actionSubject:
|
|
88
|
+
eventType: _enums.EVENT_TYPE.TRACK,
|
|
89
|
+
action: _enums.ACTION.TYPING_FINISHED,
|
|
90
|
+
actionSubject: _enums.ACTION_SUBJECT.DATE
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
} else {
|
|
@@ -106,9 +106,9 @@ var DatePickerInput = /*#__PURE__*/function (_React$Component) {
|
|
|
106
106
|
// Fire event on every keypress (textfield not necessarily empty)
|
|
107
107
|
if (dispatchAnalyticsEvent && event.key !== 'Enter' && event.key !== 'Backspace') {
|
|
108
108
|
dispatchAnalyticsEvent({
|
|
109
|
-
eventType:
|
|
110
|
-
action:
|
|
111
|
-
actionSubject:
|
|
109
|
+
eventType: _enums.EVENT_TYPE.TRACK,
|
|
110
|
+
action: _enums.ACTION.TYPING_STARTED,
|
|
111
|
+
actionSubject: _enums.ACTION_SUBJECT.DATE
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
if (event.key !== 'Enter') {
|
|
@@ -150,19 +150,19 @@ var DatePickerInput = /*#__PURE__*/function (_React$Component) {
|
|
|
150
150
|
var dateSegment;
|
|
151
151
|
switch (activeSegment) {
|
|
152
152
|
case 'day':
|
|
153
|
-
dateSegment =
|
|
153
|
+
dateSegment = _enums.ACTION_SUBJECT_ID.DATE_DAY;
|
|
154
154
|
break;
|
|
155
155
|
case 'month':
|
|
156
|
-
dateSegment =
|
|
156
|
+
dateSegment = _enums.ACTION_SUBJECT_ID.DATE_MONTH;
|
|
157
157
|
break;
|
|
158
158
|
default:
|
|
159
|
-
dateSegment =
|
|
159
|
+
dateSegment = _enums.ACTION_SUBJECT_ID.DATE_YEAR;
|
|
160
160
|
}
|
|
161
161
|
if (dispatchAnalyticsEvent) {
|
|
162
162
|
dispatchAnalyticsEvent({
|
|
163
|
-
eventType:
|
|
164
|
-
action: adjustment > 0 ?
|
|
165
|
-
actionSubject:
|
|
163
|
+
eventType: _enums.EVENT_TYPE.TRACK,
|
|
164
|
+
action: adjustment > 0 ? _enums.ACTION.INCREMENTED : _enums.ACTION.DECREMENTED,
|
|
165
|
+
actionSubject: _enums.ACTION_SUBJECT.DATE_SEGMENT,
|
|
166
166
|
attributes: {
|
|
167
167
|
dateSegment: dateSegment
|
|
168
168
|
}
|
|
@@ -213,8 +213,8 @@ var DatePickerInput = /*#__PURE__*/function (_React$Component) {
|
|
|
213
213
|
spellCheck: false,
|
|
214
214
|
autoComplete: "off",
|
|
215
215
|
isInvalid: displayError,
|
|
216
|
-
"aria-label": formatMessage(
|
|
217
|
-
}), displayError && /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, null, formatMessage(
|
|
216
|
+
"aria-label": formatMessage(_date.messages.onKeyUpDownText)
|
|
217
|
+
}), displayError && /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, null, formatMessage(_date.messages.invalidDateError)));
|
|
218
218
|
}
|
|
219
219
|
}, {
|
|
220
220
|
key: "componentDidUpdate",
|
|
@@ -17,18 +17,20 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
17
17
|
var _react = _interopRequireDefault(require("react"));
|
|
18
18
|
var _reactIntl = require("react-intl");
|
|
19
19
|
var _calendar = _interopRequireDefault(require("@atlaskit/calendar/calendar"));
|
|
20
|
-
var
|
|
21
|
-
var
|
|
20
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
21
|
+
var _date = require("@atlaskit/editor-common/messages/date");
|
|
22
|
+
var _Popup = _interopRequireDefault(require("@atlaskit/editor-common/Popup"));
|
|
22
23
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
23
|
-
var
|
|
24
|
-
var
|
|
24
|
+
var _date2 = require("@atlaskit/editor-common/utils/date");
|
|
25
|
+
var _withOuterListeners = _interopRequireDefault(require("@atlaskit/editor-common/with-outer-listeners"));
|
|
26
|
+
var _constants = require("@atlaskit/editor-shared-styles/constants");
|
|
25
27
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
26
28
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden/visually-hidden"));
|
|
27
29
|
var _datePickerInput = _interopRequireDefault(require("./date-picker-input"));
|
|
28
30
|
var _internal = require("./utils/internal");
|
|
29
31
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
30
32
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
31
|
-
var PopupWithListeners = (0,
|
|
33
|
+
var PopupWithListeners = (0, _withOuterListeners.default)(_Popup.default);
|
|
32
34
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
33
35
|
var popupContentWrapper = null;
|
|
34
36
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
@@ -47,7 +49,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
47
49
|
});
|
|
48
50
|
});
|
|
49
51
|
(0, _defineProperty2.default)(_this, "handleKeyboardSubmitDate", function (date) {
|
|
50
|
-
_this.props.onSelect(date,
|
|
52
|
+
_this.props.onSelect(date, _enums.INPUT_METHOD.KEYBOARD);
|
|
51
53
|
});
|
|
52
54
|
(0, _defineProperty2.default)(_this, "handleEmptySubmitDate", function () {
|
|
53
55
|
_this.props.onDelete();
|
|
@@ -80,7 +82,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
80
82
|
if (timestamp) {
|
|
81
83
|
// Warning: The 'Date' return type of timestampToUTCDate() is not a JS date, it's more similar
|
|
82
84
|
// to the DateType type
|
|
83
|
-
var _timestampToUTCDate = (0,
|
|
85
|
+
var _timestampToUTCDate = (0, _date2.timestampToUTCDate)(timestamp),
|
|
84
86
|
day = _timestampToUTCDate.day,
|
|
85
87
|
month = _timestampToUTCDate.month,
|
|
86
88
|
year = _timestampToUTCDate.year;
|
|
@@ -90,7 +92,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
90
92
|
year: year
|
|
91
93
|
};
|
|
92
94
|
_this.state = {
|
|
93
|
-
selected: [(0,
|
|
95
|
+
selected: [(0, _date2.timestampToIsoFormat)(timestamp)],
|
|
94
96
|
date: date,
|
|
95
97
|
latestValidDate: date
|
|
96
98
|
};
|
|
@@ -145,7 +147,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
145
147
|
fitWidth: 340,
|
|
146
148
|
handleClickOutside: this.closeDatePickerWithAnalytics,
|
|
147
149
|
handleEscapeKeydown: this.closeDatePickerWithAnalytics,
|
|
148
|
-
zIndex:
|
|
150
|
+
zIndex: _constants.akEditorFloatingDialogZIndex,
|
|
149
151
|
mountTo: mountTo,
|
|
150
152
|
boundariesElement: boundariesElement,
|
|
151
153
|
scrollableElement: scrollableElement,
|
|
@@ -153,7 +155,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
153
155
|
}, /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, {
|
|
154
156
|
"aria-atomic": true,
|
|
155
157
|
role: "alert"
|
|
156
|
-
}, intl.formatMessage(
|
|
158
|
+
}, intl.formatMessage(_date.messages.datePickerOpenedAlert)), /*#__PURE__*/_react.default.createElement(_ui.PlainOutsideClickTargetRefContext.Consumer, null, function (setOutsideClickTargetRef) {
|
|
157
159
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
158
160
|
ref: setOutsideClickTargetRef,
|
|
159
161
|
className: (0, _runtime.ax)(["_2rkofajl _ca0qv77o _n3tdv77o _19bvv77o _u5f3v77o _16qs130s _bfhk1bhr"])
|
|
@@ -171,7 +173,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
171
173
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
172
174
|
,
|
|
173
175
|
onSelect: function onSelect(date) {
|
|
174
|
-
return _onSelect(date,
|
|
176
|
+
return _onSelect(date, _enums.INPUT_METHOD.PICKER);
|
|
175
177
|
},
|
|
176
178
|
day: day,
|
|
177
179
|
month: month,
|
|
@@ -8,10 +8,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.DateQuickInsertMenuItem = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactIntl = require("react-intl");
|
|
11
|
-
var
|
|
12
|
-
var
|
|
11
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
12
|
+
var _insertBlock = require("@atlaskit/editor-common/messages/insert-block");
|
|
13
13
|
var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
|
|
14
|
-
var
|
|
14
|
+
var _messages = require("@atlaskit/editor-common/quick-insert/messages");
|
|
15
15
|
var _calendar = _interopRequireDefault(require("@atlaskit/icon/core/calendar"));
|
|
16
16
|
var _actions = require("../../pm-plugins/actions");
|
|
17
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -24,7 +24,7 @@ var DateQuickInsertMenuItem = exports.DateQuickInsertMenuItem = function DateQui
|
|
|
24
24
|
return previewImageUrls ? {
|
|
25
25
|
image: previewImageUrls,
|
|
26
26
|
attribution: {
|
|
27
|
-
name: formatMessage(
|
|
27
|
+
name: formatMessage(_messages.messages.previewAttributionAtlassian)
|
|
28
28
|
}
|
|
29
29
|
} : undefined;
|
|
30
30
|
}, [formatMessage, previewImageUrls]);
|
|
@@ -34,24 +34,24 @@ var DateQuickInsertMenuItem = exports.DateQuickInsertMenuItem = function DateQui
|
|
|
34
34
|
source = _ref2.source;
|
|
35
35
|
var tr = (0, _actions.createDateAtTransaction)(true)(insert(undefined));
|
|
36
36
|
api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || (_api$analytics$attach = _api$analytics.attachAnalyticsEvent) === null || _api$analytics$attach === void 0 || _api$analytics$attach.call(_api$analytics, {
|
|
37
|
-
action:
|
|
38
|
-
actionSubject:
|
|
39
|
-
actionSubjectId:
|
|
37
|
+
action: _enums.ACTION.INSERTED,
|
|
38
|
+
actionSubject: _enums.ACTION_SUBJECT.DOCUMENT,
|
|
39
|
+
actionSubjectId: _enums.ACTION_SUBJECT_ID.DATE,
|
|
40
40
|
attributes: {
|
|
41
|
-
inputMethod: source !== null && source !== void 0 ? source :
|
|
41
|
+
inputMethod: source !== null && source !== void 0 ? source : _enums.INPUT_METHOD.QUICK_INSERT
|
|
42
42
|
},
|
|
43
|
-
eventType:
|
|
43
|
+
eventType: _enums.EVENT_TYPE.TRACK
|
|
44
44
|
})(tr);
|
|
45
45
|
return tr;
|
|
46
46
|
}, [api]);
|
|
47
47
|
return /*#__PURE__*/_react.default.createElement(_menuItem.QuickInsertMenuItem, {
|
|
48
|
-
description: formatMessage(
|
|
48
|
+
description: formatMessage(_insertBlock.toolbarInsertBlockMessages.dateDescription),
|
|
49
49
|
iconBefore: /*#__PURE__*/_react.default.createElement(_calendar.default, {
|
|
50
50
|
label: ""
|
|
51
51
|
}),
|
|
52
52
|
onSelect: onSelect,
|
|
53
53
|
preview: preview,
|
|
54
54
|
shortcut: "//",
|
|
55
|
-
title: formatMessage(
|
|
55
|
+
title: formatMessage(_insertBlock.toolbarInsertBlockMessages.date)
|
|
56
56
|
});
|
|
57
57
|
};
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.getDateQuickInsertComponents = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var
|
|
9
|
+
var _insertBlock = require("@atlaskit/editor-common/messages/insert-block");
|
|
10
10
|
var _createQuickInsertMatcher = require("@atlaskit/editor-common/quick-insert/create-quick-insert-matcher");
|
|
11
11
|
var _keys = require("@atlaskit/editor-common/quick-insert/keys");
|
|
12
12
|
var _rank = require("@atlaskit/editor-common/quick-insert/rank");
|
|
@@ -28,10 +28,10 @@ var getDateQuickInsertComponents = exports.getDateQuickInsertComponents = functi
|
|
|
28
28
|
match: (0, _createQuickInsertMatcher.createQuickInsertMatcher)(function (_ref2) {
|
|
29
29
|
var formatMessage = _ref2.formatMessage;
|
|
30
30
|
return {
|
|
31
|
-
description: formatMessage(
|
|
31
|
+
description: formatMessage(_insertBlock.toolbarInsertBlockMessages.dateDescription),
|
|
32
32
|
keywords: ['calendar', 'day', 'time', 'today', '/'],
|
|
33
33
|
shortcut: '//',
|
|
34
|
-
title: formatMessage(
|
|
34
|
+
title: formatMessage(_insertBlock.toolbarInsertBlockMessages.date)
|
|
35
35
|
};
|
|
36
36
|
}),
|
|
37
37
|
component: function component() {
|
|
@@ -3,13 +3,14 @@ import Loadable from 'react-loadable';
|
|
|
3
3
|
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
4
4
|
import { lazy, LazySuspense } from 'react-loosely-lazy';
|
|
5
5
|
import { date, dateWithLocalId } from '@atlaskit/adf-schema/date';
|
|
6
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
7
|
-
import {
|
|
6
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
7
|
+
import { IconDate } from '@atlaskit/editor-common/assets';
|
|
8
8
|
import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
9
|
-
import { annotationMessages
|
|
10
|
-
import {
|
|
11
|
-
import { DateSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
12
|
-
import {
|
|
9
|
+
import { annotationMessages } from '@atlaskit/editor-common/messages/annotation';
|
|
10
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
11
|
+
import { DateSharedCssClassName } from '@atlaskit/editor-common/styles/date';
|
|
12
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/useSharedPluginState';
|
|
13
|
+
import { calculateToolbarPositionAboveSelection } from '@atlaskit/editor-common/utils/calculate-toolbar-position';
|
|
13
14
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
14
15
|
import CommentIcon from '@atlaskit/icon/core/comment';
|
|
15
16
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createIntl } from 'react-intl';
|
|
2
2
|
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
3
|
-
import { convertToInlineCss } from '@atlaskit/editor-common/
|
|
4
|
-
import { timestampToString } from '@atlaskit/editor-common/utils';
|
|
5
|
-
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
|
|
3
|
+
import { convertToInlineCss } from '@atlaskit/editor-common/css-helper';
|
|
4
|
+
import { timestampToString } from '@atlaskit/editor-common/utils/date';
|
|
5
|
+
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace/whitespace';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
7
|
import { getDateInformation } from './utils';
|
|
8
8
|
let intlRef;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isPastDate, timestampToString, timestampToTaskContext } from '@atlaskit/editor-common/utils';
|
|
1
|
+
import { isPastDate, timestampToString, timestampToTaskContext } from '@atlaskit/editor-common/utils/date';
|
|
2
2
|
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
export const getDateInformation = (timestamp, intl, state, pos) => {
|
|
4
4
|
if (!state) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { getAnnotationMarksForPos
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
|
+
import { getAnnotationMarksForPos } from '@atlaskit/editor-common/utils/annotation';
|
|
3
|
+
import { todayTimestampInUTC } from '@atlaskit/editor-common/utils/date';
|
|
3
4
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
4
5
|
import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
6
|
import { canInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { todayTimestampInUTC } from '@atlaskit/editor-common/utils';
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
|
+
import { todayTimestampInUTC } from '@atlaskit/editor-common/utils/date';
|
|
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';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { keymap } from '@atlaskit/editor-common/keymap';
|
|
2
|
+
import { bindKeymapWithCommand, enter, tab } from '@atlaskit/editor-common/keymaps';
|
|
2
3
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
import { closeDatePicker, focusDateInput, openDatePicker } from './actions';
|
|
4
5
|
import { getPluginState } from './main';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { pluginFactory } from '@atlaskit/editor-common/utils/plugin-state-factory';
|
|
3
3
|
import { DateNodeView } from '../nodeviews/DateNodeView';
|
|
4
4
|
import { pluginKey } from './plugin-key';
|
|
5
5
|
import { mapping, onSelectionChanged, reducer } from './utils';
|
|
@@ -4,8 +4,8 @@ import "./date-picker-input.compiled.css";
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { injectIntl } from 'react-intl';
|
|
7
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
8
|
-
import {
|
|
7
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
8
|
+
import { messages } from '@atlaskit/editor-common/messages/date';
|
|
9
9
|
import { ErrorMessage } from '@atlaskit/form/error-message';
|
|
10
10
|
import TextField from '@atlaskit/textfield/text-field';
|
|
11
11
|
import { formatDateType, parseDateType } from './utils/formatParse';
|
|
@@ -5,11 +5,13 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { injectIntl } from 'react-intl';
|
|
7
7
|
import Calendar from '@atlaskit/calendar/calendar';
|
|
8
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
8
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
9
|
+
import { messages } from '@atlaskit/editor-common/messages/date';
|
|
10
|
+
import Popup from '@atlaskit/editor-common/Popup';
|
|
11
|
+
import { PlainOutsideClickTargetRefContext } from '@atlaskit/editor-common/ui';
|
|
12
|
+
import { timestampToIsoFormat, timestampToUTCDate } from '@atlaskit/editor-common/utils/date';
|
|
13
|
+
import withOuterListeners from '@atlaskit/editor-common/with-outer-listeners';
|
|
14
|
+
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles/constants';
|
|
13
15
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
16
|
import VisuallyHidden from '@atlaskit/visually-hidden/visually-hidden';
|
|
15
17
|
const PopupWithListeners = withOuterListeners(Popup);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
5
5
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
6
6
|
import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
|
|
7
7
|
import CalendarIcon from '@atlaskit/icon/core/calendar';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
2
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
3
3
|
import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
|
|
4
4
|
import { DATE_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
|
|
5
5
|
import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
|
package/dist/esm/datePlugin.js
CHANGED
|
@@ -6,13 +6,14 @@ import Loadable from 'react-loadable';
|
|
|
6
6
|
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
7
7
|
import { lazy, LazySuspense } from 'react-loosely-lazy';
|
|
8
8
|
import { date, dateWithLocalId } from '@atlaskit/adf-schema/date';
|
|
9
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
10
|
-
import {
|
|
9
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
10
|
+
import { IconDate } from '@atlaskit/editor-common/assets';
|
|
11
11
|
import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
12
|
-
import { annotationMessages
|
|
13
|
-
import {
|
|
14
|
-
import { DateSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
15
|
-
import {
|
|
12
|
+
import { annotationMessages } from '@atlaskit/editor-common/messages/annotation';
|
|
13
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
14
|
+
import { DateSharedCssClassName } from '@atlaskit/editor-common/styles/date';
|
|
15
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/useSharedPluginState';
|
|
16
|
+
import { calculateToolbarPositionAboveSelection } from '@atlaskit/editor-common/utils/calculate-toolbar-position';
|
|
16
17
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
17
18
|
import CommentIcon from '@atlaskit/icon/core/comment';
|
|
18
19
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createIntl } from 'react-intl';
|
|
2
2
|
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
3
|
-
import { convertToInlineCss } from '@atlaskit/editor-common/
|
|
4
|
-
import { timestampToString } from '@atlaskit/editor-common/utils';
|
|
5
|
-
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
|
|
3
|
+
import { convertToInlineCss } from '@atlaskit/editor-common/css-helper';
|
|
4
|
+
import { timestampToString } from '@atlaskit/editor-common/utils/date';
|
|
5
|
+
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace/whitespace';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
7
|
import { getDateInformation } from './utils';
|
|
8
8
|
var intlRef;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isPastDate, timestampToString, timestampToTaskContext } from '@atlaskit/editor-common/utils';
|
|
1
|
+
import { isPastDate, timestampToString, timestampToTaskContext } from '@atlaskit/editor-common/utils/date';
|
|
2
2
|
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
export var getDateInformation = function getDateInformation(timestamp, intl, state, pos) {
|
|
4
4
|
if (!state) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { getAnnotationMarksForPos
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
|
+
import { getAnnotationMarksForPos } from '@atlaskit/editor-common/utils/annotation';
|
|
3
|
+
import { todayTimestampInUTC } from '@atlaskit/editor-common/utils/date';
|
|
3
4
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
4
5
|
import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
6
|
import { canInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { todayTimestampInUTC } from '@atlaskit/editor-common/utils';
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
|
+
import { todayTimestampInUTC } from '@atlaskit/editor-common/utils/date';
|
|
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';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { keymap } from '@atlaskit/editor-common/keymap';
|
|
2
|
+
import { bindKeymapWithCommand, enter, tab } from '@atlaskit/editor-common/keymaps';
|
|
2
3
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
import { closeDatePicker, focusDateInput, openDatePicker } from './actions';
|
|
4
5
|
import { getPluginState } from './main';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { pluginFactory } from '@atlaskit/editor-common/utils/plugin-state-factory';
|
|
3
3
|
import { DateNodeView } from '../nodeviews/DateNodeView';
|
|
4
4
|
import { pluginKey } from './plugin-key';
|
|
5
5
|
import { mapping, onSelectionChanged, reducer } from './utils';
|
|
@@ -11,8 +11,8 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
|
|
|
11
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { injectIntl } from 'react-intl';
|
|
14
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
15
|
-
import {
|
|
14
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
15
|
+
import { messages } from '@atlaskit/editor-common/messages/date';
|
|
16
16
|
import { ErrorMessage } from '@atlaskit/form/error-message';
|
|
17
17
|
import TextField from '@atlaskit/textfield/text-field';
|
|
18
18
|
import { formatDateType, parseDateType } from './utils/formatParse';
|
|
@@ -12,11 +12,13 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { injectIntl } from 'react-intl';
|
|
14
14
|
import Calendar from '@atlaskit/calendar/calendar';
|
|
15
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
15
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
16
|
+
import { messages } from '@atlaskit/editor-common/messages/date';
|
|
17
|
+
import Popup from '@atlaskit/editor-common/Popup';
|
|
18
|
+
import { PlainOutsideClickTargetRefContext } from '@atlaskit/editor-common/ui';
|
|
19
|
+
import { timestampToIsoFormat, timestampToUTCDate } from '@atlaskit/editor-common/utils/date';
|
|
20
|
+
import withOuterListeners from '@atlaskit/editor-common/with-outer-listeners';
|
|
21
|
+
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles/constants';
|
|
20
22
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
21
23
|
import VisuallyHidden from '@atlaskit/visually-hidden/visually-hidden';
|
|
22
24
|
var PopupWithListeners = withOuterListeners(Popup);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
5
5
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
6
6
|
import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
|
|
7
7
|
import CalendarIcon from '@atlaskit/icon/core/calendar';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
2
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
3
3
|
import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
|
|
4
4
|
import { DATE_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
|
|
5
5
|
import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
-
import type { AnnotationPlugin } from '@atlaskit/editor-plugin-annotation';
|
|
4
|
-
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
5
|
-
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
1
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
2
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics/analyticsPlugin';
|
|
3
|
+
import type { AnnotationPlugin } from '@atlaskit/editor-plugin-annotation/annotationPluginType';
|
|
4
|
+
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled/editorDisabledPluginType';
|
|
5
|
+
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode/editorViewmodePluginType';
|
|
6
6
|
import type { UiControlRegistryPlugin } from '@atlaskit/editor-plugin-ui-control-registry/ui-control-registry-plugin-type';
|
|
7
7
|
import type { DatePluginOptions, DatePluginSharedState, DeleteDate, InsertDate } from './types';
|
|
8
8
|
export type DatePluginDependencies = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { getPosHandlerNode } from '@atlaskit/editor-common/types/editor-plugin';
|
|
3
3
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { Decoration, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { getPosHandlerNode } from '@atlaskit/editor-common/types/editor-plugin';
|
|
3
3
|
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
export declare const dateNodeSpec: (node: PMNode) => DOMOutputSpec;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Command, CommandDispatch
|
|
1
|
+
import type { Command, CommandDispatch } from '@atlaskit/editor-common/types/command';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
2
3
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
import type { DatePlugin, DateType } from '../types';
|
|
4
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
2
2
|
import type { DatePlugin, DeleteDate, InsertDate } from '../types';
|
|
3
3
|
type DeleteDateCommand = (pluginInjectionApi: ExtractInjectionAPI<DatePlugin> | undefined) => DeleteDate;
|
|
4
4
|
/** Delete the date and close the datepicker */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types/plugin-factory';
|
|
3
3
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { DatePluginState } from './types';
|
|
5
5
|
declare const getPluginState: (state: EditorState) => DatePluginState;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { WeekDay } from '@atlaskit/calendar/types';
|
|
2
|
-
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type { EditorCommand
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
2
|
+
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types/editor-command';
|
|
4
|
+
import type { TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types/insert-block';
|
|
5
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
6
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics/analyticsPlugin';
|
|
7
|
+
import type { AnnotationPlugin } from '@atlaskit/editor-plugin-annotation/annotationPluginType';
|
|
8
|
+
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled/editorDisabledPluginType';
|
|
9
|
+
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode/editorViewmodePluginType';
|
|
8
10
|
import type { UiControlRegistryPlugin } from '@atlaskit/editor-plugin-ui-control-registry/ui-control-registry-plugin-type';
|
|
9
11
|
export type DateSegment = 'day' | 'month' | 'year';
|
|
10
12
|
export type DateType = {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
7
|
-
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics/types/dispatch-analytics-event';
|
|
8
8
|
import type { DateType } from '../../types';
|
|
9
9
|
export interface InputProps {
|
|
10
10
|
/** Automatically focus the text field */
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
7
7
|
import type { WeekDay } from '@atlaskit/calendar/types';
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
8
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics/types/dispatch-analytics-event';
|
|
9
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
10
10
|
import type { DateType } from '../../types';
|
|
11
11
|
export interface Props {
|
|
12
12
|
/** Whether to automatically focus the input */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type QuickInsertMenuItemProps } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
3
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
4
4
|
import type { DatePlugin } from '../../datePluginType';
|
|
5
5
|
export declare const DateQuickInsertMenuItem: ({ api, previewImageUrls, }: {
|
|
6
6
|
api: ExtractInjectionAPI<DatePlugin> | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
2
2
|
import type { RegisterMenuItem } from '@atlaskit/editor-ui-control-model/types';
|
|
3
3
|
import type { DatePlugin } from '../../datePluginType';
|
|
4
4
|
export declare const getDateQuickInsertComponents: ({ api, }: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-date",
|
|
3
|
-
"version": "28.0.
|
|
3
|
+
"version": "28.0.5",
|
|
4
4
|
"description": "Date plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
40
40
|
"@atlaskit/textfield": "^10.2.0",
|
|
41
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
41
|
+
"@atlaskit/tmp-editor-statsig": "^232.0.0",
|
|
42
42
|
"@atlaskit/tokens": "^20.4.0",
|
|
43
43
|
"@atlaskit/visually-hidden": "^4.4.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|