@atlaskit/editor-common 87.6.0 → 87.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/cjs/extensibility/Extension/Extension/index.js +2 -1
- package/dist/cjs/extensibility/Extension/Extension/styles.js +4 -0
- package/dist/cjs/extensibility/MultiBodiedExtension/styles.js +1 -1
- package/dist/cjs/extensibility/extensionNodeView.js +13 -0
- package/dist/cjs/keymaps/index.js +7 -4
- package/dist/cjs/lazy-node-view/index.js +10 -3
- package/dist/cjs/lazy-node-view/node-view.js +32 -20
- package/dist/cjs/lazy-node-view/replace-node-views.js +94 -25
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/styles/shared/code-block.js +3 -4
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/extensibility/Extension/Extension/index.js +2 -1
- package/dist/es2019/extensibility/Extension/Extension/styles.js +4 -0
- package/dist/es2019/extensibility/MultiBodiedExtension/styles.js +1 -1
- package/dist/es2019/extensibility/extensionNodeView.js +11 -0
- package/dist/es2019/keymaps/index.js +2 -1
- package/dist/es2019/lazy-node-view/index.js +10 -3
- package/dist/es2019/lazy-node-view/node-view.js +6 -1
- package/dist/es2019/lazy-node-view/replace-node-views.js +94 -28
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/styles/shared/code-block.js +15 -3
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/extensibility/Extension/Extension/index.js +2 -1
- package/dist/esm/extensibility/Extension/Extension/styles.js +4 -0
- package/dist/esm/extensibility/MultiBodiedExtension/styles.js +1 -1
- package/dist/esm/extensibility/extensionNodeView.js +13 -0
- package/dist/esm/keymaps/index.js +2 -1
- package/dist/esm/lazy-node-view/index.js +10 -3
- package/dist/esm/lazy-node-view/node-view.js +32 -20
- package/dist/esm/lazy-node-view/replace-node-views.js +94 -25
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/styles/shared/code-block.js +3 -4
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/extensibility/extensionNodeView.d.ts +1 -0
- package/dist/types/keymaps/index.d.ts +2 -0
- package/dist/types/lazy-node-view/index.d.ts +5 -2
- package/dist/types/lazy-node-view/node-view.d.ts +6 -1
- package/dist/types/lazy-node-view/replace-node-views.d.ts +15 -25
- package/dist/types/lazy-node-view/types.d.ts +7 -0
- package/dist/types/styles/shared/code-block.d.ts +1 -0
- package/dist/types-ts4.5/extensibility/extensionNodeView.d.ts +1 -0
- package/dist/types-ts4.5/keymaps/index.d.ts +2 -0
- package/dist/types-ts4.5/lazy-node-view/index.d.ts +5 -2
- package/dist/types-ts4.5/lazy-node-view/node-view.d.ts +6 -1
- package/dist/types-ts4.5/lazy-node-view/replace-node-views.d.ts +15 -25
- package/dist/types-ts4.5/lazy-node-view/types.d.ts +7 -0
- package/dist/types-ts4.5/styles/shared/code-block.d.ts +1 -0
- package/package.json +6 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { DispatchAnalyticsEvent } from '../analytics';
|
|
4
|
-
import type { NodeViewConstructor } from './types';
|
|
4
|
+
import type { IgnoreMutationParam, NodeViewConstructor } from './types';
|
|
5
5
|
export { convertToInlineCss } from './css-helper';
|
|
6
6
|
export type { NodeViewConstructor };
|
|
7
7
|
/**
|
|
@@ -20,6 +20,9 @@ export type LazyLoadingProps<NodeViewOptions> = {
|
|
|
20
20
|
loader: () => Promise<CreateReactNodeViewProps<NodeViewOptions>>;
|
|
21
21
|
getNodeViewOptions: () => NodeViewOptions;
|
|
22
22
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
23
|
+
lazyNodeViewOptions?: {
|
|
24
|
+
ignoreMutationDelegate?: (mutation: IgnoreMutationParam) => boolean;
|
|
25
|
+
};
|
|
23
26
|
};
|
|
24
27
|
/**
|
|
25
28
|
* 📢 Public: Any EditorPlugin can use this function
|
|
@@ -61,4 +64,4 @@ export type LazyLoadingProps<NodeViewOptions> = {
|
|
|
61
64
|
*
|
|
62
65
|
* // Then, use `lazyTableView` in ProseMirror editor setup to enhance 'table' nodes with lazy loading
|
|
63
66
|
*/
|
|
64
|
-
export declare const withLazyLoading: <Options>({ nodeName, loader, getNodeViewOptions, dispatchAnalyticsEvent, }: LazyLoadingProps<Options>) => NodeViewConstructor;
|
|
67
|
+
export declare const withLazyLoading: <Options>({ nodeName, loader, getNodeViewOptions, dispatchAnalyticsEvent, lazyNodeViewOptions: { ignoreMutationDelegate }, }: LazyLoadingProps<Options>) => NodeViewConstructor;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
+
import type { IgnoreMutationParam } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* 🧱 Internal: Editor FE Platform
|
|
5
6
|
*
|
|
@@ -8,5 +9,9 @@ import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
|
8
9
|
export declare class LazyNodeView implements NodeView {
|
|
9
10
|
dom: Node;
|
|
10
11
|
contentDOM?: HTMLElement;
|
|
11
|
-
|
|
12
|
+
private ignoreMutationDelegate?;
|
|
13
|
+
constructor(node: PMNode, view: EditorView, getPos: () => number | undefined, options?: {
|
|
14
|
+
ignoreMutationDelegate?: (mutation: IgnoreMutationParam) => boolean;
|
|
15
|
+
});
|
|
16
|
+
ignoreMutation(mutation: IgnoreMutationParam): boolean;
|
|
12
17
|
}
|
|
@@ -1,40 +1,30 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
1
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
2
|
import type { CacheLoadedReactNodeViews, NodeViewConstructor } from './types';
|
|
4
3
|
/**
|
|
5
4
|
* 🧱 Internal: Editor FE Platform
|
|
6
5
|
*
|
|
7
|
-
*
|
|
6
|
+
* Debounced and memoized version of `replaceNodeViews`.
|
|
8
7
|
*
|
|
9
|
-
* This function is
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* This function is designed to update the `nodeViews` property of an `EditorView` after a
|
|
9
|
+
* period of inactivity (debounce), ensuring that multiple rapid updates do not occur in quick
|
|
10
|
+
* succession. It uses lodash's `debounce` to handle the debouncing.
|
|
12
11
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `
|
|
17
|
-
* `
|
|
12
|
+
* Memoization is crucial here to ensure that each `EditorView` instance has its own opportunity
|
|
13
|
+
* to update the node views. Without memoization, if you have multiple `EditorView` instances on
|
|
14
|
+
* the same page, only one instance would potentially call `view.setProps`, which could lead to
|
|
15
|
+
* incorrect or missing updates in other `EditorView` instances. By memoizing the debounced function,
|
|
16
|
+
* we ensure that each `EditorView` maintains its own debounced update logic.
|
|
18
17
|
*
|
|
19
|
-
* @param {
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* @param {CacheLoadedReactNodeViews} cache - A WeakMap that stores the loaded node views for each
|
|
19
|
+
* `EditorView`. The key is the `EditorView`, and the value is a record of node type names
|
|
20
|
+
* to their corresponding `NodeViewConstructor`.
|
|
22
21
|
* @param {EditorView} view - The ProseMirror `EditorView` instance whose `nodeViews` property
|
|
23
22
|
* needs to be updated.
|
|
24
23
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* const view = new EditorView(...);
|
|
28
|
-
*
|
|
29
|
-
* // Assume some node views have been loaded and stored in the cache
|
|
30
|
-
* cache.set(view, {
|
|
31
|
-
* 'table': TableViewConstructor,
|
|
32
|
-
* 'tableCell': TableCellViewConstructor,
|
|
33
|
-
* });
|
|
34
|
-
*
|
|
35
|
-
* debouncedReplaceNodeviews(cache, view);
|
|
24
|
+
* This function is typically not called directly. Instead, it is invoked through `queueReplaceNodeViews`,
|
|
25
|
+
* which handles adding node views to the cache and triggering this debounced update.
|
|
36
26
|
*/
|
|
37
|
-
export declare const debouncedReplaceNodeviews:
|
|
27
|
+
export declare const debouncedReplaceNodeviews: (cache: CacheLoadedReactNodeViews, view: EditorView) => void | undefined;
|
|
38
28
|
/**
|
|
39
29
|
* 🧱 Internal: Editor FE Platform
|
|
40
30
|
*/
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { Decoration, DecorationSource, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
+
/**
|
|
4
|
+
* 🧱 Internal: Editor FE Platform
|
|
5
|
+
*/
|
|
6
|
+
export type IgnoreMutationParam = MutationRecord | {
|
|
7
|
+
type: 'selection';
|
|
8
|
+
target: Element;
|
|
9
|
+
};
|
|
3
10
|
/**
|
|
4
11
|
* 🧱 Internal: Editor FE Platform
|
|
5
12
|
*/
|
|
@@ -9,6 +9,7 @@ export declare const CodeBlockSharedCssClassName: {
|
|
|
9
9
|
CODEBLOCK_LINE_NUMBER_GUTTER_FG_WRAP: string;
|
|
10
10
|
CODEBLOCK_CONTENT_WRAPPED: string;
|
|
11
11
|
CODEBLOCK_CONTAINER_LINE_NUMBER_WRAPPED: string;
|
|
12
|
+
CODEBLOCK_WRAPPED: string;
|
|
12
13
|
};
|
|
13
14
|
export declare const codeBlockSharedStyles: () => import("@emotion/react").SerializedStyles;
|
|
14
15
|
export declare const codeBlockInListSafariFix: import("@emotion/react").SerializedStyles;
|
|
@@ -97,6 +97,8 @@ export declare const focusToContextMenuTrigger: Keymap;
|
|
|
97
97
|
export declare const dragToMoveUp: Keymap;
|
|
98
98
|
export declare const dragToMoveDown: Keymap;
|
|
99
99
|
export declare const showElementDragHandle: Keymap;
|
|
100
|
+
export declare const continueInRovoChat: Keymap;
|
|
101
|
+
export declare function formatShortcut(keymap: Keymap): string | undefined;
|
|
100
102
|
export declare function tooltip(keymap?: Keymap, description?: string): string | undefined;
|
|
101
103
|
export declare const ToolTipContent: React.MemoExoticComponent<({ description, shortcutOverride, keymap, }: {
|
|
102
104
|
description?: string | React.ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { DispatchAnalyticsEvent } from '../analytics';
|
|
4
|
-
import type { NodeViewConstructor } from './types';
|
|
4
|
+
import type { IgnoreMutationParam, NodeViewConstructor } from './types';
|
|
5
5
|
export { convertToInlineCss } from './css-helper';
|
|
6
6
|
export type { NodeViewConstructor };
|
|
7
7
|
/**
|
|
@@ -20,6 +20,9 @@ export type LazyLoadingProps<NodeViewOptions> = {
|
|
|
20
20
|
loader: () => Promise<CreateReactNodeViewProps<NodeViewOptions>>;
|
|
21
21
|
getNodeViewOptions: () => NodeViewOptions;
|
|
22
22
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
23
|
+
lazyNodeViewOptions?: {
|
|
24
|
+
ignoreMutationDelegate?: (mutation: IgnoreMutationParam) => boolean;
|
|
25
|
+
};
|
|
23
26
|
};
|
|
24
27
|
/**
|
|
25
28
|
* 📢 Public: Any EditorPlugin can use this function
|
|
@@ -61,4 +64,4 @@ export type LazyLoadingProps<NodeViewOptions> = {
|
|
|
61
64
|
*
|
|
62
65
|
* // Then, use `lazyTableView` in ProseMirror editor setup to enhance 'table' nodes with lazy loading
|
|
63
66
|
*/
|
|
64
|
-
export declare const withLazyLoading: <Options>({ nodeName, loader, getNodeViewOptions, dispatchAnalyticsEvent, }: LazyLoadingProps<Options>) => NodeViewConstructor;
|
|
67
|
+
export declare const withLazyLoading: <Options>({ nodeName, loader, getNodeViewOptions, dispatchAnalyticsEvent, lazyNodeViewOptions: { ignoreMutationDelegate }, }: LazyLoadingProps<Options>) => NodeViewConstructor;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
+
import type { IgnoreMutationParam } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* 🧱 Internal: Editor FE Platform
|
|
5
6
|
*
|
|
@@ -8,5 +9,9 @@ import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
|
8
9
|
export declare class LazyNodeView implements NodeView {
|
|
9
10
|
dom: Node;
|
|
10
11
|
contentDOM?: HTMLElement;
|
|
11
|
-
|
|
12
|
+
private ignoreMutationDelegate?;
|
|
13
|
+
constructor(node: PMNode, view: EditorView, getPos: () => number | undefined, options?: {
|
|
14
|
+
ignoreMutationDelegate?: (mutation: IgnoreMutationParam) => boolean;
|
|
15
|
+
});
|
|
16
|
+
ignoreMutation(mutation: IgnoreMutationParam): boolean;
|
|
12
17
|
}
|
|
@@ -1,40 +1,30 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
1
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
2
|
import type { CacheLoadedReactNodeViews, NodeViewConstructor } from './types';
|
|
4
3
|
/**
|
|
5
4
|
* 🧱 Internal: Editor FE Platform
|
|
6
5
|
*
|
|
7
|
-
*
|
|
6
|
+
* Debounced and memoized version of `replaceNodeViews`.
|
|
8
7
|
*
|
|
9
|
-
* This function is
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* This function is designed to update the `nodeViews` property of an `EditorView` after a
|
|
9
|
+
* period of inactivity (debounce), ensuring that multiple rapid updates do not occur in quick
|
|
10
|
+
* succession. It uses lodash's `debounce` to handle the debouncing.
|
|
12
11
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `
|
|
17
|
-
* `
|
|
12
|
+
* Memoization is crucial here to ensure that each `EditorView` instance has its own opportunity
|
|
13
|
+
* to update the node views. Without memoization, if you have multiple `EditorView` instances on
|
|
14
|
+
* the same page, only one instance would potentially call `view.setProps`, which could lead to
|
|
15
|
+
* incorrect or missing updates in other `EditorView` instances. By memoizing the debounced function,
|
|
16
|
+
* we ensure that each `EditorView` maintains its own debounced update logic.
|
|
18
17
|
*
|
|
19
|
-
* @param {
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* @param {CacheLoadedReactNodeViews} cache - A WeakMap that stores the loaded node views for each
|
|
19
|
+
* `EditorView`. The key is the `EditorView`, and the value is a record of node type names
|
|
20
|
+
* to their corresponding `NodeViewConstructor`.
|
|
22
21
|
* @param {EditorView} view - The ProseMirror `EditorView` instance whose `nodeViews` property
|
|
23
22
|
* needs to be updated.
|
|
24
23
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* const view = new EditorView(...);
|
|
28
|
-
*
|
|
29
|
-
* // Assume some node views have been loaded and stored in the cache
|
|
30
|
-
* cache.set(view, {
|
|
31
|
-
* 'table': TableViewConstructor,
|
|
32
|
-
* 'tableCell': TableCellViewConstructor,
|
|
33
|
-
* });
|
|
34
|
-
*
|
|
35
|
-
* debouncedReplaceNodeviews(cache, view);
|
|
24
|
+
* This function is typically not called directly. Instead, it is invoked through `queueReplaceNodeViews`,
|
|
25
|
+
* which handles adding node views to the cache and triggering this debounced update.
|
|
36
26
|
*/
|
|
37
|
-
export declare const debouncedReplaceNodeviews:
|
|
27
|
+
export declare const debouncedReplaceNodeviews: (cache: CacheLoadedReactNodeViews, view: EditorView) => void | undefined;
|
|
38
28
|
/**
|
|
39
29
|
* 🧱 Internal: Editor FE Platform
|
|
40
30
|
*/
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { Decoration, DecorationSource, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
+
/**
|
|
4
|
+
* 🧱 Internal: Editor FE Platform
|
|
5
|
+
*/
|
|
6
|
+
export type IgnoreMutationParam = MutationRecord | {
|
|
7
|
+
type: 'selection';
|
|
8
|
+
target: Element;
|
|
9
|
+
};
|
|
3
10
|
/**
|
|
4
11
|
* 🧱 Internal: Editor FE Platform
|
|
5
12
|
*/
|
|
@@ -9,6 +9,7 @@ export declare const CodeBlockSharedCssClassName: {
|
|
|
9
9
|
CODEBLOCK_LINE_NUMBER_GUTTER_FG_WRAP: string;
|
|
10
10
|
CODEBLOCK_CONTENT_WRAPPED: string;
|
|
11
11
|
CODEBLOCK_CONTAINER_LINE_NUMBER_WRAPPED: string;
|
|
12
|
+
CODEBLOCK_WRAPPED: string;
|
|
12
13
|
};
|
|
13
14
|
export declare const codeBlockSharedStyles: () => import("@emotion/react").SerializedStyles;
|
|
14
15
|
export declare const codeBlockInListSafariFix: import("@emotion/react").SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "87.6.
|
|
3
|
+
"version": "87.6.2",
|
|
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/"
|
|
@@ -127,11 +127,11 @@
|
|
|
127
127
|
"@atlaskit/media-file-preview": "^0.6.0",
|
|
128
128
|
"@atlaskit/media-picker": "^66.4.0",
|
|
129
129
|
"@atlaskit/media-ui": "^25.10.0",
|
|
130
|
-
"@atlaskit/media-viewer": "48.6.
|
|
130
|
+
"@atlaskit/media-viewer": "48.6.16",
|
|
131
131
|
"@atlaskit/mention": "^23.2.0",
|
|
132
132
|
"@atlaskit/menu": "^2.10.0",
|
|
133
133
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
134
|
-
"@atlaskit/primitives": "^
|
|
134
|
+
"@atlaskit/primitives": "^12.0.0",
|
|
135
135
|
"@atlaskit/profilecard": "^19.17.0",
|
|
136
136
|
"@atlaskit/section-message": "^6.5.0",
|
|
137
137
|
"@atlaskit/smart-card": "^27.13.0",
|
|
@@ -268,6 +268,9 @@
|
|
|
268
268
|
},
|
|
269
269
|
"platform_editor_migration_icon_and_typography": {
|
|
270
270
|
"type": "boolean"
|
|
271
|
+
},
|
|
272
|
+
"cc_page_experiences_live_search_wysiwyg": {
|
|
273
|
+
"type": "boolean"
|
|
271
274
|
}
|
|
272
275
|
}
|
|
273
276
|
}
|