@atlaskit/editor-plugin-user-preferences 6.0.23 → 6.0.25
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 +14 -0
- package/README.md +52 -1
- package/docs/0-intro.tsx +34 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-user-preferences
|
|
2
2
|
|
|
3
|
+
## 6.0.25
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9ff7d1c1aa288`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9ff7d1c1aa288) -
|
|
8
|
+
Update README.md and 0-intro.tsx
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 6.0.24
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 6.0.23
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1 +1,52 @@
|
|
|
1
|
-
# Editor
|
|
1
|
+
# Editor Plugin User Preferences
|
|
2
|
+
|
|
3
|
+
User Preferences plugin for @atlaskit/editor-core
|
|
4
|
+
|
|
5
|
+
**Note:** This component is designed for internal Atlassian development.
|
|
6
|
+
External contributors will be able to use this component but will not be able to submit issues.
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
The User Preferences plugin provides comprehensive user preference management capabilities for the Atlassian Editor. It integrates with a UserPreferencesProvider to capture, persist, and manage user preferences across editor sessions. The plugin supports preference updates, retrieval, and automatic synchronization with the editor state.
|
|
11
|
+
|
|
12
|
+
## Key features
|
|
13
|
+
|
|
14
|
+
- **Preference management** - Get and update user preferences with a consistent API
|
|
15
|
+
- **Persistent storage** - Optional integration with UserPreferencesProvider for preference persistence
|
|
16
|
+
- **In-memory mode** - Operates without a provider when persistence is not available
|
|
17
|
+
- **Event tracking** - Integration with analytics plugin for preference update tracking
|
|
18
|
+
- **Hooks integration** - React hooks for listening to preference changes and document visibility
|
|
19
|
+
- **Flexible configuration** - Configure initial preferences and provide a custom preferences provider
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
- **Install** - *yarn add @atlaskit/editor-plugin-user-preferences*
|
|
26
|
+
- **npm** - [@atlaskit/editor-plugin-user-preferences](https://www.npmjs.com/package/@atlaskit/editor-plugin-user-preferences)
|
|
27
|
+
- **Source** - [Bitbucket](https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/editor/editor-plugin-user-preferences)
|
|
28
|
+
- **Bundle** - [unpkg.com](https://unpkg.com/@atlaskit/editor-plugin-user-preferences/dist/)
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
**Internal use only**
|
|
35
|
+
|
|
36
|
+
@atlaskit/editor-plugin-user-preferences is intended for internal use by the @atlaskit/editor-core and as a plugin dependency of the Editor within your product.
|
|
37
|
+
|
|
38
|
+
Direct use of this component is not supported.
|
|
39
|
+
|
|
40
|
+
Please see [Atlaskit - Editor plugin user preferences](https://atlaskit.atlassian.com/packages/editor/editor-plugin-user-preferences) for documentation and examples for this package.
|
|
41
|
+
|
|
42
|
+
## Support
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#License) for more licensing information.
|
package/docs/0-intro.tsx
CHANGED
|
@@ -31,7 +31,40 @@ The \`dependencies\`, \`configuration\`, \`state\`, \`actions\`, and \`commands\
|
|
|
31
31
|
below:
|
|
32
32
|
|
|
33
33
|
${code`
|
|
34
|
-
type
|
|
34
|
+
type UserPreferencesPluginOptions = {
|
|
35
|
+
/**
|
|
36
|
+
* The initial user preferences to be used when the userPreferencesProvider is not available.
|
|
37
|
+
* Otherwise, will default to the userPreferencesProvider's initial preferences.
|
|
38
|
+
*/
|
|
39
|
+
initialUserPreferences?: ResolvedUserPreferences;
|
|
40
|
+
/**
|
|
41
|
+
* The user preferences provider to be used to get and set user preferences.
|
|
42
|
+
* When not provided, user preferences will not be persisted.
|
|
43
|
+
*/
|
|
44
|
+
userPreferencesProvider?: UserPreferencesProvider;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type PrefKey = keyof UserPreferences;
|
|
48
|
+
type ResolvedPrefKey = keyof ResolvedUserPreferences;
|
|
49
|
+
type UserPreferencesSharedState = {
|
|
50
|
+
preferences: ResolvedUserPreferences;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
type UserPreferencesPlugin = NextEditorPlugin<
|
|
54
|
+
'userPreferences',
|
|
55
|
+
{
|
|
56
|
+
actions: {
|
|
57
|
+
getUserPreferences: () => ResolvedUserPreferences | undefined;
|
|
58
|
+
updateUserPreference: (
|
|
59
|
+
key: PrefKey,
|
|
60
|
+
value: ResolvedUserPreferences[PrefKey],
|
|
61
|
+
) => EditorCommand;
|
|
62
|
+
};
|
|
63
|
+
dependencies: [OptionalPlugin<AnalyticsPlugin>];
|
|
64
|
+
pluginConfiguration: UserPreferencesPluginOptions;
|
|
65
|
+
sharedState: UserPreferencesSharedState;
|
|
66
|
+
}
|
|
67
|
+
>;
|
|
35
68
|
`}
|
|
36
69
|
|
|
37
70
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-user-preferences",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.25",
|
|
4
4
|
"description": "UserPreferences plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/editor-plugin-analytics": "^8.0.0",
|
|
32
32
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
33
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
33
|
+
"@atlaskit/tmp-editor-statsig": "^58.0.0",
|
|
34
34
|
"@babel/runtime": "^7.0.0",
|
|
35
35
|
"bind-event-listener": "^3.0.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@atlaskit/editor-common": "^112.
|
|
38
|
+
"@atlaskit/editor-common": "^112.19.0",
|
|
39
39
|
"react": "^18.2.0"
|
|
40
40
|
},
|
|
41
41
|
"techstack": {
|