@atlaskit/editor-plugin-user-preferences 1.2.2 → 1.2.4
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 +15 -0
- package/dist/cjs/userPreferencesPlugin.js +6 -0
- package/dist/es2019/userPreferencesPlugin.js +6 -0
- package/dist/esm/userPreferencesPlugin.js +6 -0
- package/dist/types/pm-plugins/commands.d.ts +2 -2
- package/dist/types/userPreferencesPluginType.d.ts +8 -7
- package/dist/types-ts4.5/pm-plugins/commands.d.ts +2 -2
- package/dist/types-ts4.5/userPreferencesPluginType.d.ts +8 -7
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-user-preferences
|
|
2
2
|
|
|
3
|
+
## 1.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
|
|
8
|
+
Sorted type and interface props to improve Atlaskit docs
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 1.2.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`4bc05c9f87780`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4bc05c9f87780) -
|
|
16
|
+
[ux] Fix toolbar blink CLS regression
|
|
17
|
+
|
|
3
18
|
## 1.2.2
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -33,6 +33,12 @@ var userPreferencesPlugin = exports.userPreferencesPlugin = function userPrefere
|
|
|
33
33
|
userPreferencesProvider: userPreferencesProvider,
|
|
34
34
|
editorAnalyticsApi: api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions
|
|
35
35
|
});
|
|
36
|
+
},
|
|
37
|
+
getUserPreferences: function getUserPreferences() {
|
|
38
|
+
if (!userPreferencesProvider) {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
return userPreferencesProvider.getPreferences();
|
|
36
42
|
}
|
|
37
43
|
},
|
|
38
44
|
getSharedState: function getSharedState(editorState) {
|
|
@@ -28,6 +28,12 @@ export const userPreferencesPlugin = ({
|
|
|
28
28
|
userPreferencesProvider,
|
|
29
29
|
editorAnalyticsApi: api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions
|
|
30
30
|
});
|
|
31
|
+
},
|
|
32
|
+
getUserPreferences: () => {
|
|
33
|
+
if (!userPreferencesProvider) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
return userPreferencesProvider.getPreferences();
|
|
31
37
|
}
|
|
32
38
|
},
|
|
33
39
|
getSharedState(editorState) {
|
|
@@ -27,6 +27,12 @@ export var userPreferencesPlugin = function userPreferencesPlugin(_ref) {
|
|
|
27
27
|
userPreferencesProvider: userPreferencesProvider,
|
|
28
28
|
editorAnalyticsApi: api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions
|
|
29
29
|
});
|
|
30
|
+
},
|
|
31
|
+
getUserPreferences: function getUserPreferences() {
|
|
32
|
+
if (!userPreferencesProvider) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
return userPreferencesProvider.getPreferences();
|
|
30
36
|
}
|
|
31
37
|
},
|
|
32
38
|
getSharedState: function getSharedState(editorState) {
|
|
@@ -2,8 +2,8 @@ import { type EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
2
2
|
import type { EditorCommand } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { type ResolvedUserPreferences, type UserPreferences, type UserPreferencesProvider } from '@atlaskit/editor-common/user-preferences';
|
|
4
4
|
export declare const updateUserPreference: ({ key, value, userPreferencesProvider, editorAnalyticsApi, }: {
|
|
5
|
+
editorAnalyticsApi?: EditorAnalyticsAPI | undefined;
|
|
5
6
|
key: keyof UserPreferences;
|
|
6
|
-
value: ResolvedUserPreferences[typeof key];
|
|
7
7
|
userPreferencesProvider?: UserPreferencesProvider;
|
|
8
|
-
|
|
8
|
+
value: ResolvedUserPreferences[typeof key];
|
|
9
9
|
}) => EditorCommand;
|
|
@@ -2,16 +2,16 @@ import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/
|
|
|
2
2
|
import { type ResolvedUserPreferences, type UserPreferencesProvider, type UserPreferences } from '@atlaskit/editor-common/user-preferences';
|
|
3
3
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
4
|
export type UserPreferencesPluginOptions = {
|
|
5
|
-
/**
|
|
6
|
-
* The user preferences provider to be used to get and set user preferences.
|
|
7
|
-
* When not provided, user preferences will not be persisted.
|
|
8
|
-
*/
|
|
9
|
-
userPreferencesProvider?: UserPreferencesProvider;
|
|
10
5
|
/**
|
|
11
6
|
* The initial user preferences to be used when the userPreferencesProvider is not available.
|
|
12
7
|
* Otherwise, will default to the userPreferencesProvider's initial preferences.
|
|
13
8
|
*/
|
|
14
9
|
initialUserPreferences?: ResolvedUserPreferences;
|
|
10
|
+
/**
|
|
11
|
+
* The user preferences provider to be used to get and set user preferences.
|
|
12
|
+
* When not provided, user preferences will not be persisted.
|
|
13
|
+
*/
|
|
14
|
+
userPreferencesProvider?: UserPreferencesProvider;
|
|
15
15
|
};
|
|
16
16
|
export type PrefKey = keyof UserPreferences;
|
|
17
17
|
export type ResolvedPrefKey = keyof ResolvedUserPreferences;
|
|
@@ -19,10 +19,11 @@ export type UserPreferencesSharedState = {
|
|
|
19
19
|
preferences: ResolvedUserPreferences;
|
|
20
20
|
};
|
|
21
21
|
export type UserPreferencesPlugin = NextEditorPlugin<'userPreferences', {
|
|
22
|
-
pluginConfiguration: UserPreferencesPluginOptions;
|
|
23
22
|
actions: {
|
|
23
|
+
getUserPreferences: () => ResolvedUserPreferences | undefined;
|
|
24
24
|
updateUserPreference: (key: PrefKey, value: ResolvedUserPreferences[PrefKey]) => EditorCommand;
|
|
25
25
|
};
|
|
26
|
-
sharedState: UserPreferencesSharedState;
|
|
27
26
|
dependencies: [OptionalPlugin<AnalyticsPlugin>];
|
|
27
|
+
pluginConfiguration: UserPreferencesPluginOptions;
|
|
28
|
+
sharedState: UserPreferencesSharedState;
|
|
28
29
|
}>;
|
|
@@ -2,8 +2,8 @@ import { type EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
2
2
|
import type { EditorCommand } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { type ResolvedUserPreferences, type UserPreferences, type UserPreferencesProvider } from '@atlaskit/editor-common/user-preferences';
|
|
4
4
|
export declare const updateUserPreference: ({ key, value, userPreferencesProvider, editorAnalyticsApi, }: {
|
|
5
|
+
editorAnalyticsApi?: EditorAnalyticsAPI | undefined;
|
|
5
6
|
key: keyof UserPreferences;
|
|
6
|
-
value: ResolvedUserPreferences[typeof key];
|
|
7
7
|
userPreferencesProvider?: UserPreferencesProvider;
|
|
8
|
-
|
|
8
|
+
value: ResolvedUserPreferences[typeof key];
|
|
9
9
|
}) => EditorCommand;
|
|
@@ -2,16 +2,16 @@ import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/
|
|
|
2
2
|
import { type ResolvedUserPreferences, type UserPreferencesProvider, type UserPreferences } from '@atlaskit/editor-common/user-preferences';
|
|
3
3
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
4
|
export type UserPreferencesPluginOptions = {
|
|
5
|
-
/**
|
|
6
|
-
* The user preferences provider to be used to get and set user preferences.
|
|
7
|
-
* When not provided, user preferences will not be persisted.
|
|
8
|
-
*/
|
|
9
|
-
userPreferencesProvider?: UserPreferencesProvider;
|
|
10
5
|
/**
|
|
11
6
|
* The initial user preferences to be used when the userPreferencesProvider is not available.
|
|
12
7
|
* Otherwise, will default to the userPreferencesProvider's initial preferences.
|
|
13
8
|
*/
|
|
14
9
|
initialUserPreferences?: ResolvedUserPreferences;
|
|
10
|
+
/**
|
|
11
|
+
* The user preferences provider to be used to get and set user preferences.
|
|
12
|
+
* When not provided, user preferences will not be persisted.
|
|
13
|
+
*/
|
|
14
|
+
userPreferencesProvider?: UserPreferencesProvider;
|
|
15
15
|
};
|
|
16
16
|
export type PrefKey = keyof UserPreferences;
|
|
17
17
|
export type ResolvedPrefKey = keyof ResolvedUserPreferences;
|
|
@@ -19,12 +19,13 @@ export type UserPreferencesSharedState = {
|
|
|
19
19
|
preferences: ResolvedUserPreferences;
|
|
20
20
|
};
|
|
21
21
|
export type UserPreferencesPlugin = NextEditorPlugin<'userPreferences', {
|
|
22
|
-
pluginConfiguration: UserPreferencesPluginOptions;
|
|
23
22
|
actions: {
|
|
23
|
+
getUserPreferences: () => ResolvedUserPreferences | undefined;
|
|
24
24
|
updateUserPreference: (key: PrefKey, value: ResolvedUserPreferences[PrefKey]) => EditorCommand;
|
|
25
25
|
};
|
|
26
|
-
sharedState: UserPreferencesSharedState;
|
|
27
26
|
dependencies: [
|
|
28
27
|
OptionalPlugin<AnalyticsPlugin>
|
|
29
28
|
];
|
|
29
|
+
pluginConfiguration: UserPreferencesPluginOptions;
|
|
30
|
+
sharedState: UserPreferencesSharedState;
|
|
30
31
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-user-preferences",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "UserPreferences plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"@atlaskit/editor-plugin-analytics": "^3.0.0",
|
|
35
35
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
36
36
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
37
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
37
|
+
"@atlaskit/tmp-editor-statsig": "^11.5.0",
|
|
38
38
|
"@babel/runtime": "^7.0.0",
|
|
39
39
|
"bind-event-listener": "^3.0.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@atlaskit/editor-common": "^107.
|
|
42
|
+
"@atlaskit/editor-common": "^107.28.0",
|
|
43
43
|
"react": "^18.2.0"
|
|
44
44
|
},
|
|
45
45
|
"techstack": {
|