@atlaskit/editor-core 187.14.12 → 187.15.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 +12 -0
- package/dist/cjs/create-editor/create-plugins-list.js +2 -7
- package/dist/cjs/create-editor/feature-flags-from-props.js +23 -28
- package/dist/cjs/plugins/media/toolbar/index.js +59 -4
- package/dist/cjs/plugins/media/ui/PixelEntry/index.js +152 -0
- package/dist/cjs/plugins/media/ui/PixelEntry/messages.js +40 -0
- package/dist/cjs/plugins/media/ui/PixelEntry/styles.js +25 -0
- package/dist/cjs/plugins/media/ui/PixelEntry/types.js +5 -0
- package/dist/cjs/plugins/type-ahead/index.js +1 -4
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +2 -4
- package/dist/cjs/plugins/type-ahead/pm-plugins/main.js +2 -4
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +21 -40
- package/dist/cjs/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -9
- package/dist/cjs/plugins/type-ahead/utils.js +15 -19
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/create-plugins-list.js +2 -7
- package/dist/es2019/create-editor/feature-flags-from-props.js +23 -28
- package/dist/es2019/plugins/media/toolbar/index.js +62 -0
- package/dist/es2019/plugins/media/ui/PixelEntry/index.js +133 -0
- package/dist/es2019/plugins/media/ui/PixelEntry/messages.js +33 -0
- package/dist/es2019/plugins/media/ui/PixelEntry/styles.js +44 -0
- package/dist/es2019/plugins/media/ui/PixelEntry/types.js +1 -0
- package/dist/es2019/plugins/type-ahead/index.js +1 -4
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +2 -4
- package/dist/es2019/plugins/type-ahead/pm-plugins/main.js +2 -4
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +21 -40
- package/dist/es2019/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -9
- package/dist/es2019/plugins/type-ahead/utils.js +15 -19
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/create-plugins-list.js +2 -7
- package/dist/esm/create-editor/feature-flags-from-props.js +23 -28
- package/dist/esm/plugins/media/toolbar/index.js +59 -4
- package/dist/esm/plugins/media/ui/PixelEntry/index.js +140 -0
- package/dist/esm/plugins/media/ui/PixelEntry/messages.js +33 -0
- package/dist/esm/plugins/media/ui/PixelEntry/styles.js +11 -0
- package/dist/esm/plugins/media/ui/PixelEntry/types.js +1 -0
- package/dist/esm/plugins/type-ahead/index.js +1 -4
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +2 -4
- package/dist/esm/plugins/type-ahead/pm-plugins/main.js +2 -4
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +21 -40
- package/dist/esm/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -9
- package/dist/esm/plugins/type-ahead/utils.js +15 -19
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/create-plugins-list.d.ts +6 -6
- package/dist/types/plugins/media/ui/PixelEntry/index.d.ts +4 -0
- package/dist/types/plugins/media/ui/PixelEntry/messages.d.ts +32 -0
- package/dist/types/plugins/media/ui/PixelEntry/styles.d.ts +7 -0
- package/dist/types/plugins/media/ui/PixelEntry/types.d.ts +35 -0
- package/dist/types/plugins/type-ahead/index.d.ts +0 -1
- package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +1 -2
- package/dist/types/plugins/type-ahead/pm-plugins/main.d.ts +1 -2
- package/dist/types/plugins/type-ahead/ui/InputQuery.d.ts +0 -1
- package/dist/types/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +0 -1
- package/dist/types/plugins/type-ahead/utils.d.ts +1 -2
- package/dist/types-ts4.5/create-editor/create-plugins-list.d.ts +6 -6
- package/dist/types-ts4.5/plugins/media/ui/PixelEntry/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/media/ui/PixelEntry/messages.d.ts +32 -0
- package/dist/types-ts4.5/plugins/media/ui/PixelEntry/styles.d.ts +7 -0
- package/dist/types-ts4.5/plugins/media/ui/PixelEntry/types.d.ts +35 -0
- package/dist/types-ts4.5/plugins/type-ahead/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/decorations.d.ts +1 -2
- package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/main.d.ts +1 -2
- package/dist/types-ts4.5/plugins/type-ahead/ui/InputQuery.d.ts +0 -1
- package/dist/types-ts4.5/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +0 -1
- package/dist/types-ts4.5/plugins/type-ahead/utils.d.ts +1 -2
- package/package.json +1 -1
- package/report.api.md +1 -2
- package/tmp/api-report-tmp.d.ts +1 -2
|
@@ -15,8 +15,7 @@ import { closeTypeAhead } from '../transforms/close-type-ahead';
|
|
|
15
15
|
export var factoryDecorations = function factoryDecorations(_ref) {
|
|
16
16
|
var intl = _ref.intl,
|
|
17
17
|
popupMountRef = _ref.popupMountRef,
|
|
18
|
-
createAnalyticsEvent = _ref.createAnalyticsEvent
|
|
19
|
-
useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
|
|
18
|
+
createAnalyticsEvent = _ref.createAnalyticsEvent;
|
|
20
19
|
var createDecorations = function createDecorations(tr, _ref2) {
|
|
21
20
|
var triggerHandler = _ref2.triggerHandler,
|
|
22
21
|
inputMethod = _ref2.inputMethod,
|
|
@@ -88,8 +87,7 @@ export var factoryDecorations = function factoryDecorations(_ref) {
|
|
|
88
87
|
popupsBoundariesElement: (_popupMountRef$curren2 = popupMountRef.current) === null || _popupMountRef$curren2 === void 0 ? void 0 : _popupMountRef$curren2.popupsBoundariesElement,
|
|
89
88
|
popupsScrollableElement: (_popupMountRef$curren3 = popupMountRef.current) === null || _popupMountRef$curren3 === void 0 ? void 0 : _popupMountRef$curren3.popupsScrollableElement,
|
|
90
89
|
onUndoRedo: onUndoRedo,
|
|
91
|
-
reopenQuery: reopenQuery
|
|
92
|
-
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
90
|
+
reopenQuery: reopenQuery
|
|
93
91
|
})), typeaheadComponent);
|
|
94
92
|
shouldFocusCursorInsideQuery = false;
|
|
95
93
|
return typeaheadComponent;
|
|
@@ -25,14 +25,12 @@ export function createPlugin(_ref) {
|
|
|
25
25
|
popupMountRef = _ref.popupMountRef,
|
|
26
26
|
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
27
27
|
typeAheadHandlers = _ref.typeAheadHandlers,
|
|
28
|
-
getIntl = _ref.getIntl
|
|
29
|
-
useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
|
|
28
|
+
getIntl = _ref.getIntl;
|
|
30
29
|
var intl = getIntl();
|
|
31
30
|
var _factoryDecorations = factoryDecorations({
|
|
32
31
|
intl: intl,
|
|
33
32
|
popupMountRef: popupMountRef,
|
|
34
|
-
createAnalyticsEvent: createAnalyticsEvent
|
|
35
|
-
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
33
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
36
34
|
}),
|
|
37
35
|
createDecorations = _factoryDecorations.createDecorations,
|
|
38
36
|
removeDecorations = _factoryDecorations.removeDecorations;
|
|
@@ -66,8 +66,7 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
66
66
|
onQueryFocus = _ref.onQueryFocus,
|
|
67
67
|
onUndoRedo = _ref.onUndoRedo,
|
|
68
68
|
editorView = _ref.editorView,
|
|
69
|
-
items = _ref.items
|
|
70
|
-
useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
|
|
69
|
+
items = _ref.items;
|
|
71
70
|
var ref = useRef(document.createElement('span'));
|
|
72
71
|
var inputRef = useRef(null);
|
|
73
72
|
var _useState = useState(null),
|
|
@@ -140,27 +139,6 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
140
139
|
// Some suggested the other workaround maybe listen on`keypress` instead of `keydown`
|
|
141
140
|
if (!event.isComposing && event.which !== 229 && event.keyCode !== 229) {
|
|
142
141
|
if (selectedIndex === -1) {
|
|
143
|
-
if (useBetterTypeaheadNavigation) {
|
|
144
|
-
/**
|
|
145
|
-
* TODO DTR-1401: (also see ED-17200) There are two options
|
|
146
|
-
* here, either
|
|
147
|
-
* - set the index directly to 1 in WrapperTypeAhead.tsx's
|
|
148
|
-
* `insertSelectedItem` at the cost of breaking some of the a11y
|
|
149
|
-
* focus changes,
|
|
150
|
-
* - or do this jank at the cost of some small analytics noise.
|
|
151
|
-
*
|
|
152
|
-
* The focus behaviour still needs cleanup
|
|
153
|
-
*/
|
|
154
|
-
selectPreviousItem();
|
|
155
|
-
}
|
|
156
|
-
selectNextItem();
|
|
157
|
-
}
|
|
158
|
-
onItemSelect(event.shiftKey ? SelectItemMode.SHIFT_ENTER : SelectItemMode.ENTER);
|
|
159
|
-
}
|
|
160
|
-
break;
|
|
161
|
-
case 'Tab':
|
|
162
|
-
if (selectedIndex === -1) {
|
|
163
|
-
if (useBetterTypeaheadNavigation) {
|
|
164
142
|
/**
|
|
165
143
|
* TODO DTR-1401: (also see ED-17200) There are two options
|
|
166
144
|
* here, either
|
|
@@ -169,33 +147,36 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
169
147
|
* focus changes,
|
|
170
148
|
* - or do this jank at the cost of some small analytics noise.
|
|
171
149
|
*
|
|
150
|
+
* The focus behaviour still needs cleanup
|
|
172
151
|
*/
|
|
173
152
|
selectPreviousItem();
|
|
153
|
+
selectNextItem();
|
|
174
154
|
}
|
|
155
|
+
onItemSelect(event.shiftKey ? SelectItemMode.SHIFT_ENTER : SelectItemMode.ENTER);
|
|
156
|
+
}
|
|
157
|
+
break;
|
|
158
|
+
case 'Tab':
|
|
159
|
+
if (selectedIndex === -1) {
|
|
160
|
+
/**
|
|
161
|
+
* TODO DTR-1401: (also see ED-17200) There are two options
|
|
162
|
+
* here, either
|
|
163
|
+
* - set the index directly to 1 in WrapperTypeAhead.tsx's
|
|
164
|
+
* `insertSelectedItem` at the cost of breaking some of the a11y
|
|
165
|
+
* focus changes,
|
|
166
|
+
* - or do this jank at the cost of some small analytics noise.
|
|
167
|
+
*
|
|
168
|
+
*/
|
|
169
|
+
selectPreviousItem();
|
|
175
170
|
selectNextItem();
|
|
176
171
|
}
|
|
177
172
|
// TODO DTR-1401: why is this calling select item when hitting tab? fix this in DTR-1401
|
|
178
173
|
onItemSelect(SelectItemMode.TAB);
|
|
179
174
|
break;
|
|
180
175
|
case 'ArrowDown':
|
|
181
|
-
|
|
182
|
-
selectNextItem();
|
|
183
|
-
} else {
|
|
184
|
-
// TODO DTR-1401: why were we preventing selection?
|
|
185
|
-
if (selectedIndex === -1) {
|
|
186
|
-
selectNextItem();
|
|
187
|
-
}
|
|
188
|
-
}
|
|
176
|
+
selectNextItem();
|
|
189
177
|
break;
|
|
190
178
|
case 'ArrowUp':
|
|
191
|
-
|
|
192
|
-
selectPreviousItem();
|
|
193
|
-
} else {
|
|
194
|
-
// TODO DTR-1401: why were we preventing selection?
|
|
195
|
-
if (selectedIndex === -1) {
|
|
196
|
-
selectPreviousItem();
|
|
197
|
-
}
|
|
198
|
-
}
|
|
179
|
+
selectPreviousItem();
|
|
199
180
|
break;
|
|
200
181
|
}
|
|
201
182
|
var undoRedoType = isUndoRedoShortcut(event);
|
|
@@ -207,7 +188,7 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
207
188
|
event.preventDefault();
|
|
208
189
|
return false;
|
|
209
190
|
}
|
|
210
|
-
}, [
|
|
191
|
+
}, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
|
|
211
192
|
var onClick = useCallback(function (event) {
|
|
212
193
|
var _inputRef$current;
|
|
213
194
|
event.stopPropagation();
|
|
@@ -19,8 +19,7 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
19
19
|
inputMethod = _ref.inputMethod,
|
|
20
20
|
getDecorationPosition = _ref.getDecorationPosition,
|
|
21
21
|
reopenQuery = _ref.reopenQuery,
|
|
22
|
-
onUndoRedo = _ref.onUndoRedo
|
|
23
|
-
useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
|
|
22
|
+
onUndoRedo = _ref.onUndoRedo;
|
|
24
23
|
var _useState = useState(false),
|
|
25
24
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26
25
|
closed = _useState2[0],
|
|
@@ -42,17 +41,15 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
42
41
|
var selectNextItem = useMemo(function () {
|
|
43
42
|
return moveSelectedIndex({
|
|
44
43
|
editorView: editorView,
|
|
45
|
-
direction: 'next'
|
|
46
|
-
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
44
|
+
direction: 'next'
|
|
47
45
|
});
|
|
48
|
-
}, [editorView
|
|
46
|
+
}, [editorView]);
|
|
49
47
|
var selectPreviousItem = useMemo(function () {
|
|
50
48
|
return moveSelectedIndex({
|
|
51
49
|
editorView: editorView,
|
|
52
|
-
direction: 'previous'
|
|
53
|
-
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
50
|
+
direction: 'previous'
|
|
54
51
|
});
|
|
55
|
-
}, [editorView
|
|
52
|
+
}, [editorView]);
|
|
56
53
|
var cancel = useCallback(function (_ref2) {
|
|
57
54
|
var setSelectionAt = _ref2.setSelectionAt,
|
|
58
55
|
addPrefixTrigger = _ref2.addPrefixTrigger,
|
|
@@ -103,7 +100,6 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
103
100
|
return null;
|
|
104
101
|
}
|
|
105
102
|
return /*#__PURE__*/React.createElement(InputQuery, {
|
|
106
|
-
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation,
|
|
107
103
|
triggerQueryPrefix: triggerHandler.trigger,
|
|
108
104
|
onQueryChange: setQuery,
|
|
109
105
|
onItemSelect: insertSelectedItem,
|
|
@@ -53,8 +53,7 @@ export var findHandlerByTrigger = function findHandlerByTrigger(_ref) {
|
|
|
53
53
|
};
|
|
54
54
|
export var moveSelectedIndex = function moveSelectedIndex(_ref2) {
|
|
55
55
|
var editorView = _ref2.editorView,
|
|
56
|
-
direction = _ref2.direction
|
|
57
|
-
useBetterTypeaheadNavigation = _ref2.useBetterTypeaheadNavigation;
|
|
56
|
+
direction = _ref2.direction;
|
|
58
57
|
return function () {
|
|
59
58
|
var typeAheadState = getPluginState(editorView.state);
|
|
60
59
|
if (!typeAheadState) {
|
|
@@ -66,23 +65,20 @@ export var moveSelectedIndex = function moveSelectedIndex(_ref2) {
|
|
|
66
65
|
var nextIndex;
|
|
67
66
|
if (direction === 'next') {
|
|
68
67
|
stats.increaseArrowDown();
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
} else {
|
|
84
|
-
nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
|
|
85
|
-
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* See: https://product-fabric.atlassian.net/browse/ED-17200
|
|
71
|
+
* `selectedIndex` is forced to -1 now to not immediately focus the typeahead
|
|
72
|
+
* and only do so when there is explicit logic to focus into the typeahead
|
|
73
|
+
* options.
|
|
74
|
+
*
|
|
75
|
+
* This check for "set index to 1 when -1"
|
|
76
|
+
* - is a temporary workaround to get back the previous behaviour without
|
|
77
|
+
* entirely reverting the a11y improvements
|
|
78
|
+
*
|
|
79
|
+
*/
|
|
80
|
+
if (selectedIndex === -1 && items.length > 1) {
|
|
81
|
+
nextIndex = 1;
|
|
86
82
|
} else {
|
|
87
83
|
nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
|
|
88
84
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
-
import { EditorPlugin, EditorProps } from '../types';
|
|
3
|
-
import { EditorPluginFeatureProps } from '../types/editor-props';
|
|
4
|
-
import { ScrollGutterPluginOptions } from '../plugins/base/pm-plugins/scroll-gutter';
|
|
5
|
-
import { DefaultPresetPluginOptions } from '../labs/next/presets/default';
|
|
6
|
-
import { EditorPresetProps } from '../labs/next/presets/types';
|
|
1
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
+
import type { EditorPlugin, EditorProps } from '../types';
|
|
3
|
+
import type { EditorPluginFeatureProps } from '../types/editor-props';
|
|
4
|
+
import type { ScrollGutterPluginOptions } from '../plugins/base/pm-plugins/scroll-gutter';
|
|
5
|
+
import type { DefaultPresetPluginOptions } from '../labs/next/presets/default';
|
|
6
|
+
import type { EditorPresetProps } from '../labs/next/presets/types';
|
|
7
7
|
import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
8
8
|
export declare function getScrollGutterOptions(props: EditorProps): ScrollGutterPluginOptions | undefined;
|
|
9
9
|
export declare function getDefaultPresetOptionsFromEditorProps(props: EditorProps, createAnalyticsEvent?: CreateUIAnalyticsEvent): EditorPresetProps & DefaultPresetPluginOptions & EditorPluginFeatureProps;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const messages: {
|
|
2
|
+
validationFailedMessage: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
inputWidthTooltip: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
inputWidthAriaLabel: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
inputHeightTooltip: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
inputHeightAriaLabel: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
submitButtonText: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const pixelSizingWrapper: import("@emotion/react").SerializedStyles;
|
|
2
|
+
export declare const pixelEntryForm: import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const pixelSizingInput: import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const pixelSizingLabel: import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const pixelSizingWidthInput: import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const pixelSizingHeightInput: import("@emotion/react").SerializedStyles;
|
|
7
|
+
export declare const pixelEntryHiddenSubmit: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
export type PixelEntryProps = {
|
|
3
|
+
/**
|
|
4
|
+
* IntlShape passed in for translations
|
|
5
|
+
*/
|
|
6
|
+
intl: IntlShape;
|
|
7
|
+
/**
|
|
8
|
+
* The current pixel width
|
|
9
|
+
*/
|
|
10
|
+
width: number;
|
|
11
|
+
/**
|
|
12
|
+
* The original media width used to calculate the height
|
|
13
|
+
*/
|
|
14
|
+
mediaWidth: number;
|
|
15
|
+
/**
|
|
16
|
+
* The original media height used to calculate the width
|
|
17
|
+
*/
|
|
18
|
+
mediaHeight: number;
|
|
19
|
+
/**
|
|
20
|
+
* The submit function that is called when the form is valid and the submit key is pressed
|
|
21
|
+
*/
|
|
22
|
+
onSubmit?: (value: PixelEntryFormData) => void;
|
|
23
|
+
/**
|
|
24
|
+
* An optional validate function that is called before onSubmit is called.
|
|
25
|
+
* The value passed through the validator currently comes from the width input only.
|
|
26
|
+
*/
|
|
27
|
+
validate?: (value: number | '') => boolean;
|
|
28
|
+
};
|
|
29
|
+
export type PixelEntryFormValues = {
|
|
30
|
+
inputWidth: number | '';
|
|
31
|
+
inputHeight: number | '';
|
|
32
|
+
};
|
|
33
|
+
export type PixelEntryFormData = {
|
|
34
|
+
width: number;
|
|
35
|
+
};
|
|
@@ -5,11 +5,10 @@ type FactoryProps = {
|
|
|
5
5
|
intl: IntlShape;
|
|
6
6
|
popupMountRef: PopupMountPointReference;
|
|
7
7
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
8
|
-
useBetterTypeaheadNavigation: boolean;
|
|
9
8
|
};
|
|
10
9
|
type FactoryReturn = {
|
|
11
10
|
createDecorations: CreateTypeAheadDecorations;
|
|
12
11
|
removeDecorations: RemoveTypeAheadDecorations;
|
|
13
12
|
};
|
|
14
|
-
export declare const factoryDecorations: ({ intl, popupMountRef, createAnalyticsEvent,
|
|
13
|
+
export declare const factoryDecorations: ({ intl, popupMountRef, createAnalyticsEvent, }: FactoryProps) => FactoryReturn;
|
|
15
14
|
export {};
|
|
@@ -9,7 +9,6 @@ type Props = {
|
|
|
9
9
|
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
10
10
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
11
11
|
getIntl: () => IntlShape;
|
|
12
|
-
useBetterTypeaheadNavigation: boolean;
|
|
13
12
|
};
|
|
14
|
-
export declare function createPlugin({ reactDispatch, popupMountRef, createAnalyticsEvent, typeAheadHandlers, getIntl,
|
|
13
|
+
export declare function createPlugin({ reactDispatch, popupMountRef, createAnalyticsEvent, typeAheadHandlers, getIntl, }: Props): SafePlugin;
|
|
15
14
|
export {};
|
|
@@ -15,7 +15,6 @@ type WrapperProps = {
|
|
|
15
15
|
popupsScrollableElement?: HTMLElement;
|
|
16
16
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
17
17
|
inputMethod?: TypeAheadInputMethod;
|
|
18
|
-
useBetterTypeaheadNavigation: boolean;
|
|
19
18
|
};
|
|
20
19
|
export declare const WrapperTypeAhead: React.FC<WrapperProps>;
|
|
21
20
|
export {};
|
|
@@ -18,9 +18,8 @@ export declare const findHandlerByTrigger: ({ trigger, editorState, }: {
|
|
|
18
18
|
type MoveSelectedIndexProps = {
|
|
19
19
|
editorView: EditorView;
|
|
20
20
|
direction: 'next' | 'previous';
|
|
21
|
-
useBetterTypeaheadNavigation?: boolean;
|
|
22
21
|
};
|
|
23
|
-
export declare const moveSelectedIndex: ({ editorView, direction
|
|
22
|
+
export declare const moveSelectedIndex: ({ editorView, direction }: MoveSelectedIndexProps) => () => void;
|
|
24
23
|
type TypeAheadAssistiveLabels = {
|
|
25
24
|
popupAriaLabel: string;
|
|
26
25
|
listItemAriaLabel?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
-
import { EditorPlugin, EditorProps } from '../types';
|
|
3
|
-
import { EditorPluginFeatureProps } from '../types/editor-props';
|
|
4
|
-
import { ScrollGutterPluginOptions } from '../plugins/base/pm-plugins/scroll-gutter';
|
|
5
|
-
import { DefaultPresetPluginOptions } from '../labs/next/presets/default';
|
|
6
|
-
import { EditorPresetProps } from '../labs/next/presets/types';
|
|
1
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
+
import type { EditorPlugin, EditorProps } from '../types';
|
|
3
|
+
import type { EditorPluginFeatureProps } from '../types/editor-props';
|
|
4
|
+
import type { ScrollGutterPluginOptions } from '../plugins/base/pm-plugins/scroll-gutter';
|
|
5
|
+
import type { DefaultPresetPluginOptions } from '../labs/next/presets/default';
|
|
6
|
+
import type { EditorPresetProps } from '../labs/next/presets/types';
|
|
7
7
|
import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
8
8
|
export declare function getScrollGutterOptions(props: EditorProps): ScrollGutterPluginOptions | undefined;
|
|
9
9
|
export declare function getDefaultPresetOptionsFromEditorProps(props: EditorProps, createAnalyticsEvent?: CreateUIAnalyticsEvent): EditorPresetProps & DefaultPresetPluginOptions & EditorPluginFeatureProps;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const messages: {
|
|
2
|
+
validationFailedMessage: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
inputWidthTooltip: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
inputWidthAriaLabel: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
inputHeightTooltip: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
inputHeightAriaLabel: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
submitButtonText: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const pixelSizingWrapper: import("@emotion/react").SerializedStyles;
|
|
2
|
+
export declare const pixelEntryForm: import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const pixelSizingInput: import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const pixelSizingLabel: import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const pixelSizingWidthInput: import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const pixelSizingHeightInput: import("@emotion/react").SerializedStyles;
|
|
7
|
+
export declare const pixelEntryHiddenSubmit: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
export type PixelEntryProps = {
|
|
3
|
+
/**
|
|
4
|
+
* IntlShape passed in for translations
|
|
5
|
+
*/
|
|
6
|
+
intl: IntlShape;
|
|
7
|
+
/**
|
|
8
|
+
* The current pixel width
|
|
9
|
+
*/
|
|
10
|
+
width: number;
|
|
11
|
+
/**
|
|
12
|
+
* The original media width used to calculate the height
|
|
13
|
+
*/
|
|
14
|
+
mediaWidth: number;
|
|
15
|
+
/**
|
|
16
|
+
* The original media height used to calculate the width
|
|
17
|
+
*/
|
|
18
|
+
mediaHeight: number;
|
|
19
|
+
/**
|
|
20
|
+
* The submit function that is called when the form is valid and the submit key is pressed
|
|
21
|
+
*/
|
|
22
|
+
onSubmit?: (value: PixelEntryFormData) => void;
|
|
23
|
+
/**
|
|
24
|
+
* An optional validate function that is called before onSubmit is called.
|
|
25
|
+
* The value passed through the validator currently comes from the width input only.
|
|
26
|
+
*/
|
|
27
|
+
validate?: (value: number | '') => boolean;
|
|
28
|
+
};
|
|
29
|
+
export type PixelEntryFormValues = {
|
|
30
|
+
inputWidth: number | '';
|
|
31
|
+
inputHeight: number | '';
|
|
32
|
+
};
|
|
33
|
+
export type PixelEntryFormData = {
|
|
34
|
+
width: number;
|
|
35
|
+
};
|
|
@@ -5,11 +5,10 @@ type FactoryProps = {
|
|
|
5
5
|
intl: IntlShape;
|
|
6
6
|
popupMountRef: PopupMountPointReference;
|
|
7
7
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
8
|
-
useBetterTypeaheadNavigation: boolean;
|
|
9
8
|
};
|
|
10
9
|
type FactoryReturn = {
|
|
11
10
|
createDecorations: CreateTypeAheadDecorations;
|
|
12
11
|
removeDecorations: RemoveTypeAheadDecorations;
|
|
13
12
|
};
|
|
14
|
-
export declare const factoryDecorations: ({ intl, popupMountRef, createAnalyticsEvent,
|
|
13
|
+
export declare const factoryDecorations: ({ intl, popupMountRef, createAnalyticsEvent, }: FactoryProps) => FactoryReturn;
|
|
15
14
|
export {};
|
|
@@ -9,7 +9,6 @@ type Props = {
|
|
|
9
9
|
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
10
10
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
11
11
|
getIntl: () => IntlShape;
|
|
12
|
-
useBetterTypeaheadNavigation: boolean;
|
|
13
12
|
};
|
|
14
|
-
export declare function createPlugin({ reactDispatch, popupMountRef, createAnalyticsEvent, typeAheadHandlers, getIntl,
|
|
13
|
+
export declare function createPlugin({ reactDispatch, popupMountRef, createAnalyticsEvent, typeAheadHandlers, getIntl, }: Props): SafePlugin;
|
|
15
14
|
export {};
|
|
@@ -15,7 +15,6 @@ type WrapperProps = {
|
|
|
15
15
|
popupsScrollableElement?: HTMLElement;
|
|
16
16
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
17
17
|
inputMethod?: TypeAheadInputMethod;
|
|
18
|
-
useBetterTypeaheadNavigation: boolean;
|
|
19
18
|
};
|
|
20
19
|
export declare const WrapperTypeAhead: React.FC<WrapperProps>;
|
|
21
20
|
export {};
|
|
@@ -18,9 +18,8 @@ export declare const findHandlerByTrigger: ({ trigger, editorState, }: {
|
|
|
18
18
|
type MoveSelectedIndexProps = {
|
|
19
19
|
editorView: EditorView;
|
|
20
20
|
direction: 'next' | 'previous';
|
|
21
|
-
useBetterTypeaheadNavigation?: boolean;
|
|
22
21
|
};
|
|
23
|
-
export declare const moveSelectedIndex: ({ editorView, direction
|
|
22
|
+
export declare const moveSelectedIndex: ({ editorView, direction }: MoveSelectedIndexProps) => () => void;
|
|
24
23
|
type TypeAheadAssistiveLabels = {
|
|
25
24
|
popupAriaLabel: string;
|
|
26
25
|
listItemAriaLabel?: string;
|
package/package.json
CHANGED
package/report.api.md
CHANGED
|
@@ -41,7 +41,7 @@ import type { ConfigWithNodeInfo } from '@atlaskit/editor-plugin-floating-toolba
|
|
|
41
41
|
import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
|
|
42
42
|
import type { ContextUpdateHandler } from '@atlaskit/editor-common/types';
|
|
43
43
|
import { createTable } from '@atlaskit/editor-plugin-table/commands';
|
|
44
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
44
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
45
45
|
import type { CreateUIAnalyticsEvent as CreateUIAnalyticsEvent_2 } from '@atlaskit/analytics-next/types';
|
|
46
46
|
import { darkModeStatusColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
47
47
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -2216,7 +2216,6 @@ export const typeAheadPluginKey: PluginKey<TypeAheadPluginState>;
|
|
|
2216
2216
|
type TypeAheadPluginOptions = {
|
|
2217
2217
|
isMobile?: boolean;
|
|
2218
2218
|
createAnalyticsEvent?: CreateUIAnalyticsEvent_2;
|
|
2219
|
-
useBetterTypeaheadNavigation?: boolean;
|
|
2220
2219
|
};
|
|
2221
2220
|
|
|
2222
2221
|
// @public (undocumented)
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ import type { ConfigWithNodeInfo } from '@atlaskit/editor-plugin-floating-toolba
|
|
|
30
30
|
import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
|
|
31
31
|
import type { ContextUpdateHandler } from '@atlaskit/editor-common/types';
|
|
32
32
|
import { createTable } from '@atlaskit/editor-plugin-table/commands';
|
|
33
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
33
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
34
34
|
import type { CreateUIAnalyticsEvent as CreateUIAnalyticsEvent_2 } from '@atlaskit/analytics-next/types';
|
|
35
35
|
import { darkModeStatusColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
36
36
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -1972,7 +1972,6 @@ export const typeAheadPluginKey: PluginKey<TypeAheadPluginState>;
|
|
|
1972
1972
|
type TypeAheadPluginOptions = {
|
|
1973
1973
|
isMobile?: boolean;
|
|
1974
1974
|
createAnalyticsEvent?: CreateUIAnalyticsEvent_2;
|
|
1975
|
-
useBetterTypeaheadNavigation?: boolean;
|
|
1976
1975
|
};
|
|
1977
1976
|
|
|
1978
1977
|
// @public (undocumented)
|