@atlaskit/editor-plugin-panel 3.1.6 → 3.2.1
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 +18 -0
- package/dist/cjs/{actions.js → editor-actions/actions.js} +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/nodeviews/panel.js +6 -3
- package/dist/cjs/{plugin.js → panelPlugin.js} +2 -2
- package/dist/cjs/pm-plugins/main.js +3 -3
- package/dist/cjs/{toolbar.js → ui/toolbar.js} +9 -10
- package/dist/es2019/{actions.js → editor-actions/actions.js} +1 -1
- package/dist/es2019/index.js +4 -1
- package/dist/es2019/nodeviews/panel.js +6 -1
- package/dist/es2019/{plugin.js → panelPlugin.js} +2 -2
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/es2019/{toolbar.js → ui/toolbar.js} +2 -2
- package/dist/esm/{actions.js → editor-actions/actions.js} +1 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/nodeviews/panel.js +7 -3
- package/dist/esm/{plugin.js → panelPlugin.js} +2 -2
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/esm/{toolbar.js → ui/toolbar.js} +9 -10
- package/dist/types/{actions.d.ts → editor-actions/actions.d.ts} +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/nodeviews/panel.d.ts +1 -1
- package/dist/types/{plugin.d.ts → panelPlugin.d.ts} +1 -1
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/{toolbar.d.ts → ui/toolbar.d.ts} +2 -2
- package/dist/types-ts4.5/{actions.d.ts → editor-actions/actions.d.ts} +1 -1
- package/dist/types-ts4.5/index.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/panel.d.ts +1 -1
- package/dist/types-ts4.5/{plugin.d.ts → panelPlugin.d.ts} +1 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/{toolbar.d.ts → ui/toolbar.d.ts} +2 -2
- package/package.json +7 -4
- /package/dist/cjs/{types.js → panelPluginType.js} +0 -0
- /package/dist/cjs/{utils.js → pm-plugins/utils/utils.js} +0 -0
- /package/dist/es2019/{types.js → panelPluginType.js} +0 -0
- /package/dist/es2019/{utils.js → pm-plugins/utils/utils.js} +0 -0
- /package/dist/esm/{types.js → panelPluginType.js} +0 -0
- /package/dist/esm/{utils.js → pm-plugins/utils/utils.js} +0 -0
- /package/dist/types/{types.d.ts → panelPluginType.d.ts} +0 -0
- /package/dist/types/{utils.d.ts → pm-plugins/utils/utils.d.ts} +0 -0
- /package/dist/types-ts4.5/{types.d.ts → panelPluginType.d.ts} +0 -0
- /package/dist/types-ts4.5/{utils.d.ts → pm-plugins/utils/utils.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-panel
|
|
2
2
|
|
|
3
|
+
## 3.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 3.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#178674](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/178674)
|
|
14
|
+
[`112c90f42dcbc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/112c90f42dcbc) -
|
|
15
|
+
Refactored folder structure to confirm to new editor standards
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 3.1.6
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -15,7 +15,7 @@ var _panel = require("@atlaskit/editor-common/panel");
|
|
|
15
15
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
16
16
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
17
17
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
18
|
-
var _utils3 = require("
|
|
18
|
+
var _utils3 = require("../pm-plugins/utils/utils");
|
|
19
19
|
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; }
|
|
20
20
|
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; }
|
|
21
21
|
var removePanel = exports.removePanel = function removePanel(editorAnalyticsAPI) {
|
package/dist/cjs/index.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
Object.defineProperty(exports, "panelPlugin", {
|
|
8
8
|
enumerable: true,
|
|
9
9
|
get: function get() {
|
|
10
|
-
return
|
|
10
|
+
return _panelPlugin.default;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
var
|
|
13
|
+
var _panelPlugin = _interopRequireDefault(require("./panelPlugin"));
|
|
@@ -19,7 +19,9 @@ var _model = require("@atlaskit/editor-prosemirror/model");
|
|
|
19
19
|
var _consts = require("@atlaskit/editor-shared-styles/consts");
|
|
20
20
|
var _hint = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/hint"));
|
|
21
21
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
|
-
var _utils = require("../utils");
|
|
22
|
+
var _utils = require("../pm-plugins/utils/utils");
|
|
23
|
+
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
24
|
+
// Mapping export
|
|
23
25
|
var panelIcons = exports.panelIcons = {
|
|
24
26
|
info: _icons.PanelInfoIcon,
|
|
25
27
|
success: _icons.PanelSuccessIcon,
|
|
@@ -29,6 +31,8 @@ var panelIcons = exports.panelIcons = {
|
|
|
29
31
|
error: _icons.PanelErrorIcon,
|
|
30
32
|
custom: _icons.PanelInfoIcon
|
|
31
33
|
};
|
|
34
|
+
/* eslint-enable @atlaskit/editor/no-re-export */
|
|
35
|
+
|
|
32
36
|
var useEmojiProvider = function useEmojiProvider(pluginInjectionApi) {
|
|
33
37
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['emoji']),
|
|
34
38
|
emojiState = _useSharedPluginState.emojiState;
|
|
@@ -101,7 +105,7 @@ var PanelNodeView = /*#__PURE__*/function () {
|
|
|
101
105
|
}), this.icon);
|
|
102
106
|
}
|
|
103
107
|
}
|
|
104
|
-
(0, _createClass2.default)(PanelNodeView, [{
|
|
108
|
+
return (0, _createClass2.default)(PanelNodeView, [{
|
|
105
109
|
key: "ignoreMutation",
|
|
106
110
|
value: function ignoreMutation(mutation) {
|
|
107
111
|
// ignore mutation if it caused by the icon.
|
|
@@ -121,7 +125,6 @@ var PanelNodeView = /*#__PURE__*/function () {
|
|
|
121
125
|
}
|
|
122
126
|
}
|
|
123
127
|
}]);
|
|
124
|
-
return PanelNodeView;
|
|
125
128
|
}();
|
|
126
129
|
var getPanelNodeView = exports.getPanelNodeView = function getPanelNodeView(pluginOptions, api, nodeViewPortalProviderAPI, providerFactory) {
|
|
127
130
|
return function (node, view, getPos) {
|
|
@@ -11,10 +11,10 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
11
11
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
12
12
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
13
13
|
var _colors = require("@atlaskit/theme/colors");
|
|
14
|
-
var _actions = require("./actions");
|
|
14
|
+
var _actions = require("./editor-actions/actions");
|
|
15
15
|
var _keymaps = _interopRequireDefault(require("./pm-plugins/keymaps"));
|
|
16
16
|
var _main = require("./pm-plugins/main");
|
|
17
|
-
var _toolbar = require("./toolbar");
|
|
17
|
+
var _toolbar = require("./ui/toolbar");
|
|
18
18
|
var panelPlugin = function panelPlugin(_ref) {
|
|
19
19
|
var _ref$config = _ref.config,
|
|
20
20
|
options = _ref$config === void 0 ? {} : _ref$config,
|
|
@@ -8,13 +8,13 @@ var _panel = require("@atlaskit/editor-common/panel");
|
|
|
8
8
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
9
9
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
10
10
|
var _panel2 = require("../nodeviews/panel");
|
|
11
|
-
var
|
|
12
|
-
var _utils = require("
|
|
11
|
+
var _panelPluginType = require("../panelPluginType");
|
|
12
|
+
var _utils = require("./utils/utils");
|
|
13
13
|
var createPlugin = exports.createPlugin = function createPlugin(dispatch, providerFactory, pluginOptions, api, nodeViewPortalProviderAPI) {
|
|
14
14
|
var _pluginOptions$useLon = pluginOptions.useLongPressSelection,
|
|
15
15
|
useLongPressSelection = _pluginOptions$useLon === void 0 ? false : _pluginOptions$useLon;
|
|
16
16
|
return new _safePlugin.SafePlugin({
|
|
17
|
-
key:
|
|
17
|
+
key: _panelPluginType.pluginKey,
|
|
18
18
|
appendTransaction: function appendTransaction(transactions, oldState, newState) {
|
|
19
19
|
var tr = transactions.find(function (tr) {
|
|
20
20
|
return tr.getMeta('uiEvent') === 'cut';
|
|
@@ -29,32 +29,31 @@ var _removeEmoji = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/r
|
|
|
29
29
|
var _success2 = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/success"));
|
|
30
30
|
var _warning2 = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/warning"));
|
|
31
31
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
32
|
-
var _actions = require("
|
|
33
|
-
var _utils2 = require("
|
|
34
|
-
var _panelIconMap;
|
|
32
|
+
var _actions = require("../editor-actions/actions");
|
|
33
|
+
var _utils2 = require("../pm-plugins/utils/utils");
|
|
35
34
|
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); }
|
|
36
35
|
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; }
|
|
37
36
|
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; }
|
|
38
37
|
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; }
|
|
39
|
-
var panelIconMap = exports.panelIconMap = (
|
|
38
|
+
var panelIconMap = exports.panelIconMap = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _adfSchema.PanelType.INFO, {
|
|
40
39
|
shortName: ':info:',
|
|
41
40
|
id: 'atlassian-info'
|
|
42
|
-
}),
|
|
41
|
+
}), _adfSchema.PanelType.NOTE, {
|
|
43
42
|
shortName: ':note:',
|
|
44
43
|
id: 'atlassian-note'
|
|
45
|
-
}),
|
|
44
|
+
}), _adfSchema.PanelType.WARNING, {
|
|
46
45
|
shortName: ':warning:',
|
|
47
46
|
id: 'atlassian-warning'
|
|
48
|
-
}),
|
|
47
|
+
}), _adfSchema.PanelType.ERROR, {
|
|
49
48
|
shortName: ':cross_mark:',
|
|
50
49
|
id: 'atlassian-cross_mark'
|
|
51
|
-
}),
|
|
50
|
+
}), _adfSchema.PanelType.SUCCESS, {
|
|
52
51
|
shortName: ':check_mark:',
|
|
53
52
|
id: 'atlassian-check_mark'
|
|
54
|
-
}),
|
|
53
|
+
}), _adfSchema.PanelType.TIP, {
|
|
55
54
|
shortName: ':tip:',
|
|
56
55
|
id: 'atlassian-tip'
|
|
57
|
-
})
|
|
56
|
+
});
|
|
58
57
|
var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, hoverDecoration, editorAnalyticsAPI, activePanelType, activePanelColor, activePanelIcon, state) {
|
|
59
58
|
// TODO: ED-14403 investigate why these titles are not getting translated for the tooltips
|
|
60
59
|
var items = [{
|
|
@@ -5,7 +5,7 @@ import { getPanelTypeBackgroundNoTokens } from '@atlaskit/editor-common/panel';
|
|
|
5
5
|
import { wrapSelectionIn } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { findParentNodeOfType, findSelectedNodeOfType, removeParentNodeOfType, removeSelectedNode } from '@atlaskit/editor-prosemirror/utils';
|
|
8
|
-
import { findPanel } from '
|
|
8
|
+
import { findPanel } from '../pm-plugins/utils/utils';
|
|
9
9
|
export const removePanel = editorAnalyticsAPI => (state, dispatch) => {
|
|
10
10
|
const {
|
|
11
11
|
schema: {
|
package/dist/es2019/index.js
CHANGED
|
@@ -10,7 +10,10 @@ import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
|
10
10
|
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
|
|
11
11
|
import TipIcon from '@atlaskit/icon/glyph/editor/hint';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
-
import { panelAttrsToDom } from '../utils';
|
|
13
|
+
import { panelAttrsToDom } from '../pm-plugins/utils/utils';
|
|
14
|
+
|
|
15
|
+
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
16
|
+
// Mapping export
|
|
14
17
|
export const panelIcons = {
|
|
15
18
|
info: PanelInfoIcon,
|
|
16
19
|
success: PanelSuccessIcon,
|
|
@@ -20,6 +23,8 @@ export const panelIcons = {
|
|
|
20
23
|
error: PanelErrorIcon,
|
|
21
24
|
custom: PanelInfoIcon
|
|
22
25
|
};
|
|
26
|
+
/* eslint-enable @atlaskit/editor/no-re-export */
|
|
27
|
+
|
|
23
28
|
const useEmojiProvider = pluginInjectionApi => {
|
|
24
29
|
const {
|
|
25
30
|
emojiState
|
|
@@ -4,10 +4,10 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
|
|
|
4
4
|
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { IconCustomPanel, IconPanel, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning } from '@atlaskit/editor-common/quick-insert';
|
|
6
6
|
import { T50 } from '@atlaskit/theme/colors';
|
|
7
|
-
import { insertPanelWithAnalytics } from './actions';
|
|
7
|
+
import { insertPanelWithAnalytics } from './editor-actions/actions';
|
|
8
8
|
import keymap from './pm-plugins/keymaps';
|
|
9
9
|
import { createPlugin } from './pm-plugins/main';
|
|
10
|
-
import { getToolbarConfig } from './toolbar';
|
|
10
|
+
import { getToolbarConfig } from './ui/toolbar';
|
|
11
11
|
const panelPlugin = ({
|
|
12
12
|
config: options = {},
|
|
13
13
|
api
|
|
@@ -2,8 +2,8 @@ import { PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
|
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { createSelectionClickHandler } from '@atlaskit/editor-common/selection';
|
|
4
4
|
import { getPanelNodeView } from '../nodeviews/panel';
|
|
5
|
-
import { pluginKey } from '../
|
|
6
|
-
import { handleCut } from '
|
|
5
|
+
import { pluginKey } from '../panelPluginType';
|
|
6
|
+
import { handleCut } from './utils/utils';
|
|
7
7
|
export const createPlugin = (dispatch, providerFactory, pluginOptions, api, nodeViewPortalProviderAPI) => {
|
|
8
8
|
const {
|
|
9
9
|
useLongPressSelection = false
|
|
@@ -20,8 +20,8 @@ import RemoveEmojiIcon from '@atlaskit/icon/glyph/editor/remove-emoji';
|
|
|
20
20
|
import LegacySuccessIcon from '@atlaskit/icon/glyph/editor/success';
|
|
21
21
|
import LegacyWarningIcon from '@atlaskit/icon/glyph/editor/warning';
|
|
22
22
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
23
|
-
import { changePanelType, removePanel } from '
|
|
24
|
-
import { findPanel } from '
|
|
23
|
+
import { changePanelType, removePanel } from '../editor-actions/actions';
|
|
24
|
+
import { findPanel } from '../pm-plugins/utils/utils';
|
|
25
25
|
export const panelIconMap = {
|
|
26
26
|
[PanelType.INFO]: {
|
|
27
27
|
shortName: ':info:',
|
|
@@ -8,7 +8,7 @@ import { getPanelTypeBackgroundNoTokens } from '@atlaskit/editor-common/panel';
|
|
|
8
8
|
import { wrapSelectionIn } from '@atlaskit/editor-common/utils';
|
|
9
9
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
10
10
|
import { findParentNodeOfType, findSelectedNodeOfType, removeParentNodeOfType, removeSelectedNode } from '@atlaskit/editor-prosemirror/utils';
|
|
11
|
-
import { findPanel } from '
|
|
11
|
+
import { findPanel } from '../pm-plugins/utils/utils';
|
|
12
12
|
export var removePanel = function removePanel(editorAnalyticsAPI) {
|
|
13
13
|
return function (state, dispatch) {
|
|
14
14
|
var nodes = state.schema.nodes,
|
package/dist/esm/index.js
CHANGED
|
@@ -12,7 +12,10 @@ import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
|
12
12
|
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
|
|
13
13
|
import TipIcon from '@atlaskit/icon/glyph/editor/hint';
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
|
-
import { panelAttrsToDom } from '../utils';
|
|
15
|
+
import { panelAttrsToDom } from '../pm-plugins/utils/utils';
|
|
16
|
+
|
|
17
|
+
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
18
|
+
// Mapping export
|
|
16
19
|
export var panelIcons = {
|
|
17
20
|
info: PanelInfoIcon,
|
|
18
21
|
success: PanelSuccessIcon,
|
|
@@ -22,6 +25,8 @@ export var panelIcons = {
|
|
|
22
25
|
error: PanelErrorIcon,
|
|
23
26
|
custom: PanelInfoIcon
|
|
24
27
|
};
|
|
28
|
+
/* eslint-enable @atlaskit/editor/no-re-export */
|
|
29
|
+
|
|
25
30
|
var useEmojiProvider = function useEmojiProvider(pluginInjectionApi) {
|
|
26
31
|
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['emoji']),
|
|
27
32
|
emojiState = _useSharedPluginState.emojiState;
|
|
@@ -94,7 +99,7 @@ var PanelNodeView = /*#__PURE__*/function () {
|
|
|
94
99
|
}), this.icon);
|
|
95
100
|
}
|
|
96
101
|
}
|
|
97
|
-
_createClass(PanelNodeView, [{
|
|
102
|
+
return _createClass(PanelNodeView, [{
|
|
98
103
|
key: "ignoreMutation",
|
|
99
104
|
value: function ignoreMutation(mutation) {
|
|
100
105
|
// ignore mutation if it caused by the icon.
|
|
@@ -114,7 +119,6 @@ var PanelNodeView = /*#__PURE__*/function () {
|
|
|
114
119
|
}
|
|
115
120
|
}
|
|
116
121
|
}]);
|
|
117
|
-
return PanelNodeView;
|
|
118
122
|
}();
|
|
119
123
|
export var getPanelNodeView = function getPanelNodeView(pluginOptions, api, nodeViewPortalProviderAPI, providerFactory) {
|
|
120
124
|
return function (node, view, getPos) {
|
|
@@ -4,10 +4,10 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
|
|
|
4
4
|
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { IconCustomPanel, IconPanel, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning } from '@atlaskit/editor-common/quick-insert';
|
|
6
6
|
import { T50 } from '@atlaskit/theme/colors';
|
|
7
|
-
import { insertPanelWithAnalytics } from './actions';
|
|
7
|
+
import { insertPanelWithAnalytics } from './editor-actions/actions';
|
|
8
8
|
import keymap from './pm-plugins/keymaps';
|
|
9
9
|
import { createPlugin } from './pm-plugins/main';
|
|
10
|
-
import { getToolbarConfig } from './toolbar';
|
|
10
|
+
import { getToolbarConfig } from './ui/toolbar';
|
|
11
11
|
var panelPlugin = function panelPlugin(_ref) {
|
|
12
12
|
var _ref$config = _ref.config,
|
|
13
13
|
options = _ref$config === void 0 ? {} : _ref$config,
|
|
@@ -2,8 +2,8 @@ import { PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
|
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { createSelectionClickHandler } from '@atlaskit/editor-common/selection';
|
|
4
4
|
import { getPanelNodeView } from '../nodeviews/panel';
|
|
5
|
-
import { pluginKey } from '../
|
|
6
|
-
import { handleCut } from '
|
|
5
|
+
import { pluginKey } from '../panelPluginType';
|
|
6
|
+
import { handleCut } from './utils/utils';
|
|
7
7
|
export var createPlugin = function createPlugin(dispatch, providerFactory, pluginOptions, api, nodeViewPortalProviderAPI) {
|
|
8
8
|
var _pluginOptions$useLon = pluginOptions.useLongPressSelection,
|
|
9
9
|
useLongPressSelection = _pluginOptions$useLon === void 0 ? false : _pluginOptions$useLon;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
var _panelIconMap;
|
|
3
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; }
|
|
4
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; }
|
|
5
4
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
@@ -24,27 +23,27 @@ import RemoveEmojiIcon from '@atlaskit/icon/glyph/editor/remove-emoji';
|
|
|
24
23
|
import LegacySuccessIcon from '@atlaskit/icon/glyph/editor/success';
|
|
25
24
|
import LegacyWarningIcon from '@atlaskit/icon/glyph/editor/warning';
|
|
26
25
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
27
|
-
import { changePanelType, removePanel } from '
|
|
28
|
-
import { findPanel } from '
|
|
29
|
-
export var panelIconMap = (
|
|
26
|
+
import { changePanelType, removePanel } from '../editor-actions/actions';
|
|
27
|
+
import { findPanel } from '../pm-plugins/utils/utils';
|
|
28
|
+
export var panelIconMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, PanelType.INFO, {
|
|
30
29
|
shortName: ':info:',
|
|
31
30
|
id: 'atlassian-info'
|
|
32
|
-
}),
|
|
31
|
+
}), PanelType.NOTE, {
|
|
33
32
|
shortName: ':note:',
|
|
34
33
|
id: 'atlassian-note'
|
|
35
|
-
}),
|
|
34
|
+
}), PanelType.WARNING, {
|
|
36
35
|
shortName: ':warning:',
|
|
37
36
|
id: 'atlassian-warning'
|
|
38
|
-
}),
|
|
37
|
+
}), PanelType.ERROR, {
|
|
39
38
|
shortName: ':cross_mark:',
|
|
40
39
|
id: 'atlassian-cross_mark'
|
|
41
|
-
}),
|
|
40
|
+
}), PanelType.SUCCESS, {
|
|
42
41
|
shortName: ':check_mark:',
|
|
43
42
|
id: 'atlassian-check_mark'
|
|
44
|
-
}),
|
|
43
|
+
}), PanelType.TIP, {
|
|
45
44
|
shortName: ':tip:',
|
|
46
45
|
id: 'atlassian-tip'
|
|
47
|
-
})
|
|
46
|
+
});
|
|
48
47
|
export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, hoverDecoration, editorAnalyticsAPI, activePanelType, activePanelColor, activePanelIcon, state) {
|
|
49
48
|
// TODO: ED-14403 investigate why these titles are not getting translated for the tooltips
|
|
50
49
|
var items = [{
|
|
@@ -2,7 +2,7 @@ import { PanelType } from '@atlaskit/adf-schema';
|
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
5
|
-
import type { PanelOptions } from '
|
|
5
|
+
import type { PanelOptions } from '../pm-plugins/main';
|
|
6
6
|
export type DomAtPos = (pos: number) => {
|
|
7
7
|
node: HTMLElement;
|
|
8
8
|
offset: number;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as panelPlugin } from './
|
|
2
|
-
export type { PanelPlugin, PanelPluginConfig, PanelPluginOptions } from './
|
|
1
|
+
export { default as panelPlugin } from './panelPlugin';
|
|
2
|
+
export type { PanelPlugin, PanelPluginConfig, PanelPluginOptions } from './panelPluginType';
|
|
@@ -6,7 +6,7 @@ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
|
6
6
|
import type { ExtractInjectionAPI, getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
8
8
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import type { PanelPlugin, PanelPluginOptions } from '../
|
|
9
|
+
import type { PanelPlugin, PanelPluginOptions } from '../panelPluginType';
|
|
10
10
|
export declare const panelIcons: {
|
|
11
11
|
[key in PanelType]: React.ComponentType<{
|
|
12
12
|
label: string;
|
|
@@ -3,7 +3,7 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
3
3
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
5
|
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
-
import { type PanelPlugin, type PanelPluginOptions } from '../
|
|
6
|
+
import { type PanelPlugin, type PanelPluginOptions } from '../panelPluginType';
|
|
7
7
|
export type PanelOptions = {
|
|
8
8
|
color?: string;
|
|
9
9
|
emoji?: string;
|
|
@@ -6,8 +6,8 @@ import type { Command, ExtractInjectionAPI, FloatingToolbarConfig, FloatingToolb
|
|
|
6
6
|
import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
|
|
7
7
|
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
8
8
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
9
|
+
import type { PanelPlugin } from '../index';
|
|
10
|
+
import type { EmojiInfo, PanelPluginOptions } from '../panelPluginType';
|
|
11
11
|
export declare const panelIconMap: {
|
|
12
12
|
[key in Exclude<PanelType, PanelType.CUSTOM>]: EmojiInfo;
|
|
13
13
|
};
|
|
@@ -2,7 +2,7 @@ import { PanelType } from '@atlaskit/adf-schema';
|
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
5
|
-
import type { PanelOptions } from '
|
|
5
|
+
import type { PanelOptions } from '../pm-plugins/main';
|
|
6
6
|
export type DomAtPos = (pos: number) => {
|
|
7
7
|
node: HTMLElement;
|
|
8
8
|
offset: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as panelPlugin } from './
|
|
2
|
-
export type { PanelPlugin, PanelPluginConfig, PanelPluginOptions } from './
|
|
1
|
+
export { default as panelPlugin } from './panelPlugin';
|
|
2
|
+
export type { PanelPlugin, PanelPluginConfig, PanelPluginOptions } from './panelPluginType';
|
|
@@ -6,7 +6,7 @@ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
|
6
6
|
import type { ExtractInjectionAPI, getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
8
8
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import type { PanelPlugin, PanelPluginOptions } from '../
|
|
9
|
+
import type { PanelPlugin, PanelPluginOptions } from '../panelPluginType';
|
|
10
10
|
export declare const panelIcons: {
|
|
11
11
|
[key in PanelType]: React.ComponentType<{
|
|
12
12
|
label: string;
|
|
@@ -3,7 +3,7 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
3
3
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
5
|
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
-
import { type PanelPlugin, type PanelPluginOptions } from '../
|
|
6
|
+
import { type PanelPlugin, type PanelPluginOptions } from '../panelPluginType';
|
|
7
7
|
export type PanelOptions = {
|
|
8
8
|
color?: string;
|
|
9
9
|
emoji?: string;
|
|
@@ -6,8 +6,8 @@ import type { Command, ExtractInjectionAPI, FloatingToolbarConfig, FloatingToolb
|
|
|
6
6
|
import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
|
|
7
7
|
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
8
8
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
9
|
+
import type { PanelPlugin } from '../index';
|
|
10
|
+
import type { EmojiInfo, PanelPluginOptions } from '../panelPluginType';
|
|
11
11
|
export declare const panelIconMap: {
|
|
12
12
|
[key in Exclude<PanelType, PanelType.CUSTOM>]: EmojiInfo;
|
|
13
13
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-panel",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Panel 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/editor-common": "^
|
|
35
|
+
"@atlaskit/editor-common": "^97.0.0",
|
|
36
36
|
"@atlaskit/editor-palette": "1.6.3",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
38
38
|
"@atlaskit/editor-plugin-decorations": "^1.3.0",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
41
41
|
"@atlaskit/editor-shared-styles": "^3.2.0",
|
|
42
42
|
"@atlaskit/emoji": "^67.11.0",
|
|
43
|
-
"@atlaskit/icon": "^23.
|
|
43
|
+
"@atlaskit/icon": "^23.1.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
45
45
|
"@atlaskit/theme": "^14.0.0",
|
|
46
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
46
|
+
"@atlaskit/tmp-editor-statsig": "^2.29.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"uuid": "^3.1.0"
|
|
49
49
|
},
|
|
@@ -62,6 +62,9 @@
|
|
|
62
62
|
],
|
|
63
63
|
"circular-dependencies": [
|
|
64
64
|
"file-and-folder-level"
|
|
65
|
+
],
|
|
66
|
+
"code-structure": [
|
|
67
|
+
"editor-plugin"
|
|
65
68
|
]
|
|
66
69
|
},
|
|
67
70
|
"@repo/internal": {
|
|
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
|