@atlaskit/editor-core 182.0.2 → 182.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +2 -0
- package/CHANGELOG.md +46 -0
- package/README.md +20 -0
- package/architecture/0001-record-architecture-decisions.md +25 -0
- package/architecture/0002-deep-equality-check-for-getsharedstate.md +67 -0
- package/architecture/0003-explicit-plugin-dependencies.md +291 -0
- package/dist/cjs/actions/index.js +17 -6
- package/dist/cjs/analytics-api/attach-payload-into-transaction.js +2 -1
- package/dist/cjs/create-editor/ErrorBoundary.js +1 -16
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +3 -3
- package/dist/cjs/editor-next/editor-internal.js +2 -1
- package/dist/cjs/editor-next/index.js +5 -1
- package/dist/cjs/editor.js +9 -5
- package/dist/cjs/keymaps/index.js +12 -0
- package/dist/cjs/labs/next/internal/hooks/use-editor/index.js +5 -7
- package/dist/cjs/labs/next/presets/default.js +1 -2
- package/dist/cjs/plugins/card/index.js +16 -5
- package/dist/cjs/plugins/card/pm-plugins/actions.js +10 -1
- package/dist/cjs/plugins/card/pm-plugins/analytics/create-analytics-queue.js +48 -0
- package/dist/cjs/plugins/card/pm-plugins/analytics/events-from-tr.js +337 -0
- package/dist/cjs/plugins/card/pm-plugins/analytics/index.js +19 -0
- package/dist/cjs/plugins/card/pm-plugins/analytics/types.js +5 -0
- package/dist/cjs/plugins/card/pm-plugins/analytics/utils.js +139 -0
- package/dist/cjs/plugins/card/pm-plugins/doc.js +99 -22
- package/dist/cjs/plugins/card/pm-plugins/main.js +16 -10
- package/dist/cjs/plugins/card/pm-plugins/reducers.js +7 -0
- package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +3 -7
- package/dist/cjs/plugins/card/toolbar.js +18 -8
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +12 -8
- package/dist/cjs/plugins/card/ui/EditorSmartCardEventsNext.js +202 -0
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +12 -4
- package/dist/cjs/plugins/card/utils.js +4 -2
- package/dist/cjs/plugins/extension/context-panel.js +3 -2
- package/dist/cjs/plugins/extension/index.js +4 -1
- package/dist/cjs/plugins/help-dialog/ui/index.js +29 -8
- package/dist/cjs/plugins/hyperlink/Toolbar.js +12 -2
- package/dist/cjs/plugins/hyperlink/commands.js +9 -5
- package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +4 -0
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +2 -2
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/insert-block/index.js +5 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +25 -23
- package/dist/cjs/plugins/media/index.js +9 -5
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +7 -1
- package/dist/cjs/plugins/media/pm-plugins/main.js +5 -4
- package/dist/cjs/plugins/media/utils/media-single.js +1 -4
- package/dist/cjs/plugins/panel/pm-plugins/keymaps.js +2 -1
- package/dist/cjs/plugins/paste/handlers.js +5 -5
- package/dist/cjs/plugins/paste/index.js +4 -2
- package/dist/cjs/plugins/paste/pm-plugins/main.js +6 -4
- package/dist/cjs/plugins/rule/commands.js +2 -2
- package/dist/cjs/plugins/rule/index.js +5 -4
- package/dist/cjs/plugins/rule/pm-plugins/input-rule.js +6 -8
- package/dist/cjs/plugins/rule/pm-plugins/keymap.js +2 -2
- package/dist/cjs/plugins/text-color/index.js +5 -2
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +3 -4
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +10 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +2 -4
- package/dist/cjs/ui/ColorPalette/index.js +6 -0
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +15 -10
- package/dist/cjs/ui/ConfigPanel/ConfigPanelFieldsLoader.js +3 -1
- package/dist/cjs/ui/ConfigPanel/Fields/ColorPicker.js +248 -17
- package/dist/cjs/ui/ConfigPanel/FormContent.js +12 -6
- package/dist/cjs/ui/ConfigPanel/utils.js +2 -12
- package/dist/cjs/ui/ContentStyles/index.js +2 -5
- package/dist/cjs/ui/MediaAndEmbedsToolbar/index.js +16 -8
- package/dist/cjs/utils/document.js +5 -3
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +10 -4
- package/dist/es2019/analytics-api/attach-payload-into-transaction.js +2 -1
- package/dist/es2019/create-editor/ErrorBoundary.js +1 -13
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +2 -2
- package/dist/es2019/editor-next/editor-internal.js +2 -1
- package/dist/es2019/editor-next/index.js +5 -1
- package/dist/es2019/editor.js +5 -2
- package/dist/es2019/keymaps/index.js +1 -1
- package/dist/es2019/labs/next/internal/hooks/use-editor/index.js +4 -6
- package/dist/es2019/labs/next/presets/default.js +1 -2
- package/dist/es2019/plugins/card/index.js +15 -5
- package/dist/es2019/plugins/card/pm-plugins/actions.js +4 -0
- package/dist/es2019/plugins/card/pm-plugins/analytics/create-analytics-queue.js +38 -0
- package/dist/es2019/plugins/card/pm-plugins/analytics/events-from-tr.js +316 -0
- package/dist/es2019/plugins/card/pm-plugins/analytics/index.js +2 -0
- package/dist/es2019/plugins/card/pm-plugins/analytics/types.js +1 -0
- package/dist/es2019/plugins/card/pm-plugins/analytics/utils.js +124 -0
- package/dist/es2019/plugins/card/pm-plugins/doc.js +94 -20
- package/dist/es2019/plugins/card/pm-plugins/main.js +17 -8
- package/dist/es2019/plugins/card/pm-plugins/reducers.js +8 -0
- package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +3 -7
- package/dist/es2019/plugins/card/toolbar.js +16 -8
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +13 -9
- package/dist/es2019/plugins/card/ui/EditorSmartCardEventsNext.js +180 -0
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +11 -2
- package/dist/es2019/plugins/card/utils.js +6 -2
- package/dist/es2019/plugins/extension/context-panel.js +3 -2
- package/dist/es2019/plugins/extension/index.js +45 -41
- package/dist/es2019/plugins/help-dialog/ui/index.js +17 -1
- package/dist/es2019/plugins/hyperlink/Toolbar.js +13 -4
- package/dist/es2019/plugins/hyperlink/commands.js +9 -6
- package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +4 -0
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +2 -2
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/insert-block/index.js +96 -91
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +3 -2
- package/dist/es2019/plugins/media/index.js +202 -198
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +9 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +5 -4
- package/dist/es2019/plugins/media/utils/media-single.js +1 -5
- package/dist/es2019/plugins/panel/pm-plugins/keymaps.js +3 -2
- package/dist/es2019/plugins/paste/handlers.js +6 -6
- package/dist/es2019/plugins/paste/index.js +18 -14
- package/dist/es2019/plugins/paste/pm-plugins/main.js +7 -5
- package/dist/es2019/plugins/rule/commands.js +2 -2
- package/dist/es2019/plugins/rule/index.js +49 -46
- package/dist/es2019/plugins/rule/pm-plugins/input-rule.js +6 -7
- package/dist/es2019/plugins/rule/pm-plugins/keymap.js +2 -2
- package/dist/es2019/plugins/text-color/index.js +49 -44
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +3 -3
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +10 -0
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +2 -4
- package/dist/es2019/ui/ColorPalette/index.js +2 -2
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +8 -4
- package/dist/es2019/ui/ConfigPanel/ConfigPanelFieldsLoader.js +3 -1
- package/dist/es2019/ui/ConfigPanel/Fields/ColorPicker.js +238 -13
- package/dist/es2019/ui/ConfigPanel/FormContent.js +12 -6
- package/dist/es2019/ui/ConfigPanel/utils.js +1 -11
- package/dist/es2019/ui/ContentStyles/index.js +2 -5
- package/dist/es2019/ui/MediaAndEmbedsToolbar/index.js +12 -10
- package/dist/es2019/utils/document.js +5 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +17 -6
- package/dist/esm/analytics-api/attach-payload-into-transaction.js +2 -1
- package/dist/esm/create-editor/ErrorBoundary.js +1 -16
- package/dist/esm/create-editor/ReactEditorViewInternal.js +2 -2
- package/dist/esm/editor-next/editor-internal.js +2 -1
- package/dist/esm/editor-next/index.js +5 -1
- package/dist/esm/editor.js +9 -5
- package/dist/esm/keymaps/index.js +1 -1
- package/dist/esm/labs/next/internal/hooks/use-editor/index.js +4 -6
- package/dist/esm/labs/next/presets/default.js +1 -2
- package/dist/esm/plugins/card/index.js +13 -5
- package/dist/esm/plugins/card/pm-plugins/actions.js +8 -0
- package/dist/esm/plugins/card/pm-plugins/analytics/create-analytics-queue.js +41 -0
- package/dist/esm/plugins/card/pm-plugins/analytics/events-from-tr.js +328 -0
- package/dist/esm/plugins/card/pm-plugins/analytics/index.js +2 -0
- package/dist/esm/plugins/card/pm-plugins/analytics/types.js +1 -0
- package/dist/esm/plugins/card/pm-plugins/analytics/utils.js +124 -0
- package/dist/esm/plugins/card/pm-plugins/doc.js +98 -22
- package/dist/esm/plugins/card/pm-plugins/main.js +16 -10
- package/dist/esm/plugins/card/pm-plugins/reducers.js +7 -0
- package/dist/esm/plugins/card/pm-plugins/util/resolve.js +3 -7
- package/dist/esm/plugins/card/toolbar.js +18 -8
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +13 -9
- package/dist/esm/plugins/card/ui/EditorSmartCardEventsNext.js +191 -0
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +12 -4
- package/dist/esm/plugins/card/utils.js +4 -2
- package/dist/esm/plugins/extension/context-panel.js +3 -2
- package/dist/esm/plugins/extension/index.js +4 -1
- package/dist/esm/plugins/help-dialog/ui/index.js +29 -8
- package/dist/esm/plugins/hyperlink/Toolbar.js +13 -3
- package/dist/esm/plugins/hyperlink/commands.js +9 -5
- package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +4 -0
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +2 -2
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/insert-block/index.js +5 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +25 -23
- package/dist/esm/plugins/media/index.js +9 -5
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +7 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +5 -4
- package/dist/esm/plugins/media/utils/media-single.js +1 -4
- package/dist/esm/plugins/panel/pm-plugins/keymaps.js +3 -2
- package/dist/esm/plugins/paste/handlers.js +6 -6
- package/dist/esm/plugins/paste/index.js +4 -2
- package/dist/esm/plugins/paste/pm-plugins/main.js +7 -5
- package/dist/esm/plugins/rule/commands.js +2 -2
- package/dist/esm/plugins/rule/index.js +5 -4
- package/dist/esm/plugins/rule/pm-plugins/input-rule.js +6 -8
- package/dist/esm/plugins/rule/pm-plugins/keymap.js +2 -2
- package/dist/esm/plugins/text-color/index.js +5 -2
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +3 -4
- package/dist/esm/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +10 -0
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +2 -4
- package/dist/esm/ui/ColorPalette/index.js +2 -2
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +15 -10
- package/dist/esm/ui/ConfigPanel/ConfigPanelFieldsLoader.js +3 -1
- package/dist/esm/ui/ConfigPanel/Fields/ColorPicker.js +244 -19
- package/dist/esm/ui/ConfigPanel/FormContent.js +12 -6
- package/dist/esm/ui/ConfigPanel/utils.js +0 -10
- package/dist/esm/ui/ContentStyles/index.js +2 -5
- package/dist/esm/ui/MediaAndEmbedsToolbar/index.js +16 -8
- package/dist/esm/utils/document.js +5 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +3 -2
- package/dist/types/create-editor/ErrorBoundary.d.ts +2 -2
- package/dist/types/editor-next/index.d.ts +1 -0
- package/dist/types/editor.d.ts +1 -0
- package/dist/types/keymaps/index.d.ts +1 -1
- package/dist/types/labs/next/internal/hooks/use-editor/index.d.ts +2 -1
- package/dist/types/labs/next/presets/cxhtml.d.ts +1 -5
- package/dist/types/labs/next/presets/default.d.ts +2 -10
- package/dist/types/labs/next/presets/mobile.d.ts +1 -5
- package/dist/types/plugins/card/pm-plugins/actions.d.ts +2 -1
- package/dist/types/plugins/card/pm-plugins/analytics/create-analytics-queue.d.ts +10 -0
- package/dist/types/plugins/card/pm-plugins/analytics/events-from-tr.d.ts +17 -0
- package/dist/types/plugins/card/pm-plugins/analytics/index.d.ts +2 -0
- package/dist/types/plugins/card/pm-plugins/analytics/types.d.ts +10 -0
- package/dist/types/plugins/card/pm-plugins/analytics/utils.d.ts +26 -0
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +8 -7
- package/dist/types/plugins/card/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/card/pm-plugins/util/resolve.d.ts +2 -2
- package/dist/types/plugins/card/pm-plugins/util/state.d.ts +3 -0
- package/dist/types/plugins/card/types.d.ts +81 -7
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +2 -1
- package/dist/types/plugins/card/ui/EditorSmartCardEventsNext.d.ts +18 -0
- package/dist/types/plugins/card/utils.d.ts +1 -1
- package/dist/types/plugins/extension/context-panel.d.ts +2 -1
- package/dist/types/plugins/extension/index.d.ts +2 -0
- package/dist/types/plugins/hyperlink/commands.d.ts +3 -2
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +2 -1
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/insert-block/index.d.ts +2 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +2 -1
- package/dist/types/plugins/media/index.d.ts +2 -0
- package/dist/types/plugins/media/pm-plugins/main.d.ts +3 -2
- package/dist/types/plugins/media/utils/media-single.d.ts +1 -1
- package/dist/types/plugins/paste/index.d.ts +2 -0
- package/dist/types/plugins/paste/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/rule/commands.d.ts +2 -1
- package/dist/types/plugins/rule/index.d.ts +5 -1
- package/dist/types/plugins/rule/pm-plugins/input-rule.d.ts +1 -1
- package/dist/types/plugins/rule/pm-plugins/keymap.d.ts +2 -1
- package/dist/types/plugins/text-color/index.d.ts +2 -0
- package/dist/types/plugins/text-color/ui/ToolbarTextColor/index.d.ts +2 -0
- package/dist/types/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +10 -0
- package/dist/types/types/editor-appearance-component.d.ts +1 -1
- package/dist/types/types/editor-props.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +2 -0
- package/dist/types/ui/ColorPalette/index.d.ts +2 -2
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +3 -1
- package/dist/types/ui/ConfigPanel/ConfigPanelFieldsLoader.d.ts +3 -1
- package/dist/types/ui/ConfigPanel/Fields/ColorPicker.d.ts +12 -1
- package/dist/types/ui/ConfigPanel/FormContent.d.ts +2 -2
- package/dist/types/ui/ConfigPanel/types.d.ts +3 -0
- package/dist/types/ui/ConfigPanel/utils.d.ts +0 -1
- package/dist/types/ui/MediaAndEmbedsToolbar/index.d.ts +1 -1
- package/package.json +14 -13
- package/report.api.md +10 -0
- package/dist/cjs/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +0 -12
- package/dist/cjs/plugins/feature-flags-context/get-feature-flags.js +0 -11
- package/dist/cjs/plugins/feature-flags-context/index.js +0 -50
- package/dist/cjs/plugins/feature-flags-context/plugin-key.js +0 -9
- package/dist/es2019/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +0 -1
- package/dist/es2019/plugins/feature-flags-context/get-feature-flags.js +0 -2
- package/dist/es2019/plugins/feature-flags-context/index.js +0 -29
- package/dist/es2019/plugins/feature-flags-context/plugin-key.js +0 -2
- package/dist/esm/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +0 -1
- package/dist/esm/plugins/feature-flags-context/get-feature-flags.js +0 -4
- package/dist/esm/plugins/feature-flags-context/index.js +0 -40
- package/dist/esm/plugins/feature-flags-context/plugin-key.js +0 -2
- package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +0 -1
- package/dist/types/plugins/feature-flags-context/get-feature-flags.d.ts +0 -3
- package/dist/types/plugins/feature-flags-context/index.d.ts +0 -9
- package/dist/types/plugins/feature-flags-context/plugin-key.d.ts +0 -2
|
@@ -11,7 +11,7 @@ declare type EditorPresetMobileProps = {
|
|
|
11
11
|
allowMediaSingle?: boolean;
|
|
12
12
|
};
|
|
13
13
|
} & EditorPresetProps;
|
|
14
|
-
export declare function useMobilePreset({ media, placeholder, maxContentSize, createAnalyticsEvent, featureFlags, }: EditorPresetMobileProps & EditorPresetProps): import("@atlaskit/editor-common/preset").EditorPresetBuilder<[...string[], "hyperlink", "textFormatting", "width", "quickInsert", "typeAhead", "unsupportedContent", "editorDisabled", "submitEditor", "fakeTextCursor", "floatingToolbar", "
|
|
14
|
+
export declare function useMobilePreset({ media, placeholder, maxContentSize, createAnalyticsEvent, featureFlags, }: EditorPresetMobileProps & EditorPresetProps): import("@atlaskit/editor-common/preset").EditorPresetBuilder<[...string[], "hyperlink", "textFormatting", "width", "quickInsert", "typeAhead", "unsupportedContent", "editorDisabled", "submitEditor", "fakeTextCursor", "floatingToolbar", "selection", "codeBlock"], [(config: import("../../../plugins/code-block/types").CodeBlockOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"codeBlock", {
|
|
15
15
|
pluginConfiguration: import("../../../plugins/code-block/types").CodeBlockOptions;
|
|
16
16
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"codeBlock", {
|
|
17
17
|
pluginConfiguration: import("../../../plugins/code-block/types").CodeBlockOptions;
|
|
@@ -19,10 +19,6 @@ export declare function useMobilePreset({ media, placeholder, maxContentSize, cr
|
|
|
19
19
|
pluginConfiguration: import("../../../plugins/selection/types").SelectionPluginOptions | undefined;
|
|
20
20
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"selection", {
|
|
21
21
|
pluginConfiguration: import("../../../plugins/selection/types").SelectionPluginOptions | undefined;
|
|
22
|
-
}>, (config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlagsContext", {
|
|
23
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
24
|
-
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"featureFlagsContext", {
|
|
25
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
26
22
|
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"floatingToolbar", {
|
|
27
23
|
dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
|
|
28
24
|
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Transaction } from 'prosemirror-state';
|
|
2
2
|
import { CardProvider } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import { CardPluginAction, Request, CardInfo } from '../types';
|
|
3
|
+
import { CardPluginAction, Request, CardInfo, SmartLinkEventsNext } from '../types';
|
|
4
4
|
import { SmartLinkEvents } from '@atlaskit/smart-card';
|
|
5
5
|
export declare const cardAction: (tr: Transaction, action: CardPluginAction) => Transaction;
|
|
6
6
|
export declare const resolveCard: (url: string) => (tr: Transaction) => Transaction<any>;
|
|
7
7
|
export declare const queueCards: (requests: Request[]) => (tr: Transaction) => Transaction<any>;
|
|
8
8
|
export declare const registerCard: (info: CardInfo) => (tr: Transaction) => Transaction<any>;
|
|
9
9
|
export declare const registerSmartCardEvents: (smartLinkEvents: SmartLinkEvents) => (tr: Transaction) => Transaction<any>;
|
|
10
|
+
export declare const registerSmartCardEventsNext: (smartLinkEvents: SmartLinkEventsNext) => (tr: Transaction) => Transaction<any>;
|
|
10
11
|
export declare const setProvider: (cardProvider: CardProvider | null) => (tr: Transaction) => Transaction<any>;
|
|
11
12
|
export declare const showLinkToolbar: (tr: Transaction) => Transaction<any>;
|
|
12
13
|
export declare const hideLinkToolbar: (tr: Transaction) => Transaction<any>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LifecycleEvent, SmartLinkEventsNext } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Simple mechanism to defer analytics related callbacks
|
|
4
|
+
*/
|
|
5
|
+
export declare const createAnalyticsQueue: (enabled?: boolean) => {
|
|
6
|
+
push: (...events: LifecycleEvent[]) => void;
|
|
7
|
+
flush: () => void;
|
|
8
|
+
setCallbacks: (callbacks: SmartLinkEventsNext) => void;
|
|
9
|
+
getSize: () => number;
|
|
10
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EditorState, ReadonlyTransaction, Transaction } from 'prosemirror-state';
|
|
2
|
+
import { LifecycleEvent } from '../../types';
|
|
3
|
+
import { Link } from './types';
|
|
4
|
+
export declare const findChangedLinks: (tr: Transaction | ReadonlyTransaction, state: EditorState) => {
|
|
5
|
+
removed: Link[];
|
|
6
|
+
inserted: Link[];
|
|
7
|
+
updated: ({
|
|
8
|
+
removed: Link;
|
|
9
|
+
inserted: Link;
|
|
10
|
+
} | {
|
|
11
|
+
inserted: Link;
|
|
12
|
+
previous: {
|
|
13
|
+
display?: string;
|
|
14
|
+
};
|
|
15
|
+
})[];
|
|
16
|
+
};
|
|
17
|
+
export declare function eventsFromTransaction(tr: ReadonlyTransaction, state: EditorState): LifecycleEvent[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Node, Schema } from 'prosemirror-model';
|
|
2
|
+
import { ReadonlyTransaction, Transaction } from 'prosemirror-state';
|
|
3
|
+
import { Link } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Whether a node is a "link" node, ie inline card, block card, embed card
|
|
6
|
+
* (but not a text node with a link mark)
|
|
7
|
+
*/
|
|
8
|
+
export declare function isLinkNode(node: Node): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Analytics appearance for link object
|
|
11
|
+
*/
|
|
12
|
+
export declare function appearanceForLink(link: Link): "url" | import("@atlaskit/editor-common/provider-factory").CardAppearance;
|
|
13
|
+
/**
|
|
14
|
+
* Determine if a node is considered to be a link
|
|
15
|
+
*/
|
|
16
|
+
export declare const isLink: (schema: Schema, node: Node) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Given a node, find all nodes and marks that are considered "links"
|
|
19
|
+
* @param state EditorState
|
|
20
|
+
* @param fragment Fragment to search
|
|
21
|
+
* @returns Array of nodes and marks found in the fragment that are "links"
|
|
22
|
+
*/
|
|
23
|
+
export declare function findLinksInNode(schema: Schema, node: Node, offset: number): Link[];
|
|
24
|
+
export declare function getLinkUrl(link: Link): string | undefined;
|
|
25
|
+
export declare const linkObjectFromNode: (schema: Schema, node: Node, pos: number) => Link | undefined;
|
|
26
|
+
export declare const findLinksAtPositions: (tr: Transaction | ReadonlyTransaction, positions: number[]) => Link[];
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { EditorState, Transaction } from 'prosemirror-state';
|
|
2
2
|
import { Node } from 'prosemirror-model';
|
|
3
|
-
import {
|
|
3
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
4
|
import { CardAdf, CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
-
import { ACTION
|
|
5
|
+
import { ACTION } from '../../../plugins/analytics';
|
|
6
6
|
import { Command } from '../../../types';
|
|
7
|
-
import { CardReplacementInputMethod } from '../types';
|
|
8
|
-
export declare const replaceQueuedUrlWithCard: (url: string, cardData: CardAdf, analyticsAction?: ACTION | undefined
|
|
9
|
-
export declare const handleFallbackWithAnalytics: (
|
|
10
|
-
export declare const queueCardsFromChangedTr: (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, normalizeLinkText?: boolean) => Transaction;
|
|
7
|
+
import { CardReplacementInputMethod, Request } from '../types';
|
|
8
|
+
export declare const replaceQueuedUrlWithCard: (url: string, cardData: CardAdf, analyticsAction?: ACTION | undefined) => Command;
|
|
9
|
+
export declare const handleFallbackWithAnalytics: (request: Request) => Command;
|
|
10
|
+
export declare const queueCardsFromChangedTr: (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined) => Transaction;
|
|
11
|
+
export declare const queueCardFromChangedTr: (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, previousAppearance?: "url" | CardAppearance | undefined) => Transaction;
|
|
11
12
|
export declare const convertHyperlinkToSmartCard: (state: EditorState, source: CardReplacementInputMethod, appearance: CardAppearance, normalizeLinkText?: boolean) => Transaction;
|
|
12
13
|
export declare const changeSelectedCardToLink: (text?: string | undefined, href?: string | undefined, sendAnalytics?: boolean | undefined, node?: Node<any> | undefined, pos?: number | undefined) => Command;
|
|
13
14
|
export declare const changeSelectedCardToLinkFallback: (text?: string | undefined, href?: string | undefined, sendAnalytics?: boolean | undefined, node?: Node<any> | undefined, pos?: number | undefined) => Command;
|
|
14
|
-
export declare const updateCard: (href: string) => Command;
|
|
15
|
+
export declare const updateCard: (href: string, sourceEvent?: UIAnalyticsEvent | null | undefined) => Command;
|
|
15
16
|
export declare const changeSelectedCardToText: (text: string) => Command;
|
|
16
17
|
export declare const setSelectedCardAppearance: (appearance: CardAppearance) => Command;
|
|
@@ -2,4 +2,4 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import { PMPluginFactoryParams } from '../../../types';
|
|
3
3
|
import { CardPluginOptions, CardPluginState } from '../types';
|
|
4
4
|
export { pluginKey } from './plugin-key';
|
|
5
|
-
export declare const createPlugin: (options: CardPluginOptions) => (pmPluginFactoryParams: PMPluginFactoryParams) => SafePlugin<CardPluginState
|
|
5
|
+
export declare const createPlugin: (options: CardPluginOptions) => (pmPluginFactoryParams: PMPluginFactoryParams) => SafePlugin<CardPluginState>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CardProvider } from '@atlaskit/editor-common/provider-factory';
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
|
-
import {
|
|
3
|
+
import { Request } from '../../types';
|
|
4
4
|
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
5
|
-
export declare const resolveWithProvider: (view: EditorView,
|
|
5
|
+
export declare const resolveWithProvider: (view: EditorView, provider: CardProvider, request: Request, options: CardOptions) => Promise<void | import("@atlaskit/linking-common").InlineCardAdf | import("@atlaskit/linking-common").BlockCardAdf | import("@atlaskit/linking-common").EmbedCardAdf>;
|
|
6
6
|
export declare const handleProvider: (_: 'cardProvider', provider: Promise<CardProvider> | undefined, view: EditorView) => void;
|
|
@@ -8,8 +8,10 @@ export declare const getPluginStateWithUpdatedPos: (pluginState: CardPluginState
|
|
|
8
8
|
appearance: import("@atlaskit/editor-common/provider-factory").CardAppearance;
|
|
9
9
|
compareLinkText: boolean;
|
|
10
10
|
source: import("../../types").CardReplacementInputMethod;
|
|
11
|
+
previousAppearance?: "url" | import("@atlaskit/editor-common/provider-factory").CardAppearance | undefined;
|
|
11
12
|
analyticsAction?: import("@atlaskit/editor-common/analytics").ACTION | undefined;
|
|
12
13
|
shouldReplaceLink?: boolean | undefined;
|
|
14
|
+
sourceEvent?: import("@atlaskit/analytics-next").UIAnalyticsEvent | null | undefined;
|
|
13
15
|
}[];
|
|
14
16
|
cards: {
|
|
15
17
|
pos: number;
|
|
@@ -19,6 +21,7 @@ export declare const getPluginStateWithUpdatedPos: (pluginState: CardPluginState
|
|
|
19
21
|
provider: import("@atlaskit/editor-common/provider-factory").CardProvider | null;
|
|
20
22
|
showLinkingToolbar: boolean;
|
|
21
23
|
smartLinkEvents?: import("@atlaskit/smart-card").SmartLinkEvents | undefined;
|
|
24
|
+
smartLinkEventsNext?: import("../../types").SmartLinkEventsNext | undefined;
|
|
22
25
|
createAnalyticsEvent?: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | undefined;
|
|
23
26
|
editorAppearance?: import("@atlaskit/editor-common/types").EditorAppearance | undefined;
|
|
24
27
|
};
|
|
@@ -1,26 +1,94 @@
|
|
|
1
1
|
import { INPUT_METHOD, ACTION } from '../analytics/types/enums';
|
|
2
|
-
import { CardProvider, CardAppearance
|
|
2
|
+
import { CardProvider, CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
3
3
|
import { SmartLinkEvents } from '@atlaskit/smart-card';
|
|
4
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
+
import { CreateUIAnalyticsEvent, UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
5
|
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
6
|
+
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
6
7
|
import { LinkPickerOptions } from '../hyperlink/types';
|
|
7
|
-
import { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
8
8
|
export declare type CardInfo = {
|
|
9
9
|
title?: string;
|
|
10
10
|
url?: string;
|
|
11
11
|
pos: number;
|
|
12
12
|
};
|
|
13
13
|
export declare type Request = {
|
|
14
|
+
/**
|
|
15
|
+
* The position of the link in the doc this request for upgrade is for
|
|
16
|
+
*/
|
|
14
17
|
pos: number;
|
|
18
|
+
/**
|
|
19
|
+
* The URL of the link being upgraded/resolved
|
|
20
|
+
*/
|
|
15
21
|
url: string;
|
|
22
|
+
/**
|
|
23
|
+
* The requested appearance to upgrade to
|
|
24
|
+
*/
|
|
16
25
|
appearance: CardAppearance;
|
|
26
|
+
/**
|
|
27
|
+
* Determines if the link should only be replaced after successful
|
|
28
|
+
* resolution if the link's text content still matches its href
|
|
29
|
+
* (ie has not been changed by the user since the resolve request).
|
|
30
|
+
*/
|
|
17
31
|
compareLinkText: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Analytics input method which preserves "how" the change
|
|
34
|
+
* has occured. Used when analytics are dispatched after the link
|
|
35
|
+
* is successfully/unsuccessfully resolved.
|
|
36
|
+
*/
|
|
18
37
|
source: CardReplacementInputMethod;
|
|
38
|
+
/**
|
|
39
|
+
* The previous appearance of the link
|
|
40
|
+
* This is necessary when tracking an update of a link
|
|
41
|
+
* where the link begins as a smart card, then is updated by
|
|
42
|
+
* replacing with a hyperlink and queueing it for upgrade
|
|
43
|
+
*/
|
|
44
|
+
previousAppearance?: CardAppearance | 'url';
|
|
45
|
+
/**
|
|
46
|
+
* Analytics action to be used when disaptching
|
|
47
|
+
* analytics events once the link is successfully/unsuccessfully
|
|
48
|
+
* resolved. Preserves the users "intent" ie was this a link
|
|
49
|
+
* being inserted or updated?
|
|
50
|
+
*/
|
|
19
51
|
analyticsAction?: ACTION;
|
|
52
|
+
/**
|
|
53
|
+
* Describes if the requested `appearance` MUST be returned by the card provider
|
|
54
|
+
* when resolving the link, because the request is associated with the user intent
|
|
55
|
+
* to explicitly change the link appearance to the target appearance (view switcher), and therefore
|
|
56
|
+
* should not be affected by "default appearances" or "user preferences"
|
|
57
|
+
*/
|
|
20
58
|
shouldReplaceLink?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Source UI that triggered this step if relevant
|
|
61
|
+
* Primarily for transfering link picker UI event from initial UI action
|
|
62
|
+
* through to the end of the link queue/request saga
|
|
63
|
+
*/
|
|
64
|
+
sourceEvent?: UIAnalyticsEvent | null | undefined;
|
|
21
65
|
};
|
|
22
|
-
|
|
23
|
-
|
|
66
|
+
declare type Metadata<T = {}> = {
|
|
67
|
+
url: string;
|
|
68
|
+
display: string;
|
|
69
|
+
isUndo?: boolean;
|
|
70
|
+
isRedo?: boolean;
|
|
71
|
+
action?: string;
|
|
72
|
+
inputMethod?: string;
|
|
73
|
+
sourceEvent?: unknown;
|
|
74
|
+
} & T;
|
|
75
|
+
declare type UpdateMetadata = {
|
|
76
|
+
previousDisplay?: string;
|
|
77
|
+
};
|
|
78
|
+
export declare type SmartLinkEventsNext = {
|
|
79
|
+
created: (metadata: Metadata) => void;
|
|
80
|
+
updated: (metadata: Metadata<UpdateMetadata>) => void;
|
|
81
|
+
deleted: (metadata: Metadata) => void;
|
|
82
|
+
};
|
|
83
|
+
export declare type LifecycleEventType = keyof SmartLinkEventsNext;
|
|
84
|
+
/**
|
|
85
|
+
* Describes the shape of an event that will be stored
|
|
86
|
+
* in the Card state until it can be dispatched
|
|
87
|
+
* as a side-effect in a view update
|
|
88
|
+
*/
|
|
89
|
+
export declare type LifecycleEvent<Type extends keyof SmartLinkEventsNext = keyof SmartLinkEventsNext> = {
|
|
90
|
+
type: Type;
|
|
91
|
+
data: Parameters<SmartLinkEventsNext[Type]>[0];
|
|
24
92
|
};
|
|
25
93
|
export declare type CardPluginState = {
|
|
26
94
|
requests: Request[];
|
|
@@ -28,6 +96,7 @@ export declare type CardPluginState = {
|
|
|
28
96
|
cards: CardInfo[];
|
|
29
97
|
showLinkingToolbar: boolean;
|
|
30
98
|
smartLinkEvents?: SmartLinkEvents;
|
|
99
|
+
smartLinkEventsNext?: SmartLinkEventsNext;
|
|
31
100
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
32
101
|
editorAppearance?: EditorAppearance;
|
|
33
102
|
};
|
|
@@ -64,5 +133,10 @@ export declare type RegisterSmartCardEvents = {
|
|
|
64
133
|
type: 'REGISTER_EVENTS';
|
|
65
134
|
smartLinkEvents: SmartLinkEvents;
|
|
66
135
|
};
|
|
67
|
-
export declare type
|
|
68
|
-
|
|
136
|
+
export declare type RegisterSmartCardEventsNext = {
|
|
137
|
+
type: 'REGISTER_EVENTS_NEXT';
|
|
138
|
+
smartLinkEvents: SmartLinkEventsNext;
|
|
139
|
+
};
|
|
140
|
+
export declare type CardPluginAction = SetProvider | Queue | Resolve | Register | ShowLinkToolbar | HideLinkToolbar | RegisterSmartCardEvents | RegisterSmartCardEventsNext;
|
|
141
|
+
export declare type CardReplacementInputMethod = INPUT_METHOD.CLIPBOARD | INPUT_METHOD.AUTO_DETECT | INPUT_METHOD.FORMATTING | INPUT_METHOD.MANUAL | INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.FLOATING_TB;
|
|
142
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { Node } from 'prosemirror-model';
|
|
4
4
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
6
|
import { LinkPickerOptions } from '../../hyperlink/types';
|
|
6
7
|
import { Command } from '../../../types';
|
|
7
8
|
import { FloatingToolbarItem, FloatingToolbarConfig } from '../../floating-toolbar/types';
|
|
@@ -12,7 +13,7 @@ export declare type EditLinkToolbarProps = {
|
|
|
12
13
|
url: string | undefined;
|
|
13
14
|
text: string;
|
|
14
15
|
node: Node;
|
|
15
|
-
onSubmit?: (href: string, text?: string) => void;
|
|
16
|
+
onSubmit?: (href: string, text?: string, analytic?: UIAnalyticsEvent | null | undefined) => void;
|
|
16
17
|
linkPickerOptions?: LinkPickerOptions;
|
|
17
18
|
featureFlags: FeatureFlags;
|
|
18
19
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { EditorView } from 'prosemirror-view';
|
|
4
|
+
declare type AnalyticsBindingsProps = {
|
|
5
|
+
editorView: EditorView;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Binds the @atlaskit/link-analytics callbacks
|
|
9
|
+
* to the editor card plugin state events callbacks interfaces
|
|
10
|
+
*/
|
|
11
|
+
export declare const EventsBinding: ({ editorView }: AnalyticsBindingsProps) => null;
|
|
12
|
+
export declare class EditorSmartCardEventsNext extends React.PureComponent<AnalyticsBindingsProps> {
|
|
13
|
+
static contextTypes: {
|
|
14
|
+
contextAdapter: PropTypes.Requireable<object>;
|
|
15
|
+
};
|
|
16
|
+
render(): JSX.Element | null;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -4,7 +4,7 @@ import { CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
|
4
4
|
import { CardInfo } from './types';
|
|
5
5
|
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
6
6
|
export declare const appearanceForNodeType: (spec: NodeType) => CardAppearance | undefined;
|
|
7
|
-
export declare const selectedCardAppearance: (state: EditorState) =>
|
|
7
|
+
export declare const selectedCardAppearance: (state: EditorState) => CardAppearance | undefined;
|
|
8
8
|
export declare type TitleUrlPair = {
|
|
9
9
|
title?: string;
|
|
10
10
|
url?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { EditorState } from 'prosemirror-state';
|
|
3
|
+
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
4
|
import type { EditorView } from 'prosemirror-view';
|
|
4
5
|
import type { ContentNodeWithPos } from 'prosemirror-utils';
|
|
5
|
-
export declare const getContextPanel: (allowAutoSave?: boolean | undefined) => (state: EditorState) => JSX.Element | undefined;
|
|
6
|
+
export declare const getContextPanel: (allowAutoSave?: boolean | undefined, featureFlags?: FeatureFlags | undefined) => (state: EditorState) => JSX.Element | undefined;
|
|
6
7
|
export declare function onChangeAction(editorView: EditorView, updatedParameters: object | undefined, oldParameters: object | undefined, nodeWithPos: ContentNodeWithPos, onSaving?: () => void): Promise<void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
2
|
+
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
2
3
|
import { NextEditorPlugin, EditorAppearance } from '../../types';
|
|
3
4
|
import { LongPressSelectionPluginOptions } from '../selection/types';
|
|
4
5
|
interface ExtensionPluginOptions extends LongPressSelectionPluginOptions {
|
|
@@ -9,5 +10,6 @@ interface ExtensionPluginOptions extends LongPressSelectionPluginOptions {
|
|
|
9
10
|
}
|
|
10
11
|
declare const extensionPlugin: NextEditorPlugin<'extension', {
|
|
11
12
|
pluginConfiguration: ExtensionPluginOptions | undefined;
|
|
13
|
+
dependencies: [typeof featureFlagsPlugin];
|
|
12
14
|
}>;
|
|
13
15
|
export default extensionPlugin;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
1
2
|
import { Command } from '../../types';
|
|
2
3
|
import { Predicate } from '../../utils/commands';
|
|
3
4
|
import { INPUT_METHOD } from '../analytics';
|
|
@@ -6,8 +7,8 @@ export declare function isTextAtPos(pos: number): Predicate;
|
|
|
6
7
|
export declare function isLinkAtPos(pos: number): Predicate;
|
|
7
8
|
export declare function setLinkHref(href: string, pos: number, to?: number, isTabPressed?: boolean): Command;
|
|
8
9
|
export declare function updateLink(href: string, text: string, pos: number, to?: number): Command;
|
|
9
|
-
export declare function insertLink(from: number, to: number, incomingHref: string, incomingTitle?: string, displayText?: string, source?: LinkInputType): Command;
|
|
10
|
-
export declare const insertLinkWithAnalytics: (inputMethod: LinkInputType, from: number, to: number, href: string, title?: string | undefined, displayText?: string | undefined, cardsAvailable?: boolean) => Command;
|
|
10
|
+
export declare function insertLink(from: number, to: number, incomingHref: string, incomingTitle?: string, displayText?: string, source?: LinkInputType, sourceEvent?: UIAnalyticsEvent | null | undefined): Command;
|
|
11
|
+
export declare const insertLinkWithAnalytics: (inputMethod: LinkInputType, from: number, to: number, href: string, title?: string | undefined, displayText?: string | undefined, cardsAvailable?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined) => Command;
|
|
11
12
|
export declare const insertLinkWithAnalyticsMobileNative: (inputMethod: LinkInputType, from: number, to: number, href: string, title?: string | undefined, displayText?: string | undefined) => Command;
|
|
12
13
|
export declare function removeLink(pos: number): Command;
|
|
13
14
|
export declare function editInsertedLink(): Command;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
5
|
import { LinkInputType, LinkPickerOptions } from '../../types';
|
|
5
6
|
import { EditorLinkPickerProps } from '../EditorLinkPicker';
|
|
6
7
|
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
8
|
export interface Props extends Pick<EditorLinkPickerProps, 'onCancel' | 'invokeMethod'> {
|
|
8
9
|
view: EditorView;
|
|
9
10
|
providerFactory: ProviderFactory;
|
|
10
|
-
onSubmit: (href: string, title: string | undefined, displayText: string | undefined, inputMethod: LinkInputType) => void;
|
|
11
|
+
onSubmit: (href: string, title: string | undefined, displayText: string | undefined, inputMethod: LinkInputType, analytic?: UIAnalyticsEvent | null | undefined) => void;
|
|
11
12
|
featureFlags: FeatureFlags;
|
|
12
13
|
linkPickerOptions?: LinkPickerOptions;
|
|
13
14
|
displayText?: string;
|
|
@@ -52,7 +52,6 @@ export { default as customAutoformatPlugin } from './custom-autoformat';
|
|
|
52
52
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
53
53
|
export { default as historyPlugin } from './history';
|
|
54
54
|
export { default as captionPlugin } from './caption';
|
|
55
|
-
export { default as featureFlagsContextPlugin } from './feature-flags-context';
|
|
56
55
|
export { default as expandPlugin, isExpandInsertionEnabled } from './expand';
|
|
57
56
|
export { default as scrollIntoViewPlugin } from './scroll-into-view';
|
|
58
57
|
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { InsertNodeAPI } from '../../insert-api/types';
|
|
3
|
+
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
3
4
|
export interface InsertBlockOptions {
|
|
4
5
|
allowTables?: boolean;
|
|
5
6
|
allowExpand?: boolean;
|
|
@@ -12,5 +13,6 @@ export interface InsertBlockOptions {
|
|
|
12
13
|
}
|
|
13
14
|
declare const insertBlockPlugin: NextEditorPlugin<'insertBlock', {
|
|
14
15
|
pluginConfiguration: InsertBlockOptions | undefined;
|
|
16
|
+
dependencies: [typeof featureFlagsPlugin];
|
|
15
17
|
}>;
|
|
16
18
|
export default insertBlockPlugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { INPUT_METHOD } from '../../../analytics/types';
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
|
-
import { EditorActionsOptions as EditorActions } from '@atlaskit/editor-common/types';
|
|
3
|
+
import { EditorActionsOptions as EditorActions, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
4
|
import { Command } from '../../../../types/command';
|
|
5
5
|
import { EmojiProvider } from '@atlaskit/emoji';
|
|
6
6
|
import { BlockType } from '../../../block-type/types';
|
|
@@ -50,6 +50,7 @@ export interface Props {
|
|
|
50
50
|
onInsertMacroFromMacroBrowser?: (macroProvider: MacroProvider, node?: PMNode, isEditing?: boolean) => (view: EditorView) => void;
|
|
51
51
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
52
52
|
insertNodeAPI?: InsertNodeAPI | undefined | null;
|
|
53
|
+
featureFlags: FeatureFlags;
|
|
53
54
|
}
|
|
54
55
|
export interface State {
|
|
55
56
|
isPlusMenuOpen: boolean;
|
|
@@ -2,9 +2,11 @@ import { MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
|
2
2
|
import { NextEditorPlugin } from '../../types';
|
|
3
3
|
import { MediaState } from './pm-plugins/main';
|
|
4
4
|
import { CustomMediaPicker, MediaOptions } from './types';
|
|
5
|
+
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
5
6
|
export type { MediaState, MediaProvider, CustomMediaPicker };
|
|
6
7
|
export { insertMediaSingleNode } from './utils/media-single';
|
|
7
8
|
declare const mediaPlugin: NextEditorPlugin<'media', {
|
|
8
9
|
pluginConfiguration: MediaOptions | undefined;
|
|
10
|
+
dependencies: [typeof featureFlagsPlugin];
|
|
9
11
|
}>;
|
|
10
12
|
export default mediaPlugin;
|
|
@@ -29,6 +29,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
29
29
|
mediaNodes: MediaNodeWithPosHandler[];
|
|
30
30
|
options: MediaPluginOptions;
|
|
31
31
|
mediaProvider?: MediaProvider;
|
|
32
|
+
newInsertionBehaviour?: boolean;
|
|
32
33
|
private view;
|
|
33
34
|
private destroyed;
|
|
34
35
|
private contextIdentifierProvider?;
|
|
@@ -45,7 +46,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
45
46
|
showEditingDialog?: boolean;
|
|
46
47
|
mediaOptions?: MediaOptions;
|
|
47
48
|
dispatch?: Dispatch;
|
|
48
|
-
constructor(state: EditorState, options: MediaPluginOptions, mediaOptions?: MediaOptions, dispatch?: Dispatch);
|
|
49
|
+
constructor(state: EditorState, options: MediaPluginOptions, mediaOptions?: MediaOptions, newInsertionBehaviour?: boolean, dispatch?: Dispatch);
|
|
49
50
|
onContextIdentifierProvider: (_name: string, provider?: Promise<ContextIdentifierProvider> | undefined) => Promise<void>;
|
|
50
51
|
setMediaProvider: (mediaProvider?: Promise<MediaProvider> | undefined) => Promise<void>;
|
|
51
52
|
getMediaOptions: () => MediaPluginOptions;
|
|
@@ -104,4 +105,4 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
104
105
|
updateAndDispatch(props: Partial<Pick<this, 'allowsUploads' | 'allUploadsFinished' | 'isFullscreen'>>): void;
|
|
105
106
|
}
|
|
106
107
|
export declare const getMediaPluginState: (state: EditorState) => MediaPluginState;
|
|
107
|
-
export declare const createPlugin: (_schema: Schema, options: MediaPluginOptions, reactContext: () => {}, getIntl: () => IntlShape, dispatch?: Dispatch<any> | undefined, mediaOptions?: MediaOptions | undefined) => SafePlugin<any, any>;
|
|
108
|
+
export declare const createPlugin: (_schema: Schema, options: MediaPluginOptions, reactContext: () => {}, getIntl: () => IntlShape, dispatch?: Dispatch<any> | undefined, mediaOptions?: MediaOptions | undefined, newInsertionBehaviour?: boolean | undefined) => SafePlugin<any, any>;
|
|
@@ -15,7 +15,7 @@ export interface MediaSingleState extends MediaState {
|
|
|
15
15
|
}
|
|
16
16
|
export declare const isMediaSingle: (schema: Schema, fileMimeType?: string | undefined) => boolean;
|
|
17
17
|
export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia) => boolean;
|
|
18
|
-
export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia | undefined, collection?: string | undefined, alignLeftOnInsert?: boolean | undefined) => boolean;
|
|
18
|
+
export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia | undefined, collection?: string | undefined, alignLeftOnInsert?: boolean | undefined, newInsertionBehaviour?: boolean | undefined) => boolean;
|
|
19
19
|
export declare const createMediaSingleNode: (schema: Schema, collection: string, alignLeftOnInsert?: boolean | undefined) => (mediaState: MediaSingleState) => PMNode<Schema<any, any>>;
|
|
20
20
|
export declare function transformSliceForMedia(slice: Slice, schema: Schema): (selection: Selection) => Slice<any>;
|
|
21
21
|
export declare const calcMediaPxWidth: (opts: {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
3
|
+
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
3
4
|
export declare type PastePluginOptions = {
|
|
4
5
|
cardOptions?: CardOptions;
|
|
5
6
|
sanitizePrivateContent?: boolean;
|
|
6
7
|
};
|
|
7
8
|
declare const pastePlugin: NextEditorPlugin<'paste', {
|
|
8
9
|
pluginConfiguration: PastePluginOptions;
|
|
10
|
+
dependencies: [typeof featureFlagsPlugin];
|
|
9
11
|
}>;
|
|
10
12
|
export default pastePlugin;
|
|
@@ -6,4 +6,5 @@ import { DispatchAnalyticsEvent } from '../../analytics';
|
|
|
6
6
|
export { pluginKey as stateKey } from './plugin-factory';
|
|
7
7
|
export { md } from '../md';
|
|
8
8
|
import type { Dispatch } from '../../../event-dispatcher';
|
|
9
|
-
|
|
9
|
+
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
10
|
+
export declare function createPlugin(schema: Schema, dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, featureFlags: FeatureFlags, cardOptions?: CardOptions, sanitizePrivateContent?: boolean, providerFactory?: ProviderFactory): SafePlugin<import("../types").PastePluginState, Schema<any, any>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
1
2
|
import { Command } from '../../types';
|
|
2
3
|
import { INPUT_METHOD } from '../analytics';
|
|
3
|
-
export declare const insertHorizontalRule: (inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.FORMATTING | INPUT_METHOD.SHORTCUT) => Command;
|
|
4
|
+
export declare const insertHorizontalRule: (inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.FORMATTING | INPUT_METHOD.SHORTCUT, featureFlags: FeatureFlags) => Command;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
|
|
2
|
+
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
3
|
+
declare const rulePlugin: NextEditorPlugin<'rule', {
|
|
4
|
+
pluginConfiguration: undefined;
|
|
5
|
+
dependencies: [typeof featureFlagsPlugin];
|
|
6
|
+
}>;
|
|
3
7
|
export default rulePlugin;
|
|
@@ -3,6 +3,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
3
3
|
import { EditorState, Transaction } from 'prosemirror-state';
|
|
4
4
|
import { FeatureFlags } from '../../../types/feature-flags';
|
|
5
5
|
import { INPUT_METHOD } from '../../analytics';
|
|
6
|
-
export declare const createHorizontalRule: (state: EditorState, start: number, end: number, inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.FORMATTING | INPUT_METHOD.SHORTCUT) => Transaction<any> | null;
|
|
6
|
+
export declare const createHorizontalRule: (state: EditorState, featureFlags: FeatureFlags, start: number, end: number, inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.FORMATTING | INPUT_METHOD.SHORTCUT) => Transaction<any> | null;
|
|
7
7
|
export declare function inputRulePlugin(schema: Schema, featureFlags: FeatureFlags): SafePlugin | undefined;
|
|
8
8
|
export default inputRulePlugin;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
|
|
2
|
+
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
|
+
export declare function keymapPlugin(featureFlags: FeatureFlags): SafePlugin;
|
|
3
4
|
export default keymapPlugin;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
2
3
|
import { TextColorPluginConfig, pluginKey as textColorPluginKey, TextColorPluginState } from './pm-plugins/main';
|
|
3
4
|
declare type Config = TextColorPluginConfig | boolean;
|
|
4
5
|
declare const textColorPlugin: NextEditorPlugin<'textColor', {
|
|
5
6
|
pluginConfiguration: Config | undefined;
|
|
7
|
+
dependencies: [typeof featureFlagsPlugin];
|
|
6
8
|
}>;
|
|
7
9
|
export { textColorPluginKey };
|
|
8
10
|
export type { TextColorPluginState };
|
|
@@ -5,6 +5,7 @@ import { EditorView } from 'prosemirror-view';
|
|
|
5
5
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
6
6
|
import { DispatchAnalyticsEvent } from '../../../analytics';
|
|
7
7
|
import { TextColorPluginState } from '../../pm-plugins/main';
|
|
8
|
+
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
8
9
|
export declare const messages: {
|
|
9
10
|
textColor: {
|
|
10
11
|
id: string;
|
|
@@ -25,6 +26,7 @@ export interface Props {
|
|
|
25
26
|
isReducedSpacing?: boolean;
|
|
26
27
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
27
28
|
disabled?: boolean;
|
|
29
|
+
featureFlags: FeatureFlags;
|
|
28
30
|
}
|
|
29
31
|
export declare class ToolbarTextColor extends React.Component<Props & WrappedComponentProps, State> {
|
|
30
32
|
state: State;
|
|
@@ -74,4 +74,14 @@ export declare const toolbarMessages: {
|
|
|
74
74
|
defaultMessage: string;
|
|
75
75
|
description: string;
|
|
76
76
|
};
|
|
77
|
+
navigateToEditorToolbar: {
|
|
78
|
+
id: string;
|
|
79
|
+
defaultMessage: string;
|
|
80
|
+
description: string;
|
|
81
|
+
};
|
|
82
|
+
navigateToFloatingToolbar: {
|
|
83
|
+
id: string;
|
|
84
|
+
defaultMessage: string;
|
|
85
|
+
description: string;
|
|
86
|
+
};
|
|
77
87
|
};
|
|
@@ -42,7 +42,7 @@ export interface EditorAppearanceComponentProps {
|
|
|
42
42
|
collabEdit?: CollabEditOptions;
|
|
43
43
|
persistScrollGutter?: boolean;
|
|
44
44
|
enableToolbarMinWidth?: boolean;
|
|
45
|
-
featureFlags
|
|
45
|
+
featureFlags: FeatureFlags;
|
|
46
46
|
useStickyToolbar?: UseStickyToolbarType;
|
|
47
47
|
innerRef?: RefObject<HTMLDivElement>;
|
|
48
48
|
}
|
|
@@ -72,6 +72,7 @@ export interface EditorBaseProps extends EditorPluginFeatureProps, EditorProvide
|
|
|
72
72
|
placeholder?: string;
|
|
73
73
|
placeholderBracketHint?: string;
|
|
74
74
|
defaultValue?: Node | string | Object;
|
|
75
|
+
assistiveLabel?: string;
|
|
75
76
|
popupsMountPoint?: HTMLElement;
|
|
76
77
|
popupsBoundariesElement?: HTMLElement;
|
|
77
78
|
popupsScrollableElement?: HTMLElement;
|