@atlaskit/editor-plugin-status 2.6.0 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/{actions.js → pm-plugins/actions.js} +1 -1
- package/dist/cjs/pm-plugins/keymap.js +2 -2
- package/dist/cjs/pm-plugins/plugin.js +1 -1
- package/dist/cjs/{plugin.js → statusPlugin.js} +13 -7
- package/dist/cjs/types/index.js +5 -0
- package/dist/cjs/ui/ContentComponent.js +1 -1
- package/dist/cjs/ui/statusPicker.js +2 -2
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/{actions.js → pm-plugins/actions.js} +1 -1
- package/dist/es2019/pm-plugins/keymap.js +2 -2
- package/dist/es2019/pm-plugins/plugin.js +1 -1
- package/dist/es2019/{plugin.js → statusPlugin.js} +14 -9
- package/dist/es2019/ui/ContentComponent.js +1 -1
- package/dist/es2019/ui/statusPicker.js +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/{actions.js → pm-plugins/actions.js} +1 -1
- package/dist/esm/pm-plugins/keymap.js +2 -2
- package/dist/esm/pm-plugins/plugin.js +1 -1
- package/dist/esm/{plugin.js → statusPlugin.js} +14 -9
- package/dist/esm/statusPluginType.js +1 -0
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/ui/ContentComponent.js +1 -1
- package/dist/esm/ui/statusPicker.js +2 -2
- package/dist/types/index.d.ts +3 -3
- package/dist/types/{actions.d.ts → pm-plugins/actions.d.ts} +1 -1
- package/dist/types/{utils.d.ts → pm-plugins/utils.d.ts} +1 -1
- package/dist/types/statusPlugin.d.ts +2 -0
- package/dist/{types-ts4.5/plugin.d.ts → types/statusPluginType.d.ts} +1 -3
- package/dist/{types-ts4.5/types.d.ts → types/types/index.d.ts} +1 -1
- package/dist/types/ui/ContentComponent.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +3 -3
- package/dist/types-ts4.5/{actions.d.ts → pm-plugins/actions.d.ts} +1 -1
- package/dist/types-ts4.5/{utils.d.ts → pm-plugins/utils.d.ts} +1 -1
- package/dist/types-ts4.5/statusPlugin.d.ts +2 -0
- package/dist/{types/plugin.d.ts → types-ts4.5/statusPluginType.d.ts} +1 -3
- package/dist/{types/types.d.ts → types-ts4.5/types/index.d.ts} +1 -1
- package/dist/types-ts4.5/ui/ContentComponent.d.ts +1 -1
- package/package.json +5 -2
- /package/dist/cjs/{utils.js → pm-plugins/utils.js} +0 -0
- /package/dist/cjs/{types.js → statusPluginType.js} +0 -0
- /package/dist/cjs/{analytics.js → ui/analytics.js} +0 -0
- /package/dist/es2019/{utils.js → pm-plugins/utils.js} +0 -0
- /package/dist/es2019/{types.js → statusPluginType.js} +0 -0
- /package/dist/{esm/types.js → es2019/types/index.js} +0 -0
- /package/dist/es2019/{analytics.js → ui/analytics.js} +0 -0
- /package/dist/esm/{utils.js → pm-plugins/utils.js} +0 -0
- /package/dist/esm/{analytics.js → ui/analytics.js} +0 -0
- /package/dist/types/{analytics.d.ts → ui/analytics.d.ts} +0 -0
- /package/dist/types-ts4.5/{analytics.d.ts → ui/analytics.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-status
|
|
2
2
|
|
|
3
|
+
## 2.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#176427](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/176427)
|
|
8
|
+
[`9c2bd03adeebd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9c2bd03adeebd) -
|
|
9
|
+
[ED-25999] adding analytic events for inline node of emoji,status and inlineCard
|
|
10
|
+
|
|
11
|
+
## 2.6.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#171440](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/171440)
|
|
16
|
+
[`835f7bbff3122`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/835f7bbff3122) -
|
|
17
|
+
ED-25816: refactors plugins to meet folder standards
|
|
18
|
+
|
|
3
19
|
## 2.6.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "statusPlugin", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _statusPlugin.statusPlugin;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
var
|
|
12
|
+
var _statusPlugin = require("./statusPlugin");
|
|
@@ -14,7 +14,7 @@ var _model = require("@atlaskit/editor-prosemirror/model");
|
|
|
14
14
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
15
15
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
16
16
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
|
-
var _pluginKey = require("./
|
|
17
|
+
var _pluginKey = require("./plugin-key");
|
|
18
18
|
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; }
|
|
19
19
|
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; }
|
|
20
20
|
var DEFAULT_STATUS = exports.DEFAULT_STATUS = {
|
|
@@ -8,9 +8,9 @@ exports.keymapPlugin = keymapPlugin;
|
|
|
8
8
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
9
9
|
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
10
10
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
|
-
var _actions = require("
|
|
12
|
-
var _utils = require("../utils");
|
|
11
|
+
var _actions = require("./actions");
|
|
13
12
|
var _pluginKey = require("./plugin-key");
|
|
13
|
+
var _utils = require("./utils");
|
|
14
14
|
function keymapPlugin() {
|
|
15
15
|
var list = {};
|
|
16
16
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.enter.common, consumeKeyEvent, list);
|
|
@@ -23,8 +23,8 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
23
23
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
24
24
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
25
25
|
var _status = require("../nodeviews/status");
|
|
26
|
-
var _utils2 = require("../utils");
|
|
27
26
|
var _pluginKey = require("./plugin-key");
|
|
27
|
+
var _utils2 = require("./utils");
|
|
28
28
|
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; }
|
|
29
29
|
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; }
|
|
30
30
|
var createPlugin = function createPlugin(pmPluginFactoryParams, options) {
|
|
@@ -14,17 +14,11 @@ var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
|
14
14
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
15
15
|
var _comment = _interopRequireDefault(require("@atlaskit/icon/core/comment"));
|
|
16
16
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
|
-
var _actions = require("./actions");
|
|
17
|
+
var _actions = require("./pm-plugins/actions");
|
|
18
18
|
var _keymap = require("./pm-plugins/keymap");
|
|
19
19
|
var _plugin = _interopRequireDefault(require("./pm-plugins/plugin"));
|
|
20
20
|
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
21
21
|
var _ContentComponent = require("./ui/ContentComponent");
|
|
22
|
-
// This dummy type is to bypass the typescript compiler maximum length limit error
|
|
23
|
-
// TODO: Fix the type definition of editor-core's createUniversalPreset
|
|
24
|
-
|
|
25
|
-
// This dummy type is to bypass the typescript compiler maximum length limit error
|
|
26
|
-
// TODO: Fix the type definition of editor-core's createUniversalPreset
|
|
27
|
-
|
|
28
22
|
var statusPlugin = exports.statusPlugin = function statusPlugin(_ref) {
|
|
29
23
|
var _api$analytics, _api$analytics2;
|
|
30
24
|
var options = _ref.config,
|
|
@@ -108,10 +102,22 @@ var statusPlugin = exports.statusPlugin = function statusPlugin(_ref) {
|
|
|
108
102
|
});
|
|
109
103
|
var showAnnotation = annotationState && isViewMode && annotationState.isVisible && !annotationState.bookmark && !annotationState.mouseData.isSelecting && !hasActiveMark;
|
|
110
104
|
var onCommentClick = function onCommentClick(stateFromClickEvent, dispatch) {
|
|
105
|
+
var _api$analytics4;
|
|
111
106
|
if (!(api !== null && api !== void 0 && api.annotation)) {
|
|
112
107
|
return true;
|
|
113
108
|
}
|
|
114
109
|
var command = api.annotation.actions.setInlineCommentDraftState(true, _analytics.INPUT_METHOD.TOOLBAR);
|
|
110
|
+
api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 || (_api$analytics4 = _api$analytics4.actions) === null || _api$analytics4 === void 0 || _api$analytics4.fireAnalyticsEvent({
|
|
111
|
+
action: _analytics.ACTION.CLICKED,
|
|
112
|
+
actionSubject: _analytics.ACTION_SUBJECT.BUTTON,
|
|
113
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.CREATE_INLINE_COMMENT_FROM_HIGHLIGHT_ACTIONS_MENU,
|
|
114
|
+
eventType: _analytics.EVENT_TYPE.UI,
|
|
115
|
+
attributes: {
|
|
116
|
+
source: 'highlightActionsMenu',
|
|
117
|
+
pageMode: 'edit',
|
|
118
|
+
sourceNode: 'status'
|
|
119
|
+
}
|
|
120
|
+
});
|
|
115
121
|
return command(stateFromClickEvent, dispatch);
|
|
116
122
|
};
|
|
117
123
|
var createCommentMessage = intl.formatMessage(_messages.annotationMessages.createComment);
|
|
@@ -9,7 +9,7 @@ exports.ContentComponent = ContentComponent;
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
11
11
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
12
|
-
var _actions = require("../actions");
|
|
12
|
+
var _actions = require("../pm-plugins/actions");
|
|
13
13
|
var _statusPicker = _interopRequireDefault(require("./statusPicker"));
|
|
14
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
15
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -22,8 +22,8 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
22
22
|
var _picker = require("@atlaskit/status/picker");
|
|
23
23
|
var _colors = require("@atlaskit/theme/colors");
|
|
24
24
|
var _constants = require("@atlaskit/theme/constants");
|
|
25
|
-
var _actions = require("../actions");
|
|
26
|
-
var _analytics = require("
|
|
25
|
+
var _actions = require("../pm-plugins/actions");
|
|
26
|
+
var _analytics = require("./analytics");
|
|
27
27
|
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
28
28
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
|
29
29
|
* @jsxRuntime classic
|
package/dist/es2019/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { statusPlugin } from './
|
|
1
|
+
export { statusPlugin } from './statusPlugin';
|
|
@@ -6,7 +6,7 @@ import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
|
6
6
|
import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { canInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
-
import { pluginKey } from './
|
|
9
|
+
import { pluginKey } from './plugin-key';
|
|
10
10
|
export const DEFAULT_STATUS = {
|
|
11
11
|
text: '',
|
|
12
12
|
color: 'neutral'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { bindKeymapWithCommand, enter, tab } from '@atlaskit/editor-common/keymaps';
|
|
2
2
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
3
3
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { setFocusOnStatusInput } from '
|
|
5
|
-
import { mayGetStatusAtSelection } from '../utils';
|
|
4
|
+
import { setFocusOnStatusInput } from './actions';
|
|
6
5
|
import { pluginKey } from './plugin-key';
|
|
6
|
+
import { mayGetStatusAtSelection } from './utils';
|
|
7
7
|
export function keymapPlugin() {
|
|
8
8
|
const list = {};
|
|
9
9
|
bindKeymapWithCommand(enter.common, consumeKeyEvent, list);
|
|
@@ -3,8 +3,8 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
3
3
|
import { pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { StatusNodeView } from '../nodeviews/status';
|
|
6
|
-
import { isEmptyStatus, mayGetStatusAtSelection } from '../utils';
|
|
7
6
|
import { pluginKey } from './plugin-key';
|
|
7
|
+
import { isEmptyStatus, mayGetStatusAtSelection } from './utils';
|
|
8
8
|
export { pluginKey, pluginKeyName } from './plugin-key';
|
|
9
9
|
const createPlugin = (pmPluginFactoryParams, options) => new SafePlugin({
|
|
10
10
|
state: {
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { status } from '@atlaskit/adf-schema';
|
|
3
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { ACTION_SUBJECT_ID, ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { addInlineComment, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { annotationMessages, toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { IconStatus } from '@atlaskit/editor-common/quick-insert';
|
|
7
7
|
import { calculateToolbarPositionAboveSelection } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import CommentIcon from '@atlaskit/icon/core/comment';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
-
import { commitStatusPicker, insertStatus, removeStatus, updateStatusWithAnalytics } from './actions';
|
|
10
|
+
import { commitStatusPicker, insertStatus, removeStatus, updateStatusWithAnalytics } from './pm-plugins/actions';
|
|
11
11
|
import { keymapPlugin } from './pm-plugins/keymap';
|
|
12
12
|
import createStatusPlugin from './pm-plugins/plugin';
|
|
13
13
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
14
14
|
import { ContentComponent } from './ui/ContentComponent';
|
|
15
|
-
|
|
16
|
-
// This dummy type is to bypass the typescript compiler maximum length limit error
|
|
17
|
-
// TODO: Fix the type definition of editor-core's createUniversalPreset
|
|
18
|
-
|
|
19
|
-
// This dummy type is to bypass the typescript compiler maximum length limit error
|
|
20
|
-
// TODO: Fix the type definition of editor-core's createUniversalPreset
|
|
21
|
-
|
|
22
15
|
export const statusPlugin = ({
|
|
23
16
|
config: options,
|
|
24
17
|
api
|
|
@@ -98,10 +91,22 @@ export const statusPlugin = ({
|
|
|
98
91
|
const hasActiveMark = node.marks.some(mark => mark.type.name === 'annotation' && (annotationState === null || annotationState === void 0 ? void 0 : annotationState.annotations[mark.attrs.id]) === false);
|
|
99
92
|
const showAnnotation = annotationState && isViewMode && annotationState.isVisible && !annotationState.bookmark && !annotationState.mouseData.isSelecting && !hasActiveMark;
|
|
100
93
|
const onCommentClick = (stateFromClickEvent, dispatch) => {
|
|
94
|
+
var _api$analytics4, _api$analytics4$actio;
|
|
101
95
|
if (!(api !== null && api !== void 0 && api.annotation)) {
|
|
102
96
|
return true;
|
|
103
97
|
}
|
|
104
98
|
const command = api.annotation.actions.setInlineCommentDraftState(true, INPUT_METHOD.TOOLBAR);
|
|
99
|
+
api === null || api === void 0 ? void 0 : (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : (_api$analytics4$actio = _api$analytics4.actions) === null || _api$analytics4$actio === void 0 ? void 0 : _api$analytics4$actio.fireAnalyticsEvent({
|
|
100
|
+
action: ACTION.CLICKED,
|
|
101
|
+
actionSubject: ACTION_SUBJECT.BUTTON,
|
|
102
|
+
actionSubjectId: ACTION_SUBJECT_ID.CREATE_INLINE_COMMENT_FROM_HIGHLIGHT_ACTIONS_MENU,
|
|
103
|
+
eventType: EVENT_TYPE.UI,
|
|
104
|
+
attributes: {
|
|
105
|
+
source: 'highlightActionsMenu',
|
|
106
|
+
pageMode: 'edit',
|
|
107
|
+
sourceNode: 'status'
|
|
108
|
+
}
|
|
109
|
+
});
|
|
105
110
|
return command(stateFromClickEvent, dispatch);
|
|
106
111
|
};
|
|
107
112
|
const createCommentMessage = intl.formatMessage(annotationMessages.createComment);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
3
3
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
-
import { commitStatusPicker, updateStatus } from '../actions';
|
|
4
|
+
import { commitStatusPicker, updateStatus } from '../pm-plugins/actions';
|
|
5
5
|
import StatusPicker from './statusPicker';
|
|
6
6
|
export function ContentComponent({
|
|
7
7
|
api,
|
|
@@ -16,8 +16,8 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
16
16
|
import { StatusPicker as AkStatusPicker } from '@atlaskit/status/picker';
|
|
17
17
|
import { N0 } from '@atlaskit/theme/colors';
|
|
18
18
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
19
|
-
import { DEFAULT_STATUS } from '../actions';
|
|
20
|
-
import { analyticsState, createStatusAnalyticsAndFire } from '
|
|
19
|
+
import { DEFAULT_STATUS } from '../pm-plugins/actions';
|
|
20
|
+
import { analyticsState, createStatusAnalyticsAndFire } from './analytics';
|
|
21
21
|
const PopupWithListeners = withOuterListeners(Popup);
|
|
22
22
|
export let InputMethod = /*#__PURE__*/function (InputMethod) {
|
|
23
23
|
InputMethod["blur"] = "blur";
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { statusPlugin } from './
|
|
1
|
+
export { statusPlugin } from './statusPlugin';
|
|
@@ -9,7 +9,7 @@ import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
|
9
9
|
import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
10
10
|
import { canInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
11
11
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
|
-
import { pluginKey } from './
|
|
12
|
+
import { pluginKey } from './plugin-key';
|
|
13
13
|
export var DEFAULT_STATUS = {
|
|
14
14
|
text: '',
|
|
15
15
|
color: 'neutral'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { bindKeymapWithCommand, enter, tab } from '@atlaskit/editor-common/keymaps';
|
|
2
2
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
3
3
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { setFocusOnStatusInput } from '
|
|
5
|
-
import { mayGetStatusAtSelection } from '../utils';
|
|
4
|
+
import { setFocusOnStatusInput } from './actions';
|
|
6
5
|
import { pluginKey } from './plugin-key';
|
|
6
|
+
import { mayGetStatusAtSelection } from './utils';
|
|
7
7
|
export function keymapPlugin() {
|
|
8
8
|
var list = {};
|
|
9
9
|
bindKeymapWithCommand(enter.common, consumeKeyEvent, list);
|
|
@@ -6,8 +6,8 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
6
6
|
import { pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
8
8
|
import { StatusNodeView } from '../nodeviews/status';
|
|
9
|
-
import { isEmptyStatus, mayGetStatusAtSelection } from '../utils';
|
|
10
9
|
import { pluginKey } from './plugin-key';
|
|
10
|
+
import { isEmptyStatus, mayGetStatusAtSelection } from './utils';
|
|
11
11
|
export { pluginKey, pluginKeyName } from './plugin-key';
|
|
12
12
|
var createPlugin = function createPlugin(pmPluginFactoryParams, options) {
|
|
13
13
|
return new SafePlugin({
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { status } from '@atlaskit/adf-schema';
|
|
3
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { ACTION_SUBJECT_ID, ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { addInlineComment, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { annotationMessages, toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { IconStatus } from '@atlaskit/editor-common/quick-insert';
|
|
7
7
|
import { calculateToolbarPositionAboveSelection } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import CommentIcon from '@atlaskit/icon/core/comment';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
-
import { commitStatusPicker, insertStatus, removeStatus, updateStatusWithAnalytics } from './actions';
|
|
10
|
+
import { commitStatusPicker, insertStatus, removeStatus, updateStatusWithAnalytics } from './pm-plugins/actions';
|
|
11
11
|
import { keymapPlugin } from './pm-plugins/keymap';
|
|
12
12
|
import createStatusPlugin from './pm-plugins/plugin';
|
|
13
13
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
14
14
|
import { ContentComponent } from './ui/ContentComponent';
|
|
15
|
-
|
|
16
|
-
// This dummy type is to bypass the typescript compiler maximum length limit error
|
|
17
|
-
// TODO: Fix the type definition of editor-core's createUniversalPreset
|
|
18
|
-
|
|
19
|
-
// This dummy type is to bypass the typescript compiler maximum length limit error
|
|
20
|
-
// TODO: Fix the type definition of editor-core's createUniversalPreset
|
|
21
|
-
|
|
22
15
|
export var statusPlugin = function statusPlugin(_ref) {
|
|
23
16
|
var _api$analytics, _api$analytics2;
|
|
24
17
|
var options = _ref.config,
|
|
@@ -102,10 +95,22 @@ export var statusPlugin = function statusPlugin(_ref) {
|
|
|
102
95
|
});
|
|
103
96
|
var showAnnotation = annotationState && isViewMode && annotationState.isVisible && !annotationState.bookmark && !annotationState.mouseData.isSelecting && !hasActiveMark;
|
|
104
97
|
var onCommentClick = function onCommentClick(stateFromClickEvent, dispatch) {
|
|
98
|
+
var _api$analytics4;
|
|
105
99
|
if (!(api !== null && api !== void 0 && api.annotation)) {
|
|
106
100
|
return true;
|
|
107
101
|
}
|
|
108
102
|
var command = api.annotation.actions.setInlineCommentDraftState(true, INPUT_METHOD.TOOLBAR);
|
|
103
|
+
api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 || (_api$analytics4 = _api$analytics4.actions) === null || _api$analytics4 === void 0 || _api$analytics4.fireAnalyticsEvent({
|
|
104
|
+
action: ACTION.CLICKED,
|
|
105
|
+
actionSubject: ACTION_SUBJECT.BUTTON,
|
|
106
|
+
actionSubjectId: ACTION_SUBJECT_ID.CREATE_INLINE_COMMENT_FROM_HIGHLIGHT_ACTIONS_MENU,
|
|
107
|
+
eventType: EVENT_TYPE.UI,
|
|
108
|
+
attributes: {
|
|
109
|
+
source: 'highlightActionsMenu',
|
|
110
|
+
pageMode: 'edit',
|
|
111
|
+
sourceNode: 'status'
|
|
112
|
+
}
|
|
113
|
+
});
|
|
109
114
|
return command(stateFromClickEvent, dispatch);
|
|
110
115
|
};
|
|
111
116
|
var createCommentMessage = intl.formatMessage(annotationMessages.createComment);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
3
3
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
-
import { commitStatusPicker, updateStatus } from '../actions';
|
|
4
|
+
import { commitStatusPicker, updateStatus } from '../pm-plugins/actions';
|
|
5
5
|
import StatusPicker from './statusPicker';
|
|
6
6
|
export function ContentComponent(_ref) {
|
|
7
7
|
var api = _ref.api,
|
|
@@ -24,8 +24,8 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
24
24
|
import { StatusPicker as AkStatusPicker } from '@atlaskit/status/picker';
|
|
25
25
|
import { N0 } from '@atlaskit/theme/colors';
|
|
26
26
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
27
|
-
import { DEFAULT_STATUS } from '../actions';
|
|
28
|
-
import { analyticsState, createStatusAnalyticsAndFire } from '
|
|
27
|
+
import { DEFAULT_STATUS } from '../pm-plugins/actions';
|
|
28
|
+
import { analyticsState, createStatusAnalyticsAndFire } from './analytics';
|
|
29
29
|
var PopupWithListeners = withOuterListeners(Popup);
|
|
30
30
|
export var InputMethod = /*#__PURE__*/function (InputMethod) {
|
|
31
31
|
InputMethod["blur"] = "blur";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { statusPlugin } from './
|
|
2
|
-
export type { StatusPlugin } from './
|
|
1
|
+
export { statusPlugin } from './statusPlugin';
|
|
2
|
+
export type { StatusPlugin } from './statusPluginType';
|
|
3
3
|
export type { StatusState, StatusType, StatusPluginOptions, ClosingPayload } from './types';
|
|
4
|
-
export type { UpdateStatus } from './actions';
|
|
4
|
+
export type { UpdateStatus } from './pm-plugins/actions';
|
|
@@ -5,7 +5,7 @@ import { type Mark } from '@atlaskit/editor-prosemirror/model';
|
|
|
5
5
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import type { ClosingPayload, StatusType } from '
|
|
8
|
+
import type { ClosingPayload, StatusType } from '../types';
|
|
9
9
|
export declare const DEFAULT_STATUS: StatusType;
|
|
10
10
|
export declare const verifyAndInsertStatus: (statusNode: Node, tr: Transaction, annotationMarks?: Mark[] | undefined) => Transaction;
|
|
11
11
|
export declare const createStatus: (tr: Transaction) => Transaction;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { StatusType } from '
|
|
2
|
+
import type { StatusType } from '../types';
|
|
3
3
|
export declare const mayGetStatusAtSelection: (selection: Selection) => StatusType | null;
|
|
4
4
|
export declare const isEmptyStatus: (node: StatusType) => boolean;
|
|
5
5
|
export declare const setNodeSelectionNearPos: (tr: Transaction, pos: number) => Transaction;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { NextEditorPlugin, OptionalPlugin, Command } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
-
import type { UpdateStatus } from './actions';
|
|
5
|
-
import { commitStatusPicker, insertStatus, removeStatus } from './actions';
|
|
4
|
+
import type { commitStatusPicker, insertStatus, removeStatus, UpdateStatus } from './pm-plugins/actions';
|
|
6
5
|
import type { StatusPluginOptions, StatusState } from './types';
|
|
7
6
|
type DummyAnnotationPlugin = NextEditorPlugin<'annotation', {
|
|
8
7
|
actions: {
|
|
@@ -39,5 +38,4 @@ export type StatusPlugin = NextEditorPlugin<'status', {
|
|
|
39
38
|
};
|
|
40
39
|
sharedState: StatusState | undefined;
|
|
41
40
|
}>;
|
|
42
|
-
export declare const statusPlugin: StatusPlugin;
|
|
43
41
|
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { DomAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { StatusPlugin } from '../
|
|
5
|
+
import type { StatusPlugin } from '../statusPluginType';
|
|
6
6
|
interface ContentComponentProps {
|
|
7
7
|
api: ExtractInjectionAPI<StatusPlugin> | undefined;
|
|
8
8
|
popupsMountPoint?: HTMLElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { statusPlugin } from './
|
|
2
|
-
export type { StatusPlugin } from './
|
|
1
|
+
export { statusPlugin } from './statusPlugin';
|
|
2
|
+
export type { StatusPlugin } from './statusPluginType';
|
|
3
3
|
export type { StatusState, StatusType, StatusPluginOptions, ClosingPayload } from './types';
|
|
4
|
-
export type { UpdateStatus } from './actions';
|
|
4
|
+
export type { UpdateStatus } from './pm-plugins/actions';
|
|
@@ -5,7 +5,7 @@ import { type Mark } from '@atlaskit/editor-prosemirror/model';
|
|
|
5
5
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import type { ClosingPayload, StatusType } from '
|
|
8
|
+
import type { ClosingPayload, StatusType } from '../types';
|
|
9
9
|
export declare const DEFAULT_STATUS: StatusType;
|
|
10
10
|
export declare const verifyAndInsertStatus: (statusNode: Node, tr: Transaction, annotationMarks?: Mark[] | undefined) => Transaction;
|
|
11
11
|
export declare const createStatus: (tr: Transaction) => Transaction;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { StatusType } from '
|
|
2
|
+
import type { StatusType } from '../types';
|
|
3
3
|
export declare const mayGetStatusAtSelection: (selection: Selection) => StatusType | null;
|
|
4
4
|
export declare const isEmptyStatus: (node: StatusType) => boolean;
|
|
5
5
|
export declare const setNodeSelectionNearPos: (tr: Transaction, pos: number) => Transaction;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { NextEditorPlugin, OptionalPlugin, Command } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
-
import type { UpdateStatus } from './actions';
|
|
5
|
-
import { commitStatusPicker, insertStatus, removeStatus } from './actions';
|
|
4
|
+
import type { commitStatusPicker, insertStatus, removeStatus, UpdateStatus } from './pm-plugins/actions';
|
|
6
5
|
import type { StatusPluginOptions, StatusState } from './types';
|
|
7
6
|
type DummyAnnotationPlugin = NextEditorPlugin<'annotation', {
|
|
8
7
|
actions: {
|
|
@@ -39,5 +38,4 @@ export type StatusPlugin = NextEditorPlugin<'status', {
|
|
|
39
38
|
};
|
|
40
39
|
sharedState: StatusState | undefined;
|
|
41
40
|
}>;
|
|
42
|
-
export declare const statusPlugin: StatusPlugin;
|
|
43
41
|
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { DomAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { StatusPlugin } from '../
|
|
5
|
+
import type { StatusPlugin } from '../statusPluginType';
|
|
6
6
|
interface ContentComponentProps {
|
|
7
7
|
api: ExtractInjectionAPI<StatusPlugin> | undefined;
|
|
8
8
|
popupsMountPoint?: HTMLElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-status",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.2",
|
|
4
4
|
"description": "Status plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
35
|
-
"@atlaskit/analytics-next": "^10.
|
|
35
|
+
"@atlaskit/analytics-next": "^10.2.0",
|
|
36
36
|
"@atlaskit/editor-common": "^96.3.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
@@ -60,6 +60,9 @@
|
|
|
60
60
|
},
|
|
61
61
|
"techstack": {
|
|
62
62
|
"@atlassian/frontend": {
|
|
63
|
+
"code-structure": [
|
|
64
|
+
"editor-plugin"
|
|
65
|
+
],
|
|
63
66
|
"import-structure": [
|
|
64
67
|
"atlassian-conventions"
|
|
65
68
|
],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|