@atlaskit/editor-plugin-expand 1.2.5 → 1.3.0
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 +13 -0
- package/dist/cjs/legacyExpand/plugin.js +105 -0
- package/dist/cjs/plugin.js +13 -93
- package/dist/cjs/singlePlayerExpand/plugin.js +35 -0
- package/dist/es2019/index.js +2 -0
- package/dist/es2019/legacyExpand/plugin.js +90 -0
- package/dist/es2019/plugin.js +14 -85
- package/dist/es2019/singlePlayerExpand/plugin.js +30 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/legacyExpand/plugin.js +92 -0
- package/dist/esm/plugin.js +14 -87
- package/dist/esm/singlePlayerExpand/plugin.js +30 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/{types-ts4.5 → types/legacyExpand}/nodeviews/index.d.ts +1 -2
- package/dist/types/legacyExpand/plugin.d.ts +3 -0
- package/dist/types/legacyExpand/pm-plugins/plugin-factory.d.ts +3 -0
- package/dist/types/{toolbar.d.ts → legacyExpand/toolbar.d.ts} +1 -1
- package/dist/types/plugin.d.ts +1 -2
- package/dist/types/singlePlayerExpand/plugin.d.ts +2 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/{types → types-ts4.5/legacyExpand}/nodeviews/index.d.ts +1 -2
- package/dist/types-ts4.5/legacyExpand/plugin.d.ts +3 -0
- package/dist/types-ts4.5/legacyExpand/pm-plugins/plugin-factory.d.ts +3 -0
- package/dist/types-ts4.5/{toolbar.d.ts → legacyExpand/toolbar.d.ts} +1 -1
- package/dist/types-ts4.5/plugin.d.ts +1 -2
- package/dist/types-ts4.5/singlePlayerExpand/plugin.d.ts +2 -0
- package/package.json +7 -4
- package/dist/types/pm-plugins/plugin-factory.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/plugin-factory.d.ts +0 -3
- /package/dist/cjs/{commands.js → legacyExpand/commands.js} +0 -0
- /package/dist/cjs/{nodeviews → legacyExpand/nodeviews}/index.js +0 -0
- /package/dist/cjs/{pm-plugins → legacyExpand/pm-plugins}/keymap.js +0 -0
- /package/dist/cjs/{pm-plugins → legacyExpand/pm-plugins}/main.js +0 -0
- /package/dist/cjs/{pm-plugins → legacyExpand/pm-plugins}/plugin-factory.js +0 -0
- /package/dist/cjs/{reducer.js → legacyExpand/reducer.js} +0 -0
- /package/dist/cjs/{toolbar.js → legacyExpand/toolbar.js} +0 -0
- /package/dist/cjs/{types.js → legacyExpand/types.js} +0 -0
- /package/dist/cjs/{ui → legacyExpand/ui}/ExpandIconButton.js +0 -0
- /package/dist/cjs/{utils.js → legacyExpand/utils.js} +0 -0
- /package/dist/es2019/{commands.js → legacyExpand/commands.js} +0 -0
- /package/dist/es2019/{nodeviews → legacyExpand/nodeviews}/index.js +0 -0
- /package/dist/es2019/{pm-plugins → legacyExpand/pm-plugins}/keymap.js +0 -0
- /package/dist/es2019/{pm-plugins → legacyExpand/pm-plugins}/main.js +0 -0
- /package/dist/es2019/{pm-plugins → legacyExpand/pm-plugins}/plugin-factory.js +0 -0
- /package/dist/es2019/{reducer.js → legacyExpand/reducer.js} +0 -0
- /package/dist/es2019/{toolbar.js → legacyExpand/toolbar.js} +0 -0
- /package/dist/es2019/{types.js → legacyExpand/types.js} +0 -0
- /package/dist/es2019/{ui → legacyExpand/ui}/ExpandIconButton.js +0 -0
- /package/dist/es2019/{utils.js → legacyExpand/utils.js} +0 -0
- /package/dist/esm/{commands.js → legacyExpand/commands.js} +0 -0
- /package/dist/esm/{nodeviews → legacyExpand/nodeviews}/index.js +0 -0
- /package/dist/esm/{pm-plugins → legacyExpand/pm-plugins}/keymap.js +0 -0
- /package/dist/esm/{pm-plugins → legacyExpand/pm-plugins}/main.js +0 -0
- /package/dist/esm/{pm-plugins → legacyExpand/pm-plugins}/plugin-factory.js +0 -0
- /package/dist/esm/{reducer.js → legacyExpand/reducer.js} +0 -0
- /package/dist/esm/{toolbar.js → legacyExpand/toolbar.js} +0 -0
- /package/dist/esm/{types.js → legacyExpand/types.js} +0 -0
- /package/dist/esm/{ui → legacyExpand/ui}/ExpandIconButton.js +0 -0
- /package/dist/esm/{utils.js → legacyExpand/utils.js} +0 -0
- /package/dist/types/{commands.d.ts → legacyExpand/commands.d.ts} +0 -0
- /package/dist/types/{pm-plugins → legacyExpand/pm-plugins}/keymap.d.ts +0 -0
- /package/dist/types/{pm-plugins → legacyExpand/pm-plugins}/main.d.ts +0 -0
- /package/dist/types/{reducer.d.ts → legacyExpand/reducer.d.ts} +0 -0
- /package/dist/types/{types.d.ts → legacyExpand/types.d.ts} +0 -0
- /package/dist/types/{ui → legacyExpand/ui}/ExpandIconButton.d.ts +0 -0
- /package/dist/types/{utils.d.ts → legacyExpand/utils.d.ts} +0 -0
- /package/dist/types-ts4.5/{commands.d.ts → legacyExpand/commands.d.ts} +0 -0
- /package/dist/types-ts4.5/{pm-plugins → legacyExpand/pm-plugins}/keymap.d.ts +0 -0
- /package/dist/types-ts4.5/{pm-plugins → legacyExpand/pm-plugins}/main.d.ts +0 -0
- /package/dist/types-ts4.5/{reducer.d.ts → legacyExpand/reducer.d.ts} +0 -0
- /package/dist/types-ts4.5/{types.d.ts → legacyExpand/types.d.ts} +0 -0
- /package/dist/types-ts4.5/{ui → legacyExpand/ui}/ExpandIconButton.d.ts +0 -0
- /package/dist/types-ts4.5/{utils.d.ts → legacyExpand/utils.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-expand
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#87870](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87870) [`76711a3e7edd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/76711a3e7edd) - [ED-22839] Refactor expand plugin to use either legacy (current) expand or single player expand (coming soon). Single player expand will only be used if `platform.editor.single-player-expand` is true and livePage is enabled.
|
|
8
|
+
|
|
9
|
+
## 1.2.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#88038](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88038) [`19ac4de34153`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/19ac4de34153) - update 'w3c-keyname' dependency to 2.1.8
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 1.2.5
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.expandPlugin = void 0;
|
|
8
|
+
Object.defineProperty(exports, "pluginKey", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _pluginFactory.pluginKey;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
var _adfSchema = require("@atlaskit/adf-schema");
|
|
16
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
17
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
18
|
+
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
19
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
20
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
|
+
var _commands = require("./commands");
|
|
22
|
+
var _keymap = require("./pm-plugins/keymap");
|
|
23
|
+
var _main = require("./pm-plugins/main");
|
|
24
|
+
var _toolbar = require("./toolbar");
|
|
25
|
+
var _pluginFactory = require("./pm-plugins/plugin-factory");
|
|
26
|
+
var expandPlugin = exports.expandPlugin = function expandPlugin(_ref) {
|
|
27
|
+
var _api$analytics;
|
|
28
|
+
var _ref$config = _ref.config,
|
|
29
|
+
options = _ref$config === void 0 ? {} : _ref$config,
|
|
30
|
+
api = _ref.api;
|
|
31
|
+
return {
|
|
32
|
+
name: 'expand',
|
|
33
|
+
nodes: function nodes() {
|
|
34
|
+
var nestedExpandNode = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-extended-nested-expand') ? _adfSchema.extendedNestedExpand : _adfSchema.nestedExpand;
|
|
35
|
+
return [{
|
|
36
|
+
name: 'expand',
|
|
37
|
+
node: _adfSchema.expand
|
|
38
|
+
}, {
|
|
39
|
+
name: 'nestedExpand',
|
|
40
|
+
node: nestedExpandNode
|
|
41
|
+
}];
|
|
42
|
+
},
|
|
43
|
+
actions: {
|
|
44
|
+
insertExpand: (0, _commands.insertExpand)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)
|
|
45
|
+
},
|
|
46
|
+
pmPlugins: function pmPlugins() {
|
|
47
|
+
return [{
|
|
48
|
+
name: 'expand',
|
|
49
|
+
plugin: function plugin(_ref2) {
|
|
50
|
+
var _options$allowInterac;
|
|
51
|
+
var dispatch = _ref2.dispatch,
|
|
52
|
+
getIntl = _ref2.getIntl;
|
|
53
|
+
return (0, _main.createPlugin)(dispatch, getIntl, options.appearance, options.useLongPressSelection, api, (_options$allowInterac = options.allowInteractiveExpand) !== null && _options$allowInterac !== void 0 ? _options$allowInterac : true, options.__livePage);
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
name: 'expandKeymap',
|
|
57
|
+
plugin: function plugin() {
|
|
58
|
+
return (0, _keymap.expandKeymap)(api, {
|
|
59
|
+
__livePage: options.__livePage
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}];
|
|
63
|
+
},
|
|
64
|
+
pluginsOptions: {
|
|
65
|
+
floatingToolbar: (0, _toolbar.getToolbarConfig)(api),
|
|
66
|
+
quickInsert: function quickInsert(_ref3) {
|
|
67
|
+
var formatMessage = _ref3.formatMessage;
|
|
68
|
+
if (options && options.allowInsertion !== true) {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
return [{
|
|
72
|
+
id: 'expand',
|
|
73
|
+
title: formatMessage(_messages.toolbarInsertBlockMessages.expand),
|
|
74
|
+
description: formatMessage(_messages.toolbarInsertBlockMessages.expandDescription),
|
|
75
|
+
keywords: ['accordion', 'collapse'],
|
|
76
|
+
priority: 600,
|
|
77
|
+
icon: function icon() {
|
|
78
|
+
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconExpand, null);
|
|
79
|
+
},
|
|
80
|
+
action: function action(insert, state) {
|
|
81
|
+
var _api$analytics2;
|
|
82
|
+
var node = (0, _commands.createExpandNode)(state);
|
|
83
|
+
if (!node) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
var tr = state.selection.empty ? insert(node) : (0, _utils.createWrapSelectionTransaction)({
|
|
87
|
+
state: state,
|
|
88
|
+
type: node.type
|
|
89
|
+
});
|
|
90
|
+
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
|
|
91
|
+
action: _analytics.ACTION.INSERTED,
|
|
92
|
+
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
93
|
+
actionSubjectId: node.type === state.schema.nodes.nestedExpand ? _analytics.ACTION_SUBJECT_ID.NESTED_EXPAND : _analytics.ACTION_SUBJECT_ID.EXPAND,
|
|
94
|
+
attributes: {
|
|
95
|
+
inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
|
|
96
|
+
},
|
|
97
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
98
|
+
})(tr);
|
|
99
|
+
return tr;
|
|
100
|
+
}
|
|
101
|
+
}];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
};
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -1,105 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.expandPlugin = void 0;
|
|
8
|
-
Object.defineProperty(exports, "pluginKey", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function get() {
|
|
11
|
-
return _pluginFactory.pluginKey;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
var _adfSchema = require("@atlaskit/adf-schema");
|
|
16
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
17
|
-
var _messages = require("@atlaskit/editor-common/messages");
|
|
18
|
-
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
19
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
20
7
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
var _main = require("./pm-plugins/main");
|
|
24
|
-
var _toolbar = require("./toolbar");
|
|
25
|
-
var _pluginFactory = require("./pm-plugins/plugin-factory");
|
|
8
|
+
var _plugin = require("./legacyExpand/plugin");
|
|
9
|
+
var _plugin2 = require("./singlePlayerExpand/plugin");
|
|
26
10
|
var expandPlugin = exports.expandPlugin = function expandPlugin(_ref) {
|
|
27
|
-
var _api$analytics;
|
|
28
11
|
var _ref$config = _ref.config,
|
|
29
12
|
options = _ref$config === void 0 ? {} : _ref$config,
|
|
30
13
|
api = _ref.api;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
actions: {
|
|
44
|
-
insertExpand: (0, _commands.insertExpand)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)
|
|
45
|
-
},
|
|
46
|
-
pmPlugins: function pmPlugins() {
|
|
47
|
-
return [{
|
|
48
|
-
name: 'expand',
|
|
49
|
-
plugin: function plugin(_ref2) {
|
|
50
|
-
var _options$allowInterac;
|
|
51
|
-
var dispatch = _ref2.dispatch,
|
|
52
|
-
getIntl = _ref2.getIntl;
|
|
53
|
-
return (0, _main.createPlugin)(dispatch, getIntl, options.appearance, options.useLongPressSelection, api, (_options$allowInterac = options.allowInteractiveExpand) !== null && _options$allowInterac !== void 0 ? _options$allowInterac : true, options.__livePage);
|
|
54
|
-
}
|
|
55
|
-
}, {
|
|
56
|
-
name: 'expandKeymap',
|
|
57
|
-
plugin: function plugin() {
|
|
58
|
-
return (0, _keymap.expandKeymap)(api, {
|
|
59
|
-
__livePage: options.__livePage
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}];
|
|
63
|
-
},
|
|
64
|
-
pluginsOptions: {
|
|
65
|
-
floatingToolbar: (0, _toolbar.getToolbarConfig)(api),
|
|
66
|
-
quickInsert: function quickInsert(_ref3) {
|
|
67
|
-
var formatMessage = _ref3.formatMessage;
|
|
68
|
-
if (options && options.allowInsertion !== true) {
|
|
69
|
-
return [];
|
|
70
|
-
}
|
|
71
|
-
return [{
|
|
72
|
-
id: 'expand',
|
|
73
|
-
title: formatMessage(_messages.toolbarInsertBlockMessages.expand),
|
|
74
|
-
description: formatMessage(_messages.toolbarInsertBlockMessages.expandDescription),
|
|
75
|
-
keywords: ['accordion', 'collapse'],
|
|
76
|
-
priority: 600,
|
|
77
|
-
icon: function icon() {
|
|
78
|
-
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconExpand, null);
|
|
79
|
-
},
|
|
80
|
-
action: function action(insert, state) {
|
|
81
|
-
var _api$analytics2;
|
|
82
|
-
var node = (0, _commands.createExpandNode)(state);
|
|
83
|
-
if (!node) {
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
var tr = state.selection.empty ? insert(node) : (0, _utils.createWrapSelectionTransaction)({
|
|
87
|
-
state: state,
|
|
88
|
-
type: node.type
|
|
89
|
-
});
|
|
90
|
-
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
|
|
91
|
-
action: _analytics.ACTION.INSERTED,
|
|
92
|
-
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
93
|
-
actionSubjectId: node.type === state.schema.nodes.nestedExpand ? _analytics.ACTION_SUBJECT_ID.NESTED_EXPAND : _analytics.ACTION_SUBJECT_ID.EXPAND,
|
|
94
|
-
attributes: {
|
|
95
|
-
inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
|
|
96
|
-
},
|
|
97
|
-
eventType: _analytics.EVENT_TYPE.TRACK
|
|
98
|
-
})(tr);
|
|
99
|
-
return tr;
|
|
100
|
-
}
|
|
101
|
-
}];
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
};
|
|
14
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.single-player-expand') && options !== null && options !== void 0 && options.__livePage) {
|
|
15
|
+
return (0, _plugin2.expandPlugin)({
|
|
16
|
+
config: options,
|
|
17
|
+
api: api
|
|
18
|
+
});
|
|
19
|
+
} else {
|
|
20
|
+
return (0, _plugin.expandPlugin)({
|
|
21
|
+
config: options,
|
|
22
|
+
api: api
|
|
23
|
+
});
|
|
24
|
+
}
|
|
105
25
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.expandPlugin = void 0;
|
|
7
|
+
var _adfSchema = require("@atlaskit/adf-schema");
|
|
8
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
|
+
// TODO: https://product-fabric.atlassian.net/browse/ED-22840
|
|
10
|
+
// In ED-22840 make sure we update the ExpandPlugin type to use singlePlayerExpands own types
|
|
11
|
+
|
|
12
|
+
var expandPlugin = exports.expandPlugin = function expandPlugin() {
|
|
13
|
+
return {
|
|
14
|
+
name: 'expand',
|
|
15
|
+
nodes: function nodes() {
|
|
16
|
+
var nestedExpandNode = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-extended-nested-expand') ? _adfSchema.extendedNestedExpand : _adfSchema.nestedExpand;
|
|
17
|
+
return [{
|
|
18
|
+
name: 'expand',
|
|
19
|
+
node: _adfSchema.expand
|
|
20
|
+
}, {
|
|
21
|
+
name: 'nestedExpand',
|
|
22
|
+
node: nestedExpandNode
|
|
23
|
+
}];
|
|
24
|
+
},
|
|
25
|
+
actions: {
|
|
26
|
+
insertExpand: function insertExpand() {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
pmPlugins: function pmPlugins() {
|
|
31
|
+
return [];
|
|
32
|
+
},
|
|
33
|
+
pluginsOptions: {}
|
|
34
|
+
};
|
|
35
|
+
};
|
package/dist/es2019/index.js
CHANGED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { expand, extendedNestedExpand, nestedExpand } from '@atlaskit/adf-schema';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { IconExpand } from '@atlaskit/editor-common/quick-insert';
|
|
6
|
+
import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
|
|
7
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { createExpandNode, insertExpand } from './commands';
|
|
9
|
+
import { expandKeymap } from './pm-plugins/keymap';
|
|
10
|
+
import { createPlugin } from './pm-plugins/main';
|
|
11
|
+
import { getToolbarConfig } from './toolbar';
|
|
12
|
+
export { pluginKey } from './pm-plugins/plugin-factory';
|
|
13
|
+
export const expandPlugin = ({
|
|
14
|
+
config: options = {},
|
|
15
|
+
api
|
|
16
|
+
}) => {
|
|
17
|
+
var _api$analytics;
|
|
18
|
+
return {
|
|
19
|
+
name: 'expand',
|
|
20
|
+
nodes() {
|
|
21
|
+
const nestedExpandNode = getBooleanFF('platform.editor.allow-extended-nested-expand') ? extendedNestedExpand : nestedExpand;
|
|
22
|
+
return [{
|
|
23
|
+
name: 'expand',
|
|
24
|
+
node: expand
|
|
25
|
+
}, {
|
|
26
|
+
name: 'nestedExpand',
|
|
27
|
+
node: nestedExpandNode
|
|
28
|
+
}];
|
|
29
|
+
},
|
|
30
|
+
actions: {
|
|
31
|
+
insertExpand: insertExpand(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)
|
|
32
|
+
},
|
|
33
|
+
pmPlugins() {
|
|
34
|
+
return [{
|
|
35
|
+
name: 'expand',
|
|
36
|
+
plugin: ({
|
|
37
|
+
dispatch,
|
|
38
|
+
getIntl
|
|
39
|
+
}) => {
|
|
40
|
+
var _options$allowInterac;
|
|
41
|
+
return createPlugin(dispatch, getIntl, options.appearance, options.useLongPressSelection, api, (_options$allowInterac = options.allowInteractiveExpand) !== null && _options$allowInterac !== void 0 ? _options$allowInterac : true, options.__livePage);
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
name: 'expandKeymap',
|
|
45
|
+
plugin: () => expandKeymap(api, {
|
|
46
|
+
__livePage: options.__livePage
|
|
47
|
+
})
|
|
48
|
+
}];
|
|
49
|
+
},
|
|
50
|
+
pluginsOptions: {
|
|
51
|
+
floatingToolbar: getToolbarConfig(api),
|
|
52
|
+
quickInsert: ({
|
|
53
|
+
formatMessage
|
|
54
|
+
}) => {
|
|
55
|
+
if (options && options.allowInsertion !== true) {
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
return [{
|
|
59
|
+
id: 'expand',
|
|
60
|
+
title: formatMessage(messages.expand),
|
|
61
|
+
description: formatMessage(messages.expandDescription),
|
|
62
|
+
keywords: ['accordion', 'collapse'],
|
|
63
|
+
priority: 600,
|
|
64
|
+
icon: () => /*#__PURE__*/React.createElement(IconExpand, null),
|
|
65
|
+
action(insert, state) {
|
|
66
|
+
var _api$analytics2;
|
|
67
|
+
const node = createExpandNode(state);
|
|
68
|
+
if (!node) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
const tr = state.selection.empty ? insert(node) : createWrapSelectionTransaction({
|
|
72
|
+
state,
|
|
73
|
+
type: node.type
|
|
74
|
+
});
|
|
75
|
+
api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.attachAnalyticsEvent({
|
|
76
|
+
action: ACTION.INSERTED,
|
|
77
|
+
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
78
|
+
actionSubjectId: node.type === state.schema.nodes.nestedExpand ? ACTION_SUBJECT_ID.NESTED_EXPAND : ACTION_SUBJECT_ID.EXPAND,
|
|
79
|
+
attributes: {
|
|
80
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
81
|
+
},
|
|
82
|
+
eventType: EVENT_TYPE.TRACK
|
|
83
|
+
})(tr);
|
|
84
|
+
return tr;
|
|
85
|
+
}
|
|
86
|
+
}];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
};
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -1,90 +1,19 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { expand, extendedNestedExpand, nestedExpand } from '@atlaskit/adf-schema';
|
|
3
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
-
import { IconExpand } from '@atlaskit/editor-common/quick-insert';
|
|
6
|
-
import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
|
|
7
1
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { createPlugin } from './pm-plugins/main';
|
|
11
|
-
import { getToolbarConfig } from './toolbar';
|
|
2
|
+
import { expandPlugin as legacyExpandPlugin } from './legacyExpand/plugin';
|
|
3
|
+
import { expandPlugin as singlePlayerExpandPlugin } from './singlePlayerExpand/plugin';
|
|
12
4
|
export const expandPlugin = ({
|
|
13
5
|
config: options = {},
|
|
14
6
|
api
|
|
15
7
|
}) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
actions: {
|
|
30
|
-
insertExpand: insertExpand(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)
|
|
31
|
-
},
|
|
32
|
-
pmPlugins() {
|
|
33
|
-
return [{
|
|
34
|
-
name: 'expand',
|
|
35
|
-
plugin: ({
|
|
36
|
-
dispatch,
|
|
37
|
-
getIntl
|
|
38
|
-
}) => {
|
|
39
|
-
var _options$allowInterac;
|
|
40
|
-
return createPlugin(dispatch, getIntl, options.appearance, options.useLongPressSelection, api, (_options$allowInterac = options.allowInteractiveExpand) !== null && _options$allowInterac !== void 0 ? _options$allowInterac : true, options.__livePage);
|
|
41
|
-
}
|
|
42
|
-
}, {
|
|
43
|
-
name: 'expandKeymap',
|
|
44
|
-
plugin: () => expandKeymap(api, {
|
|
45
|
-
__livePage: options.__livePage
|
|
46
|
-
})
|
|
47
|
-
}];
|
|
48
|
-
},
|
|
49
|
-
pluginsOptions: {
|
|
50
|
-
floatingToolbar: getToolbarConfig(api),
|
|
51
|
-
quickInsert: ({
|
|
52
|
-
formatMessage
|
|
53
|
-
}) => {
|
|
54
|
-
if (options && options.allowInsertion !== true) {
|
|
55
|
-
return [];
|
|
56
|
-
}
|
|
57
|
-
return [{
|
|
58
|
-
id: 'expand',
|
|
59
|
-
title: formatMessage(messages.expand),
|
|
60
|
-
description: formatMessage(messages.expandDescription),
|
|
61
|
-
keywords: ['accordion', 'collapse'],
|
|
62
|
-
priority: 600,
|
|
63
|
-
icon: () => /*#__PURE__*/React.createElement(IconExpand, null),
|
|
64
|
-
action(insert, state) {
|
|
65
|
-
var _api$analytics2;
|
|
66
|
-
const node = createExpandNode(state);
|
|
67
|
-
if (!node) {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
const tr = state.selection.empty ? insert(node) : createWrapSelectionTransaction({
|
|
71
|
-
state,
|
|
72
|
-
type: node.type
|
|
73
|
-
});
|
|
74
|
-
api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.attachAnalyticsEvent({
|
|
75
|
-
action: ACTION.INSERTED,
|
|
76
|
-
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
77
|
-
actionSubjectId: node.type === state.schema.nodes.nestedExpand ? ACTION_SUBJECT_ID.NESTED_EXPAND : ACTION_SUBJECT_ID.EXPAND,
|
|
78
|
-
attributes: {
|
|
79
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
80
|
-
},
|
|
81
|
-
eventType: EVENT_TYPE.TRACK
|
|
82
|
-
})(tr);
|
|
83
|
-
return tr;
|
|
84
|
-
}
|
|
85
|
-
}];
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
export { pluginKey } from './pm-plugins/plugin-factory';
|
|
8
|
+
if (getBooleanFF('platform.editor.single-player-expand') && options !== null && options !== void 0 && options.__livePage) {
|
|
9
|
+
return singlePlayerExpandPlugin({
|
|
10
|
+
config: options,
|
|
11
|
+
api
|
|
12
|
+
});
|
|
13
|
+
} else {
|
|
14
|
+
return legacyExpandPlugin({
|
|
15
|
+
config: options,
|
|
16
|
+
api
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { expand, extendedNestedExpand, nestedExpand } from '@atlaskit/adf-schema';
|
|
2
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
|
|
4
|
+
// TODO: https://product-fabric.atlassian.net/browse/ED-22840
|
|
5
|
+
// In ED-22840 make sure we update the ExpandPlugin type to use singlePlayerExpands own types
|
|
6
|
+
|
|
7
|
+
export const expandPlugin = () => {
|
|
8
|
+
return {
|
|
9
|
+
name: 'expand',
|
|
10
|
+
nodes() {
|
|
11
|
+
const nestedExpandNode = getBooleanFF('platform.editor.allow-extended-nested-expand') ? extendedNestedExpand : nestedExpand;
|
|
12
|
+
return [{
|
|
13
|
+
name: 'expand',
|
|
14
|
+
node: expand
|
|
15
|
+
}, {
|
|
16
|
+
name: 'nestedExpand',
|
|
17
|
+
node: nestedExpandNode
|
|
18
|
+
}];
|
|
19
|
+
},
|
|
20
|
+
actions: {
|
|
21
|
+
insertExpand: () => {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
pmPlugins() {
|
|
26
|
+
return [];
|
|
27
|
+
},
|
|
28
|
+
pluginsOptions: {}
|
|
29
|
+
};
|
|
30
|
+
};
|
package/dist/esm/index.js
CHANGED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { expand, extendedNestedExpand, nestedExpand } from '@atlaskit/adf-schema';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { IconExpand } from '@atlaskit/editor-common/quick-insert';
|
|
6
|
+
import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
|
|
7
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { createExpandNode, insertExpand } from './commands';
|
|
9
|
+
import { expandKeymap } from './pm-plugins/keymap';
|
|
10
|
+
import { createPlugin } from './pm-plugins/main';
|
|
11
|
+
import { getToolbarConfig } from './toolbar';
|
|
12
|
+
export { pluginKey } from './pm-plugins/plugin-factory';
|
|
13
|
+
export var expandPlugin = function expandPlugin(_ref) {
|
|
14
|
+
var _api$analytics;
|
|
15
|
+
var _ref$config = _ref.config,
|
|
16
|
+
options = _ref$config === void 0 ? {} : _ref$config,
|
|
17
|
+
api = _ref.api;
|
|
18
|
+
return {
|
|
19
|
+
name: 'expand',
|
|
20
|
+
nodes: function nodes() {
|
|
21
|
+
var nestedExpandNode = getBooleanFF('platform.editor.allow-extended-nested-expand') ? extendedNestedExpand : nestedExpand;
|
|
22
|
+
return [{
|
|
23
|
+
name: 'expand',
|
|
24
|
+
node: expand
|
|
25
|
+
}, {
|
|
26
|
+
name: 'nestedExpand',
|
|
27
|
+
node: nestedExpandNode
|
|
28
|
+
}];
|
|
29
|
+
},
|
|
30
|
+
actions: {
|
|
31
|
+
insertExpand: insertExpand(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)
|
|
32
|
+
},
|
|
33
|
+
pmPlugins: function pmPlugins() {
|
|
34
|
+
return [{
|
|
35
|
+
name: 'expand',
|
|
36
|
+
plugin: function plugin(_ref2) {
|
|
37
|
+
var _options$allowInterac;
|
|
38
|
+
var dispatch = _ref2.dispatch,
|
|
39
|
+
getIntl = _ref2.getIntl;
|
|
40
|
+
return createPlugin(dispatch, getIntl, options.appearance, options.useLongPressSelection, api, (_options$allowInterac = options.allowInteractiveExpand) !== null && _options$allowInterac !== void 0 ? _options$allowInterac : true, options.__livePage);
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
name: 'expandKeymap',
|
|
44
|
+
plugin: function plugin() {
|
|
45
|
+
return expandKeymap(api, {
|
|
46
|
+
__livePage: options.__livePage
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}];
|
|
50
|
+
},
|
|
51
|
+
pluginsOptions: {
|
|
52
|
+
floatingToolbar: getToolbarConfig(api),
|
|
53
|
+
quickInsert: function quickInsert(_ref3) {
|
|
54
|
+
var formatMessage = _ref3.formatMessage;
|
|
55
|
+
if (options && options.allowInsertion !== true) {
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
return [{
|
|
59
|
+
id: 'expand',
|
|
60
|
+
title: formatMessage(messages.expand),
|
|
61
|
+
description: formatMessage(messages.expandDescription),
|
|
62
|
+
keywords: ['accordion', 'collapse'],
|
|
63
|
+
priority: 600,
|
|
64
|
+
icon: function icon() {
|
|
65
|
+
return /*#__PURE__*/React.createElement(IconExpand, null);
|
|
66
|
+
},
|
|
67
|
+
action: function action(insert, state) {
|
|
68
|
+
var _api$analytics2;
|
|
69
|
+
var node = createExpandNode(state);
|
|
70
|
+
if (!node) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
var tr = state.selection.empty ? insert(node) : createWrapSelectionTransaction({
|
|
74
|
+
state: state,
|
|
75
|
+
type: node.type
|
|
76
|
+
});
|
|
77
|
+
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
|
|
78
|
+
action: ACTION.INSERTED,
|
|
79
|
+
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
80
|
+
actionSubjectId: node.type === state.schema.nodes.nestedExpand ? ACTION_SUBJECT_ID.NESTED_EXPAND : ACTION_SUBJECT_ID.EXPAND,
|
|
81
|
+
attributes: {
|
|
82
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
83
|
+
},
|
|
84
|
+
eventType: EVENT_TYPE.TRACK
|
|
85
|
+
})(tr);
|
|
86
|
+
return tr;
|
|
87
|
+
}
|
|
88
|
+
}];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
};
|
package/dist/esm/plugin.js
CHANGED
|
@@ -1,92 +1,19 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { expand, extendedNestedExpand, nestedExpand } from '@atlaskit/adf-schema';
|
|
3
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
-
import { IconExpand } from '@atlaskit/editor-common/quick-insert';
|
|
6
|
-
import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
|
|
7
1
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { createPlugin } from './pm-plugins/main';
|
|
11
|
-
import { getToolbarConfig } from './toolbar';
|
|
2
|
+
import { expandPlugin as legacyExpandPlugin } from './legacyExpand/plugin';
|
|
3
|
+
import { expandPlugin as singlePlayerExpandPlugin } from './singlePlayerExpand/plugin';
|
|
12
4
|
export var expandPlugin = function expandPlugin(_ref) {
|
|
13
|
-
var _api$analytics;
|
|
14
5
|
var _ref$config = _ref.config,
|
|
15
6
|
options = _ref$config === void 0 ? {} : _ref$config,
|
|
16
7
|
api = _ref.api;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
actions: {
|
|
30
|
-
insertExpand: insertExpand(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)
|
|
31
|
-
},
|
|
32
|
-
pmPlugins: function pmPlugins() {
|
|
33
|
-
return [{
|
|
34
|
-
name: 'expand',
|
|
35
|
-
plugin: function plugin(_ref2) {
|
|
36
|
-
var _options$allowInterac;
|
|
37
|
-
var dispatch = _ref2.dispatch,
|
|
38
|
-
getIntl = _ref2.getIntl;
|
|
39
|
-
return createPlugin(dispatch, getIntl, options.appearance, options.useLongPressSelection, api, (_options$allowInterac = options.allowInteractiveExpand) !== null && _options$allowInterac !== void 0 ? _options$allowInterac : true, options.__livePage);
|
|
40
|
-
}
|
|
41
|
-
}, {
|
|
42
|
-
name: 'expandKeymap',
|
|
43
|
-
plugin: function plugin() {
|
|
44
|
-
return expandKeymap(api, {
|
|
45
|
-
__livePage: options.__livePage
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}];
|
|
49
|
-
},
|
|
50
|
-
pluginsOptions: {
|
|
51
|
-
floatingToolbar: getToolbarConfig(api),
|
|
52
|
-
quickInsert: function quickInsert(_ref3) {
|
|
53
|
-
var formatMessage = _ref3.formatMessage;
|
|
54
|
-
if (options && options.allowInsertion !== true) {
|
|
55
|
-
return [];
|
|
56
|
-
}
|
|
57
|
-
return [{
|
|
58
|
-
id: 'expand',
|
|
59
|
-
title: formatMessage(messages.expand),
|
|
60
|
-
description: formatMessage(messages.expandDescription),
|
|
61
|
-
keywords: ['accordion', 'collapse'],
|
|
62
|
-
priority: 600,
|
|
63
|
-
icon: function icon() {
|
|
64
|
-
return /*#__PURE__*/React.createElement(IconExpand, null);
|
|
65
|
-
},
|
|
66
|
-
action: function action(insert, state) {
|
|
67
|
-
var _api$analytics2;
|
|
68
|
-
var node = createExpandNode(state);
|
|
69
|
-
if (!node) {
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
var tr = state.selection.empty ? insert(node) : createWrapSelectionTransaction({
|
|
73
|
-
state: state,
|
|
74
|
-
type: node.type
|
|
75
|
-
});
|
|
76
|
-
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
|
|
77
|
-
action: ACTION.INSERTED,
|
|
78
|
-
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
79
|
-
actionSubjectId: node.type === state.schema.nodes.nestedExpand ? ACTION_SUBJECT_ID.NESTED_EXPAND : ACTION_SUBJECT_ID.EXPAND,
|
|
80
|
-
attributes: {
|
|
81
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
82
|
-
},
|
|
83
|
-
eventType: EVENT_TYPE.TRACK
|
|
84
|
-
})(tr);
|
|
85
|
-
return tr;
|
|
86
|
-
}
|
|
87
|
-
}];
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
export { pluginKey } from './pm-plugins/plugin-factory';
|
|
8
|
+
if (getBooleanFF('platform.editor.single-player-expand') && options !== null && options !== void 0 && options.__livePage) {
|
|
9
|
+
return singlePlayerExpandPlugin({
|
|
10
|
+
config: options,
|
|
11
|
+
api: api
|
|
12
|
+
});
|
|
13
|
+
} else {
|
|
14
|
+
return legacyExpandPlugin({
|
|
15
|
+
config: options,
|
|
16
|
+
api: api
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { expand, extendedNestedExpand, nestedExpand } from '@atlaskit/adf-schema';
|
|
2
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
|
|
4
|
+
// TODO: https://product-fabric.atlassian.net/browse/ED-22840
|
|
5
|
+
// In ED-22840 make sure we update the ExpandPlugin type to use singlePlayerExpands own types
|
|
6
|
+
|
|
7
|
+
export var expandPlugin = function expandPlugin() {
|
|
8
|
+
return {
|
|
9
|
+
name: 'expand',
|
|
10
|
+
nodes: function nodes() {
|
|
11
|
+
var nestedExpandNode = getBooleanFF('platform.editor.allow-extended-nested-expand') ? extendedNestedExpand : nestedExpand;
|
|
12
|
+
return [{
|
|
13
|
+
name: 'expand',
|
|
14
|
+
node: expand
|
|
15
|
+
}, {
|
|
16
|
+
name: 'nestedExpand',
|
|
17
|
+
node: nestedExpandNode
|
|
18
|
+
}];
|
|
19
|
+
},
|
|
20
|
+
actions: {
|
|
21
|
+
insertExpand: function insertExpand() {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
pmPlugins: function pmPlugins() {
|
|
26
|
+
return [];
|
|
27
|
+
},
|
|
28
|
+
pluginsOptions: {}
|
|
29
|
+
};
|
|
30
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { ExpandPlugin, ExpandPluginState, ExpandPluginOptions, } from './types';
|
|
1
|
+
export type { ExpandPlugin, ExpandPluginState, ExpandPluginOptions, } from './legacyExpand/types';
|
|
2
2
|
export { expandPlugin } from './plugin';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { SetSelectionRelativeToNode } from '@atlaskit/editor-common/selection';
|
|
3
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { ExtractInjectionAPI, getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
5
4
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
5
|
import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
7
6
|
import type { ExpandPlugin } from '../types';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
export declare const pluginKey: PluginKey<any>;
|
|
3
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("../types").ExpandPluginState | ((state: import("prosemirror-state").EditorState) => import("../types").ExpandPluginState)) => import("prosemirror-state").SafeStateField<import("../types").ExpandPluginState>, createCommand: <A = import("../types").ExpandPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("../types").ExpandPluginState;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ExtractInjectionAPI, FloatingToolbarHandler } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { ExpandPlugin } from './
|
|
2
|
+
import type { ExpandPlugin } from './types';
|
|
3
3
|
export declare const getToolbarConfig: (api: ExtractInjectionAPI<ExpandPlugin> | undefined) => FloatingToolbarHandler;
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { ExpandPlugin, ExpandPluginState, ExpandPluginOptions, } from './types';
|
|
1
|
+
export type { ExpandPlugin, ExpandPluginState, ExpandPluginOptions, } from './legacyExpand/types';
|
|
2
2
|
export { expandPlugin } from './plugin';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { SetSelectionRelativeToNode } from '@atlaskit/editor-common/selection';
|
|
3
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { ExtractInjectionAPI, getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
5
4
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
5
|
import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
7
6
|
import type { ExpandPlugin } from '../types';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
export declare const pluginKey: PluginKey<any>;
|
|
3
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("../types").ExpandPluginState | ((state: import("prosemirror-state").EditorState) => import("../types").ExpandPluginState)) => import("prosemirror-state").SafeStateField<import("../types").ExpandPluginState>, createCommand: <A = import("../types").ExpandPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("../types").ExpandPluginState;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ExtractInjectionAPI, FloatingToolbarHandler } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { ExpandPlugin } from './
|
|
2
|
+
import type { ExpandPlugin } from './types';
|
|
3
3
|
export declare const getToolbarConfig: (api: ExtractInjectionAPI<ExpandPlugin> | undefined) => FloatingToolbarHandler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-expand",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Expand plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/adf-schema": "^35.8.0",
|
|
37
|
-
"@atlaskit/button": "^17.
|
|
38
|
-
"@atlaskit/editor-common": "^78.
|
|
37
|
+
"@atlaskit/button": "^17.11.0",
|
|
38
|
+
"@atlaskit/editor-common": "^78.23.0",
|
|
39
39
|
"@atlaskit/editor-plugin-analytics": "^1.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-decorations": "^1.0.0",
|
|
41
41
|
"@atlaskit/editor-plugin-selection": "^1.1.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/tooltip": "^18.1.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
49
49
|
"@emotion/react": "^11.7.1",
|
|
50
|
-
"w3c-keyname": "^2.1.
|
|
50
|
+
"w3c-keyname": "^2.1.8"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"react": "^16.8.0",
|
|
@@ -107,6 +107,9 @@
|
|
|
107
107
|
},
|
|
108
108
|
"platform.editor.live-pages-expand-divergence": {
|
|
109
109
|
"type": "boolean"
|
|
110
|
+
},
|
|
111
|
+
"platform.editor.single-player-expand": {
|
|
112
|
+
"type": "boolean"
|
|
110
113
|
}
|
|
111
114
|
}
|
|
112
115
|
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
export declare const pluginKey: PluginKey<any>;
|
|
3
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("..").ExpandPluginState | ((state: import("prosemirror-state").EditorState) => import("..").ExpandPluginState)) => import("prosemirror-state").SafeStateField<import("..").ExpandPluginState>, createCommand: <A = import("../types").ExpandPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("..").ExpandPluginState;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
export declare const pluginKey: PluginKey<any>;
|
|
3
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("..").ExpandPluginState | ((state: import("prosemirror-state").EditorState) => import("..").ExpandPluginState)) => import("prosemirror-state").SafeStateField<import("..").ExpandPluginState>, createCommand: <A = import("../types").ExpandPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("..").ExpandPluginState;
|
|
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
|
|
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
|
|
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
|