@atlaskit/jql-editor 6.4.6 → 6.5.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 +20 -0
- package/dist/cjs/analytics/util.js +1 -1
- package/dist/cjs/plugins/rich-inline-nodes/nodes/index.js +2 -0
- package/dist/cjs/plugins/rich-inline-nodes/nodes/lozenge-with-avatar/index.js +41 -0
- package/dist/cjs/plugins/rich-inline-nodes/nodes/lozenge-with-avatar/styled.js +105 -0
- package/dist/cjs/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +86 -33
- package/dist/cjs/state/hydration/index.js +15 -15
- package/dist/cjs/state/hydration/util.js +6 -6
- package/dist/cjs/state/index.js +40 -31
- package/dist/cjs/ui/jql-editor-controls-content/base-syntax-help/styled.js +1 -1
- package/dist/cjs/ui/jql-editor-layout/styled.js +1 -1
- package/dist/cjs/ui/jql-editor-view/index.js +1 -2
- package/dist/es2019/analytics/util.js +1 -1
- package/dist/es2019/plugins/rich-inline-nodes/nodes/index.js +2 -0
- package/dist/es2019/plugins/rich-inline-nodes/nodes/lozenge-with-avatar/index.js +32 -0
- package/dist/es2019/plugins/rich-inline-nodes/nodes/lozenge-with-avatar/styled.js +97 -0
- package/dist/es2019/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +63 -15
- package/dist/es2019/state/hydration/util.js +6 -6
- package/dist/es2019/state/index.js +12 -2
- package/dist/es2019/ui/jql-editor-controls-content/base-syntax-help/styled.js +1 -1
- package/dist/es2019/ui/jql-editor-layout/styled.js +1 -1
- package/dist/es2019/ui/jql-editor-view/index.js +1 -4
- package/dist/esm/analytics/util.js +1 -1
- package/dist/esm/plugins/rich-inline-nodes/nodes/index.js +2 -0
- package/dist/esm/plugins/rich-inline-nodes/nodes/lozenge-with-avatar/index.js +34 -0
- package/dist/esm/plugins/rich-inline-nodes/nodes/lozenge-with-avatar/styled.js +96 -0
- package/dist/esm/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +86 -33
- package/dist/esm/state/hydration/index.js +15 -15
- package/dist/esm/state/hydration/util.js +6 -6
- package/dist/esm/state/index.js +39 -30
- package/dist/esm/ui/jql-editor-controls-content/base-syntax-help/styled.js +1 -1
- package/dist/esm/ui/jql-editor-layout/styled.js +1 -1
- package/dist/esm/ui/jql-editor-view/index.js +1 -2
- package/dist/types/plugins/rich-inline-nodes/nodes/index.d.ts +2 -0
- package/dist/types/plugins/rich-inline-nodes/nodes/lozenge-with-avatar/index.d.ts +7 -0
- package/dist/types/plugins/rich-inline-nodes/nodes/lozenge-with-avatar/styled.d.ts +18 -0
- package/dist/types/state/index.d.ts +5 -1
- package/dist/types/types.d.ts +1 -1
- package/dist/types/ui/jql-editor/types.d.ts +7 -1
- package/dist/types/ui/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/index.d.ts +2 -0
- package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/lozenge-with-avatar/index.d.ts +7 -0
- package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/lozenge-with-avatar/styled.d.ts +18 -0
- package/dist/types-ts4.5/state/index.d.ts +5 -1
- package/dist/types-ts4.5/types.d.ts +1 -1
- package/dist/types-ts4.5/ui/jql-editor/types.d.ts +7 -1
- package/dist/types-ts4.5/ui/types.d.ts +1 -1
- package/package.json +8 -8
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
5
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
8
8
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
9
9
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
@@ -27,32 +27,42 @@ export var replaceRichInlineNodes = function replaceRichInlineNodes(editorState,
|
|
|
27
27
|
fieldName = _ref2[0],
|
|
28
28
|
values = _ref2[1];
|
|
29
29
|
values.forEach(function (value) {
|
|
30
|
-
if (
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// If not found as direct value and it's a team, try to find in membersOf function arguments
|
|
35
|
-
if (astNodes.length === 0 && value.type === 'team' && fg('jira-membersof-team-support')) {
|
|
36
|
-
astNodes = getMembersOfArgumentNodes(ast, value.id);
|
|
30
|
+
if (fg('jql-function-arg-hydration')) {
|
|
31
|
+
// Skip deprecated fields
|
|
32
|
+
if (value.type === 'deprecated-field') {
|
|
33
|
+
return;
|
|
37
34
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
});
|
|
35
|
+
// When the gate is on, collect both direct value operands and function argument
|
|
36
|
+
// operands for all node types
|
|
37
|
+
var astNodes = [].concat(_toConsumableArray(getValueNodes(ast, fieldName, value.id)), _toConsumableArray(getFunctionArgumentNodes(ast, fieldName, value.id)));
|
|
38
|
+
replaceAstNodesWithRichInlineNodes(transaction, astNodes, fieldName, value);
|
|
39
|
+
} else if (value.type === 'user' || value.type === 'team' || value.type === 'goal' && FeatureGates.getExperimentValue('anip-1095-goals-in-harmonised-filter', 'isEnabled', false) || value.type === 'project' && FeatureGates.getExperimentValue('atlassian_projects_-_native_integration', 'releaseVersion', -1) >= 1) {
|
|
40
|
+
// Legacy path: direct value operands only, with membersOf fallback for teams.
|
|
41
|
+
var _astNodes = getValueNodes(ast, fieldName, value.id);
|
|
42
|
+
if (_astNodes.length === 0 && value.type === 'team' && fg('jira-membersof-team-support')) {
|
|
43
|
+
_astNodes = getMembersOfArgumentNodes(ast, value.id);
|
|
44
|
+
}
|
|
45
|
+
replaceAstNodesWithRichInlineNodes(transaction, _astNodes, fieldName, value);
|
|
51
46
|
}
|
|
52
47
|
});
|
|
53
48
|
});
|
|
54
49
|
return transaction;
|
|
55
50
|
};
|
|
51
|
+
var replaceAstNodesWithRichInlineNodes = function replaceAstNodesWithRichInlineNodes(transaction, astNodes, fieldName, value) {
|
|
52
|
+
astNodes.forEach(function (astNode) {
|
|
53
|
+
if (astNode.position) {
|
|
54
|
+
var _astNode$position = _slicedToArray(astNode.position, 2),
|
|
55
|
+
from = _astNode$position[0],
|
|
56
|
+
to = _astNode$position[1];
|
|
57
|
+
var documentFrom = getDocumentPosition(transaction.doc, from);
|
|
58
|
+
if (!isRichInlineNode(transaction.doc, documentFrom)) {
|
|
59
|
+
var documentTo = getDocumentPosition(transaction.doc, to);
|
|
60
|
+
var node = getRichInlineNode(fieldName, value, astNode.text);
|
|
61
|
+
transaction.replaceWith(documentFrom, documentTo, node);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
};
|
|
56
66
|
var getRichInlineNode = function getRichInlineNode(fieldName, value, text) {
|
|
57
67
|
switch (value.type) {
|
|
58
68
|
case 'user':
|
|
@@ -83,6 +93,13 @@ var getRichInlineNode = function getRichInlineNode(fieldName, value, text) {
|
|
|
83
93
|
fieldName: fieldName
|
|
84
94
|
}), _textContent3);
|
|
85
95
|
}
|
|
96
|
+
case 'lozengeWithAvatar':
|
|
97
|
+
{
|
|
98
|
+
var _textContent4 = JQLEditorSchema.text(text);
|
|
99
|
+
return JQLEditorSchema.nodes.lozengeWithAvatar.create(_objectSpread(_objectSpread({}, value), {}, {
|
|
100
|
+
fieldName: fieldName
|
|
101
|
+
}), _textContent4);
|
|
102
|
+
}
|
|
86
103
|
default:
|
|
87
104
|
{
|
|
88
105
|
throw new Error("Unsupported hydrated value type ".concat(value.type));
|
|
@@ -105,6 +122,12 @@ var getMembersOfArgumentNodes = function getMembersOfArgumentNodes(ast, teamId)
|
|
|
105
122
|
}
|
|
106
123
|
return ast.query.accept(new FindMembersOfArgumentsVisitor(teamId));
|
|
107
124
|
};
|
|
125
|
+
var getFunctionArgumentNodes = function getFunctionArgumentNodes(ast, fieldName, valueId) {
|
|
126
|
+
if (!ast.query) {
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
return ast.query.accept(new FindFunctionArgumentsVisitor(fieldName, valueId));
|
|
130
|
+
};
|
|
108
131
|
|
|
109
132
|
/**
|
|
110
133
|
* Base visitor class for traversing JQL AST to find specific nodes.
|
|
@@ -191,21 +214,51 @@ var FindValuesVisitor = /*#__PURE__*/function (_BaseAstNodeFinder2) {
|
|
|
191
214
|
return _createClass(FindValuesVisitor);
|
|
192
215
|
}(BaseAstNodeFinder);
|
|
193
216
|
/**
|
|
194
|
-
* Visitor that finds
|
|
195
|
-
*
|
|
217
|
+
* Visitor that finds function arguments for a specific field matching a target value id.
|
|
218
|
+
* This visitor is field-aware: it processes clauses for the given field and matches arguments by their raw value.
|
|
196
219
|
*/
|
|
197
|
-
var
|
|
198
|
-
function
|
|
220
|
+
var FindFunctionArgumentsVisitor = /*#__PURE__*/function (_BaseAstNodeFinder3) {
|
|
221
|
+
function FindFunctionArgumentsVisitor(fieldName, targetValueId) {
|
|
199
222
|
var _this3;
|
|
200
|
-
_classCallCheck(this,
|
|
201
|
-
_this3 = _callSuper(this,
|
|
223
|
+
_classCallCheck(this, FindFunctionArgumentsVisitor);
|
|
224
|
+
_this3 = _callSuper(this, FindFunctionArgumentsVisitor);
|
|
202
225
|
_defineProperty(_this3, "visitTerminalClause", function (terminalClause) {
|
|
226
|
+
if (!_this3.equalsIgnoreCase(terminalClause.field.value, _this3.fieldName)) {
|
|
227
|
+
return [];
|
|
228
|
+
}
|
|
203
229
|
if (terminalClause.operand === undefined) {
|
|
204
230
|
return [];
|
|
205
231
|
}
|
|
206
232
|
return terminalClause.operand.accept(_this3);
|
|
207
233
|
});
|
|
208
234
|
_defineProperty(_this3, "visitFunctionOperand", function (functionOperand) {
|
|
235
|
+
return functionOperand.arguments.filter(function (arg) {
|
|
236
|
+
return _this3.equalsIgnoreCase(arg.value.trim(), _this3.targetValueId);
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
_this3.fieldName = fieldName;
|
|
240
|
+
_this3.targetValueId = targetValueId.trim();
|
|
241
|
+
return _this3;
|
|
242
|
+
}
|
|
243
|
+
_inherits(FindFunctionArgumentsVisitor, _BaseAstNodeFinder3);
|
|
244
|
+
return _createClass(FindFunctionArgumentsVisitor);
|
|
245
|
+
}(BaseAstNodeFinder);
|
|
246
|
+
/**
|
|
247
|
+
* Visitor that finds membersOf function arguments matching a specific team ID.
|
|
248
|
+
* Used for queries like "assignee in membersOf("id: <uuid>")".
|
|
249
|
+
*/
|
|
250
|
+
var FindMembersOfArgumentsVisitor = /*#__PURE__*/function (_BaseAstNodeFinder4) {
|
|
251
|
+
function FindMembersOfArgumentsVisitor(teamId) {
|
|
252
|
+
var _this4;
|
|
253
|
+
_classCallCheck(this, FindMembersOfArgumentsVisitor);
|
|
254
|
+
_this4 = _callSuper(this, FindMembersOfArgumentsVisitor);
|
|
255
|
+
_defineProperty(_this4, "visitTerminalClause", function (terminalClause) {
|
|
256
|
+
if (terminalClause.operand === undefined) {
|
|
257
|
+
return [];
|
|
258
|
+
}
|
|
259
|
+
return terminalClause.operand.accept(_this4);
|
|
260
|
+
});
|
|
261
|
+
_defineProperty(_this4, "visitFunctionOperand", function (functionOperand) {
|
|
209
262
|
var functionName = functionOperand.function.value.toLowerCase();
|
|
210
263
|
|
|
211
264
|
// Only process membersOf function
|
|
@@ -216,18 +269,18 @@ var FindMembersOfArgumentsVisitor = /*#__PURE__*/function (_BaseAstNodeFinder3)
|
|
|
216
269
|
functionOperand.arguments.forEach(function (arg) {
|
|
217
270
|
// Normalize both values by removing extra whitespace for comparison
|
|
218
271
|
// This handles both "id: uuid" and "id:uuid" formats
|
|
219
|
-
var normalizedArgValue =
|
|
220
|
-
var normalizedTeamId =
|
|
221
|
-
if (
|
|
272
|
+
var normalizedArgValue = _this4.normalizeValue(arg.value);
|
|
273
|
+
var normalizedTeamId = _this4.normalizeValue(_this4.teamId);
|
|
274
|
+
if (_this4.equalsIgnoreCase(normalizedArgValue, normalizedTeamId)) {
|
|
222
275
|
matchingArgs.push(arg);
|
|
223
276
|
}
|
|
224
277
|
});
|
|
225
278
|
return matchingArgs;
|
|
226
279
|
});
|
|
227
|
-
|
|
228
|
-
return
|
|
280
|
+
_this4.teamId = teamId;
|
|
281
|
+
return _this4;
|
|
229
282
|
}
|
|
230
|
-
_inherits(FindMembersOfArgumentsVisitor,
|
|
283
|
+
_inherits(FindMembersOfArgumentsVisitor, _BaseAstNodeFinder4);
|
|
231
284
|
return _createClass(FindMembersOfArgumentsVisitor, [{
|
|
232
285
|
key: "normalizeValue",
|
|
233
286
|
value:
|
|
@@ -12,19 +12,19 @@ import { normaliseHydrationKey, ValidQueryVisitor } from './util';
|
|
|
12
12
|
export var hydrateQuery = function hydrateQuery() {
|
|
13
13
|
return /*#__PURE__*/function () {
|
|
14
14
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref, _ref2) {
|
|
15
|
-
var setState, getState, dispatch, onHydrate, _getState, query, oldHydratedValues, enableRichInlineNodes, editorState, queryToHydrate, jast, visitor, newHydratedValues, hydratedValuesMap;
|
|
16
|
-
return _regeneratorRuntime.wrap(function
|
|
15
|
+
var setState, getState, dispatch, onHydrate, _getState, query, oldHydratedValues, enableRichInlineNodes, editorState, queryToHydrate, jast, visitor, newHydratedValues, hydratedValuesMap, _t;
|
|
16
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
17
17
|
while (1) switch (_context.prev = _context.next) {
|
|
18
18
|
case 0:
|
|
19
19
|
setState = _ref.setState, getState = _ref.getState, dispatch = _ref.dispatch;
|
|
20
20
|
onHydrate = _ref2.onHydrate;
|
|
21
21
|
_getState = getState(), query = _getState.query, oldHydratedValues = _getState.hydratedValues, enableRichInlineNodes = _getState.enableRichInlineNodes, editorState = _getState.editorState;
|
|
22
22
|
if (!(!enableRichInlineNodes || !onHydrate || !query)) {
|
|
23
|
-
_context.next =
|
|
23
|
+
_context.next = 1;
|
|
24
24
|
break;
|
|
25
25
|
}
|
|
26
26
|
return _context.abrupt("return");
|
|
27
|
-
case
|
|
27
|
+
case 1:
|
|
28
28
|
queryToHydrate = query;
|
|
29
29
|
jast = getJastFromState(editorState); // Hydration API will fail for syntactically invalid queries, including partial queries. We do want to hydrate those
|
|
30
30
|
// as well to be able to handle queries like `assignee in (abc-123-def`, so we build an equivalent valid query.
|
|
@@ -33,15 +33,15 @@ export var hydrateQuery = function hydrateQuery() {
|
|
|
33
33
|
queryToHydrate = jast.query.accept(visitor);
|
|
34
34
|
}
|
|
35
35
|
if (queryToHydrate) {
|
|
36
|
-
_context.next =
|
|
36
|
+
_context.next = 2;
|
|
37
37
|
break;
|
|
38
38
|
}
|
|
39
39
|
return _context.abrupt("return");
|
|
40
|
-
case
|
|
41
|
-
_context.prev =
|
|
42
|
-
_context.next =
|
|
40
|
+
case 2:
|
|
41
|
+
_context.prev = 2;
|
|
42
|
+
_context.next = 3;
|
|
43
43
|
return onHydrate(queryToHydrate);
|
|
44
|
-
case
|
|
44
|
+
case 3:
|
|
45
45
|
newHydratedValues = _context.sent;
|
|
46
46
|
// IMPORTANT: Field name keys must be normalised (unquoted + lowercased) when storing hydrated values.
|
|
47
47
|
// The hydration API returns field names in a canonical format (e.g. 'Project[AtlassianProject]'),
|
|
@@ -63,16 +63,16 @@ export var hydrateQuery = function hydrateQuery() {
|
|
|
63
63
|
hydratedValues: hydratedValuesMap
|
|
64
64
|
});
|
|
65
65
|
dispatch(replaceHydratedValuesWithRichInlineNodes());
|
|
66
|
-
_context.next =
|
|
66
|
+
_context.next = 5;
|
|
67
67
|
break;
|
|
68
|
-
case
|
|
69
|
-
_context.prev =
|
|
70
|
-
|
|
71
|
-
case
|
|
68
|
+
case 4:
|
|
69
|
+
_context.prev = 4;
|
|
70
|
+
_t = _context["catch"](2);
|
|
71
|
+
case 5:
|
|
72
72
|
case "end":
|
|
73
73
|
return _context.stop();
|
|
74
74
|
}
|
|
75
|
-
}, _callee, null, [[
|
|
75
|
+
}, _callee, null, [[2, 4]]);
|
|
76
76
|
}));
|
|
77
77
|
return function (_x, _x2) {
|
|
78
78
|
return _ref3.apply(this, arguments);
|
|
@@ -79,16 +79,16 @@ export var ValidQueryVisitor = /*#__PURE__*/function (_AbstractJastVisitor) {
|
|
|
79
79
|
}).join(', '), ")");
|
|
80
80
|
});
|
|
81
81
|
_defineProperty(_this, "visitFunctionOperand", function (functionOperand) {
|
|
82
|
-
// Only include membersOf function as it has arguments that need hydration
|
|
83
|
-
// Other functions like currentUser() don't have hydratable arguments
|
|
84
82
|
var functionName = functionOperand.function.value.toLowerCase();
|
|
85
|
-
if (functionName !== 'membersof' || !fg('jira-membersof-team-support')) {
|
|
86
|
-
return '';
|
|
87
|
-
}
|
|
88
83
|
var args = functionOperand.arguments.map(function (arg) {
|
|
89
84
|
return arg.text;
|
|
90
85
|
}).join(', ');
|
|
91
|
-
|
|
86
|
+
|
|
87
|
+
// The generic gate supersedes the legacy membersOf-specific gate: when
|
|
88
|
+
// jql-function-arg-hydration is on, any function with arguments is included (covering
|
|
89
|
+
// membersOf and all others). Otherwise fall back to the legacy membersOf-only path.
|
|
90
|
+
var shouldIncludeFunction = fg('jql-function-arg-hydration') ? functionOperand.arguments.length > 0 : functionName === 'membersof' && fg('jira-membersof-team-support');
|
|
91
|
+
return shouldIncludeFunction ? "".concat(functionOperand.function.text, "(").concat(args, ")") : '';
|
|
92
92
|
});
|
|
93
93
|
return _this;
|
|
94
94
|
}
|
package/dist/esm/state/index.js
CHANGED
|
@@ -944,16 +944,25 @@ export var useHydratedGoal = createHook(Store, {
|
|
|
944
944
|
return goal && goal.type === 'goal' ? goal : undefined;
|
|
945
945
|
}
|
|
946
946
|
});
|
|
947
|
+
export var useHydratedLozengeWithAvatar = createHook(Store, {
|
|
948
|
+
selector: function selector(state, _ref43) {
|
|
949
|
+
var _state$hydratedValues0;
|
|
950
|
+
var id = _ref43.id,
|
|
951
|
+
fieldName = _ref43.fieldName;
|
|
952
|
+
var value = (_state$hydratedValues0 = state.hydratedValues[normaliseHydrationKey(fieldName)]) === null || _state$hydratedValues0 === void 0 ? void 0 : _state$hydratedValues0.get(normaliseJqlString(id));
|
|
953
|
+
return value && value.type === 'lozengeWithAvatar' ? value : undefined;
|
|
954
|
+
}
|
|
955
|
+
});
|
|
947
956
|
export var useHydratedDeprecations = createHook(Store, {
|
|
948
957
|
selector: function selector(state) {
|
|
949
958
|
var ast = getJastFromState(state.editorState);
|
|
950
959
|
var fieldsInQuery = getFieldNodes(ast);
|
|
951
960
|
var toReturn = [];
|
|
952
|
-
Object.entries(state.hydratedValues).forEach(function (
|
|
953
|
-
var _state$
|
|
954
|
-
var
|
|
955
|
-
fieldName =
|
|
956
|
-
(_state$
|
|
961
|
+
Object.entries(state.hydratedValues).forEach(function (_ref44) {
|
|
962
|
+
var _state$hydratedValues1;
|
|
963
|
+
var _ref45 = _slicedToArray(_ref44, 1),
|
|
964
|
+
fieldName = _ref45[0];
|
|
965
|
+
(_state$hydratedValues1 = state.hydratedValues[fieldName]) === null || _state$hydratedValues1 === void 0 || _state$hydratedValues1.forEach(function (value) {
|
|
957
966
|
if (value.type === 'deprecated-field') {
|
|
958
967
|
if (fieldsInQuery.has(value.id.toLowerCase())) {
|
|
959
968
|
toReturn.push(value);
|
|
@@ -976,19 +985,19 @@ export var useOnSyntaxHelp = createHook(Store, {
|
|
|
976
985
|
});
|
|
977
986
|
export var EditorStateContainer = createContainer(Store, {
|
|
978
987
|
onInit: function onInit() {
|
|
979
|
-
return function (
|
|
980
|
-
var getState =
|
|
981
|
-
setState =
|
|
982
|
-
dispatch =
|
|
983
|
-
var intlRef =
|
|
984
|
-
query =
|
|
985
|
-
isSearching =
|
|
986
|
-
autocompleteProvider =
|
|
987
|
-
externalMessages =
|
|
988
|
-
enableRichInlineNodes =
|
|
989
|
-
onDebugUnsafeMessage =
|
|
990
|
-
onSyntaxHelp =
|
|
991
|
-
customComponents =
|
|
988
|
+
return function (_ref46, _ref47) {
|
|
989
|
+
var getState = _ref46.getState,
|
|
990
|
+
setState = _ref46.setState,
|
|
991
|
+
dispatch = _ref46.dispatch;
|
|
992
|
+
var intlRef = _ref47.intlRef,
|
|
993
|
+
query = _ref47.query,
|
|
994
|
+
isSearching = _ref47.isSearching,
|
|
995
|
+
autocompleteProvider = _ref47.autocompleteProvider,
|
|
996
|
+
externalMessages = _ref47.externalMessages,
|
|
997
|
+
enableRichInlineNodes = _ref47.enableRichInlineNodes,
|
|
998
|
+
onDebugUnsafeMessage = _ref47.onDebugUnsafeMessage,
|
|
999
|
+
onSyntaxHelp = _ref47.onSyntaxHelp,
|
|
1000
|
+
customComponents = _ref47.customComponents;
|
|
992
1001
|
setState({
|
|
993
1002
|
controlledQuery: query,
|
|
994
1003
|
query: query,
|
|
@@ -1017,18 +1026,18 @@ export var EditorStateContainer = createContainer(Store, {
|
|
|
1017
1026
|
};
|
|
1018
1027
|
},
|
|
1019
1028
|
onUpdate: function onUpdate() {
|
|
1020
|
-
return function (
|
|
1021
|
-
var getState =
|
|
1022
|
-
setState =
|
|
1023
|
-
dispatch =
|
|
1024
|
-
var controlledQueryProp =
|
|
1025
|
-
isSearching =
|
|
1026
|
-
autocompleteProvider =
|
|
1027
|
-
externalMessages =
|
|
1028
|
-
enableRichInlineNodes =
|
|
1029
|
-
onDebugUnsafeMessage =
|
|
1030
|
-
onSyntaxHelp =
|
|
1031
|
-
customComponents =
|
|
1029
|
+
return function (_ref48, _ref49) {
|
|
1030
|
+
var getState = _ref48.getState,
|
|
1031
|
+
setState = _ref48.setState,
|
|
1032
|
+
dispatch = _ref48.dispatch;
|
|
1033
|
+
var controlledQueryProp = _ref49.query,
|
|
1034
|
+
isSearching = _ref49.isSearching,
|
|
1035
|
+
autocompleteProvider = _ref49.autocompleteProvider,
|
|
1036
|
+
externalMessages = _ref49.externalMessages,
|
|
1037
|
+
enableRichInlineNodes = _ref49.enableRichInlineNodes,
|
|
1038
|
+
onDebugUnsafeMessage = _ref49.onDebugUnsafeMessage,
|
|
1039
|
+
onSyntaxHelp = _ref49.onSyntaxHelp,
|
|
1040
|
+
customComponents = _ref49.customComponents;
|
|
1032
1041
|
var _getState12 = getState(),
|
|
1033
1042
|
controlledQuery = _getState12.controlledQuery,
|
|
1034
1043
|
query = _getState12.query;
|
|
@@ -25,7 +25,7 @@ styled.div({
|
|
|
25
25
|
},
|
|
26
26
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
27
27
|
'&[disabled]': {
|
|
28
|
-
background: "var(--ds-background-disabled, #
|
|
28
|
+
background: "var(--ds-background-disabled, #0515240F)"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
});
|
|
@@ -92,7 +92,7 @@ function (props) {
|
|
|
92
92
|
export var ReadOnlyEditorViewContainer =
|
|
93
93
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
94
94
|
styled(EditorViewContainer)({
|
|
95
|
-
backgroundColor: "var(--ds-background-disabled, #
|
|
95
|
+
backgroundColor: "var(--ds-background-disabled, #0515240F)",
|
|
96
96
|
color: "var(--ds-text-disabled, #080F214A)",
|
|
97
97
|
pointerEvents: 'none'
|
|
98
98
|
});
|
|
@@ -4,7 +4,6 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
4
4
|
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; }
|
|
5
5
|
import React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
6
6
|
import throttle from 'lodash/throttle';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { JQL_EDITOR_AUTOCOMPLETE_ID, JQL_EDITOR_HELP_CONTENT_ID, JQL_EDITOR_INPUT_ID, JQL_EDITOR_MAIN_ID, JQL_EDITOR_VALIDATION_ID } from '../../common/constants';
|
|
9
8
|
import { useEditorThemeContext } from '../../hooks/use-editor-theme';
|
|
10
9
|
import { useEditorViewIsInvalid } from '../../hooks/use-editor-view-is-invalid';
|
|
@@ -122,7 +121,7 @@ var JQLEditorView = function JQLEditorView(_ref) {
|
|
|
122
121
|
'aria-activedescendant': selectedOptionId
|
|
123
122
|
}), editorViewIsInvalid && {
|
|
124
123
|
'aria-invalid': 'true'
|
|
125
|
-
}),
|
|
124
|
+
}), {}, {
|
|
126
125
|
tabindex: '0'
|
|
127
126
|
});
|
|
128
127
|
}, [editorId, isAutocompleteOpen, intl, autocompleteId, editorViewIsInvalid, validationId, helpContentId, selectedOptionId]);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { Props as GoalRichInlineProps } from './goal/types';
|
|
2
|
+
import { type Props as LozengeWithAvatarRichInlineProps } from './lozenge-with-avatar';
|
|
2
3
|
import type { Props as ProjectRichInlineProps } from './project/types';
|
|
3
4
|
import { type Props as TeamRichInlineProps } from './team';
|
|
4
5
|
import type { JQLNodeSpec } from './types';
|
|
5
6
|
import { type Props as UserRichInlineProps } from './user';
|
|
6
7
|
export declare const richInlineNodes: {
|
|
7
8
|
goal: JQLNodeSpec<GoalRichInlineProps>;
|
|
9
|
+
lozengeWithAvatar: JQLNodeSpec<LozengeWithAvatarRichInlineProps>;
|
|
8
10
|
project: JQLNodeSpec<ProjectRichInlineProps>;
|
|
9
11
|
team: JQLNodeSpec<TeamRichInlineProps>;
|
|
10
12
|
user: JQLNodeSpec<UserRichInlineProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DetailedHTMLProps, HTMLAttributes } from 'react';
|
|
2
|
+
import { type Theme } from '@emotion/react';
|
|
3
|
+
import { type StyledComponent } from '@emotion/styled';
|
|
4
|
+
export declare const LozengeWithAvatarContainer: StyledComponent<{
|
|
5
|
+
as?: React.ElementType;
|
|
6
|
+
theme?: Theme;
|
|
7
|
+
} & {
|
|
8
|
+
error: boolean;
|
|
9
|
+
selected: boolean;
|
|
10
|
+
}, DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
11
|
+
export declare const NameContainer: StyledComponent<{
|
|
12
|
+
as?: React.ElementType;
|
|
13
|
+
theme?: Theme;
|
|
14
|
+
}, DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
15
|
+
export declare const AvatarWrapper: StyledComponent<{
|
|
16
|
+
as?: React.ElementType;
|
|
17
|
+
theme?: Theme;
|
|
18
|
+
}, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -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 HydratedGoal, type HydratedTeam, type HydratedUser, type HydratedValue } from '../ui/jql-editor/types';
|
|
13
|
+
import { type HydratedDeprecatedField, type HydratedProject, type HydratedGoal, type HydratedLozengeWithAvatar, 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
|
type Actions = {
|
|
@@ -91,6 +91,10 @@ export declare const useHydratedGoal: HookFunction<HydratedGoal | undefined, Bou
|
|
|
91
91
|
fieldName: string;
|
|
92
92
|
id: string;
|
|
93
93
|
}>;
|
|
94
|
+
export declare const useHydratedLozengeWithAvatar: HookFunction<HydratedLozengeWithAvatar | undefined, BoundActions<State, Actions>, {
|
|
95
|
+
fieldName: string;
|
|
96
|
+
id: string;
|
|
97
|
+
}>;
|
|
94
98
|
export declare const useHydratedDeprecations: HookFunction<HydratedDeprecatedField[], BoundActions<State, Actions>, void>;
|
|
95
99
|
export declare const useRichInlineNodesEnabled: HookFunction<boolean, BoundActions<State, Actions>, void>;
|
|
96
100
|
export declare const useOnSyntaxHelp: HookFunction<void | ((e: MouseEvent<HTMLElement>) => boolean), BoundActions<State, Actions>, void>;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { JQLClause } from '@atlaskit/jql-autocomplete';
|
|
2
|
-
export type { JQLEditorUIProps, JQLEditorProps, HydratedValues, HydratedValue, HydratedUser, HydratedTeam, HydratedProject, HydratedGoal, } from './ui/types';
|
|
2
|
+
export type { JQLEditorUIProps, JQLEditorProps, HydratedValues, HydratedValue, HydratedUser, HydratedTeam, HydratedProject, HydratedGoal, HydratedLozengeWithAvatar, } from './ui/types';
|
|
3
3
|
export type { ExternalMessage, ExternalError, ExternalWarning, ExternalInfo, CustomComponents, } from './state/types';
|
|
4
4
|
export type { AutocompleteProvider, AutocompleteOptions, AutocompleteOption, AutocompleteValueType, } from './plugins/types';
|
|
5
5
|
export type { ListenerProps, JqlAnalyticsEvent } from './analytics';
|
|
@@ -37,7 +37,13 @@ export type HydratedDeprecatedField = {
|
|
|
37
37
|
id: string;
|
|
38
38
|
type: 'deprecated-field';
|
|
39
39
|
};
|
|
40
|
-
export type
|
|
40
|
+
export type HydratedLozengeWithAvatar = {
|
|
41
|
+
avatarUrl?: string;
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
type: 'lozengeWithAvatar';
|
|
45
|
+
};
|
|
46
|
+
export type HydratedValue = HydratedUser | HydratedTeam | HydratedProject | HydratedGoal | HydratedDeprecatedField | HydratedLozengeWithAvatar;
|
|
41
47
|
export type HydratedValues = {
|
|
42
48
|
[fieldName: string]: HydratedValue[];
|
|
43
49
|
};
|
package/dist/types/ui/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JQLEditorUIProps } from './jql-editor/types';
|
|
2
|
-
export type { JQLEditorUIProps, HydratedValue, HydratedValues, HydratedUser, HydratedTeam, HydratedProject, HydratedGoal, } from './jql-editor/types';
|
|
2
|
+
export type { JQLEditorUIProps, HydratedValue, HydratedValues, HydratedUser, HydratedTeam, HydratedProject, HydratedGoal, HydratedLozengeWithAvatar, } from './jql-editor/types';
|
|
3
3
|
export type JQLEditorProps = JQLEditorUIProps & {
|
|
4
4
|
/**
|
|
5
5
|
* React-intl locale. This should be set to "en" if alternate message sets are not being loaded higher in the React
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { Props as GoalRichInlineProps } from './goal/types';
|
|
2
|
+
import { type Props as LozengeWithAvatarRichInlineProps } from './lozenge-with-avatar';
|
|
2
3
|
import type { Props as ProjectRichInlineProps } from './project/types';
|
|
3
4
|
import { type Props as TeamRichInlineProps } from './team';
|
|
4
5
|
import type { JQLNodeSpec } from './types';
|
|
5
6
|
import { type Props as UserRichInlineProps } from './user';
|
|
6
7
|
export declare const richInlineNodes: {
|
|
7
8
|
goal: JQLNodeSpec<GoalRichInlineProps>;
|
|
9
|
+
lozengeWithAvatar: JQLNodeSpec<LozengeWithAvatarRichInlineProps>;
|
|
8
10
|
project: JQLNodeSpec<ProjectRichInlineProps>;
|
|
9
11
|
team: JQLNodeSpec<TeamRichInlineProps>;
|
|
10
12
|
user: JQLNodeSpec<UserRichInlineProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DetailedHTMLProps, HTMLAttributes } from 'react';
|
|
2
|
+
import { type Theme } from '@emotion/react';
|
|
3
|
+
import { type StyledComponent } from '@emotion/styled';
|
|
4
|
+
export declare const LozengeWithAvatarContainer: StyledComponent<{
|
|
5
|
+
as?: React.ElementType;
|
|
6
|
+
theme?: Theme;
|
|
7
|
+
} & {
|
|
8
|
+
error: boolean;
|
|
9
|
+
selected: boolean;
|
|
10
|
+
}, DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
11
|
+
export declare const NameContainer: StyledComponent<{
|
|
12
|
+
as?: React.ElementType;
|
|
13
|
+
theme?: Theme;
|
|
14
|
+
}, DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
15
|
+
export declare const AvatarWrapper: StyledComponent<{
|
|
16
|
+
as?: React.ElementType;
|
|
17
|
+
theme?: Theme;
|
|
18
|
+
}, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -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 HydratedGoal, type HydratedTeam, type HydratedUser, type HydratedValue } from '../ui/jql-editor/types';
|
|
13
|
+
import { type HydratedDeprecatedField, type HydratedProject, type HydratedGoal, type HydratedLozengeWithAvatar, 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
|
type Actions = {
|
|
@@ -91,6 +91,10 @@ export declare const useHydratedGoal: HookFunction<HydratedGoal | undefined, Bou
|
|
|
91
91
|
fieldName: string;
|
|
92
92
|
id: string;
|
|
93
93
|
}>;
|
|
94
|
+
export declare const useHydratedLozengeWithAvatar: HookFunction<HydratedLozengeWithAvatar | undefined, BoundActions<State, Actions>, {
|
|
95
|
+
fieldName: string;
|
|
96
|
+
id: string;
|
|
97
|
+
}>;
|
|
94
98
|
export declare const useHydratedDeprecations: HookFunction<HydratedDeprecatedField[], BoundActions<State, Actions>, void>;
|
|
95
99
|
export declare const useRichInlineNodesEnabled: HookFunction<boolean, BoundActions<State, Actions>, void>;
|
|
96
100
|
export declare const useOnSyntaxHelp: HookFunction<void | ((e: MouseEvent<HTMLElement>) => boolean), BoundActions<State, Actions>, void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { JQLClause } from '@atlaskit/jql-autocomplete';
|
|
2
|
-
export type { JQLEditorUIProps, JQLEditorProps, HydratedValues, HydratedValue, HydratedUser, HydratedTeam, HydratedProject, HydratedGoal, } from './ui/types';
|
|
2
|
+
export type { JQLEditorUIProps, JQLEditorProps, HydratedValues, HydratedValue, HydratedUser, HydratedTeam, HydratedProject, HydratedGoal, HydratedLozengeWithAvatar, } from './ui/types';
|
|
3
3
|
export type { ExternalMessage, ExternalError, ExternalWarning, ExternalInfo, CustomComponents, } from './state/types';
|
|
4
4
|
export type { AutocompleteProvider, AutocompleteOptions, AutocompleteOption, AutocompleteValueType, } from './plugins/types';
|
|
5
5
|
export type { ListenerProps, JqlAnalyticsEvent } from './analytics';
|
|
@@ -37,7 +37,13 @@ export type HydratedDeprecatedField = {
|
|
|
37
37
|
id: string;
|
|
38
38
|
type: 'deprecated-field';
|
|
39
39
|
};
|
|
40
|
-
export type
|
|
40
|
+
export type HydratedLozengeWithAvatar = {
|
|
41
|
+
avatarUrl?: string;
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
type: 'lozengeWithAvatar';
|
|
45
|
+
};
|
|
46
|
+
export type HydratedValue = HydratedUser | HydratedTeam | HydratedProject | HydratedGoal | HydratedDeprecatedField | HydratedLozengeWithAvatar;
|
|
41
47
|
export type HydratedValues = {
|
|
42
48
|
[fieldName: string]: HydratedValue[];
|
|
43
49
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JQLEditorUIProps } from './jql-editor/types';
|
|
2
|
-
export type { JQLEditorUIProps, HydratedValue, HydratedValues, HydratedUser, HydratedTeam, HydratedProject, HydratedGoal, } from './jql-editor/types';
|
|
2
|
+
export type { JQLEditorUIProps, HydratedValue, HydratedValues, HydratedUser, HydratedTeam, HydratedProject, HydratedGoal, HydratedLozengeWithAvatar, } from './jql-editor/types';
|
|
3
3
|
export type JQLEditorProps = JQLEditorUIProps & {
|
|
4
4
|
/**
|
|
5
5
|
* React-intl locale. This should be set to "en" if alternate message sets are not being loaded higher in the React
|