@atlaskit/editor-core 182.0.3 → 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 +40 -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/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/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/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
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { EditorAppearanceComponentProps } from '../../../types';
|
|
5
|
+
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
6
|
interface FullPageEditorState {
|
|
6
7
|
showKeyline: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare class FullPageEditor extends React.Component<EditorAppearanceComponentProps, FullPageEditorState> {
|
|
9
10
|
state: FullPageEditorState;
|
|
11
|
+
featureFlags: FeatureFlags;
|
|
10
12
|
static displayName: string;
|
|
11
13
|
private scrollContainer;
|
|
12
14
|
private contentArea;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ColorPalette, backgroundPaletteTooltipMessages, textPaletteTooltipMessages } from '@atlaskit/editor-common/ui-color';
|
|
2
|
-
export { ColorPalette, backgroundPaletteTooltipMessages, textPaletteTooltipMessages, };
|
|
1
|
+
import { ColorPalette, backgroundPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages } from '@atlaskit/editor-common/ui-color';
|
|
2
|
+
export { ColorPalette, backgroundPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages, };
|
|
3
3
|
export default ColorPalette;
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
3
|
import type { ExtensionManifest } from '@atlaskit/editor-common/extensions';
|
|
4
4
|
import { FieldDefinition, Parameters, OnSaveCallback } from '@atlaskit/editor-common/extensions';
|
|
5
|
+
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
6
|
declare type Props = {
|
|
6
7
|
extensionManifest?: ExtensionManifest;
|
|
7
8
|
fields?: FieldDefinition[];
|
|
@@ -15,6 +16,7 @@ declare type Props = {
|
|
|
15
16
|
onCancel: () => void;
|
|
16
17
|
errorMessage: string | null;
|
|
17
18
|
isLoading?: boolean;
|
|
19
|
+
featureFlags?: FeatureFlags;
|
|
18
20
|
} & WithAnalyticsEventsProps;
|
|
19
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "key" | "autoSave" | "onChange" | "autoSaveReject" | "analyticsContext" | "isLoading" | "parameters" | "fields" | "onCancel" | "errorMessage" | "extensionManifest" | "autoSaveTrigger" | "showHeader" | "closeOnEsc"> & React.RefAttributes<any>>;
|
|
21
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "key" | "autoSave" | "onChange" | "autoSaveReject" | "featureFlags" | "analyticsContext" | "isLoading" | "parameters" | "fields" | "onCancel" | "errorMessage" | "extensionManifest" | "autoSaveTrigger" | "showHeader" | "closeOnEsc"> & React.RefAttributes<any>>;
|
|
20
22
|
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ExtensionProvider, ExtensionType, ExtensionKey, Parameters } from '@atlaskit/editor-common/extensions';
|
|
3
|
+
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
4
|
export declare type PublicProps = {
|
|
4
5
|
extensionProvider: ExtensionProvider;
|
|
5
6
|
extensionType: ExtensionType;
|
|
@@ -12,7 +13,8 @@ export declare type PublicProps = {
|
|
|
12
13
|
autoSaveReject?: (reason?: any) => void;
|
|
13
14
|
closeOnEsc?: boolean;
|
|
14
15
|
showHeader?: boolean;
|
|
16
|
+
featureFlags?: FeatureFlags;
|
|
15
17
|
onChange: (data: Parameters) => void;
|
|
16
18
|
onCancel: () => void;
|
|
17
19
|
};
|
|
18
|
-
export default function FieldsLoader({ extensionType, extensionKey, nodeKey, extensionProvider, extensionParameters, parameters, autoSave, autoSaveTrigger, autoSaveReject, closeOnEsc, showHeader, onChange, onCancel, }: PublicProps): JSX.Element;
|
|
20
|
+
export default function FieldsLoader({ extensionType, extensionKey, nodeKey, extensionProvider, extensionParameters, parameters, autoSave, autoSaveTrigger, autoSaveReject, closeOnEsc, showHeader, featureFlags, onChange, onCancel, }: PublicProps): JSX.Element;
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { ColorField } from '@atlaskit/editor-common/extensions';
|
|
4
|
+
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
|
+
import { PaletteColor } from '../../../ui/ColorPalette/Palettes';
|
|
4
6
|
import { OnFieldChange } from '../types';
|
|
5
|
-
declare const
|
|
7
|
+
export declare const colorPalette: PaletteColor[];
|
|
8
|
+
/**
|
|
9
|
+
* Extended chart colors.
|
|
10
|
+
* Decided here https://product-fabric.atlassian.net/wiki/spaces/EUXQ/pages/3477245015/Tokenising+table+charts+color
|
|
11
|
+
*/
|
|
12
|
+
export declare const extendedColorPalette: PaletteColor[];
|
|
13
|
+
export declare const EXPANDED_COLOR_PICKER_COLUMNS = 9;
|
|
14
|
+
export declare const ORIGINAL_COLOR_PICKER_COLUMNS = 5;
|
|
15
|
+
declare const ColorPickerField: ({ name, field, onFieldChange, featureFlags, }: {
|
|
6
16
|
name: string;
|
|
7
17
|
field: ColorField;
|
|
8
18
|
onFieldChange: OnFieldChange;
|
|
19
|
+
featureFlags?: FeatureFlags | undefined;
|
|
9
20
|
}) => jsx.JSX.Element;
|
|
10
21
|
export default ColorPickerField;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FieldComponentProps, FormContentProps } from './types';
|
|
3
|
-
export declare function FieldComponent({ field, parameters, parentName, extensionManifest, firstVisibleFieldName, onFieldChange, }: FieldComponentProps): JSX.Element;
|
|
4
|
-
export default function FormContent({ fields, parentName, parameters, extensionManifest, canRemoveFields, onClickRemove, onFieldChange, firstVisibleFieldName, contextIdentifierProvider, }: FormContentProps): JSX.Element;
|
|
3
|
+
export declare function FieldComponent({ field, parameters, parentName, extensionManifest, firstVisibleFieldName, onFieldChange, featureFlags, }: FieldComponentProps): JSX.Element;
|
|
4
|
+
export default function FormContent({ fields, parentName, parameters, extensionManifest, canRemoveFields, onClickRemove, onFieldChange, firstVisibleFieldName, contextIdentifierProvider, featureFlags, }: FormContentProps): JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ExtensionManifest } from '@atlaskit/editor-common/extensions';
|
|
2
2
|
import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
|
|
3
3
|
import { FieldDefinition, Parameters } from '@atlaskit/editor-common/extensions';
|
|
4
|
+
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
5
|
export declare enum ValidationError {
|
|
5
6
|
Required = "required",
|
|
6
7
|
Invalid = "invalid"
|
|
@@ -20,6 +21,7 @@ export interface FieldComponentProps {
|
|
|
20
21
|
extensionManifest: ExtensionManifest;
|
|
21
22
|
firstVisibleFieldName?: string;
|
|
22
23
|
onFieldChange: OnFieldChange;
|
|
24
|
+
featureFlags?: FeatureFlags;
|
|
23
25
|
}
|
|
24
26
|
export interface FormContentProps {
|
|
25
27
|
fields: FieldDefinition[];
|
|
@@ -31,4 +33,5 @@ export interface FormContentProps {
|
|
|
31
33
|
onFieldChange: OnFieldChange;
|
|
32
34
|
firstVisibleFieldName?: string;
|
|
33
35
|
contextIdentifierProvider?: ContextIdentifierProvider;
|
|
36
|
+
featureFlags?: FeatureFlags;
|
|
34
37
|
}
|
|
@@ -10,5 +10,4 @@ export declare const getOptionFromValue: (options: Option[], value: string | str
|
|
|
10
10
|
export declare const getSafeParentedName: (name: string, parentName?: string | undefined) => string;
|
|
11
11
|
export declare const isDuplicateField: (key: string) => boolean;
|
|
12
12
|
export declare const getNameFromDuplicateField: (key: string) => string;
|
|
13
|
-
export declare const isValidHex: (color: string) => boolean;
|
|
14
13
|
export {};
|
|
@@ -3,5 +3,5 @@ import { IntlShape } from 'react-intl-next';
|
|
|
3
3
|
import { NodeType } from 'prosemirror-model';
|
|
4
4
|
import { FloatingToolbarItem } from '../../plugins/floating-toolbar/types';
|
|
5
5
|
import { Command } from '../../types';
|
|
6
|
-
declare const buildLayoutButtons: (state: EditorState, intl: IntlShape, nodeType: NodeType, allowResizing?: boolean | undefined, allowResizingInTables?: boolean | undefined) => FloatingToolbarItem<Command>[];
|
|
6
|
+
declare const buildLayoutButtons: (state: EditorState, intl: IntlShape, nodeType: NodeType, allowResizing?: boolean | undefined, allowResizingInTables?: boolean | undefined, allowWrapping?: boolean, allowAlignment?: boolean) => FloatingToolbarItem<Command>[];
|
|
7
7
|
export default buildLayoutButtons;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "182.0
|
|
3
|
+
"version": "182.1.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@atlaskit/activity-provider": "^2.3.0",
|
|
29
|
-
"@atlaskit/adf-schema": "^25.
|
|
29
|
+
"@atlaskit/adf-schema": "^25.5.0",
|
|
30
30
|
"@atlaskit/adf-utils": "^18.1.0",
|
|
31
31
|
"@atlaskit/analytics-gas-types": "^5.0.0",
|
|
32
32
|
"@atlaskit/analytics-listeners": "^8.6.0",
|
|
@@ -41,24 +41,25 @@
|
|
|
41
41
|
"@atlaskit/code": "^14.5.0",
|
|
42
42
|
"@atlaskit/date": "^0.9.0",
|
|
43
43
|
"@atlaskit/datetime-picker": "^12.3.0",
|
|
44
|
-
"@atlaskit/editor-common": "^72.
|
|
44
|
+
"@atlaskit/editor-common": "^72.8.0",
|
|
45
45
|
"@atlaskit/editor-json-transformer": "^8.8.0",
|
|
46
46
|
"@atlaskit/editor-markdown-transformer": "^5.0.0",
|
|
47
|
-
"@atlaskit/editor-palette": "1.
|
|
48
|
-
"@atlaskit/editor-plugin-feature-flags": "^0.0.
|
|
47
|
+
"@atlaskit/editor-palette": "1.3.0",
|
|
48
|
+
"@atlaskit/editor-plugin-feature-flags": "^0.0.3",
|
|
49
49
|
"@atlaskit/editor-plugin-table": "^1.2.0",
|
|
50
50
|
"@atlaskit/editor-shared-styles": "^2.3.0",
|
|
51
51
|
"@atlaskit/editor-tables": "^2.2.0",
|
|
52
52
|
"@atlaskit/emoji": "^67.3.0",
|
|
53
53
|
"@atlaskit/empty-state": "^7.4.0",
|
|
54
|
-
"@atlaskit/form": "^8.
|
|
54
|
+
"@atlaskit/form": "^8.9.0",
|
|
55
55
|
"@atlaskit/icon": "^21.11.0",
|
|
56
56
|
"@atlaskit/icon-object": "^6.2.0",
|
|
57
|
+
"@atlaskit/link-analytics": "^7.0.0",
|
|
57
58
|
"@atlaskit/link-picker": "^1.18.0",
|
|
58
59
|
"@atlaskit/locale": "^2.3.0",
|
|
59
60
|
"@atlaskit/logo": "^13.12.0",
|
|
60
61
|
"@atlaskit/media-card": "^74.7.0",
|
|
61
|
-
"@atlaskit/media-client": "^
|
|
62
|
+
"@atlaskit/media-client": "^21.0.0",
|
|
62
63
|
"@atlaskit/media-common": "^4.0.0",
|
|
63
64
|
"@atlaskit/media-filmstrip": "^46.1.0",
|
|
64
65
|
"@atlaskit/media-picker": "^64.3.0",
|
|
@@ -72,7 +73,7 @@
|
|
|
72
73
|
"@atlaskit/radio": "^5.4.0",
|
|
73
74
|
"@atlaskit/section-message": "^6.3.0",
|
|
74
75
|
"@atlaskit/select": "^16.1.0",
|
|
75
|
-
"@atlaskit/smart-card": "^25.
|
|
76
|
+
"@atlaskit/smart-card": "^25.4.0",
|
|
76
77
|
"@atlaskit/smart-user-picker": "^6.0.0",
|
|
77
78
|
"@atlaskit/spinner": "^15.4.0",
|
|
78
79
|
"@atlaskit/status": "^1.2.0",
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
"@atlaskit/task-decision": "^17.5.0",
|
|
81
82
|
"@atlaskit/textarea": "^4.5.0",
|
|
82
83
|
"@atlaskit/textfield": "^5.3.0",
|
|
83
|
-
"@atlaskit/theme": "^12.
|
|
84
|
+
"@atlaskit/theme": "^12.4.0",
|
|
84
85
|
"@atlaskit/toggle": "^12.5.0",
|
|
85
86
|
"@atlaskit/tokens": "^1.2.0",
|
|
86
87
|
"@atlaskit/tooltip": "^17.7.0",
|
|
@@ -125,7 +126,7 @@
|
|
|
125
126
|
"w3c-keyname": "^2.1.0"
|
|
126
127
|
},
|
|
127
128
|
"peerDependencies": {
|
|
128
|
-
"@atlaskit/link-provider": "^1.5.
|
|
129
|
+
"@atlaskit/link-provider": "^1.5.3",
|
|
129
130
|
"@atlaskit/media-core": "^34.0.2",
|
|
130
131
|
"react": "^16.8.0",
|
|
131
132
|
"react-dom": "^16.8.0",
|
|
@@ -135,7 +136,7 @@
|
|
|
135
136
|
"@atlaskit/atlassian-navigation": "^2.4.0",
|
|
136
137
|
"@atlaskit/breadcrumbs": "11.8.0",
|
|
137
138
|
"@atlaskit/code": "^14.5.0",
|
|
138
|
-
"@atlaskit/collab-provider": "8.
|
|
139
|
+
"@atlaskit/collab-provider": "8.6.0",
|
|
139
140
|
"@atlaskit/docs": "*",
|
|
140
141
|
"@atlaskit/drawer": "^7.4.0",
|
|
141
142
|
"@atlaskit/dropdown-menu": "^11.7.0",
|
|
@@ -151,7 +152,7 @@
|
|
|
151
152
|
"@atlaskit/lozenge": "^11.3.0",
|
|
152
153
|
"@atlaskit/media-core": "^34.0.0",
|
|
153
154
|
"@atlaskit/media-integration-test-helpers": "^2.6.0",
|
|
154
|
-
"@atlaskit/media-test-helpers": "^
|
|
155
|
+
"@atlaskit/media-test-helpers": "^32.0.0",
|
|
155
156
|
"@atlaskit/menu": "^1.5.0",
|
|
156
157
|
"@atlaskit/page-layout": "^1.3.0",
|
|
157
158
|
"@atlaskit/profilecard": "^19.2.0",
|
|
@@ -170,7 +171,7 @@
|
|
|
170
171
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
171
172
|
"@atlassian/link-picker-atlassian-plugin": "^28.0.0",
|
|
172
173
|
"@atlassian/link-picker-plugins": "^18.1.0",
|
|
173
|
-
"@atlassian/search-provider": "2.3.
|
|
174
|
+
"@atlassian/search-provider": "2.3.14",
|
|
174
175
|
"@atlassian/ufo": "^0.1.0",
|
|
175
176
|
"@emotion/jest": "^11.8.0",
|
|
176
177
|
"@storybook/addon-knobs": "^5.3.18",
|
package/report.api.md
CHANGED
|
@@ -66,6 +66,7 @@ import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
|
66
66
|
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
67
67
|
import { ExtensionType } from '@atlaskit/editor-common/provider-factory';
|
|
68
68
|
import { FC } from 'react';
|
|
69
|
+
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
69
70
|
import { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
|
|
70
71
|
import { FloatingToolbarButton } from '@atlaskit/editor-common/types';
|
|
71
72
|
import { FloatingToolbarColorPicker } from '@atlaskit/editor-common/types';
|
|
@@ -144,6 +145,7 @@ import type { TypeAheadHandler } from '@atlaskit/editor-common/types';
|
|
|
144
145
|
import type { TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
145
146
|
import type { TypeAheadItem as TypeAheadItem_2 } from '@atlaskit/editor-common/provider-factory';
|
|
146
147
|
import type { TypeAheadStats } from '@atlaskit/editor-common/types';
|
|
148
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
147
149
|
import { UIComponentFactory } from '@atlaskit/editor-common/types';
|
|
148
150
|
import { UploadEndEventPayload } from '@atlaskit/media-picker/types';
|
|
149
151
|
import { UploadErrorEventPayload } from '@atlaskit/media-picker/types';
|
|
@@ -725,6 +727,7 @@ export class EditorActions<T = any> implements EditorActionsOptions<T> {
|
|
|
725
727
|
editorView: EditorView,
|
|
726
728
|
eventDispatcher: EventDispatcher,
|
|
727
729
|
contentTransformer?: Transformer_2<T>,
|
|
730
|
+
getFeatureFlags?: () => EditorFeatureFlags,
|
|
728
731
|
): void;
|
|
729
732
|
// (undocumented)
|
|
730
733
|
_privateSubscribe(cb: ContextUpdateHandler): void;
|
|
@@ -752,6 +755,8 @@ interface EditorBaseProps
|
|
|
752
755
|
// (undocumented)
|
|
753
756
|
appearance?: EditorAppearance;
|
|
754
757
|
// (undocumented)
|
|
758
|
+
assistiveLabel?: string;
|
|
759
|
+
// (undocumented)
|
|
755
760
|
codeBlock?: CodeBlockOptions;
|
|
756
761
|
// (undocumented)
|
|
757
762
|
contentComponents?: ReactComponents;
|
|
@@ -1435,6 +1440,7 @@ export const insertHorizontalRule: (
|
|
|
1435
1440
|
| INPUT_METHOD.QUICK_INSERT
|
|
1436
1441
|
| INPUT_METHOD.SHORTCUT
|
|
1437
1442
|
| INPUT_METHOD.TOOLBAR,
|
|
1443
|
+
featureFlags: EditorFeatureFlags,
|
|
1438
1444
|
) => Command;
|
|
1439
1445
|
|
|
1440
1446
|
// @public (undocumented)
|
|
@@ -1452,6 +1458,7 @@ export function insertLink(
|
|
|
1452
1458
|
incomingTitle?: string,
|
|
1453
1459
|
displayText?: string,
|
|
1454
1460
|
source?: LinkInputMethod,
|
|
1461
|
+
sourceEvent?: UIAnalyticsEvent | null | undefined,
|
|
1455
1462
|
): Command;
|
|
1456
1463
|
|
|
1457
1464
|
// @public (undocumented)
|
|
@@ -1463,6 +1470,7 @@ export const insertLinkWithAnalytics: (
|
|
|
1463
1470
|
title?: string | undefined,
|
|
1464
1471
|
displayText?: string | undefined,
|
|
1465
1472
|
cardsAvailable?: boolean,
|
|
1473
|
+
sourceEvent?: UIAnalyticsEvent | null | undefined,
|
|
1466
1474
|
) => Command;
|
|
1467
1475
|
|
|
1468
1476
|
// @public (undocumented)
|
|
@@ -1482,6 +1490,7 @@ export const insertMediaSingleNode: (
|
|
|
1482
1490
|
inputMethod?: InputMethodInsertMedia | undefined,
|
|
1483
1491
|
collection?: string | undefined,
|
|
1484
1492
|
alignLeftOnInsert?: boolean | undefined,
|
|
1493
|
+
newInsertionBehaviour?: boolean | undefined,
|
|
1485
1494
|
) => boolean;
|
|
1486
1495
|
|
|
1487
1496
|
// @public (undocumented)
|
|
@@ -1679,6 +1688,7 @@ export const mediaPlugin: NextEditorPlugin<
|
|
|
1679
1688
|
'media',
|
|
1680
1689
|
{
|
|
1681
1690
|
pluginConfiguration: MediaOptions | undefined;
|
|
1691
|
+
dependencies: [typeof featureFlagsPlugin];
|
|
1682
1692
|
}
|
|
1683
1693
|
>;
|
|
1684
1694
|
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "getEnabledFeatureFlagKeys", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _normalizeFeatureFlags.getEnabledFeatureFlagKeys;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _normalizeFeatureFlags = require("@atlaskit/editor-common/normalize-feature-flags");
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getFeatureFlags = void 0;
|
|
7
|
-
var _pluginKey = require("./plugin-key");
|
|
8
|
-
var getFeatureFlags = function getFeatureFlags(state) {
|
|
9
|
-
return _pluginKey.pluginKey.getState(state);
|
|
10
|
-
};
|
|
11
|
-
exports.getFeatureFlags = getFeatureFlags;
|
|
@@ -1,50 +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.useFeatureFlags = exports.getFeatureFlags = exports.default = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
10
|
-
var _EditorContext = require("../../ui/EditorContext");
|
|
11
|
-
var _pluginKey = require("./plugin-key");
|
|
12
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14
|
-
var featureFlagsContextPlugin = function featureFlagsContextPlugin() {
|
|
15
|
-
var featureFlags = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
16
|
-
return {
|
|
17
|
-
name: 'featureFlagsContext',
|
|
18
|
-
pmPlugins: function pmPlugins() {
|
|
19
|
-
return [{
|
|
20
|
-
name: 'featureFlagsContext',
|
|
21
|
-
plugin: function plugin() {
|
|
22
|
-
return new _safePlugin.SafePlugin({
|
|
23
|
-
key: _pluginKey.pluginKey,
|
|
24
|
-
state: {
|
|
25
|
-
init: function init() {
|
|
26
|
-
return _objectSpread({}, featureFlags);
|
|
27
|
-
},
|
|
28
|
-
apply: function apply(_, pluginState) {
|
|
29
|
-
return pluginState;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}];
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
var getFeatureFlags = function getFeatureFlags(state) {
|
|
39
|
-
return _pluginKey.pluginKey.getState(state);
|
|
40
|
-
};
|
|
41
|
-
exports.getFeatureFlags = getFeatureFlags;
|
|
42
|
-
var useFeatureFlags = function useFeatureFlags() {
|
|
43
|
-
var _useEditorContext = (0, _EditorContext.useEditorContext)(),
|
|
44
|
-
editorActions = _useEditorContext.editorActions;
|
|
45
|
-
var editorView = editorActions === null || editorActions === void 0 ? void 0 : editorActions._privateGetEditorView();
|
|
46
|
-
return editorView !== null && editorView !== void 0 && editorView.state ? _pluginKey.pluginKey.getState(editorView.state) : undefined;
|
|
47
|
-
};
|
|
48
|
-
exports.useFeatureFlags = useFeatureFlags;
|
|
49
|
-
var _default = featureFlagsContextPlugin;
|
|
50
|
-
exports.default = _default;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.pluginKey = void 0;
|
|
7
|
-
var _prosemirrorState = require("prosemirror-state");
|
|
8
|
-
var pluginKey = new _prosemirrorState.PluginKey('featureFlagsContextPlugin');
|
|
9
|
-
exports.pluginKey = pluginKey;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getEnabledFeatureFlagKeys } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { useEditorContext } from '../../ui/EditorContext';
|
|
3
|
-
import { pluginKey } from './plugin-key';
|
|
4
|
-
const featureFlagsContextPlugin = (featureFlags = {}) => ({
|
|
5
|
-
name: 'featureFlagsContext',
|
|
6
|
-
pmPlugins() {
|
|
7
|
-
return [{
|
|
8
|
-
name: 'featureFlagsContext',
|
|
9
|
-
plugin: () => new SafePlugin({
|
|
10
|
-
key: pluginKey,
|
|
11
|
-
state: {
|
|
12
|
-
init: () => ({
|
|
13
|
-
...featureFlags
|
|
14
|
-
}),
|
|
15
|
-
apply: (_, pluginState) => pluginState
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
}];
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
export const getFeatureFlags = state => pluginKey.getState(state);
|
|
22
|
-
export const useFeatureFlags = () => {
|
|
23
|
-
const {
|
|
24
|
-
editorActions
|
|
25
|
-
} = useEditorContext();
|
|
26
|
-
const editorView = editorActions === null || editorActions === void 0 ? void 0 : editorActions._privateGetEditorView();
|
|
27
|
-
return editorView !== null && editorView !== void 0 && editorView.state ? pluginKey.getState(editorView.state) : undefined;
|
|
28
|
-
};
|
|
29
|
-
export default featureFlagsContextPlugin;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getEnabledFeatureFlagKeys } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
|
-
import { useEditorContext } from '../../ui/EditorContext';
|
|
6
|
-
import { pluginKey } from './plugin-key';
|
|
7
|
-
var featureFlagsContextPlugin = function featureFlagsContextPlugin() {
|
|
8
|
-
var featureFlags = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9
|
-
return {
|
|
10
|
-
name: 'featureFlagsContext',
|
|
11
|
-
pmPlugins: function pmPlugins() {
|
|
12
|
-
return [{
|
|
13
|
-
name: 'featureFlagsContext',
|
|
14
|
-
plugin: function plugin() {
|
|
15
|
-
return new SafePlugin({
|
|
16
|
-
key: pluginKey,
|
|
17
|
-
state: {
|
|
18
|
-
init: function init() {
|
|
19
|
-
return _objectSpread({}, featureFlags);
|
|
20
|
-
},
|
|
21
|
-
apply: function apply(_, pluginState) {
|
|
22
|
-
return pluginState;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}];
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
export var getFeatureFlags = function getFeatureFlags(state) {
|
|
32
|
-
return pluginKey.getState(state);
|
|
33
|
-
};
|
|
34
|
-
export var useFeatureFlags = function useFeatureFlags() {
|
|
35
|
-
var _useEditorContext = useEditorContext(),
|
|
36
|
-
editorActions = _useEditorContext.editorActions;
|
|
37
|
-
var editorView = editorActions === null || editorActions === void 0 ? void 0 : editorActions._privateGetEditorView();
|
|
38
|
-
return editorView !== null && editorView !== void 0 && editorView.state ? pluginKey.getState(editorView.state) : undefined;
|
|
39
|
-
};
|
|
40
|
-
export default featureFlagsContextPlugin;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getEnabledFeatureFlagKeys } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { EditorState } from 'prosemirror-state';
|
|
2
|
-
import { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { FeatureFlags } from '../../types/feature-flags';
|
|
4
|
-
declare const featureFlagsContextPlugin: NextEditorPlugin<'featureFlagsContext', {
|
|
5
|
-
pluginConfiguration: FeatureFlags;
|
|
6
|
-
}>;
|
|
7
|
-
export declare const getFeatureFlags: (state: EditorState) => FeatureFlags;
|
|
8
|
-
export declare const useFeatureFlags: () => FeatureFlags | undefined;
|
|
9
|
-
export default featureFlagsContextPlugin;
|