@atlaskit/editor-core 189.3.14 → 189.3.15
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 +10 -0
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/cjs/plugins/analytics/index.js +0 -6
- package/dist/cjs/plugins/analytics/utils.js +0 -29
- package/dist/cjs/plugins/breakout/index.js +3 -3
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +4 -4
- package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +32 -30
- package/dist/cjs/plugins/find-replace/commands-with-analytics.js +85 -71
- package/dist/cjs/plugins/find-replace/index.js +5 -2
- package/dist/cjs/plugins/find-replace/keymap.js +4 -4
- package/dist/cjs/plugins/index.js +1 -17
- package/dist/cjs/presets/context.js +5 -3
- package/dist/cjs/presets/universal.js +12 -3
- package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
- package/dist/cjs/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +11 -8
- package/dist/cjs/ui/ContentStyles/index.js +4 -4
- package/dist/cjs/ui/ToolbarFeedback/index.js +1 -1
- package/dist/cjs/use-preset.js +0 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/es2019/plugins/analytics/index.js +1 -1
- package/dist/es2019/plugins/analytics/utils.js +0 -24
- package/dist/es2019/plugins/breakout/index.js +1 -1
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +1 -1
- package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +20 -19
- package/dist/es2019/plugins/find-replace/commands-with-analytics.js +15 -15
- package/dist/es2019/plugins/find-replace/index.js +7 -2
- package/dist/es2019/plugins/find-replace/keymap.js +4 -4
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/presets/context.js +2 -2
- package/dist/es2019/presets/universal.js +10 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
- package/dist/es2019/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +9 -4
- package/dist/es2019/ui/ContentStyles/index.js +1 -1
- package/dist/es2019/ui/ToolbarFeedback/index.js +2 -2
- package/dist/es2019/use-preset.js +0 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/esm/plugins/analytics/index.js +1 -1
- package/dist/esm/plugins/analytics/utils.js +0 -28
- package/dist/esm/plugins/breakout/index.js +1 -1
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +1 -1
- package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +32 -30
- package/dist/esm/plugins/find-replace/commands-with-analytics.js +84 -70
- package/dist/esm/plugins/find-replace/index.js +5 -2
- package/dist/esm/plugins/find-replace/keymap.js +4 -4
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/presets/context.js +2 -2
- package/dist/esm/presets/universal.js +9 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
- package/dist/esm/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +9 -4
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
- package/dist/esm/use-preset.js +0 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/analytics/index.d.ts +1 -1
- package/dist/types/plugins/analytics/utils.d.ts +0 -11
- package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -2
- package/dist/types/plugins/find-replace/commands-with-analytics.d.ts +9 -9
- package/dist/types/plugins/find-replace/index.d.ts +5 -3
- package/dist/types/plugins/find-replace/keymap.d.ts +2 -1
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/insert-block/types.d.ts +1 -1
- package/dist/types/plugins/mobile-dimensions/index.d.ts +2 -1
- package/dist/types/presets/context.d.ts +2 -2
- package/dist/types/presets/universal.d.ts +5 -0
- package/dist/types/{plugins/expand/ui/styles.d.ts → ui/ContentStyles/expand.d.ts} +1 -1
- package/dist/types-ts4.5/plugins/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/analytics/utils.d.ts +0 -11
- package/dist/types-ts4.5/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -2
- package/dist/types-ts4.5/plugins/find-replace/commands-with-analytics.d.ts +9 -9
- package/dist/types-ts4.5/plugins/find-replace/index.d.ts +6 -3
- package/dist/types-ts4.5/plugins/find-replace/keymap.d.ts +2 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/mobile-dimensions/index.d.ts +2 -1
- package/dist/types-ts4.5/presets/context.d.ts +2 -2
- package/dist/types-ts4.5/presets/universal.d.ts +5 -0
- package/dist/types-ts4.5/{plugins/expand/ui/styles.d.ts → ui/ContentStyles/expand.d.ts} +1 -1
- package/package.json +3 -7
- package/dist/cjs/plugins/breakout/constants.js +0 -10
- package/dist/cjs/plugins/expand/commands.js +0 -184
- package/dist/cjs/plugins/expand/index.js +0 -111
- package/dist/cjs/plugins/expand/nodeviews/index.js +0 -485
- package/dist/cjs/plugins/expand/pm-plugins/keymap.js +0 -171
- package/dist/cjs/plugins/expand/pm-plugins/main.js +0 -85
- package/dist/cjs/plugins/expand/pm-plugins/plugin-factory.js +0 -15
- package/dist/cjs/plugins/expand/reducer.js +0 -20
- package/dist/cjs/plugins/expand/toolbar.js +0 -59
- package/dist/cjs/plugins/expand/types.js +0 -5
- package/dist/cjs/plugins/expand/ui/ExpandIconButton.js +0 -104
- package/dist/cjs/plugins/expand/ui/class-names.js +0 -20
- package/dist/cjs/plugins/expand/utils.js +0 -24
- package/dist/es2019/plugins/breakout/constants.js +0 -4
- package/dist/es2019/plugins/expand/commands.js +0 -161
- package/dist/es2019/plugins/expand/index.js +0 -95
- package/dist/es2019/plugins/expand/nodeviews/index.js +0 -475
- package/dist/es2019/plugins/expand/pm-plugins/keymap.js +0 -197
- package/dist/es2019/plugins/expand/pm-plugins/main.js +0 -73
- package/dist/es2019/plugins/expand/pm-plugins/plugin-factory.js +0 -9
- package/dist/es2019/plugins/expand/reducer.js +0 -11
- package/dist/es2019/plugins/expand/toolbar.js +0 -52
- package/dist/es2019/plugins/expand/types.js +0 -1
- package/dist/es2019/plugins/expand/ui/ExpandIconButton.js +0 -85
- package/dist/es2019/plugins/expand/ui/class-names.js +0 -12
- package/dist/es2019/plugins/expand/utils.js +0 -1
- package/dist/esm/plugins/breakout/constants.js +0 -4
- package/dist/esm/plugins/expand/commands.js +0 -177
- package/dist/esm/plugins/expand/index.js +0 -97
- package/dist/esm/plugins/expand/nodeviews/index.js +0 -477
- package/dist/esm/plugins/expand/pm-plugins/keymap.js +0 -165
- package/dist/esm/plugins/expand/pm-plugins/main.js +0 -77
- package/dist/esm/plugins/expand/pm-plugins/plugin-factory.js +0 -9
- package/dist/esm/plugins/expand/reducer.js +0 -13
- package/dist/esm/plugins/expand/toolbar.js +0 -52
- package/dist/esm/plugins/expand/types.js +0 -1
- package/dist/esm/plugins/expand/ui/ExpandIconButton.js +0 -95
- package/dist/esm/plugins/expand/ui/class-names.js +0 -14
- package/dist/esm/plugins/expand/utils.js +0 -1
- package/dist/types/plugins/breakout/constants.d.ts +0 -4
- package/dist/types/plugins/expand/commands.d.ts +0 -13
- package/dist/types/plugins/expand/index.d.ts +0 -31
- package/dist/types/plugins/expand/nodeviews/index.d.ts +0 -55
- package/dist/types/plugins/expand/pm-plugins/keymap.d.ts +0 -4
- package/dist/types/plugins/expand/pm-plugins/main.d.ts +0 -8
- package/dist/types/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -3
- package/dist/types/plugins/expand/reducer.d.ts +0 -3
- package/dist/types/plugins/expand/toolbar.d.ts +0 -3
- package/dist/types/plugins/expand/types.d.ts +0 -9
- package/dist/types/plugins/expand/ui/ExpandIconButton.d.ts +0 -43
- package/dist/types/plugins/expand/ui/class-names.d.ts +0 -11
- package/dist/types/plugins/expand/utils.d.ts +0 -1
- package/dist/types-ts4.5/plugins/breakout/constants.d.ts +0 -4
- package/dist/types-ts4.5/plugins/expand/commands.d.ts +0 -13
- package/dist/types-ts4.5/plugins/expand/index.d.ts +0 -31
- package/dist/types-ts4.5/plugins/expand/nodeviews/index.d.ts +0 -55
- package/dist/types-ts4.5/plugins/expand/pm-plugins/keymap.d.ts +0 -4
- package/dist/types-ts4.5/plugins/expand/pm-plugins/main.d.ts +0 -8
- package/dist/types-ts4.5/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -3
- package/dist/types-ts4.5/plugins/expand/reducer.d.ts +0 -3
- package/dist/types-ts4.5/plugins/expand/toolbar.d.ts +0 -3
- package/dist/types-ts4.5/plugins/expand/types.d.ts +0 -9
- package/dist/types-ts4.5/plugins/expand/ui/ExpandIconButton.d.ts +0 -43
- package/dist/types-ts4.5/plugins/expand/ui/class-names.d.ts +0 -11
- package/dist/types-ts4.5/plugins/expand/utils.d.ts +0 -1
|
@@ -15,7 +15,6 @@ export { default as annotationPlugin } from './annotation';
|
|
|
15
15
|
export { default as analyticsPlugin } from './analytics';
|
|
16
16
|
export { default as customAutoformatPlugin } from './custom-autoformat';
|
|
17
17
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
18
|
-
export { default as expandPlugin, isExpandInsertionEnabled } from './expand';
|
|
19
18
|
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|
|
20
19
|
export { default as findReplacePlugin } from './find-replace';
|
|
21
20
|
export { default as mobileSelectionPlugin } from './mobile-selection';
|
|
@@ -17,7 +17,7 @@ import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
|
17
17
|
import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions';
|
|
18
18
|
import type { StatusPlugin } from '@atlaskit/editor-plugin-status';
|
|
19
19
|
import type { PlaceholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
|
|
20
|
-
import type { ExpandPlugin } from '
|
|
20
|
+
import type { ExpandPlugin } from '@atlaskit/editor-plugin-expand';
|
|
21
21
|
export type InsertBlockPluginDependencies = [
|
|
22
22
|
FeatureFlagsPlugin,
|
|
23
23
|
TypeAheadPlugin,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { MobileDimensionsPluginState } from './types';
|
|
3
|
-
|
|
3
|
+
export type MobileDimensionsPlugin = NextEditorPlugin<'mobileDimensions', {
|
|
4
4
|
sharedState: MobileDimensionsPluginState | undefined;
|
|
5
5
|
}>;
|
|
6
|
+
declare const mobileDimensionsPlugin: MobileDimensionsPlugin;
|
|
6
7
|
export default mobileDimensionsPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PublicPluginAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { PublicPluginAPI, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
3
|
export type SetEditorAPI = (editorApi: PublicPluginAPI<any>) => void;
|
|
4
4
|
export interface EditorAPIContextType {
|
|
5
5
|
editorApi?: PublicPluginAPI<any>;
|
|
@@ -10,6 +10,6 @@ interface EditorAPIProviderProps {
|
|
|
10
10
|
children: React.ReactNode;
|
|
11
11
|
}
|
|
12
12
|
export declare const PresetContextProvider: ({ children }: EditorAPIProviderProps) => JSX.Element;
|
|
13
|
-
export declare
|
|
13
|
+
export declare function usePresetContext<Plugins extends OptionalPlugin<NextEditorPlugin<any, any>>[]>(): PublicPluginAPI<Plugins>;
|
|
14
14
|
export declare const useSetPresetContext: () => SetEditorAPI | undefined;
|
|
15
15
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
2
|
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { EditorProps } from '../types';
|
|
3
4
|
import type { DefaultPresetPluginOptions } from './default';
|
|
4
5
|
import type { EditorPresetProps } from './types';
|
|
5
6
|
import type { EditorSharedPropsWithPlugins, EditorPluginFeatureProps, EditorProviderProps } from '../types/editor-props';
|
|
@@ -18,4 +19,8 @@ type UniversalPresetProps = EditorPresetProps & DefaultPresetPluginOptions & Edi
|
|
|
18
19
|
* @returns a full featured preset configured according to the provided props - basis for create-plugins-list
|
|
19
20
|
*/
|
|
20
21
|
export default function createUniversalPreset(appearance: EditorAppearance | undefined, props: UniversalPresetProps, featureFlags: FeatureFlags, prevAppearance?: EditorAppearance, createAnalyticsEvent?: CreateUIAnalyticsEvent): EditorPresetBuilder<any, any>;
|
|
22
|
+
interface ExpandEditorProps {
|
|
23
|
+
allowExpand?: EditorProps['allowExpand'];
|
|
24
|
+
}
|
|
25
|
+
export declare function isExpandInsertionEnabled({ allowExpand }: ExpandEditorProps): boolean;
|
|
21
26
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ThemeProps } from '@atlaskit/theme/types';
|
|
1
|
+
import type { ThemeProps } from '@atlaskit/theme/types';
|
|
2
2
|
export declare const expandStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { AnalyticsEventPayload } from './types';
|
|
3
|
-
import type { HigherOrderCommand } from '../../types/command';
|
|
4
3
|
/**
|
|
5
4
|
*
|
|
6
5
|
* @private
|
|
@@ -10,13 +9,3 @@ import type { HigherOrderCommand } from '../../types/command';
|
|
|
10
9
|
*
|
|
11
10
|
*/
|
|
12
11
|
export declare function addAnalytics(state: EditorState, tr: Transaction, payload: AnalyticsEventPayload, channel?: string): Transaction;
|
|
13
|
-
export type AnalyticsEventPayloadCallback = (state: EditorState) => AnalyticsEventPayload | undefined;
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* @private
|
|
17
|
-
* @deprecated
|
|
18
|
-
*
|
|
19
|
-
* Do not use this anymore. Please use @atlaskit/editor-plugin-analytics
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
export declare function withAnalytics(payload: AnalyticsEventPayload | AnalyticsEventPayloadCallback, channel?: string): HigherOrderCommand;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
6
|
export type FindReplaceToolbarButtonWithStateProps = {
|
|
6
7
|
popupsBoundariesElement?: HTMLElement;
|
|
7
8
|
popupsMountPoint?: HTMLElement;
|
|
@@ -12,6 +13,7 @@ export type FindReplaceToolbarButtonWithStateProps = {
|
|
|
12
13
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
13
14
|
takeFullWidth?: boolean;
|
|
14
15
|
featureFlags: FeatureFlags;
|
|
16
|
+
editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
|
|
15
17
|
};
|
|
16
|
-
declare const FindReplaceToolbarButtonWithState:
|
|
18
|
+
declare const FindReplaceToolbarButtonWithState: ({ popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, isToolbarReducedSpacing, editorView, containerElement, dispatchAnalyticsEvent, featureFlags, editorAnalyticsAPI, takeFullWidth, }: FindReplaceToolbarButtonWithStateProps) => JSX.Element | null;
|
|
17
19
|
export default FindReplaceToolbarButtonWithState;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
2
|
import type { Command } from '../../types';
|
|
3
|
-
import type { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
export declare const activateWithAnalytics: ({ triggerMethod, }: {
|
|
3
|
+
import type { TRIGGER_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
export declare const activateWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ triggerMethod, }: {
|
|
5
5
|
triggerMethod: TRIGGER_METHOD.SHORTCUT | TRIGGER_METHOD.TOOLBAR;
|
|
6
6
|
}) => Command;
|
|
7
|
-
export declare const findWithAnalytics: ({ editorView, containerElement, keyword, }: {
|
|
7
|
+
export declare const findWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ editorView, containerElement, keyword, }: {
|
|
8
8
|
editorView: EditorView;
|
|
9
9
|
containerElement: HTMLElement | null;
|
|
10
10
|
keyword?: string | undefined;
|
|
11
|
-
}) => Command;
|
|
12
|
-
export declare const findNextWithAnalytics: ({ triggerMethod, }: {
|
|
11
|
+
}) => import("@atlaskit/editor-common/types").Command;
|
|
12
|
+
export declare const findNextWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ triggerMethod, }: {
|
|
13
13
|
triggerMethod: TRIGGER_METHOD.KEYBOARD | TRIGGER_METHOD.BUTTON;
|
|
14
14
|
}) => Command;
|
|
15
|
-
export declare const findPrevWithAnalytics: ({ triggerMethod, }: {
|
|
15
|
+
export declare const findPrevWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ triggerMethod, }: {
|
|
16
16
|
triggerMethod: TRIGGER_METHOD.KEYBOARD | TRIGGER_METHOD.BUTTON;
|
|
17
17
|
}) => Command;
|
|
18
|
-
export declare const replaceWithAnalytics: ({ triggerMethod, replaceText, }: {
|
|
18
|
+
export declare const replaceWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ triggerMethod, replaceText, }: {
|
|
19
19
|
triggerMethod: TRIGGER_METHOD.KEYBOARD | TRIGGER_METHOD.BUTTON;
|
|
20
20
|
replaceText: string;
|
|
21
21
|
}) => Command;
|
|
22
|
-
export declare const replaceAllWithAnalytics: ({ replaceText
|
|
22
|
+
export declare const replaceAllWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ replaceText }: {
|
|
23
23
|
replaceText: string;
|
|
24
24
|
}) => Command;
|
|
25
|
-
export declare const cancelSearchWithAnalytics: ({ triggerMethod, }: {
|
|
25
|
+
export declare const cancelSearchWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ triggerMethod, }: {
|
|
26
26
|
triggerMethod: TRIGGER_METHOD.KEYBOARD | TRIGGER_METHOD.TOOLBAR | TRIGGER_METHOD.BUTTON;
|
|
27
27
|
}) => Command;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
3
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
4
|
type Config = {
|
|
4
5
|
takeFullWidth: boolean;
|
|
5
6
|
twoLineEditorToolbar: boolean;
|
|
6
7
|
};
|
|
7
|
-
export
|
|
8
|
+
export type FindReplacePlugin = NextEditorPlugin<'findReplace', {
|
|
8
9
|
pluginConfiguration: Config;
|
|
9
10
|
dependencies: [
|
|
10
|
-
FeatureFlagsPlugin
|
|
11
|
+
FeatureFlagsPlugin,
|
|
12
|
+
OptionalPlugin<AnalyticsPlugin>
|
|
11
13
|
];
|
|
12
14
|
}>;
|
|
15
|
+
export declare const findReplacePlugin: FindReplacePlugin;
|
|
13
16
|
export default findReplacePlugin;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
|
|
2
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
declare const keymapPlugin: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => SafePlugin<any>;
|
|
3
4
|
export default keymapPlugin;
|
|
@@ -15,7 +15,6 @@ export { default as annotationPlugin } from './annotation';
|
|
|
15
15
|
export { default as analyticsPlugin } from './analytics';
|
|
16
16
|
export { default as customAutoformatPlugin } from './custom-autoformat';
|
|
17
17
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
18
|
-
export { default as expandPlugin, isExpandInsertionEnabled } from './expand';
|
|
19
18
|
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|
|
20
19
|
export { default as findReplacePlugin } from './find-replace';
|
|
21
20
|
export { default as mobileSelectionPlugin } from './mobile-selection';
|
|
@@ -17,7 +17,7 @@ import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
|
17
17
|
import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions';
|
|
18
18
|
import type { StatusPlugin } from '@atlaskit/editor-plugin-status';
|
|
19
19
|
import type { PlaceholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
|
|
20
|
-
import type { ExpandPlugin } from '
|
|
20
|
+
import type { ExpandPlugin } from '@atlaskit/editor-plugin-expand';
|
|
21
21
|
export type InsertBlockPluginDependencies = [
|
|
22
22
|
FeatureFlagsPlugin,
|
|
23
23
|
TypeAheadPlugin,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { MobileDimensionsPluginState } from './types';
|
|
3
|
-
|
|
3
|
+
export type MobileDimensionsPlugin = NextEditorPlugin<'mobileDimensions', {
|
|
4
4
|
sharedState: MobileDimensionsPluginState | undefined;
|
|
5
5
|
}>;
|
|
6
|
+
declare const mobileDimensionsPlugin: MobileDimensionsPlugin;
|
|
6
7
|
export default mobileDimensionsPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PublicPluginAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { PublicPluginAPI, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
3
|
export type SetEditorAPI = (editorApi: PublicPluginAPI<any>) => void;
|
|
4
4
|
export interface EditorAPIContextType {
|
|
5
5
|
editorApi?: PublicPluginAPI<any>;
|
|
@@ -10,6 +10,6 @@ interface EditorAPIProviderProps {
|
|
|
10
10
|
children: React.ReactNode;
|
|
11
11
|
}
|
|
12
12
|
export declare const PresetContextProvider: ({ children }: EditorAPIProviderProps) => JSX.Element;
|
|
13
|
-
export declare
|
|
13
|
+
export declare function usePresetContext<Plugins extends OptionalPlugin<NextEditorPlugin<any, any>>[]>(): PublicPluginAPI<Plugins>;
|
|
14
14
|
export declare const useSetPresetContext: () => SetEditorAPI | undefined;
|
|
15
15
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
2
|
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { EditorProps } from '../types';
|
|
3
4
|
import type { DefaultPresetPluginOptions } from './default';
|
|
4
5
|
import type { EditorPresetProps } from './types';
|
|
5
6
|
import type { EditorSharedPropsWithPlugins, EditorPluginFeatureProps, EditorProviderProps } from '../types/editor-props';
|
|
@@ -18,4 +19,8 @@ type UniversalPresetProps = EditorPresetProps & DefaultPresetPluginOptions & Edi
|
|
|
18
19
|
* @returns a full featured preset configured according to the provided props - basis for create-plugins-list
|
|
19
20
|
*/
|
|
20
21
|
export default function createUniversalPreset(appearance: EditorAppearance | undefined, props: UniversalPresetProps, featureFlags: FeatureFlags, prevAppearance?: EditorAppearance, createAnalyticsEvent?: CreateUIAnalyticsEvent): EditorPresetBuilder<any, any>;
|
|
22
|
+
interface ExpandEditorProps {
|
|
23
|
+
allowExpand?: EditorProps['allowExpand'];
|
|
24
|
+
}
|
|
25
|
+
export declare function isExpandInsertionEnabled({ allowExpand }: ExpandEditorProps): boolean;
|
|
21
26
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ThemeProps } from '@atlaskit/theme/types';
|
|
1
|
+
import type { ThemeProps } from '@atlaskit/theme/types';
|
|
2
2
|
export declare const expandStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "189.3.
|
|
3
|
+
"version": "189.3.15",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
74
74
|
"@atlaskit/editor-plugin-editor-disabled": "^0.2.0",
|
|
75
75
|
"@atlaskit/editor-plugin-emoji": "^0.4.0",
|
|
76
|
+
"@atlaskit/editor-plugin-expand": "^0.1.0",
|
|
76
77
|
"@atlaskit/editor-plugin-extension": "^0.2.0",
|
|
77
78
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
78
79
|
"@atlaskit/editor-plugin-floating-toolbar": "^0.7.0",
|
|
@@ -151,8 +152,7 @@
|
|
|
151
152
|
"raf-schd": "^4.0.3",
|
|
152
153
|
"react-loadable": "^5.1.0",
|
|
153
154
|
"react-transition-group": "^4.4.1",
|
|
154
|
-
"uuid": "^3.1.0"
|
|
155
|
-
"w3c-keyname": "^2.1.0"
|
|
155
|
+
"uuid": "^3.1.0"
|
|
156
156
|
},
|
|
157
157
|
"peerDependencies": {
|
|
158
158
|
"@atlaskit/link-provider": "^1.6.2",
|
|
@@ -246,10 +246,6 @@
|
|
|
246
246
|
"type": "boolean",
|
|
247
247
|
"referenceOnly": "true"
|
|
248
248
|
},
|
|
249
|
-
"platform.editor.update-table-cell-width-via-step": {
|
|
250
|
-
"type": "boolean",
|
|
251
|
-
"referenceOnly": "true"
|
|
252
|
-
},
|
|
253
249
|
"platform.editor.table-remove-update-resize-handles_djvab": {
|
|
254
250
|
"type": "boolean",
|
|
255
251
|
"referenceOnly": "true"
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.BreakoutCssClassName = void 0;
|
|
7
|
-
var BreakoutCssClassName = exports.BreakoutCssClassName = {
|
|
8
|
-
BREAKOUT_MARK: 'fabric-editor-breakout-mark',
|
|
9
|
-
BREAKOUT_MARK_DOM: 'fabric-editor-breakout-mark-dom'
|
|
10
|
-
};
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.updateExpandTitle = exports.toggleExpandExpanded = exports.setSelectionInsideExpand = exports.setExpandRef = exports.insertExpand = exports.focusTitle = exports.deleteExpandAtPos = exports.deleteExpand = exports.createExpandNode = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
|
-
var _utils = require("@atlaskit/editor-tables/utils");
|
|
11
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
|
-
var _selection = require("@atlaskit/editor-common/selection");
|
|
13
|
-
var _utils2 = require("./utils");
|
|
14
|
-
var _pluginFactory = require("./pm-plugins/plugin-factory");
|
|
15
|
-
var _utils3 = require("@atlaskit/editor-common/utils");
|
|
16
|
-
var _utils4 = require("@atlaskit/editor-prosemirror/utils");
|
|
17
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
-
var setExpandRef = exports.setExpandRef = function setExpandRef(ref) {
|
|
20
|
-
return (0, _pluginFactory.createCommand)({
|
|
21
|
-
type: 'SET_EXPAND_REF',
|
|
22
|
-
data: {
|
|
23
|
-
ref: ref
|
|
24
|
-
}
|
|
25
|
-
}, function (tr) {
|
|
26
|
-
return tr.setMeta('addToHistory', false);
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
var deleteExpandAtPos = exports.deleteExpandAtPos = function deleteExpandAtPos(editorAnalyticsAPI) {
|
|
30
|
-
return function (expandNodePos, expandNode) {
|
|
31
|
-
return function (state, dispatch) {
|
|
32
|
-
if (!expandNode || isNaN(expandNodePos)) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
var payload = {
|
|
36
|
-
action: _analytics.ACTION.DELETED,
|
|
37
|
-
actionSubject: expandNode.type === state.schema.nodes.expand ? _analytics.ACTION_SUBJECT.EXPAND : _analytics.ACTION_SUBJECT.NESTED_EXPAND,
|
|
38
|
-
attributes: {
|
|
39
|
-
inputMethod: _analytics.INPUT_METHOD.TOOLBAR
|
|
40
|
-
},
|
|
41
|
-
eventType: _analytics.EVENT_TYPE.TRACK
|
|
42
|
-
};
|
|
43
|
-
if (expandNode && dispatch) {
|
|
44
|
-
var tr = state.tr;
|
|
45
|
-
tr.delete(expandNodePos, expandNodePos + expandNode.nodeSize);
|
|
46
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
|
|
47
|
-
dispatch(tr);
|
|
48
|
-
}
|
|
49
|
-
return true;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
var deleteExpand = exports.deleteExpand = function deleteExpand(editorAnalyticsAPI) {
|
|
54
|
-
return function (state, dispatch) {
|
|
55
|
-
var expandNode = (0, _utils2.findExpand)(state);
|
|
56
|
-
if (!expandNode) {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
return deleteExpandAtPos(editorAnalyticsAPI)(expandNode.pos, expandNode.node)(state, dispatch);
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
var updateExpandTitle = exports.updateExpandTitle = function updateExpandTitle(title, pos, nodeType) {
|
|
63
|
-
return function (state, dispatch) {
|
|
64
|
-
var node = state.doc.nodeAt(pos);
|
|
65
|
-
if (node && node.type === nodeType && dispatch) {
|
|
66
|
-
var tr = state.tr;
|
|
67
|
-
tr.setNodeMarkup(pos, node.type, _objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
68
|
-
title: title
|
|
69
|
-
}), node.marks);
|
|
70
|
-
dispatch(tr);
|
|
71
|
-
}
|
|
72
|
-
return true;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
var toggleExpandExpanded = exports.toggleExpandExpanded = function toggleExpandExpanded(editorAnalyticsAPI) {
|
|
76
|
-
return function (pos, nodeType) {
|
|
77
|
-
return function (state, dispatch) {
|
|
78
|
-
var node = state.doc.nodeAt(pos);
|
|
79
|
-
if (node && node.type === nodeType && dispatch) {
|
|
80
|
-
var tr = state.tr;
|
|
81
|
-
var isExpandedNext = !node.attrs.__expanded;
|
|
82
|
-
tr.setNodeMarkup(pos, node.type, _objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
83
|
-
__expanded: isExpandedNext
|
|
84
|
-
}), node.marks);
|
|
85
|
-
|
|
86
|
-
// If we're going to collapse the expand and our cursor is currently inside
|
|
87
|
-
// Move to a right gap cursor, if the toolbar is interacted (or an API),
|
|
88
|
-
// it will insert below rather than inside (which will be invisible).
|
|
89
|
-
if (isExpandedNext === false && (0, _utils2.findExpand)(state)) {
|
|
90
|
-
tr.setSelection(new _selection.GapCursorSelection(tr.doc.resolve(pos + node.nodeSize), _selection.Side.RIGHT));
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// log when people open/close expands
|
|
94
|
-
// TODO: ED-8523 make platform/mode global attributes?
|
|
95
|
-
var payload = {
|
|
96
|
-
action: _analytics.ACTION.TOGGLE_EXPAND,
|
|
97
|
-
actionSubject: nodeType === state.schema.nodes.expand ? _analytics.ACTION_SUBJECT.EXPAND : _analytics.ACTION_SUBJECT.NESTED_EXPAND,
|
|
98
|
-
attributes: {
|
|
99
|
-
platform: _analytics.PLATFORMS.WEB,
|
|
100
|
-
mode: _analytics.MODE.EDITOR,
|
|
101
|
-
expanded: isExpandedNext
|
|
102
|
-
},
|
|
103
|
-
eventType: _analytics.EVENT_TYPE.TRACK
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
// `isRemote` meta prevents this step from being
|
|
107
|
-
// sync'd between sessions in collab edit
|
|
108
|
-
tr.setMeta('isRemote', true);
|
|
109
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
|
|
110
|
-
dispatch(tr);
|
|
111
|
-
}
|
|
112
|
-
return true;
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
// Creates either an expand or a nestedExpand node based on the current selection
|
|
118
|
-
var createExpandNode = exports.createExpandNode = function createExpandNode(state) {
|
|
119
|
-
var _state$schema$nodes = state.schema.nodes,
|
|
120
|
-
expand = _state$schema$nodes.expand,
|
|
121
|
-
nestedExpand = _state$schema$nodes.nestedExpand;
|
|
122
|
-
var expandType = (0, _utils.findTable)(state.selection) ? nestedExpand : expand;
|
|
123
|
-
return expandType.createAndFill({});
|
|
124
|
-
};
|
|
125
|
-
var insertExpand = exports.insertExpand = function insertExpand(editorAnalyticsAPI) {
|
|
126
|
-
return function (state, dispatch) {
|
|
127
|
-
var expandNode = createExpandNode(state);
|
|
128
|
-
if (!expandNode) {
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
var tr = state.selection.empty ? (0, _utils4.safeInsert)(expandNode)(state.tr).scrollIntoView() : (0, _utils3.createWrapSelectionTransaction)({
|
|
132
|
-
state: state,
|
|
133
|
-
type: expandNode.type
|
|
134
|
-
});
|
|
135
|
-
var payload = {
|
|
136
|
-
action: _analytics.ACTION.INSERTED,
|
|
137
|
-
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
138
|
-
actionSubjectId: (expandNode === null || expandNode === void 0 ? void 0 : expandNode.type) === state.schema.nodes.expand ? _analytics.ACTION_SUBJECT_ID.EXPAND : _analytics.ACTION_SUBJECT_ID.NESTED_EXPAND,
|
|
139
|
-
attributes: {
|
|
140
|
-
inputMethod: _analytics.INPUT_METHOD.INSERT_MENU
|
|
141
|
-
},
|
|
142
|
-
eventType: _analytics.EVENT_TYPE.TRACK
|
|
143
|
-
};
|
|
144
|
-
if (dispatch && expandNode) {
|
|
145
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
|
|
146
|
-
dispatch(tr);
|
|
147
|
-
}
|
|
148
|
-
return true;
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
var focusTitle = exports.focusTitle = function focusTitle(pos) {
|
|
152
|
-
return function (state, dispatch, editorView) {
|
|
153
|
-
if (editorView) {
|
|
154
|
-
var dom = editorView.domAtPos(pos);
|
|
155
|
-
var expandWrapper = dom.node.parentElement;
|
|
156
|
-
if (expandWrapper) {
|
|
157
|
-
setSelectionInsideExpand(pos)(state, dispatch, editorView);
|
|
158
|
-
var input = expandWrapper.querySelector('input');
|
|
159
|
-
if (input) {
|
|
160
|
-
input.focus();
|
|
161
|
-
return true;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
return false;
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
// Used to clear any node or cell selection when expand title is focused
|
|
170
|
-
var setSelectionInsideExpand = exports.setSelectionInsideExpand = function setSelectionInsideExpand(expandPos) {
|
|
171
|
-
return function (state, dispatch, editorView) {
|
|
172
|
-
if (editorView) {
|
|
173
|
-
if (!editorView.hasFocus()) {
|
|
174
|
-
editorView.focus();
|
|
175
|
-
}
|
|
176
|
-
var sel = _state.Selection.findFrom(editorView.state.doc.resolve(expandPos), 1, true);
|
|
177
|
-
if (sel && dispatch) {
|
|
178
|
-
dispatch(editorView.state.tr.setSelection(sel));
|
|
179
|
-
}
|
|
180
|
-
return true;
|
|
181
|
-
}
|
|
182
|
-
return false;
|
|
183
|
-
};
|
|
184
|
-
};
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
exports.isExpandInsertionEnabled = isExpandInsertionEnabled;
|
|
9
|
-
Object.defineProperty(exports, "pluginKey", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function get() {
|
|
12
|
-
return _pluginFactory.pluginKey;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
16
|
-
var _react = _interopRequireDefault(require("react"));
|
|
17
|
-
var _adfSchema = require("@atlaskit/adf-schema");
|
|
18
|
-
var _main = require("./pm-plugins/main");
|
|
19
|
-
var _keymap = require("./pm-plugins/keymap");
|
|
20
|
-
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
21
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
22
|
-
var _toolbar = require("./toolbar");
|
|
23
|
-
var _commands = require("./commands");
|
|
24
|
-
var _messages = require("@atlaskit/editor-common/messages");
|
|
25
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
26
|
-
var _pluginFactory = require("./pm-plugins/plugin-factory");
|
|
27
|
-
var expandPlugin = function expandPlugin(_ref) {
|
|
28
|
-
var _api$featureFlags, _api$analytics;
|
|
29
|
-
var _ref$config = _ref.config,
|
|
30
|
-
options = _ref$config === void 0 ? {} : _ref$config,
|
|
31
|
-
api = _ref.api;
|
|
32
|
-
var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
33
|
-
return {
|
|
34
|
-
name: 'expand',
|
|
35
|
-
nodes: function nodes() {
|
|
36
|
-
return [{
|
|
37
|
-
name: 'expand',
|
|
38
|
-
node: _adfSchema.expand
|
|
39
|
-
}, {
|
|
40
|
-
name: 'nestedExpand',
|
|
41
|
-
node: _adfSchema.nestedExpand
|
|
42
|
-
}];
|
|
43
|
-
},
|
|
44
|
-
actions: {
|
|
45
|
-
insertExpand: (0, _commands.insertExpand)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)
|
|
46
|
-
},
|
|
47
|
-
pmPlugins: function pmPlugins() {
|
|
48
|
-
return [{
|
|
49
|
-
name: 'expand',
|
|
50
|
-
plugin: function plugin(_ref2) {
|
|
51
|
-
var dispatch = _ref2.dispatch,
|
|
52
|
-
getIntl = _ref2.getIntl;
|
|
53
|
-
return (0, _main.createPlugin)(dispatch, getIntl, options.appearance, options.useLongPressSelection, featureFlags, api);
|
|
54
|
-
}
|
|
55
|
-
}, {
|
|
56
|
-
name: 'expandKeymap',
|
|
57
|
-
plugin: function plugin() {
|
|
58
|
-
return (0, _keymap.expandKeymap)(api);
|
|
59
|
-
}
|
|
60
|
-
}];
|
|
61
|
-
},
|
|
62
|
-
pluginsOptions: {
|
|
63
|
-
floatingToolbar: (0, _toolbar.getToolbarConfig)(api),
|
|
64
|
-
quickInsert: function quickInsert(_ref3) {
|
|
65
|
-
var formatMessage = _ref3.formatMessage;
|
|
66
|
-
if (options && options.allowInsertion !== true) {
|
|
67
|
-
return [];
|
|
68
|
-
}
|
|
69
|
-
return [{
|
|
70
|
-
id: 'expand',
|
|
71
|
-
title: formatMessage(_messages.toolbarInsertBlockMessages.expand),
|
|
72
|
-
description: formatMessage(_messages.toolbarInsertBlockMessages.expandDescription),
|
|
73
|
-
keywords: ['accordion', 'collapse'],
|
|
74
|
-
priority: 600,
|
|
75
|
-
icon: function icon() {
|
|
76
|
-
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconExpand, null);
|
|
77
|
-
},
|
|
78
|
-
action: function action(insert, state) {
|
|
79
|
-
var _api$analytics2;
|
|
80
|
-
var node = (0, _commands.createExpandNode)(state);
|
|
81
|
-
if (!node) {
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
var tr = state.selection.empty ? insert(node) : (0, _utils.createWrapSelectionTransaction)({
|
|
85
|
-
state: state,
|
|
86
|
-
type: node.type
|
|
87
|
-
});
|
|
88
|
-
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
|
|
89
|
-
action: _analytics.ACTION.INSERTED,
|
|
90
|
-
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
91
|
-
actionSubjectId: node.type === state.schema.nodes.nestedExpand ? _analytics.ACTION_SUBJECT_ID.NESTED_EXPAND : _analytics.ACTION_SUBJECT_ID.EXPAND,
|
|
92
|
-
attributes: {
|
|
93
|
-
inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
|
|
94
|
-
},
|
|
95
|
-
eventType: _analytics.EVENT_TYPE.TRACK
|
|
96
|
-
})(tr);
|
|
97
|
-
return tr;
|
|
98
|
-
}
|
|
99
|
-
}];
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
var _default = exports.default = expandPlugin;
|
|
105
|
-
function isExpandInsertionEnabled(_ref4) {
|
|
106
|
-
var allowExpand = _ref4.allowExpand;
|
|
107
|
-
if (allowExpand && (0, _typeof2.default)(allowExpand) === 'object') {
|
|
108
|
-
return !!allowExpand.allowInsertion;
|
|
109
|
-
}
|
|
110
|
-
return false;
|
|
111
|
-
}
|