@atlaskit/editor-common 73.0.0 → 74.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/analytics/package.json +2 -2
- package/card/package.json +2 -2
- package/collab/package.json +2 -2
- package/core-utils/package.json +2 -2
- package/dist/cjs/provider-helpers/combine-providers.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/provider-helpers/combine-providers.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/provider-helpers/combine-providers.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/__tests_external__/cases/fundamentals/test-cases/editor-is-present.d.ts +1 -1
- package/dist/types/__tests_external__/cases/fundamentals/test-cases/editor-typing.d.ts +1 -1
- package/dist/types/__tests_external__/page-objects/Editor.d.ts +2 -0
- package/dist/types/__tests_external__/page-objects/EditorSmartLink.d.ts +2 -0
- package/dist/types/__tests_external__/page-objects/Renderer.d.ts +2 -0
- package/dist/types/analytics/api.d.ts +1 -1
- package/dist/types/analytics/types/avatar.d.ts +2 -2
- package/dist/types/analytics/types/block.d.ts +3 -3
- package/dist/types/analytics/types/config-panel-events.d.ts +4 -4
- package/dist/types/analytics/types/cut-copy-events.d.ts +3 -3
- package/dist/types/analytics/types/date-events.d.ts +6 -6
- package/dist/types/analytics/types/dispatch-analytics-event.d.ts +1 -1
- package/dist/types/analytics/types/element-browser-events.d.ts +4 -4
- package/dist/types/analytics/types/events.d.ts +26 -26
- package/dist/types/analytics/types/experimental-events.d.ts +4 -4
- package/dist/types/analytics/types/extension-events.d.ts +5 -5
- package/dist/types/analytics/types/find-replace-events.d.ts +9 -9
- package/dist/types/analytics/types/format-events.d.ts +10 -10
- package/dist/types/analytics/types/general-events.d.ts +40 -40
- package/dist/types/analytics/types/inline-comment-events.d.ts +5 -5
- package/dist/types/analytics/types/insert-events.d.ts +23 -23
- package/dist/types/analytics/types/link-tool-bar-events.d.ts +14 -14
- package/dist/types/analytics/types/list-events.d.ts +11 -11
- package/dist/types/analytics/types/media-events.d.ts +12 -12
- package/dist/types/analytics/types/node-events.d.ts +11 -11
- package/dist/types/analytics/types/paste-events.d.ts +10 -10
- package/dist/types/analytics/types/performance-report.d.ts +1 -1
- package/dist/types/analytics/types/referentiality-events.d.ts +10 -10
- package/dist/types/analytics/types/selection-events.d.ts +6 -6
- package/dist/types/analytics/types/smart-links.d.ts +2 -2
- package/dist/types/analytics/types/substitute-events.d.ts +5 -5
- package/dist/types/analytics/types/table-events.d.ts +18 -18
- package/dist/types/analytics/types/toolbar-button.d.ts +2 -2
- package/dist/types/analytics/types/type-ahead.d.ts +8 -8
- package/dist/types/analytics/types/utils.d.ts +9 -9
- package/dist/types/card/utils.d.ts +2 -2
- package/dist/types/collab/types.d.ts +2 -2
- package/dist/types/event-dispatcher/index.d.ts +2 -2
- package/dist/types/extensions/combine-extension-providers.d.ts +1 -1
- package/dist/types/extensions/default-extension-provider.d.ts +1 -1
- package/dist/types/extensions/extension-handlers.d.ts +2 -2
- package/dist/types/extensions/manifest-helpers.d.ts +6 -5
- package/dist/types/extensions/module-helpers.d.ts +4 -4
- package/dist/types/extensions/types/extension-handler.d.ts +9 -9
- package/dist/types/extensions/types/extension-manifest-common.d.ts +4 -4
- package/dist/types/extensions/types/extension-manifest-toolbar-item.d.ts +11 -11
- package/dist/types/extensions/types/extension-manifest.d.ts +30 -30
- package/dist/types/extensions/types/extension-parameters.d.ts +2 -2
- package/dist/types/extensions/types/field-definitions.d.ts +12 -12
- package/dist/types/extensions/types/utils.d.ts +2 -2
- package/dist/types/hooks/useSharedPluginState.d.ts +2 -2
- package/dist/types/i18n/cs.d.ts +6 -6
- package/dist/types/i18n/da.d.ts +6 -6
- package/dist/types/i18n/de.d.ts +6 -6
- package/dist/types/i18n/en.d.ts +6 -6
- package/dist/types/i18n/en_GB.d.ts +6 -6
- package/dist/types/i18n/en_ZZ.d.ts +6 -6
- package/dist/types/i18n/es.d.ts +6 -6
- package/dist/types/i18n/et.d.ts +1 -1
- package/dist/types/i18n/fi.d.ts +6 -6
- package/dist/types/i18n/fr.d.ts +6 -6
- package/dist/types/i18n/hu.d.ts +6 -6
- package/dist/types/i18n/it.d.ts +6 -6
- package/dist/types/i18n/ja.d.ts +6 -6
- package/dist/types/i18n/ko.d.ts +6 -6
- package/dist/types/i18n/languages.d.ts +6 -6
- package/dist/types/i18n/nb.d.ts +6 -6
- package/dist/types/i18n/nl.d.ts +6 -6
- package/dist/types/i18n/pl.d.ts +6 -6
- package/dist/types/i18n/pt_BR.d.ts +6 -6
- package/dist/types/i18n/pt_PT.d.ts +1 -1
- package/dist/types/i18n/ru.d.ts +6 -6
- package/dist/types/i18n/sk.d.ts +1 -1
- package/dist/types/i18n/sv.d.ts +6 -6
- package/dist/types/i18n/th.d.ts +6 -6
- package/dist/types/i18n/tr.d.ts +6 -6
- package/dist/types/i18n/uk.d.ts +6 -6
- package/dist/types/i18n/vi.d.ts +6 -6
- package/dist/types/i18n/zh.d.ts +6 -6
- package/dist/types/i18n/zh_TW.d.ts +6 -6
- package/dist/types/node-width/index.d.ts +1 -1
- package/dist/types/normalize-feature-flags.d.ts +2 -2
- package/dist/types/preset/plugin-injection-api.d.ts +5 -5
- package/dist/types/provider-factory/autoformatting-provider.d.ts +3 -3
- package/dist/types/provider-factory/card-provider.d.ts +1 -1
- package/dist/types/provider-factory/image-upload-provider.d.ts +2 -2
- package/dist/types/provider-factory/macro-provider.d.ts +1 -1
- package/dist/types/provider-factory/media-provider.d.ts +1 -1
- package/dist/types/provider-factory/quick-insert-provider.d.ts +4 -4
- package/dist/types/provider-factory/search-provider.d.ts +1 -1
- package/dist/types/provider-factory/types.d.ts +3 -3
- package/dist/types/provider-factory/with-providers.d.ts +1 -1
- package/dist/types/provider-helpers/combine-providers.d.ts +4 -4
- package/dist/types/provider-helpers/promise-helpers.d.ts +2 -2
- package/dist/types/react-node-view/types.d.ts +6 -6
- package/dist/types/selection/gap-cursor/utils/is-ignored.d.ts +1 -1
- package/dist/types/selection/gap-cursor/utils/is-valid-target-node.d.ts +1 -1
- package/dist/types/selection/types.d.ts +1 -1
- package/dist/types/selection/utils.d.ts +2 -2
- package/dist/types/styles/shared/table.d.ts +1 -1
- package/dist/types/transforms/expand.d.ts +1 -1
- package/dist/types/types/annotation/emitter.d.ts +5 -5
- package/dist/types/types/annotation/index.d.ts +8 -8
- package/dist/types/types/collab.d.ts +2 -2
- package/dist/types/types/command.d.ts +3 -3
- package/dist/types/types/context-panel.d.ts +1 -1
- package/dist/types/types/copy-button.d.ts +2 -2
- package/dist/types/types/editor-actions.d.ts +2 -2
- package/dist/types/types/editor-appearance.d.ts +1 -1
- package/dist/types/types/editor-container-width.d.ts +2 -2
- package/dist/types/types/editor-plugin.d.ts +4 -4
- package/dist/types/types/editor-react-context.d.ts +1 -1
- package/dist/types/types/empty-state-handler.d.ts +2 -2
- package/dist/types/types/feature-flags.d.ts +3 -3
- package/dist/types/types/floating-toolbar.d.ts +26 -26
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/next-editor-plugin.d.ts +38 -38
- package/dist/types/types/plugin-factory.d.ts +3 -3
- package/dist/types/types/quick-insert.d.ts +5 -5
- package/dist/types/types/supported-browsers.d.ts +3 -3
- package/dist/types/types/toolbar.d.ts +2 -2
- package/dist/types/types/type-ahead.d.ts +7 -7
- package/dist/types/types/ui-components.d.ts +2 -2
- package/dist/types/ufo/experience-store.d.ts +2 -2
- package/dist/types/ui/BaseTheme/index.d.ts +2 -2
- package/dist/types/ui/Caption/index.d.ts +1 -1
- package/dist/types/ui/DropList/index.d.ts +1 -1
- package/dist/types/ui/ErrorBoundary/index.d.ts +1 -1
- package/dist/types/ui/EventHandlers/index.d.ts +5 -5
- package/dist/types/ui/Layer/index.d.ts +2 -2
- package/dist/types/ui/MediaSingle/index.d.ts +1 -1
- package/dist/types/ui/OverflowShadow/shadowObserver.d.ts +1 -1
- package/dist/types/ui/PortalProvider/index.d.ts +5 -5
- package/dist/types/ui/WidthProvider/index.d.ts +4 -4
- package/dist/types/ui/WithCreateAnalyticsEvent/index.d.ts +1 -1
- package/dist/types/ui/with-outer-listeners.d.ts +1 -1
- package/dist/types/ui-color/ColorPalette/Palettes/type.d.ts +2 -2
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/types.d.ts +7 -7
- package/dist/types/ui-menu/ToolbarButton/index.d.ts +2 -2
- package/dist/types/ui-react/ReactEditorViewContext.d.ts +1 -1
- package/dist/types/ui-react/with-react-editor-view-outer-listeners.d.ts +2 -2
- package/dist/types/utils/analytics.d.ts +7 -7
- package/dist/types/utils/annotation/index.d.ts +1 -1
- package/dist/types/utils/browser-extensions.d.ts +6 -6
- package/dist/types/utils/collab.d.ts +1 -1
- package/dist/types/utils/compare-props.d.ts +8 -8
- package/dist/types/utils/compareNodes.d.ts +2 -2
- package/dist/types/utils/compose.d.ts +1 -1
- package/dist/types/utils/date.d.ts +1 -1
- package/dist/types/utils/dom.d.ts +1 -1
- package/dist/types/utils/error-reporter.d.ts +1 -1
- package/dist/types/utils/extension-handler.d.ts +2 -2
- package/dist/types/utils/imageLoader.d.ts +1 -1
- package/dist/types/utils/nodes.d.ts +2 -2
- package/dist/types/utils/performance/hooks/use-component-render-tracking/index.d.ts +3 -3
- package/dist/types/utils/plugin-state-factory.d.ts +3 -3
- package/dist/types/utils/profiler/render-count.d.ts +2 -2
- package/dist/types/utils/referentiality.d.ts +6 -6
- package/dist/types/utils/slice.d.ts +2 -2
- package/dist/types/utils/track-unsupported-content.d.ts +4 -4
- package/dist/types/utils/traversor.d.ts +1 -1
- package/dist/types/utils/types.d.ts +2 -2
- package/dist/types/utils/unsupportedContent/get-unsupported-content-level-data.d.ts +2 -2
- package/dist/types/utils/validate-using-spec.d.ts +3 -3
- package/dist/types/utils/validator.d.ts +1 -1
- package/dist/types/with-plugin-state/index.d.ts +6 -6
- package/dist/types/with-plugin-state/types.d.ts +3 -3
- package/emoji/package.json +2 -2
- package/error-boundary/package.json +2 -2
- package/event-dispatcher/package.json +2 -2
- package/extensions/package.json +2 -2
- package/hooks/package.json +2 -2
- package/icons/package.json +2 -2
- package/in-product/package.json +2 -2
- package/keymaps/package.json +2 -2
- package/mention/package.json +2 -2
- package/messages/package.json +2 -2
- package/node-width/package.json +2 -2
- package/normalize-feature-flags/package.json +2 -2
- package/package.json +47 -39
- package/panel/package.json +2 -2
- package/portal-provider/package.json +2 -2
- package/preset/package.json +2 -2
- package/provider-factory/package.json +2 -2
- package/provider-helpers/package.json +2 -2
- package/react-node-view/package.json +2 -2
- package/safe-plugin/package.json +2 -2
- package/selection/package.json +2 -2
- package/styles/package.json +2 -2
- package/transforms/package.json +2 -2
- package/type-ahead/package.json +2 -2
- package/types/package.json +2 -2
- package/ufo/package.json +2 -2
- package/ui/package.json +2 -2
- package/ui-color/package.json +2 -2
- package/ui-menu/package.json +2 -2
- package/ui-react/package.json +2 -2
- package/utils/package.json +2 -2
- package/validator/package.json +2 -2
- package/with-plugin-state/package.json +2 -2
|
@@ -9,11 +9,11 @@ import type { ProviderFactory } from '../provider-factory';
|
|
|
9
9
|
import type { PaletteColor } from '../ui-color/ColorPalette/Palettes/type';
|
|
10
10
|
import type { Command } from './command';
|
|
11
11
|
import type { MarkOptions, NodeOptions } from './copy-button';
|
|
12
|
-
export interface RenderOptionsPropsT<T> {
|
|
12
|
+
export interface RenderOptionsPropsT<T extends {}> {
|
|
13
13
|
hide: () => void;
|
|
14
14
|
dispatchCommand: (command: T) => void;
|
|
15
15
|
}
|
|
16
|
-
export interface DropdownOptionT<T> {
|
|
16
|
+
export interface DropdownOptionT<T extends {}> {
|
|
17
17
|
id?: string;
|
|
18
18
|
title: string;
|
|
19
19
|
onClick: T;
|
|
@@ -31,12 +31,12 @@ export interface DropdownOptionT<T> {
|
|
|
31
31
|
tooltip?: string;
|
|
32
32
|
elemAfter?: React.ReactNode;
|
|
33
33
|
}
|
|
34
|
-
export
|
|
34
|
+
export type DropdownOptions<T extends {}> = Array<DropdownOptionT<T>> | {
|
|
35
35
|
render: (props: RenderOptionsPropsT<T>) => React.ReactElement<any> | null;
|
|
36
36
|
height: number;
|
|
37
37
|
width: number;
|
|
38
38
|
};
|
|
39
|
-
export interface SelectOption<T =
|
|
39
|
+
export interface SelectOption<T extends {} = {}> {
|
|
40
40
|
value: string;
|
|
41
41
|
label: string;
|
|
42
42
|
selected?: boolean;
|
|
@@ -44,19 +44,19 @@ export interface SelectOption<T = unknown> {
|
|
|
44
44
|
hidden?: boolean;
|
|
45
45
|
data?: T;
|
|
46
46
|
}
|
|
47
|
-
export
|
|
48
|
-
export
|
|
47
|
+
export type ButtonAppearance = 'subtle' | 'danger';
|
|
48
|
+
export type Icon = React.ComponentType<{
|
|
49
49
|
label: string;
|
|
50
50
|
}>;
|
|
51
|
-
export
|
|
52
|
-
export
|
|
51
|
+
export type RenderOptionsProps = RenderOptionsPropsT<Command>;
|
|
52
|
+
export type AlignType = 'left' | 'center' | 'right';
|
|
53
53
|
interface Position {
|
|
54
54
|
top?: number;
|
|
55
55
|
right?: number;
|
|
56
56
|
bottom?: number;
|
|
57
57
|
left?: number;
|
|
58
58
|
}
|
|
59
|
-
export
|
|
59
|
+
export type ConfirmDialogChildInfo = {
|
|
60
60
|
id: string;
|
|
61
61
|
name: string | null;
|
|
62
62
|
amount: number;
|
|
@@ -72,7 +72,7 @@ export interface ConfirmDialogOptions {
|
|
|
72
72
|
getChildrenInfo?: () => ConfirmDialogChildInfo[];
|
|
73
73
|
onConfirm?: (...args: any[]) => Command;
|
|
74
74
|
}
|
|
75
|
-
export
|
|
75
|
+
export type ConfirmationDialogProps = {
|
|
76
76
|
onConfirm: (isCheck?: boolean) => void;
|
|
77
77
|
/**
|
|
78
78
|
* onClose is called every time when the dialog is closed.
|
|
@@ -83,12 +83,12 @@ export declare type ConfirmationDialogProps = {
|
|
|
83
83
|
options?: ConfirmDialogOptions;
|
|
84
84
|
testId?: string;
|
|
85
85
|
};
|
|
86
|
-
export
|
|
86
|
+
export type FloatingToolbarCopyButton = {
|
|
87
87
|
type: 'copy-button';
|
|
88
88
|
items: Array<FloatingToolbarSeparator | MarkOptions | NodeOptions>;
|
|
89
89
|
hidden?: boolean;
|
|
90
90
|
};
|
|
91
|
-
export
|
|
91
|
+
export type FloatingToolbarButton<T extends {}> = {
|
|
92
92
|
id?: string;
|
|
93
93
|
type: 'button';
|
|
94
94
|
title: string;
|
|
@@ -117,7 +117,7 @@ export declare type FloatingToolbarButton<T> = {
|
|
|
117
117
|
tabIndex?: number | null | undefined;
|
|
118
118
|
focusEditoronEnter?: boolean;
|
|
119
119
|
};
|
|
120
|
-
export
|
|
120
|
+
export type FloatingToolbarInput<T extends {}> = {
|
|
121
121
|
id: string;
|
|
122
122
|
type: 'input';
|
|
123
123
|
title?: string;
|
|
@@ -128,7 +128,7 @@ export declare type FloatingToolbarInput<T> = {
|
|
|
128
128
|
placeholder?: string;
|
|
129
129
|
hidden?: boolean;
|
|
130
130
|
};
|
|
131
|
-
export
|
|
131
|
+
export type FloatingToolbarCustom<T extends {}> = {
|
|
132
132
|
type: 'custom';
|
|
133
133
|
/**
|
|
134
134
|
* By default -- the floating toolbar supports navigating between
|
|
@@ -145,7 +145,7 @@ export declare type FloatingToolbarCustom<T> = {
|
|
|
145
145
|
render: (view?: EditorView, idx?: number, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => React.ComponentClass | React.SFC | React.ReactElement<any> | null;
|
|
146
146
|
hidden?: boolean;
|
|
147
147
|
};
|
|
148
|
-
|
|
148
|
+
type FloatingToolbarSelectBase<T extends {}, V = SelectOption> = {
|
|
149
149
|
id: string;
|
|
150
150
|
type: 'select';
|
|
151
151
|
selectType: 'list' | 'emoji' | 'date' | 'color';
|
|
@@ -158,27 +158,27 @@ declare type FloatingToolbarSelectBase<T, V = SelectOption> = {
|
|
|
158
158
|
onChange: (selected: V) => T;
|
|
159
159
|
filterOption?: ((option: V, rawInput: string) => boolean) | null;
|
|
160
160
|
};
|
|
161
|
-
export
|
|
161
|
+
export type FloatingToolbarListPicker<T extends {}> = FloatingToolbarSelectBase<T> & {
|
|
162
162
|
selectType: 'list';
|
|
163
163
|
};
|
|
164
|
-
export
|
|
164
|
+
export type FloatingToolbarColorPicker<T extends {}> = FloatingToolbarSelectBase<T, PaletteColor> & {
|
|
165
165
|
selectType: 'color';
|
|
166
166
|
};
|
|
167
|
-
export
|
|
167
|
+
export type FloatingToolbarEmojiPicker<T extends {}> = FloatingToolbarSelectBase<T, EmojiId> & {
|
|
168
168
|
selectType: 'emoji';
|
|
169
169
|
selected?: boolean;
|
|
170
170
|
options: never[];
|
|
171
171
|
};
|
|
172
|
-
export
|
|
172
|
+
export type FloatingToolbarDatePicker<T extends {}> = FloatingToolbarSelectBase<T, number> & {
|
|
173
173
|
selectType: 'date';
|
|
174
174
|
options: never[];
|
|
175
175
|
};
|
|
176
|
-
export
|
|
177
|
-
export
|
|
176
|
+
export type FloatingToolbarSelect<T extends {}> = FloatingToolbarEmojiPicker<T> | FloatingToolbarColorPicker<T> | FloatingToolbarListPicker<T> | FloatingToolbarDatePicker<T>;
|
|
177
|
+
export type FloatingToolbarSeparator = {
|
|
178
178
|
type: 'separator';
|
|
179
179
|
hidden?: boolean;
|
|
180
180
|
};
|
|
181
|
-
export
|
|
181
|
+
export type FloatingToolbarDropdown<T extends {}> = {
|
|
182
182
|
testId?: string;
|
|
183
183
|
id?: string;
|
|
184
184
|
type: 'dropdown';
|
|
@@ -192,7 +192,7 @@ export declare type FloatingToolbarDropdown<T> = {
|
|
|
192
192
|
dropdownWidth?: number;
|
|
193
193
|
showSelected?: boolean;
|
|
194
194
|
};
|
|
195
|
-
|
|
195
|
+
type FloatingToolbarExtensionsPlaceholder = {
|
|
196
196
|
type: 'extensions-placeholder';
|
|
197
197
|
hidden?: boolean;
|
|
198
198
|
separator?: 'start' | 'end' | 'both';
|
|
@@ -206,8 +206,8 @@ declare type FloatingToolbarExtensionsPlaceholder = {
|
|
|
206
206
|
* This type is restricted with the items that can be used for fallback.
|
|
207
207
|
* Make sure that this type is not a FloatingToolbarCustom type.
|
|
208
208
|
*/
|
|
209
|
-
export
|
|
210
|
-
export
|
|
209
|
+
export type FloatingToolbarFallbackItem<T extends {}> = FloatingToolbarButton<T> | FloatingToolbarCopyButton | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarSeparator;
|
|
210
|
+
export type FloatingToolbarItem<T extends {}> = FloatingToolbarButton<T> | FloatingToolbarCopyButton | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarCustom<T> | FloatingToolbarSeparator | FloatingToolbarExtensionsPlaceholder;
|
|
211
211
|
export interface FloatingToolbarConfig {
|
|
212
212
|
/** Used for the ariaLabel on the <Popup /> component */
|
|
213
213
|
title: string;
|
|
@@ -249,5 +249,5 @@ export interface FloatingToolbarConfig {
|
|
|
249
249
|
focusTrap?: boolean;
|
|
250
250
|
preventPopupOverflow?: boolean;
|
|
251
251
|
}
|
|
252
|
-
export
|
|
252
|
+
export type FloatingToolbarHandler = (state: EditorState, intl: IntlShape, providerFactory: ProviderFactory) => FloatingToolbarConfig | undefined;
|
|
253
253
|
export {};
|
|
@@ -30,6 +30,6 @@ export type { PMPluginFactoryParams, PMPluginFactory, PMPlugin, } from './plugin
|
|
|
30
30
|
export type { NodeConfig, MarkConfig, NodeViewConfig, } from './prosemirror-config';
|
|
31
31
|
export type { PluginsOptions, EditorPlugin, getPosHandler, getPosHandlerNode, } from './editor-plugin';
|
|
32
32
|
export type { NextEditorPlugin, AllEditorPresetPluginTypes, PluginDependenciesAPI, ExtractPluginNameFromAllBuilderPlugins, SafePresetCheck, DefaultEditorPlugin, OptionalPlugin, PluginInjectionAPI, CreatePluginDependenciesAPI, NextEditorPluginMetadata, ExtractInjectionAPI, } from './next-editor-plugin';
|
|
33
|
-
export
|
|
33
|
+
export type IconProps = {
|
|
34
34
|
label?: string;
|
|
35
35
|
};
|
|
@@ -6,56 +6,56 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { EditorState } from 'prosemirror-state';
|
|
8
8
|
import type { EditorPlugin } from './editor-plugin';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
10
|
+
type PickSharedStatePropertyName<Metadata extends NextEditorPluginMetadata> = IsAny<Metadata> extends true ? never : ExtractSharedStateFromMetadata<Metadata> extends never ? never : 'getSharedState';
|
|
11
|
+
type WithSharedState<Metadata extends NextEditorPluginMetadata> = {
|
|
12
12
|
[Property in keyof Pick<Metadata, 'sharedState'> as PickSharedStatePropertyName<Metadata>]: (editorState: EditorState | undefined) => ExtractSharedStateFromMetadata<Metadata>;
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
type PickActionsPropertyName<Metadata extends NextEditorPluginMetadata> = IsAny<Metadata> extends true ? never : ExtractActionsFromMetadata<Metadata> extends never ? never : 'actions';
|
|
15
|
+
type WithActions<Metadata extends NextEditorPluginMetadata> = {
|
|
16
16
|
[Property in keyof Pick<Metadata, 'actions'> as PickActionsPropertyName<Metadata>]: ExtractActionsFromMetadata<Metadata>;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export type DefaultEditorPlugin<Name extends string, Metadata extends NextEditorPluginMetadata> = EditorPlugin & WithSharedState<Metadata> & WithActions<Metadata> & {
|
|
19
19
|
name: Name;
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
type MaybeAction = ((...agrs: any) => any) | ((...agrs: any) => void);
|
|
22
|
+
type NextEditorPluginActions = Record<string, MaybeAction>;
|
|
23
23
|
export interface NextEditorPluginMetadata {
|
|
24
24
|
readonly sharedState?: any;
|
|
25
25
|
readonly pluginConfiguration?: any;
|
|
26
26
|
readonly dependencies?: DependencyPlugin[];
|
|
27
27
|
readonly actions?: NextEditorPluginActions;
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export type PluginInjectionAPI<Name extends string, Metadata extends NextEditorPluginMetadata> = {
|
|
30
30
|
dependencies: CreatePluginDependenciesAPI<[
|
|
31
31
|
NextEditorPlugin<Name, Metadata>,
|
|
32
32
|
...ExtractPluginDependenciesFromMetadata<Metadata>
|
|
33
33
|
]>;
|
|
34
34
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
type NextEditorPluginFunctionDefinition<Name extends string, Metadata extends NextEditorPluginMetadata, Configuration> = (config: Configuration, api?: PluginInjectionAPI<Name, Metadata>) => DefaultEditorPlugin<Name, Metadata>;
|
|
36
|
+
type NextEditorPluginFunctionOptionalConfigDefinition<Name extends string, Metadata extends NextEditorPluginMetadata, Configuration = undefined> = (config?: Configuration, api?: PluginInjectionAPI<Name, Metadata>) => DefaultEditorPlugin<Name, Metadata>;
|
|
37
|
+
type OptionalPrivateProperty = {
|
|
38
38
|
__optionalPluginType: true;
|
|
39
39
|
};
|
|
40
|
-
export
|
|
41
|
-
|
|
42
|
-
export
|
|
43
|
-
|
|
40
|
+
export type OptionalPlugin<EditorPlugin extends NextEditorPlugin<any, any>> = EditorPlugin & OptionalPrivateProperty;
|
|
41
|
+
type DependencyPlugin = OptionalPlugin<NextEditorPlugin<any, any>> | NextEditorPlugin<any, any>;
|
|
42
|
+
export type NextEditorPlugin<Name extends string, Metadata extends NextEditorPluginMetadata = {}> = Metadata extends NextEditorPluginMetadata ? 'pluginConfiguration' extends keyof Metadata ? undefined extends Metadata['pluginConfiguration'] ? NextEditorPluginFunctionOptionalConfigDefinition<Name, Metadata, Metadata['pluginConfiguration']> : NextEditorPluginFunctionDefinition<Name, Metadata, Metadata['pluginConfiguration']> : NextEditorPluginFunctionOptionalConfigDefinition<Name, Metadata> : never;
|
|
43
|
+
type FilterOptionalPlugins<T extends DependencyPlugin[]> = T extends [
|
|
44
44
|
infer Head,
|
|
45
45
|
...infer Tail
|
|
46
46
|
] ? Tail extends DependencyPlugin[] ? Head extends OptionalPlugin<NextEditorPlugin<any, any>> ? FilterOptionalPlugins<Tail> : [Head, ...FilterOptionalPlugins<Tail>] : T : T;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
export
|
|
53
|
-
|
|
54
|
-
export
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
export
|
|
47
|
+
type ExtractPluginDependenciesFromMetadataWithoutOptionals<Metadata extends NextEditorPluginMetadata> = Metadata['dependencies'] extends DependencyPlugin[] ? FilterOptionalPlugins<Metadata['dependencies']> : [];
|
|
48
|
+
type ExtractPluginDependenciesFromMetadata<Metadata> = 'dependencies' extends keyof Metadata ? Metadata['dependencies'] extends DependencyPlugin[] ? Exclude<Metadata['dependencies'], undefined> : [] : [];
|
|
49
|
+
type ExtractSharedStateFromMetadata<Metadata> = 'sharedState' extends keyof Metadata ? Metadata['sharedState'] : never;
|
|
50
|
+
type ExtractActionsFromMetadata<Metadata> = 'actions' extends keyof Metadata ? Metadata['actions'] : never;
|
|
51
|
+
type ExtractPluginConfigurationFromMetadata<Metadata> = 'pluginConfiguration' extends keyof Metadata ? Metadata['pluginConfiguration'] : never;
|
|
52
|
+
export type ExtractPluginDependencies<Plugin> = Plugin extends NextEditorPlugin<any, any> ? Plugin extends (config: any, api: any) => DefaultEditorPlugin<any, infer Metadata> ? ExtractPluginDependenciesFromMetadataWithoutOptionals<Metadata> : never : never;
|
|
53
|
+
type ExtractPluginConfiguration<Plugin> = Plugin extends NextEditorPlugin<any, any> ? Plugin extends (config: any, api: any) => DefaultEditorPlugin<any, infer Metadata> ? ExtractPluginConfigurationFromMetadata<Metadata> : never : never;
|
|
54
|
+
export type ExtractPluginSharedState<Plugin> = Plugin extends NextEditorPlugin<any, any> ? Plugin extends (config: any, api: any) => DefaultEditorPlugin<any, infer Metadata> ? ExtractSharedStateFromMetadata<Metadata> : never : never;
|
|
55
|
+
type ExtractPluginActions<Plugin> = Plugin extends NextEditorPlugin<any, any> ? Plugin extends (config: any, api: any) => DefaultEditorPlugin<any, infer Metadata> ? ExtractActionsFromMetadata<Metadata> : never : never;
|
|
56
|
+
type ExtractPluginName<Plugin> = Plugin extends NextEditorPlugin<any, any> ? Plugin extends (...args: any) => DefaultEditorPlugin<infer PluginName, any> ? PluginName : never : never;
|
|
57
|
+
type Unsubscribe = () => void;
|
|
58
|
+
export type PluginDependenciesAPI<Plugin extends NextEditorPlugin<any, any>> = {
|
|
59
59
|
sharedState: {
|
|
60
60
|
currentState: () => ExtractPluginSharedState<Plugin> | undefined;
|
|
61
61
|
onChange: (sub: (props: {
|
|
@@ -65,13 +65,13 @@ export declare type PluginDependenciesAPI<Plugin extends NextEditorPlugin<any, a
|
|
|
65
65
|
};
|
|
66
66
|
actions: ExtractPluginActions<Plugin>;
|
|
67
67
|
};
|
|
68
|
-
export
|
|
68
|
+
export type CreatePluginDependenciesAPI<PluginList extends NextEditorPlugin<any, any>[]> = {
|
|
69
69
|
[Plugin in PluginList[number] as `${ExtractPluginName<Plugin>}`]: Plugin extends OptionalPlugin<NextEditorPlugin<any, any>> ? PluginDependenciesAPI<Plugin> | undefined : Plugin extends NextEditorPlugin<any, any> ? PluginDependenciesAPI<Plugin> : never;
|
|
70
70
|
};
|
|
71
|
-
export
|
|
72
|
-
export
|
|
73
|
-
|
|
74
|
-
export
|
|
71
|
+
export type PluginAsArray<Plugin> = undefined extends ExtractPluginConfiguration<Plugin> ? [Plugin, ExtractPluginConfiguration<Plugin>?] : [Plugin, ExtractPluginConfiguration<Plugin>];
|
|
72
|
+
export type AllEditorPresetPluginTypes = PluginAsArray<any> | NextEditorPlugin<any, any>;
|
|
73
|
+
type ExtractNextEditorPlugin<Plugin> = Plugin extends PluginAsArray<any> ? Plugin[0] : never;
|
|
74
|
+
export type VerifyPluginDependencies<Plugin, PluginsStack extends AllEditorPresetPluginTypes[]> = ExtractPluginDependencies<Plugin> extends [] ? Plugin extends PluginAsArray<any> | NextEditorPlugin<any, any> ? Plugin : never :
|
|
75
75
|
/**
|
|
76
76
|
* case 1: We're looking for its dependent plugins indexed on `AllEditorPresetPluginTypes`
|
|
77
77
|
*/
|
|
@@ -85,11 +85,11 @@ ExtractPluginDependencies<Plugin>[number] extends (ExtractPluginDependencies<Plu
|
|
|
85
85
|
/**
|
|
86
86
|
* Used to check if a plugin being added can be added to a Preset/builder
|
|
87
87
|
*/
|
|
88
|
-
export
|
|
89
|
-
|
|
88
|
+
export type SafePresetCheck<Plugin, StackPlugins extends AllEditorPresetPluginTypes[]> = Plugin extends Plugin & VerifyPluginDependencies<Plugin, StackPlugins> ? Plugin extends NextEditorPlugin<any, any> ? CheckBasicPlugin<Plugin> : never : never;
|
|
89
|
+
type CheckTupleRequirements<Plugin, Config, ArrayType> = unknown extends Config ? Plugin | ArrayType : undefined extends Config ? Plugin | ArrayType : [
|
|
90
90
|
Config
|
|
91
91
|
] extends [never] ? Plugin : ArrayType;
|
|
92
|
-
|
|
93
|
-
export
|
|
94
|
-
export
|
|
92
|
+
type CheckBasicPlugin<Plugin> = Plugin extends (args: any, api: any) => EditorPlugin ? CheckTupleRequirements<Plugin, ExtractPluginConfiguration<Plugin>, PluginAsArray<Plugin>> : never;
|
|
93
|
+
export type ExtractPluginNameFromAllBuilderPlugins<Plugin extends AllEditorPresetPluginTypes> = Plugin extends Array<any> ? Plugin extends [infer MaybePlugin, ...any] ? MaybePlugin extends NextEditorPlugin<any, any> ? ExtractPluginName<MaybePlugin> : never : never : Plugin extends NextEditorPlugin<any, any> ? ExtractPluginName<Plugin> : never;
|
|
94
|
+
export type ExtractInjectionAPI<Plugin> = Plugin extends NextEditorPlugin<infer Name, infer Metadata> ? PluginInjectionAPI<Name, Metadata> : never;
|
|
95
95
|
export {};
|
|
@@ -8,7 +8,7 @@ import type { PortalProviderAPI } from '../ui/PortalProvider';
|
|
|
8
8
|
import type { ErrorReporter } from '../utils';
|
|
9
9
|
import type { EditorReactContext } from './editor-react-context';
|
|
10
10
|
import type { FeatureFlags } from './feature-flags';
|
|
11
|
-
export
|
|
11
|
+
export type PMPluginFactoryParams = {
|
|
12
12
|
schema: Schema;
|
|
13
13
|
dispatch: Dispatch;
|
|
14
14
|
eventDispatcher: EventDispatcher;
|
|
@@ -20,8 +20,8 @@ export declare type PMPluginFactoryParams = {
|
|
|
20
20
|
featureFlags: FeatureFlags;
|
|
21
21
|
getIntl: () => IntlShape;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
24
|
-
export
|
|
23
|
+
export type PMPluginFactory = (params: PMPluginFactoryParams) => SafePlugin | undefined;
|
|
24
|
+
export type PMPlugin = {
|
|
25
25
|
name: string;
|
|
26
26
|
plugin: PMPluginFactory;
|
|
27
27
|
};
|
|
@@ -2,21 +2,21 @@ import { IntlShape } from 'react-intl-next';
|
|
|
2
2
|
import type { QuickInsertItem, QuickInsertProvider } from '../provider-factory';
|
|
3
3
|
import type { EmptyStateHandler } from './empty-state-handler';
|
|
4
4
|
export type { QuickInsertActionInsert, QuickInsertItem, QuickInsertProvider, } from '../provider-factory';
|
|
5
|
-
export
|
|
5
|
+
export type QuickInsertOptions = boolean | {
|
|
6
6
|
provider: Promise<QuickInsertProvider>;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export type QuickInsertHandler = Array<QuickInsertItem> | ((intl: IntlShape) => Array<QuickInsertItem>);
|
|
9
|
+
export type IconProps = {
|
|
10
10
|
label?: string;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type QuickInsertPluginState = {
|
|
13
13
|
isElementBrowserModalOpen: boolean;
|
|
14
14
|
lazyDefaultItems: () => QuickInsertItem[];
|
|
15
15
|
providedItems?: QuickInsertItem[];
|
|
16
16
|
provider?: QuickInsertProvider;
|
|
17
17
|
emptyStateHandler?: EmptyStateHandler;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type QuickInsertPluginStateKeys = keyof QuickInsertPluginState;
|
|
20
20
|
export interface QuickInsertPluginOptions {
|
|
21
21
|
headless?: boolean;
|
|
22
22
|
disableDefaultItems?: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare const SupportedBrowsers: readonly ["ie", "gecko", "chrome", "safari"];
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type Browsers = (typeof SupportedBrowsers)[number];
|
|
3
|
+
export type Range = {
|
|
4
4
|
minimum: number;
|
|
5
5
|
maximum?: number;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type DisableSpellcheckByBrowser = {
|
|
8
8
|
[b in Browsers]?: Range;
|
|
9
9
|
};
|
|
10
10
|
export {};
|
|
@@ -22,9 +22,9 @@ export declare enum ToolbarWidthsFullPage {
|
|
|
22
22
|
M = 490,
|
|
23
23
|
S = 410
|
|
24
24
|
}
|
|
25
|
-
export
|
|
25
|
+
export type ToolbarUiComponentFactoryParams = UiComponentFactoryParams & {
|
|
26
26
|
toolbarSize: ToolbarSize;
|
|
27
27
|
isToolbarReducedSpacing: boolean;
|
|
28
28
|
isLastItem?: boolean;
|
|
29
29
|
};
|
|
30
|
-
export
|
|
30
|
+
export type ToolbarUIComponentFactory = (params: ToolbarUiComponentFactoryParams) => React.ReactElement<any> | null;
|
|
@@ -3,7 +3,7 @@ import { Fragment, Node as PMNode } from 'prosemirror-model';
|
|
|
3
3
|
import { EditorState, Transaction } from 'prosemirror-state';
|
|
4
4
|
import type { TypeAheadPayload } from '../analytics/types/type-ahead';
|
|
5
5
|
import type { SelectItemMode, TypeAheadAvailableNodes } from '../type-ahead';
|
|
6
|
-
|
|
6
|
+
type TypeAheadForceSelectProps = {
|
|
7
7
|
query: string;
|
|
8
8
|
items: Array<TypeAheadItem>;
|
|
9
9
|
editorState: EditorState;
|
|
@@ -16,21 +16,21 @@ export interface TypeAheadStats {
|
|
|
16
16
|
arrowDown: number;
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
export
|
|
19
|
+
export type TypeAheadItemRenderProps = {
|
|
20
20
|
onClick: () => void;
|
|
21
21
|
onHover: () => void;
|
|
22
22
|
isSelected: boolean;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
24
|
+
export type TypeAheadInsert = (node?: PMNode | Object | string | Fragment, opts?: {
|
|
25
25
|
selectInlineNode?: boolean;
|
|
26
26
|
}) => Transaction;
|
|
27
|
-
export
|
|
27
|
+
export type TypeAheadSelectItem = (state: EditorState, item: TypeAheadItem, insert: TypeAheadInsert, meta: {
|
|
28
28
|
mode: SelectItemMode;
|
|
29
29
|
stats: TypeAheadStats;
|
|
30
30
|
query: string;
|
|
31
31
|
sourceListItem: Array<TypeAheadItem>;
|
|
32
32
|
}) => Transaction | false;
|
|
33
|
-
export
|
|
33
|
+
export type TypeAheadItem = {
|
|
34
34
|
title: string;
|
|
35
35
|
description?: string;
|
|
36
36
|
keyshortcut?: string;
|
|
@@ -39,8 +39,8 @@ export declare type TypeAheadItem = {
|
|
|
39
39
|
render?: (props: TypeAheadItemRenderProps) => React.ReactElement<TypeAheadItemRenderProps> | null;
|
|
40
40
|
[key: string]: any;
|
|
41
41
|
};
|
|
42
|
-
export
|
|
43
|
-
export
|
|
42
|
+
export type TypeAheadForceSelect = (props: TypeAheadForceSelectProps) => TypeAheadItem | undefined;
|
|
43
|
+
export type TypeAheadHandler = {
|
|
44
44
|
id: TypeAheadAvailableNodes;
|
|
45
45
|
/** Pattern that will trigger the TypeAhead */
|
|
46
46
|
trigger: string;
|
|
@@ -5,7 +5,7 @@ import type { EventDispatcher } from '../event-dispatcher';
|
|
|
5
5
|
import type { ProviderFactory } from '../provider-factory';
|
|
6
6
|
import type { EditorActionsOptions } from './editor-actions';
|
|
7
7
|
import type { EditorAppearance } from './editor-appearance';
|
|
8
|
-
export
|
|
8
|
+
export type UiComponentFactoryParams = {
|
|
9
9
|
editorView: EditorView;
|
|
10
10
|
editorActions: EditorActionsOptions;
|
|
11
11
|
eventDispatcher: EventDispatcher;
|
|
@@ -19,4 +19,4 @@ export declare type UiComponentFactoryParams = {
|
|
|
19
19
|
disabled: boolean;
|
|
20
20
|
wrapperElement: HTMLElement | null;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type UIComponentFactory = (params: UiComponentFactoryParams) => React.ReactElement<any> | null;
|
|
@@ -9,8 +9,8 @@ export declare enum EditorExperience {
|
|
|
9
9
|
editSession = "editSession"
|
|
10
10
|
}
|
|
11
11
|
export declare const RELIABILITY_INTERVAL = 30000;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
type TypeOfEditorExperience = typeof EditorExperience;
|
|
13
|
+
type ValueOfEditorExperience = TypeOfEditorExperience[keyof TypeOfEditorExperience];
|
|
14
14
|
export declare class ExperienceStore {
|
|
15
15
|
private static stores;
|
|
16
16
|
private experiences;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Breakpoints } from '../WidthProvider';
|
|
3
3
|
export declare function mapBreakpointToLayoutMaxWidth(breakpoint: Breakpoints): 760 | 680;
|
|
4
|
-
|
|
4
|
+
type BaseThemeWrapperProps = {
|
|
5
5
|
breakpoint: Breakpoints;
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
baseFontSize?: number;
|
|
8
8
|
};
|
|
9
9
|
export declare function BaseThemeWrapper({ baseFontSize, children, }: BaseThemeWrapperProps): JSX.Element;
|
|
10
|
-
|
|
10
|
+
type BaseThemeProps = {
|
|
11
11
|
children: React.ReactNode;
|
|
12
12
|
baseFontSize?: number;
|
|
13
13
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ACTION, DispatchAnalyticsEvent, ErrorEventPayload } from '../../analytics';
|
|
3
|
-
|
|
3
|
+
type ErrorCrashPayload = Extract<ErrorEventPayload, {
|
|
4
4
|
action: ACTION.EDITOR_CRASHED;
|
|
5
5
|
}>;
|
|
6
6
|
interface ErrorBoundaryProps {
|
|
@@ -5,11 +5,11 @@ export interface CardSurroundings {
|
|
|
5
5
|
collectionName: string;
|
|
6
6
|
list: Identifier[];
|
|
7
7
|
}
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
8
|
+
export type MentionEventHandler = (mentionId: string, text: string, event?: SyntheticEvent<HTMLSpanElement>) => void;
|
|
9
|
+
export type CardEventClickHandler = (result: CardEvent | InlineCardEvent, surroundings?: CardSurroundings, analyticsEvent?: any) => void;
|
|
10
|
+
export type LinkEventClickHandler = (event: SyntheticEvent<HTMLAnchorElement>, url?: string) => void;
|
|
11
|
+
export type SmartCardEventClickHandler = (event: SyntheticEvent<HTMLAnchorElement>, url?: string) => void;
|
|
12
|
+
export type OnUnhandledClickHandler = (event: React.MouseEvent) => void;
|
|
13
13
|
export interface MentionEventHandlers {
|
|
14
14
|
onClick?: MentionEventHandler;
|
|
15
15
|
onMouseEnter?: MentionEventHandler;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Component, ReactNode } from 'react';
|
|
2
2
|
import { Data } from 'popper.js';
|
|
3
|
-
export
|
|
3
|
+
export type Props = {
|
|
4
4
|
content: ReactNode | null;
|
|
5
5
|
offset: string;
|
|
6
6
|
position: string;
|
|
7
7
|
onPositioned: () => void;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type State = {
|
|
10
10
|
hasExtractedStyles: boolean;
|
|
11
11
|
position?: string;
|
|
12
12
|
transform?: string;
|
|
@@ -20,5 +20,5 @@ export interface Props {
|
|
|
20
20
|
hasFallbackContainer?: boolean;
|
|
21
21
|
handleMediaSingleRef?: React.RefObject<HTMLDivElement>;
|
|
22
22
|
}
|
|
23
|
-
export declare const shouldAddDefaultWrappedWidth: (layout: RichMediaLayout, width?: number
|
|
23
|
+
export declare const shouldAddDefaultWrappedWidth: (layout: RichMediaLayout, width?: number, lineLength?: number) => boolean | 0 | undefined;
|
|
24
24
|
export default function MediaSingle({ layout, width, height, containerWidth, isLoading, pctWidth, className, children: propsChildren, nodeType, fullWidthMode, lineLength, hasFallbackContainer, handleMediaSingleRef, }: Props): jsx.JSX.Element;
|
|
@@ -2,7 +2,7 @@ export declare enum ShadowKeys {
|
|
|
2
2
|
SHOW_LEFT_SHADOW = "showLeftShadow",
|
|
3
3
|
SHOW_RIGHT_SHADOW = "showRightShadow"
|
|
4
4
|
}
|
|
5
|
-
export
|
|
5
|
+
export type ShadowsStates = {
|
|
6
6
|
[ShadowKey in ShadowKeys]: boolean;
|
|
7
7
|
};
|
|
8
8
|
export declare const shadowObserverClassNames: {
|
|
@@ -3,17 +3,17 @@ import { IntlShape, WrappedComponentProps } from 'react-intl-next';
|
|
|
3
3
|
import type { ThemeModes } from '@atlaskit/theme/types';
|
|
4
4
|
import { FireAnalyticsCallback } from '../../analytics';
|
|
5
5
|
import { EventDispatcher } from '../../event-dispatcher';
|
|
6
|
-
export
|
|
6
|
+
export type BasePortalProviderProps = {
|
|
7
7
|
render: (portalProviderAPI: PortalProviderAPI) => React.ReactChild | JSX.Element | null;
|
|
8
8
|
onAnalyticsEvent?: FireAnalyticsCallback;
|
|
9
9
|
useAnalyticsContext?: boolean;
|
|
10
10
|
themeMode?: ThemeModes;
|
|
11
11
|
} & WrappedComponentProps;
|
|
12
|
-
export
|
|
13
|
-
export
|
|
12
|
+
export type Portals = Map<HTMLElement, React.ReactChild>;
|
|
13
|
+
export type PortalRendererState = {
|
|
14
14
|
portals: Portals;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
type MountedPortal = {
|
|
17
17
|
children: () => React.ReactChild | null;
|
|
18
18
|
hasAnalyticsContext: boolean;
|
|
19
19
|
hasIntlContext: boolean;
|
|
@@ -37,7 +37,7 @@ export declare class PortalProviderAPI extends EventDispatcher {
|
|
|
37
37
|
export declare const PortalProvider: React.FC<import("react-intl-next").WithIntlProps<BasePortalProviderProps>> & {
|
|
38
38
|
WrappedComponent: React.ComponentType<BasePortalProviderProps>;
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
type PortalProviderWithThemeProvidersProps = Omit<BasePortalProviderProps, 'intl' | 'themeMode'>;
|
|
41
41
|
export declare const PortalProviderWithThemeProviders: ({ onAnalyticsEvent, useAnalyticsContext, render, }: PortalProviderWithThemeProvidersProps) => JSX.Element;
|
|
42
42
|
export declare class PortalRenderer extends React.Component<{
|
|
43
43
|
portalProviderAPI: PortalProviderAPI;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type Breakpoints = 'S' | 'M' | 'L';
|
|
5
|
+
export type WidthConsumerContext = {
|
|
6
6
|
width: number;
|
|
7
7
|
breakpoint: Breakpoints;
|
|
8
8
|
};
|
|
@@ -10,10 +10,10 @@ export declare function getBreakpoint(width?: number): Breakpoints;
|
|
|
10
10
|
export declare function createWidthContext(width?: number): WidthConsumerContext;
|
|
11
11
|
export declare const WidthContext: React.Context<WidthConsumerContext>;
|
|
12
12
|
declare const Consumer: React.Consumer<WidthConsumerContext>;
|
|
13
|
-
export
|
|
13
|
+
export type WidthProviderState = {
|
|
14
14
|
width?: number;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
type WidthProviderProps = {
|
|
17
17
|
className?: string;
|
|
18
18
|
};
|
|
19
19
|
export declare class WidthProvider extends React.Component<WidthProviderProps, WidthProviderState> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
export
|
|
3
|
+
export type Props = {
|
|
4
4
|
render: (createAnalyticsEvent?: CreateUIAnalyticsEvent) => React.ReactNode;
|
|
5
5
|
};
|
|
6
6
|
export declare const WithCreateAnalyticsEvent: React.ComponentType<Props>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentClass, StatelessComponent } from 'react';
|
|
2
|
-
|
|
2
|
+
type SimpleEventHandler<T> = (event: T) => void;
|
|
3
3
|
export interface WithOutsideClickProps {
|
|
4
4
|
handleClickOutside?: SimpleEventHandler<MouseEvent>;
|
|
5
5
|
handleEscapeKeydown?: SimpleEventHandler<KeyboardEvent>;
|