@atlaskit/editor-common 87.5.1 → 87.6.1
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 +45 -0
- package/dist/cjs/analytics/types/enums.js +4 -0
- package/dist/cjs/analytics/types/upload-media-events.js +5 -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 +93 -15
- package/dist/cjs/messages/index.js +7 -0
- package/dist/cjs/messages/media-insert.js +44 -0
- 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/analytics/types/enums.js +4 -0
- package/dist/es2019/analytics/types/upload-media-events.js +1 -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 +93 -18
- package/dist/es2019/messages/index.js +1 -0
- package/dist/es2019/messages/media-insert.js +38 -0
- 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/analytics/types/enums.js +4 -0
- package/dist/esm/analytics/types/upload-media-events.js +1 -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 +93 -15
- package/dist/esm/messages/index.js +1 -0
- package/dist/esm/messages/media-insert.js +38 -0
- 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/analytics/types/enums.d.ts +5 -1
- package/dist/types/analytics/types/events.d.ts +2 -1
- package/dist/types/analytics/types/format-events.d.ts +2 -2
- package/dist/types/analytics/types/general-events.d.ts +2 -1
- package/dist/types/analytics/types/index.d.ts +1 -0
- package/dist/types/analytics/types/insert-events.d.ts +1 -1
- package/dist/types/analytics/types/upload-media-events.d.ts +10 -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/messages/index.d.ts +1 -0
- package/dist/types/messages/media-insert.d.ts +37 -0
- package/dist/types/styles/shared/code-block.d.ts +1 -0
- package/dist/types-ts4.5/analytics/types/enums.d.ts +5 -1
- package/dist/types-ts4.5/analytics/types/events.d.ts +2 -1
- package/dist/types-ts4.5/analytics/types/format-events.d.ts +2 -2
- package/dist/types-ts4.5/analytics/types/general-events.d.ts +2 -1
- package/dist/types-ts4.5/analytics/types/index.d.ts +1 -0
- package/dist/types-ts4.5/analytics/types/insert-events.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/upload-media-events.d.ts +10 -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/messages/index.d.ts +1 -0
- package/dist/types-ts4.5/messages/media-insert.d.ts +37 -0
- package/dist/types-ts4.5/styles/shared/code-block.d.ts +1 -0
- package/package.json +9 -9
|
@@ -146,6 +146,9 @@ export declare enum ACTION {
|
|
|
146
146
|
UPDATE_PARAMETERS = "updateParameters",
|
|
147
147
|
GET_CHILDERN = "getChildern",
|
|
148
148
|
MOVED = "moved",
|
|
149
|
+
UPLOAD_COMMENCED = "uploadCommenced",
|
|
150
|
+
UPLOAD_SUCCEEDED = "uploadSucceeded",
|
|
151
|
+
UPLOAD_FAILED = "uploadFailed",
|
|
149
152
|
TOGGLE_CODE_BLOCK_WRAP = "toggleCodeBlockWrap"
|
|
150
153
|
}
|
|
151
154
|
export declare enum INPUT_METHOD {
|
|
@@ -373,7 +376,8 @@ export declare enum ACTION_SUBJECT_ID {
|
|
|
373
376
|
UNSUPPORTED_MARK = "unsupportedMark",
|
|
374
377
|
ON_UNSUPPORTED_INLINE = "onUnsupportedInline",
|
|
375
378
|
ON_UNSUPPORTED_BLOCK = "onUnsupportedBlock",
|
|
376
|
-
MULTI_BODIED_EXTENSION = "multiBodiedExtension"
|
|
379
|
+
MULTI_BODIED_EXTENSION = "multiBodiedExtension",
|
|
380
|
+
UPLOAD_MEDIA_FROM_URL = "uploadMediaFromUrl"
|
|
377
381
|
}
|
|
378
382
|
export declare enum FLOATING_CONTROLS_TITLE {
|
|
379
383
|
CODE_BLOCK = "codeBlockFloatingControls",
|
|
@@ -33,6 +33,7 @@ import type { SelectionEventPayload } from './selection-events';
|
|
|
33
33
|
import type { SubstituteEventPayload } from './substitute-events';
|
|
34
34
|
import type { TableEventPayload } from './table-events';
|
|
35
35
|
import type { TypeAheadPayload } from './type-ahead';
|
|
36
|
+
import type { MediaUploadEventPayload } from './upload-media-events';
|
|
36
37
|
import type { OperationalAEP, OperationalExposureAEP, TrackAEP } from './utils';
|
|
37
38
|
import type { ViewEventPayload } from './view-events';
|
|
38
39
|
type Dispatch<T = any> = (eventName: PluginKey | string, data: T) => void;
|
|
@@ -43,7 +44,7 @@ export type SimplifiedNode = {
|
|
|
43
44
|
marks?: string[];
|
|
44
45
|
content?: SimplifiedNode[];
|
|
45
46
|
};
|
|
46
|
-
export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MoveContentEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | ExperimentalEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | HighlightActionsEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload | LoomEventPayload | MBEEventPayload | HighlightEventPayload | DatasourceClickedPayload | ElementEventPayload | ContextMenuEventPayload | VisitedLinkAEP | ViewEventPayload;
|
|
47
|
+
export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MoveContentEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | ExperimentalEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | HighlightActionsEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload | LoomEventPayload | MBEEventPayload | HighlightEventPayload | DatasourceClickedPayload | ElementEventPayload | ContextMenuEventPayload | VisitedLinkAEP | ViewEventPayload | MediaUploadEventPayload;
|
|
47
48
|
type CustomPanelEventPayload = TrackAEP<ACTION.CHANGED_BACKGROUND_COLOR | ACTION.CHANGED_ICON | ACTION.REMOVE_ICON, ACTION_SUBJECT.PANEL, ACTION_SUBJECT_ID.PANEL, {
|
|
48
49
|
previousColor: string;
|
|
49
50
|
newColor: string;
|
|
@@ -27,12 +27,12 @@ type FormatIndentationAEP = FormatAEP<ACTION_SUBJECT_ID.FORMAT_INDENT, {
|
|
|
27
27
|
indentType: INDENT_TYPE.PARAGRAPH | INDENT_TYPE.LIST | INDENT_TYPE.HEADING | INDENT_TYPE.CODE_BLOCK | INDENT_TYPE.TASK_LIST;
|
|
28
28
|
}>;
|
|
29
29
|
type FormatHeadingAEP = FormatAEP<ACTION_SUBJECT_ID.FORMAT_HEADING, {
|
|
30
|
-
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FORMATTING | INPUT_METHOD.SHORTCUT | INPUT_METHOD.QUICK_INSERT;
|
|
30
|
+
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FORMATTING | INPUT_METHOD.SHORTCUT | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.FLOATING_TB;
|
|
31
31
|
newHeadingLevel: HeadingLevelsAndNormalText;
|
|
32
32
|
previousHeadingLevel?: HeadingLevelsAndNormalText;
|
|
33
33
|
}>;
|
|
34
34
|
type FormatBlockQuoteAEP = FormatAEP<ACTION_SUBJECT_ID.FORMAT_BLOCK_QUOTE, {
|
|
35
|
-
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FORMATTING | INPUT_METHOD.SHORTCUT | INPUT_METHOD.QUICK_INSERT;
|
|
35
|
+
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FORMATTING | INPUT_METHOD.SHORTCUT | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.FLOATING_TB;
|
|
36
36
|
}>;
|
|
37
37
|
type FormatClearAEP = FormatAEP<ACTION_SUBJECT_ID.FORMAT_CLEAR, {
|
|
38
38
|
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.SHORTCUT;
|
|
@@ -128,6 +128,7 @@ type ButtonHelpAEP = ButtonAEP<ACTION_SUBJECT_ID.BUTTON_HELP, {
|
|
|
128
128
|
inputMethod: INPUT_METHOD.SHORTCUT | INPUT_METHOD.TOOLBAR;
|
|
129
129
|
}>;
|
|
130
130
|
type ButtonFeedbackAEP = ButtonAEP<ACTION_SUBJECT_ID.BUTTON_FEEDBACK, undefined>;
|
|
131
|
+
type ButtonUploadMediaAEP = ButtonAEP<ACTION_SUBJECT_ID.UPLOAD_MEDIA_FROM_URL, undefined>;
|
|
131
132
|
type PickerEmojiAEP = PickerAEP<ACTION_SUBJECT_ID.PICKER_EMOJI, {
|
|
132
133
|
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.KEYBOARD;
|
|
133
134
|
}>;
|
|
@@ -181,5 +182,5 @@ type CodeBlockWordWrapToggleAEP = TrackAEP<ACTION.TOGGLE_CODE_BLOCK_WRAP, ACTION
|
|
|
181
182
|
mode: MODE;
|
|
182
183
|
wordWrapEnabled: boolean;
|
|
183
184
|
}, undefined>;
|
|
184
|
-
export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ColorPickerAEP | DispatchedTransactionAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | EditorTTIAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamlingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | UfoSessionCompletePayloadAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | CodeBlockWordWrapToggleAEP;
|
|
185
|
+
export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | DispatchedTransactionAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | EditorTTIAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamlingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | UfoSessionCompletePayloadAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | CodeBlockWordWrapToggleAEP;
|
|
185
186
|
export {};
|
|
@@ -37,3 +37,4 @@ export type { PluginMethodReport, PluginsReport, NodeCount, PluginPerformanceRep
|
|
|
37
37
|
export type { InitialiseFragmentMarksAEP, ConnectedNodesAEP, DisconnectedSourceAEP, DisconnectedTargetAEP, GotConnectionsAEP, UpdatedFragmentMarkNameAEP, UpdatedSourceAEP, UpdatedTargetAEP, } from './referentiality-events';
|
|
38
38
|
export type { ElementEventPayload } from './element-events';
|
|
39
39
|
export type { ViewInlineCommentsButtonEventAEP, ViewEventPayload } from './view-events';
|
|
40
|
+
export type { MediaUploadEventPayload } from './upload-media-events';
|
|
@@ -50,7 +50,7 @@ type InsertTableAEP = InsertAEP<ACTION_SUBJECT_ID.TABLE, {
|
|
|
50
50
|
localId?: string;
|
|
51
51
|
}, undefined>;
|
|
52
52
|
type InsertExpandAEP = InsertAEP<ACTION_SUBJECT_ID.EXPAND | ACTION_SUBJECT_ID.NESTED_EXPAND, {
|
|
53
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.INSERT_MENU;
|
|
53
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.FLOATING_TB;
|
|
54
54
|
}, undefined>;
|
|
55
55
|
type InsertActionDecisionAEP = InsertAEP<ACTION_SUBJECT_ID.DECISION | ACTION_SUBJECT_ID.ACTION, {
|
|
56
56
|
inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ACTION, type ACTION_SUBJECT, type ACTION_SUBJECT_ID } from './enums';
|
|
2
|
+
import type { OperationalAEP } from './utils';
|
|
3
|
+
type MediaUploadAEP<Action, Attributes> = OperationalAEP<Action, ACTION_SUBJECT.MEDIA, ACTION_SUBJECT_ID.UPLOAD_MEDIA_FROM_URL, Attributes>;
|
|
4
|
+
type MediaUploadCommencedAEP = MediaUploadAEP<ACTION.UPLOAD_COMMENCED, undefined>;
|
|
5
|
+
type MediaUploadSuccessAEP = MediaUploadAEP<ACTION.UPLOAD_SUCCEEDED, undefined>;
|
|
6
|
+
type MediaUploadFailAEP = MediaUploadAEP<ACTION.UPLOAD_FAILED, {
|
|
7
|
+
reason: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type MediaUploadEventPayload = MediaUploadCommencedAEP | MediaUploadSuccessAEP | MediaUploadFailAEP;
|
|
10
|
+
export {};
|
|
@@ -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
|
*/
|
|
@@ -29,6 +29,7 @@ export { mentionMessages } from './mentions';
|
|
|
29
29
|
export { helpDialogMessages } from './help-dialog';
|
|
30
30
|
export { highlightMessages } from './highlight';
|
|
31
31
|
export { messages as blockControlsMessages } from './block-controls';
|
|
32
|
+
export { mediaInsertMessages } from './media-insert';
|
|
32
33
|
declare const _default: {
|
|
33
34
|
layoutFixedWidth: {
|
|
34
35
|
id: string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const mediaInsertMessages: {
|
|
2
|
+
loadPreview: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
insert: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
pasteLinkToUpload: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
cancel: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
errorMessage: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
warning: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
mediaAlt: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -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;
|
|
@@ -146,6 +146,9 @@ export declare enum ACTION {
|
|
|
146
146
|
UPDATE_PARAMETERS = "updateParameters",
|
|
147
147
|
GET_CHILDERN = "getChildern",
|
|
148
148
|
MOVED = "moved",
|
|
149
|
+
UPLOAD_COMMENCED = "uploadCommenced",
|
|
150
|
+
UPLOAD_SUCCEEDED = "uploadSucceeded",
|
|
151
|
+
UPLOAD_FAILED = "uploadFailed",
|
|
149
152
|
TOGGLE_CODE_BLOCK_WRAP = "toggleCodeBlockWrap"
|
|
150
153
|
}
|
|
151
154
|
export declare enum INPUT_METHOD {
|
|
@@ -373,7 +376,8 @@ export declare enum ACTION_SUBJECT_ID {
|
|
|
373
376
|
UNSUPPORTED_MARK = "unsupportedMark",
|
|
374
377
|
ON_UNSUPPORTED_INLINE = "onUnsupportedInline",
|
|
375
378
|
ON_UNSUPPORTED_BLOCK = "onUnsupportedBlock",
|
|
376
|
-
MULTI_BODIED_EXTENSION = "multiBodiedExtension"
|
|
379
|
+
MULTI_BODIED_EXTENSION = "multiBodiedExtension",
|
|
380
|
+
UPLOAD_MEDIA_FROM_URL = "uploadMediaFromUrl"
|
|
377
381
|
}
|
|
378
382
|
export declare enum FLOATING_CONTROLS_TITLE {
|
|
379
383
|
CODE_BLOCK = "codeBlockFloatingControls",
|
|
@@ -33,6 +33,7 @@ import type { SelectionEventPayload } from './selection-events';
|
|
|
33
33
|
import type { SubstituteEventPayload } from './substitute-events';
|
|
34
34
|
import type { TableEventPayload } from './table-events';
|
|
35
35
|
import type { TypeAheadPayload } from './type-ahead';
|
|
36
|
+
import type { MediaUploadEventPayload } from './upload-media-events';
|
|
36
37
|
import type { OperationalAEP, OperationalExposureAEP, TrackAEP } from './utils';
|
|
37
38
|
import type { ViewEventPayload } from './view-events';
|
|
38
39
|
type Dispatch<T = any> = (eventName: PluginKey | string, data: T) => void;
|
|
@@ -43,7 +44,7 @@ export type SimplifiedNode = {
|
|
|
43
44
|
marks?: string[];
|
|
44
45
|
content?: SimplifiedNode[];
|
|
45
46
|
};
|
|
46
|
-
export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MoveContentEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | ExperimentalEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | HighlightActionsEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload | LoomEventPayload | MBEEventPayload | HighlightEventPayload | DatasourceClickedPayload | ElementEventPayload | ContextMenuEventPayload | VisitedLinkAEP | ViewEventPayload;
|
|
47
|
+
export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MoveContentEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | ExperimentalEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | HighlightActionsEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload | LoomEventPayload | MBEEventPayload | HighlightEventPayload | DatasourceClickedPayload | ElementEventPayload | ContextMenuEventPayload | VisitedLinkAEP | ViewEventPayload | MediaUploadEventPayload;
|
|
47
48
|
type CustomPanelEventPayload = TrackAEP<ACTION.CHANGED_BACKGROUND_COLOR | ACTION.CHANGED_ICON | ACTION.REMOVE_ICON, ACTION_SUBJECT.PANEL, ACTION_SUBJECT_ID.PANEL, {
|
|
48
49
|
previousColor: string;
|
|
49
50
|
newColor: string;
|
|
@@ -27,12 +27,12 @@ type FormatIndentationAEP = FormatAEP<ACTION_SUBJECT_ID.FORMAT_INDENT, {
|
|
|
27
27
|
indentType: INDENT_TYPE.PARAGRAPH | INDENT_TYPE.LIST | INDENT_TYPE.HEADING | INDENT_TYPE.CODE_BLOCK | INDENT_TYPE.TASK_LIST;
|
|
28
28
|
}>;
|
|
29
29
|
type FormatHeadingAEP = FormatAEP<ACTION_SUBJECT_ID.FORMAT_HEADING, {
|
|
30
|
-
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FORMATTING | INPUT_METHOD.SHORTCUT | INPUT_METHOD.QUICK_INSERT;
|
|
30
|
+
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FORMATTING | INPUT_METHOD.SHORTCUT | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.FLOATING_TB;
|
|
31
31
|
newHeadingLevel: HeadingLevelsAndNormalText;
|
|
32
32
|
previousHeadingLevel?: HeadingLevelsAndNormalText;
|
|
33
33
|
}>;
|
|
34
34
|
type FormatBlockQuoteAEP = FormatAEP<ACTION_SUBJECT_ID.FORMAT_BLOCK_QUOTE, {
|
|
35
|
-
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FORMATTING | INPUT_METHOD.SHORTCUT | INPUT_METHOD.QUICK_INSERT;
|
|
35
|
+
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FORMATTING | INPUT_METHOD.SHORTCUT | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.FLOATING_TB;
|
|
36
36
|
}>;
|
|
37
37
|
type FormatClearAEP = FormatAEP<ACTION_SUBJECT_ID.FORMAT_CLEAR, {
|
|
38
38
|
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.SHORTCUT;
|
|
@@ -128,6 +128,7 @@ type ButtonHelpAEP = ButtonAEP<ACTION_SUBJECT_ID.BUTTON_HELP, {
|
|
|
128
128
|
inputMethod: INPUT_METHOD.SHORTCUT | INPUT_METHOD.TOOLBAR;
|
|
129
129
|
}>;
|
|
130
130
|
type ButtonFeedbackAEP = ButtonAEP<ACTION_SUBJECT_ID.BUTTON_FEEDBACK, undefined>;
|
|
131
|
+
type ButtonUploadMediaAEP = ButtonAEP<ACTION_SUBJECT_ID.UPLOAD_MEDIA_FROM_URL, undefined>;
|
|
131
132
|
type PickerEmojiAEP = PickerAEP<ACTION_SUBJECT_ID.PICKER_EMOJI, {
|
|
132
133
|
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.KEYBOARD;
|
|
133
134
|
}>;
|
|
@@ -181,5 +182,5 @@ type CodeBlockWordWrapToggleAEP = TrackAEP<ACTION.TOGGLE_CODE_BLOCK_WRAP, ACTION
|
|
|
181
182
|
mode: MODE;
|
|
182
183
|
wordWrapEnabled: boolean;
|
|
183
184
|
}, undefined>;
|
|
184
|
-
export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ColorPickerAEP | DispatchedTransactionAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | EditorTTIAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamlingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | UfoSessionCompletePayloadAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | CodeBlockWordWrapToggleAEP;
|
|
185
|
+
export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | DispatchedTransactionAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | EditorTTIAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamlingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | UfoSessionCompletePayloadAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | CodeBlockWordWrapToggleAEP;
|
|
185
186
|
export {};
|
|
@@ -37,3 +37,4 @@ export type { PluginMethodReport, PluginsReport, NodeCount, PluginPerformanceRep
|
|
|
37
37
|
export type { InitialiseFragmentMarksAEP, ConnectedNodesAEP, DisconnectedSourceAEP, DisconnectedTargetAEP, GotConnectionsAEP, UpdatedFragmentMarkNameAEP, UpdatedSourceAEP, UpdatedTargetAEP, } from './referentiality-events';
|
|
38
38
|
export type { ElementEventPayload } from './element-events';
|
|
39
39
|
export type { ViewInlineCommentsButtonEventAEP, ViewEventPayload } from './view-events';
|
|
40
|
+
export type { MediaUploadEventPayload } from './upload-media-events';
|
|
@@ -50,7 +50,7 @@ type InsertTableAEP = InsertAEP<ACTION_SUBJECT_ID.TABLE, {
|
|
|
50
50
|
localId?: string;
|
|
51
51
|
}, undefined>;
|
|
52
52
|
type InsertExpandAEP = InsertAEP<ACTION_SUBJECT_ID.EXPAND | ACTION_SUBJECT_ID.NESTED_EXPAND, {
|
|
53
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.INSERT_MENU;
|
|
53
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.FLOATING_TB;
|
|
54
54
|
}, undefined>;
|
|
55
55
|
type InsertActionDecisionAEP = InsertAEP<ACTION_SUBJECT_ID.DECISION | ACTION_SUBJECT_ID.ACTION, {
|
|
56
56
|
inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ACTION, type ACTION_SUBJECT, type ACTION_SUBJECT_ID } from './enums';
|
|
2
|
+
import type { OperationalAEP } from './utils';
|
|
3
|
+
type MediaUploadAEP<Action, Attributes> = OperationalAEP<Action, ACTION_SUBJECT.MEDIA, ACTION_SUBJECT_ID.UPLOAD_MEDIA_FROM_URL, Attributes>;
|
|
4
|
+
type MediaUploadCommencedAEP = MediaUploadAEP<ACTION.UPLOAD_COMMENCED, undefined>;
|
|
5
|
+
type MediaUploadSuccessAEP = MediaUploadAEP<ACTION.UPLOAD_SUCCEEDED, undefined>;
|
|
6
|
+
type MediaUploadFailAEP = MediaUploadAEP<ACTION.UPLOAD_FAILED, {
|
|
7
|
+
reason: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type MediaUploadEventPayload = MediaUploadCommencedAEP | MediaUploadSuccessAEP | MediaUploadFailAEP;
|
|
10
|
+
export {};
|
|
@@ -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
|
*/
|
|
@@ -29,6 +29,7 @@ export { mentionMessages } from './mentions';
|
|
|
29
29
|
export { helpDialogMessages } from './help-dialog';
|
|
30
30
|
export { highlightMessages } from './highlight';
|
|
31
31
|
export { messages as blockControlsMessages } from './block-controls';
|
|
32
|
+
export { mediaInsertMessages } from './media-insert';
|
|
32
33
|
declare const _default: {
|
|
33
34
|
layoutFixedWidth: {
|
|
34
35
|
id: string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const mediaInsertMessages: {
|
|
2
|
+
loadPreview: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
insert: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
pasteLinkToUpload: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
cancel: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
errorMessage: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
warning: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
mediaAlt: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -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;
|