@atlaskit/editor-plugin-expand 9.0.0 → 9.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +17 -2
- package/dist/cjs/legacyExpand/commands.js +3 -1
- package/dist/cjs/legacyExpand/pm-plugins/plugin-factory.js +6 -4
- package/dist/cjs/singlePlayerExpand/plugin.js +2 -2
- package/dist/cjs/singlePlayerExpand/ui/ExpandButton.js +1 -1
- package/dist/es2019/legacyExpand/commands.js +3 -1
- package/dist/es2019/legacyExpand/pm-plugins/plugin-factory.js +5 -5
- package/dist/es2019/singlePlayerExpand/plugin.js +2 -2
- package/dist/es2019/singlePlayerExpand/ui/ExpandButton.js +1 -1
- package/dist/esm/legacyExpand/commands.js +3 -1
- package/dist/esm/legacyExpand/pm-plugins/plugin-factory.js +5 -5
- package/dist/esm/singlePlayerExpand/plugin.js +2 -2
- package/dist/esm/singlePlayerExpand/ui/ExpandButton.js +1 -1
- package/dist/types/legacyExpand/pm-plugins/main.d.ts +2 -2
- package/dist/types/legacyExpand/pm-plugins/plugin-factory.d.ts +8 -3
- package/dist/types/singlePlayerExpand/commands.d.ts +2 -2
- package/dist/types/singlePlayerExpand/pm-plugins/main.d.ts +2 -2
- package/dist/types/types.d.ts +1 -1
- package/dist/types-ts4.5/legacyExpand/pm-plugins/main.d.ts +2 -2
- package/dist/types-ts4.5/legacyExpand/pm-plugins/plugin-factory.d.ts +8 -3
- package/dist/types-ts4.5/singlePlayerExpand/commands.d.ts +2 -2
- package/dist/types-ts4.5/singlePlayerExpand/pm-plugins/main.d.ts +2 -2
- package/dist/types-ts4.5/types.d.ts +1 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-expand
|
|
2
2
|
|
|
3
|
+
## 9.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5985f38f7104e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5985f38f7104e) -
|
|
8
|
+
Update README.md and 0-intro.tsx
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 9.0.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 9.0.0
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
|
-
# Editor
|
|
1
|
+
# Editor Plugin Expand
|
|
2
2
|
|
|
3
3
|
Expand plugin for @atlaskit/editor-core
|
|
4
4
|
|
|
5
5
|
**Note:** This component is designed for internal Atlassian development.
|
|
6
6
|
External contributors will be able to use this component but will not be able to submit issues.
|
|
7
7
|
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
The Expand plugin provides collapsible/expandable content sections for the Atlassian Editor. It supports both standard expand nodes and nested expand nodes, enabling users to organize and structure content with accordion-like functionality.
|
|
11
|
+
|
|
12
|
+
## Key features
|
|
13
|
+
|
|
14
|
+
- **Expand and nested expand nodes** - Support for both top-level expand and nested expand content structures
|
|
15
|
+
- **Interactive expand/collapse** - Toggle expand nodes open or closed with configurable interactive behavior
|
|
16
|
+
- **Quick insert integration** - Insert expand nodes via quick insert menu with keywords like 'accordion' and 'collapse'
|
|
17
|
+
- **Range toggle commands** - Programmatically expand or collapse multiple expand nodes across a document range
|
|
18
|
+
- **Floating toolbar** - Context-aware toolbar for expand node manipulation
|
|
19
|
+
- **Keyboard shortcuts** - Keymap support for efficient expand node navigation and manipulation
|
|
20
|
+
- **Configurable insertion** - Control expand node insertion permissions via plugin options
|
|
21
|
+
- **Live Page support** - Special handling for Confluence Live Page editor with divergent behavior
|
|
22
|
+
|
|
8
23
|
## Install
|
|
9
24
|
---
|
|
10
25
|
- **Install** - *yarn add @atlaskit/editor-plugin-expand*
|
|
@@ -27,4 +42,4 @@ Please see [Atlaskit - Editor plugin expand](https://atlaskit.atlassian.com/pack
|
|
|
27
42
|
For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
|
|
28
43
|
## License
|
|
29
44
|
---
|
|
30
|
-
Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#
|
|
45
|
+
Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#License) for more licensing information.
|
|
@@ -15,6 +15,7 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
15
15
|
var _state2 = require("@atlaskit/editor-prosemirror/state");
|
|
16
16
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
17
17
|
var _utils3 = require("@atlaskit/editor-tables/utils");
|
|
18
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
19
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
19
20
|
var _utils4 = require("../utils");
|
|
20
21
|
var _pluginFactory = require("./pm-plugins/plugin-factory");
|
|
@@ -163,12 +164,13 @@ var insertExpandWithInputMethod = exports.insertExpandWithInputMethod = function
|
|
|
163
164
|
state: state,
|
|
164
165
|
type: expandNode.type
|
|
165
166
|
});
|
|
167
|
+
var resolvedInputMethod = (0, _platformFeatureFlags.fg)('platform_editor_element_browser_analytic') ? inputMethod : _analytics.INPUT_METHOD.QUICK_INSERT;
|
|
166
168
|
var payload = {
|
|
167
169
|
action: _analytics.ACTION.INSERTED,
|
|
168
170
|
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
169
171
|
actionSubjectId: (expandNode === null || expandNode === void 0 ? void 0 : expandNode.type) === state.schema.nodes.expand ? _analytics.ACTION_SUBJECT_ID.EXPAND : _analytics.ACTION_SUBJECT_ID.NESTED_EXPAND,
|
|
170
172
|
attributes: {
|
|
171
|
-
inputMethod:
|
|
173
|
+
inputMethod: resolvedInputMethod
|
|
172
174
|
},
|
|
173
175
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
174
176
|
};
|
|
@@ -8,8 +8,10 @@ exports.pluginKey = exports.getPluginState = exports.createPluginState = exports
|
|
|
8
8
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
9
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
10
|
var _reducer = _interopRequireDefault(require("../reducer"));
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
12
|
+
|
|
11
13
|
var pluginKey = exports.pluginKey = new _state.PluginKey('expandPlugin');
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
var dest = (0, _utils.pluginFactory)(pluginKey, _reducer.default);
|
|
15
|
+
var createPluginState = exports.createPluginState = dest.createPluginState;
|
|
16
|
+
var createCommand = exports.createCommand = dest.createCommand;
|
|
17
|
+
var getPluginState = exports.getPluginState = dest.getPluginState;
|
|
@@ -105,7 +105,7 @@ var expandPlugin = exports.expandPlugin = function expandPlugin(_ref) {
|
|
|
105
105
|
icon: function icon() {
|
|
106
106
|
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconExpand, null);
|
|
107
107
|
},
|
|
108
|
-
action: function action(insert, state) {
|
|
108
|
+
action: function action(insert, state, source) {
|
|
109
109
|
var _api$analytics;
|
|
110
110
|
var node = (0, _commands.createExpandNode)(state, undefined, !!(api !== null && api !== void 0 && api.localId));
|
|
111
111
|
if (!node) {
|
|
@@ -120,7 +120,7 @@ var expandPlugin = exports.expandPlugin = function expandPlugin(_ref) {
|
|
|
120
120
|
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
121
121
|
actionSubjectId: node.type === state.schema.nodes.nestedExpand ? _analytics.ACTION_SUBJECT_ID.NESTED_EXPAND : _analytics.ACTION_SUBJECT_ID.EXPAND,
|
|
122
122
|
attributes: {
|
|
123
|
-
inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
|
|
123
|
+
inputMethod: source !== null && source !== void 0 ? source : _analytics.INPUT_METHOD.QUICK_INSERT
|
|
124
124
|
},
|
|
125
125
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
126
126
|
})(tr);
|
|
@@ -22,7 +22,7 @@ var _excluded = ["buttonStyles"];
|
|
|
22
22
|
* @jsxRuntime classic
|
|
23
23
|
* @jsx jsx
|
|
24
24
|
*/
|
|
25
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
26
26
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
27
27
|
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; }
|
|
28
28
|
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; }
|
|
@@ -7,6 +7,7 @@ import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
|
|
|
7
7
|
import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
8
8
|
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
9
9
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
12
|
import { isNestedInExpand } from '../utils';
|
|
12
13
|
import { createCommand } from './pm-plugins/plugin-factory';
|
|
@@ -150,12 +151,13 @@ export const insertExpandWithInputMethod = editorAnalyticsAPI => inputMethod =>
|
|
|
150
151
|
state,
|
|
151
152
|
type: expandNode.type
|
|
152
153
|
});
|
|
154
|
+
const resolvedInputMethod = fg('platform_editor_element_browser_analytic') ? inputMethod : INPUT_METHOD.QUICK_INSERT;
|
|
153
155
|
const payload = {
|
|
154
156
|
action: ACTION.INSERTED,
|
|
155
157
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
156
158
|
actionSubjectId: (expandNode === null || expandNode === void 0 ? void 0 : expandNode.type) === state.schema.nodes.expand ? ACTION_SUBJECT_ID.EXPAND : ACTION_SUBJECT_ID.NESTED_EXPAND,
|
|
157
159
|
attributes: {
|
|
158
|
-
inputMethod
|
|
160
|
+
inputMethod: resolvedInputMethod
|
|
159
161
|
},
|
|
160
162
|
eventType: EVENT_TYPE.TRACK
|
|
161
163
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
2
3
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
import reducer from '../reducer';
|
|
4
5
|
export const pluginKey = new PluginKey('expandPlugin');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} = pluginFactory(pluginKey, reducer);
|
|
6
|
+
const dest = pluginFactory(pluginKey, reducer);
|
|
7
|
+
export const createPluginState = dest.createPluginState;
|
|
8
|
+
export const createCommand = dest.createCommand;
|
|
9
|
+
export const getPluginState = dest.getPluginState;
|
|
@@ -95,7 +95,7 @@ export let expandPlugin = ({
|
|
|
95
95
|
keywords: ['accordion', 'collapse'],
|
|
96
96
|
priority: 600,
|
|
97
97
|
icon: () => /*#__PURE__*/React.createElement(IconExpand, null),
|
|
98
|
-
action(insert, state) {
|
|
98
|
+
action(insert, state, source) {
|
|
99
99
|
var _api$analytics;
|
|
100
100
|
const node = createExpandNode(state, undefined, !!(api !== null && api !== void 0 && api.localId));
|
|
101
101
|
if (!node) {
|
|
@@ -110,7 +110,7 @@ export let expandPlugin = ({
|
|
|
110
110
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
111
111
|
actionSubjectId: node.type === state.schema.nodes.nestedExpand ? ACTION_SUBJECT_ID.NESTED_EXPAND : ACTION_SUBJECT_ID.EXPAND,
|
|
112
112
|
attributes: {
|
|
113
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
113
|
+
inputMethod: source !== null && source !== void 0 ? source : INPUT_METHOD.QUICK_INSERT
|
|
114
114
|
},
|
|
115
115
|
eventType: EVENT_TYPE.TRACK
|
|
116
116
|
})(tr);
|
|
@@ -5,7 +5,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
5
5
|
*/
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
10
10
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
11
11
|
import { expandClassNames } from '@atlaskit/editor-common/styles';
|
|
@@ -10,6 +10,7 @@ import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
|
|
|
10
10
|
import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
12
12
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
14
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
15
|
import { isNestedInExpand } from '../utils';
|
|
15
16
|
import { createCommand } from './pm-plugins/plugin-factory';
|
|
@@ -156,12 +157,13 @@ export var insertExpandWithInputMethod = function insertExpandWithInputMethod(ed
|
|
|
156
157
|
state: state,
|
|
157
158
|
type: expandNode.type
|
|
158
159
|
});
|
|
160
|
+
var resolvedInputMethod = fg('platform_editor_element_browser_analytic') ? inputMethod : INPUT_METHOD.QUICK_INSERT;
|
|
159
161
|
var payload = {
|
|
160
162
|
action: ACTION.INSERTED,
|
|
161
163
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
162
164
|
actionSubjectId: (expandNode === null || expandNode === void 0 ? void 0 : expandNode.type) === state.schema.nodes.expand ? ACTION_SUBJECT_ID.EXPAND : ACTION_SUBJECT_ID.NESTED_EXPAND,
|
|
163
165
|
attributes: {
|
|
164
|
-
inputMethod:
|
|
166
|
+
inputMethod: resolvedInputMethod
|
|
165
167
|
},
|
|
166
168
|
eventType: EVENT_TYPE.TRACK
|
|
167
169
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
2
3
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
import reducer from '../reducer';
|
|
4
5
|
export var pluginKey = new PluginKey('expandPlugin');
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export { createPluginState, createCommand, getPluginState };
|
|
6
|
+
var dest = pluginFactory(pluginKey, reducer);
|
|
7
|
+
export var createPluginState = dest.createPluginState;
|
|
8
|
+
export var createCommand = dest.createCommand;
|
|
9
|
+
export var getPluginState = dest.getPluginState;
|
|
@@ -99,7 +99,7 @@ export var expandPlugin = function expandPlugin(_ref) {
|
|
|
99
99
|
icon: function icon() {
|
|
100
100
|
return /*#__PURE__*/React.createElement(IconExpand, null);
|
|
101
101
|
},
|
|
102
|
-
action: function action(insert, state) {
|
|
102
|
+
action: function action(insert, state, source) {
|
|
103
103
|
var _api$analytics;
|
|
104
104
|
var node = createExpandNode(state, undefined, !!(api !== null && api !== void 0 && api.localId));
|
|
105
105
|
if (!node) {
|
|
@@ -114,7 +114,7 @@ export var expandPlugin = function expandPlugin(_ref) {
|
|
|
114
114
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
115
115
|
actionSubjectId: node.type === state.schema.nodes.nestedExpand ? ACTION_SUBJECT_ID.NESTED_EXPAND : ACTION_SUBJECT_ID.EXPAND,
|
|
116
116
|
attributes: {
|
|
117
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
117
|
+
inputMethod: source !== null && source !== void 0 ? source : INPUT_METHOD.QUICK_INSERT
|
|
118
118
|
},
|
|
119
119
|
eventType: EVENT_TYPE.TRACK
|
|
120
120
|
})(tr);
|
|
@@ -10,7 +10,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
10
10
|
*/
|
|
11
11
|
import React, { useCallback } from 'react';
|
|
12
12
|
|
|
13
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
13
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
14
14
|
import { jsx } from '@emotion/react';
|
|
15
15
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
16
16
|
import { expandClassNames } from '@atlaskit/editor-common/styles';
|
|
@@ -5,9 +5,9 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
5
5
|
import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
6
|
import { type Slice } from '@atlaskit/editor-prosemirror/model';
|
|
7
7
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import type { ExpandPlugin } from '../../types';
|
|
8
|
+
import type { ExpandPlugin, ExpandPluginState } from '../../types';
|
|
9
9
|
export declare function containsClass(element: Element | null, className: string): boolean;
|
|
10
|
-
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, allowInteractiveExpand?: boolean, __livePage?: boolean) => SafePlugin<
|
|
10
|
+
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, allowInteractiveExpand?: boolean, __livePage?: boolean) => SafePlugin<ExpandPluginState>;
|
|
11
11
|
/**
|
|
12
12
|
* Convert a nested expand to an expand when dropped outside an expand or table. Convert an expand to a nested expand when dropped inside an expand or table.
|
|
13
13
|
*/
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
import { EditorState, PluginKey, Transaction, type SafeStateField } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { ExpandPluginState, ExpandPluginAction } from '../../types';
|
|
5
|
+
export declare const pluginKey: PluginKey;
|
|
6
|
+
export declare const createPluginState: (dispatch: Dispatch, initialState: ExpandPluginState | ((state: EditorState) => ExpandPluginState)) => SafeStateField<ExpandPluginState>;
|
|
7
|
+
export declare const createCommand: <A = ExpandPluginAction>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
8
|
+
export declare const getPluginState: (state: EditorState) => ExpandPluginState;
|
|
@@ -2,7 +2,7 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
2
2
|
import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { NodeType, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import type { ExpandPlugin, InsertMethod } from '../types';
|
|
8
8
|
export declare const createExpandNode: (state: EditorState, setExpandedState?: boolean, addLocalId?: boolean) => PMNode | null;
|
|
@@ -10,7 +10,7 @@ export declare const createExpandNode: (state: EditorState, setExpandedState?: b
|
|
|
10
10
|
* When cleaning up platform_editor_adf_with_localid we can reuse this function
|
|
11
11
|
* in insertExpandWithInputMethod.
|
|
12
12
|
*/
|
|
13
|
-
export declare const wrapSelectionAndSetExpandedState: (state: EditorState, node: PMNode) =>
|
|
13
|
+
export declare const wrapSelectionAndSetExpandedState: (state: EditorState, node: PMNode) => Transaction;
|
|
14
14
|
export declare const insertExpandWithInputMethod: (api: ExtractInjectionAPI<ExpandPlugin> | undefined) => (inputMethod: InsertMethod) => Command;
|
|
15
15
|
export declare const insertExpand: (api: ExtractInjectionAPI<ExpandPlugin> | undefined) => Command;
|
|
16
16
|
export declare const deleteExpand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -7,9 +7,9 @@ import { type Slice } from '@atlaskit/editor-prosemirror/model';
|
|
|
7
7
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
8
8
|
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
9
|
import type { ExpandPlugin } from '../../types';
|
|
10
|
-
export declare const pluginKey: PluginKey
|
|
10
|
+
export declare const pluginKey: PluginKey;
|
|
11
11
|
export declare function containsClass(element: Element | null, className: string): boolean;
|
|
12
|
-
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, allowInteractiveExpand?: boolean, __livePage?: boolean) => SafePlugin
|
|
12
|
+
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, allowInteractiveExpand?: boolean, __livePage?: boolean) => SafePlugin;
|
|
13
13
|
/**
|
|
14
14
|
* Convert a nested expand to an expand when dropped outside an expand or table. Convert an expand to a nested expand when dropped inside an expand or table.
|
|
15
15
|
*/
|
package/dist/types/types.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export type ExpandPluginAction = {
|
|
|
23
23
|
export type ExpandPluginSharedState = {
|
|
24
24
|
allowInsertion?: boolean;
|
|
25
25
|
} | undefined;
|
|
26
|
-
export type InsertMethod = INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.INSERT_MENU;
|
|
26
|
+
export type InsertMethod = INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.ELEMENT_BROWSER | INPUT_METHOD.TOOLBAR;
|
|
27
27
|
export interface ExpandPluginOptions extends LongPressSelectionPluginOptions {
|
|
28
28
|
/**
|
|
29
29
|
* There is expected to be temporary divergence between Live Page editor expand behaviour and the standard expand behaviour.
|
|
@@ -5,9 +5,9 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
5
5
|
import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
6
|
import { type Slice } from '@atlaskit/editor-prosemirror/model';
|
|
7
7
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import type { ExpandPlugin } from '../../types';
|
|
8
|
+
import type { ExpandPlugin, ExpandPluginState } from '../../types';
|
|
9
9
|
export declare function containsClass(element: Element | null, className: string): boolean;
|
|
10
|
-
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, allowInteractiveExpand?: boolean, __livePage?: boolean) => SafePlugin<
|
|
10
|
+
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, allowInteractiveExpand?: boolean, __livePage?: boolean) => SafePlugin<ExpandPluginState>;
|
|
11
11
|
/**
|
|
12
12
|
* Convert a nested expand to an expand when dropped outside an expand or table. Convert an expand to a nested expand when dropped inside an expand or table.
|
|
13
13
|
*/
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
import { EditorState, PluginKey, Transaction, type SafeStateField } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { ExpandPluginState, ExpandPluginAction } from '../../types';
|
|
5
|
+
export declare const pluginKey: PluginKey;
|
|
6
|
+
export declare const createPluginState: (dispatch: Dispatch, initialState: ExpandPluginState | ((state: EditorState) => ExpandPluginState)) => SafeStateField<ExpandPluginState>;
|
|
7
|
+
export declare const createCommand: <A = ExpandPluginAction>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
8
|
+
export declare const getPluginState: (state: EditorState) => ExpandPluginState;
|
|
@@ -2,7 +2,7 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
2
2
|
import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { NodeType, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import type { ExpandPlugin, InsertMethod } from '../types';
|
|
8
8
|
export declare const createExpandNode: (state: EditorState, setExpandedState?: boolean, addLocalId?: boolean) => PMNode | null;
|
|
@@ -10,7 +10,7 @@ export declare const createExpandNode: (state: EditorState, setExpandedState?: b
|
|
|
10
10
|
* When cleaning up platform_editor_adf_with_localid we can reuse this function
|
|
11
11
|
* in insertExpandWithInputMethod.
|
|
12
12
|
*/
|
|
13
|
-
export declare const wrapSelectionAndSetExpandedState: (state: EditorState, node: PMNode) =>
|
|
13
|
+
export declare const wrapSelectionAndSetExpandedState: (state: EditorState, node: PMNode) => Transaction;
|
|
14
14
|
export declare const insertExpandWithInputMethod: (api: ExtractInjectionAPI<ExpandPlugin> | undefined) => (inputMethod: InsertMethod) => Command;
|
|
15
15
|
export declare const insertExpand: (api: ExtractInjectionAPI<ExpandPlugin> | undefined) => Command;
|
|
16
16
|
export declare const deleteExpand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -7,9 +7,9 @@ import { type Slice } from '@atlaskit/editor-prosemirror/model';
|
|
|
7
7
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
8
8
|
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
9
|
import type { ExpandPlugin } from '../../types';
|
|
10
|
-
export declare const pluginKey: PluginKey
|
|
10
|
+
export declare const pluginKey: PluginKey;
|
|
11
11
|
export declare function containsClass(element: Element | null, className: string): boolean;
|
|
12
|
-
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, allowInteractiveExpand?: boolean, __livePage?: boolean) => SafePlugin
|
|
12
|
+
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, allowInteractiveExpand?: boolean, __livePage?: boolean) => SafePlugin;
|
|
13
13
|
/**
|
|
14
14
|
* Convert a nested expand to an expand when dropped outside an expand or table. Convert an expand to a nested expand when dropped inside an expand or table.
|
|
15
15
|
*/
|
|
@@ -23,7 +23,7 @@ export type ExpandPluginAction = {
|
|
|
23
23
|
export type ExpandPluginSharedState = {
|
|
24
24
|
allowInsertion?: boolean;
|
|
25
25
|
} | undefined;
|
|
26
|
-
export type InsertMethod = INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.INSERT_MENU;
|
|
26
|
+
export type InsertMethod = INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.ELEMENT_BROWSER | INPUT_METHOD.TOOLBAR;
|
|
27
27
|
export interface ExpandPluginOptions extends LongPressSelectionPluginOptions {
|
|
28
28
|
/**
|
|
29
29
|
* There is expected to be temporary divergence between Live Page editor expand behaviour and the standard expand behaviour.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-expand",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.2",
|
|
4
4
|
"description": "Expand plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/icon-lab": "^5.17.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
49
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
50
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^36.3.0",
|
|
51
51
|
"@atlaskit/tokens": "^11.1.0",
|
|
52
52
|
"@atlaskit/tooltip": "^20.14.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"w3c-keyname": "^2.1.8"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@atlaskit/editor-common": "^112.
|
|
59
|
+
"@atlaskit/editor-common": "^112.2.0",
|
|
60
60
|
"react": "^18.2.0",
|
|
61
61
|
"react-dom": "^18.2.0",
|
|
62
62
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -99,6 +99,9 @@
|
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
"platform-feature-flags": {
|
|
102
|
+
"platform_editor_element_browser_analytic": {
|
|
103
|
+
"type": "boolean"
|
|
104
|
+
},
|
|
102
105
|
"platform_editor_adf_with_localid": {
|
|
103
106
|
"type": "boolean"
|
|
104
107
|
},
|