@atlaskit/jql-editor 5.5.0 → 5.5.2

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/analytics/util.js +1 -1
  3. package/dist/es2019/analytics/util.js +1 -1
  4. package/dist/esm/analytics/util.js +1 -1
  5. package/dist/types/analytics/listener/types.d.ts +2 -2
  6. package/dist/types/hooks/use-editor-theme/index.d.ts +6 -6
  7. package/dist/types/plugins/autocomplete/components/autocomplete-dropdown/index.d.ts +2 -2
  8. package/dist/types/plugins/autocomplete/components/autocomplete-option/index.d.ts +1 -1
  9. package/dist/types/plugins/autocomplete/components/autocomplete-option/styled.d.ts +1 -1
  10. package/dist/types/plugins/autocomplete/components/types.d.ts +5 -5
  11. package/dist/types/plugins/rich-inline-nodes/nodes/types.d.ts +1 -1
  12. package/dist/types/plugins/rich-inline-nodes/nodes/user/index.d.ts +1 -1
  13. package/dist/types/plugins/rich-inline-nodes/nodes/user/styled.d.ts +1 -1
  14. package/dist/types/plugins/rich-inline-nodes/util/react-node-view.d.ts +1 -1
  15. package/dist/types/plugins/types.d.ts +4 -4
  16. package/dist/types/plugins/validation-tooltip/view.d.ts +1 -1
  17. package/dist/types/state/types.d.ts +89 -89
  18. package/dist/types/ui/error-boundary/index.d.ts +8 -8
  19. package/dist/types/ui/jql-editor/types.d.ts +44 -44
  20. package/dist/types/ui/jql-editor-controls-content/base-expand-toggle/index.d.ts +1 -1
  21. package/dist/types/ui/jql-editor-layout/index.d.ts +17 -17
  22. package/dist/types/ui/jql-editor-layout/styled.d.ts +3 -3
  23. package/dist/types/ui/jql-editor-portal-provider/types.d.ts +5 -5
  24. package/dist/types-ts4.5/analytics/listener/types.d.ts +2 -2
  25. package/dist/types-ts4.5/hooks/use-editor-theme/index.d.ts +6 -6
  26. package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete-dropdown/index.d.ts +2 -2
  27. package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete-option/index.d.ts +1 -1
  28. package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete-option/styled.d.ts +1 -1
  29. package/dist/types-ts4.5/plugins/autocomplete/components/types.d.ts +5 -5
  30. package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/types.d.ts +1 -1
  31. package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/user/index.d.ts +1 -1
  32. package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/user/styled.d.ts +1 -1
  33. package/dist/types-ts4.5/plugins/rich-inline-nodes/util/react-node-view.d.ts +1 -1
  34. package/dist/types-ts4.5/plugins/types.d.ts +4 -4
  35. package/dist/types-ts4.5/plugins/validation-tooltip/view.d.ts +1 -1
  36. package/dist/types-ts4.5/state/types.d.ts +89 -89
  37. package/dist/types-ts4.5/ui/error-boundary/index.d.ts +8 -8
  38. package/dist/types-ts4.5/ui/jql-editor/types.d.ts +44 -44
  39. package/dist/types-ts4.5/ui/jql-editor-controls-content/base-expand-toggle/index.d.ts +1 -1
  40. package/dist/types-ts4.5/ui/jql-editor-layout/index.d.ts +17 -17
  41. package/dist/types-ts4.5/ui/jql-editor-layout/styled.d.ts +3 -3
  42. package/dist/types-ts4.5/ui/jql-editor-portal-provider/types.d.ts +5 -5
  43. package/package.json +3 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/jql-editor
2
2
 
3
+ ## 5.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`92b1368d9607d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/92b1368d9607d) -
8
+ Sorted type and interface props to improve Atlaskit docs
9
+ - Updated dependencies
10
+
11
+ ## 5.5.1
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 5.5.0
4
18
 
5
19
  ### Minor Changes
@@ -6,5 +6,5 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.useJqlEditorAnalytics = void 0;
7
7
  var _jqlEditorCommon = require("@atlaskit/jql-editor-common");
8
8
  var useJqlEditorAnalytics = exports.useJqlEditorAnalytics = function useJqlEditorAnalytics(analyticsSource) {
9
- return (0, _jqlEditorCommon.useJqlPackageAnalytics)(analyticsSource, "@atlaskit/jql-editor", "5.4.6", _jqlEditorCommon.ANALYTICS_CHANNEL);
9
+ return (0, _jqlEditorCommon.useJqlPackageAnalytics)(analyticsSource, "@atlaskit/jql-editor", "5.5.1", _jqlEditorCommon.ANALYTICS_CHANNEL);
10
10
  };
@@ -1,4 +1,4 @@
1
1
  import { ANALYTICS_CHANNEL, useJqlPackageAnalytics } from '@atlaskit/jql-editor-common';
2
2
  export const useJqlEditorAnalytics = analyticsSource => {
3
- return useJqlPackageAnalytics(analyticsSource, "@atlaskit/jql-editor", "5.4.6", ANALYTICS_CHANNEL);
3
+ return useJqlPackageAnalytics(analyticsSource, "@atlaskit/jql-editor", "5.5.1", ANALYTICS_CHANNEL);
4
4
  };
@@ -1,4 +1,4 @@
1
1
  import { ANALYTICS_CHANNEL, useJqlPackageAnalytics } from '@atlaskit/jql-editor-common';
2
2
  export var useJqlEditorAnalytics = function useJqlEditorAnalytics(analyticsSource) {
3
- return useJqlPackageAnalytics(analyticsSource, "@atlaskit/jql-editor", "5.4.6", ANALYTICS_CHANNEL);
3
+ return useJqlPackageAnalytics(analyticsSource, "@atlaskit/jql-editor", "5.5.1", ANALYTICS_CHANNEL);
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import { type GasPurePayload, type GasPureScreenEventPayload } from '@atlaskit/analytics-gas-types';
2
2
  export type AnalyticsWebClient = {
3
- sendUIEvent: (event: GasPurePayload) => void;
4
3
  sendOperationalEvent: (event: GasPurePayload) => void;
5
- sendTrackEvent: (event: GasPurePayload) => void;
6
4
  sendScreenEvent: (event: GasPureScreenEventPayload) => void;
5
+ sendTrackEvent: (event: GasPurePayload) => void;
6
+ sendUIEvent: (event: GasPurePayload) => void;
7
7
  };
@@ -12,26 +12,26 @@ export type EditorTheme = {
12
12
  */
13
13
  expandedRows: number;
14
14
  /**
15
- * Toggle the editor view expanded state.
15
+ * `false` matches AK's default field styling
16
+ * `true` matches AK's compact field styling, generally used for search purposes.
16
17
  */
17
- toggleExpanded: () => void;
18
+ isCompact: boolean;
18
19
  /**
19
20
  * `true` shows search button, other search related elements
20
21
  * `false` to act as a text field
21
22
  */
22
23
  isSearch: boolean;
23
24
  /**
24
- * `false` matches AK's default field styling
25
- * `true` matches AK's compact field styling, generally used for search purposes.
25
+ * Toggle the editor view expanded state.
26
26
  */
27
- isCompact: boolean;
27
+ toggleExpanded: () => void;
28
28
  };
29
29
  export declare const EditorThemeContext: import("react").Context<EditorTheme>;
30
30
  /**
31
31
  * Hook to manage the theming state of the editor.
32
32
  */
33
33
  export declare const useEditorTheme: ({ isSearch, isCompact, }: {
34
- isSearch?: boolean;
35
34
  isCompact?: boolean;
35
+ isSearch?: boolean;
36
36
  }) => EditorTheme;
37
37
  export declare const useEditorThemeContext: () => EditorTheme;
@@ -2,10 +2,10 @@ import React from 'react';
2
2
  import { type PluginKeymap } from '../../../common/plugin-keymap';
3
3
  import { type AutocompleteAnalyticsAttributes, type SelectableAutocompleteOption } from '../types';
4
4
  type Props = {
5
- options: SelectableAutocompleteOption[];
6
- loading: boolean;
7
5
  keymap: PluginKeymap;
6
+ loading: boolean;
8
7
  onClick: (option: SelectableAutocompleteOption, analyticsAttributes: AutocompleteAnalyticsAttributes) => void;
8
+ options: SelectableAutocompleteOption[];
9
9
  };
10
10
  declare const AutocompleteDropdown: ({ options, loading, keymap, onClick }: Props) => React.JSX.Element | null;
11
11
  export default AutocompleteDropdown;
@@ -2,9 +2,9 @@ import React from 'react';
2
2
  import { type SelectableAutocompleteOption } from '../types';
3
3
  type Props = {
4
4
  isSelected: boolean;
5
- option: SelectableAutocompleteOption;
6
5
  onClick: () => void;
7
6
  onMouseMove: () => void;
7
+ option: SelectableAutocompleteOption;
8
8
  };
9
9
  declare const AutocompleteOption: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLLIElement>>;
10
10
  export default AutocompleteOption;
@@ -6,8 +6,8 @@ export declare const OptionListItem: import("@emotion/styled").StyledComponent<{
6
6
  theme?: import("@emotion/react").Theme;
7
7
  as?: React.ElementType;
8
8
  } & {
9
- isSelected: boolean;
10
9
  isDeprecated: boolean;
10
+ isSelected: boolean;
11
11
  }, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
12
12
  export declare const OptionName: import("@emotion/styled").StyledComponent<{
13
13
  theme?: import("@emotion/react").Theme;
@@ -4,9 +4,9 @@ import { type PluginKeymap } from '../../common/plugin-keymap';
4
4
  export type { AutocompleteProvider, AutocompleteOptions, AutocompleteOption, AutocompleteValueType, } from '@atlaskit/jql-editor-common';
5
5
  export type AutocompleteOptionType = 'field' | 'operator' | 'value' | 'function' | 'keyword';
6
6
  export type AutocompleteOptionExtra = {
7
- replacePosition: Position;
8
7
  context: JQLRuleContext | null;
9
8
  matchedText: string;
9
+ replacePosition: Position;
10
10
  type: AutocompleteOptionType;
11
11
  };
12
12
  export type SelectableAutocompleteOption = AutocompleteOption & AutocompleteOptionExtra & {
@@ -14,15 +14,15 @@ export type SelectableAutocompleteOption = AutocompleteOption & AutocompleteOpti
14
14
  };
15
15
  export type SelectableAutocompleteOptions = SelectableAutocompleteOption[];
16
16
  export type AutocompleteOptionGroup = {
17
- tokens: SelectableAutocompleteOptions;
18
17
  fields: SelectableAutocompleteOptions;
18
+ functions: SelectableAutocompleteOptions;
19
19
  operators: SelectableAutocompleteOptions;
20
+ tokens: SelectableAutocompleteOptions;
20
21
  values: SelectableAutocompleteOptions;
21
- functions: SelectableAutocompleteOptions;
22
22
  };
23
23
  export type AutocompletePosition = {
24
- top: number;
25
24
  left: number;
25
+ top: number;
26
26
  };
27
27
  export type AutocompleteProps = {
28
28
  keymap: PluginKeymap;
@@ -30,9 +30,9 @@ export type AutocompleteProps = {
30
30
  };
31
31
  export type AutocompleteAnalyticsAttributes = {
32
32
  keyboard: boolean;
33
+ nodeType: string;
33
34
  numberOfOptions: number;
34
35
  optionIndex: number;
35
36
  optionType: AutocompleteOptionType;
36
37
  queryLength: number;
37
- nodeType: string;
38
38
  };
@@ -2,8 +2,8 @@ import { type FunctionComponent } from 'react';
2
2
  import { type AttributeSpec } from '@atlaskit/editor-prosemirror/model';
3
3
  import { type NodeViewProps } from '../util/react-node-view';
4
4
  export type JQLNodeSpec<Props> = {
5
- component: FunctionComponent<NodeViewProps<Props>>;
6
5
  attrs: {
7
6
  [name: string]: AttributeSpec;
8
7
  };
8
+ component: FunctionComponent<NodeViewProps<Props>>;
9
9
  };
@@ -1,7 +1,7 @@
1
1
  import { type JQLNodeSpec } from '../types';
2
2
  export type Props = {
3
+ fieldName: string;
3
4
  id: string;
4
5
  name: string;
5
- fieldName: string;
6
6
  };
7
7
  export declare const user: JQLNodeSpec<Props>;
@@ -2,8 +2,8 @@ export declare const UserContainer: import("@emotion/styled").StyledComponent<{
2
2
  theme?: import("@emotion/react").Theme;
3
3
  as?: React.ElementType;
4
4
  } & {
5
- selected: boolean;
6
5
  error: boolean;
6
+ selected: boolean;
7
7
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
8
8
  export declare const NameContainer: import("@emotion/styled").StyledComponent<{
9
9
  theme?: import("@emotion/react").Theme;
@@ -3,8 +3,8 @@ import { type Node } from '@atlaskit/editor-prosemirror/model';
3
3
  import { type Decoration, type NodeView } from '@atlaskit/editor-prosemirror/view';
4
4
  import { type PortalActions } from '../../../ui/jql-editor-portal-provider/types';
5
5
  export type NodeViewProps<Props> = Props & {
6
- selected: boolean;
7
6
  error: boolean;
7
+ selected: boolean;
8
8
  };
9
9
  export declare class ReactNodeView<Props> implements NodeView {
10
10
  private readonly component;
@@ -1,16 +1,16 @@
1
1
  export type { AutocompleteProvider, AutocompleteOptions, AutocompleteOption, AutocompleteValueType, } from './autocomplete/types';
2
2
  export type PluginContainers = {
3
3
  /**
4
- * Container for plugin components which should be appended to the top level container element.
4
+ * Container for plugin components which should be appended at the end of the editor input.
5
5
  */
6
- main?: HTMLElement;
6
+ editor_controls?: HTMLElement;
7
7
  /**
8
8
  * Container for plugin components which should be appended to the footer underneath the editor input.
9
9
  */
10
10
  footer?: HTMLElement;
11
11
  /**
12
- * Container for plugin components which should be appended at the end of the editor input.
12
+ * Container for plugin components which should be appended to the top level container element.
13
13
  */
14
- editor_controls?: HTMLElement;
14
+ main?: HTMLElement;
15
15
  };
16
16
  export type PluginContainerKey = keyof PluginContainers;
@@ -2,10 +2,10 @@ import { type EditorState } from '@atlaskit/editor-prosemirror/state';
2
2
  import { type EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import { JQLSyntaxError } from '@atlaskit/jql-ast';
4
4
  type Coords = {
5
+ bottom: number;
5
6
  left: number;
6
7
  right: number;
7
8
  top: number;
8
- bottom: number;
9
9
  };
10
10
  export declare class ValidationTooltipPluginView {
11
11
  tooltip: HTMLElement;
@@ -13,8 +13,8 @@ export type ContextAwareTokenSuggestions = TokenSuggestions & {
13
13
  context?: JQLRuleContext;
14
14
  };
15
15
  export type ContextAwareJQLSuggestions = {
16
- tokens: ContextAwareTokenSuggestions;
17
16
  rules: JQLRuleSuggestions;
17
+ tokens: ContextAwareTokenSuggestions;
18
18
  };
19
19
  /**
20
20
  * Analytic attributes emitted whenever external JQL errors are viewed in the UI.
@@ -32,44 +32,44 @@ export type ExternalErrorAttributes = {
32
32
  */
33
33
  export type ExternalError = {
34
34
  /**
35
- * Type of the message.
35
+ * Optional identifying error type when a syntax error has occurred. This should be one of the types defined in the
36
+ * `JqlSyntaxQueryErrorExtension` node of the Atlassian GraphQL schema.
36
37
  */
37
- type: 'error';
38
+ errorType?: string;
38
39
  /**
39
40
  * Message to display.
40
41
  */
41
42
  message: ReactNode;
42
43
  /**
43
- * Optional identifying error type when a syntax error has occurred. This should be one of the types defined in the
44
- * `JqlSyntaxQueryErrorExtension` node of the Atlassian GraphQL schema.
44
+ * Type of the message.
45
45
  */
46
- errorType?: string;
46
+ type: 'error';
47
47
  };
48
48
  export type ExternalWarning = {
49
+ /**
50
+ * Message to display.
51
+ */
52
+ message: ReactNode;
49
53
  /**
50
54
  * Type of the message.
51
55
  */
52
56
  type: 'warning';
57
+ };
58
+ export type ExternalInfo = {
53
59
  /**
54
60
  * Message to display.
55
61
  */
56
62
  message: ReactNode;
57
- };
58
- export type ExternalInfo = {
59
63
  /**
60
64
  * Type of the message.
61
65
  */
62
66
  type: 'info';
63
- /**
64
- * Message to display.
65
- */
66
- message: ReactNode;
67
67
  };
68
68
  export type CustomErrorComponent = React.ComponentType<PropsWithChildren<{
69
- testId: string;
70
- editorTheme: EditorTheme;
71
69
  editorId: string;
70
+ editorTheme: EditorTheme;
72
71
  errorMessages: React.ReactElement[];
72
+ testId: string;
73
73
  validationId: string;
74
74
  }>>;
75
75
  export type CustomErrorMessageProps = Omit<React.ComponentProps<CustomErrorComponent>, 'editorTheme'> & {
@@ -81,77 +81,81 @@ export type CustomComponents = {
81
81
  export type ExternalMessage = ExternalError | ExternalWarning | ExternalInfo;
82
82
  export type ExternalMessagesNormalized = {
83
83
  errors: ExternalError[];
84
- warnings: ExternalWarning[];
85
84
  infos: ExternalInfo[];
85
+ warnings: ExternalWarning[];
86
86
  };
87
87
  export type AutocompletePosition = {
88
- top: number;
89
88
  left: number;
89
+ top: number;
90
90
  };
91
91
  export type OptionsKey = keyof Omit<AutocompleteOptionGroup, 'tokens'>;
92
92
  export type AutocompleteState = {
93
93
  /**
94
- * ID of the currently selected autocomplete option, or `undefined` if no option is selected.
95
- */
96
- selectedOptionId: string | undefined;
97
- /**
98
- * Forces autocomplete to stay closed on next update, which is the desired behavior when:
99
- * - we select an autocomplete option
100
- * - we navigate the query with arrow keys
94
+ * Subscription for a debounced autocomplete analytics event. This allows the event to be cancelled upon a new request.
101
95
  */
102
- shouldStayClosedOnNextUpdate: boolean;
96
+ analyticsSubscription: Subscription | null;
103
97
  /**
104
- * Manages current autocomplete visibility state, derived from `shouldStayClosedOnNextUpdate`.
98
+ * Reference to the autocomplete container DOM element.
105
99
  */
106
- shouldStayClosed: boolean;
100
+ container: HTMLElement | null;
107
101
  /**
108
102
  * Determines if autocomplete options are currently being loaded.
109
103
  */
110
104
  loading: boolean;
105
+ /**
106
+ * Provides information about autocomplete offset parent's size and its position relative to the viewport.
107
+ * This is used to calculate autocomplete dropdown position.
108
+ */
109
+ offsetParentRect: DOMRectReadOnly | undefined;
111
110
  /**
112
111
  * Autocomplete options returned by autocomplete provider functions.
113
112
  */
114
113
  options: AutocompleteOptionGroup;
115
114
  /**
116
- * Autocomplete provider is an Observable based API. This references any in-flight subscription so we can cancel it
117
- * upon a new request.
115
+ * Computed replace position start for the current set of autocomplete options.
116
+ * We use this position to derive autocomplete dropdown coordinates.
118
117
  */
119
- subscription: Subscription | null;
118
+ replacePositionStart: number;
120
119
  /**
121
- * Subscription for a debounced autocomplete analytics event. This allows the event to be cancelled upon a new request.
120
+ * ID of the currently selected autocomplete option, or `undefined` if no option is selected.
122
121
  */
123
- analyticsSubscription: Subscription | null;
122
+ selectedOptionId: string | undefined;
124
123
  /**
125
- * Reference to the autocomplete container DOM element.
124
+ * Manages current autocomplete visibility state, derived from `shouldStayClosedOnNextUpdate`.
126
125
  */
127
- container: HTMLElement | null;
126
+ shouldStayClosed: boolean;
128
127
  /**
129
- * Provides information about autocomplete offset parent's size and its position relative to the viewport.
130
- * This is used to calculate autocomplete dropdown position.
128
+ * Forces autocomplete to stay closed on next update, which is the desired behavior when:
129
+ * - we select an autocomplete option
130
+ * - we navigate the query with arrow keys
131
131
  */
132
- offsetParentRect: DOMRectReadOnly | undefined;
132
+ shouldStayClosedOnNextUpdate: boolean;
133
133
  /**
134
- * Computed replace position start for the current set of autocomplete options.
135
- * We use this position to derive autocomplete dropdown coordinates.
134
+ * Autocomplete provider is an Observable based API. This references any in-flight subscription so we can cancel it
135
+ * upon a new request.
136
136
  */
137
- replacePositionStart: number;
137
+ subscription: Subscription | null;
138
138
  };
139
139
  export type HydratedValuesMap = {
140
140
  [fieldName: string]: Map<string, HydratedValue>;
141
141
  };
142
142
  export type State = {
143
143
  /**
144
- * The controlled query prop passed to the container.
144
+ * State managed by the autocomplete plugin.
145
145
  */
146
- controlledQuery: string;
146
+ autocomplete: AutocompleteState;
147
147
  /**
148
- * The current query string in the JQL editor.
148
+ * Provider object to fetch autocomplete data.
149
149
  */
150
- query: string;
150
+ autocompleteProvider: AutocompleteProvider;
151
151
  /**
152
- * Custom messages to display.
152
+ * The controlled query prop passed to the container.
153
153
  */
154
- externalMessages: ExternalMessage[];
154
+ controlledQuery: string;
155
+ /**
156
+ * Custom components to take over the rendering of certain parts of the jql editor
157
+ */
158
+ customComponents?: CustomComponents;
155
159
  /**
156
160
  * The current Prosemirror editor state.
157
161
  */
@@ -160,68 +164,60 @@ export type State = {
160
164
  * The Prosemirror editor view mounted to the DOM, or `undefined` if the view has not been initialised.
161
165
  */
162
166
  editorView: EditorView | undefined;
163
- /**
164
- * Flag to enable the searching indicator when a JQL search is in progress.
165
- */
166
- isSearching: boolean | undefined;
167
- /**
168
- * Mutable reference to a react-intl object.
169
- */
170
- intlRef: MutableRefObject<IntlShape>;
171
- /**
172
- * Provider object to fetch autocomplete data.
173
- */
174
- autocompleteProvider: AutocompleteProvider;
175
- /**
176
- * Prefix to use when computing id's for DOM elements (to allow multiple editors rendered on the same page).
177
- */
178
- idPrefix: string;
179
167
  /**
180
168
  * ID of the timeout used before setting `editorViewHasFocus=false`. This gives an opportunity for the timeout to be
181
169
  * cleared if another element within the context receives focus.
182
170
  */
183
171
  editorViewBlurTimeout: number | null;
184
172
  /**
185
- * Flag to determine whether the editor view (or autocomplete dropdown) currently has focus.
173
+ * Reference to the editor view container (scrollable element that contains line numbers and editor view).
186
174
  */
187
- editorViewHasFocus: boolean;
175
+ editorViewContainer: HTMLElement | undefined;
188
176
  /**
189
- * Flag to determine whether line numbers should be shown in the editor.
177
+ * Provides information about editor view container size and its position relative to the viewport.
178
+ * Can be used to position portals in relation to the editor, ensure they don't exceed its dimensions, etc.
190
179
  */
191
- lineNumbersVisible: boolean;
180
+ editorViewContainerRect: DOMRectReadOnly | undefined;
192
181
  /**
193
- * The first JQL parse error of the last submitted query, or {@code null} if there were no errors.
182
+ * Number of pixels that the editor view container is currently scrolled vertically (Y axis).
194
183
  */
195
- jqlError: JQLParseError | null;
184
+ editorViewContainerScroll: number;
196
185
  /**
197
- * State managed by the autocomplete plugin.
186
+ * Flag to determine whether the editor view (or autocomplete dropdown) currently has focus.
198
187
  */
199
- autocomplete: AutocompleteState;
188
+ editorViewHasFocus: boolean;
200
189
  /**
201
190
  * Whether rich inline nodes feature should be enabled.
202
191
  */
203
192
  enableRichInlineNodes: boolean;
193
+ /**
194
+ * Custom messages to display.
195
+ */
196
+ externalMessages: ExternalMessage[];
204
197
  /**
205
198
  * Map of hydrated values.
206
199
  */
207
200
  hydratedValues: HydratedValuesMap;
208
201
  /**
209
- * Reference to the ResizeObserver object used to process size changes within the editor.
202
+ * Prefix to use when computing id's for DOM elements (to allow multiple editors rendered on the same page).
210
203
  */
211
- resizeObserver: ResizeObserver | undefined;
204
+ idPrefix: string;
212
205
  /**
213
- * Reference to the editor view container (scrollable element that contains line numbers and editor view).
206
+ * Mutable reference to a react-intl object.
214
207
  */
215
- editorViewContainer: HTMLElement | undefined;
208
+ intlRef: MutableRefObject<IntlShape>;
216
209
  /**
217
- * Provides information about editor view container size and its position relative to the viewport.
218
- * Can be used to position portals in relation to the editor, ensure they don't exceed its dimensions, etc.
210
+ * Flag to enable the searching indicator when a JQL search is in progress.
219
211
  */
220
- editorViewContainerRect: DOMRectReadOnly | undefined;
212
+ isSearching: boolean | undefined;
221
213
  /**
222
- * Number of pixels that the editor view container is currently scrolled vertically (Y axis).
214
+ * The first JQL parse error of the last submitted query, or {@code null} if there were no errors.
223
215
  */
224
- editorViewContainerScroll: number;
216
+ jqlError: JQLParseError | null;
217
+ /**
218
+ * Flag to determine whether line numbers should be shown in the editor.
219
+ */
220
+ lineNumbersVisible: boolean;
225
221
  /**
226
222
  * Called when we want to debug a particular error or action that has occurred within the editor. The message may
227
223
  * contain PII, and as such consumers should treat as a privacy unsafe error.
@@ -235,27 +231,31 @@ export type State = {
235
231
  */
236
232
  onSyntaxHelp?: (e: MouseEvent<HTMLElement>) => boolean;
237
233
  /**
238
- * Custom components to take over the rendering of certain parts of the jql editor
234
+ * The current query string in the JQL editor.
239
235
  */
240
- customComponents?: CustomComponents;
236
+ query: string;
237
+ /**
238
+ * Reference to the ResizeObserver object used to process size changes within the editor.
239
+ */
240
+ resizeObserver: ResizeObserver | undefined;
241
241
  };
242
242
  export type DebugMessageEventAttribute = string | number | boolean | void | null;
243
243
  export type Props = {
244
- query: string;
244
+ autocompleteProvider: AutocompleteProvider;
245
+ createAndFireAnalyticsEvent: (payload: JqlEditorAnalyticsEvent) => void;
246
+ customComponents?: CustomComponents;
247
+ enableRichInlineNodes: boolean;
245
248
  externalMessages: ExternalMessage[];
246
- isSearching: boolean | undefined;
247
249
  intlRef: MutableRefObject<IntlShape>;
248
- createAndFireAnalyticsEvent: (payload: JqlEditorAnalyticsEvent) => void;
249
- onEditorMounted?: () => void;
250
+ isSearching: boolean | undefined;
250
251
  onDebugUnsafeMessage?: (message: string, event: {
251
252
  [key: string]: DebugMessageEventAttribute;
252
253
  }) => void;
254
+ onEditorMounted?: () => void;
255
+ onFocus?: (e: FocusEvent<HTMLElement>) => void;
253
256
  onHydrate?: (query: string) => Promise<HydratedValues>;
254
- onUpdate?: (query: string, jast: Jast) => void;
255
257
  onSearch?: (query: string, jast: Jast) => void;
256
- autocompleteProvider: AutocompleteProvider;
257
- enableRichInlineNodes: boolean;
258
258
  onSyntaxHelp?: (e: MouseEvent<HTMLElement>) => boolean;
259
- onFocus?: (e: FocusEvent<HTMLElement>) => void;
260
- customComponents?: CustomComponents;
259
+ onUpdate?: (query: string, jast: Jast) => void;
260
+ query: string;
261
261
  };
@@ -2,24 +2,24 @@ import React, { type ComponentClass, type FunctionComponent } from 'react';
2
2
  import { type JQLEditorUIProps } from '../jql-editor/types';
3
3
  type WithErrorBoundaryProps = {
4
4
  /**
5
- * Called if an unexpected error is thrown while rendering the editor.
5
+ * To adjust size of the editor
6
+ * `false` matches AK's default field styling
7
+ * `true` matches AK's compact field styling, used for search purposes
6
8
  */
7
- onRenderError?: (error: Error) => void;
9
+ isCompact?: boolean;
8
10
  /**
9
- * The query to render in the editor.
11
+ * Called if an unexpected error is thrown while rendering the editor.
10
12
  */
11
- query: string;
13
+ onRenderError?: (error: Error) => void;
12
14
  /**
13
15
  * Called every time the search command is given in the editor with the current query value and respective Jast object.
14
16
  * If not passed, hides the search button/other search related functionality, allowing this to be usable as a form field.
15
17
  */
16
18
  onSearch?: JQLEditorUIProps['onSearch'];
17
19
  /**
18
- * To adjust size of the editor
19
- * `false` matches AK's default field styling
20
- * `true` matches AK's compact field styling, used for search purposes
20
+ * The query to render in the editor.
21
21
  */
22
- isCompact?: boolean;
22
+ query: string;
23
23
  };
24
24
  export declare const withErrorBoundary: <Props extends WithErrorBoundaryProps>(WrappedComponent: FunctionComponent<Props> | ComponentClass<Props>) => (props: Props) => React.JSX.Element;
25
25
  export {};