@atlaskit/editor-common 76.33.2 → 76.35.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 (118) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/cjs/collab/index.js +27 -2
  3. package/dist/cjs/core-utils/document-logger.js +171 -0
  4. package/dist/cjs/core-utils/index.js +8 -1
  5. package/dist/cjs/extensibility/Extension/Extension/index.js +151 -0
  6. package/dist/cjs/extensibility/Extension/Extension/styles.js +17 -0
  7. package/dist/cjs/extensibility/Extension/InlineExtension/index.js +50 -0
  8. package/dist/cjs/extensibility/Extension/InlineExtension/styles.js +12 -0
  9. package/dist/cjs/extensibility/Extension/Lozenge.js +95 -0
  10. package/dist/cjs/extensibility/Extension/styles.js +30 -0
  11. package/dist/cjs/extensibility/Extension.js +79 -0
  12. package/dist/cjs/extensibility/ExtensionComponent.js +252 -0
  13. package/dist/cjs/extensibility/ExtensionNodeWrapper.js +21 -0
  14. package/dist/cjs/extensibility/MultiBodiedExtension/index.js +264 -0
  15. package/dist/cjs/extensibility/extensionNodeView.js +91 -0
  16. package/dist/cjs/extensibility/index.js +42 -0
  17. package/dist/cjs/extensibility/types.js +5 -0
  18. package/dist/cjs/media-inline/media-inline-image-card.js +24 -19
  19. package/dist/cjs/monitoring/error.js +3 -2
  20. package/dist/cjs/ui/DropList/index.js +1 -1
  21. package/dist/cjs/utils/index.js +7 -0
  22. package/dist/cjs/utils/insert-node-into-ordered-list.js +91 -0
  23. package/dist/es2019/collab/index.js +54 -1
  24. package/dist/es2019/core-utils/document-logger.js +161 -0
  25. package/dist/es2019/core-utils/index.js +2 -1
  26. package/dist/es2019/extensibility/Extension/Extension/index.js +155 -0
  27. package/dist/es2019/extensibility/Extension/Extension/styles.js +42 -0
  28. package/dist/es2019/extensibility/Extension/InlineExtension/index.js +26 -0
  29. package/dist/es2019/extensibility/Extension/InlineExtension/styles.js +26 -0
  30. package/dist/es2019/extensibility/Extension/Lozenge.js +71 -0
  31. package/dist/es2019/extensibility/Extension/styles.js +62 -0
  32. package/dist/es2019/extensibility/Extension.js +52 -0
  33. package/dist/es2019/extensibility/ExtensionComponent.js +204 -0
  34. package/dist/es2019/extensibility/ExtensionNodeWrapper.js +13 -0
  35. package/dist/es2019/extensibility/MultiBodiedExtension/index.js +283 -0
  36. package/dist/es2019/extensibility/extensionNodeView.js +62 -0
  37. package/dist/es2019/extensibility/index.js +4 -0
  38. package/dist/es2019/extensibility/types.js +1 -0
  39. package/dist/es2019/media-inline/media-inline-image-card.js +24 -19
  40. package/dist/es2019/monitoring/error.js +3 -2
  41. package/dist/es2019/ui/DropList/index.js +1 -1
  42. package/dist/es2019/utils/index.js +1 -0
  43. package/dist/es2019/utils/insert-node-into-ordered-list.js +84 -0
  44. package/dist/esm/collab/index.js +23 -1
  45. package/dist/esm/core-utils/document-logger.js +165 -0
  46. package/dist/esm/core-utils/index.js +2 -1
  47. package/dist/esm/extensibility/Extension/Extension/index.js +146 -0
  48. package/dist/esm/extensibility/Extension/Extension/styles.js +10 -0
  49. package/dist/esm/extensibility/Extension/InlineExtension/index.js +43 -0
  50. package/dist/esm/extensibility/Extension/InlineExtension/styles.js +5 -0
  51. package/dist/esm/extensibility/Extension/Lozenge.js +90 -0
  52. package/dist/esm/extensibility/Extension/styles.js +11 -0
  53. package/dist/esm/extensibility/Extension.js +69 -0
  54. package/dist/esm/extensibility/ExtensionComponent.js +243 -0
  55. package/dist/esm/extensibility/ExtensionNodeWrapper.js +14 -0
  56. package/dist/esm/extensibility/MultiBodiedExtension/index.js +257 -0
  57. package/dist/esm/extensibility/extensionNodeView.js +83 -0
  58. package/dist/esm/extensibility/index.js +4 -0
  59. package/dist/esm/extensibility/types.js +1 -0
  60. package/dist/esm/media-inline/media-inline-image-card.js +24 -19
  61. package/dist/esm/monitoring/error.js +3 -2
  62. package/dist/esm/ui/DropList/index.js +1 -1
  63. package/dist/esm/utils/index.js +1 -0
  64. package/dist/esm/utils/insert-node-into-ordered-list.js +84 -0
  65. package/dist/types/collab/index.d.ts +7 -0
  66. package/dist/types/core-utils/document-logger.d.ts +6 -0
  67. package/dist/types/core-utils/index.d.ts +1 -0
  68. package/dist/types/extensibility/Extension/Extension/index.d.ts +108 -0
  69. package/dist/types/extensibility/Extension/Extension/styles.d.ts +5 -0
  70. package/dist/types/extensibility/Extension/InlineExtension/index.d.ts +12 -0
  71. package/dist/types/extensibility/Extension/InlineExtension/styles.d.ts +1 -0
  72. package/dist/types/extensibility/Extension/Lozenge.d.ts +14 -0
  73. package/dist/types/extensibility/Extension/styles.d.ts +7 -0
  74. package/dist/types/extensibility/Extension.d.ts +29 -0
  75. package/dist/types/extensibility/ExtensionComponent.d.ts +53 -0
  76. package/dist/types/extensibility/ExtensionNodeWrapper.d.ts +14 -0
  77. package/dist/types/extensibility/MultiBodiedExtension/index.d.ts +26 -0
  78. package/dist/types/extensibility/extensionNodeView.d.ts +31 -0
  79. package/dist/types/extensibility/index.d.ts +4 -0
  80. package/dist/types/extensibility/types.d.ts +6 -0
  81. package/dist/types/extensions/types/extension-handler.d.ts +2 -0
  82. package/dist/types/media-inline/media-inline-image-card.d.ts +3 -2
  83. package/dist/types/media-inline/types.d.ts +6 -2
  84. package/dist/types/types/index.d.ts +1 -1
  85. package/dist/types/types/next-editor-plugin.d.ts +0 -1
  86. package/dist/types/ui/DropList/index.d.ts +1 -1
  87. package/dist/types/ui-menu/ColorPickerButton/index.d.ts +1 -1
  88. package/dist/types/ui-menu/ToolbarButton/index.d.ts +1 -1
  89. package/dist/types/utils/index.d.ts +1 -0
  90. package/dist/types/utils/insert-node-into-ordered-list.d.ts +3 -0
  91. package/dist/types-ts4.5/collab/index.d.ts +7 -0
  92. package/dist/types-ts4.5/core-utils/document-logger.d.ts +6 -0
  93. package/dist/types-ts4.5/core-utils/index.d.ts +1 -0
  94. package/dist/types-ts4.5/extensibility/Extension/Extension/index.d.ts +108 -0
  95. package/dist/types-ts4.5/extensibility/Extension/Extension/styles.d.ts +5 -0
  96. package/dist/types-ts4.5/extensibility/Extension/InlineExtension/index.d.ts +12 -0
  97. package/dist/types-ts4.5/extensibility/Extension/InlineExtension/styles.d.ts +1 -0
  98. package/dist/types-ts4.5/extensibility/Extension/Lozenge.d.ts +14 -0
  99. package/dist/types-ts4.5/extensibility/Extension/styles.d.ts +7 -0
  100. package/dist/types-ts4.5/extensibility/Extension.d.ts +29 -0
  101. package/dist/types-ts4.5/extensibility/ExtensionComponent.d.ts +53 -0
  102. package/dist/types-ts4.5/extensibility/ExtensionNodeWrapper.d.ts +14 -0
  103. package/dist/types-ts4.5/extensibility/MultiBodiedExtension/index.d.ts +26 -0
  104. package/dist/types-ts4.5/extensibility/extensionNodeView.d.ts +31 -0
  105. package/dist/types-ts4.5/extensibility/index.d.ts +4 -0
  106. package/dist/types-ts4.5/extensibility/types.d.ts +8 -0
  107. package/dist/types-ts4.5/extensions/types/extension-handler.d.ts +2 -0
  108. package/dist/types-ts4.5/media-inline/media-inline-image-card.d.ts +3 -2
  109. package/dist/types-ts4.5/media-inline/types.d.ts +6 -2
  110. package/dist/types-ts4.5/types/index.d.ts +1 -1
  111. package/dist/types-ts4.5/types/next-editor-plugin.d.ts +0 -3
  112. package/dist/types-ts4.5/ui/DropList/index.d.ts +1 -1
  113. package/dist/types-ts4.5/ui-menu/ColorPickerButton/index.d.ts +1 -1
  114. package/dist/types-ts4.5/ui-menu/ToolbarButton/index.d.ts +1 -1
  115. package/dist/types-ts4.5/utils/index.d.ts +1 -0
  116. package/dist/types-ts4.5/utils/insert-node-into-ordered-list.d.ts +3 -0
  117. package/extensibility/package.json +15 -0
  118. package/package.json +6 -5
@@ -17,5 +17,5 @@ export type OpenChangedEvent = {
17
17
  isOpen: boolean;
18
18
  event: MouseEvent | KeyboardEvent;
19
19
  };
20
- declare const _default: import("react").ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "key" | "id" | "children" | "position" | "testId" | "analyticsContext" | "shouldFitContainer" | "onPositioned" | "isOpen" | "trigger" | "onOpenChange"> & import("react").RefAttributes<any>>;
20
+ declare const _default: import("react").ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "position" | "key" | "id" | "children" | "testId" | "analyticsContext" | "shouldFitContainer" | "onPositioned" | "isOpen" | "trigger" | "onOpenChange"> & import("react").RefAttributes<any>>;
21
21
  export default _default;
@@ -26,5 +26,5 @@ type Props = WithAnalyticsEventsProps & {
26
26
  skipFocusButtonAfterPick?: boolean;
27
27
  absoluteOffset?: PopupPosition;
28
28
  };
29
- declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "onChange" | "title" | "key" | "size" | "placement" | "alignX" | "absoluteOffset" | "currentColor" | "analyticsContext" | "cols" | "hexToPaletteColor" | "paletteColorTooltipMessages" | "colorPalette" | "mountPoint" | "setDisableParentScroll" | "skipFocusButtonAfterPick"> & React.RefAttributes<any>>;
29
+ declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "size" | "currentColor" | "onChange" | "title" | "key" | "placement" | "alignX" | "absoluteOffset" | "analyticsContext" | "cols" | "hexToPaletteColor" | "paletteColorTooltipMessages" | "colorPalette" | "mountPoint" | "setDisableParentScroll" | "skipFocusButtonAfterPick"> & React.RefAttributes<any>>;
30
30
  export default _default;
@@ -42,7 +42,7 @@ declare const ToolbarButton: React.ForwardRefExoticComponent<{
42
42
  onItemClick?: ((item: MenuItem) => void) | undefined;
43
43
  onKeyDown?: ((event: React.KeyboardEvent<HTMLElement>) => void) | undefined;
44
44
  selected?: boolean | undefined;
45
- spacing?: "default" | "none" | "compact" | undefined;
45
+ spacing?: "none" | "default" | "compact" | undefined;
46
46
  target?: string | undefined;
47
47
  title?: React.ReactNode;
48
48
  titlePosition?: PositionType | undefined;
@@ -82,6 +82,7 @@ export declare function isNodeEmpty(node?: PMNode): boolean;
82
82
  export declare function isInEmptyLine(state: EditorState): boolean;
83
83
  export { dedupe } from './dedupe';
84
84
  export { createWrapSelectionTransaction } from './create-wrap-selection-transaction';
85
+ export { transformNodeIntoListItem } from './insert-node-into-ordered-list';
85
86
  export { wrapSelectionIn } from './wrap-selection-in';
86
87
  export { toJSON, nodeToJSON } from './nodes';
87
88
  export { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead, } from './calculate-toolbar-position';
@@ -0,0 +1,3 @@
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
3
+ export declare function transformNodeIntoListItem(tr: Transaction, node: PMNode): Transaction;
@@ -376,4 +376,11 @@ export interface CollabAnalyticsProps {
376
376
  export interface CollabEventLocalStepData {
377
377
  steps: Array<Step>;
378
378
  }
379
+ export interface Color {
380
+ solid: string;
381
+ selection: string;
382
+ }
383
+ export declare const colors: Color[];
384
+ export declare const TELEPOINTER_DIM_CLASS = "telepointer-dim";
385
+ export declare const telepointerStyle: import("@emotion/react").SerializedStyles;
379
386
  export {};
@@ -0,0 +1,6 @@
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { SimplifiedNode } from '../analytics';
3
+ export type { SimplifiedNode };
4
+ export declare const getDocStructure: (doc: PMNode, options?: {
5
+ compact?: boolean;
6
+ }) => SimplifiedNode | string;
@@ -1 +1,2 @@
1
1
  export { insideTable } from './inside';
2
+ export { getDocStructure } from './document-logger';
@@ -0,0 +1,108 @@
1
+ import React from 'react';
2
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ import type { ExtensionProvider, ReferenceEntity } from '../../../extensions';
5
+ import type { ProsemirrorGetPosHandler } from '../../../react-node-view';
6
+ import type { EditorAppearance } from '../../../types';
7
+ import type { ExtensionsPluginInjectionAPI } from '../../types';
8
+ export interface Props {
9
+ node: PmNode;
10
+ getPos: ProsemirrorGetPosHandler;
11
+ view: EditorView;
12
+ extensionProvider?: ExtensionProvider;
13
+ handleContentDOMRef: (node: HTMLElement | null) => void;
14
+ children?: React.ReactNode;
15
+ references?: ReferenceEntity[];
16
+ hideFrame?: boolean;
17
+ editorAppearance?: EditorAppearance;
18
+ pluginInjectionApi: ExtensionsPluginInjectionAPI;
19
+ }
20
+ /**
21
+ * End workaround
22
+ */
23
+ declare const _default: {
24
+ new (props: Props | Readonly<Props>): {
25
+ overflowContainer?: HTMLElement | null | undefined;
26
+ container?: HTMLElement | undefined;
27
+ shadowObserver?: import("../../../ui").ShadowObserver | undefined;
28
+ overflowContainerWidth: number;
29
+ scrollable?: NodeList | undefined;
30
+ diff?: number | undefined;
31
+ state: {
32
+ showLeftShadow: boolean;
33
+ showRightShadow: boolean;
34
+ };
35
+ componentWillUnmount(): void;
36
+ componentDidUpdate(): void;
37
+ handleScroll: (event: Event) => void;
38
+ updateShadows: () => void;
39
+ showLeftShadow: (overflowContainer: HTMLElement | null | undefined) => boolean;
40
+ calcOverflowDiff: () => number;
41
+ calcScrollableWidth: () => number;
42
+ handleContainer: (container: HTMLElement | null) => void;
43
+ initShadowObserver(): void;
44
+ render(): JSX.Element;
45
+ context: any;
46
+ setState<K extends keyof import("../../../ui").OverflowShadowState>(state: import("../../../ui").OverflowShadowState | ((prevState: Readonly<import("../../../ui").OverflowShadowState>, props: Readonly<Props>) => import("../../../ui").OverflowShadowState | Pick<import("../../../ui").OverflowShadowState, K> | null) | Pick<import("../../../ui").OverflowShadowState, K> | null, callback?: (() => void) | undefined): void;
47
+ forceUpdate(callback?: (() => void) | undefined): void;
48
+ readonly props: Readonly<Props> & Readonly<{
49
+ children?: React.ReactNode;
50
+ }>;
51
+ refs: {
52
+ [key: string]: React.ReactInstance;
53
+ };
54
+ componentDidMount?(): void;
55
+ shouldComponentUpdate?(nextProps: Readonly<Props>, nextState: Readonly<import("../../../ui").OverflowShadowState>, nextContext: any): boolean;
56
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
57
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Props>, prevState: Readonly<import("../../../ui").OverflowShadowState>): any;
58
+ componentWillMount?(): void;
59
+ UNSAFE_componentWillMount?(): void;
60
+ componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
61
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
62
+ componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<import("../../../ui").OverflowShadowState>, nextContext: any): void;
63
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<import("../../../ui").OverflowShadowState>, nextContext: any): void;
64
+ };
65
+ new (props: Props, context: any): {
66
+ overflowContainer?: HTMLElement | null | undefined;
67
+ container?: HTMLElement | undefined;
68
+ shadowObserver?: import("../../../ui").ShadowObserver | undefined;
69
+ overflowContainerWidth: number;
70
+ scrollable?: NodeList | undefined;
71
+ diff?: number | undefined;
72
+ state: {
73
+ showLeftShadow: boolean;
74
+ showRightShadow: boolean;
75
+ };
76
+ componentWillUnmount(): void;
77
+ componentDidUpdate(): void;
78
+ handleScroll: (event: Event) => void;
79
+ updateShadows: () => void;
80
+ showLeftShadow: (overflowContainer: HTMLElement | null | undefined) => boolean;
81
+ calcOverflowDiff: () => number;
82
+ calcScrollableWidth: () => number;
83
+ handleContainer: (container: HTMLElement | null) => void;
84
+ initShadowObserver(): void;
85
+ render(): JSX.Element;
86
+ context: any;
87
+ setState<K extends keyof import("../../../ui").OverflowShadowState>(state: import("../../../ui").OverflowShadowState | ((prevState: Readonly<import("../../../ui").OverflowShadowState>, props: Readonly<Props>) => import("../../../ui").OverflowShadowState | Pick<import("../../../ui").OverflowShadowState, K> | null) | Pick<import("../../../ui").OverflowShadowState, K> | null, callback?: (() => void) | undefined): void;
88
+ forceUpdate(callback?: (() => void) | undefined): void;
89
+ readonly props: Readonly<Props> & Readonly<{
90
+ children?: React.ReactNode;
91
+ }>;
92
+ refs: {
93
+ [key: string]: React.ReactInstance;
94
+ };
95
+ componentDidMount?(): void;
96
+ shouldComponentUpdate?(nextProps: Readonly<Props>, nextState: Readonly<import("../../../ui").OverflowShadowState>, nextContext: any): boolean;
97
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
98
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Props>, prevState: Readonly<import("../../../ui").OverflowShadowState>): any;
99
+ componentWillMount?(): void;
100
+ UNSAFE_componentWillMount?(): void;
101
+ componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
102
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
103
+ componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<import("../../../ui").OverflowShadowState>, nextContext: any): void;
104
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<import("../../../ui").OverflowShadowState>, nextContext: any): void;
105
+ };
106
+ contextType?: React.Context<any> | undefined;
107
+ };
108
+ export default _default;
@@ -0,0 +1,5 @@
1
+ export declare const widerLayoutClassName = "wider-layout";
2
+ export declare const wrapperStyle: import("@emotion/react").SerializedStyles;
3
+ export declare const header: import("@emotion/react").SerializedStyles;
4
+ export declare const content: import("@emotion/react").SerializedStyles;
5
+ export declare const contentWrapper: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,12 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { Component } from 'react';
4
+ import { jsx } from '@emotion/react';
5
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
6
+ export interface Props {
7
+ node: PmNode;
8
+ children?: React.ReactNode;
9
+ }
10
+ export default class InlineExtension extends Component<Props, any> {
11
+ render(): jsx.JSX.Element;
12
+ }
@@ -0,0 +1 @@
1
+ export declare const wrapperStyle: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,14 @@
1
+ /** @jsx jsx */
2
+ import { Component } from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
5
+ export declare const capitalizeFirstLetter: (str: string) => string;
6
+ export interface Props {
7
+ node: PmNode;
8
+ }
9
+ export declare const ICON_SIZE = 24;
10
+ export default class ExtensionLozenge extends Component<Props, any> {
11
+ render(): jsx.JSX.Element;
12
+ private renderImage;
13
+ private renderFallback;
14
+ }
@@ -0,0 +1,7 @@
1
+ import { BODIED_EXT_PADDING, EXTENSION_PADDING } from '../../styles';
2
+ export { EXTENSION_PADDING as padding, BODIED_EXT_PADDING };
3
+ export declare const wrapperDefault: import("@emotion/react").SerializedStyles;
4
+ export declare const overlay: import("@emotion/react").SerializedStyles;
5
+ export declare const placeholderFallback: import("@emotion/react").SerializedStyles;
6
+ export declare const placeholderFallbackParams: import("@emotion/react").SerializedStyles;
7
+ export declare const styledImage: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,29 @@
1
+ import { Component } from 'react';
2
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ import type { EventDispatcher } from '../event-dispatcher';
5
+ import type { ExtensionHandlers, ReferenceEntity } from '../extensions';
6
+ import { ProviderFactory } from '../provider-factory';
7
+ import type { ProsemirrorGetPosHandler } from '../react-node-view';
8
+ import type { EditorAppearance } from '../types';
9
+ import type { ExtensionsPluginInjectionAPI } from './types';
10
+ export interface Props {
11
+ editorView: EditorView;
12
+ node: PMNode;
13
+ getPos: ProsemirrorGetPosHandler;
14
+ providerFactory?: ProviderFactory;
15
+ handleContentDOMRef: (node: HTMLElement | null) => void;
16
+ extensionHandlers: ExtensionHandlers;
17
+ references?: ReferenceEntity[];
18
+ editorAppearance?: EditorAppearance;
19
+ pluginInjectionApi: ExtensionsPluginInjectionAPI;
20
+ eventDispatcher?: EventDispatcher;
21
+ }
22
+ export declare class Extension extends Component<Props, any> {
23
+ static displayName: string;
24
+ private providerFactory;
25
+ constructor(props: Props);
26
+ componentWillUnmount(): void;
27
+ private renderWithProvider;
28
+ render(): JSX.Element;
29
+ }
@@ -0,0 +1,53 @@
1
+ import { Component } from 'react';
2
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ import type { EventDispatcher } from '../event-dispatcher';
5
+ import { getExtensionModuleNodePrivateProps, getNodeRenderer } from '../extensions';
6
+ import type { ExtensionHandlers, ExtensionProvider, ReferenceEntity } from '../extensions';
7
+ import type { ProsemirrorGetPosHandler } from '../react-node-view';
8
+ import type { EditorAppearance } from '../types';
9
+ import type { ExtensionsPluginInjectionAPI } from './types';
10
+ export interface Props {
11
+ editorView: EditorView;
12
+ node: PMNode;
13
+ getPos: ProsemirrorGetPosHandler;
14
+ handleContentDOMRef: (node: HTMLElement | null) => void;
15
+ extensionHandlers: ExtensionHandlers;
16
+ extensionProvider?: Promise<ExtensionProvider>;
17
+ references?: ReferenceEntity[];
18
+ editorAppearance?: EditorAppearance;
19
+ pluginInjectionApi: ExtensionsPluginInjectionAPI;
20
+ eventDispatcher?: EventDispatcher;
21
+ }
22
+ export interface State {
23
+ extensionProvider?: ExtensionProvider;
24
+ extensionHandlersFromProvider?: ExtensionHandlers;
25
+ _privateProps?: {
26
+ __hideFrame?: boolean;
27
+ };
28
+ activeChildIndex?: number;
29
+ }
30
+ export declare class ExtensionComponent extends Component<Props, State> {
31
+ private privatePropsParsed;
32
+ state: State;
33
+ mounted: boolean;
34
+ UNSAFE_componentWillMount(): void;
35
+ componentDidMount(): void;
36
+ componentDidUpdate(): void;
37
+ componentWillUnmount(): void;
38
+ UNSAFE_componentWillReceiveProps(nextProps: Props): void;
39
+ getNodeRenderer: import("memoize-one").MemoizedFn<typeof getNodeRenderer>;
40
+ getExtensionModuleNodePrivateProps: import("memoize-one").MemoizedFn<typeof getExtensionModuleNodePrivateProps>;
41
+ render(): JSX.Element | null;
42
+ private setStateFromPromise;
43
+ /**
44
+ * Parses any private nodes once an extension provider is available.
45
+ *
46
+ * We do this separately from resolving a node renderer component since the
47
+ * private props come from extension provider, rather than an extension
48
+ * handler which only handles `render`/component concerns.
49
+ */
50
+ private parsePrivateNodePropsIfNeeded;
51
+ private tryExtensionHandler;
52
+ private handleExtension;
53
+ }
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ children: React.ReactNode;
4
+ nodeType: string;
5
+ };
6
+ /**
7
+ * If inlineExtension, add zero width space to the end of the nodes and wrap with span;
8
+ * else wrap with a div (for multi bodied extensions)
9
+ *
10
+ * @param param0
11
+ * @returns
12
+ */
13
+ export declare const ExtensionNodeWrapper: ({ children, nodeType }: Props) => JSX.Element;
14
+ export {};
@@ -0,0 +1,26 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
5
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
+ import type { EventDispatcher } from '../../event-dispatcher';
7
+ import type { MultiBodiedExtensionActions } from '../../extensions';
8
+ import type { EditorAppearance } from '../../types';
9
+ import type { OverflowShadowProps } from '../../ui';
10
+ import type { ExtensionsPluginInjectionAPI } from '../types';
11
+ export type TryExtensionHandlerType = (actions: MultiBodiedExtensionActions | undefined) => React.ReactElement | null;
12
+ type Props = {
13
+ node: PmNode;
14
+ handleContentDOMRef: (node: HTMLElement | null) => void;
15
+ editorView: EditorView;
16
+ getPos: () => number | undefined;
17
+ tryExtensionHandler: TryExtensionHandlerType;
18
+ eventDispatcher?: EventDispatcher;
19
+ pluginInjectionApi?: ExtensionsPluginInjectionAPI;
20
+ editorAppearance?: EditorAppearance;
21
+ };
22
+ declare const MultiBodiedExtension: (props: Props & OverflowShadowProps) => jsx.JSX.Element;
23
+ /**
24
+ * End workaround
25
+ */
26
+ export default MultiBodiedExtension;
@@ -0,0 +1,31 @@
1
+ /// <reference types="react" />
2
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
+ import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
4
+ import type { EventDispatcher } from '../event-dispatcher';
5
+ import type { ExtensionHandlers } from '../extensions';
6
+ import type { ProviderFactory } from '../provider-factory';
7
+ import type { ForwardRef, getPosHandler } from '../react-node-view';
8
+ import ReactNodeView from '../react-node-view';
9
+ import type { EditorAppearance } from '../types';
10
+ import type { PortalProviderAPI } from '../ui/PortalProvider';
11
+ import type { ExtensionsPluginInjectionAPI } from './types';
12
+ interface ExtensionNodeViewOptions {
13
+ appearance?: EditorAppearance;
14
+ }
15
+ export declare class ExtensionNode extends ReactNodeView {
16
+ ignoreMutation(mutation: MutationRecord | {
17
+ type: 'selection';
18
+ target: Element;
19
+ }): boolean;
20
+ getContentDOM(): {
21
+ dom: HTMLDivElement;
22
+ } | undefined;
23
+ render(props: {
24
+ providerFactory: ProviderFactory;
25
+ extensionHandlers: ExtensionHandlers;
26
+ extensionNodeViewOptions?: ExtensionNodeViewOptions;
27
+ pluginInjectionApi: ExtensionsPluginInjectionAPI;
28
+ }, forwardRef: ForwardRef): JSX.Element;
29
+ }
30
+ export default function ExtensionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, extensionNodeViewOptions: ExtensionNodeViewOptions, pluginInjectionApi: ExtensionsPluginInjectionAPI): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
31
+ export {};
@@ -0,0 +1,4 @@
1
+ export { ExtensionNodeWrapper } from './ExtensionNodeWrapper';
2
+ export { Extension } from './Extension';
3
+ export { default as ExtensionNodeView, ExtensionNode, } from './extensionNodeView';
4
+ export { ExtensionComponent } from './ExtensionComponent';
@@ -0,0 +1,8 @@
1
+ import type { EditorContainerWidth, NextEditorPlugin, PublicPluginAPI } from '../types';
2
+ type WidthPluginType = NextEditorPlugin<'width', {
3
+ sharedState: EditorContainerWidth | undefined;
4
+ }>;
5
+ export type ExtensionsPluginInjectionAPI = PublicPluginAPI<[
6
+ WidthPluginType
7
+ ]> | undefined;
8
+ export {};
@@ -9,6 +9,8 @@ export interface ExtensionParams<T extends Parameters> {
9
9
  content?: object | string;
10
10
  localId?: string;
11
11
  fragmentLocalId?: string;
12
+ maxFrames?: number;
13
+ layout?: string;
12
14
  }
13
15
  export type ExtensionHandler<T extends Parameters = Parameters> = (ext: ExtensionParams<T>, doc: object, actions?: MultiBodiedExtensionActions) => JSX.Element | null;
14
16
  export type OnSaveCallback<T extends Parameters = Parameters> = (params: T) => void;
@@ -2,16 +2,17 @@
2
2
  import type { FC } from 'react';
3
3
  import type { WrappedComponentProps } from 'react-intl-next';
4
4
  import type { FileIdentifier, MediaClient } from '@atlaskit/media-client';
5
- import type { MediaInlineAttrs } from './types';
5
+ import type { MediaInlineAttrs, MediaSSR } from './types';
6
6
  export interface MediaInlineImageCardProps {
7
7
  identifier: FileIdentifier;
8
- mediaClient: MediaClient;
8
+ mediaClient?: MediaClient;
9
9
  isSelected?: boolean;
10
10
  isLazy?: boolean;
11
11
  border?: {
12
12
  borderSize?: number;
13
13
  borderColor?: string;
14
14
  };
15
+ ssr?: MediaSSR;
15
16
  }
16
17
  export declare const MediaInlineImageCardInternal: FC<MediaInlineImageCardProps & WrappedComponentProps & MediaInlineAttrs>;
17
18
  export declare const MediaInlineImageCard: FC<MediaInlineImageCardProps & MediaInlineAttrs>;
@@ -1,8 +1,12 @@
1
+ import type { SSR } from '@atlaskit/media-common';
2
+ import type { MediaClientConfig } from '@atlaskit/media-core';
1
3
  export type MediaInlineAttrs = {
2
4
  type?: string;
3
5
  alt?: string;
4
6
  width?: number;
5
7
  height?: number;
6
- borderSize?: number;
7
- borderColor?: string;
8
+ };
9
+ export type MediaSSR = {
10
+ mode: SSR;
11
+ config: MediaClientConfig;
8
12
  };
@@ -28,7 +28,7 @@ export type { EditorReactContext } from './editor-react-context';
28
28
  export type { PMPluginFactoryParams, PMPluginFactory, PMPlugin, } from './plugin-factory';
29
29
  export type { NodeConfig, MarkConfig, NodeViewConfig, } from './prosemirror-config';
30
30
  export type { PluginsOptions, EditorPlugin, getPosHandler, getPosHandlerNode, } from './editor-plugin';
31
- export type { NextEditorPlugin, AllEditorPresetPluginTypes, PluginDependenciesAPI, ExtractPluginNameFromAllBuilderPlugins, SafePresetCheck, DefaultEditorPlugin, OptionalPlugin, PluginInjectionAPI, CreatePluginDependenciesAPI, NextEditorPluginMetadata, ExtractInjectionAPI, ExtractPluginActions, PluginInjectionAPIWithDependency, PluginInjectionAPIWithDependencies, PublicPluginAPI, NextEditorPluginFunctionOptionalConfigDefinition, ExtractNextEditorPlugins, } from './next-editor-plugin';
31
+ export type { NextEditorPlugin, AllEditorPresetPluginTypes, PluginDependenciesAPI, ExtractPluginNameFromAllBuilderPlugins, SafePresetCheck, DefaultEditorPlugin, OptionalPlugin, PluginInjectionAPI, CreatePluginDependenciesAPI, NextEditorPluginMetadata, ExtractInjectionAPI, ExtractPluginActions, PluginInjectionAPIWithDependencies, PublicPluginAPI, NextEditorPluginFunctionOptionalConfigDefinition, ExtractNextEditorPlugins, } from './next-editor-plugin';
32
32
  export type { ExtractPublicEditorAPI } from './editor-public-api';
33
33
  export type { EditorCommand, EditorCommandWithMetadata, } from './editor-command';
34
34
  export type IconProps = {
@@ -46,9 +46,6 @@ export type PluginInjectionAPI<Name extends string, Metadata extends NextEditorP
46
46
  ...ExtractPluginDependenciesFromMetadata<Metadata>
47
47
  ]>;
48
48
  };
49
- export type PluginInjectionAPIWithDependency<Plugin extends NextEditorPlugin<any, any>> = PublicPluginAPI<[
50
- Plugin
51
- ]>;
52
49
  export type PluginInjectionAPIWithDependencies<Plugins extends NextEditorPlugin<any, any>[]> = PublicPluginAPI<Plugins>;
53
50
  export type NextEditorPluginFunctionOptionalConfigDefinition<Name extends string, Metadata extends NextEditorPluginMetadata, Configuration = undefined> = (props: {
54
51
  config: Configuration;
@@ -17,5 +17,5 @@ export type OpenChangedEvent = {
17
17
  isOpen: boolean;
18
18
  event: MouseEvent | KeyboardEvent;
19
19
  };
20
- declare const _default: import("react").ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "key" | "id" | "children" | "position" | "testId" | "analyticsContext" | "shouldFitContainer" | "onPositioned" | "isOpen" | "trigger" | "onOpenChange"> & import("react").RefAttributes<any>>;
20
+ declare const _default: import("react").ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "position" | "key" | "id" | "children" | "testId" | "analyticsContext" | "shouldFitContainer" | "onPositioned" | "isOpen" | "trigger" | "onOpenChange"> & import("react").RefAttributes<any>>;
21
21
  export default _default;
@@ -26,5 +26,5 @@ type Props = WithAnalyticsEventsProps & {
26
26
  skipFocusButtonAfterPick?: boolean;
27
27
  absoluteOffset?: PopupPosition;
28
28
  };
29
- declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "onChange" | "title" | "key" | "size" | "placement" | "alignX" | "absoluteOffset" | "currentColor" | "analyticsContext" | "cols" | "hexToPaletteColor" | "paletteColorTooltipMessages" | "colorPalette" | "mountPoint" | "setDisableParentScroll" | "skipFocusButtonAfterPick"> & React.RefAttributes<any>>;
29
+ declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "size" | "currentColor" | "onChange" | "title" | "key" | "placement" | "alignX" | "absoluteOffset" | "analyticsContext" | "cols" | "hexToPaletteColor" | "paletteColorTooltipMessages" | "colorPalette" | "mountPoint" | "setDisableParentScroll" | "skipFocusButtonAfterPick"> & React.RefAttributes<any>>;
30
30
  export default _default;
@@ -42,7 +42,7 @@ declare const ToolbarButton: React.ForwardRefExoticComponent<{
42
42
  onItemClick?: ((item: MenuItem) => void) | undefined;
43
43
  onKeyDown?: ((event: React.KeyboardEvent<HTMLElement>) => void) | undefined;
44
44
  selected?: boolean | undefined;
45
- spacing?: "default" | "none" | "compact" | undefined;
45
+ spacing?: "none" | "default" | "compact" | undefined;
46
46
  target?: string | undefined;
47
47
  title?: React.ReactNode;
48
48
  titlePosition?: PositionType | undefined;
@@ -82,6 +82,7 @@ export declare function isNodeEmpty(node?: PMNode): boolean;
82
82
  export declare function isInEmptyLine(state: EditorState): boolean;
83
83
  export { dedupe } from './dedupe';
84
84
  export { createWrapSelectionTransaction } from './create-wrap-selection-transaction';
85
+ export { transformNodeIntoListItem } from './insert-node-into-ordered-list';
85
86
  export { wrapSelectionIn } from './wrap-selection-in';
86
87
  export { toJSON, nodeToJSON } from './nodes';
87
88
  export { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead, } from './calculate-toolbar-position';
@@ -0,0 +1,3 @@
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
3
+ export declare function transformNodeIntoListItem(tr: Transaction, node: PMNode): Transaction;
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/extensibility",
3
+ "main": "../dist/cjs/extensibility/index.js",
4
+ "module": "../dist/esm/extensibility/index.js",
5
+ "module:es2019": "../dist/es2019/extensibility/index.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/extensibility/index.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <4.9": {
10
+ "*": [
11
+ "../dist/types-ts4.5/extensibility/index.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "76.33.2",
3
+ "version": "76.35.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/"
@@ -32,6 +32,7 @@
32
32
  "af:exports": {
33
33
  "./event-dispatcher": "./src/event-dispatcher/index.ts",
34
34
  "./extensions": "./src/extensions.ts",
35
+ "./extensibility": "./src/extensibility/index.ts",
35
36
  "./normalize-feature-flags": "./src/normalize-feature-flags.ts",
36
37
  "./messages": "./src/messages/index.ts",
37
38
  "./provider-factory": "./src/provider-factory.ts",
@@ -90,16 +91,16 @@
90
91
  },
91
92
  "dependencies": {
92
93
  "@atlaskit/activity-provider": "^2.4.0",
93
- "@atlaskit/adf-schema": "^35.2.0",
94
+ "@atlaskit/adf-schema": "^35.3.0",
94
95
  "@atlaskit/adf-utils": "^19.0.0",
95
96
  "@atlaskit/analytics-listeners": "^8.7.0",
96
97
  "@atlaskit/analytics-namespaced-context": "^6.7.0",
97
98
  "@atlaskit/analytics-next": "^9.1.0",
98
99
  "@atlaskit/analytics-next-stable-react-context": "1.0.1",
99
- "@atlaskit/button": "^17.1.0",
100
+ "@atlaskit/button": "^17.2.0",
100
101
  "@atlaskit/code": "^15.1.0",
101
102
  "@atlaskit/codemod-utils": "^4.2.0",
102
- "@atlaskit/custom-steps": "^0.0.10",
103
+ "@atlaskit/custom-steps": "^0.0.11",
103
104
  "@atlaskit/editor-json-transformer": "^8.10.0",
104
105
  "@atlaskit/editor-palette": "1.5.2",
105
106
  "@atlaskit/editor-prosemirror": "1.1.0",
@@ -118,7 +119,7 @@
118
119
  "@atlaskit/menu": "^2.1.0",
119
120
  "@atlaskit/platform-feature-flags": "^0.2.0",
120
121
  "@atlaskit/profilecard": "^19.7.0",
121
- "@atlaskit/smart-card": "^26.43.0",
122
+ "@atlaskit/smart-card": "^26.44.0",
122
123
  "@atlaskit/smart-user-picker": "^6.4.0",
123
124
  "@atlaskit/spinner": "^16.0.0",
124
125
  "@atlaskit/task-decision": "^17.9.0",