@atlaskit/editor-common 105.2.2 → 105.2.3
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 +12 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/resizer/BreakoutResizer.js +13 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/user-preferences/hooks.js +5 -0
- package/dist/cjs/user-preferences/user-preferences-provider.js +21 -0
- package/dist/cjs/utils/imageLoader.js +62 -27
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/resizer/BreakoutResizer.js +13 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/user-preferences/hooks.js +5 -0
- package/dist/es2019/user-preferences/user-preferences-provider.js +21 -0
- package/dist/es2019/utils/imageLoader.js +58 -25
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/resizer/BreakoutResizer.js +13 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/user-preferences/hooks.js +5 -0
- package/dist/esm/user-preferences/user-preferences-provider.js +21 -0
- package/dist/esm/utils/imageLoader.js +62 -27
- package/dist/types/analytics/types/alignment-events.d.ts +1 -1
- package/dist/types/analytics/types/events.d.ts +1 -1
- package/dist/types/card/MediaAndEmbedsToolbar/index.d.ts +1 -1
- package/dist/types/collab/index.d.ts +1 -0
- package/dist/types/resizer/BreakoutResizer.d.ts +14 -1
- package/dist/types/resizer/ResizerBreakoutModeLabel.d.ts +1 -1
- package/dist/types/user-preferences/hooks.d.ts +5 -0
- package/dist/types/user-preferences/persistence-api.d.ts +1 -1
- package/dist/types/user-preferences/user-preferences-provider.d.ts +21 -2
- package/dist/types-ts4.5/analytics/types/alignment-events.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/events.d.ts +1 -1
- package/dist/types-ts4.5/card/MediaAndEmbedsToolbar/index.d.ts +1 -1
- package/dist/types-ts4.5/collab/index.d.ts +1 -0
- package/dist/types-ts4.5/resizer/BreakoutResizer.d.ts +14 -1
- package/dist/types-ts4.5/resizer/ResizerBreakoutModeLabel.d.ts +1 -1
- package/dist/types-ts4.5/user-preferences/hooks.d.ts +5 -0
- package/dist/types-ts4.5/user-preferences/persistence-api.d.ts +1 -1
- package/dist/types-ts4.5/user-preferences/user-preferences-provider.d.ts +21 -2
- package/package.json +9 -9
|
@@ -6,11 +6,15 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
9
12
|
export var UserPreferencesProvider = /*#__PURE__*/function () {
|
|
10
13
|
/**
|
|
11
14
|
* @param persistenceAPI - The persistence API to use for loading and updating user preferences
|
|
12
15
|
* @param defaultPreferences - The default user preferences to use
|
|
13
16
|
* @param initialUserPreferences - The initial user preferences to use (optional)
|
|
17
|
+
* @example
|
|
14
18
|
*/
|
|
15
19
|
function UserPreferencesProvider(persistenceAPI, defaultPreferences) {
|
|
16
20
|
var _this$persistenceAPI$, _this$persistenceAPI;
|
|
@@ -28,6 +32,10 @@ export var UserPreferencesProvider = /*#__PURE__*/function () {
|
|
|
28
32
|
this.loadPreferences();
|
|
29
33
|
}
|
|
30
34
|
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
31
39
|
return _createClass(UserPreferencesProvider, [{
|
|
32
40
|
key: "isInitialized",
|
|
33
41
|
get: function get() {
|
|
@@ -38,6 +46,7 @@ export var UserPreferencesProvider = /*#__PURE__*/function () {
|
|
|
38
46
|
* This method fetches the latest user preferences
|
|
39
47
|
* @returns a promise that resolves with the user preferences, or rejects if error occurs
|
|
40
48
|
* @throws Error if there is an error loading user preferences
|
|
49
|
+
* @example
|
|
41
50
|
*/
|
|
42
51
|
}, {
|
|
43
52
|
key: "loadPreferences",
|
|
@@ -69,6 +78,7 @@ export var UserPreferencesProvider = /*#__PURE__*/function () {
|
|
|
69
78
|
* @param value
|
|
70
79
|
* @returns a promise that resolves when the user preference is updated
|
|
71
80
|
* @throws Error if there is an error updating user preferences
|
|
81
|
+
* @example
|
|
72
82
|
*/
|
|
73
83
|
)
|
|
74
84
|
}, {
|
|
@@ -99,6 +109,7 @@ export var UserPreferencesProvider = /*#__PURE__*/function () {
|
|
|
99
109
|
* get a user preference, Note that this function is a not async function,
|
|
100
110
|
* meaning that consumers should prefetch the user preference and make it available initially
|
|
101
111
|
* @param key
|
|
112
|
+
* @example
|
|
102
113
|
*/
|
|
103
114
|
)
|
|
104
115
|
}, {
|
|
@@ -109,6 +120,7 @@ export var UserPreferencesProvider = /*#__PURE__*/function () {
|
|
|
109
120
|
|
|
110
121
|
/**
|
|
111
122
|
* get all user preferences
|
|
123
|
+
* @example
|
|
112
124
|
*/
|
|
113
125
|
}, {
|
|
114
126
|
key: "getPreferences",
|
|
@@ -118,7 +130,9 @@ export var UserPreferencesProvider = /*#__PURE__*/function () {
|
|
|
118
130
|
|
|
119
131
|
/**
|
|
120
132
|
* This method fetches the latest user preferences
|
|
133
|
+
* @param onUpdate
|
|
121
134
|
* @returns a function to unsubscribe from the updates
|
|
135
|
+
* @example
|
|
122
136
|
*/
|
|
123
137
|
}, {
|
|
124
138
|
key: "onUpdate",
|
|
@@ -139,6 +153,7 @@ export var UserPreferencesProvider = /*#__PURE__*/function () {
|
|
|
139
153
|
* setting the default user preferences will also trigger an update
|
|
140
154
|
* This is useful when the default user preferences dynamically based on the context
|
|
141
155
|
* @param preferences
|
|
156
|
+
* @example
|
|
142
157
|
*/
|
|
143
158
|
}, {
|
|
144
159
|
key: "setDefaultPreferences",
|
|
@@ -161,6 +176,11 @@ export var UserPreferencesProvider = /*#__PURE__*/function () {
|
|
|
161
176
|
this.initialized = true;
|
|
162
177
|
}
|
|
163
178
|
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
*/
|
|
164
184
|
}, {
|
|
165
185
|
key: "notifyUserPreferencesUpdated",
|
|
166
186
|
value: function notifyUserPreferencesUpdated() {
|
|
@@ -175,6 +195,7 @@ export var UserPreferencesProvider = /*#__PURE__*/function () {
|
|
|
175
195
|
* with the user preferences and filtering out any undefined or null values
|
|
176
196
|
* to avoid overwriting default preferences with null values
|
|
177
197
|
* @returns true if the user preferences were updated, false otherwise
|
|
198
|
+
* @example
|
|
178
199
|
*/
|
|
179
200
|
}, {
|
|
180
201
|
key: "resolveUserPreferences",
|
|
@@ -43,10 +43,20 @@ export var withImageLoaderOld = function withImageLoaderOld(Wrapped) {
|
|
|
43
43
|
_inherits(WithImageLoader, _Component);
|
|
44
44
|
return _createClass(WithImageLoader, [{
|
|
45
45
|
key: "componentDidMount",
|
|
46
|
-
value:
|
|
46
|
+
value:
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
*/
|
|
51
|
+
function componentDidMount() {
|
|
47
52
|
this.fetchImage(this.props);
|
|
48
53
|
}
|
|
49
54
|
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* @param nextProps
|
|
58
|
+
* @example
|
|
59
|
+
*/
|
|
50
60
|
// Ignored via go/ees005
|
|
51
61
|
// eslint-disable-next-line react/no-unsafe
|
|
52
62
|
}, {
|
|
@@ -59,19 +69,33 @@ export var withImageLoaderOld = function withImageLoaderOld(Wrapped) {
|
|
|
59
69
|
this.fetchImage(nextProps);
|
|
60
70
|
}
|
|
61
71
|
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
*/
|
|
62
77
|
}, {
|
|
63
78
|
key: "componentWillUnmount",
|
|
64
79
|
value: function componentWillUnmount() {
|
|
65
80
|
if (this.img) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
81
|
+
if (!process.env.REACT_SSR) {
|
|
82
|
+
// Ignored via go/ees005
|
|
83
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
84
|
+
this.img.removeEventListener('load', this.onLoad);
|
|
85
|
+
// Ignored via go/ees005
|
|
86
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
87
|
+
this.img.removeEventListener('error', this.onError);
|
|
88
|
+
this.img = null;
|
|
89
|
+
}
|
|
73
90
|
}
|
|
74
91
|
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
*
|
|
95
|
+
* @param root0
|
|
96
|
+
* @param root0.url
|
|
97
|
+
* @example
|
|
98
|
+
*/
|
|
75
99
|
}, {
|
|
76
100
|
key: "fetchImage",
|
|
77
101
|
value: function fetchImage(_ref) {
|
|
@@ -79,19 +103,26 @@ export var withImageLoaderOld = function withImageLoaderOld(Wrapped) {
|
|
|
79
103
|
if (url) {
|
|
80
104
|
if (!this.img) {
|
|
81
105
|
this.img = new Image();
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
106
|
+
if (!process.env.REACT_SSR) {
|
|
107
|
+
// Ignored via go/ees005
|
|
108
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
109
|
+
this.img.addEventListener('load', this.onLoad);
|
|
110
|
+
// Ignored via go/ees005
|
|
111
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
112
|
+
this.img.addEventListener('error', this.onError);
|
|
113
|
+
}
|
|
88
114
|
}
|
|
89
115
|
this.img.src = url;
|
|
90
116
|
}
|
|
91
117
|
}
|
|
92
118
|
}, {
|
|
93
119
|
key: "render",
|
|
94
|
-
value:
|
|
120
|
+
value:
|
|
121
|
+
/**
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
*/
|
|
125
|
+
function render() {
|
|
95
126
|
var imageStatus = this.state.imageStatus;
|
|
96
127
|
// Ignored via go/ees005
|
|
97
128
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -153,12 +184,14 @@ var withImageLoaderNew = function withImageLoaderNew(Wrapped) {
|
|
|
153
184
|
key: "componentWillUnmount",
|
|
154
185
|
value: function componentWillUnmount() {
|
|
155
186
|
if (this.img) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
187
|
+
if (!process.env.REACT_SSR) {
|
|
188
|
+
// Ignored via go/ees005
|
|
189
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
190
|
+
this.img.removeEventListener('load', this.onLoad);
|
|
191
|
+
// Ignored via go/ees005
|
|
192
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
193
|
+
this.img.removeEventListener('error', this.onError);
|
|
194
|
+
}
|
|
162
195
|
this.img = null;
|
|
163
196
|
}
|
|
164
197
|
}
|
|
@@ -169,12 +202,14 @@ var withImageLoaderNew = function withImageLoaderNew(Wrapped) {
|
|
|
169
202
|
if (url) {
|
|
170
203
|
if (!this.img) {
|
|
171
204
|
this.img = new Image();
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
205
|
+
if (!process.env.REACT_SSR) {
|
|
206
|
+
// Ignored via go/ees005
|
|
207
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
208
|
+
this.img.addEventListener('load', this.onLoad);
|
|
209
|
+
// Ignored via go/ees005
|
|
210
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
211
|
+
this.img.addEventListener('error', this.onError);
|
|
212
|
+
}
|
|
178
213
|
}
|
|
179
214
|
this.img.src = url;
|
|
180
215
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, INPUT_METHOD, ACTION_SUBJECT_ID } from './enums';
|
|
2
|
-
import { TrackAEP } from './utils';
|
|
2
|
+
import { type TrackAEP } from './utils';
|
|
3
3
|
type AlignmentUpdatedAEP = TrackAEP<ACTION.UPDATED, ACTION_SUBJECT.ALIGNMENT, ACTION_SUBJECT_ID, {
|
|
4
4
|
alignmentType?: 'start' | 'end' | 'center';
|
|
5
5
|
inputMethod?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT;
|
|
@@ -11,7 +11,7 @@ import type { AIEventPayload } from './ai-events';
|
|
|
11
11
|
import type { AIInlineSuggestionPayload } from './ai-inline-suggestion-events';
|
|
12
12
|
import type { AIProactiveEventPayload } from './ai-proactive-events';
|
|
13
13
|
import type { AIUnifiedEventPayload } from './ai-unified-events';
|
|
14
|
-
import { AlignmentEventPayload } from './alignment-events';
|
|
14
|
+
import type { AlignmentEventPayload } from './alignment-events';
|
|
15
15
|
import type { AvatarEventPayload } from './avatar';
|
|
16
16
|
import { type BreakoutEventPayload } from './breakout-events';
|
|
17
17
|
import type { TextColorEventPayload } from './color-events';
|
|
@@ -3,7 +3,7 @@ import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema'
|
|
|
3
3
|
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { EditorAnalyticsAPI } from '../../analytics';
|
|
6
|
-
import { Keymap } from '../../keymaps';
|
|
6
|
+
import { type Keymap } from '../../keymaps';
|
|
7
7
|
import type { Command, EditorContainerWidth, FloatingToolbarItem, Icon, NextEditorPlugin, PluginDependenciesAPI } from '../../types';
|
|
8
8
|
type WidthPluginType = NextEditorPlugin<'width', {
|
|
9
9
|
sharedState: EditorContainerWidth | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { EditorAnalyticsAPI } from '../analytics';
|
|
4
|
-
import { GuidelineConfig } from '../guideline';
|
|
4
|
+
import { type GuidelineConfig } from '../guideline';
|
|
5
5
|
import { type EditorContainerWidth, type getPosHandlerNode } from '../types';
|
|
6
6
|
type BreakoutSupportedNodes = 'layoutSection' | 'expand' | 'codeBlock';
|
|
7
7
|
export declare const ignoreResizerMutations: (mutation: MutationRecord | {
|
|
@@ -26,6 +26,19 @@ type BreakoutResizerProps = {
|
|
|
26
26
|
* correct ADF support.
|
|
27
27
|
*
|
|
28
28
|
* use experiment platform_editor_advanced_layouts
|
|
29
|
+
* @param root0
|
|
30
|
+
* @param root0.editorView
|
|
31
|
+
* @param root0.nodeType
|
|
32
|
+
* @param root0.getPos
|
|
33
|
+
* @param root0.getRef
|
|
34
|
+
* @param root0.disabled
|
|
35
|
+
* @param root0.getEditorWidth
|
|
36
|
+
* @param root0.parentRef
|
|
37
|
+
* @param root0.displayGuidelines
|
|
38
|
+
* @param root0.editorAnalyticsApi
|
|
39
|
+
* @param root0.displayGapCursor
|
|
40
|
+
* @param root0.onResizeStart
|
|
41
|
+
* @example
|
|
29
42
|
*/
|
|
30
43
|
declare const BreakoutResizer: ({ editorView, nodeType, getPos, getRef, disabled, getEditorWidth, parentRef, displayGuidelines, editorAnalyticsApi, displayGapCursor, onResizeStart, }: BreakoutResizerProps) => React.JSX.Element;
|
|
31
44
|
export { BreakoutResizer };
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { UserPreferencesProvider } from './user-preferences-provider';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param userPreferencesProvider
|
|
5
|
+
* @example
|
|
6
|
+
*/
|
|
2
7
|
export declare function useResolvedUserPreferences(userPreferencesProvider: UserPreferencesProvider): {
|
|
3
8
|
resolvedUserPreferences: import("./user-preferences").ResolvedUserPreferences<import("./user-preferences").UserPreferences>;
|
|
4
9
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { PersistenceAPI } from './persistence-api';
|
|
2
|
-
import { ResolvedUserPreferences, UserPreferences } from './user-preferences';
|
|
1
|
+
import { type PersistenceAPI } from './persistence-api';
|
|
2
|
+
import { type ResolvedUserPreferences, type UserPreferences } from './user-preferences';
|
|
3
3
|
type UpdateCallback = (userPreferences: UserPreferences) => void;
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
4
7
|
export declare class UserPreferencesProvider {
|
|
5
8
|
private callbacks;
|
|
6
9
|
private userPreferences;
|
|
@@ -12,13 +15,18 @@ export declare class UserPreferencesProvider {
|
|
|
12
15
|
* @param persistenceAPI - The persistence API to use for loading and updating user preferences
|
|
13
16
|
* @param defaultPreferences - The default user preferences to use
|
|
14
17
|
* @param initialUserPreferences - The initial user preferences to use (optional)
|
|
18
|
+
* @example
|
|
15
19
|
*/
|
|
16
20
|
constructor(persistenceAPI: PersistenceAPI, defaultPreferences: ResolvedUserPreferences);
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
17
24
|
get isInitialized(): boolean;
|
|
18
25
|
/**
|
|
19
26
|
* This method fetches the latest user preferences
|
|
20
27
|
* @returns a promise that resolves with the user preferences, or rejects if error occurs
|
|
21
28
|
* @throws Error if there is an error loading user preferences
|
|
29
|
+
* @example
|
|
22
30
|
*/
|
|
23
31
|
loadPreferences(): Promise<void>;
|
|
24
32
|
/**
|
|
@@ -27,21 +35,26 @@ export declare class UserPreferencesProvider {
|
|
|
27
35
|
* @param value
|
|
28
36
|
* @returns a promise that resolves when the user preference is updated
|
|
29
37
|
* @throws Error if there is an error updating user preferences
|
|
38
|
+
* @example
|
|
30
39
|
*/
|
|
31
40
|
updatePreference<K extends keyof UserPreferences>(key: K, value: UserPreferences[K]): Promise<void>;
|
|
32
41
|
/**
|
|
33
42
|
* get a user preference, Note that this function is a not async function,
|
|
34
43
|
* meaning that consumers should prefetch the user preference and make it available initially
|
|
35
44
|
* @param key
|
|
45
|
+
* @example
|
|
36
46
|
*/
|
|
37
47
|
getPreference<K extends keyof ResolvedUserPreferences>(key: K): ResolvedUserPreferences[K];
|
|
38
48
|
/**
|
|
39
49
|
* get all user preferences
|
|
50
|
+
* @example
|
|
40
51
|
*/
|
|
41
52
|
getPreferences(): ResolvedUserPreferences;
|
|
42
53
|
/**
|
|
43
54
|
* This method fetches the latest user preferences
|
|
55
|
+
* @param onUpdate
|
|
44
56
|
* @returns a function to unsubscribe from the updates
|
|
57
|
+
* @example
|
|
45
58
|
*/
|
|
46
59
|
onUpdate(onUpdate: UpdateCallback): () => void;
|
|
47
60
|
/**
|
|
@@ -49,15 +62,21 @@ export declare class UserPreferencesProvider {
|
|
|
49
62
|
* setting the default user preferences will also trigger an update
|
|
50
63
|
* This is useful when the default user preferences dynamically based on the context
|
|
51
64
|
* @param preferences
|
|
65
|
+
* @example
|
|
52
66
|
*/
|
|
53
67
|
setDefaultPreferences(preferences: ResolvedUserPreferences): void;
|
|
54
68
|
private setUserPreferences;
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
*/
|
|
55
73
|
notifyUserPreferencesUpdated(): void;
|
|
56
74
|
/**
|
|
57
75
|
* This method resolves the user preferences by merging the default preferences
|
|
58
76
|
* with the user preferences and filtering out any undefined or null values
|
|
59
77
|
* to avoid overwriting default preferences with null values
|
|
60
78
|
* @returns true if the user preferences were updated, false otherwise
|
|
79
|
+
* @example
|
|
61
80
|
*/
|
|
62
81
|
private resolveUserPreferences;
|
|
63
82
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, INPUT_METHOD, ACTION_SUBJECT_ID } from './enums';
|
|
2
|
-
import { TrackAEP } from './utils';
|
|
2
|
+
import { type TrackAEP } from './utils';
|
|
3
3
|
type AlignmentUpdatedAEP = TrackAEP<ACTION.UPDATED, ACTION_SUBJECT.ALIGNMENT, ACTION_SUBJECT_ID, {
|
|
4
4
|
alignmentType?: 'start' | 'end' | 'center';
|
|
5
5
|
inputMethod?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT;
|
|
@@ -11,7 +11,7 @@ import type { AIEventPayload } from './ai-events';
|
|
|
11
11
|
import type { AIInlineSuggestionPayload } from './ai-inline-suggestion-events';
|
|
12
12
|
import type { AIProactiveEventPayload } from './ai-proactive-events';
|
|
13
13
|
import type { AIUnifiedEventPayload } from './ai-unified-events';
|
|
14
|
-
import { AlignmentEventPayload } from './alignment-events';
|
|
14
|
+
import type { AlignmentEventPayload } from './alignment-events';
|
|
15
15
|
import type { AvatarEventPayload } from './avatar';
|
|
16
16
|
import { type BreakoutEventPayload } from './breakout-events';
|
|
17
17
|
import type { TextColorEventPayload } from './color-events';
|
|
@@ -3,7 +3,7 @@ import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema'
|
|
|
3
3
|
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { EditorAnalyticsAPI } from '../../analytics';
|
|
6
|
-
import { Keymap } from '../../keymaps';
|
|
6
|
+
import { type Keymap } from '../../keymaps';
|
|
7
7
|
import type { Command, EditorContainerWidth, FloatingToolbarItem, Icon, NextEditorPlugin, PluginDependenciesAPI } from '../../types';
|
|
8
8
|
type WidthPluginType = NextEditorPlugin<'width', {
|
|
9
9
|
sharedState: EditorContainerWidth | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { EditorAnalyticsAPI } from '../analytics';
|
|
4
|
-
import { GuidelineConfig } from '../guideline';
|
|
4
|
+
import { type GuidelineConfig } from '../guideline';
|
|
5
5
|
import { type EditorContainerWidth, type getPosHandlerNode } from '../types';
|
|
6
6
|
type BreakoutSupportedNodes = 'layoutSection' | 'expand' | 'codeBlock';
|
|
7
7
|
export declare const ignoreResizerMutations: (mutation: MutationRecord | {
|
|
@@ -26,6 +26,19 @@ type BreakoutResizerProps = {
|
|
|
26
26
|
* correct ADF support.
|
|
27
27
|
*
|
|
28
28
|
* use experiment platform_editor_advanced_layouts
|
|
29
|
+
* @param root0
|
|
30
|
+
* @param root0.editorView
|
|
31
|
+
* @param root0.nodeType
|
|
32
|
+
* @param root0.getPos
|
|
33
|
+
* @param root0.getRef
|
|
34
|
+
* @param root0.disabled
|
|
35
|
+
* @param root0.getEditorWidth
|
|
36
|
+
* @param root0.parentRef
|
|
37
|
+
* @param root0.displayGuidelines
|
|
38
|
+
* @param root0.editorAnalyticsApi
|
|
39
|
+
* @param root0.displayGapCursor
|
|
40
|
+
* @param root0.onResizeStart
|
|
41
|
+
* @example
|
|
29
42
|
*/
|
|
30
43
|
declare const BreakoutResizer: ({ editorView, nodeType, getPos, getRef, disabled, getEditorWidth, parentRef, displayGuidelines, editorAnalyticsApi, displayGapCursor, onResizeStart, }: BreakoutResizerProps) => React.JSX.Element;
|
|
31
44
|
export { BreakoutResizer };
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { UserPreferencesProvider } from './user-preferences-provider';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param userPreferencesProvider
|
|
5
|
+
* @example
|
|
6
|
+
*/
|
|
2
7
|
export declare function useResolvedUserPreferences(userPreferencesProvider: UserPreferencesProvider): {
|
|
3
8
|
resolvedUserPreferences: import("./user-preferences").ResolvedUserPreferences<import("./user-preferences").UserPreferences>;
|
|
4
9
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { PersistenceAPI } from './persistence-api';
|
|
2
|
-
import { ResolvedUserPreferences, UserPreferences } from './user-preferences';
|
|
1
|
+
import { type PersistenceAPI } from './persistence-api';
|
|
2
|
+
import { type ResolvedUserPreferences, type UserPreferences } from './user-preferences';
|
|
3
3
|
type UpdateCallback = (userPreferences: UserPreferences) => void;
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
4
7
|
export declare class UserPreferencesProvider {
|
|
5
8
|
private callbacks;
|
|
6
9
|
private userPreferences;
|
|
@@ -12,13 +15,18 @@ export declare class UserPreferencesProvider {
|
|
|
12
15
|
* @param persistenceAPI - The persistence API to use for loading and updating user preferences
|
|
13
16
|
* @param defaultPreferences - The default user preferences to use
|
|
14
17
|
* @param initialUserPreferences - The initial user preferences to use (optional)
|
|
18
|
+
* @example
|
|
15
19
|
*/
|
|
16
20
|
constructor(persistenceAPI: PersistenceAPI, defaultPreferences: ResolvedUserPreferences);
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
17
24
|
get isInitialized(): boolean;
|
|
18
25
|
/**
|
|
19
26
|
* This method fetches the latest user preferences
|
|
20
27
|
* @returns a promise that resolves with the user preferences, or rejects if error occurs
|
|
21
28
|
* @throws Error if there is an error loading user preferences
|
|
29
|
+
* @example
|
|
22
30
|
*/
|
|
23
31
|
loadPreferences(): Promise<void>;
|
|
24
32
|
/**
|
|
@@ -27,21 +35,26 @@ export declare class UserPreferencesProvider {
|
|
|
27
35
|
* @param value
|
|
28
36
|
* @returns a promise that resolves when the user preference is updated
|
|
29
37
|
* @throws Error if there is an error updating user preferences
|
|
38
|
+
* @example
|
|
30
39
|
*/
|
|
31
40
|
updatePreference<K extends keyof UserPreferences>(key: K, value: UserPreferences[K]): Promise<void>;
|
|
32
41
|
/**
|
|
33
42
|
* get a user preference, Note that this function is a not async function,
|
|
34
43
|
* meaning that consumers should prefetch the user preference and make it available initially
|
|
35
44
|
* @param key
|
|
45
|
+
* @example
|
|
36
46
|
*/
|
|
37
47
|
getPreference<K extends keyof ResolvedUserPreferences>(key: K): ResolvedUserPreferences[K];
|
|
38
48
|
/**
|
|
39
49
|
* get all user preferences
|
|
50
|
+
* @example
|
|
40
51
|
*/
|
|
41
52
|
getPreferences(): ResolvedUserPreferences;
|
|
42
53
|
/**
|
|
43
54
|
* This method fetches the latest user preferences
|
|
55
|
+
* @param onUpdate
|
|
44
56
|
* @returns a function to unsubscribe from the updates
|
|
57
|
+
* @example
|
|
45
58
|
*/
|
|
46
59
|
onUpdate(onUpdate: UpdateCallback): () => void;
|
|
47
60
|
/**
|
|
@@ -49,15 +62,21 @@ export declare class UserPreferencesProvider {
|
|
|
49
62
|
* setting the default user preferences will also trigger an update
|
|
50
63
|
* This is useful when the default user preferences dynamically based on the context
|
|
51
64
|
* @param preferences
|
|
65
|
+
* @example
|
|
52
66
|
*/
|
|
53
67
|
setDefaultPreferences(preferences: ResolvedUserPreferences): void;
|
|
54
68
|
private setUserPreferences;
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
*/
|
|
55
73
|
notifyUserPreferencesUpdated(): void;
|
|
56
74
|
/**
|
|
57
75
|
* This method resolves the user preferences by merging the default preferences
|
|
58
76
|
* with the user preferences and filtering out any undefined or null values
|
|
59
77
|
* to avoid overwriting default preferences with null values
|
|
60
78
|
* @returns true if the user preferences were updated, false otherwise
|
|
79
|
+
* @example
|
|
61
80
|
*/
|
|
62
81
|
private resolveUserPreferences;
|
|
63
82
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "105.2.
|
|
3
|
+
"version": "105.2.3",
|
|
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/"
|
|
@@ -128,23 +128,23 @@
|
|
|
128
128
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
129
129
|
"@atlaskit/atlassian-context": "^0.2.0",
|
|
130
130
|
"@atlaskit/button": "^23.0.0",
|
|
131
|
-
"@atlaskit/code": "^17.
|
|
131
|
+
"@atlaskit/code": "^17.2.0",
|
|
132
132
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
133
133
|
"@atlaskit/css": "^0.10.0",
|
|
134
134
|
"@atlaskit/custom-steps": "^0.11.0",
|
|
135
|
-
"@atlaskit/dropdown-menu": "^14.
|
|
135
|
+
"@atlaskit/dropdown-menu": "^14.2.0",
|
|
136
136
|
"@atlaskit/editor-json-transformer": "^8.24.0",
|
|
137
137
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
138
138
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
139
139
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
140
140
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
141
|
-
"@atlaskit/emoji": "^69.
|
|
141
|
+
"@atlaskit/emoji": "^69.2.0",
|
|
142
142
|
"@atlaskit/icon": "^26.0.0",
|
|
143
143
|
"@atlaskit/icon-object": "^7.1.0",
|
|
144
144
|
"@atlaskit/link-datasource": "^4.10.0",
|
|
145
145
|
"@atlaskit/link-picker": "^3.2.0",
|
|
146
146
|
"@atlaskit/media-card": "^79.2.0",
|
|
147
|
-
"@atlaskit/media-client": "^33.
|
|
147
|
+
"@atlaskit/media-client": "^33.1.0",
|
|
148
148
|
"@atlaskit/media-client-react": "^4.0.0",
|
|
149
149
|
"@atlaskit/media-common": "^12.0.0",
|
|
150
150
|
"@atlaskit/media-file-preview": "^0.11.0",
|
|
@@ -153,12 +153,12 @@
|
|
|
153
153
|
"@atlaskit/media-viewer": "^52.0.0",
|
|
154
154
|
"@atlaskit/mention": "^24.1.0",
|
|
155
155
|
"@atlaskit/menu": "^5.0.0",
|
|
156
|
-
"@atlaskit/onboarding": "^14.
|
|
156
|
+
"@atlaskit/onboarding": "^14.1.0",
|
|
157
157
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
158
158
|
"@atlaskit/platform-feature-flags-react": "^0.2.0",
|
|
159
159
|
"@atlaskit/popper": "^7.0.0",
|
|
160
160
|
"@atlaskit/primitives": "^14.7.0",
|
|
161
|
-
"@atlaskit/profilecard": "^23.
|
|
161
|
+
"@atlaskit/profilecard": "^23.12.0",
|
|
162
162
|
"@atlaskit/react-ufo": "^3.11.0",
|
|
163
163
|
"@atlaskit/section-message": "^8.2.0",
|
|
164
164
|
"@atlaskit/smart-card": "^38.0.0",
|
|
@@ -199,14 +199,14 @@
|
|
|
199
199
|
"w3c-keyname": "^2.1.8"
|
|
200
200
|
},
|
|
201
201
|
"peerDependencies": {
|
|
202
|
-
"@atlaskit/media-core": "^36.
|
|
202
|
+
"@atlaskit/media-core": "^36.1.0",
|
|
203
203
|
"react": "^18.2.0",
|
|
204
204
|
"react-dom": "^18.2.0",
|
|
205
205
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
206
206
|
},
|
|
207
207
|
"devDependencies": {
|
|
208
208
|
"@af/visual-regression": "workspace:^",
|
|
209
|
-
"@atlaskit/media-core": "^36.
|
|
209
|
+
"@atlaskit/media-core": "^36.1.0",
|
|
210
210
|
"@atlaskit/media-test-helpers": "^36.0.0",
|
|
211
211
|
"@atlaskit/util-data-test": "^18.0.0",
|
|
212
212
|
"@atlaskit/visual-regression": "workspace:^",
|