@atlaskit/jql-editor 6.1.1 → 6.2.0

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 (52) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/analytics/util.js +1 -1
  3. package/dist/cjs/plugins/autocomplete/view.js +17 -1
  4. package/dist/cjs/plugins/rich-inline-nodes/nodes/base/index.js +3 -2
  5. package/dist/cjs/plugins/rich-inline-nodes/nodes/goal/goal-icon.js +46 -0
  6. package/dist/cjs/plugins/rich-inline-nodes/nodes/goal/goal-node.compiled.css +3 -0
  7. package/dist/cjs/plugins/rich-inline-nodes/nodes/goal/goal-node.js +56 -0
  8. package/dist/cjs/plugins/rich-inline-nodes/nodes/goal/index.js +15 -0
  9. package/dist/cjs/plugins/rich-inline-nodes/nodes/goal/types.js +1 -0
  10. package/dist/cjs/plugins/rich-inline-nodes/nodes/index.js +3 -1
  11. package/dist/cjs/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +9 -1
  12. package/dist/cjs/state/index.js +40 -31
  13. package/dist/cjs/ui/jql-editor-footer-content/jql-messages/warnings/messages.js +1 -1
  14. package/dist/es2019/analytics/util.js +1 -1
  15. package/dist/es2019/plugins/autocomplete/view.js +17 -1
  16. package/dist/es2019/plugins/rich-inline-nodes/nodes/base/index.js +3 -2
  17. package/dist/es2019/plugins/rich-inline-nodes/nodes/goal/goal-icon.js +35 -0
  18. package/dist/es2019/plugins/rich-inline-nodes/nodes/goal/goal-node.compiled.css +3 -0
  19. package/dist/es2019/plugins/rich-inline-nodes/nodes/goal/goal-node.js +46 -0
  20. package/dist/es2019/plugins/rich-inline-nodes/nodes/goal/index.js +9 -0
  21. package/dist/es2019/plugins/rich-inline-nodes/nodes/goal/types.js +0 -0
  22. package/dist/es2019/plugins/rich-inline-nodes/nodes/index.js +3 -1
  23. package/dist/es2019/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +10 -1
  24. package/dist/es2019/state/index.js +12 -2
  25. package/dist/es2019/ui/jql-editor-footer-content/jql-messages/warnings/messages.js +1 -1
  26. package/dist/esm/analytics/util.js +1 -1
  27. package/dist/esm/plugins/autocomplete/view.js +17 -1
  28. package/dist/esm/plugins/rich-inline-nodes/nodes/base/index.js +3 -2
  29. package/dist/esm/plugins/rich-inline-nodes/nodes/goal/goal-icon.js +39 -0
  30. package/dist/esm/plugins/rich-inline-nodes/nodes/goal/goal-node.compiled.css +3 -0
  31. package/dist/esm/plugins/rich-inline-nodes/nodes/goal/goal-node.js +49 -0
  32. package/dist/esm/plugins/rich-inline-nodes/nodes/goal/index.js +9 -0
  33. package/dist/esm/plugins/rich-inline-nodes/nodes/goal/types.js +0 -0
  34. package/dist/esm/plugins/rich-inline-nodes/nodes/index.js +3 -1
  35. package/dist/esm/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +9 -1
  36. package/dist/esm/state/index.js +39 -30
  37. package/dist/esm/ui/jql-editor-footer-content/jql-messages/warnings/messages.js +1 -1
  38. package/dist/types/plugins/rich-inline-nodes/nodes/base/types.d.ts +1 -0
  39. package/dist/types/plugins/rich-inline-nodes/nodes/goal/goal-icon.d.ts +12 -0
  40. package/dist/types/plugins/rich-inline-nodes/nodes/goal/goal-node.d.ts +10 -0
  41. package/dist/types/plugins/rich-inline-nodes/nodes/goal/index.d.ts +3 -0
  42. package/dist/types/plugins/rich-inline-nodes/nodes/goal/types.d.ts +5 -0
  43. package/dist/types/plugins/rich-inline-nodes/nodes/index.d.ts +1 -0
  44. package/dist/types/state/index.d.ts +36 -1
  45. package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/base/types.d.ts +1 -0
  46. package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/goal/goal-icon.d.ts +16 -0
  47. package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/goal/goal-node.d.ts +10 -0
  48. package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/goal/index.d.ts +3 -0
  49. package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/goal/types.d.ts +5 -0
  50. package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/index.d.ts +1 -0
  51. package/dist/types-ts4.5/state/index.d.ts +36 -1
  52. package/package.json +16 -8
@@ -9,6 +9,7 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
9
9
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
10
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
11
11
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
12
+ import FeatureGates from '@atlaskit/feature-gate-js-client';
12
13
  import { isListOperator } from '@atlaskit/jql-ast';
13
14
  import { fg } from '@atlaskit/platform-feature-flags';
14
15
  import getDocumentPosition from '../common/get-document-position';
@@ -56,7 +57,7 @@ var AutocompletePluginView = /*#__PURE__*/function (_ReactPluginView) {
56
57
  if (_this.enableRichInlineNodes && option.type === 'value' && option.valueType === 'user') {
57
58
  transaction.setMeta('hydrate', true);
58
59
  }
59
- if (_this.enableRichInlineNodes && option.type === 'value' && (option.valueType === 'team' || option.valueType === 'project' && fg('projects_in_jira_eap_drop2'))) {
60
+ if (_this.enableRichInlineNodes && option.type === 'value' && (option.valueType === 'team' || option.valueType === 'goal' && FeatureGates.getExperimentValue('anip-1095-goals-in-harmonised-filter', 'isEnabled', false) || option.valueType === 'project' && fg('projects_in_jira_eap_drop2'))) {
60
61
  transaction.setMeta('hydrate', true);
61
62
  }
62
63
  var documentFrom = getDocumentPosition(transaction.doc, from);
@@ -122,6 +123,21 @@ var AutocompletePluginView = /*#__PURE__*/function (_ReactPluginView) {
122
123
  }
123
124
  break;
124
125
  }
126
+ case 'goal':
127
+ {
128
+ if (FeatureGates.getExperimentValue('anip-1095-goals-in-harmonised-filter', 'isEnabled', false)) {
129
+ var _attributes3 = {
130
+ type: 'goal',
131
+ id: value,
132
+ name: nameOnRichInlineNode !== null && nameOnRichInlineNode !== void 0 ? nameOnRichInlineNode : name,
133
+ fieldName: context === null || context === void 0 ? void 0 : context.field
134
+ };
135
+ nodes.push(_this.view.state.schema.nodes.goal.create(_attributes3, textContent));
136
+ } else {
137
+ nodes.push(textContent);
138
+ }
139
+ break;
140
+ }
125
141
  default:
126
142
  {
127
143
  nodes.push(textContent);
@@ -36,8 +36,9 @@ export var NodeBase = function NodeBase(props) {
36
36
  text = props.text,
37
37
  isLocked = props.isLocked,
38
38
  selected = props.selected,
39
- error = props.error;
40
- var isNewExperienceEnabled = FeatureGates.getExperimentValue('projects_in_jira_eap_drop2_fast_follow_filters', 'isEnabled', false);
39
+ error = props.error,
40
+ isRichNodeDisplay = props.isRichNodeDisplay;
41
+ var isNewExperienceEnabled = FeatureGates.getExperimentValue('projects_in_jira_eap_drop2_fast_follow_filters', 'isEnabled', false) || isRichNodeDisplay;
41
42
  return /*#__PURE__*/React.createElement(Pressable, _extends({
42
43
  xcss: cx(styles.nodeWrapper, !isNewExperienceEnabled && styles.nodeWrapperWithHeight, error && styles.nodeWrapperError, selected && (error ? styles.nodeWrapperErrorSelected : styles.nodeWrapperSelected))
43
44
  }, isNewExperienceEnabled ? {
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { IconTile } from '@atlaskit/icon';
3
+ import KeyResultIcon from '@atlaskit/icon/core/key-result';
4
+ import ObjectiveIcon from '@atlaskit/icon/core/objective';
5
+ var goalAppearances = ['DEFAULT', 'ON_TRACK', 'AT_RISK', 'OFF_TRACK', 'MENU'];
6
+ var GOAL_ICON_KEYS = ['GOAL', 'OBJECTIVE', 'KEY_RESULT'];
7
+ var isGoalAppearance = function isGoalAppearance(value) {
8
+ return goalAppearances.includes(value.toLocaleUpperCase());
9
+ };
10
+ export var isGoalIconKey = function isGoalIconKey(value) {
11
+ return GOAL_ICON_KEYS.includes(value);
12
+ };
13
+ var appearanceToColorMap = {
14
+ DEFAULT: 'gray',
15
+ MENU: 'gray',
16
+ OFF_TRACK: 'red',
17
+ AT_RISK: 'yellow',
18
+ ON_TRACK: 'green'
19
+ };
20
+ var keyToIconMap = {
21
+ GOAL: ObjectiveIcon,
22
+ OBJECTIVE: ObjectiveIcon,
23
+ KEY_RESULT: KeyResultIcon
24
+ };
25
+ export var GoalIcon = function GoalIcon(_ref) {
26
+ var _keyToIconMap;
27
+ var status = _ref.status,
28
+ size = _ref.size,
29
+ _ref$iconKey = _ref.iconKey,
30
+ iconKey = _ref$iconKey === void 0 ? 'GOAL' : _ref$iconKey;
31
+ var Icon = (_keyToIconMap = keyToIconMap[iconKey]) !== null && _keyToIconMap !== void 0 ? _keyToIconMap : keyToIconMap.GOAL;
32
+ var appearance = isGoalAppearance(status) ? status : 'DEFAULT';
33
+ return /*#__PURE__*/React.createElement(IconTile, {
34
+ size: size,
35
+ icon: Icon,
36
+ label: "",
37
+ appearance: appearanceToColorMap[appearance]
38
+ });
39
+ };
@@ -0,0 +1,3 @@
1
+ ._1e0c1txw{display:flex}
2
+ ._4t3i7vkz{height:1pc}
3
+ ._kqswh2mm{position:relative}
@@ -0,0 +1,49 @@
1
+ /* goal-node.tsx generated by @compiled/babel-plugin v0.39.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
+ var _excluded = ["id", "fieldName", "name"];
6
+ import "./goal-node.compiled.css";
7
+ import { ax, ix } from "@compiled/react/runtime";
8
+ import React from 'react';
9
+ import { Box } from '@atlaskit/primitives/compiled';
10
+ import { useHydratedGoal } from '../../../../state';
11
+ import { NodeBase } from '../base';
12
+ import { GoalIcon, isGoalIconKey } from './goal-icon';
13
+ var styles = {
14
+ iconWrapper: "_1e0c1txw _4t3i7vkz _kqswh2mm"
15
+ };
16
+ function toGoalIconKey(iconKey) {
17
+ return iconKey && isGoalIconKey(iconKey) ? iconKey : 'GOAL';
18
+ }
19
+
20
+ /**
21
+ * GoalNode Component
22
+ *
23
+ * This component is a component for rendering a pill-like view for Goal node type
24
+ * in the JQL editor
25
+ */
26
+ export var GoalNode = function GoalNode(props) {
27
+ var _goal$status;
28
+ var id = props.id,
29
+ fieldName = props.fieldName,
30
+ name = props.name,
31
+ rest = _objectWithoutProperties(props, _excluded);
32
+ var _useHydratedGoal = useHydratedGoal({
33
+ id: id,
34
+ fieldName: fieldName
35
+ }),
36
+ _useHydratedGoal2 = _slicedToArray(_useHydratedGoal, 1),
37
+ goal = _useHydratedGoal2[0];
38
+ return /*#__PURE__*/React.createElement(NodeBase, _extends({
39
+ iconBefore: /*#__PURE__*/React.createElement(Box, {
40
+ xcss: styles.iconWrapper
41
+ }, /*#__PURE__*/React.createElement(GoalIcon, {
42
+ size: "16",
43
+ status: (_goal$status = goal === null || goal === void 0 ? void 0 : goal.status) !== null && _goal$status !== void 0 ? _goal$status : "DEFAULT",
44
+ iconKey: toGoalIconKey("GOAL")
45
+ })),
46
+ text: name,
47
+ isRichNodeDisplay: true
48
+ }, rest));
49
+ };
@@ -0,0 +1,9 @@
1
+ import { GoalNode } from './goal-node';
2
+ export var goal = {
3
+ component: GoalNode,
4
+ attrs: {
5
+ id: {},
6
+ name: {},
7
+ fieldName: {}
8
+ }
9
+ };
@@ -1,8 +1,10 @@
1
+ import { goal } from './goal';
1
2
  import { project } from './project';
2
3
  import { team } from './team';
3
4
  import { user } from './user';
4
5
  export var richInlineNodes = {
5
6
  user: user,
6
7
  team: team,
7
- project: project
8
+ project: project,
9
+ goal: goal
8
10
  };
@@ -10,6 +10,7 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
10
10
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
11
  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; }
12
12
  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; }
13
+ import FeatureGates from '@atlaskit/feature-gate-js-client';
13
14
  import { AbstractJastVisitor } from '@atlaskit/jql-ast';
14
15
  import { fg } from '@atlaskit/platform-feature-flags';
15
16
  import { JQLEditorSchema } from '../../../schema';
@@ -26,7 +27,7 @@ export var replaceRichInlineNodes = function replaceRichInlineNodes(editorState,
26
27
  fieldName = _ref2[0],
27
28
  values = _ref2[1];
28
29
  values.forEach(function (value) {
29
- if (value.type === 'user' || value.type === 'team' || value.type === 'project' && fg('projects_in_jira_eap_drop2')) {
30
+ if (value.type === 'user' || value.type === 'team' || value.type === 'goal' && FeatureGates.getExperimentValue('anip-1095-goals-in-harmonised-filter', 'isEnabled', false) || value.type === 'project' && fg('projects_in_jira_eap_drop2')) {
30
31
  // First try to find as direct value operand (e.g., Team[Team] = uuid)
31
32
  var astNodes = getValueNodes(ast, fieldName, value.id);
32
33
 
@@ -75,6 +76,13 @@ var getRichInlineNode = function getRichInlineNode(fieldName, value, text) {
75
76
  fieldName: fieldName
76
77
  }), _textContent2);
77
78
  }
79
+ case 'goal':
80
+ {
81
+ var _textContent3 = JQLEditorSchema.text(text);
82
+ return JQLEditorSchema.nodes.goal.create(_objectSpread(_objectSpread({}, value), {}, {
83
+ fieldName: fieldName
84
+ }), _textContent3);
85
+ }
78
86
  default:
79
87
  {
80
88
  throw new Error("Unsupported hydrated value type ".concat(value.type));
@@ -932,16 +932,25 @@ export var useHydratedProject = createHook(Store, {
932
932
  return project && project.type === 'project' ? project : undefined;
933
933
  }
934
934
  });
935
+ export var useHydratedGoal = createHook(Store, {
936
+ selector: function selector(state, _ref42) {
937
+ var _state$hydratedValues9;
938
+ var id = _ref42.id,
939
+ fieldName = _ref42.fieldName;
940
+ var goal = (_state$hydratedValues9 = state.hydratedValues[normaliseHydrationKey(fieldName)]) === null || _state$hydratedValues9 === void 0 ? void 0 : _state$hydratedValues9.get(normaliseJqlString(id));
941
+ return goal && goal.type === 'goal' ? goal : undefined;
942
+ }
943
+ });
935
944
  export var useHydratedDeprecations = createHook(Store, {
936
945
  selector: function selector(state) {
937
946
  var ast = getJastFromState(state.editorState);
938
947
  var fieldsInQuery = getFieldNodes(ast);
939
948
  var toReturn = [];
940
- Object.entries(state.hydratedValues).forEach(function (_ref42) {
941
- var _state$hydratedValues9;
942
- var _ref43 = _slicedToArray(_ref42, 1),
943
- fieldName = _ref43[0];
944
- (_state$hydratedValues9 = state.hydratedValues[fieldName]) === null || _state$hydratedValues9 === void 0 || _state$hydratedValues9.forEach(function (value) {
949
+ Object.entries(state.hydratedValues).forEach(function (_ref43) {
950
+ var _state$hydratedValues0;
951
+ var _ref44 = _slicedToArray(_ref43, 1),
952
+ fieldName = _ref44[0];
953
+ (_state$hydratedValues0 = state.hydratedValues[fieldName]) === null || _state$hydratedValues0 === void 0 || _state$hydratedValues0.forEach(function (value) {
945
954
  if (value.type === 'deprecated-field') {
946
955
  if (fieldsInQuery.has(value.id.toLowerCase())) {
947
956
  toReturn.push(value);
@@ -964,19 +973,19 @@ export var useOnSyntaxHelp = createHook(Store, {
964
973
  });
965
974
  export var EditorStateContainer = createContainer(Store, {
966
975
  onInit: function onInit() {
967
- return function (_ref44, _ref45) {
968
- var getState = _ref44.getState,
969
- setState = _ref44.setState,
970
- dispatch = _ref44.dispatch;
971
- var intlRef = _ref45.intlRef,
972
- query = _ref45.query,
973
- isSearching = _ref45.isSearching,
974
- autocompleteProvider = _ref45.autocompleteProvider,
975
- externalMessages = _ref45.externalMessages,
976
- enableRichInlineNodes = _ref45.enableRichInlineNodes,
977
- onDebugUnsafeMessage = _ref45.onDebugUnsafeMessage,
978
- onSyntaxHelp = _ref45.onSyntaxHelp,
979
- customComponents = _ref45.customComponents;
976
+ return function (_ref45, _ref46) {
977
+ var getState = _ref45.getState,
978
+ setState = _ref45.setState,
979
+ dispatch = _ref45.dispatch;
980
+ var intlRef = _ref46.intlRef,
981
+ query = _ref46.query,
982
+ isSearching = _ref46.isSearching,
983
+ autocompleteProvider = _ref46.autocompleteProvider,
984
+ externalMessages = _ref46.externalMessages,
985
+ enableRichInlineNodes = _ref46.enableRichInlineNodes,
986
+ onDebugUnsafeMessage = _ref46.onDebugUnsafeMessage,
987
+ onSyntaxHelp = _ref46.onSyntaxHelp,
988
+ customComponents = _ref46.customComponents;
980
989
  setState({
981
990
  controlledQuery: query,
982
991
  query: query,
@@ -1005,18 +1014,18 @@ export var EditorStateContainer = createContainer(Store, {
1005
1014
  };
1006
1015
  },
1007
1016
  onUpdate: function onUpdate() {
1008
- return function (_ref46, _ref47) {
1009
- var getState = _ref46.getState,
1010
- setState = _ref46.setState,
1011
- dispatch = _ref46.dispatch;
1012
- var controlledQueryProp = _ref47.query,
1013
- isSearching = _ref47.isSearching,
1014
- autocompleteProvider = _ref47.autocompleteProvider,
1015
- externalMessages = _ref47.externalMessages,
1016
- enableRichInlineNodes = _ref47.enableRichInlineNodes,
1017
- onDebugUnsafeMessage = _ref47.onDebugUnsafeMessage,
1018
- onSyntaxHelp = _ref47.onSyntaxHelp,
1019
- customComponents = _ref47.customComponents;
1017
+ return function (_ref47, _ref48) {
1018
+ var getState = _ref47.getState,
1019
+ setState = _ref47.setState,
1020
+ dispatch = _ref47.dispatch;
1021
+ var controlledQueryProp = _ref48.query,
1022
+ isSearching = _ref48.isSearching,
1023
+ autocompleteProvider = _ref48.autocompleteProvider,
1024
+ externalMessages = _ref48.externalMessages,
1025
+ enableRichInlineNodes = _ref48.enableRichInlineNodes,
1026
+ onDebugUnsafeMessage = _ref48.onDebugUnsafeMessage,
1027
+ onSyntaxHelp = _ref48.onSyntaxHelp,
1028
+ customComponents = _ref48.customComponents;
1020
1029
  var _getState12 = getState(),
1021
1030
  controlledQuery = _getState12.controlledQuery,
1022
1031
  query = _getState12.query;
@@ -13,6 +13,6 @@ export var messages = defineMessages({
13
13
  defaultWarning: {
14
14
  id: 'jql-editor.ui.jql-warning-message.default',
15
15
  defaultMessage: '{deprecatedField} has been deprecated and may stop working in the future.',
16
- description: 'Default warning message to show on NIN'
16
+ description: 'The text is shown as a warning message in the JQL editor footer when a deprecated field is used in the query. The placeholder {deprecatedField} will be substituted with the name of the deprecated JQL field.'
17
17
  }
18
18
  });
@@ -2,5 +2,6 @@ import { type ReactNode } from 'react';
2
2
  export type NodeBaseProps = {
3
3
  iconBefore: ReactNode;
4
4
  isLocked?: boolean;
5
+ isRichNodeDisplay?: boolean;
5
6
  text?: string;
6
7
  };
@@ -0,0 +1,12 @@
1
+ import React, { type ComponentProps } from 'react';
2
+ import { IconTile } from '@atlaskit/icon';
3
+ declare const GOAL_ICON_KEYS: readonly ["GOAL", "OBJECTIVE", "KEY_RESULT"];
4
+ export type GoalIconKey = (typeof GOAL_ICON_KEYS)[number];
5
+ export declare const isGoalIconKey: (value: string) => value is GoalIconKey;
6
+ interface GoalIconProps {
7
+ iconKey?: GoalIconKey;
8
+ size?: ComponentProps<typeof IconTile>['size'];
9
+ status: string;
10
+ }
11
+ export declare const GoalIcon: ({ status, size, iconKey, }: GoalIconProps) => React.JSX.Element;
12
+ export {};
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { NodeViewProps } from '../../util/react-node-view';
3
+ import type { Props } from './types';
4
+ /**
5
+ * GoalNode Component
6
+ *
7
+ * This component is a component for rendering a pill-like view for Goal node type
8
+ * in the JQL editor
9
+ */
10
+ export declare const GoalNode: (props: NodeViewProps<Props>) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import type { JQLNodeSpec } from '../types';
2
+ import type { Props } from './types';
3
+ export declare const goal: JQLNodeSpec<Props>;
@@ -0,0 +1,5 @@
1
+ export type Props = {
2
+ fieldName: string;
3
+ id: string;
4
+ name: string;
5
+ };
@@ -2,4 +2,5 @@ export declare const richInlineNodes: {
2
2
  user: import("./types").JQLNodeSpec<import("./user").Props>;
3
3
  team: import("./types").JQLNodeSpec<import("./team").Props>;
4
4
  project: import("./types").JQLNodeSpec<import("./project/types").Props>;
5
+ goal: import("./types").JQLNodeSpec<import("./goal/types").Props>;
5
6
  };
@@ -10,7 +10,7 @@ import { type JqlEditorAnalyticsEvent } from '../analytics';
10
10
  import { type AutocompleteOptionGroup, type AutocompleteOptions, type AutocompleteOptionType, type SelectableAutocompleteOption } from '../plugins/autocomplete/components/types';
11
11
  import { type AutocompleteProvider } from '../plugins/types';
12
12
  import { type PortalActions } from '../ui/jql-editor-portal-provider/types';
13
- import { type HydratedDeprecatedField, type HydratedProject, type HydratedTeam, type HydratedUser, type HydratedValue } from '../ui/jql-editor/types';
13
+ import { type HydratedDeprecatedField, type HydratedProject, type HydratedGoal, type HydratedTeam, type HydratedUser, type HydratedValue } from '../ui/jql-editor/types';
14
14
  import { type AutocompletePosition, type AutocompleteState, type ContextAwareJQLSuggestions, type CustomErrorComponent, type ExternalMessagesNormalized, type OptionsKey, type Props, type State } from './types';
15
15
  export declare const initialState: State;
16
16
  export declare const actions: {
@@ -799,6 +799,41 @@ export declare const useHydratedProject: import("react-sweet-state").HookFunctio
799
799
  fieldName: string;
800
800
  id: string;
801
801
  }>;
802
+ export declare const useHydratedGoal: import("react-sweet-state").HookFunction<HydratedGoal | undefined, import("react-sweet-state").BoundActions<State, {
803
+ onEditorViewBlur: () => Action<State>;
804
+ onEditorViewFocus: (event: FocusEvent<HTMLElement>) => Action<State, Props>;
805
+ openAutocompleteOnNextUpdate: () => Action<State>;
806
+ closeAutocomplete: () => Action<State>;
807
+ setSelectedAutocompleteOptionId: (selectedOptionId: string | undefined) => Action<State>;
808
+ getAutocompleteSuggestions: (editorState: EditorState) => Action<State>;
809
+ getAutocompleteOptions: (suggestions: ContextAwareJQLSuggestions) => Action<State>;
810
+ appendOptionsForObservable: (key: OptionsKey, observable: Observable<AutocompleteOptions>, rule: JQLRuleSuggestion, type: AutocompleteOptionType) => Action<State, void, Observable<AutocompleteOptions>>;
811
+ cancelSubscription: () => Action<State>;
812
+ setLoading: (loading: boolean) => Action<State>;
813
+ setAutocompleteOptions: (options: AutocompleteOptionGroup) => Action<State>;
814
+ setAutocompleteContainer: (container: HTMLElement | null) => Action<State>;
815
+ callAutocompleteProviders: ({ rules, tokens }: ContextAwareJQLSuggestions) => Action<State>;
816
+ updateValidationState: () => Action<State>;
817
+ initialiseEditorState: () => Action<State, Props>;
818
+ configurePlugins: (portalActions: PortalActions | void) => Action<State, Props>;
819
+ onApplyEditorTransaction: (transaction: Transaction) => Action<State, Props>;
820
+ resetEditorState: (query: string, addToHistory?: boolean) => Action<State>;
821
+ initialiseEditorView: (editorViewNode: HTMLElement, attributes: {
822
+ [key: string]: string;
823
+ }, portalActions: PortalActions) => Action<State, Props>;
824
+ updateEditorView: (attributes: {
825
+ [key: string]: string;
826
+ }) => Action<State, Props>;
827
+ setEditorViewContainer: (editorViewContainer: HTMLElement) => Action<State>;
828
+ setEditorViewContainerScroll: (scroll: number) => Action<State>;
829
+ onSearch: () => Action<State>;
830
+ onSearchCommand: (pmState: EditorState, pmDispatch: ((tr: Transaction) => void) | undefined, pmView: EditorView | undefined, keyboardShortcut: boolean) => Action<State, Props, boolean>;
831
+ externalErrorMessageViewed: () => Action<State, Props>;
832
+ createAndFireAnalyticsEvent: (payload: JqlEditorAnalyticsEvent) => Action<State, Props>;
833
+ }>, {
834
+ fieldName: string;
835
+ id: string;
836
+ }>;
802
837
  export declare const useHydratedDeprecations: import("react-sweet-state").HookFunction<HydratedDeprecatedField[], import("react-sweet-state").BoundActions<State, {
803
838
  onEditorViewBlur: () => Action<State>;
804
839
  onEditorViewFocus: (event: FocusEvent<HTMLElement>) => Action<State, Props>;
@@ -2,5 +2,6 @@ import { type ReactNode } from 'react';
2
2
  export type NodeBaseProps = {
3
3
  iconBefore: ReactNode;
4
4
  isLocked?: boolean;
5
+ isRichNodeDisplay?: boolean;
5
6
  text?: string;
6
7
  };
@@ -0,0 +1,16 @@
1
+ import React, { type ComponentProps } from 'react';
2
+ import { IconTile } from '@atlaskit/icon';
3
+ declare const GOAL_ICON_KEYS: readonly [
4
+ "GOAL",
5
+ "OBJECTIVE",
6
+ "KEY_RESULT"
7
+ ];
8
+ export type GoalIconKey = (typeof GOAL_ICON_KEYS)[number];
9
+ export declare const isGoalIconKey: (value: string) => value is GoalIconKey;
10
+ interface GoalIconProps {
11
+ iconKey?: GoalIconKey;
12
+ size?: ComponentProps<typeof IconTile>['size'];
13
+ status: string;
14
+ }
15
+ export declare const GoalIcon: ({ status, size, iconKey, }: GoalIconProps) => React.JSX.Element;
16
+ export {};
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { NodeViewProps } from '../../util/react-node-view';
3
+ import type { Props } from './types';
4
+ /**
5
+ * GoalNode Component
6
+ *
7
+ * This component is a component for rendering a pill-like view for Goal node type
8
+ * in the JQL editor
9
+ */
10
+ export declare const GoalNode: (props: NodeViewProps<Props>) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import type { JQLNodeSpec } from '../types';
2
+ import type { Props } from './types';
3
+ export declare const goal: JQLNodeSpec<Props>;
@@ -0,0 +1,5 @@
1
+ export type Props = {
2
+ fieldName: string;
3
+ id: string;
4
+ name: string;
5
+ };
@@ -2,4 +2,5 @@ export declare const richInlineNodes: {
2
2
  user: import("./types").JQLNodeSpec<import("./user").Props>;
3
3
  team: import("./types").JQLNodeSpec<import("./team").Props>;
4
4
  project: import("./types").JQLNodeSpec<import("./project/types").Props>;
5
+ goal: import("./types").JQLNodeSpec<import("./goal/types").Props>;
5
6
  };
@@ -10,7 +10,7 @@ import { type JqlEditorAnalyticsEvent } from '../analytics';
10
10
  import { type AutocompleteOptionGroup, type AutocompleteOptions, type AutocompleteOptionType, type SelectableAutocompleteOption } from '../plugins/autocomplete/components/types';
11
11
  import { type AutocompleteProvider } from '../plugins/types';
12
12
  import { type PortalActions } from '../ui/jql-editor-portal-provider/types';
13
- import { type HydratedDeprecatedField, type HydratedProject, type HydratedTeam, type HydratedUser, type HydratedValue } from '../ui/jql-editor/types';
13
+ import { type HydratedDeprecatedField, type HydratedProject, type HydratedGoal, type HydratedTeam, type HydratedUser, type HydratedValue } from '../ui/jql-editor/types';
14
14
  import { type AutocompletePosition, type AutocompleteState, type ContextAwareJQLSuggestions, type CustomErrorComponent, type ExternalMessagesNormalized, type OptionsKey, type Props, type State } from './types';
15
15
  export declare const initialState: State;
16
16
  export declare const actions: {
@@ -799,6 +799,41 @@ export declare const useHydratedProject: import("react-sweet-state").HookFunctio
799
799
  fieldName: string;
800
800
  id: string;
801
801
  }>;
802
+ export declare const useHydratedGoal: import("react-sweet-state").HookFunction<HydratedGoal | undefined, import("react-sweet-state").BoundActions<State, {
803
+ onEditorViewBlur: () => Action<State>;
804
+ onEditorViewFocus: (event: FocusEvent<HTMLElement>) => Action<State, Props>;
805
+ openAutocompleteOnNextUpdate: () => Action<State>;
806
+ closeAutocomplete: () => Action<State>;
807
+ setSelectedAutocompleteOptionId: (selectedOptionId: string | undefined) => Action<State>;
808
+ getAutocompleteSuggestions: (editorState: EditorState) => Action<State>;
809
+ getAutocompleteOptions: (suggestions: ContextAwareJQLSuggestions) => Action<State>;
810
+ appendOptionsForObservable: (key: OptionsKey, observable: Observable<AutocompleteOptions>, rule: JQLRuleSuggestion, type: AutocompleteOptionType) => Action<State, void, Observable<AutocompleteOptions>>;
811
+ cancelSubscription: () => Action<State>;
812
+ setLoading: (loading: boolean) => Action<State>;
813
+ setAutocompleteOptions: (options: AutocompleteOptionGroup) => Action<State>;
814
+ setAutocompleteContainer: (container: HTMLElement | null) => Action<State>;
815
+ callAutocompleteProviders: ({ rules, tokens }: ContextAwareJQLSuggestions) => Action<State>;
816
+ updateValidationState: () => Action<State>;
817
+ initialiseEditorState: () => Action<State, Props>;
818
+ configurePlugins: (portalActions: PortalActions | void) => Action<State, Props>;
819
+ onApplyEditorTransaction: (transaction: Transaction) => Action<State, Props>;
820
+ resetEditorState: (query: string, addToHistory?: boolean) => Action<State>;
821
+ initialiseEditorView: (editorViewNode: HTMLElement, attributes: {
822
+ [key: string]: string;
823
+ }, portalActions: PortalActions) => Action<State, Props>;
824
+ updateEditorView: (attributes: {
825
+ [key: string]: string;
826
+ }) => Action<State, Props>;
827
+ setEditorViewContainer: (editorViewContainer: HTMLElement) => Action<State>;
828
+ setEditorViewContainerScroll: (scroll: number) => Action<State>;
829
+ onSearch: () => Action<State>;
830
+ onSearchCommand: (pmState: EditorState, pmDispatch: ((tr: Transaction) => void) | undefined, pmView: EditorView | undefined, keyboardShortcut: boolean) => Action<State, Props, boolean>;
831
+ externalErrorMessageViewed: () => Action<State, Props>;
832
+ createAndFireAnalyticsEvent: (payload: JqlEditorAnalyticsEvent) => Action<State, Props>;
833
+ }>, {
834
+ fieldName: string;
835
+ id: string;
836
+ }>;
802
837
  export declare const useHydratedDeprecations: import("react-sweet-state").HookFunction<HydratedDeprecatedField[], import("react-sweet-state").BoundActions<State, {
803
838
  onEditorViewBlur: () => Action<State>;
804
839
  onEditorViewFocus: (event: FocusEvent<HTMLElement>) => Action<State, Props>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/jql-editor",
3
- "version": "6.1.1",
3
+ "version": "6.2.0",
4
4
  "description": "This package allows consumers to render an advanced JQL editor component to enable autocomplete-assisted authoring and validation of JQL queries.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -8,6 +8,13 @@
8
8
  "registry": "https://registry.npmjs.org/"
9
9
  },
10
10
  "atlassian": {
11
+ "react-compiler": {
12
+ "enabled": true,
13
+ "gating": {
14
+ "source": "@atlassian/react-compiler-gating",
15
+ "importSpecifierName": "isReactCompilerActivePlatform"
16
+ }
17
+ },
11
18
  "team": "Jira Platform: Search Experience / Empanada",
12
19
  "website": {
13
20
  "name": "JQL Editor",
@@ -35,18 +42,18 @@
35
42
  "@atlaskit/afm-i18n-platform-jql-jql-editor": "2.10.0",
36
43
  "@atlaskit/analytics-gas-types": "^5.1.0",
37
44
  "@atlaskit/analytics-next": "^11.2.0",
38
- "@atlaskit/avatar": "^25.11.0",
45
+ "@atlaskit/avatar": "^25.12.0",
39
46
  "@atlaskit/button": "^23.11.0",
40
47
  "@atlaskit/css": "^0.19.0",
41
48
  "@atlaskit/editor-prosemirror": "^7.3.0",
42
- "@atlaskit/emoji": "^70.0.0",
49
+ "@atlaskit/emoji": "^70.1.0",
43
50
  "@atlaskit/feature-gate-js-client": "^5.5.0",
44
51
  "@atlaskit/form": "^15.5.0",
45
- "@atlaskit/icon": "^34.1.0",
52
+ "@atlaskit/icon": "^34.2.0",
46
53
  "@atlaskit/icon-lab": "^6.5.0",
47
54
  "@atlaskit/jql-ast": "^3.4.0",
48
55
  "@atlaskit/jql-autocomplete": "^2.0.0",
49
- "@atlaskit/jql-editor-common": "^3.1.0",
56
+ "@atlaskit/jql-editor-common": "^3.2.0",
50
57
  "@atlaskit/jql-parser": "^2.0.0",
51
58
  "@atlaskit/link": "^3.4.0",
52
59
  "@atlaskit/platform-feature-flags": "^1.1.0",
@@ -54,8 +61,8 @@
54
61
  "@atlaskit/primitives": "^19.0.0",
55
62
  "@atlaskit/prosemirror-history": "^0.2.0",
56
63
  "@atlaskit/spinner": "^19.1.0",
57
- "@atlaskit/teams-avatar": "^2.5.0",
58
- "@atlaskit/theme": "^23.0.0",
64
+ "@atlaskit/teams-avatar": "^2.6.0",
65
+ "@atlaskit/theme": "^23.1.0",
59
66
  "@atlaskit/tokens": "^13.0.0",
60
67
  "@atlaskit/tooltip": "^21.1.0",
61
68
  "@atlaskit/townsquare-emoji-provider": "^1.0.0",
@@ -82,9 +89,10 @@
82
89
  "@af/integration-testing": "workspace:^",
83
90
  "@af/visual-regression": "workspace:^",
84
91
  "@atlaskit/docs": "^11.8.0",
85
- "@atlaskit/jql-editor-autocomplete-rest": "^3.1.0",
92
+ "@atlaskit/jql-editor-autocomplete-rest": "^3.2.0",
86
93
  "@atlassian/feature-flags-storybook-utils": "^0.3.0",
87
94
  "@atlassian/feature-flags-test-utils": "^1.0.0",
95
+ "@atlassian/react-compiler-gating": "workspace:^",
88
96
  "@storybook/addon-actions": "^8.6.14",
89
97
  "@testing-library/jest-dom": "^6.4.5",
90
98
  "@testing-library/react": "^16.3.0",