@atlaskit/editor-common 70.1.3 → 70.2.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.
Files changed (119) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/cjs/react-node-view/index.js +19 -17
  3. package/dist/cjs/styles/index.js +12 -0
  4. package/dist/cjs/styles/shared/code-block.js +5 -3
  5. package/dist/cjs/styles/shared/lists.js +4 -2
  6. package/dist/cjs/styles/shared/table.js +1 -1
  7. package/dist/cjs/types/copy-button.js +5 -0
  8. package/dist/cjs/ui/DropList/index.js +1 -1
  9. package/dist/cjs/ui/Expand/index.js +2 -2
  10. package/dist/cjs/ui/IntlProviderIfMissingWrapper/index.js +33 -0
  11. package/dist/cjs/ui/Popup/index.js +2 -2
  12. package/dist/cjs/ui/PortalProvider/index.js +62 -47
  13. package/dist/cjs/ui/index.js +8 -0
  14. package/dist/cjs/utils/breakout.js +53 -2
  15. package/dist/cjs/utils/collab.js +22 -0
  16. package/dist/cjs/utils/dom.js +16 -0
  17. package/dist/cjs/utils/get-performance-options.js +70 -0
  18. package/dist/cjs/utils/index.js +57 -1
  19. package/dist/cjs/utils/outdated-browsers.js +41 -0
  20. package/dist/cjs/utils/referentiality.js +49 -0
  21. package/dist/cjs/utils/sendLogs.js +19 -0
  22. package/dist/cjs/version.json +1 -1
  23. package/dist/cjs/with-plugin-state/index.js +61 -54
  24. package/dist/es2019/react-node-view/index.js +19 -24
  25. package/dist/es2019/styles/index.js +2 -2
  26. package/dist/es2019/styles/shared/code-block.js +13 -1
  27. package/dist/es2019/styles/shared/lists.js +2 -1
  28. package/dist/es2019/styles/shared/table.js +4 -2
  29. package/dist/es2019/types/copy-button.js +1 -0
  30. package/dist/es2019/ui/DropList/index.js +1 -1
  31. package/dist/es2019/ui/Expand/index.js +17 -15
  32. package/dist/es2019/ui/IntlProviderIfMissingWrapper/index.js +18 -0
  33. package/dist/es2019/ui/Popup/index.js +2 -1
  34. package/dist/es2019/ui/PortalProvider/index.js +33 -14
  35. package/dist/es2019/ui/index.js +2 -1
  36. package/dist/es2019/utils/breakout.js +47 -1
  37. package/dist/es2019/utils/collab.js +13 -0
  38. package/dist/es2019/utils/dom.js +16 -0
  39. package/dist/es2019/utils/get-performance-options.js +57 -0
  40. package/dist/es2019/utils/index.js +6 -2
  41. package/dist/es2019/utils/outdated-browsers.js +32 -0
  42. package/dist/es2019/utils/referentiality.js +34 -0
  43. package/dist/es2019/utils/sendLogs.js +8 -0
  44. package/dist/es2019/version.json +1 -1
  45. package/dist/es2019/with-plugin-state/index.js +55 -52
  46. package/dist/esm/react-node-view/index.js +19 -22
  47. package/dist/esm/styles/index.js +2 -2
  48. package/dist/esm/styles/shared/code-block.js +4 -3
  49. package/dist/esm/styles/shared/lists.js +2 -1
  50. package/dist/esm/styles/shared/table.js +1 -1
  51. package/dist/esm/types/copy-button.js +1 -0
  52. package/dist/esm/ui/DropList/index.js +1 -1
  53. package/dist/esm/ui/Expand/index.js +2 -2
  54. package/dist/esm/ui/IntlProviderIfMissingWrapper/index.js +19 -0
  55. package/dist/esm/ui/Popup/index.js +2 -2
  56. package/dist/esm/ui/PortalProvider/index.js +59 -48
  57. package/dist/esm/ui/index.js +2 -1
  58. package/dist/esm/utils/breakout.js +46 -1
  59. package/dist/esm/utils/collab.js +13 -0
  60. package/dist/esm/utils/dom.js +16 -0
  61. package/dist/esm/utils/get-performance-options.js +55 -0
  62. package/dist/esm/utils/index.js +6 -2
  63. package/dist/esm/utils/outdated-browsers.js +32 -0
  64. package/dist/esm/utils/referentiality.js +40 -0
  65. package/dist/esm/utils/sendLogs.js +10 -0
  66. package/dist/esm/version.json +1 -1
  67. package/dist/esm/with-plugin-state/index.js +59 -54
  68. package/dist/types/analytics/types/events.d.ts +1 -0
  69. package/dist/types/extensions/types/extension-handler.d.ts +1 -0
  70. package/dist/types/styles/index.d.ts +2 -2
  71. package/dist/types/styles/shared/code-block.d.ts +1 -0
  72. package/dist/types/styles/shared/lists.d.ts +1 -0
  73. package/dist/types/types/copy-button.d.ts +20 -0
  74. package/dist/types/types/editor-actions.d.ts +1 -0
  75. package/dist/types/types/editor-container-width.d.ts +14 -0
  76. package/dist/types/types/feature-flags.d.ts +0 -6
  77. package/dist/types/types/floating-toolbar.d.ts +23 -2
  78. package/dist/types/types/index.d.ts +2 -1
  79. package/dist/types/ui/IntlProviderIfMissingWrapper/index.d.ts +6 -0
  80. package/dist/types/ui/Popup/index.d.ts +1 -0
  81. package/dist/types/ui/PortalProvider/index.d.ts +2 -1
  82. package/dist/types/ui/index.d.ts +1 -0
  83. package/dist/types/utils/breakout.d.ts +25 -0
  84. package/dist/types/utils/collab.d.ts +2 -0
  85. package/dist/types/utils/dom.d.ts +15 -1
  86. package/dist/types/utils/get-performance-options.d.ts +18 -0
  87. package/dist/types/utils/getModeFromTheme.d.ts +1 -1
  88. package/dist/types/utils/index.d.ts +5 -1
  89. package/dist/types/utils/outdated-browsers.d.ts +1 -0
  90. package/dist/types/utils/referentiality.d.ts +3 -0
  91. package/dist/types/utils/sendLogs.d.ts +1 -0
  92. package/dist/types/with-plugin-state/index.d.ts +4 -2
  93. package/dist/types-ts4.0/analytics/types/events.d.ts +1 -0
  94. package/dist/types-ts4.0/extensions/types/extension-handler.d.ts +1 -0
  95. package/dist/types-ts4.0/styles/index.d.ts +2 -2
  96. package/dist/types-ts4.0/styles/shared/code-block.d.ts +1 -0
  97. package/dist/types-ts4.0/styles/shared/lists.d.ts +1 -0
  98. package/dist/types-ts4.0/types/copy-button.d.ts +20 -0
  99. package/dist/types-ts4.0/types/editor-actions.d.ts +1 -0
  100. package/dist/types-ts4.0/types/editor-container-width.d.ts +14 -0
  101. package/dist/types-ts4.0/types/feature-flags.d.ts +0 -6
  102. package/dist/types-ts4.0/types/floating-toolbar.d.ts +23 -2
  103. package/dist/types-ts4.0/types/index.d.ts +2 -1
  104. package/dist/types-ts4.0/ui/IntlProviderIfMissingWrapper/index.d.ts +6 -0
  105. package/dist/types-ts4.0/ui/Popup/index.d.ts +1 -0
  106. package/dist/types-ts4.0/ui/PortalProvider/index.d.ts +2 -1
  107. package/dist/types-ts4.0/ui/index.d.ts +1 -0
  108. package/dist/types-ts4.0/utils/breakout.d.ts +25 -0
  109. package/dist/types-ts4.0/utils/collab.d.ts +2 -0
  110. package/dist/types-ts4.0/utils/dom.d.ts +15 -1
  111. package/dist/types-ts4.0/utils/get-performance-options.d.ts +18 -0
  112. package/dist/types-ts4.0/utils/getModeFromTheme.d.ts +1 -1
  113. package/dist/types-ts4.0/utils/index.d.ts +5 -1
  114. package/dist/types-ts4.0/utils/outdated-browsers.d.ts +1 -0
  115. package/dist/types-ts4.0/utils/referentiality.d.ts +3 -0
  116. package/dist/types-ts4.0/utils/sendLogs.d.ts +1 -0
  117. package/dist/types-ts4.0/with-plugin-state/index.d.ts +4 -2
  118. package/package.json +9 -6
  119. package/report.api.md +7 -3
@@ -105,6 +105,7 @@ export declare type ErrorEventAttributes = {
105
105
  errorId?: string;
106
106
  docStructure?: string | SimplifiedNode;
107
107
  browserExtensions?: UserBrowserExtensionResults;
108
+ outdatedBrowser?: boolean;
108
109
  };
109
110
  declare type ComponentCrashErrorAEP = OperationalAEP<ACTION.EDITOR_CRASHED, ACTION_SUBJECT.FLOATING_CONTEXTUAL_BUTTON | ACTION_SUBJECT.PLUGIN_SLOT | ACTION_SUBJECT.REACT_NODE_VIEW | ACTION_SUBJECT.TABLES_PLUGIN | ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN | ACTION_SUBJECT.EDITOR, ACTION_SUBJECT_ID | FLOATING_CONTROLS_TITLE, ErrorEventAttributes, undefined>;
110
111
  declare type ComponentCrashAdditionalInfoErrorAEP = OperationalAEP<ACTION.EDITOR_CRASHED_ADDITIONAL_INFORMATION, ACTION_SUBJECT.EDITOR, undefined, {
@@ -8,6 +8,7 @@ export interface ExtensionParams<T extends Parameters> {
8
8
  parameters?: T;
9
9
  content?: object | string;
10
10
  localId?: string;
11
+ fragmentLocalId?: string;
11
12
  }
12
13
  export declare type ExtensionHandler<T extends Parameters = Parameters> = (ext: ExtensionParams<T>, doc: object) => JSX.Element | null;
13
14
  export declare type OnSaveCallback<T extends Parameters = Parameters> = (params: T) => void;
@@ -9,7 +9,7 @@ export { ruleSharedStyles } from './shared/rule';
9
9
  export { whitespaceSharedStyles } from './shared/whitespace';
10
10
  export { paragraphSharedStyles } from './shared/paragraph';
11
11
  export { linkSharedStyle } from './shared/link';
12
- export { listsSharedStyles } from './shared/lists';
12
+ export { listsSharedStyles, listPaddingLeftMarkerSpace } from './shared/lists';
13
13
  export { indentationSharedStyles } from './shared/indentation';
14
14
  export { blockMarksSharedStyles } from './shared/block-marks';
15
15
  export { codeMarkSharedStyles } from './shared/code-mark';
@@ -18,6 +18,6 @@ export { dateSharedStyle, DateSharedCssClassName } from './shared/date';
18
18
  export { tasksAndDecisionsStyles, TaskDecisionSharedCssClassName, } from './shared/task-decision';
19
19
  export { StatusSharedCssClassName } from './shared/status';
20
20
  export { smartCardSharedStyles, SmartCardSharedCssClassName, } from './shared/smart-card';
21
- export { CodeBlockSharedCssClassName, codeBlockSharedStyles, } from './shared/code-block';
21
+ export { CodeBlockSharedCssClassName, codeBlockSharedStyles, codeBlockInListSafariFix, } from './shared/code-block';
22
22
  export { LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from './shared/layout';
23
23
  export { EXTENSION_PADDING, BODIED_EXT_PADDING } from './shared/extension';
@@ -8,3 +8,4 @@ export declare const CodeBlockSharedCssClassName: {
8
8
  DS_CODEBLOCK: string;
9
9
  };
10
10
  export declare const codeBlockSharedStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
11
+ export declare const codeBlockInListSafariFix: import("@emotion/react").SerializedStyles;
@@ -1 +1,2 @@
1
+ export declare const listPaddingLeftMarkerSpace = 24;
1
2
  export declare const listsSharedStyles: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,20 @@
1
+ import { MarkType, NodeType } from 'prosemirror-model';
2
+ import { EditorState } from 'prosemirror-state';
3
+ import { IntlShape } from 'react-intl-next';
4
+ import { Command } from './command';
5
+ export declare type MarkOptions = {
6
+ state: EditorState;
7
+ formatMessage: IntlShape['formatMessage'];
8
+ nodeType?: undefined;
9
+ markType: MarkType;
10
+ onMouseEnter?: undefined;
11
+ onMouseLeave?: undefined;
12
+ };
13
+ export declare type NodeOptions = {
14
+ state: EditorState;
15
+ formatMessage: IntlShape['formatMessage'];
16
+ nodeType: NodeType | Array<NodeType>;
17
+ markType?: undefined;
18
+ onMouseEnter?: Command;
19
+ onMouseLeave?: Command;
20
+ };
@@ -10,6 +10,7 @@ export interface EditorActionsOptions<T = any> {
10
10
  clear(): boolean;
11
11
  getValue(): Promise<T | JSONDocNode | undefined>;
12
12
  getNodeByLocalId(id: string): Node | undefined;
13
+ getNodeByFragmentLocalId(id: string): Node | undefined;
13
14
  getSelectedNode(): Node | undefined;
14
15
  replaceDocument(rawValue: any): boolean;
15
16
  replaceSelection(rawValue: Node | Object | string): boolean;
@@ -1,6 +1,20 @@
1
1
  export declare type EditorContainerWidth = {
2
+ /**
3
+ * Starts as offsetWidth of document body, and then
4
+ * updates to the editors content areas offsetWidth
5
+ * via the use of a contentComponent (via the
6
+ * container element prop).
7
+ */
2
8
  width: number;
3
9
  containerWidth?: number;
10
+ /**
11
+ * Starts as undefined, and then updates to the
12
+ * clientWidth of the dom element the EditorView
13
+ * is attached to.
14
+ *
15
+ * Then the WidthEmitter updates this whenever the
16
+ * context panel or editor widths change.
17
+ */
4
18
  lineLength?: number;
5
19
  };
6
20
  export declare type GetEditorContainerWidth = () => EditorContainerWidth;
@@ -185,12 +185,6 @@ export declare type FeatureFlags = {
185
185
  * @default false
186
186
  */
187
187
  extendFloatingToolbar?: boolean;
188
- /**
189
- * Set editor to use the input rule with unpredictable undo results
190
- * @see https://product-fabric.atlassian.net/browse/ED-12676
191
- * @default true
192
- */
193
- useUnpredictableInputRule?: boolean;
194
188
  /**
195
189
  * Show the avatar group as a plugin
196
190
  * @see https://product-fabric.atlassian.net/browse/CERN-747
@@ -8,6 +8,7 @@ import type { DispatchAnalyticsEvent } from '../analytics/types/dispatch-analyti
8
8
  import type { ProviderFactory } from '../provider-factory';
9
9
  import type { PaletteColor } from '../ui-color/ColorPalette/Palettes/type';
10
10
  import type { Command } from './command';
11
+ import type { MarkOptions, NodeOptions } from './copy-button';
11
12
  export interface RenderOptionsPropsT<T> {
12
13
  hide: () => void;
13
14
  dispatchCommand: (command: T) => void;
@@ -54,6 +55,11 @@ export interface ConfirmDialogOptions {
54
55
  okButtonLabel?: string;
55
56
  cancelButtonLabel?: string;
56
57
  }
58
+ export declare type FloatingToolbarCopyButton = {
59
+ type: 'copy-button';
60
+ items: Array<FloatingToolbarSeparator | MarkOptions | NodeOptions>;
61
+ hidden?: boolean;
62
+ };
57
63
  export declare type FloatingToolbarButton<T> = {
58
64
  id?: string;
59
65
  type: 'button';
@@ -95,6 +101,17 @@ export declare type FloatingToolbarInput<T> = {
95
101
  };
96
102
  export declare type FloatingToolbarCustom<T> = {
97
103
  type: 'custom';
104
+ /**
105
+ * By default -- the floating toolbar supports navigating between
106
+ * items using arrow keys (to meet aria guidelines).
107
+ * In some cases the floating toolbar is being used to present
108
+ * non toolbar content -- such as the link editing experience.
109
+ * In these cases you can opt out of arrow navigation using the
110
+ * this property.
111
+ *
112
+ * @default false
113
+ */
114
+ disableArrowNavigation?: boolean;
98
115
  fallback: Array<FloatingToolbarFallbackItem<T>>;
99
116
  render: (view?: EditorView, idx?: number, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => React.ComponentClass | React.SFC | React.ReactElement<any> | null;
100
117
  hidden?: boolean;
@@ -159,8 +176,8 @@ declare type FloatingToolbarExtensionsPlaceholder = {
159
176
  * This type is restricted with the items that can be used for fallback.
160
177
  * Make sure that this type is not a FloatingToolbarCustom type.
161
178
  */
162
- export declare type FloatingToolbarFallbackItem<T> = FloatingToolbarButton<T> | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarSeparator;
163
- export declare type FloatingToolbarItem<T> = FloatingToolbarButton<T> | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarCustom<T> | FloatingToolbarSeparator | FloatingToolbarExtensionsPlaceholder;
179
+ export declare type FloatingToolbarFallbackItem<T> = FloatingToolbarButton<T> | FloatingToolbarCopyButton | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarSeparator;
180
+ export declare type FloatingToolbarItem<T> = FloatingToolbarButton<T> | FloatingToolbarCopyButton | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarCustom<T> | FloatingToolbarSeparator | FloatingToolbarExtensionsPlaceholder;
164
181
  export interface FloatingToolbarConfig {
165
182
  title: string;
166
183
  /**
@@ -172,6 +189,9 @@ export interface FloatingToolbarConfig {
172
189
  */
173
190
  getDomRef?: (view: EditorView) => HTMLElement | undefined;
174
191
  visible?: boolean;
192
+ /**
193
+ * nodeType or list of `nodeType`s this floating toolbar should be shown for.
194
+ **/
175
195
  nodeType: NodeType | NodeType[];
176
196
  items: Array<FloatingToolbarItem<Command>> | ((node: Node) => Array<FloatingToolbarItem<Command>>);
177
197
  align?: AlignType;
@@ -184,6 +204,7 @@ export interface FloatingToolbarConfig {
184
204
  ];
185
205
  forcePlacement?: boolean;
186
206
  onPositionCalculated?: (editorView: EditorView, nextPos: Position) => Position;
207
+ scrollable?: boolean;
187
208
  }
188
209
  export declare type FloatingToolbarHandler = (state: EditorState, intl: IntlShape, providerFactory: ProviderFactory) => FloatingToolbarConfig | undefined;
189
210
  export {};
@@ -18,7 +18,8 @@ export type { FeatureFlags, FeatureFlagKey, GetEditorFeatureFlags, } from './fea
18
18
  export type { Browsers, Range, DisableSpellcheckByBrowser, } from './supported-browsers';
19
19
  export type { EditorContainerWidth, GetEditorContainerWidth, } from './editor-container-width';
20
20
  export type { EmptyStateHandler, EmptyStateHandlerParams, } from './empty-state-handler';
21
- export type { RenderOptionsPropsT, DropdownOptionT, DropdownOptions, SelectOption, ButtonAppearance, Icon, RenderOptionsProps, AlignType, ConfirmDialogOptions, FloatingToolbarButton, FloatingToolbarInput, FloatingToolbarCustom, FloatingToolbarListPicker, FloatingToolbarColorPicker, FloatingToolbarEmojiPicker, FloatingToolbarDatePicker, FloatingToolbarSelect, FloatingToolbarSeparator, FloatingToolbarDropdown, FloatingToolbarFallbackItem, FloatingToolbarItem, FloatingToolbarConfig, FloatingToolbarHandler, } from './floating-toolbar';
21
+ export type { RenderOptionsPropsT, DropdownOptionT, DropdownOptions, SelectOption, ButtonAppearance, Icon, RenderOptionsProps, AlignType, ConfirmDialogOptions, FloatingToolbarButton, FloatingToolbarCopyButton, FloatingToolbarInput, FloatingToolbarCustom, FloatingToolbarListPicker, FloatingToolbarColorPicker, FloatingToolbarEmojiPicker, FloatingToolbarDatePicker, FloatingToolbarSelect, FloatingToolbarSeparator, FloatingToolbarDropdown, FloatingToolbarFallbackItem, FloatingToolbarItem, FloatingToolbarConfig, FloatingToolbarHandler, } from './floating-toolbar';
22
+ export type { MarkOptions, NodeOptions } from './copy-button';
22
23
  export type { ContextPanelHandler } from './context-panel';
23
24
  export type { EditorAppearance } from './editor-appearance';
24
25
  export type { ToolbarUiComponentFactoryParams, ToolbarUIComponentFactory, } from './toolbar';
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ interface WrapProps {
3
+ children: JSX.Element;
4
+ }
5
+ export default function IntlProviderIfMissingWrapper({ children }: WrapProps): JSX.Element;
6
+ export {};
@@ -22,6 +22,7 @@ export interface Props {
22
22
  forcePlacement?: boolean;
23
23
  allowOutOfBounds?: boolean;
24
24
  rect?: DOMRect;
25
+ style?: React.CSSProperties;
25
26
  }
26
27
  export interface State {
27
28
  popup?: HTMLElement;
@@ -37,7 +37,8 @@ export declare class PortalProviderAPI extends EventDispatcher {
37
37
  export declare const PortalProvider: React.FC<import("react-intl-next").WithIntlProps<BasePortalProviderProps>> & {
38
38
  WrappedComponent: React.ComponentType<BasePortalProviderProps>;
39
39
  };
40
- export declare const PortalProviderWithThemeProviders: (props: Omit<BasePortalProviderProps, 'intl' | 'themeMode'>) => JSX.Element;
40
+ declare type PortalProviderWithThemeProvidersProps = Omit<BasePortalProviderProps, 'intl' | 'themeMode'>;
41
+ export declare const PortalProviderWithThemeProviders: ({ onAnalyticsEvent, useAnalyticsContext, render, }: PortalProviderWithThemeProvidersProps) => JSX.Element;
41
42
  export declare class PortalRenderer extends React.Component<{
42
43
  portalProviderAPI: PortalProviderAPI;
43
44
  }, PortalRendererState> {
@@ -23,3 +23,4 @@ export type { StyleProps as ExpandStyleProps } from './Expand';
23
23
  export { ErrorMessage, HelperMessage, ValidMessage } from './Messages';
24
24
  export { clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle, } from './clear-next-sibling-margin-top';
25
25
  export { IntlErrorBoundary, REACT_INTL_ERROR_MESSAGE, } from './IntlErrorBoundary';
26
+ export { default as IntlProviderIfMissingWrapper } from './IntlProviderIfMissingWrapper';
@@ -1,3 +1,4 @@
1
+ import { BreakoutMarkAttrs } from '@atlaskit/adf-schema';
1
2
  /**
2
3
  * Variables required to construct a context for breakout ssr inline script.
3
4
  *
@@ -8,3 +9,27 @@ export declare const absoluteBreakoutWidth: (layout: 'full-width' | 'wide' | str
8
9
  export { breakoutConsts };
9
10
  export declare const calcWideWidth: any;
10
11
  export declare const calcBreakoutWidth: any;
12
+ export declare function calculateBreakoutStyles({ mode, widthStateLineLength, widthStateWidth, }: {
13
+ mode: BreakoutMarkAttrs['mode'];
14
+ /**
15
+ * offsetWidth of the content the editor is attached to.
16
+ * Expected to be retrieved via `WidthState.lineLength`.
17
+ */
18
+ widthStateWidth?: number;
19
+ /**
20
+ * clientWidth of the content area in the editor (ie. EditorPlugin contentComponents).
21
+ * Expected to be retrieved via `WidthState.width`.
22
+ */
23
+ widthStateLineLength?: number;
24
+ }): {
25
+ type: "line-length-unknown";
26
+ width: any;
27
+ transform: string;
28
+ marginLeft: string;
29
+ } | {
30
+ type: "line-length-known";
31
+ width: any;
32
+ marginLeft: string;
33
+ transform?: undefined;
34
+ };
35
+ export declare function calcBreakoutWidthPx(mode: BreakoutMarkAttrs['mode'], widthStateWidth?: number): number;
@@ -0,0 +1,2 @@
1
+ import { EditorState } from 'prosemirror-state';
2
+ export declare const getParticipantsCount: (editorState?: EditorState<any> | undefined) => any;
@@ -20,7 +20,21 @@ export declare function removeNestedEmptyEls(el: HTMLElement): void;
20
20
  export declare const containsClassName: (node: HTMLElement | SVGElement | null, className: string) => boolean;
21
21
  export declare function closest(node: HTMLElement | null | undefined, s: string): HTMLElement | null;
22
22
  export declare function closestElement(node: HTMLElement | null | undefined, s: string): HTMLElement | null;
23
- export declare function parsePx(pxStr: string): number | undefined;
23
+ /**
24
+ * Util for converting a css pixel size value to a number (of pixels).
25
+ *
26
+ * ie.
27
+ * ```ts
28
+ * const pixels = parsePx('10px')
29
+ * // ^$ const pixels: number
30
+ * ```
31
+ * * ```ts
32
+ * const pixels = parsePx('10')
33
+ * // ^$ const pixels: number | undefined
34
+ * ```
35
+ */
36
+ export declare function parsePx<PXString extends `${number}px`>(pxStr: PXString): number;
37
+ export declare function parsePx<PXString extends string>(pxStr: PXString): number | undefined;
24
38
  export declare type MapCallback<T, S> = (elem: S, idx: number, parent: Element) => T;
25
39
  export declare function mapElem<T>(elem: Element, callback: MapCallback<T, Element>): Array<T>;
26
40
  export declare function maphElem<T, U extends HTMLElement>(elem: U, callback: MapCallback<T, U>): Array<T>;
@@ -0,0 +1,18 @@
1
+ import { EditorState } from 'prosemirror-state';
2
+ import type { EditorView } from 'prosemirror-view';
3
+ import { AnalyticsEventPayload } from '../analytics';
4
+ export declare function getPerformanceOptions(view: EditorView): {
5
+ trackingEnabled: boolean;
6
+ samplingRate: number;
7
+ slowThreshold: number;
8
+ };
9
+ export declare function startMeasureReactNodeViewRendered({ nodeTypeName, }: {
10
+ nodeTypeName: string;
11
+ }): void;
12
+ export declare function stopMeasureReactNodeViewRendered({ nodeTypeName, dispatchAnalyticsEvent, editorState, samplingRate, slowThreshold, }: {
13
+ nodeTypeName: string;
14
+ dispatchAnalyticsEvent(payload: AnalyticsEventPayload): void;
15
+ editorState: EditorState;
16
+ samplingRate: number;
17
+ slowThreshold: number;
18
+ }): void;
@@ -1 +1 @@
1
- export declare function getModeFromTheme(theme: string): "dark" | "light";
1
+ export declare function getModeFromTheme(theme: string): "light" | "dark";
@@ -9,7 +9,7 @@ export type { Date } from './date';
9
9
  export { isElementInTableCell, isTextSelection, isLastItemMediaGroup, setNodeSelection, setTextSelection, nonNullable, stepAddsOneOf, stepHasSlice, extractSliceFromStep, isValidPosition, } from './editor-core-utils';
10
10
  export { withImageLoader } from './imageLoader';
11
11
  export type { ImageLoaderProps, ImageLoaderState, ImageStatus, } from './imageLoader';
12
- export { absoluteBreakoutWidth, calcBreakoutWidth, calcWideWidth, breakoutConsts, } from './breakout';
12
+ export { absoluteBreakoutWidth, calcBreakoutWidth, calcWideWidth, breakoutConsts, calculateBreakoutStyles, calcBreakoutWidthPx, } from './breakout';
13
13
  export { findChangedNodesFromTransaction, validNode, validateNodes, isType, isParagraph, isText, isLinkMark, SelectedState, isNodeSelectedOrInRange, isSupportedInParent, } from './nodes';
14
14
  export type { Reducer } from './plugin-state-factory';
15
15
  export { pluginFactory } from './plugin-state-factory';
@@ -35,6 +35,7 @@ export { ZERO_WIDTH_SPACE, ZERO_WIDTH_JOINER } from './whitespace';
35
35
  export type { Diff } from './types';
36
36
  export { shouldForceTracking } from './should-force-tracking';
37
37
  export { getModeFromTheme } from './getModeFromTheme';
38
+ export { getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered, } from './get-performance-options';
38
39
  export type { UserBrowserExtensionResults } from './browser-extensions';
39
40
  export { sniffUserBrowserExtensions } from './browser-extensions';
40
41
  export { RenderCountProfiler } from './profiler/render-count';
@@ -43,3 +44,6 @@ export { getShallowPropsDifference, getPropsDifference } from './compare-props';
43
44
  export type { ShallowPropsDifference, PropsDifference } from './compare-props';
44
45
  export { useComponentRenderTracking } from './performance/hooks/use-component-render-tracking';
45
46
  export type { UseComponentRenderTrackingArgs } from './performance/hooks/use-component-render-tracking';
47
+ export { isOutdatedBrowser } from './outdated-browsers';
48
+ export { isReferencedSource } from './referentiality';
49
+ export { sendLogs } from './sendLogs';
@@ -0,0 +1 @@
1
+ export declare const isOutdatedBrowser: (userAgent: string) => boolean;
@@ -0,0 +1,3 @@
1
+ import { Node as PMNode } from 'prosemirror-model';
2
+ import { EditorState } from 'prosemirror-state';
3
+ export declare const isReferencedSource: (state: EditorState, node?: PMNode<any> | undefined) => boolean;
@@ -0,0 +1 @@
1
+ export declare const sendLogs: (body: any) => Promise<Response>;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { PluginKey } from 'prosemirror-state';
4
4
  import { EditorView } from 'prosemirror-view';
5
- import type { EventDispatcher } from '../event-dispatcher';
5
+ import { EventDispatcher } from '../event-dispatcher';
6
6
  import type { NamedPluginKeys, NamedPluginStates } from './types';
7
7
  export declare type PerformanceOptions = {
8
8
  samplingRate: number;
@@ -13,7 +13,7 @@ export interface State {
13
13
  [name: string]: any;
14
14
  }
15
15
  declare type ContextUpdateHandler = (editorView: EditorView, eventDispatcher: EventDispatcher) => void;
16
- declare type EditorActionsPrivateAccess = {
16
+ export declare type EditorActionsPrivateAccess = {
17
17
  _privateGetEditorView: () => EditorView;
18
18
  _privateGetEventDispatcher: () => EventDispatcher;
19
19
  _privateSubscribe: (cb: ContextUpdateHandler) => void;
@@ -59,6 +59,7 @@ declare class WithPluginState<P extends NamedPluginKeys> extends React.Component
59
59
  private debounce;
60
60
  private notAppliedState;
61
61
  private isSubscribed;
62
+ private callsCount;
62
63
  static contextTypes: {
63
64
  editorActions: PropTypes.Requireable<object>;
64
65
  editorSharedConfig: PropTypes.Requireable<object>;
@@ -72,6 +73,7 @@ declare class WithPluginState<P extends NamedPluginKeys> extends React.Component
72
73
  * Debounces setState calls in order to reduce number of re-renders caused by several plugin state changes.
73
74
  */
74
75
  private updateState;
76
+ private dispatchAnalyticsEvent;
75
77
  private getPluginsStates;
76
78
  private subscribe;
77
79
  private unsubscribe;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "70.1.3",
3
+ "version": "70.2.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -71,7 +71,7 @@
71
71
  "@atlaskit/analytics-namespaced-context": "^6.5.0",
72
72
  "@atlaskit/analytics-next": "^8.2.0",
73
73
  "@atlaskit/analytics-next-stable-react-context": "1.0.1",
74
- "@atlaskit/button": "^16.3.0",
74
+ "@atlaskit/button": "^16.4.0",
75
75
  "@atlaskit/code": "^14.4.0",
76
76
  "@atlaskit/codemod-utils": "^4.1.0",
77
77
  "@atlaskit/editor-json-transformer": "^8.8.0",
@@ -79,11 +79,11 @@
79
79
  "@atlaskit/emoji": "^66.0.0",
80
80
  "@atlaskit/icon": "^21.11.0",
81
81
  "@atlaskit/in-product-testing": "^0.1.0",
82
- "@atlaskit/media-card": "^74.1.0",
83
- "@atlaskit/media-client": "^18.0.0",
82
+ "@atlaskit/media-card": "^74.2.0",
83
+ "@atlaskit/media-client": "^18.1.0",
84
84
  "@atlaskit/media-picker": "^64.0.0",
85
85
  "@atlaskit/mention": "^21.0.0",
86
- "@atlaskit/menu": "^1.3.0",
86
+ "@atlaskit/menu": "^1.4.0",
87
87
  "@atlaskit/profilecard": "^17.2.0",
88
88
  "@atlaskit/smart-card": "^23.1.0",
89
89
  "@atlaskit/smart-user-picker": "^6.0.0",
@@ -145,7 +145,10 @@
145
145
  },
146
146
  "@repo/internal": {
147
147
  "deprecation": "no-deprecated-imports",
148
- "theming": "tokens"
148
+ "theming": "tokens",
149
+ "styling": [
150
+ "emotion"
151
+ ]
149
152
  }
150
153
  },
151
154
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
package/report.api.md CHANGED
@@ -1,9 +1,13 @@
1
- ## API Report File for "@atlaskit/editor-common".
1
+ ## API Report File for "@atlaskit/editor-common"
2
2
 
3
- > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ <!--
6
+ Generated API Report version: 2.0
7
+ -->
4
8
 
5
9
  [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
6
10
 
7
11
  ```ts
8
- export {};
12
+ // (No @packageDocumentation comment for this package)
9
13
  ```