@atlaskit/editor-core 187.8.13 → 187.9.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.
Files changed (89) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/plugins/emoji/commands/insert-emoji.js +31 -28
  3. package/dist/cjs/plugins/emoji/index.js +4 -3
  4. package/dist/cjs/plugins/emoji/pm-plugins/ascii-input-rules.js +23 -18
  5. package/dist/cjs/plugins/extension/pm-plugins/main.js +54 -9
  6. package/dist/cjs/plugins/floating-toolbar/index.js +1 -3
  7. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +1 -1
  8. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +33 -23
  9. package/dist/cjs/plugins/media/toolbar/index.js +16 -2
  10. package/dist/cjs/plugins/media/toolbar/utils.js +7 -2
  11. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +574 -0
  12. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/guidelines.js +117 -0
  13. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/resizable-media-single-messages.js +15 -0
  14. package/dist/cjs/plugins/selection/pm-plugins/events/keydown.js +61 -25
  15. package/dist/cjs/ui/Resizer/ResizeLabel/index.js +20 -0
  16. package/dist/cjs/ui/Resizer/ResizeLabel/styles.js +17 -0
  17. package/dist/cjs/version-wrapper.js +1 -1
  18. package/dist/cjs/version.json +1 -1
  19. package/dist/es2019/plugins/emoji/commands/insert-emoji.js +5 -5
  20. package/dist/es2019/plugins/emoji/index.js +6 -3
  21. package/dist/es2019/plugins/emoji/pm-plugins/ascii-input-rules.js +14 -11
  22. package/dist/es2019/plugins/extension/pm-plugins/main.js +50 -0
  23. package/dist/es2019/plugins/floating-toolbar/index.js +1 -1
  24. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +1 -1
  25. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +34 -23
  26. package/dist/es2019/plugins/media/toolbar/index.js +19 -3
  27. package/dist/es2019/plugins/media/toolbar/utils.js +7 -1
  28. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +493 -0
  29. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/guidelines.js +108 -0
  30. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/resizable-media-single-messages.js +8 -0
  31. package/dist/es2019/plugins/selection/pm-plugins/events/keydown.js +60 -24
  32. package/dist/es2019/ui/Resizer/ResizeLabel/index.js +12 -0
  33. package/dist/es2019/ui/Resizer/ResizeLabel/styles.js +25 -0
  34. package/dist/es2019/version-wrapper.js +1 -1
  35. package/dist/es2019/version.json +1 -1
  36. package/dist/esm/plugins/emoji/commands/insert-emoji.js +29 -27
  37. package/dist/esm/plugins/emoji/index.js +4 -3
  38. package/dist/esm/plugins/emoji/pm-plugins/ascii-input-rules.js +23 -18
  39. package/dist/esm/plugins/extension/pm-plugins/main.js +45 -0
  40. package/dist/esm/plugins/floating-toolbar/index.js +1 -3
  41. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +1 -1
  42. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +33 -23
  43. package/dist/esm/plugins/media/toolbar/index.js +17 -3
  44. package/dist/esm/plugins/media/toolbar/utils.js +5 -1
  45. package/dist/esm/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +564 -0
  46. package/dist/esm/plugins/media/ui/ResizableMediaSingle/guidelines.js +108 -0
  47. package/dist/esm/plugins/media/ui/ResizableMediaSingle/resizable-media-single-messages.js +8 -0
  48. package/dist/esm/plugins/selection/pm-plugins/events/keydown.js +62 -25
  49. package/dist/esm/ui/Resizer/ResizeLabel/index.js +12 -0
  50. package/dist/esm/ui/Resizer/ResizeLabel/styles.js +7 -0
  51. package/dist/esm/version-wrapper.js +1 -1
  52. package/dist/esm/version.json +1 -1
  53. package/dist/types/labs/next/presets/universal.d.ts +1 -2
  54. package/dist/types/plugins/emoji/commands/insert-emoji.d.ts +2 -2
  55. package/dist/types/plugins/emoji/pm-plugins/ascii-input-rules.d.ts +3 -2
  56. package/dist/types/plugins/extension/pm-plugins/main.d.ts +1 -1
  57. package/dist/types/plugins/floating-toolbar/index.d.ts +3 -1
  58. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/index.d.ts +1 -0
  59. package/dist/types/plugins/media/index.d.ts +2 -0
  60. package/dist/types/plugins/media/nodeviews/styles.d.ts +1 -1
  61. package/dist/types/plugins/media/pm-plugins/main.d.ts +1 -1
  62. package/dist/types/plugins/media/toolbar/utils.d.ts +1 -0
  63. package/dist/types/plugins/media/types.d.ts +1 -0
  64. package/dist/types/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +61 -0
  65. package/dist/types/plugins/media/ui/ResizableMediaSingle/guidelines.d.ts +4 -0
  66. package/dist/types/plugins/media/ui/ResizableMediaSingle/resizable-media-single-messages.d.ts +7 -0
  67. package/dist/types/plugins/media/ui/ResizableMediaSingle/types.d.ts +1 -0
  68. package/dist/types/ui/Resizer/ResizeLabel/index.d.ts +8 -0
  69. package/dist/types/ui/Resizer/ResizeLabel/styles.d.ts +3 -0
  70. package/dist/types-ts4.5/labs/next/presets/universal.d.ts +1 -2
  71. package/dist/types-ts4.5/plugins/emoji/commands/insert-emoji.d.ts +2 -2
  72. package/dist/types-ts4.5/plugins/emoji/pm-plugins/ascii-input-rules.d.ts +3 -2
  73. package/dist/types-ts4.5/plugins/extension/pm-plugins/main.d.ts +1 -1
  74. package/dist/types-ts4.5/plugins/floating-toolbar/index.d.ts +3 -1
  75. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/index.d.ts +1 -0
  76. package/dist/types-ts4.5/plugins/media/index.d.ts +2 -0
  77. package/dist/types-ts4.5/plugins/media/nodeviews/styles.d.ts +1 -1
  78. package/dist/types-ts4.5/plugins/media/pm-plugins/main.d.ts +1 -1
  79. package/dist/types-ts4.5/plugins/media/toolbar/utils.d.ts +1 -0
  80. package/dist/types-ts4.5/plugins/media/types.d.ts +1 -0
  81. package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +61 -0
  82. package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/guidelines.d.ts +4 -0
  83. package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/resizable-media-single-messages.d.ts +7 -0
  84. package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/types.d.ts +1 -0
  85. package/dist/types-ts4.5/ui/Resizer/ResizeLabel/index.d.ts +8 -0
  86. package/dist/types-ts4.5/ui/Resizer/ResizeLabel/styles.d.ts +3 -0
  87. package/package.json +2 -2
  88. package/report.api.md +7 -4
  89. package/tmp/api-report-tmp.d.ts +5 -1
@@ -1,36 +1,68 @@
1
1
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
2
+
3
+ /*
4
+ * The way expand was built, no browser reconize selection on it.
5
+ * For instance, when a selection going to a "collapsed" expand
6
+ * the browser will try to send the cursor to inside the expand content (wrong),
7
+ * this behavior is caused because the expand content is never true hidden
8
+ * we just set the height to 1px.
9
+ *
10
+ * So, we need to capture a possible selection event
11
+ * when a collapsed exxpand is the next node in the common depth.
12
+ * If that is true, we create a new TextSelection and stop the event bubble
13
+ */
2
14
  var isCollpasedExpand = function isCollpasedExpand(node) {
3
15
  return Boolean(node && ['expand', 'nestedExpand'].includes(node.type.name) && !node.attrs.__expanded);
4
16
  };
5
- var findFixedProblematicNodePosition = function findFixedProblematicNodePosition($pos, direction) {
6
- if ($pos.pos === 0 || $pos.depth === 0) {
17
+
18
+ /**
19
+ * ED-18072 - Cannot shift + arrow past bodied extension if it is not empty
20
+ */
21
+ var isBodiedExtension = function isBodiedExtension(node) {
22
+ return Boolean(node && ['bodiedExtension'].includes(node.type.name));
23
+ };
24
+ var isProblematicNode = function isProblematicNode(node) {
25
+ return isCollpasedExpand(node) || isBodiedExtension(node);
26
+ };
27
+ var findFixedProblematicNodePosition = function findFixedProblematicNodePosition(doc, $head, direction) {
28
+ if ($head.pos === 0 || $head.depth === 0) {
7
29
  return null;
8
30
  }
9
- var pos = direction === 'up' ? $pos.before() : $pos.after();
10
- var $posResolved = $pos.doc.resolve(pos);
11
- var maybeExpandNode = direction === 'up' ? $posResolved.nodeBefore : $posResolved.nodeAfter;
12
- if (maybeExpandNode && isCollpasedExpand(maybeExpandNode)) {
13
- var nodeSize = maybeExpandNode.nodeSize;
14
- var expandPosition = direction === 'up' ? pos - nodeSize : pos + nodeSize;
15
- var startPosNode = Math.max(expandPosition, 0);
16
- var $startPosNode = $pos.doc.resolve(Math.min(startPosNode, $pos.doc.content.size));
17
- return $startPosNode;
31
+ if (direction === 'up') {
32
+ var pos = $head.before();
33
+ var $posResolved = $head.doc.resolve(pos);
34
+ var maybeProblematicNode = $posResolved.nodeBefore;
35
+ if (maybeProblematicNode && isProblematicNode(maybeProblematicNode)) {
36
+ var nodeSize = maybeProblematicNode.nodeSize;
37
+ var nodeStartPosition = pos - nodeSize;
38
+
39
+ // ($head.pos - 1) will correspond to (nodeStartPosition + nodeSize) when we are at the start of the text node
40
+ var isAtEndOfProblematicNode = $head.pos - 1 === nodeStartPosition + nodeSize;
41
+ if (isAtEndOfProblematicNode) {
42
+ var startPosNode = Math.max(nodeStartPosition, 0);
43
+ var $startPosNode = $head.doc.resolve(Math.min(startPosNode, $head.doc.content.size));
44
+ return $startPosNode;
45
+ }
46
+ }
47
+ }
48
+ if (direction === 'down') {
49
+ var _pos = $head.after();
50
+ var _maybeProblematicNode = doc.nodeAt(_pos);
51
+ if (_maybeProblematicNode && isProblematicNode(_maybeProblematicNode) && $head.pos + 1 === _pos) {
52
+ var _nodeSize = _maybeProblematicNode.nodeSize;
53
+ var nodePosition = _pos + _nodeSize;
54
+ var _startPosNode = Math.max(nodePosition, 0);
55
+ var _$startPosNode = $head.doc.resolve(Math.min(_startPosNode, $head.doc.content.size));
56
+ return _$startPosNode;
57
+ }
18
58
  }
19
59
  return null;
20
60
  };
21
61
  export var onKeydown = function onKeydown(view, event) {
22
62
  /*
23
- * This workaround is needed for some specific situation with collapsed expand.
24
- *
25
- * The way expand was built, no browser reconize selection on it.
26
- * For instance, when a selection going to a "collapsed" expand
27
- * the browser will try to send the cursor to inside the expand content (wrong),
28
- * this behavior is caused because the expand content is never true hidden
29
- * we just set the height to 1px.
30
- *
31
- * So, we need to capture a possible selection event
32
- * when a collapsed exxpand is the next node in the common depth.
33
- * If that is true, we create a new TextSelection and stop the event bubble
63
+ * This workaround is needed for some specific situations.
64
+ * - expand collapse
65
+ * - bodied extension
34
66
  */
35
67
  if (!(event instanceof KeyboardEvent)) {
36
68
  return false;
@@ -41,16 +73,21 @@ export var onKeydown = function onKeydown(view, event) {
41
73
  if (!['ArrowUp', 'ArrowDown', 'ArrowRight', 'ArrowLeft', 'Home', 'End'].includes(event.key)) {
42
74
  return false;
43
75
  }
44
- var _view$state$selection = view.state.selection,
76
+ var _view$state = view.state,
77
+ doc = _view$state.doc,
78
+ _view$state$selection = _view$state.selection,
45
79
  $head = _view$state$selection.$head,
46
80
  $anchor = _view$state$selection.$anchor;
47
81
  if (event.key === 'ArrowRight' && $head.nodeAfter || event.key === 'ArrowLeft' && $head.nodeBefore) {
48
82
  return false;
49
83
  }
50
84
  var direction = ['ArrowLeft', 'ArrowUp', 'Home'].includes(event.key) ? 'up' : 'down';
51
- var $fixedProblematicNodePosition = findFixedProblematicNodePosition($head, direction);
85
+ var $fixedProblematicNodePosition = findFixedProblematicNodePosition(doc, $head, direction);
52
86
  if ($fixedProblematicNodePosition) {
53
- var forcedTextSelection = TextSelection.create(view.state.doc, $anchor.pos, $fixedProblematicNodePosition.pos);
87
+ // an offset is used here so that left arrow selects the first character before the node (consistent with arrow right)
88
+ var headOffset = event.key === 'ArrowLeft' ? -1 : 0;
89
+ var head = $fixedProblematicNodePosition.pos + headOffset;
90
+ var forcedTextSelection = TextSelection.create(view.state.doc, $anchor.pos, head);
54
91
  var tr = view.state.tr;
55
92
  tr.setSelection(forcedTextSelection);
56
93
  view.dispatch(tr);
@@ -0,0 +1,12 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { wrapper, text, smallText } from './styles';
4
+ var ResizeLabelBreakoutWidth = 110;
5
+ var ResizeLabel = function ResizeLabel(props) {
6
+ return jsx("div", {
7
+ css: wrapper
8
+ }, jsx("span", {
9
+ css: [text, props.containerWidth < ResizeLabelBreakoutWidth && smallText]
10
+ }, props.label));
11
+ };
12
+ export default ResizeLabel;
@@ -0,0 +1,7 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+ var _templateObject, _templateObject2, _templateObject3;
3
+ import { css } from '@emotion/react';
4
+ import { B300 } from '@atlaskit/theme/colors';
5
+ export var wrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-size: ", ";\n width: 100%;\n text-align: center;\n position: absolute;\n transform: translateY(-125%);\n top: 0;\n"])), "var(--ds-font-size-100, 14px)");
6
+ export var text = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-block;\n border-radius: 6px;\n min-width: 75px;\n background-color: ", ";\n color: ", ";\n padding: ", " ", ";\n letter-spacing: 0.5px;\n"])), "var(--ds-text-accent-blue, ".concat(B300, ")"), "var(--ds-text-inverse, white)", "var(--ds-space-050, 4px)", "var(--ds-space-200, 16px)");
7
+ export var smallText = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n letter-spacing: -0.5px;\n font-size: ", ";\n min-width: 27px;\n padding: ", " ", ";\n"])), "var(--ds-font-size-050, 8px)", "var(--ds-space-0, 0px)", "var(--ds-space-025, 2px)");
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "187.8.13";
2
+ export var version = "187.9.2";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.8.13",
3
+ "version": "187.9.2",
4
4
  "sideEffects": false
5
5
  }
@@ -2,9 +2,8 @@ import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
2
  import type { EditorAppearance } from '@atlaskit/editor-common/types';
3
3
  import type { DefaultPresetPluginOptions } from './default';
4
4
  import type { EditorPresetProps } from './types';
5
- import type { EditorSharedPropsWithPlugins } from '../../../types/editor-props';
5
+ import type { EditorSharedPropsWithPlugins, EditorPluginFeatureProps, EditorProviderProps } from '../../../types/editor-props';
6
6
  import type { FeatureFlags } from '../../../types/feature-flags';
7
- import type { EditorPluginFeatureProps, EditorProviderProps } from '../../../types/editor-props';
8
7
  import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
9
8
  type UniversalPresetProps = EditorPresetProps & DefaultPresetPluginOptions & EditorSharedPropsWithPlugins & EditorPluginFeatureProps & EditorProviderProps;
10
9
  /**
@@ -1,4 +1,4 @@
1
1
  import type { EmojiId } from '@atlaskit/emoji';
2
2
  import type { Command } from '../../../types';
3
- import type { INPUT_METHOD } from '../../analytics';
4
- export declare function insertEmoji(emojiId: EmojiId, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD): Command;
3
+ import type { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
+ export declare const insertEmoji: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (emojiId: EmojiId, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD) => Command;
@@ -3,7 +3,8 @@ import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
5
  import type { FeatureFlags } from '../../../types/feature-flags';
6
- export declare function inputRulePlugin(schema: Schema, providerFactory: ProviderFactory, featureFlags: FeatureFlags): SafePlugin | undefined;
6
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
7
+ export declare function inputRulePlugin(schema: Schema, providerFactory: ProviderFactory, featureFlags: FeatureFlags, editorAnalyticsAPI: EditorAnalyticsAPI | undefined): SafePlugin | undefined;
7
8
  export declare const stateKey: PluginKey<any>;
8
- declare const plugins: (schema: Schema, providerFactory: ProviderFactory, featureFlags: FeatureFlags) => SafePlugin<any>[];
9
+ declare const plugins: (schema: Schema, providerFactory: ProviderFactory, featureFlags: FeatureFlags, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => SafePlugin<any>[];
9
10
  export default plugins;
@@ -5,13 +5,13 @@ import type { ExtensionHandlers, ExtensionProvider } from '@atlaskit/editor-comm
5
5
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
6
  import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
7
7
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
+ import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
8
9
  import type { EditorAppearance } from '../../../types/editor-appearance';
9
10
  import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
10
11
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
11
12
  import { getPluginState, createCommand } from '../plugin-factory';
12
13
  import { pluginKey } from '../plugin-key';
13
14
  import type extensionPlugin from '../index';
14
- import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
15
15
  export declare const createExtensionProviderHandler: (view: EditorView) => (name: string, provider?: Promise<ExtensionProvider>) => Promise<void>;
16
16
  export declare const createContextIdentifierProviderHandler: (view: EditorView) => (name: string, provider?: Promise<ContextIdentifierProvider>) => Promise<void>;
17
17
  export declare const handleUpdate: ({ view, prevState, domAtPos, extensionHandlers, applyChange, }: {
@@ -3,7 +3,9 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { Node } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { FloatingToolbarConfig } from './types';
5
5
  import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
6
- export type FloatingToolbarPluginState = Record<'getConfigWithNodeInfo', (state: EditorState) => ConfigWithNodeInfo | null | undefined>;
6
+ export type FloatingToolbarPluginState = {
7
+ getConfigWithNodeInfo: (state: EditorState) => ConfigWithNodeInfo | null | undefined;
8
+ };
7
9
  export type ConfigWithNodeInfo = {
8
10
  config: FloatingToolbarConfig | undefined;
9
11
  pos: number;
@@ -7,6 +7,7 @@ export declare class ToolbarInsertBlock extends React.PureComponent<Props & Wrap
7
7
  private dropdownButtonRef?;
8
8
  private emojiButtonRef?;
9
9
  private plusButtonRef?;
10
+ private editorAnalyticsAPI;
10
11
  state: State;
11
12
  static getDerivedStateFromProps(props: Props & WrappedComponentProps, state: State): State | null;
12
13
  componentDidUpdate(prevProps: Props): void;
@@ -5,6 +5,7 @@ import type { MediaState } from './pm-plugins/main';
5
5
  import type { CustomMediaPicker, MediaOptions } from './types';
6
6
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
7
  import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
8
+ import type { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
8
9
  import type { gridPlugin } from '@atlaskit/editor-plugin-grid';
9
10
  import type { widthPlugin } from '@atlaskit/editor-plugin-width';
10
11
  import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
@@ -18,6 +19,7 @@ declare const mediaPlugin: NextEditorPlugin<'media', {
18
19
  dependencies: [
19
20
  typeof featureFlagsPlugin,
20
21
  OptionalPlugin<typeof analyticsPlugin>,
22
+ typeof guidelinePlugin,
21
23
  typeof gridPlugin,
22
24
  typeof widthPlugin,
23
25
  typeof decorationsPlugin,
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
3
  import { jsx } from '@emotion/react';
4
- import { NumericalCardDimensions } from '@atlaskit/media-card';
4
+ import type { NumericalCardDimensions } from '@atlaskit/media-card';
5
5
  export declare const MediaInlineNodeSelector = "media-inline-node";
6
6
  export declare const MediaSingleNodeSelector = "media-single-node";
7
7
  export declare const figureWrapper: import("@emotion/react").SerializedStyles;
@@ -5,7 +5,6 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  import type { MediaClientConfig } from '@atlaskit/media-core';
6
6
  import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
7
7
  import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
8
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
8
  import type { WidthPluginState } from '@atlaskit/editor-plugin-width';
10
9
  import type { Dispatch } from '../../../event-dispatcher';
11
10
  import type { ProsemirrorGetPosHandler } from '../../../nodeviews';
@@ -15,6 +14,7 @@ import type { MediaStateEventSubscriber } from '../picker-facade';
15
14
  import PickerFacade from '../picker-facade';
16
15
  import type { MediaNodeWithPosHandler, MediaPluginState } from './types';
17
16
  import type { IntlShape } from 'react-intl-next';
17
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
18
18
  import type mediaPlugin from '../index';
19
19
  export type { MediaState, MediaProvider, MediaStateStatus };
20
20
  export { stateKey } from './plugin-key';
@@ -6,3 +6,4 @@ import type { MediaPluginState } from '../pm-plugins/types';
6
6
  export declare const getSelectedMediaContainerNodeAttrs: (mediaPluginState: MediaPluginState) => MediaBaseAttributes | null;
7
7
  export declare const downloadMedia: (mediaPluginState: MediaPluginState) => Promise<boolean>;
8
8
  export declare const removeMediaGroupNode: (state: EditorState) => import("prosemirror-state").Transaction;
9
+ export declare const getSelectedMediaSingle: (state: EditorState) => import("prosemirror-utils").ContentNodeWithPos | undefined;
@@ -10,6 +10,7 @@ import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
10
10
  import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
11
11
  import type { PlaceholderTextOptions } from '../../plugins/placeholder-text/types';
12
12
  export type MediaStateStatus = 'unknown' | 'ready' | 'cancelled' | 'preview' | 'error' | 'mobile-upload-end';
13
+ export type MediaSingleWithType = 'pixel' | 'percentage';
13
14
  export interface MediaOptions {
14
15
  provider?: Providers['mediaProvider'];
15
16
  allowMediaSingle?: boolean | MediaSingleOptions;
@@ -0,0 +1,61 @@
1
+ /// <reference path="../../../../../../../../../typings/prosemirror.d.ts" />
2
+ /** @jsx jsx */
3
+ import React from 'react';
4
+ import { jsx } from '@emotion/react';
5
+ import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
6
+ import type { MediaClientConfig } from '@atlaskit/media-core';
7
+ import type { Props } from './types';
8
+ import type { Dimensions } from '@atlaskit/editor-common/resizer';
9
+ import type { WrappedComponentProps } from 'react-intl-next';
10
+ type State = {
11
+ offsetLeft: number;
12
+ isVideoFile: boolean;
13
+ resizedPctWidth?: number;
14
+ isResizing: boolean;
15
+ size: Dimensions;
16
+ };
17
+ export declare const resizerNextTestId = "mediaSingle.resizerNext.testid";
18
+ export declare function calcOffsetLeft(insideInlineLike: boolean, insideLayout: boolean, pmViewDom: Element, wrapper?: HTMLElement): number;
19
+ type ResizableMediaSingleNextProps = Props & WrappedComponentProps;
20
+ declare class ResizableMediaSingleNext extends React.Component<ResizableMediaSingleNextProps, State> {
21
+ constructor(props: ResizableMediaSingleNextProps);
22
+ /**
23
+ * Calculate media single node initial width if props.mediaSingleWidth is undefined
24
+ * (Mainly when switching from lagacy experience to new experience).
25
+ *
26
+ * @returns initial width in pixel
27
+ */
28
+ calcInitialWidth(): number;
29
+ componentDidUpdate(prevProps: Props, prevState: State): boolean;
30
+ isNestedNode(): boolean;
31
+ private getDefaultGuidelines;
32
+ private getSnaps;
33
+ get wrappedLayout(): boolean;
34
+ componentDidMount(): Promise<void>;
35
+ UNSAFE_componentWillReceiveProps(nextProps: Props): void;
36
+ checkVideoFile(viewMediaClientConfig?: MediaClientConfig): Promise<void>;
37
+ calcNewSize: (newWidth: number, stop: boolean) => {
38
+ width: number | null;
39
+ layout: MediaSingleLayout;
40
+ };
41
+ calcUnwrappedLayout: (width: number, containerWidth: number, contentWidth: number) => 'center' | 'wide' | 'full-width';
42
+ get $pos(): import("prosemirror-model").ResolvedPos | null;
43
+ /**
44
+ * The maxmimum number of grid columns this node can resize to.
45
+ */
46
+ get gridWidth(): number;
47
+ calcColumnLeftOffset: () => number;
48
+ wrapper?: HTMLElement;
49
+ calcPxHeight: (newWidth: number) => number;
50
+ get insideInlineLike(): boolean;
51
+ get insideLayout(): boolean;
52
+ private saveWrapper;
53
+ private displayGuideline;
54
+ private setIsResizing;
55
+ render(): jsx.JSX.Element;
56
+ }
57
+ export { ResizableMediaSingleNext as UnwrappedResizableMediaSingleNext };
58
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<ResizableMediaSingleNextProps>> & {
59
+ WrappedComponent: React.ComponentType<ResizableMediaSingleNextProps>;
60
+ };
61
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
2
+ import type { EditorView } from 'prosemirror-view';
3
+ export declare const generateDefaultGuidelines: (editorWidth: number, containerWidth: number, isFullWidthMode?: boolean | undefined) => GuidelineConfig[];
4
+ export declare const generateDynamicGuidelines: (view: EditorView) => GuidelineConfig[];
@@ -0,0 +1,7 @@
1
+ export declare const messages: {
2
+ fullWidthImage: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ };
@@ -22,5 +22,6 @@ export type Props = MediaSingleProps & {
22
22
  viewMediaClientConfig?: MediaClientConfig;
23
23
  fullWidthMode?: boolean;
24
24
  dispatchAnalyticsEvent: DispatchAnalyticsEvent;
25
+ mediaSingleWidth?: number;
25
26
  pluginInjectionApi: ExtractInjectionAPI<typeof mediaPlugin> | undefined;
26
27
  };
@@ -0,0 +1,8 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ interface Props {
4
+ label: string;
5
+ containerWidth: number;
6
+ }
7
+ declare const ResizeLabel: (props: Props) => jsx.JSX.Element;
8
+ export default ResizeLabel;
@@ -0,0 +1,3 @@
1
+ export declare const wrapper: import("@emotion/react").SerializedStyles;
2
+ export declare const text: import("@emotion/react").SerializedStyles;
3
+ export declare const smallText: import("@emotion/react").SerializedStyles;
@@ -2,9 +2,8 @@ import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
2
  import type { EditorAppearance } from '@atlaskit/editor-common/types';
3
3
  import type { DefaultPresetPluginOptions } from './default';
4
4
  import type { EditorPresetProps } from './types';
5
- import type { EditorSharedPropsWithPlugins } from '../../../types/editor-props';
5
+ import type { EditorSharedPropsWithPlugins, EditorPluginFeatureProps, EditorProviderProps } from '../../../types/editor-props';
6
6
  import type { FeatureFlags } from '../../../types/feature-flags';
7
- import type { EditorPluginFeatureProps, EditorProviderProps } from '../../../types/editor-props';
8
7
  import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
9
8
  type UniversalPresetProps = EditorPresetProps & DefaultPresetPluginOptions & EditorSharedPropsWithPlugins & EditorPluginFeatureProps & EditorProviderProps;
10
9
  /**
@@ -1,4 +1,4 @@
1
1
  import type { EmojiId } from '@atlaskit/emoji';
2
2
  import type { Command } from '../../../types';
3
- import type { INPUT_METHOD } from '../../analytics';
4
- export declare function insertEmoji(emojiId: EmojiId, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD): Command;
3
+ import type { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
+ export declare const insertEmoji: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (emojiId: EmojiId, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD) => Command;
@@ -3,7 +3,8 @@ import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
5
  import type { FeatureFlags } from '../../../types/feature-flags';
6
- export declare function inputRulePlugin(schema: Schema, providerFactory: ProviderFactory, featureFlags: FeatureFlags): SafePlugin | undefined;
6
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
7
+ export declare function inputRulePlugin(schema: Schema, providerFactory: ProviderFactory, featureFlags: FeatureFlags, editorAnalyticsAPI: EditorAnalyticsAPI | undefined): SafePlugin | undefined;
7
8
  export declare const stateKey: PluginKey<any>;
8
- declare const plugins: (schema: Schema, providerFactory: ProviderFactory, featureFlags: FeatureFlags) => SafePlugin<any>[];
9
+ declare const plugins: (schema: Schema, providerFactory: ProviderFactory, featureFlags: FeatureFlags, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => SafePlugin<any>[];
9
10
  export default plugins;
@@ -5,13 +5,13 @@ import type { ExtensionHandlers, ExtensionProvider } from '@atlaskit/editor-comm
5
5
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
6
  import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
7
7
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
+ import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
8
9
  import type { EditorAppearance } from '../../../types/editor-appearance';
9
10
  import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
10
11
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
11
12
  import { getPluginState, createCommand } from '../plugin-factory';
12
13
  import { pluginKey } from '../plugin-key';
13
14
  import type extensionPlugin from '../index';
14
- import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
15
15
  export declare const createExtensionProviderHandler: (view: EditorView) => (name: string, provider?: Promise<ExtensionProvider>) => Promise<void>;
16
16
  export declare const createContextIdentifierProviderHandler: (view: EditorView) => (name: string, provider?: Promise<ContextIdentifierProvider>) => Promise<void>;
17
17
  export declare const handleUpdate: ({ view, prevState, domAtPos, extensionHandlers, applyChange, }: {
@@ -3,7 +3,9 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { Node } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { FloatingToolbarConfig } from './types';
5
5
  import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
6
- export type FloatingToolbarPluginState = Record<'getConfigWithNodeInfo', (state: EditorState) => ConfigWithNodeInfo | null | undefined>;
6
+ export type FloatingToolbarPluginState = {
7
+ getConfigWithNodeInfo: (state: EditorState) => ConfigWithNodeInfo | null | undefined;
8
+ };
7
9
  export type ConfigWithNodeInfo = {
8
10
  config: FloatingToolbarConfig | undefined;
9
11
  pos: number;
@@ -7,6 +7,7 @@ export declare class ToolbarInsertBlock extends React.PureComponent<Props & Wrap
7
7
  private dropdownButtonRef?;
8
8
  private emojiButtonRef?;
9
9
  private plusButtonRef?;
10
+ private editorAnalyticsAPI;
10
11
  state: State;
11
12
  static getDerivedStateFromProps(props: Props & WrappedComponentProps, state: State): State | null;
12
13
  componentDidUpdate(prevProps: Props): void;
@@ -5,6 +5,7 @@ import type { MediaState } from './pm-plugins/main';
5
5
  import type { CustomMediaPicker, MediaOptions } from './types';
6
6
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
7
  import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
8
+ import type { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
8
9
  import type { gridPlugin } from '@atlaskit/editor-plugin-grid';
9
10
  import type { widthPlugin } from '@atlaskit/editor-plugin-width';
10
11
  import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
@@ -18,6 +19,7 @@ declare const mediaPlugin: NextEditorPlugin<'media', {
18
19
  dependencies: [
19
20
  typeof featureFlagsPlugin,
20
21
  OptionalPlugin<typeof analyticsPlugin>,
22
+ typeof guidelinePlugin,
21
23
  typeof gridPlugin,
22
24
  typeof widthPlugin,
23
25
  typeof decorationsPlugin,
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
3
  import { jsx } from '@emotion/react';
4
- import { NumericalCardDimensions } from '@atlaskit/media-card';
4
+ import type { NumericalCardDimensions } from '@atlaskit/media-card';
5
5
  export declare const MediaInlineNodeSelector = "media-inline-node";
6
6
  export declare const MediaSingleNodeSelector = "media-single-node";
7
7
  export declare const figureWrapper: import("@emotion/react").SerializedStyles;
@@ -5,7 +5,6 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  import type { MediaClientConfig } from '@atlaskit/media-core';
6
6
  import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
7
7
  import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
8
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
8
  import type { WidthPluginState } from '@atlaskit/editor-plugin-width';
10
9
  import type { Dispatch } from '../../../event-dispatcher';
11
10
  import type { ProsemirrorGetPosHandler } from '../../../nodeviews';
@@ -15,6 +14,7 @@ import type { MediaStateEventSubscriber } from '../picker-facade';
15
14
  import PickerFacade from '../picker-facade';
16
15
  import type { MediaNodeWithPosHandler, MediaPluginState } from './types';
17
16
  import type { IntlShape } from 'react-intl-next';
17
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
18
18
  import type mediaPlugin from '../index';
19
19
  export type { MediaState, MediaProvider, MediaStateStatus };
20
20
  export { stateKey } from './plugin-key';
@@ -6,3 +6,4 @@ import type { MediaPluginState } from '../pm-plugins/types';
6
6
  export declare const getSelectedMediaContainerNodeAttrs: (mediaPluginState: MediaPluginState) => MediaBaseAttributes | null;
7
7
  export declare const downloadMedia: (mediaPluginState: MediaPluginState) => Promise<boolean>;
8
8
  export declare const removeMediaGroupNode: (state: EditorState) => import("prosemirror-state").Transaction;
9
+ export declare const getSelectedMediaSingle: (state: EditorState) => import("prosemirror-utils").ContentNodeWithPos | undefined;
@@ -10,6 +10,7 @@ import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
10
10
  import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
11
11
  import type { PlaceholderTextOptions } from '../../plugins/placeholder-text/types';
12
12
  export type MediaStateStatus = 'unknown' | 'ready' | 'cancelled' | 'preview' | 'error' | 'mobile-upload-end';
13
+ export type MediaSingleWithType = 'pixel' | 'percentage';
13
14
  export interface MediaOptions {
14
15
  provider?: Providers['mediaProvider'];
15
16
  allowMediaSingle?: boolean | MediaSingleOptions;
@@ -0,0 +1,61 @@
1
+ /// <reference path="../../../../../../../../../typings/prosemirror.d.ts" />
2
+ /** @jsx jsx */
3
+ import React from 'react';
4
+ import { jsx } from '@emotion/react';
5
+ import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
6
+ import type { MediaClientConfig } from '@atlaskit/media-core';
7
+ import type { Props } from './types';
8
+ import type { Dimensions } from '@atlaskit/editor-common/resizer';
9
+ import type { WrappedComponentProps } from 'react-intl-next';
10
+ type State = {
11
+ offsetLeft: number;
12
+ isVideoFile: boolean;
13
+ resizedPctWidth?: number;
14
+ isResizing: boolean;
15
+ size: Dimensions;
16
+ };
17
+ export declare const resizerNextTestId = "mediaSingle.resizerNext.testid";
18
+ export declare function calcOffsetLeft(insideInlineLike: boolean, insideLayout: boolean, pmViewDom: Element, wrapper?: HTMLElement): number;
19
+ type ResizableMediaSingleNextProps = Props & WrappedComponentProps;
20
+ declare class ResizableMediaSingleNext extends React.Component<ResizableMediaSingleNextProps, State> {
21
+ constructor(props: ResizableMediaSingleNextProps);
22
+ /**
23
+ * Calculate media single node initial width if props.mediaSingleWidth is undefined
24
+ * (Mainly when switching from lagacy experience to new experience).
25
+ *
26
+ * @returns initial width in pixel
27
+ */
28
+ calcInitialWidth(): number;
29
+ componentDidUpdate(prevProps: Props, prevState: State): boolean;
30
+ isNestedNode(): boolean;
31
+ private getDefaultGuidelines;
32
+ private getSnaps;
33
+ get wrappedLayout(): boolean;
34
+ componentDidMount(): Promise<void>;
35
+ UNSAFE_componentWillReceiveProps(nextProps: Props): void;
36
+ checkVideoFile(viewMediaClientConfig?: MediaClientConfig): Promise<void>;
37
+ calcNewSize: (newWidth: number, stop: boolean) => {
38
+ width: number | null;
39
+ layout: MediaSingleLayout;
40
+ };
41
+ calcUnwrappedLayout: (width: number, containerWidth: number, contentWidth: number) => 'center' | 'wide' | 'full-width';
42
+ get $pos(): import("prosemirror-model").ResolvedPos | null;
43
+ /**
44
+ * The maxmimum number of grid columns this node can resize to.
45
+ */
46
+ get gridWidth(): number;
47
+ calcColumnLeftOffset: () => number;
48
+ wrapper?: HTMLElement;
49
+ calcPxHeight: (newWidth: number) => number;
50
+ get insideInlineLike(): boolean;
51
+ get insideLayout(): boolean;
52
+ private saveWrapper;
53
+ private displayGuideline;
54
+ private setIsResizing;
55
+ render(): jsx.JSX.Element;
56
+ }
57
+ export { ResizableMediaSingleNext as UnwrappedResizableMediaSingleNext };
58
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<ResizableMediaSingleNextProps>> & {
59
+ WrappedComponent: React.ComponentType<ResizableMediaSingleNextProps>;
60
+ };
61
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
2
+ import type { EditorView } from 'prosemirror-view';
3
+ export declare const generateDefaultGuidelines: (editorWidth: number, containerWidth: number, isFullWidthMode?: boolean | undefined) => GuidelineConfig[];
4
+ export declare const generateDynamicGuidelines: (view: EditorView) => GuidelineConfig[];
@@ -0,0 +1,7 @@
1
+ export declare const messages: {
2
+ fullWidthImage: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ };
@@ -22,5 +22,6 @@ export type Props = MediaSingleProps & {
22
22
  viewMediaClientConfig?: MediaClientConfig;
23
23
  fullWidthMode?: boolean;
24
24
  dispatchAnalyticsEvent: DispatchAnalyticsEvent;
25
+ mediaSingleWidth?: number;
25
26
  pluginInjectionApi: ExtractInjectionAPI<typeof mediaPlugin> | undefined;
26
27
  };
@@ -0,0 +1,8 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ interface Props {
4
+ label: string;
5
+ containerWidth: number;
6
+ }
7
+ declare const ResizeLabel: (props: Props) => jsx.JSX.Element;
8
+ export default ResizeLabel;
@@ -0,0 +1,3 @@
1
+ export declare const wrapper: import("@emotion/react").SerializedStyles;
2
+ export declare const text: import("@emotion/react").SerializedStyles;
3
+ export declare const smallText: import("@emotion/react").SerializedStyles;