@atlaskit/editor-plugin-help-dialog 1.8.3 → 1.8.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 +17 -0
- package/dist/cjs/{plugin.js → helpDialogPlugin.js} +6 -56
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/pm-plugins/keymap.js +32 -0
- package/dist/cjs/pm-plugins/main.js +37 -0
- package/dist/cjs/ui/index.js +1 -1
- package/dist/es2019/{plugin.js → helpDialogPlugin.js} +6 -55
- package/dist/es2019/index.js +2 -2
- package/dist/es2019/pm-plugins/keymap.js +28 -0
- package/dist/es2019/pm-plugins/main.js +28 -0
- package/dist/es2019/ui/index.js +1 -1
- package/dist/esm/{plugin.js → helpDialogPlugin.js} +5 -54
- package/dist/esm/index.js +2 -2
- package/dist/esm/pm-plugins/keymap.js +26 -0
- package/dist/esm/pm-plugins/main.js +30 -0
- package/dist/esm/ui/index.js +1 -1
- package/dist/types/helpDialogPlugin.d.ts +2 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/pm-plugins/keymap.d.ts +3 -0
- package/dist/types/{plugin.d.ts → pm-plugins/main.d.ts} +0 -2
- package/dist/types/ui/index.d.ts +1 -1
- package/dist/types-ts4.5/helpDialogPlugin.d.ts +2 -0
- package/dist/types-ts4.5/index.d.ts +3 -3
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +3 -0
- package/dist/types-ts4.5/{plugin.d.ts → pm-plugins/main.d.ts} +0 -2
- package/dist/types-ts4.5/ui/index.d.ts +1 -1
- package/package.json +8 -5
- /package/dist/cjs/{types.js → helpDialogPluginType.js} +0 -0
- /package/dist/cjs/{commands.js → pm-plugins/commands.js} +0 -0
- /package/dist/cjs/{plugin-key.js → pm-plugins/plugin-key.js} +0 -0
- /package/dist/es2019/{types.js → helpDialogPluginType.js} +0 -0
- /package/dist/es2019/{commands.js → pm-plugins/commands.js} +0 -0
- /package/dist/es2019/{plugin-key.js → pm-plugins/plugin-key.js} +0 -0
- /package/dist/esm/{types.js → helpDialogPluginType.js} +0 -0
- /package/dist/esm/{commands.js → pm-plugins/commands.js} +0 -0
- /package/dist/esm/{plugin-key.js → pm-plugins/plugin-key.js} +0 -0
- /package/dist/types/{types.d.ts → helpDialogPluginType.d.ts} +0 -0
- /package/dist/types/{commands.d.ts → pm-plugins/commands.d.ts} +0 -0
- /package/dist/types/{plugin-key.d.ts → pm-plugins/plugin-key.d.ts} +0 -0
- /package/dist/types-ts4.5/{types.d.ts → helpDialogPluginType.d.ts} +0 -0
- /package/dist/types-ts4.5/{commands.d.ts → pm-plugins/commands.d.ts} +0 -0
- /package/dist/types-ts4.5/{plugin-key.d.ts → pm-plugins/plugin-key.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-help-dialog
|
|
2
2
|
|
|
3
|
+
## 1.8.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#141343](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/141343)
|
|
8
|
+
[`3893ae8e037fb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3893ae8e037fb) -
|
|
9
|
+
Rearranging plugins to meet folder structure linting guidelines.
|
|
10
|
+
|
|
11
|
+
## 1.8.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#139334](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/139334)
|
|
16
|
+
[`30793649657c0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/30793649657c0) -
|
|
17
|
+
[HOT-111629] We had an incident where the last character disappears when hitting the enter key on
|
|
18
|
+
windows OS for Korean characters. Bumping to prosemirror-view@1.34.2 for the fix.
|
|
19
|
+
|
|
3
20
|
## 1.8.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -4,46 +4,17 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.createPlugin = createPlugin;
|
|
8
7
|
exports.helpDialogPlugin = void 0;
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
10
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
13
11
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
|
-
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
15
|
-
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
16
12
|
var _questionCircle = _interopRequireDefault(require("@atlaskit/icon/core/migration/question-circle"));
|
|
17
|
-
var _commands = require("./commands");
|
|
18
|
-
var
|
|
13
|
+
var _commands = require("./pm-plugins/commands");
|
|
14
|
+
var _keymap = require("./pm-plugins/keymap");
|
|
15
|
+
var _main = require("./pm-plugins/main");
|
|
16
|
+
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
19
17
|
var _HelpDialogLoader = require("./ui/HelpDialogLoader");
|
|
20
|
-
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; }
|
|
21
|
-
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; }
|
|
22
|
-
function createPlugin(dispatch, imageEnabled) {
|
|
23
|
-
return new _safePlugin.SafePlugin({
|
|
24
|
-
key: _pluginKey.pluginKey,
|
|
25
|
-
state: {
|
|
26
|
-
init: function init() {
|
|
27
|
-
return {
|
|
28
|
-
isVisible: false,
|
|
29
|
-
imageEnabled: imageEnabled
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
apply: function apply(tr, _value, state) {
|
|
33
|
-
var isVisible = tr.getMeta(_pluginKey.pluginKey);
|
|
34
|
-
var currentState = _pluginKey.pluginKey.getState(state);
|
|
35
|
-
if (isVisible !== undefined && isVisible !== currentState.isVisible) {
|
|
36
|
-
var newState = _objectSpread(_objectSpread({}, currentState), {}, {
|
|
37
|
-
isVisible: isVisible
|
|
38
|
-
});
|
|
39
|
-
dispatch(_pluginKey.pluginKey, newState);
|
|
40
|
-
return newState;
|
|
41
|
-
}
|
|
42
|
-
return currentState;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
18
|
var helpDialogPlugin = exports.helpDialogPlugin = function helpDialogPlugin(_ref) {
|
|
48
19
|
var _ref$config = _ref.config,
|
|
49
20
|
imageUploadProviderExists = _ref$config === void 0 ? false : _ref$config,
|
|
@@ -55,13 +26,13 @@ var helpDialogPlugin = exports.helpDialogPlugin = function helpDialogPlugin(_ref
|
|
|
55
26
|
name: 'helpDialog',
|
|
56
27
|
plugin: function plugin(_ref2) {
|
|
57
28
|
var dispatch = _ref2.dispatch;
|
|
58
|
-
return createPlugin(dispatch, imageUploadProviderExists);
|
|
29
|
+
return (0, _main.createPlugin)(dispatch, imageUploadProviderExists);
|
|
59
30
|
}
|
|
60
31
|
}, {
|
|
61
32
|
name: 'helpDialogKeymap',
|
|
62
33
|
plugin: function plugin() {
|
|
63
34
|
var _api$analytics;
|
|
64
|
-
return keymapPlugin(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
35
|
+
return (0, _keymap.keymapPlugin)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
65
36
|
}
|
|
66
37
|
}];
|
|
67
38
|
},
|
|
@@ -114,25 +85,4 @@ var helpDialogPlugin = exports.helpDialogPlugin = function helpDialogPlugin(_ref
|
|
|
114
85
|
return _pluginKey.pluginKey.getState(editorState) || null;
|
|
115
86
|
}
|
|
116
87
|
};
|
|
117
|
-
};
|
|
118
|
-
var keymapPlugin = function keymapPlugin(editorAnalyticsAPI) {
|
|
119
|
-
var list = {};
|
|
120
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.openHelp.common, function (state, dispatch) {
|
|
121
|
-
var tr = state.tr;
|
|
122
|
-
var isVisible = tr.getMeta(_pluginKey.pluginKey);
|
|
123
|
-
if (!isVisible) {
|
|
124
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
125
|
-
action: _analytics.ACTION.CLICKED,
|
|
126
|
-
actionSubject: _analytics.ACTION_SUBJECT.BUTTON,
|
|
127
|
-
actionSubjectId: _analytics.ACTION_SUBJECT_ID.BUTTON_HELP,
|
|
128
|
-
attributes: {
|
|
129
|
-
inputMethod: _analytics.INPUT_METHOD.SHORTCUT
|
|
130
|
-
},
|
|
131
|
-
eventType: _analytics.EVENT_TYPE.UI
|
|
132
|
-
})(tr);
|
|
133
|
-
(0, _commands.openHelpCommand)(tr, dispatch);
|
|
134
|
-
}
|
|
135
|
-
return true;
|
|
136
|
-
}, list);
|
|
137
|
-
return (0, _keymap.keymap)(list);
|
|
138
88
|
};
|
package/dist/cjs/index.js
CHANGED
|
@@ -12,8 +12,8 @@ Object.defineProperty(exports, "deprecatedOpenHelpCommand", {
|
|
|
12
12
|
Object.defineProperty(exports, "helpDialogPlugin", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return
|
|
15
|
+
return _helpDialogPlugin.helpDialogPlugin;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
var
|
|
19
|
-
var _commands = require("./commands");
|
|
18
|
+
var _helpDialogPlugin = require("./helpDialogPlugin");
|
|
19
|
+
var _commands = require("./pm-plugins/commands");
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.keymapPlugin = void 0;
|
|
7
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
|
+
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
9
|
+
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
10
|
+
var _commands = require("./commands");
|
|
11
|
+
var _pluginKey = require("./plugin-key");
|
|
12
|
+
var keymapPlugin = exports.keymapPlugin = function keymapPlugin(editorAnalyticsAPI) {
|
|
13
|
+
var list = {};
|
|
14
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.openHelp.common, function (state, dispatch) {
|
|
15
|
+
var tr = state.tr;
|
|
16
|
+
var isVisible = tr.getMeta(_pluginKey.pluginKey);
|
|
17
|
+
if (!isVisible) {
|
|
18
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
19
|
+
action: _analytics.ACTION.CLICKED,
|
|
20
|
+
actionSubject: _analytics.ACTION_SUBJECT.BUTTON,
|
|
21
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.BUTTON_HELP,
|
|
22
|
+
attributes: {
|
|
23
|
+
inputMethod: _analytics.INPUT_METHOD.SHORTCUT
|
|
24
|
+
},
|
|
25
|
+
eventType: _analytics.EVENT_TYPE.UI
|
|
26
|
+
})(tr);
|
|
27
|
+
(0, _commands.openHelpCommand)(tr, dispatch);
|
|
28
|
+
}
|
|
29
|
+
return true;
|
|
30
|
+
}, list);
|
|
31
|
+
return (0, _keymap.keymap)(list);
|
|
32
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createPlugin = createPlugin;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
10
|
+
var _pluginKey = require("./plugin-key");
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
function createPlugin(dispatch, imageEnabled) {
|
|
14
|
+
return new _safePlugin.SafePlugin({
|
|
15
|
+
key: _pluginKey.pluginKey,
|
|
16
|
+
state: {
|
|
17
|
+
init: function init() {
|
|
18
|
+
return {
|
|
19
|
+
isVisible: false,
|
|
20
|
+
imageEnabled: imageEnabled
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
apply: function apply(tr, _value, state) {
|
|
24
|
+
var isVisible = tr.getMeta(_pluginKey.pluginKey);
|
|
25
|
+
var currentState = _pluginKey.pluginKey.getState(state);
|
|
26
|
+
if (isVisible !== undefined && isVisible !== currentState.isVisible) {
|
|
27
|
+
var newState = _objectSpread(_objectSpread({}, currentState), {}, {
|
|
28
|
+
isVisible: isVisible
|
|
29
|
+
});
|
|
30
|
+
dispatch(_pluginKey.pluginKey, newState);
|
|
31
|
+
return newState;
|
|
32
|
+
}
|
|
33
|
+
return currentState;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
package/dist/cjs/ui/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var _react2 = require("@emotion/react");
|
|
|
11
11
|
var _reactIntlNext = require("react-intl-next");
|
|
12
12
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
13
13
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
14
|
-
var _commands = require("../commands");
|
|
14
|
+
var _commands = require("../pm-plugins/commands");
|
|
15
15
|
var _formatting = require("./formatting");
|
|
16
16
|
var _Modal = _interopRequireDefault(require("./Modal"));
|
|
17
17
|
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); }
|
|
@@ -1,39 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import {
|
|
3
|
+
import { openHelp, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
4
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
|
-
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
7
5
|
import QuestionCircleIcon from '@atlaskit/icon/core/migration/question-circle';
|
|
8
|
-
import { openHelpCommand } from './commands';
|
|
9
|
-
import {
|
|
6
|
+
import { openHelpCommand } from './pm-plugins/commands';
|
|
7
|
+
import { keymapPlugin } from './pm-plugins/keymap';
|
|
8
|
+
import { createPlugin } from './pm-plugins/main';
|
|
9
|
+
import { pluginKey } from './pm-plugins/plugin-key';
|
|
10
10
|
import { HelpDialogLoader } from './ui/HelpDialogLoader';
|
|
11
|
-
export function createPlugin(dispatch, imageEnabled) {
|
|
12
|
-
return new SafePlugin({
|
|
13
|
-
key: pluginKey,
|
|
14
|
-
state: {
|
|
15
|
-
init() {
|
|
16
|
-
return {
|
|
17
|
-
isVisible: false,
|
|
18
|
-
imageEnabled
|
|
19
|
-
};
|
|
20
|
-
},
|
|
21
|
-
apply(tr, _value, state) {
|
|
22
|
-
const isVisible = tr.getMeta(pluginKey);
|
|
23
|
-
const currentState = pluginKey.getState(state);
|
|
24
|
-
if (isVisible !== undefined && isVisible !== currentState.isVisible) {
|
|
25
|
-
const newState = {
|
|
26
|
-
...currentState,
|
|
27
|
-
isVisible
|
|
28
|
-
};
|
|
29
|
-
dispatch(pluginKey, newState);
|
|
30
|
-
return newState;
|
|
31
|
-
}
|
|
32
|
-
return currentState;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
11
|
export const helpDialogPlugin = ({
|
|
38
12
|
config: imageUploadProviderExists = false,
|
|
39
13
|
api
|
|
@@ -99,27 +73,4 @@ export const helpDialogPlugin = ({
|
|
|
99
73
|
}
|
|
100
74
|
return pluginKey.getState(editorState) || null;
|
|
101
75
|
}
|
|
102
|
-
});
|
|
103
|
-
const keymapPlugin = editorAnalyticsAPI => {
|
|
104
|
-
const list = {};
|
|
105
|
-
bindKeymapWithCommand(openHelp.common, (state, dispatch) => {
|
|
106
|
-
let {
|
|
107
|
-
tr
|
|
108
|
-
} = state;
|
|
109
|
-
const isVisible = tr.getMeta(pluginKey);
|
|
110
|
-
if (!isVisible) {
|
|
111
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
|
|
112
|
-
action: ACTION.CLICKED,
|
|
113
|
-
actionSubject: ACTION_SUBJECT.BUTTON,
|
|
114
|
-
actionSubjectId: ACTION_SUBJECT_ID.BUTTON_HELP,
|
|
115
|
-
attributes: {
|
|
116
|
-
inputMethod: INPUT_METHOD.SHORTCUT
|
|
117
|
-
},
|
|
118
|
-
eventType: EVENT_TYPE.UI
|
|
119
|
-
})(tr);
|
|
120
|
-
openHelpCommand(tr, dispatch);
|
|
121
|
-
}
|
|
122
|
-
return true;
|
|
123
|
-
}, list);
|
|
124
|
-
return keymap(list);
|
|
125
|
-
};
|
|
76
|
+
});
|
package/dist/es2019/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { helpDialogPlugin } from './
|
|
1
|
+
export { helpDialogPlugin } from './helpDialogPlugin';
|
|
2
2
|
// DO NOT COPY DISABLING THIS RULE. We are disabling it for a special existing case.
|
|
3
3
|
// This will be shortly removed. Reach out to #cc-editor-lego if you have issues.
|
|
4
4
|
// eslint-disable-next-line @atlaskit/editor/only-export-plugin
|
|
@@ -6,4 +6,4 @@ export {
|
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated DO NOT USE, it is only available to maintain an existing deprecated API
|
|
8
8
|
*/
|
|
9
|
-
openHelpCommand as deprecatedOpenHelpCommand } from './commands';
|
|
9
|
+
openHelpCommand as deprecatedOpenHelpCommand } from './pm-plugins/commands';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { bindKeymapWithCommand, openHelp } from '@atlaskit/editor-common/keymaps';
|
|
3
|
+
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
|
+
import { openHelpCommand } from './commands';
|
|
5
|
+
import { pluginKey } from './plugin-key';
|
|
6
|
+
export const keymapPlugin = editorAnalyticsAPI => {
|
|
7
|
+
const list = {};
|
|
8
|
+
bindKeymapWithCommand(openHelp.common, (state, dispatch) => {
|
|
9
|
+
let {
|
|
10
|
+
tr
|
|
11
|
+
} = state;
|
|
12
|
+
const isVisible = tr.getMeta(pluginKey);
|
|
13
|
+
if (!isVisible) {
|
|
14
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
|
|
15
|
+
action: ACTION.CLICKED,
|
|
16
|
+
actionSubject: ACTION_SUBJECT.BUTTON,
|
|
17
|
+
actionSubjectId: ACTION_SUBJECT_ID.BUTTON_HELP,
|
|
18
|
+
attributes: {
|
|
19
|
+
inputMethod: INPUT_METHOD.SHORTCUT
|
|
20
|
+
},
|
|
21
|
+
eventType: EVENT_TYPE.UI
|
|
22
|
+
})(tr);
|
|
23
|
+
openHelpCommand(tr, dispatch);
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
}, list);
|
|
27
|
+
return keymap(list);
|
|
28
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import { pluginKey } from './plugin-key';
|
|
3
|
+
export function createPlugin(dispatch, imageEnabled) {
|
|
4
|
+
return new SafePlugin({
|
|
5
|
+
key: pluginKey,
|
|
6
|
+
state: {
|
|
7
|
+
init() {
|
|
8
|
+
return {
|
|
9
|
+
isVisible: false,
|
|
10
|
+
imageEnabled
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
apply(tr, _value, state) {
|
|
14
|
+
const isVisible = tr.getMeta(pluginKey);
|
|
15
|
+
const currentState = pluginKey.getState(state);
|
|
16
|
+
if (isVisible !== undefined && isVisible !== currentState.isVisible) {
|
|
17
|
+
const newState = {
|
|
18
|
+
...currentState,
|
|
19
|
+
isVisible
|
|
20
|
+
};
|
|
21
|
+
dispatch(pluginKey, newState);
|
|
22
|
+
return newState;
|
|
23
|
+
}
|
|
24
|
+
return currentState;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
package/dist/es2019/ui/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { jsx } from '@emotion/react';
|
|
|
9
9
|
import { injectIntl } from 'react-intl-next';
|
|
10
10
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
11
11
|
import AkModalDialog, { ModalTransition } from '@atlaskit/modal-dialog';
|
|
12
|
-
import { closeHelpCommand } from '../commands';
|
|
12
|
+
import { closeHelpCommand } from '../pm-plugins/commands';
|
|
13
13
|
import { getSupportedFormatting } from './formatting';
|
|
14
14
|
import Modal from './Modal';
|
|
15
15
|
const HelpDialog = ({
|
|
@@ -1,41 +1,13 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
1
|
import React from 'react';
|
|
5
2
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
|
-
import {
|
|
3
|
+
import { openHelp, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
7
4
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
8
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
9
|
-
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
10
5
|
import QuestionCircleIcon from '@atlaskit/icon/core/migration/question-circle';
|
|
11
|
-
import { openHelpCommand } from './commands';
|
|
12
|
-
import {
|
|
6
|
+
import { openHelpCommand } from './pm-plugins/commands';
|
|
7
|
+
import { keymapPlugin } from './pm-plugins/keymap';
|
|
8
|
+
import { createPlugin } from './pm-plugins/main';
|
|
9
|
+
import { pluginKey } from './pm-plugins/plugin-key';
|
|
13
10
|
import { HelpDialogLoader } from './ui/HelpDialogLoader';
|
|
14
|
-
export function createPlugin(dispatch, imageEnabled) {
|
|
15
|
-
return new SafePlugin({
|
|
16
|
-
key: pluginKey,
|
|
17
|
-
state: {
|
|
18
|
-
init: function init() {
|
|
19
|
-
return {
|
|
20
|
-
isVisible: false,
|
|
21
|
-
imageEnabled: imageEnabled
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
apply: function apply(tr, _value, state) {
|
|
25
|
-
var isVisible = tr.getMeta(pluginKey);
|
|
26
|
-
var currentState = pluginKey.getState(state);
|
|
27
|
-
if (isVisible !== undefined && isVisible !== currentState.isVisible) {
|
|
28
|
-
var newState = _objectSpread(_objectSpread({}, currentState), {}, {
|
|
29
|
-
isVisible: isVisible
|
|
30
|
-
});
|
|
31
|
-
dispatch(pluginKey, newState);
|
|
32
|
-
return newState;
|
|
33
|
-
}
|
|
34
|
-
return currentState;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
11
|
export var helpDialogPlugin = function helpDialogPlugin(_ref) {
|
|
40
12
|
var _ref$config = _ref.config,
|
|
41
13
|
imageUploadProviderExists = _ref$config === void 0 ? false : _ref$config,
|
|
@@ -106,25 +78,4 @@ export var helpDialogPlugin = function helpDialogPlugin(_ref) {
|
|
|
106
78
|
return pluginKey.getState(editorState) || null;
|
|
107
79
|
}
|
|
108
80
|
};
|
|
109
|
-
};
|
|
110
|
-
var keymapPlugin = function keymapPlugin(editorAnalyticsAPI) {
|
|
111
|
-
var list = {};
|
|
112
|
-
bindKeymapWithCommand(openHelp.common, function (state, dispatch) {
|
|
113
|
-
var tr = state.tr;
|
|
114
|
-
var isVisible = tr.getMeta(pluginKey);
|
|
115
|
-
if (!isVisible) {
|
|
116
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
117
|
-
action: ACTION.CLICKED,
|
|
118
|
-
actionSubject: ACTION_SUBJECT.BUTTON,
|
|
119
|
-
actionSubjectId: ACTION_SUBJECT_ID.BUTTON_HELP,
|
|
120
|
-
attributes: {
|
|
121
|
-
inputMethod: INPUT_METHOD.SHORTCUT
|
|
122
|
-
},
|
|
123
|
-
eventType: EVENT_TYPE.UI
|
|
124
|
-
})(tr);
|
|
125
|
-
openHelpCommand(tr, dispatch);
|
|
126
|
-
}
|
|
127
|
-
return true;
|
|
128
|
-
}, list);
|
|
129
|
-
return keymap(list);
|
|
130
81
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { helpDialogPlugin } from './
|
|
1
|
+
export { helpDialogPlugin } from './helpDialogPlugin';
|
|
2
2
|
// DO NOT COPY DISABLING THIS RULE. We are disabling it for a special existing case.
|
|
3
3
|
// This will be shortly removed. Reach out to #cc-editor-lego if you have issues.
|
|
4
4
|
// eslint-disable-next-line @atlaskit/editor/only-export-plugin
|
|
@@ -6,4 +6,4 @@ export {
|
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated DO NOT USE, it is only available to maintain an existing deprecated API
|
|
8
8
|
*/
|
|
9
|
-
openHelpCommand as deprecatedOpenHelpCommand } from './commands';
|
|
9
|
+
openHelpCommand as deprecatedOpenHelpCommand } from './pm-plugins/commands';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { bindKeymapWithCommand, openHelp } from '@atlaskit/editor-common/keymaps';
|
|
3
|
+
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
|
+
import { openHelpCommand } from './commands';
|
|
5
|
+
import { pluginKey } from './plugin-key';
|
|
6
|
+
export var keymapPlugin = function keymapPlugin(editorAnalyticsAPI) {
|
|
7
|
+
var list = {};
|
|
8
|
+
bindKeymapWithCommand(openHelp.common, function (state, dispatch) {
|
|
9
|
+
var tr = state.tr;
|
|
10
|
+
var isVisible = tr.getMeta(pluginKey);
|
|
11
|
+
if (!isVisible) {
|
|
12
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
13
|
+
action: ACTION.CLICKED,
|
|
14
|
+
actionSubject: ACTION_SUBJECT.BUTTON,
|
|
15
|
+
actionSubjectId: ACTION_SUBJECT_ID.BUTTON_HELP,
|
|
16
|
+
attributes: {
|
|
17
|
+
inputMethod: INPUT_METHOD.SHORTCUT
|
|
18
|
+
},
|
|
19
|
+
eventType: EVENT_TYPE.UI
|
|
20
|
+
})(tr);
|
|
21
|
+
openHelpCommand(tr, dispatch);
|
|
22
|
+
}
|
|
23
|
+
return true;
|
|
24
|
+
}, list);
|
|
25
|
+
return keymap(list);
|
|
26
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
|
+
import { pluginKey } from './plugin-key';
|
|
6
|
+
export function createPlugin(dispatch, imageEnabled) {
|
|
7
|
+
return new SafePlugin({
|
|
8
|
+
key: pluginKey,
|
|
9
|
+
state: {
|
|
10
|
+
init: function init() {
|
|
11
|
+
return {
|
|
12
|
+
isVisible: false,
|
|
13
|
+
imageEnabled: imageEnabled
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
apply: function apply(tr, _value, state) {
|
|
17
|
+
var isVisible = tr.getMeta(pluginKey);
|
|
18
|
+
var currentState = pluginKey.getState(state);
|
|
19
|
+
if (isVisible !== undefined && isVisible !== currentState.isVisible) {
|
|
20
|
+
var newState = _objectSpread(_objectSpread({}, currentState), {}, {
|
|
21
|
+
isVisible: isVisible
|
|
22
|
+
});
|
|
23
|
+
dispatch(pluginKey, newState);
|
|
24
|
+
return newState;
|
|
25
|
+
}
|
|
26
|
+
return currentState;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
package/dist/esm/ui/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { jsx } from '@emotion/react';
|
|
|
9
9
|
import { injectIntl } from 'react-intl-next';
|
|
10
10
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
11
11
|
import AkModalDialog, { ModalTransition } from '@atlaskit/modal-dialog';
|
|
12
|
-
import { closeHelpCommand } from '../commands';
|
|
12
|
+
import { closeHelpCommand } from '../pm-plugins/commands';
|
|
13
13
|
import { getSupportedFormatting } from './formatting';
|
|
14
14
|
import Modal from './Modal';
|
|
15
15
|
var HelpDialog = function HelpDialog(_ref) {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type { HelpDialogPlugin, HelpDialogSharedState } from './
|
|
2
|
-
export { helpDialogPlugin } from './
|
|
1
|
+
export type { HelpDialogPlugin, HelpDialogSharedState } from './helpDialogPluginType';
|
|
2
|
+
export { helpDialogPlugin } from './helpDialogPlugin';
|
|
3
3
|
export {
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated DO NOT USE, it is only available to maintain an existing deprecated API
|
|
6
6
|
*/
|
|
7
|
-
openHelpCommand as deprecatedOpenHelpCommand, } from './commands';
|
|
7
|
+
openHelpCommand as deprecatedOpenHelpCommand, } from './pm-plugins/commands';
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { HelpDialogPlugin } from './types';
|
|
3
2
|
export declare function createPlugin(dispatch: Function, imageEnabled: boolean): SafePlugin<any>;
|
|
4
|
-
export declare const helpDialogPlugin: HelpDialogPlugin;
|
package/dist/types/ui/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { HelpDialogPlugin } from '../
|
|
5
|
+
import type { HelpDialogPlugin } from '../helpDialogPluginType';
|
|
6
6
|
export interface HelpDialogProps {
|
|
7
7
|
pluginInjectionApi: ExtractInjectionAPI<HelpDialogPlugin> | undefined;
|
|
8
8
|
editorView: EditorView;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type { HelpDialogPlugin, HelpDialogSharedState } from './
|
|
2
|
-
export { helpDialogPlugin } from './
|
|
1
|
+
export type { HelpDialogPlugin, HelpDialogSharedState } from './helpDialogPluginType';
|
|
2
|
+
export { helpDialogPlugin } from './helpDialogPlugin';
|
|
3
3
|
export {
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated DO NOT USE, it is only available to maintain an existing deprecated API
|
|
6
6
|
*/
|
|
7
|
-
openHelpCommand as deprecatedOpenHelpCommand, } from './commands';
|
|
7
|
+
openHelpCommand as deprecatedOpenHelpCommand, } from './pm-plugins/commands';
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { HelpDialogPlugin } from './types';
|
|
3
2
|
export declare function createPlugin(dispatch: Function, imageEnabled: boolean): SafePlugin<any>;
|
|
4
|
-
export declare const helpDialogPlugin: HelpDialogPlugin;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { HelpDialogPlugin } from '../
|
|
5
|
+
import type { HelpDialogPlugin } from '../helpDialogPluginType';
|
|
6
6
|
export interface HelpDialogProps {
|
|
7
7
|
pluginInjectionApi: ExtractInjectionAPI<HelpDialogPlugin> | undefined;
|
|
8
8
|
editorView: EditorView;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-help-dialog",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.5",
|
|
4
4
|
"description": "Help Dialog plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,18 +31,18 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/editor-common": "^89.
|
|
34
|
+
"@atlaskit/editor-common": "^89.2.0",
|
|
35
35
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
36
36
|
"@atlaskit/editor-plugin-quick-insert": "^1.3.0",
|
|
37
|
-
"@atlaskit/editor-prosemirror": "
|
|
37
|
+
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
38
38
|
"@atlaskit/editor-shared-styles": "^2.13.0",
|
|
39
39
|
"@atlaskit/heading": "^2.4.0",
|
|
40
|
-
"@atlaskit/icon": "^22.
|
|
40
|
+
"@atlaskit/icon": "^22.18.0",
|
|
41
41
|
"@atlaskit/modal-dialog": "^12.15.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
43
43
|
"@atlaskit/primitives": "^12.1.0",
|
|
44
44
|
"@atlaskit/theme": "^13.0.0",
|
|
45
|
-
"@atlaskit/tokens": "^1.
|
|
45
|
+
"@atlaskit/tokens": "^1.60.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0",
|
|
47
47
|
"@emotion/react": "^11.7.1",
|
|
48
48
|
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
@@ -56,6 +56,9 @@
|
|
|
56
56
|
},
|
|
57
57
|
"techstack": {
|
|
58
58
|
"@atlassian/frontend": {
|
|
59
|
+
"code-structure": [
|
|
60
|
+
"editor-plugin"
|
|
61
|
+
],
|
|
59
62
|
"import-structure": [
|
|
60
63
|
"atlassian-conventions"
|
|
61
64
|
],
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|