@atlaskit/editor-common 72.6.1 → 72.7.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/CHANGELOG.md +24 -0
- package/dist/cjs/analytics/types/enums.js +3 -0
- package/dist/cjs/hooks/index.js +8 -1
- package/dist/cjs/hooks/useSharedPluginState.js +102 -0
- package/dist/cjs/messages/{codeBlockCopyButton.js → codeBlockButton.js} +13 -3
- package/dist/cjs/messages/index.js +3 -3
- package/dist/cjs/normalize-feature-flags.js +12 -0
- package/dist/cjs/preset/plugin-injection-api.js +115 -53
- package/dist/cjs/styles/shared/table.js +2 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui-color/ColorPalette/Palettes/borderColorPalette.js +24 -0
- package/dist/cjs/ui-color/ColorPalette/Palettes/index.js +6 -0
- package/dist/cjs/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +25 -2
- package/dist/cjs/ui-color/index.js +14 -1
- package/dist/cjs/utils/validator.js +7 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/types/enums.js +3 -0
- package/dist/es2019/hooks/index.js +2 -1
- package/dist/es2019/hooks/useSharedPluginState.js +78 -0
- package/dist/{esm/messages/codeBlockCopyButton.js → es2019/messages/codeBlockButton.js} +11 -1
- package/dist/es2019/messages/index.js +1 -1
- package/dist/es2019/normalize-feature-flags.js +9 -0
- package/dist/es2019/preset/plugin-injection-api.js +64 -33
- package/dist/es2019/styles/shared/table.js +2 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui-color/ColorPalette/Palettes/borderColorPalette.js +16 -0
- package/dist/es2019/ui-color/ColorPalette/Palettes/index.js +1 -1
- package/dist/es2019/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +24 -0
- package/dist/es2019/ui-color/index.js +3 -2
- package/dist/es2019/utils/validator.js +7 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/types/enums.js +3 -0
- package/dist/esm/hooks/index.js +2 -1
- package/dist/esm/hooks/useSharedPluginState.js +95 -0
- package/dist/{es2019/messages/codeBlockCopyButton.js → esm/messages/codeBlockButton.js} +11 -1
- package/dist/esm/messages/index.js +1 -1
- package/dist/esm/normalize-feature-flags.js +11 -0
- package/dist/esm/preset/plugin-injection-api.js +115 -53
- package/dist/esm/styles/shared/table.js +2 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui-color/ColorPalette/Palettes/borderColorPalette.js +16 -0
- package/dist/esm/ui-color/ColorPalette/Palettes/index.js +1 -1
- package/dist/esm/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +22 -0
- package/dist/esm/ui-color/index.js +3 -2
- package/dist/esm/utils/validator.js +7 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/types/enums.d.ts +3 -0
- package/dist/types/analytics/types/media-events.d.ts +3 -1
- package/dist/types/collab/types.d.ts +15 -0
- package/dist/types/collab.d.ts +1 -1
- package/dist/types/extensions/types/extension-handler.d.ts +1 -1
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/useSharedPluginState.d.ts +39 -0
- package/dist/types/messages/codeBlockButton.d.ts +22 -0
- package/dist/types/messages/index.d.ts +1 -1
- package/dist/types/normalize-feature-flags.d.ts +7 -0
- package/dist/types/preset/plugin-injection-api.d.ts +3 -1
- package/dist/types/styles/shared/table.d.ts +2 -0
- package/dist/types/types/floating-toolbar.d.ts +5 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/next-editor-plugin.d.ts +5 -4
- package/dist/types/ui/EventHandlers/index.d.ts +2 -2
- package/dist/types/ui-color/ColorPalette/Palettes/borderColorPalette.d.ts +3 -0
- package/dist/types/ui-color/ColorPalette/Palettes/index.d.ts +1 -1
- package/dist/types/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.d.ts +36 -0
- package/dist/types/ui-color/index.d.ts +2 -1
- package/package.json +9 -8
- package/report.api.md +1 -1
- package/dist/types/messages/codeBlockCopyButton.d.ts +0 -12
|
@@ -9,7 +9,7 @@ import type { EditorPlugin } from './editor-plugin';
|
|
|
9
9
|
declare type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
10
10
|
declare type PickSharedStatePropertyName<Metadata extends NextEditorPluginMetadata> = IsAny<Metadata> extends true ? never : ExtractSharedStateFromMetadata<Metadata> extends never ? never : 'getSharedState';
|
|
11
11
|
declare type WithSharedState<Metadata extends NextEditorPluginMetadata> = {
|
|
12
|
-
[Property in keyof Pick<Metadata, 'sharedState'> as PickSharedStatePropertyName<Metadata>]: (editorState: EditorState) => ExtractSharedStateFromMetadata<Metadata>;
|
|
12
|
+
[Property in keyof Pick<Metadata, 'sharedState'> as PickSharedStatePropertyName<Metadata>]: (editorState: EditorState | undefined) => ExtractSharedStateFromMetadata<Metadata>;
|
|
13
13
|
};
|
|
14
14
|
declare type PickActionsPropertyName<Metadata extends NextEditorPluginMetadata> = IsAny<Metadata> extends true ? never : ExtractActionsFromMetadata<Metadata> extends never ? never : 'actions';
|
|
15
15
|
declare type WithActions<Metadata extends NextEditorPluginMetadata> = {
|
|
@@ -27,7 +27,7 @@ export interface NextEditorPluginMetadata {
|
|
|
27
27
|
readonly actions?: NextEditorPluginActions;
|
|
28
28
|
}
|
|
29
29
|
export declare type PluginInjectionAPI<Name extends string, Metadata extends NextEditorPluginMetadata> = {
|
|
30
|
-
|
|
30
|
+
dependencies: CreatePluginDependenciesAPI<[
|
|
31
31
|
NextEditorPlugin<Name, Metadata>,
|
|
32
32
|
...ExtractPluginDependenciesFromMetadata<Metadata>
|
|
33
33
|
]>;
|
|
@@ -51,7 +51,7 @@ declare type ExtractActionsFromMetadata<Metadata> = 'actions' extends keyof Meta
|
|
|
51
51
|
declare type ExtractPluginConfigurationFromMetadata<Metadata> = 'pluginConfiguration' extends keyof Metadata ? Metadata['pluginConfiguration'] : never;
|
|
52
52
|
export declare type ExtractPluginDependencies<Plugin> = Plugin extends NextEditorPlugin<any, any> ? Plugin extends (config: any, api: any) => DefaultEditorPlugin<any, infer Metadata> ? ExtractPluginDependenciesFromMetadataWithoutOptionals<Metadata> : never : never;
|
|
53
53
|
declare type ExtractPluginConfiguration<Plugin> = Plugin extends NextEditorPlugin<any, any> ? Plugin extends (config: any, api: any) => DefaultEditorPlugin<any, infer Metadata> ? ExtractPluginConfigurationFromMetadata<Metadata> : never : never;
|
|
54
|
-
declare type ExtractPluginSharedState<Plugin> = Plugin extends NextEditorPlugin<any, any> ? Plugin extends (config: any, api: any) => DefaultEditorPlugin<any, infer Metadata> ? ExtractSharedStateFromMetadata<Metadata> : never : never;
|
|
54
|
+
export declare type ExtractPluginSharedState<Plugin> = Plugin extends NextEditorPlugin<any, any> ? Plugin extends (config: any, api: any) => DefaultEditorPlugin<any, infer Metadata> ? ExtractSharedStateFromMetadata<Metadata> : never : never;
|
|
55
55
|
declare type ExtractPluginActions<Plugin> = Plugin extends NextEditorPlugin<any, any> ? Plugin extends (config: any, api: any) => DefaultEditorPlugin<any, infer Metadata> ? ExtractActionsFromMetadata<Metadata> : never : never;
|
|
56
56
|
declare type ExtractPluginName<Plugin> = Plugin extends NextEditorPlugin<any, any> ? Plugin extends (...args: any) => DefaultEditorPlugin<infer PluginName, any> ? PluginName : never : never;
|
|
57
57
|
declare type Unsubscribe = () => void;
|
|
@@ -66,7 +66,7 @@ export declare type PluginDependenciesAPI<Plugin extends NextEditorPlugin<any, a
|
|
|
66
66
|
actions: ExtractPluginActions<Plugin>;
|
|
67
67
|
};
|
|
68
68
|
export declare type CreatePluginDependenciesAPI<PluginList extends NextEditorPlugin<any, any>[]> = {
|
|
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;
|
|
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
71
|
export declare type PluginAsArray<Plugin> = undefined extends ExtractPluginConfiguration<Plugin> ? [Plugin, ExtractPluginConfiguration<Plugin>?] : [Plugin, ExtractPluginConfiguration<Plugin>];
|
|
72
72
|
export declare type AllEditorPresetPluginTypes = PluginAsArray<any> | NextEditorPlugin<any, any>;
|
|
@@ -91,4 +91,5 @@ declare type CheckTupleRequirements<Plugin, Config, ArrayType> = unknown extends
|
|
|
91
91
|
] extends [never] ? Plugin : ArrayType;
|
|
92
92
|
declare type CheckBasicPlugin<Plugin> = Plugin extends (args: any, api: any) => EditorPlugin ? CheckTupleRequirements<Plugin, ExtractPluginConfiguration<Plugin>, PluginAsArray<Plugin>> : never;
|
|
93
93
|
export declare 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 declare type ExtractInjectionAPI<Plugin> = Plugin extends NextEditorPlugin<infer Name, infer Metadata> ? PluginInjectionAPI<Name, Metadata> : never;
|
|
94
95
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { SyntheticEvent } from 'react';
|
|
2
|
-
import type { CardEvent } from '@atlaskit/media-card';
|
|
2
|
+
import type { CardEvent, InlineCardEvent } from '@atlaskit/media-card';
|
|
3
3
|
import type { Identifier } from '@atlaskit/media-client';
|
|
4
4
|
export interface CardSurroundings {
|
|
5
5
|
collectionName: string;
|
|
6
6
|
list: Identifier[];
|
|
7
7
|
}
|
|
8
8
|
export declare type MentionEventHandler = (mentionId: string, text: string, event?: SyntheticEvent<HTMLSpanElement>) => void;
|
|
9
|
-
export declare type CardEventClickHandler = (result: CardEvent, surroundings?: CardSurroundings, analyticsEvent?: any) => void;
|
|
9
|
+
export declare type CardEventClickHandler = (result: CardEvent | InlineCardEvent, surroundings?: CardSurroundings, analyticsEvent?: any) => void;
|
|
10
10
|
export declare type LinkEventClickHandler = (event: SyntheticEvent<HTMLAnchorElement>, url?: string) => void;
|
|
11
11
|
export declare type SmartCardEventClickHandler = (event: SyntheticEvent<HTMLAnchorElement>, url?: string) => void;
|
|
12
12
|
export declare type OnUnhandledClickHandler = (event: React.MouseEvent) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type { PaletteColor } from './type';
|
|
2
2
|
export { DEFAULT_BORDER_COLOR } from './common';
|
|
3
|
-
export { textPaletteTooltipMessages, backgroundPaletteTooltipMessages, } from './paletteMessagesTokenModeNames';
|
|
3
|
+
export { textPaletteTooltipMessages, backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, } from './paletteMessagesTokenModeNames';
|
|
@@ -858,3 +858,39 @@ export declare const backgroundPaletteTooltipMessages: {
|
|
|
858
858
|
};
|
|
859
859
|
};
|
|
860
860
|
};
|
|
861
|
+
export declare const borderPaletteTooltipMessages: {
|
|
862
|
+
light: {
|
|
863
|
+
'#091E4224': {
|
|
864
|
+
id: string;
|
|
865
|
+
defaultMessage: string;
|
|
866
|
+
description: string;
|
|
867
|
+
};
|
|
868
|
+
'#758195': {
|
|
869
|
+
id: string;
|
|
870
|
+
defaultMessage: string;
|
|
871
|
+
description: string;
|
|
872
|
+
};
|
|
873
|
+
'#172B4D': {
|
|
874
|
+
id: string;
|
|
875
|
+
defaultMessage: string;
|
|
876
|
+
description: string;
|
|
877
|
+
};
|
|
878
|
+
};
|
|
879
|
+
dark: {
|
|
880
|
+
'#091E4224': {
|
|
881
|
+
id: string;
|
|
882
|
+
defaultMessage: string;
|
|
883
|
+
description: string;
|
|
884
|
+
};
|
|
885
|
+
'#758195': {
|
|
886
|
+
id: string;
|
|
887
|
+
defaultMessage: string;
|
|
888
|
+
description: string;
|
|
889
|
+
};
|
|
890
|
+
'#172B4D': {
|
|
891
|
+
id: string;
|
|
892
|
+
defaultMessage: string;
|
|
893
|
+
description: string;
|
|
894
|
+
};
|
|
895
|
+
};
|
|
896
|
+
};
|
|
@@ -6,6 +6,7 @@ export { default as colorPaletteMessages } from './ColorPalette/Palettes/palette
|
|
|
6
6
|
export { panelBackgroundPalette, panelDarkModeBackgroundPalette, } from './ColorPalette/Palettes/panelBackgroundPalette';
|
|
7
7
|
export { lightModeStatusColorPalette, darkModeStatusColorPalette, } from './ColorPalette/Palettes/statusColorPalette';
|
|
8
8
|
export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
|
|
9
|
-
export { backgroundPaletteTooltipMessages, textPaletteTooltipMessages, } from './ColorPalette/Palettes';
|
|
9
|
+
export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, textPaletteTooltipMessages, } from './ColorPalette/Palettes';
|
|
10
10
|
export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
|
|
11
11
|
export type { PaletteColor, PaletteTooltipMessages, } from './ColorPalette/Palettes/type';
|
|
12
|
+
export { default as borderColorPalette } from './ColorPalette/Palettes/borderColorPalette';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "72.
|
|
3
|
+
"version": "72.7.0",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@atlaskit/activity-provider": "^2.3.0",
|
|
62
|
-
"@atlaskit/adf-schema": "^25.
|
|
63
|
-
"@atlaskit/adf-utils": "^18.
|
|
62
|
+
"@atlaskit/adf-schema": "^25.4.0",
|
|
63
|
+
"@atlaskit/adf-utils": "^18.1.0",
|
|
64
64
|
"@atlaskit/analytics-listeners": "^8.5.0",
|
|
65
65
|
"@atlaskit/analytics-namespaced-context": "^6.6.0",
|
|
66
66
|
"@atlaskit/analytics-next": "^9.0.0",
|
|
@@ -69,14 +69,14 @@
|
|
|
69
69
|
"@atlaskit/code": "^14.5.0",
|
|
70
70
|
"@atlaskit/codemod-utils": "^4.1.0",
|
|
71
71
|
"@atlaskit/editor-json-transformer": "^8.8.0",
|
|
72
|
-
"@atlaskit/editor-palette": "1.
|
|
72
|
+
"@atlaskit/editor-palette": "1.2.0",
|
|
73
73
|
"@atlaskit/editor-shared-styles": "^2.3.0",
|
|
74
|
-
"@atlaskit/emoji": "^67.
|
|
74
|
+
"@atlaskit/emoji": "^67.3.0",
|
|
75
75
|
"@atlaskit/icon": "^21.11.0",
|
|
76
76
|
"@atlaskit/in-product-testing": "^0.1.0",
|
|
77
77
|
"@atlaskit/media-card": "^74.7.0",
|
|
78
78
|
"@atlaskit/media-client": "^20.2.0",
|
|
79
|
-
"@atlaskit/media-picker": "^64.
|
|
79
|
+
"@atlaskit/media-picker": "^64.3.0",
|
|
80
80
|
"@atlaskit/mention": "^22.0.0",
|
|
81
81
|
"@atlaskit/menu": "^1.5.0",
|
|
82
82
|
"@atlaskit/profilecard": "^19.2.0",
|
|
@@ -117,10 +117,11 @@
|
|
|
117
117
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
118
118
|
},
|
|
119
119
|
"devDependencies": {
|
|
120
|
-
"@atlaskit/editor-core": "^
|
|
120
|
+
"@atlaskit/editor-core": "^182.0.0",
|
|
121
121
|
"@atlaskit/editor-json-transformer": "^8.8.0",
|
|
122
|
+
"@atlaskit/editor-plugin-feature-flags": "^0.0.2",
|
|
122
123
|
"@atlaskit/editor-plugin-table": "^1.2.0",
|
|
123
|
-
"@atlaskit/editor-test-helpers": "^18.
|
|
124
|
+
"@atlaskit/editor-test-helpers": "^18.2.0",
|
|
124
125
|
"@atlaskit/media-core": "^34.0.0",
|
|
125
126
|
"@atlaskit/util-data-test": "^17.7.0",
|
|
126
127
|
"@atlaskit/visual-regression": "*",
|
package/report.api.md
CHANGED