@atlaskit/jql-editor 4.11.2 → 4.12.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/jql-editor
2
2
 
3
+ ## 4.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#175241](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/175241)
8
+ [`7815c3852aecc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7815c3852aecc) -
9
+ Cleanup FF to enable custom components in JQL editor [GRAVITYAI-1983]
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 4.11.2
4
16
 
5
17
  ### Patch 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", "4.11.2", _jqlEditorCommon.ANALYTICS_CHANNEL);
9
+ return (0, _jqlEditorCommon.useJqlPackageAnalytics)(analyticsSource, "@atlaskit/jql-editor", "4.12.0", _jqlEditorCommon.ANALYTICS_CHANNEL);
10
10
  };
@@ -18,7 +18,6 @@ var _uuid = require("uuid");
18
18
  var _view = require("@atlaskit/editor-prosemirror/view");
19
19
  var _jqlAst = require("@atlaskit/jql-ast");
20
20
  var _jqlAutocomplete = require("@atlaskit/jql-autocomplete");
21
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
21
  var _analytics = require("../analytics");
23
22
  var _selectErrorCommand = require("../commands/select-error-command");
24
23
  var _constants = require("../common/constants");
@@ -958,7 +957,7 @@ var EditorStateContainer = exports.EditorStateContainer = (0, _reactSweetState.c
958
957
  }) : undefined,
959
958
  onDebugUnsafeMessage: onDebugUnsafeMessage,
960
959
  onSyntaxHelp: onSyntaxHelp,
961
- customComponents: (0, _platformFeatureFlags.fg)('custom_components_for_jql_editor') ? customComponents : undefined
960
+ customComponents: customComponents
962
961
  });
963
962
  dispatch(actions.initialiseEditorState());
964
963
  };
@@ -999,7 +998,7 @@ var EditorStateContainer = exports.EditorStateContainer = (0, _reactSweetState.c
999
998
  enableRichInlineNodes: enableRichInlineNodes,
1000
999
  onDebugUnsafeMessage: onDebugUnsafeMessage,
1001
1000
  onSyntaxHelp: onSyntaxHelp,
1002
- customComponents: (0, _platformFeatureFlags.fg)('custom_components_for_jql_editor') ? customComponents : undefined
1001
+ customComponents: customComponents
1003
1002
  });
1004
1003
  };
1005
1004
  }
@@ -9,7 +9,6 @@ exports.default = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _reactIntlNext = require("react-intl-next");
11
11
  var _reactMagneticDi = require("react-magnetic-di");
12
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
12
  var _analytics = require("../../analytics");
14
13
  var _useEditorTheme = require("../../hooks/use-editor-theme");
15
14
  var _state = require("../../state");
@@ -68,7 +67,7 @@ var JQLEditorInner = function JQLEditorInner(_ref) {
68
67
  enableRichInlineNodes: enableRichInlineNodes,
69
68
  onSyntaxHelp: onSyntaxHelp,
70
69
  onFocus: onFocus,
71
- customComponents: (0, _platformFeatureFlags.fg)('custom_components_for_jql_editor') ? customComponents : undefined
70
+ customComponents: customComponents
72
71
  }, /*#__PURE__*/_react.default.createElement(_useEditorTheme.EditorThemeContext.Provider, {
73
72
  value: editorTheme
74
73
  }, /*#__PURE__*/_react.default.createElement(_jqlEditorPortalProvider.JQLEditorPortalRenderer, null, /*#__PURE__*/_react.default.createElement(_jqlEditorView.default, {
@@ -13,7 +13,6 @@ var _react = _interopRequireWildcard(require("react"));
13
13
  var _reactMagneticDi = require("react-magnetic-di");
14
14
  var _form = require("@atlaskit/form");
15
15
  var _jqlAst = require("@atlaskit/jql-ast");
16
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
16
  var _constants = require("../../../../common/constants");
18
17
  var _messages = require("../../../../common/messages");
19
18
  var _useEditorTheme = require("../../../../hooks/use-editor-theme");
@@ -85,32 +84,23 @@ var ErrorMessages = exports.ErrorMessages = function ErrorMessages() {
85
84
  editorId = _useScopedId2[0];
86
85
  var errorMessage = useFormattedErrorMessage();
87
86
  var testId = 'jql-editor-validation';
88
- if ((0, _platformFeatureFlags.fg)('custom_components_for_jql_editor')) {
89
- // eslint-disable-next-line react-hooks/rules-of-hooks
90
- var _useCustomErrorCompon = (0, _state.useCustomErrorComponent)(),
91
- _useCustomErrorCompon2 = (0, _slicedToArray2.default)(_useCustomErrorCompon, 1),
92
- CustomErrorComponent = _useCustomErrorCompon2[0];
93
- var childrenToRender = errorMessage != null ? /*#__PURE__*/_react.default.createElement(_format.MessageContainer, null, /*#__PURE__*/_react.default.createElement(_form.ErrorMessage, {
94
- testId: testId
95
- }, /*#__PURE__*/_react.default.createElement("span", {
96
- role: "alert",
97
- "aria-describedby": editorId
98
- }, errorMessage))) : null;
99
-
100
- // Only render CustomErrorComponent if there is an errorMessage
101
- if (errorMessage != null && CustomErrorComponent) {
102
- return /*#__PURE__*/_react.default.createElement(CustomComponentDecoratedWithEditorTheme, {
103
- testId: testId,
104
- editorId: editorId,
105
- Component: CustomErrorComponent
106
- }, childrenToRender);
107
- }
108
- return childrenToRender;
109
- }
110
- return errorMessage != null ? /*#__PURE__*/_react.default.createElement(_format.MessageContainer, null, /*#__PURE__*/_react.default.createElement(_form.ErrorMessage, {
87
+ var _useCustomErrorCompon = (0, _state.useCustomErrorComponent)(),
88
+ _useCustomErrorCompon2 = (0, _slicedToArray2.default)(_useCustomErrorCompon, 1),
89
+ CustomErrorComponent = _useCustomErrorCompon2[0];
90
+ var childrenToRender = errorMessage != null ? /*#__PURE__*/_react.default.createElement(_format.MessageContainer, null, /*#__PURE__*/_react.default.createElement(_form.ErrorMessage, {
111
91
  testId: testId
112
92
  }, /*#__PURE__*/_react.default.createElement("span", {
113
93
  role: "alert",
114
94
  "aria-describedby": editorId
115
95
  }, errorMessage))) : null;
96
+
97
+ // Only render CustomErrorComponent if there is an errorMessage
98
+ if (errorMessage != null && CustomErrorComponent) {
99
+ return /*#__PURE__*/_react.default.createElement(CustomComponentDecoratedWithEditorTheme, {
100
+ testId: testId,
101
+ editorId: editorId,
102
+ Component: CustomErrorComponent
103
+ }, childrenToRender);
104
+ }
105
+ return childrenToRender;
116
106
  };
@@ -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", "4.11.2", ANALYTICS_CHANNEL);
3
+ return useJqlPackageAnalytics(analyticsSource, "@atlaskit/jql-editor", "4.12.0", ANALYTICS_CHANNEL);
4
4
  };
@@ -8,7 +8,6 @@ import { v4 as uuidv4 } from 'uuid';
8
8
  import { EditorView } from '@atlaskit/editor-prosemirror/view';
9
9
  import { computeJqlInsights, isListOperator } from '@atlaskit/jql-ast';
10
10
  import { JQLAutocomplete } from '@atlaskit/jql-autocomplete';
11
- import { fg } from '@atlaskit/platform-feature-flags';
12
11
  import { ActionSubject, ActionSubjectId, Action as AnalyticsAction, EventType } from '../analytics';
13
12
  import { selectErrorCommand } from '../commands/select-error-command';
14
13
  import { JQL_EDITOR_MAIN_ID } from '../common/constants';
@@ -928,7 +927,7 @@ export const EditorStateContainer = createContainer(Store, {
928
927
  }) : undefined,
929
928
  onDebugUnsafeMessage,
930
929
  onSyntaxHelp,
931
- customComponents: fg('custom_components_for_jql_editor') ? customComponents : undefined
930
+ customComponents
932
931
  });
933
932
  dispatch(actions.initialiseEditorState());
934
933
  },
@@ -970,7 +969,7 @@ export const EditorStateContainer = createContainer(Store, {
970
969
  enableRichInlineNodes,
971
970
  onDebugUnsafeMessage,
972
971
  onSyntaxHelp,
973
- customComponents: fg('custom_components_for_jql_editor') ? customComponents : undefined
972
+ customComponents
974
973
  });
975
974
  }
976
975
  });
@@ -1,7 +1,6 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
2
  import { injectIntl } from 'react-intl-next';
3
3
  import { di } from 'react-magnetic-di';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  import { useJqlEditorAnalytics } from '../../analytics';
6
5
  import { EditorThemeContext, useEditorTheme } from '../../hooks/use-editor-theme';
7
6
  import { EditorStateContainer } from '../../state';
@@ -56,7 +55,7 @@ const JQLEditorInner = ({
56
55
  enableRichInlineNodes: enableRichInlineNodes,
57
56
  onSyntaxHelp: onSyntaxHelp,
58
57
  onFocus: onFocus,
59
- customComponents: fg('custom_components_for_jql_editor') ? customComponents : undefined
58
+ customComponents: customComponents
60
59
  }, /*#__PURE__*/React.createElement(EditorThemeContext.Provider, {
61
60
  value: editorTheme
62
61
  }, /*#__PURE__*/React.createElement(JQLEditorPortalRenderer, null, /*#__PURE__*/React.createElement(JQLEditorView, {
@@ -3,7 +3,6 @@ import React, { useEffect } from 'react';
3
3
  import { di } from 'react-magnetic-di';
4
4
  import { ErrorMessage } from '@atlaskit/form';
5
5
  import { JQLSyntaxError } from '@atlaskit/jql-ast';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
6
  import { JQL_EDITOR_INPUT_ID } from '../../../../common/constants';
8
7
  import { commonMessages } from '../../../../common/messages';
9
8
  import { useEditorThemeContext } from '../../../../hooks/use-editor-theme';
@@ -70,30 +69,21 @@ export const ErrorMessages = () => {
70
69
  const [editorId] = useScopedId(JQL_EDITOR_INPUT_ID);
71
70
  const errorMessage = useFormattedErrorMessage();
72
71
  const testId = 'jql-editor-validation';
73
- if (fg('custom_components_for_jql_editor')) {
74
- // eslint-disable-next-line react-hooks/rules-of-hooks
75
- const [CustomErrorComponent] = useCustomErrorComponent();
76
- const childrenToRender = errorMessage != null ? /*#__PURE__*/React.createElement(MessageContainer, null, /*#__PURE__*/React.createElement(ErrorMessage, {
77
- testId: testId
78
- }, /*#__PURE__*/React.createElement("span", {
79
- role: "alert",
80
- "aria-describedby": editorId
81
- }, errorMessage))) : null;
82
-
83
- // Only render CustomErrorComponent if there is an errorMessage
84
- if (errorMessage != null && CustomErrorComponent) {
85
- return /*#__PURE__*/React.createElement(CustomComponentDecoratedWithEditorTheme, {
86
- testId: testId,
87
- editorId: editorId,
88
- Component: CustomErrorComponent
89
- }, childrenToRender);
90
- }
91
- return childrenToRender;
92
- }
93
- return errorMessage != null ? /*#__PURE__*/React.createElement(MessageContainer, null, /*#__PURE__*/React.createElement(ErrorMessage, {
72
+ const [CustomErrorComponent] = useCustomErrorComponent();
73
+ const childrenToRender = errorMessage != null ? /*#__PURE__*/React.createElement(MessageContainer, null, /*#__PURE__*/React.createElement(ErrorMessage, {
94
74
  testId: testId
95
75
  }, /*#__PURE__*/React.createElement("span", {
96
76
  role: "alert",
97
77
  "aria-describedby": editorId
98
78
  }, errorMessage))) : null;
79
+
80
+ // Only render CustomErrorComponent if there is an errorMessage
81
+ if (errorMessage != null && CustomErrorComponent) {
82
+ return /*#__PURE__*/React.createElement(CustomComponentDecoratedWithEditorTheme, {
83
+ testId: testId,
84
+ editorId: editorId,
85
+ Component: CustomErrorComponent
86
+ }, childrenToRender);
87
+ }
88
+ return childrenToRender;
99
89
  };
@@ -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", "4.11.2", ANALYTICS_CHANNEL);
3
+ return useJqlPackageAnalytics(analyticsSource, "@atlaskit/jql-editor", "4.12.0", ANALYTICS_CHANNEL);
4
4
  };
@@ -13,7 +13,6 @@ import { v4 as uuidv4 } from 'uuid';
13
13
  import { EditorView } from '@atlaskit/editor-prosemirror/view';
14
14
  import { computeJqlInsights, isListOperator } from '@atlaskit/jql-ast';
15
15
  import { JQLAutocomplete } from '@atlaskit/jql-autocomplete';
16
- import { fg } from '@atlaskit/platform-feature-flags';
17
16
  import { ActionSubject, ActionSubjectId, Action as AnalyticsAction, EventType } from '../analytics';
18
17
  import { selectErrorCommand } from '../commands/select-error-command';
19
18
  import { JQL_EDITOR_MAIN_ID } from '../common/constants';
@@ -951,7 +950,7 @@ export var EditorStateContainer = createContainer(Store, {
951
950
  }) : undefined,
952
951
  onDebugUnsafeMessage: onDebugUnsafeMessage,
953
952
  onSyntaxHelp: onSyntaxHelp,
954
- customComponents: fg('custom_components_for_jql_editor') ? customComponents : undefined
953
+ customComponents: customComponents
955
954
  });
956
955
  dispatch(actions.initialiseEditorState());
957
956
  };
@@ -992,7 +991,7 @@ export var EditorStateContainer = createContainer(Store, {
992
991
  enableRichInlineNodes: enableRichInlineNodes,
993
992
  onDebugUnsafeMessage: onDebugUnsafeMessage,
994
993
  onSyntaxHelp: onSyntaxHelp,
995
- customComponents: fg('custom_components_for_jql_editor') ? customComponents : undefined
994
+ customComponents: customComponents
996
995
  });
997
996
  };
998
997
  }
@@ -1,7 +1,6 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
2
  import { injectIntl } from 'react-intl-next';
3
3
  import { di } from 'react-magnetic-di';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  import { useJqlEditorAnalytics } from '../../analytics';
6
5
  import { EditorThemeContext, useEditorTheme } from '../../hooks/use-editor-theme';
7
6
  import { EditorStateContainer } from '../../state';
@@ -56,7 +55,7 @@ var JQLEditorInner = function JQLEditorInner(_ref) {
56
55
  enableRichInlineNodes: enableRichInlineNodes,
57
56
  onSyntaxHelp: onSyntaxHelp,
58
57
  onFocus: onFocus,
59
- customComponents: fg('custom_components_for_jql_editor') ? customComponents : undefined
58
+ customComponents: customComponents
60
59
  }, /*#__PURE__*/React.createElement(EditorThemeContext.Provider, {
61
60
  value: editorTheme
62
61
  }, /*#__PURE__*/React.createElement(JQLEditorPortalRenderer, null, /*#__PURE__*/React.createElement(JQLEditorView, {
@@ -6,7 +6,6 @@ import React, { useEffect } from 'react';
6
6
  import { di } from 'react-magnetic-di';
7
7
  import { ErrorMessage } from '@atlaskit/form';
8
8
  import { JQLSyntaxError } from '@atlaskit/jql-ast';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
9
  import { JQL_EDITOR_INPUT_ID } from '../../../../common/constants';
11
10
  import { commonMessages } from '../../../../common/messages';
12
11
  import { useEditorThemeContext } from '../../../../hooks/use-editor-theme';
@@ -75,32 +74,23 @@ export var ErrorMessages = function ErrorMessages() {
75
74
  editorId = _useScopedId2[0];
76
75
  var errorMessage = useFormattedErrorMessage();
77
76
  var testId = 'jql-editor-validation';
78
- if (fg('custom_components_for_jql_editor')) {
79
- // eslint-disable-next-line react-hooks/rules-of-hooks
80
- var _useCustomErrorCompon = useCustomErrorComponent(),
81
- _useCustomErrorCompon2 = _slicedToArray(_useCustomErrorCompon, 1),
82
- CustomErrorComponent = _useCustomErrorCompon2[0];
83
- var childrenToRender = errorMessage != null ? /*#__PURE__*/React.createElement(MessageContainer, null, /*#__PURE__*/React.createElement(ErrorMessage, {
84
- testId: testId
85
- }, /*#__PURE__*/React.createElement("span", {
86
- role: "alert",
87
- "aria-describedby": editorId
88
- }, errorMessage))) : null;
89
-
90
- // Only render CustomErrorComponent if there is an errorMessage
91
- if (errorMessage != null && CustomErrorComponent) {
92
- return /*#__PURE__*/React.createElement(CustomComponentDecoratedWithEditorTheme, {
93
- testId: testId,
94
- editorId: editorId,
95
- Component: CustomErrorComponent
96
- }, childrenToRender);
97
- }
98
- return childrenToRender;
99
- }
100
- return errorMessage != null ? /*#__PURE__*/React.createElement(MessageContainer, null, /*#__PURE__*/React.createElement(ErrorMessage, {
77
+ var _useCustomErrorCompon = useCustomErrorComponent(),
78
+ _useCustomErrorCompon2 = _slicedToArray(_useCustomErrorCompon, 1),
79
+ CustomErrorComponent = _useCustomErrorCompon2[0];
80
+ var childrenToRender = errorMessage != null ? /*#__PURE__*/React.createElement(MessageContainer, null, /*#__PURE__*/React.createElement(ErrorMessage, {
101
81
  testId: testId
102
82
  }, /*#__PURE__*/React.createElement("span", {
103
83
  role: "alert",
104
84
  "aria-describedby": editorId
105
85
  }, errorMessage))) : null;
86
+
87
+ // Only render CustomErrorComponent if there is an errorMessage
88
+ if (errorMessage != null && CustomErrorComponent) {
89
+ return /*#__PURE__*/React.createElement(CustomComponentDecoratedWithEditorTheme, {
90
+ testId: testId,
91
+ editorId: editorId,
92
+ Component: CustomErrorComponent
93
+ }, childrenToRender);
94
+ }
95
+ return childrenToRender;
106
96
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/jql-editor",
3
- "version": "4.11.2",
3
+ "version": "4.12.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",
@@ -41,7 +41,7 @@
41
41
  "@atlaskit/button": "^20.3.0",
42
42
  "@atlaskit/editor-prosemirror": "6.2.1",
43
43
  "@atlaskit/form": "^10.6.0",
44
- "@atlaskit/icon": "^23.0.0",
44
+ "@atlaskit/icon": "^23.1.0",
45
45
  "@atlaskit/jql-ast": "^3.3.0",
46
46
  "@atlaskit/jql-autocomplete": "^2.0.0",
47
47
  "@atlaskit/jql-editor-common": "^2.1.0",
@@ -129,9 +129,6 @@
129
129
  "platform-component-visual-refresh": {
130
130
  "type": "boolean"
131
131
  },
132
- "custom_components_for_jql_editor": {
133
- "type": "boolean"
134
- },
135
132
  "add_nin_press_interactions": {
136
133
  "type": "boolean"
137
134
  }