@atlaskit/editor-plugin-extension 0.6.1 → 0.6.3

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/editor-plugin-extension
2
2
 
3
+ ## 0.6.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#68264](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68264) [`daa71f6aa162`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/daa71f6aa162) - [ux] ED-21883: Updated MultiBodied Extension related CSS and selections
8
+ - Updated dependencies
9
+
10
+ ## 0.6.2
11
+
12
+ ### Patch Changes
13
+
14
+ - [#68501](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68501) [`c813e900fdde`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c813e900fdde) - ED-21735: Added extension config panel support for MBE
15
+
3
16
  ## 0.6.1
4
17
 
5
18
  ### Patch Changes
@@ -31,6 +31,8 @@ var buildExtensionNode = exports.buildExtensionNode = function buildExtensionNod
31
31
  return schema.nodes.inlineExtension.createChecked(attrs, content, marks);
32
32
  case 'bodiedExtension':
33
33
  return schema.nodes.bodiedExtension.create(attrs, content, marks);
34
+ case 'multiBodiedExtension':
35
+ return schema.nodes.multiBodiedExtension.create(attrs, content, marks);
34
36
  }
35
37
  };
36
38
  var performNodeUpdate = exports.performNodeUpdate = function performNodeUpdate(editorAnalyticsAPI) {
@@ -52,7 +54,8 @@ var performNodeUpdate = exports.performNodeUpdate = function performNodeUpdate(e
52
54
  var _schema$nodes = schema.nodes,
53
55
  extension = _schema$nodes.extension,
54
56
  inlineExtension = _schema$nodes.inlineExtension,
55
- bodiedExtension = _schema$nodes.bodiedExtension;
57
+ bodiedExtension = _schema$nodes.bodiedExtension,
58
+ multiBodiedExtension = _schema$nodes.multiBodiedExtension;
56
59
  var isBodiedExtensionSelected = !!(0, _utils.findSelectedNodeOfType)([bodiedExtension])(selection);
57
60
  var extensionState = (0, _main.getPluginState)(state);
58
61
  var targetSelectionSource = _analytics.TARGET_SELECTION_SOURCE.CURRENT_SELECTION;
@@ -68,7 +71,7 @@ var performNodeUpdate = exports.performNodeUpdate = function performNodeUpdate(e
68
71
  tr.setSelection(_state2.TextSelection.create(tr.doc, state.selection.anchor));
69
72
  }
70
73
  // If any extension is currently selected
71
- else if ((0, _utils.findSelectedNodeOfType)([extension, bodiedExtension, inlineExtension])(selection)) {
74
+ else if ((0, _utils.findSelectedNodeOfType)([extension, bodiedExtension, inlineExtension, multiBodiedExtension])(selection)) {
72
75
  tr = (0, _utils.replaceSelectedNode)(newNode)(tr);
73
76
  // Replacing selected node doesn't update the selection. `selection.node` still returns the old node
74
77
  tr.setSelection(_state2.NodeSelection.create(tr.doc, tr.mapping.map(state.selection.anchor)));
@@ -313,7 +313,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
313
313
  inlineExtension: (0, _extensibility.ExtensionNodeView)(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi),
314
314
  multiBodiedExtension: (0, _extensibility.ExtensionNodeView)(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi)
315
315
  },
316
- handleClickOn: (0, _selection.createSelectionClickHandler)(['extension', 'bodiedExtension'], function (target) {
316
+ handleClickOn: (0, _selection.createSelectionClickHandler)(['extension', 'bodiedExtension', 'multiBodiedExtension'], function (target) {
317
317
  return !target.closest('.extension-content');
318
318
  }, {
319
319
  useLongPressSelection: useLongPressSelection
@@ -186,8 +186,12 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
186
186
  *
187
187
  */
188
188
  var frameheight = mbeFrameRect.height > 0 ? mbeFrameRect.height : 102;
189
+ // MBE wrapper header height includes, top margin 8px + bottom margin 8px + Line height of 16px + padding top 8px
190
+ // Ref: platform/packages/editor/editor-common/src/extensibility/MultiBodiedExtension/styles.ts
191
+ var wrapperHeaderHeight = 40;
192
+ var toolbarTopPos = mbeNodeRect.top + frameheight + wrapperHeaderHeight + scrollWrapper.scrollTop;
189
193
  return {
190
- top: mbeNodeRect.top + frameheight + scrollWrapper.scrollTop,
194
+ top: toolbarTopPos,
191
195
  left: nextPos.left
192
196
  };
193
197
  },
@@ -13,6 +13,8 @@ export const buildExtensionNode = (type, schema, attrs, content, marks) => {
13
13
  return schema.nodes.inlineExtension.createChecked(attrs, content, marks);
14
14
  case 'bodiedExtension':
15
15
  return schema.nodes.bodiedExtension.create(attrs, content, marks);
16
+ case 'multiBodiedExtension':
17
+ return schema.nodes.multiBodiedExtension.create(attrs, content, marks);
16
18
  }
17
19
  };
18
20
  export const performNodeUpdate = editorAnalyticsAPI => (type, newAttrs, content, marks, shouldScrollIntoView) => (_state, _dispatch, view) => {
@@ -36,7 +38,8 @@ export const performNodeUpdate = editorAnalyticsAPI => (type, newAttrs, content,
36
38
  const {
37
39
  extension,
38
40
  inlineExtension,
39
- bodiedExtension
41
+ bodiedExtension,
42
+ multiBodiedExtension
40
43
  } = schema.nodes;
41
44
  const isBodiedExtensionSelected = !!findSelectedNodeOfType([bodiedExtension])(selection);
42
45
  const extensionState = getPluginState(state);
@@ -55,7 +58,7 @@ export const performNodeUpdate = editorAnalyticsAPI => (type, newAttrs, content,
55
58
  tr.setSelection(TextSelection.create(tr.doc, state.selection.anchor));
56
59
  }
57
60
  // If any extension is currently selected
58
- else if (findSelectedNodeOfType([extension, bodiedExtension, inlineExtension])(selection)) {
61
+ else if (findSelectedNodeOfType([extension, bodiedExtension, inlineExtension, multiBodiedExtension])(selection)) {
59
62
  tr = replaceSelectedNode(newNode)(tr);
60
63
  // Replacing selected node doesn't update the selection. `selection.node` still returns the old node
61
64
  tr.setSelection(NodeSelection.create(tr.doc, tr.mapping.map(state.selection.anchor)));
@@ -221,7 +221,7 @@ const createPlugin = (dispatch, providerFactory, extensionHandlers, portalProvid
221
221
  inlineExtension: ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi),
222
222
  multiBodiedExtension: ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi)
223
223
  },
224
- handleClickOn: createSelectionClickHandler(['extension', 'bodiedExtension'], target => !target.closest('.extension-content'), {
224
+ handleClickOn: createSelectionClickHandler(['extension', 'bodiedExtension', 'multiBodiedExtension'], target => !target.closest('.extension-content'), {
225
225
  useLongPressSelection
226
226
  })
227
227
  }
@@ -183,8 +183,12 @@ export const getToolbarConfig = ({
183
183
  *
184
184
  */
185
185
  const frameheight = mbeFrameRect.height > 0 ? mbeFrameRect.height : 102;
186
+ // MBE wrapper header height includes, top margin 8px + bottom margin 8px + Line height of 16px + padding top 8px
187
+ // Ref: platform/packages/editor/editor-common/src/extensibility/MultiBodiedExtension/styles.ts
188
+ const wrapperHeaderHeight = 40;
189
+ const toolbarTopPos = mbeNodeRect.top + frameheight + wrapperHeaderHeight + scrollWrapper.scrollTop;
186
190
  return {
187
- top: mbeNodeRect.top + frameheight + scrollWrapper.scrollTop,
191
+ top: toolbarTopPos,
188
192
  left: nextPos.left
189
193
  };
190
194
  },
@@ -18,6 +18,8 @@ export var buildExtensionNode = function buildExtensionNode(type, schema, attrs,
18
18
  return schema.nodes.inlineExtension.createChecked(attrs, content, marks);
19
19
  case 'bodiedExtension':
20
20
  return schema.nodes.bodiedExtension.create(attrs, content, marks);
21
+ case 'multiBodiedExtension':
22
+ return schema.nodes.multiBodiedExtension.create(attrs, content, marks);
21
23
  }
22
24
  };
23
25
  export var performNodeUpdate = function performNodeUpdate(editorAnalyticsAPI) {
@@ -39,7 +41,8 @@ export var performNodeUpdate = function performNodeUpdate(editorAnalyticsAPI) {
39
41
  var _schema$nodes = schema.nodes,
40
42
  extension = _schema$nodes.extension,
41
43
  inlineExtension = _schema$nodes.inlineExtension,
42
- bodiedExtension = _schema$nodes.bodiedExtension;
44
+ bodiedExtension = _schema$nodes.bodiedExtension,
45
+ multiBodiedExtension = _schema$nodes.multiBodiedExtension;
43
46
  var isBodiedExtensionSelected = !!findSelectedNodeOfType([bodiedExtension])(selection);
44
47
  var extensionState = getPluginState(state);
45
48
  var targetSelectionSource = TARGET_SELECTION_SOURCE.CURRENT_SELECTION;
@@ -55,7 +58,7 @@ export var performNodeUpdate = function performNodeUpdate(editorAnalyticsAPI) {
55
58
  tr.setSelection(TextSelection.create(tr.doc, state.selection.anchor));
56
59
  }
57
60
  // If any extension is currently selected
58
- else if (findSelectedNodeOfType([extension, bodiedExtension, inlineExtension])(selection)) {
61
+ else if (findSelectedNodeOfType([extension, bodiedExtension, inlineExtension, multiBodiedExtension])(selection)) {
59
62
  tr = replaceSelectedNode(newNode)(tr);
60
63
  // Replacing selected node doesn't update the selection. `selection.node` still returns the old node
61
64
  tr.setSelection(NodeSelection.create(tr.doc, tr.mapping.map(state.selection.anchor)));
@@ -287,7 +287,7 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
287
287
  inlineExtension: ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi),
288
288
  multiBodiedExtension: ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi)
289
289
  },
290
- handleClickOn: createSelectionClickHandler(['extension', 'bodiedExtension'], function (target) {
290
+ handleClickOn: createSelectionClickHandler(['extension', 'bodiedExtension', 'multiBodiedExtension'], function (target) {
291
291
  return !target.closest('.extension-content');
292
292
  }, {
293
293
  useLongPressSelection: useLongPressSelection
@@ -179,8 +179,12 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
179
179
  *
180
180
  */
181
181
  var frameheight = mbeFrameRect.height > 0 ? mbeFrameRect.height : 102;
182
+ // MBE wrapper header height includes, top margin 8px + bottom margin 8px + Line height of 16px + padding top 8px
183
+ // Ref: platform/packages/editor/editor-common/src/extensibility/MultiBodiedExtension/styles.ts
184
+ var wrapperHeaderHeight = 40;
185
+ var toolbarTopPos = mbeNodeRect.top + frameheight + wrapperHeaderHeight + scrollWrapper.scrollTop;
182
186
  return {
183
- top: mbeNodeRect.top + frameheight + scrollWrapper.scrollTop,
187
+ top: toolbarTopPos,
184
188
  left: nextPos.left
185
189
  };
186
190
  },
@@ -6,8 +6,8 @@ import type { Command } from '@atlaskit/editor-common/types';
6
6
  import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
7
7
  import type { Fragment, Mark, Node as PmNode, Schema } from '@atlaskit/editor-prosemirror/model';
8
8
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
9
- export declare const buildExtensionNode: <S extends Schema<any, any>>(type: 'inlineExtension' | 'extension' | 'bodiedExtension', schema: S, attrs: object, content?: Fragment, marks?: readonly Mark[]) => PmNode;
10
- export declare const performNodeUpdate: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (type: 'inlineExtension' | 'extension' | 'bodiedExtension', newAttrs: object, content: Fragment, marks: readonly Mark[], shouldScrollIntoView: boolean) => Command;
9
+ export declare const buildExtensionNode: <S extends Schema<any, any>>(type: 'inlineExtension' | 'extension' | 'bodiedExtension' | 'multiBodiedExtension', schema: S, attrs: object, content?: Fragment, marks?: readonly Mark[]) => PmNode;
10
+ export declare const performNodeUpdate: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (type: 'inlineExtension' | 'extension' | 'bodiedExtension' | 'multiBodiedExtension', newAttrs: object, content: Fragment, marks: readonly Mark[], shouldScrollIntoView: boolean) => Command;
11
11
  interface EditorActions {
12
12
  _privateGetEditorView: () => EditorView | undefined;
13
13
  }
@@ -6,8 +6,8 @@ import type { Command } from '@atlaskit/editor-common/types';
6
6
  import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
7
7
  import type { Fragment, Mark, Node as PmNode, Schema } from '@atlaskit/editor-prosemirror/model';
8
8
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
9
- export declare const buildExtensionNode: <S extends Schema<any, any>>(type: 'inlineExtension' | 'extension' | 'bodiedExtension', schema: S, attrs: object, content?: Fragment, marks?: readonly Mark[]) => PmNode;
10
- export declare const performNodeUpdate: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (type: 'inlineExtension' | 'extension' | 'bodiedExtension', newAttrs: object, content: Fragment, marks: readonly Mark[], shouldScrollIntoView: boolean) => Command;
9
+ export declare const buildExtensionNode: <S extends Schema<any, any>>(type: 'inlineExtension' | 'extension' | 'bodiedExtension' | 'multiBodiedExtension', schema: S, attrs: object, content?: Fragment, marks?: readonly Mark[]) => PmNode;
10
+ export declare const performNodeUpdate: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (type: 'inlineExtension' | 'extension' | 'bodiedExtension' | 'multiBodiedExtension', newAttrs: object, content: Fragment, marks: readonly Mark[], shouldScrollIntoView: boolean) => Command;
11
11
  interface EditorActions {
12
12
  _privateGetEditorView: () => EditorView | undefined;
13
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-extension",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "editor-plugin-extension plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  "@atlaskit/button": "^17.2.0",
32
32
  "@atlaskit/checkbox": "^13.0.0",
33
33
  "@atlaskit/datetime-picker": "^13.0.3",
34
- "@atlaskit/editor-common": "^77.0.0",
34
+ "@atlaskit/editor-common": "^77.1.0",
35
35
  "@atlaskit/editor-json-transformer": "^8.10.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^0.4.0",
37
37
  "@atlaskit/editor-plugin-context-panel": "^0.2.0",
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/editor-plugin-width": "^0.2.0",
41
41
  "@atlaskit/editor-prosemirror": "1.1.0",
42
42
  "@atlaskit/editor-shared-styles": "^2.9.0",
43
- "@atlaskit/editor-tables": "^2.4.0",
43
+ "@atlaskit/editor-tables": "^2.5.0",
44
44
  "@atlaskit/empty-state": "^7.6.0",
45
45
  "@atlaskit/form": "^9.0.3",
46
46
  "@atlaskit/icon": "^22.0.0",
@@ -48,14 +48,14 @@
48
48
  "@atlaskit/radio": "^6.0.0",
49
49
  "@atlaskit/section-message": "^6.4.0",
50
50
  "@atlaskit/select": "^17.0.3",
51
- "@atlaskit/smart-user-picker": "^6.4.0",
51
+ "@atlaskit/smart-user-picker": "^6.5.0",
52
52
  "@atlaskit/spinner": "^16.0.0",
53
53
  "@atlaskit/tabs": "^14.0.0",
54
54
  "@atlaskit/textarea": "^5.0.0",
55
55
  "@atlaskit/textfield": "^6.0.0",
56
56
  "@atlaskit/theme": "^12.6.0",
57
57
  "@atlaskit/toggle": "^13.0.0",
58
- "@atlaskit/tokens": "^1.34.0",
58
+ "@atlaskit/tokens": "^1.35.0",
59
59
  "@atlaskit/tooltip": "^18.1.0",
60
60
  "@babel/runtime": "^7.0.0",
61
61
  "@emotion/react": "^11.7.1",