@atlaskit/jql-editor 6.4.0 → 6.4.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.
- package/CHANGELOG.md +18 -1
- package/dist/cjs/async.js +3 -6
- package/dist/cjs/hooks/use-editor-theme/index.js +4 -9
- package/dist/cjs/plugins/autocomplete/components/autocomplete-dropdown/index.js +4 -7
- package/dist/cjs/ui/jql-editor-layout/index.js +3 -5
- package/dist/cjs/ui/jql-editor-layout/styled.js +2 -3
- package/dist/es2019/async.js +3 -6
- package/dist/es2019/hooks/use-editor-theme/index.js +2 -5
- package/dist/es2019/plugins/autocomplete/components/autocomplete-dropdown/index.js +5 -7
- package/dist/es2019/ui/jql-editor-layout/index.js +4 -6
- package/dist/es2019/ui/jql-editor-layout/styled.js +2 -3
- package/dist/esm/async.js +3 -6
- package/dist/esm/hooks/use-editor-theme/index.js +4 -9
- package/dist/esm/plugins/autocomplete/components/autocomplete-dropdown/index.js +4 -7
- package/dist/esm/ui/jql-editor-layout/index.js +3 -5
- package/dist/esm/ui/jql-editor-layout/styled.js +2 -3
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
# @atlaskit/jql-editor
|
|
2
2
|
|
|
3
|
+
## 6.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4f13d0c596cb7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4f13d0c596cb7) -
|
|
8
|
+
Cleanup experiment gate `anip-1289-scroll-issues-in-jql-autocomplete`. The scroll fix (maxWidth
|
|
9
|
+
clamping on the autocomplete Popper panel) is now permanently enabled.
|
|
10
|
+
|
|
11
|
+
## 6.4.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`41cdac092bfaa`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/41cdac092bfaa) -
|
|
16
|
+
Cleanup feature gate list_lovability_improving_filters. The defaultRows prop is now always applied
|
|
17
|
+
to the JQL editor, enabling configurable initial row height.
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 6.4.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
6
23
|
|
|
7
|
-
- [`
|
|
24
|
+
- [`ebab8f80bfc40`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ebab8f80bfc40) -
|
|
8
25
|
Autofix: add explicit package exports (barrel removal)
|
|
9
26
|
|
|
10
27
|
### Patch Changes
|
package/dist/cjs/async.js
CHANGED
|
@@ -6,10 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.preloadJQLEditor = exports.JQLEditorAsync = void 0;
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
9
|
var _react = _interopRequireDefault(require("react"));
|
|
11
10
|
var _reactLooselyLazy = require("react-loosely-lazy");
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
11
|
var _errorBoundary = require("./ui/error-boundary");
|
|
14
12
|
var _intlProvider = require("./ui/intl-provider");
|
|
15
13
|
var _jqlEditorLayout = require("./ui/jql-editor-layout");
|
|
@@ -33,12 +31,11 @@ var preloadJQLEditor = exports.preloadJQLEditor = function preloadJQLEditor() {
|
|
|
33
31
|
};
|
|
34
32
|
var JQLEditorAsync = exports.JQLEditorAsync = (0, _intlProvider.withIntlProvider)((0, _errorBoundary.withErrorBoundary)(function (props) {
|
|
35
33
|
return /*#__PURE__*/_react.default.createElement(_reactLooselyLazy.LazySuspense, {
|
|
36
|
-
fallback: /*#__PURE__*/_react.default.createElement(_jqlEditorLayout.JQLEditorReadOnly,
|
|
34
|
+
fallback: /*#__PURE__*/_react.default.createElement(_jqlEditorLayout.JQLEditorReadOnly, {
|
|
37
35
|
query: props.query,
|
|
38
36
|
isSearch: !!props.onSearch,
|
|
39
|
-
isCompact: props.isCompact
|
|
40
|
-
}, (0, _platformFeatureFlags.fg)('list_lovability_improving_filters') ? {
|
|
37
|
+
isCompact: props.isCompact,
|
|
41
38
|
defaultRows: props.defaultRows
|
|
42
|
-
}
|
|
39
|
+
})
|
|
43
40
|
}, /*#__PURE__*/_react.default.createElement(JQLEditor, props));
|
|
44
41
|
}));
|
|
@@ -5,13 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.useEditorThemeContext = exports.useEditorTheme = exports.EditorThemeContext = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
9
|
var _react = require("react");
|
|
11
10
|
var _noop = _interopRequireDefault(require("lodash/noop"));
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
|
-
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; }
|
|
14
|
-
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) { (0, _defineProperty2.default)(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; }
|
|
15
11
|
var defaultMaxRows = 3;
|
|
16
12
|
var expandedRows = 15;
|
|
17
13
|
var defaultEditorTheme = {
|
|
@@ -43,16 +39,15 @@ var useEditorTheme = exports.useEditorTheme = function useEditorTheme(_ref) {
|
|
|
43
39
|
});
|
|
44
40
|
}, []);
|
|
45
41
|
return (0, _react.useMemo)(function () {
|
|
46
|
-
return
|
|
47
|
-
defaultMaxRows: defaultRows !== undefined && defaultRows > defaultMaxRows
|
|
42
|
+
return {
|
|
43
|
+
defaultMaxRows: defaultRows !== undefined && defaultRows > defaultMaxRows ? defaultRows : defaultMaxRows,
|
|
48
44
|
expanded: expanded,
|
|
49
45
|
expandedRows: expandedRows,
|
|
50
46
|
toggleExpanded: toggleExpanded,
|
|
51
47
|
isSearch: isSearch,
|
|
52
|
-
isCompact: isCompact
|
|
53
|
-
}, (0, _platformFeatureFlags.fg)('list_lovability_improving_filters') ? {
|
|
48
|
+
isCompact: isCompact,
|
|
54
49
|
defaultRows: defaultRows
|
|
55
|
-
}
|
|
50
|
+
};
|
|
56
51
|
}, [expanded, toggleExpanded, isSearch, isCompact, defaultRows]);
|
|
57
52
|
};
|
|
58
53
|
var useEditorThemeContext = exports.useEditorThemeContext = function useEditorThemeContext() {
|
|
@@ -10,7 +10,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
|
|
14
13
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
var _popper = require("@atlaskit/popper");
|
|
16
15
|
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
@@ -107,7 +106,6 @@ var AutocompleteDropdown = function AutocompleteDropdown(_ref) {
|
|
|
107
106
|
_useScopedId2 = (0, _slicedToArray2.default)(_useScopedId, 1),
|
|
108
107
|
autocompleteId = _useScopedId2[0];
|
|
109
108
|
var isPopperPositioningEnabled = (0, _platformFeatureFlags.fg)('jql_editor_autocomplete_use_popper');
|
|
110
|
-
var isScrollUIFixEnabled = _featureGateJsClient.default.getExperimentValue('anip-1289-scroll-issues-in-jql-autocomplete', 'isEnabled', false);
|
|
111
109
|
|
|
112
110
|
// Create virtual reference element positioned at cursor location (for popper implementation)
|
|
113
111
|
var virtualReferenceElement = (0, _react.useMemo)(function () {
|
|
@@ -338,14 +336,13 @@ var AutocompleteDropdown = function AutocompleteDropdown(_ref) {
|
|
|
338
336
|
return /*#__PURE__*/_react.default.createElement(_styled.AutocompleteContainer, {
|
|
339
337
|
"data-testid": "jql-editor-autocomplete",
|
|
340
338
|
tabIndex: -1,
|
|
341
|
-
ref: ref
|
|
342
|
-
|
|
343
|
-
,
|
|
344
|
-
style: isScrollUIFixEnabled ? _objectSpread(_objectSpread({}, style), {}, {
|
|
339
|
+
ref: ref,
|
|
340
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
345
341
|
// Popper's maxSize modifier can produce a maxWidth larger than our design cap on small
|
|
346
342
|
// viewports; clamp it here so the panel never overflows off-screen.
|
|
343
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- inline style needed to override Popper shouldFitViewport
|
|
347
344
|
maxWidth: 'min(400px, calc(100vw - 16px))'
|
|
348
|
-
})
|
|
345
|
+
}),
|
|
349
346
|
isOpen: isAutocompleteOpen,
|
|
350
347
|
usePopper: true,
|
|
351
348
|
onBlur: onEditorViewBlur,
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.JQLEditorReadOnly = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
9
|
var _react = _interopRequireDefault(require("react"));
|
|
11
10
|
var _reactIntl = require("react-intl");
|
|
12
11
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
@@ -49,7 +48,7 @@ var JQLEditorLayout = function JQLEditorLayout(props) {
|
|
|
49
48
|
onScroll: onEditorViewContainerScroll
|
|
50
49
|
}, /*#__PURE__*/_react.default.createElement(_styled.LineNumberToolbar, {
|
|
51
50
|
lineNumbersVisible: lineNumbersVisible
|
|
52
|
-
}), /*#__PURE__*/_react.default.createElement(_styled.EditorView,
|
|
51
|
+
}), /*#__PURE__*/_react.default.createElement(_styled.EditorView, {
|
|
53
52
|
defaultMaxRows: defaultMaxRows,
|
|
54
53
|
expandedRows: expandedRows,
|
|
55
54
|
isCompact: isCompact,
|
|
@@ -57,10 +56,9 @@ var JQLEditorLayout = function JQLEditorLayout(props) {
|
|
|
57
56
|
ref: onEditorViewRef,
|
|
58
57
|
onBlur: onEditorViewBlur,
|
|
59
58
|
onFocus: onEditorViewFocus,
|
|
60
|
-
onTransitionEnd: onEditorViewTransitionEnd
|
|
61
|
-
}, (0, _platformFeatureFlags.fg)('list_lovability_improving_filters') ? {
|
|
59
|
+
onTransitionEnd: onEditorViewTransitionEnd,
|
|
62
60
|
defaultRows: defaultRows
|
|
63
|
-
}
|
|
61
|
+
}), /*#__PURE__*/_react.default.createElement(_styled.EditorControls, {
|
|
64
62
|
isSearch: isSearch,
|
|
65
63
|
isCompact: isCompact,
|
|
66
64
|
isVisualRefresh: (0, _platformFeatureFlags.fg)('platform-component-visual-refresh')
|
|
@@ -8,7 +8,6 @@ exports.ReadOnlyEditorViewContainer = exports.ReadOnlyEditorView = exports.LineN
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _constants = require("@atlaskit/theme/constants");
|
|
13
12
|
var _constants2 = require("../../plugins/validation-tooltip/constants");
|
|
14
13
|
var _templateObject, _templateObject2, _templateObject3; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -130,9 +129,9 @@ var EditorView = exports.EditorView = // eslint-disable-next-line @atlaskit/desi
|
|
|
130
129
|
_styled.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t\tcounter-reset: lineNumber;\n\t\tflex-grow: 1;\n\n\t\ttransition:\n\t\t\theight 250ms cubic-bezier(0.15, 1, 0.3, 1),\n\t\t\tmax-height 250ms cubic-bezier(0.15, 1, 0.3, 1);\n\t\tmax-height: ", "px;\n\t\tline-height: ", ";\n\t\t", "\n\t\t", "\n\tfont-family: ", ";\n\t\tword-break: break-word;\n\t\toverflow-wrap: anywhere;\n\t\twhite-space: pre-wrap;\n\n\t\t&[data-expanded] {\n\t\t\theight: ", "px;\n\t\t\tmax-height: ", "px;\n\t\t}\n\n\t\t.ProseMirror {\n\t\t\tcolor: ", ";\n\t\t\tpadding: ", "px\n\t\t\t\t", "px;\n\n\t\t\t&:focus {\n\t\t\t\toutline: none;\n\t\t\t}\n\n\t\t\t.mark-token-keyword {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\n\t\t\t.mark-token-field {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\n\t\t\t.mark-token-operator {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\n\t\t\t.mark-token-error {\n\t\t\t\tcolor: ", ";\n\t\t\t\ttext-decoration: wavy underline;\n\t\t\t\ttext-decoration-thickness: 1px;\n\t\t\t\ttext-decoration-skip-ink: none;\n\t\t\t}\n\t\t}\n\n\t\tp {\n\t\t\tmargin: 0;\n\t\t\tcounter-increment: lineNumber;\n\t\t\tposition: relative;\n\n\t\t\t/* Show the current line number before each paragraph block. */\n\n\t\t\t&::before {\n\t\t\t\tcontent: counter(lineNumber);\n\t\t\t\tcolor: ", ";\n\t\t\t\tfont-size: 10px;\n\t\t\t\tline-height: ", ";\n\t\t\t\tpadding: 0 ", " 0 ", ";\n\t\t\t\tposition: absolute;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\t/* Shift the line number tag 100% (plus 8px padding) to the left to position it inside the LineNumberToolbar */\n\t\t\t\ttransform: translateX(calc(-100% - ", "));\n\n\t\t\t\t/* We can fit 3 digits before ellipses. This is not very responsive but saves us having to add expensive width\n recalculation logic to the LineNumberToolbar for a scenario that *should* never happen. */\n\t\t\t\tmax-width: 30px;\n\t\t\t\ttext-overflow: ellipsis;\n\t\t\t\toverflow: hidden;\n\t\t\t\twhite-space: nowrap;\n\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t"])), function (props) {
|
|
131
130
|
return rowHeight * props.defaultMaxRows + getEditorInputVerticalPadding(props.isCompact) * 2;
|
|
132
131
|
}, rowHeight / 14, function (props) {
|
|
133
|
-
return props.defaultRows
|
|
132
|
+
return props.defaultRows ? 'height: ' + (rowHeight * props.defaultRows + getEditorInputVerticalPadding(props.isCompact) * 2) + 'px;' : '';
|
|
134
133
|
}, function (props) {
|
|
135
|
-
return props.defaultRows
|
|
134
|
+
return props.defaultRows ? 'min-height: ' + (rowHeight * props.defaultRows + getEditorInputVerticalPadding(props.isCompact) * 2) + 'px;' : '';
|
|
136
135
|
}, "var(--ds-font-family-code, \"Atlassian Mono\", ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)", function (props) {
|
|
137
136
|
return rowHeight * props.expandedRows + getEditorInputVerticalPadding(props.isCompact) * 2;
|
|
138
137
|
}, function (props) {
|
package/dist/es2019/async.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
5
4
|
import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
5
|
import { withErrorBoundary } from './ui/error-boundary';
|
|
8
6
|
import { withIntlProvider } from './ui/intl-provider';
|
|
9
7
|
import { JQLEditorReadOnly } from './ui/jql-editor-layout';
|
|
@@ -20,12 +18,11 @@ const JQLEditor = lazyForPaint(() => import( /* webpackChunkName: "@atlassian/as
|
|
|
20
18
|
export const preloadJQLEditor = () => JQLEditor.preload();
|
|
21
19
|
export const JQLEditorAsync = withIntlProvider(withErrorBoundary(props => {
|
|
22
20
|
return /*#__PURE__*/React.createElement(LazySuspense, {
|
|
23
|
-
fallback: /*#__PURE__*/React.createElement(JQLEditorReadOnly,
|
|
21
|
+
fallback: /*#__PURE__*/React.createElement(JQLEditorReadOnly, {
|
|
24
22
|
query: props.query,
|
|
25
23
|
isSearch: !!props.onSearch,
|
|
26
|
-
isCompact: props.isCompact
|
|
27
|
-
}, fg('list_lovability_improving_filters') ? {
|
|
24
|
+
isCompact: props.isCompact,
|
|
28
25
|
defaultRows: props.defaultRows
|
|
29
|
-
}
|
|
26
|
+
})
|
|
30
27
|
}, /*#__PURE__*/React.createElement(JQLEditor, props));
|
|
31
28
|
}));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createContext, useCallback, useContext, useMemo, useState } from 'react';
|
|
2
2
|
import noop from 'lodash/noop';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
const defaultMaxRows = 3;
|
|
5
4
|
const expandedRows = 15;
|
|
6
5
|
const defaultEditorTheme = {
|
|
@@ -24,15 +23,13 @@ export const useEditorTheme = ({
|
|
|
24
23
|
const [expanded, setExpanded] = useState(false);
|
|
25
24
|
const toggleExpanded = useCallback(() => setExpanded(prevState => !prevState), []);
|
|
26
25
|
return useMemo(() => ({
|
|
27
|
-
defaultMaxRows: defaultRows !== undefined && defaultRows > defaultMaxRows
|
|
26
|
+
defaultMaxRows: defaultRows !== undefined && defaultRows > defaultMaxRows ? defaultRows : defaultMaxRows,
|
|
28
27
|
expanded,
|
|
29
28
|
expandedRows,
|
|
30
29
|
toggleExpanded,
|
|
31
30
|
isSearch,
|
|
32
31
|
isCompact,
|
|
33
|
-
|
|
34
|
-
defaultRows
|
|
35
|
-
} : {})
|
|
32
|
+
defaultRows
|
|
36
33
|
}), [expanded, toggleExpanded, isSearch, isCompact, defaultRows]);
|
|
37
34
|
};
|
|
38
35
|
export const useEditorThemeContext = () => useContext(EditorThemeContext);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
-
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
4
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { Popper } from '@atlaskit/popper';
|
|
6
5
|
import Spinner from '@atlaskit/spinner';
|
|
@@ -76,7 +75,6 @@ const AutocompleteDropdown = ({
|
|
|
76
75
|
const [areRichInlineNodesEnabled] = useRichInlineNodesEnabled();
|
|
77
76
|
const [autocompleteId] = useScopedId(JQL_EDITOR_AUTOCOMPLETE_ID);
|
|
78
77
|
const isPopperPositioningEnabled = fg('jql_editor_autocomplete_use_popper');
|
|
79
|
-
const isScrollUIFixEnabled = FeatureGates.getExperimentValue('anip-1289-scroll-issues-in-jql-autocomplete', 'isEnabled', false);
|
|
80
78
|
|
|
81
79
|
// Create virtual reference element positioned at cursor location (for popper implementation)
|
|
82
80
|
const virtualReferenceElement = useMemo(() => {
|
|
@@ -295,15 +293,15 @@ const AutocompleteDropdown = ({
|
|
|
295
293
|
}) => /*#__PURE__*/React.createElement(AutocompleteContainer, {
|
|
296
294
|
"data-testid": "jql-editor-autocomplete",
|
|
297
295
|
tabIndex: -1,
|
|
298
|
-
ref: ref
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
style: isScrollUIFixEnabled ? {
|
|
296
|
+
ref: ref,
|
|
297
|
+
style: {
|
|
298
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
302
299
|
...style,
|
|
303
300
|
// Popper's maxSize modifier can produce a maxWidth larger than our design cap on small
|
|
304
301
|
// viewports; clamp it here so the panel never overflows off-screen.
|
|
302
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- inline style needed to override Popper shouldFitViewport
|
|
305
303
|
maxWidth: 'min(400px, calc(100vw - 16px))'
|
|
306
|
-
}
|
|
304
|
+
},
|
|
307
305
|
isOpen: isAutocompleteOpen,
|
|
308
306
|
usePopper: true,
|
|
309
307
|
onBlur: onEditorViewBlur,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { useIntl } from 'react-intl';
|
|
4
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -44,7 +43,7 @@ const JQLEditorLayout = props => {
|
|
|
44
43
|
onScroll: onEditorViewContainerScroll
|
|
45
44
|
}, /*#__PURE__*/React.createElement(LineNumberToolbar, {
|
|
46
45
|
lineNumbersVisible: lineNumbersVisible
|
|
47
|
-
}), /*#__PURE__*/React.createElement(EditorView,
|
|
46
|
+
}), /*#__PURE__*/React.createElement(EditorView, {
|
|
48
47
|
defaultMaxRows: defaultMaxRows,
|
|
49
48
|
expandedRows: expandedRows,
|
|
50
49
|
isCompact: isCompact,
|
|
@@ -52,10 +51,9 @@ const JQLEditorLayout = props => {
|
|
|
52
51
|
ref: onEditorViewRef,
|
|
53
52
|
onBlur: onEditorViewBlur,
|
|
54
53
|
onFocus: onEditorViewFocus,
|
|
55
|
-
onTransitionEnd: onEditorViewTransitionEnd
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
} : {})), /*#__PURE__*/React.createElement(EditorControls, {
|
|
54
|
+
onTransitionEnd: onEditorViewTransitionEnd,
|
|
55
|
+
defaultRows: defaultRows
|
|
56
|
+
}), /*#__PURE__*/React.createElement(EditorControls, {
|
|
59
57
|
isSearch: isSearch,
|
|
60
58
|
isCompact: isCompact,
|
|
61
59
|
isVisualRefresh: fg('platform-component-visual-refresh')
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { css, keyframes } from '@emotion/react';
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import styled from '@emotion/styled';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { layers } from '@atlaskit/theme/constants';
|
|
9
8
|
import { TOOLTIP_CLASSNAME, TOOLTIP_ENTER_CLASSNAME, TOOLTIP_EXIT_CLASSNAME } from '../../plugins/validation-tooltip/constants';
|
|
10
9
|
const fadeIn = keyframes({
|
|
@@ -159,8 +158,8 @@ styled.div`
|
|
|
159
158
|
max-height 250ms cubic-bezier(0.15, 1, 0.3, 1);
|
|
160
159
|
max-height: ${props => rowHeight * props.defaultMaxRows + getEditorInputVerticalPadding(props.isCompact) * 2}px;
|
|
161
160
|
line-height: ${rowHeight / 14};
|
|
162
|
-
${props => props.defaultRows
|
|
163
|
-
${props => props.defaultRows
|
|
161
|
+
${props => props.defaultRows ? 'height: ' + (rowHeight * props.defaultRows + getEditorInputVerticalPadding(props.isCompact) * 2) + 'px;' : ''}
|
|
162
|
+
${props => props.defaultRows ? 'min-height: ' + (rowHeight * props.defaultRows + getEditorInputVerticalPadding(props.isCompact) * 2) + 'px;' : ''}
|
|
164
163
|
font-family: ${"var(--ds-font-family-code, \"Atlassian Mono\", ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)"};
|
|
165
164
|
word-break: break-word;
|
|
166
165
|
overflow-wrap: anywhere;
|
package/dist/esm/async.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
5
4
|
import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
5
|
import { withErrorBoundary } from './ui/error-boundary';
|
|
8
6
|
import { withIntlProvider } from './ui/intl-provider';
|
|
9
7
|
import { JQLEditorReadOnly } from './ui/jql-editor-layout';
|
|
@@ -25,12 +23,11 @@ export var preloadJQLEditor = function preloadJQLEditor() {
|
|
|
25
23
|
};
|
|
26
24
|
export var JQLEditorAsync = withIntlProvider(withErrorBoundary(function (props) {
|
|
27
25
|
return /*#__PURE__*/React.createElement(LazySuspense, {
|
|
28
|
-
fallback: /*#__PURE__*/React.createElement(JQLEditorReadOnly,
|
|
26
|
+
fallback: /*#__PURE__*/React.createElement(JQLEditorReadOnly, {
|
|
29
27
|
query: props.query,
|
|
30
28
|
isSearch: !!props.onSearch,
|
|
31
|
-
isCompact: props.isCompact
|
|
32
|
-
}, fg('list_lovability_improving_filters') ? {
|
|
29
|
+
isCompact: props.isCompact,
|
|
33
30
|
defaultRows: props.defaultRows
|
|
34
|
-
}
|
|
31
|
+
})
|
|
35
32
|
}, /*#__PURE__*/React.createElement(JQLEditor, props));
|
|
36
33
|
}));
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
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; }
|
|
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
2
|
import { createContext, useCallback, useContext, useMemo, useState } from 'react';
|
|
6
3
|
import noop from 'lodash/noop';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
4
|
var defaultMaxRows = 3;
|
|
9
5
|
var expandedRows = 15;
|
|
10
6
|
var defaultEditorTheme = {
|
|
@@ -36,16 +32,15 @@ export var useEditorTheme = function useEditorTheme(_ref) {
|
|
|
36
32
|
});
|
|
37
33
|
}, []);
|
|
38
34
|
return useMemo(function () {
|
|
39
|
-
return
|
|
40
|
-
defaultMaxRows: defaultRows !== undefined && defaultRows > defaultMaxRows
|
|
35
|
+
return {
|
|
36
|
+
defaultMaxRows: defaultRows !== undefined && defaultRows > defaultMaxRows ? defaultRows : defaultMaxRows,
|
|
41
37
|
expanded: expanded,
|
|
42
38
|
expandedRows: expandedRows,
|
|
43
39
|
toggleExpanded: toggleExpanded,
|
|
44
40
|
isSearch: isSearch,
|
|
45
|
-
isCompact: isCompact
|
|
46
|
-
}, fg('list_lovability_improving_filters') ? {
|
|
41
|
+
isCompact: isCompact,
|
|
47
42
|
defaultRows: defaultRows
|
|
48
|
-
}
|
|
43
|
+
};
|
|
49
44
|
}, [expanded, toggleExpanded, isSearch, isCompact, defaultRows]);
|
|
50
45
|
};
|
|
51
46
|
export var useEditorThemeContext = function useEditorThemeContext() {
|
|
@@ -4,7 +4,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
6
6
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7
|
-
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
8
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { Popper } from '@atlaskit/popper';
|
|
10
9
|
import Spinner from '@atlaskit/spinner';
|
|
@@ -98,7 +97,6 @@ var AutocompleteDropdown = function AutocompleteDropdown(_ref) {
|
|
|
98
97
|
_useScopedId2 = _slicedToArray(_useScopedId, 1),
|
|
99
98
|
autocompleteId = _useScopedId2[0];
|
|
100
99
|
var isPopperPositioningEnabled = fg('jql_editor_autocomplete_use_popper');
|
|
101
|
-
var isScrollUIFixEnabled = FeatureGates.getExperimentValue('anip-1289-scroll-issues-in-jql-autocomplete', 'isEnabled', false);
|
|
102
100
|
|
|
103
101
|
// Create virtual reference element positioned at cursor location (for popper implementation)
|
|
104
102
|
var virtualReferenceElement = useMemo(function () {
|
|
@@ -329,14 +327,13 @@ var AutocompleteDropdown = function AutocompleteDropdown(_ref) {
|
|
|
329
327
|
return /*#__PURE__*/React.createElement(AutocompleteContainer, {
|
|
330
328
|
"data-testid": "jql-editor-autocomplete",
|
|
331
329
|
tabIndex: -1,
|
|
332
|
-
ref: ref
|
|
333
|
-
|
|
334
|
-
,
|
|
335
|
-
style: isScrollUIFixEnabled ? _objectSpread(_objectSpread({}, style), {}, {
|
|
330
|
+
ref: ref,
|
|
331
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
336
332
|
// Popper's maxSize modifier can produce a maxWidth larger than our design cap on small
|
|
337
333
|
// viewports; clamp it here so the panel never overflows off-screen.
|
|
334
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- inline style needed to override Popper shouldFitViewport
|
|
338
335
|
maxWidth: 'min(400px, calc(100vw - 16px))'
|
|
339
|
-
})
|
|
336
|
+
}),
|
|
340
337
|
isOpen: isAutocompleteOpen,
|
|
341
338
|
usePopper: true,
|
|
342
339
|
onBlur: onEditorViewBlur,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
var _excluded = ["isSearch", "isCompact", "defaultRows"];
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import { useIntl } from 'react-intl';
|
|
@@ -43,7 +42,7 @@ var JQLEditorLayout = function JQLEditorLayout(props) {
|
|
|
43
42
|
onScroll: onEditorViewContainerScroll
|
|
44
43
|
}, /*#__PURE__*/React.createElement(LineNumberToolbar, {
|
|
45
44
|
lineNumbersVisible: lineNumbersVisible
|
|
46
|
-
}), /*#__PURE__*/React.createElement(EditorView,
|
|
45
|
+
}), /*#__PURE__*/React.createElement(EditorView, {
|
|
47
46
|
defaultMaxRows: defaultMaxRows,
|
|
48
47
|
expandedRows: expandedRows,
|
|
49
48
|
isCompact: isCompact,
|
|
@@ -51,10 +50,9 @@ var JQLEditorLayout = function JQLEditorLayout(props) {
|
|
|
51
50
|
ref: onEditorViewRef,
|
|
52
51
|
onBlur: onEditorViewBlur,
|
|
53
52
|
onFocus: onEditorViewFocus,
|
|
54
|
-
onTransitionEnd: onEditorViewTransitionEnd
|
|
55
|
-
}, fg('list_lovability_improving_filters') ? {
|
|
53
|
+
onTransitionEnd: onEditorViewTransitionEnd,
|
|
56
54
|
defaultRows: defaultRows
|
|
57
|
-
}
|
|
55
|
+
}), /*#__PURE__*/React.createElement(EditorControls, {
|
|
58
56
|
isSearch: isSearch,
|
|
59
57
|
isCompact: isCompact,
|
|
60
58
|
isVisualRefresh: fg('platform-component-visual-refresh')
|
|
@@ -6,7 +6,6 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
6
6
|
import { css, keyframes } from '@emotion/react';
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import styled from '@emotion/styled';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { layers } from '@atlaskit/theme/constants';
|
|
11
10
|
import { TOOLTIP_CLASSNAME, TOOLTIP_ENTER_CLASSNAME, TOOLTIP_EXIT_CLASSNAME } from '../../plugins/validation-tooltip/constants';
|
|
12
11
|
var fadeIn = keyframes({
|
|
@@ -125,9 +124,9 @@ export var EditorView = // eslint-disable-next-line @atlaskit/design-system/no-s
|
|
|
125
124
|
styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t\tcounter-reset: lineNumber;\n\t\tflex-grow: 1;\n\n\t\ttransition:\n\t\t\theight 250ms cubic-bezier(0.15, 1, 0.3, 1),\n\t\t\tmax-height 250ms cubic-bezier(0.15, 1, 0.3, 1);\n\t\tmax-height: ", "px;\n\t\tline-height: ", ";\n\t\t", "\n\t\t", "\n\tfont-family: ", ";\n\t\tword-break: break-word;\n\t\toverflow-wrap: anywhere;\n\t\twhite-space: pre-wrap;\n\n\t\t&[data-expanded] {\n\t\t\theight: ", "px;\n\t\t\tmax-height: ", "px;\n\t\t}\n\n\t\t.ProseMirror {\n\t\t\tcolor: ", ";\n\t\t\tpadding: ", "px\n\t\t\t\t", "px;\n\n\t\t\t&:focus {\n\t\t\t\toutline: none;\n\t\t\t}\n\n\t\t\t.mark-token-keyword {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\n\t\t\t.mark-token-field {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\n\t\t\t.mark-token-operator {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\n\t\t\t.mark-token-error {\n\t\t\t\tcolor: ", ";\n\t\t\t\ttext-decoration: wavy underline;\n\t\t\t\ttext-decoration-thickness: 1px;\n\t\t\t\ttext-decoration-skip-ink: none;\n\t\t\t}\n\t\t}\n\n\t\tp {\n\t\t\tmargin: 0;\n\t\t\tcounter-increment: lineNumber;\n\t\t\tposition: relative;\n\n\t\t\t/* Show the current line number before each paragraph block. */\n\n\t\t\t&::before {\n\t\t\t\tcontent: counter(lineNumber);\n\t\t\t\tcolor: ", ";\n\t\t\t\tfont-size: 10px;\n\t\t\t\tline-height: ", ";\n\t\t\t\tpadding: 0 ", " 0 ", ";\n\t\t\t\tposition: absolute;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\t/* Shift the line number tag 100% (plus 8px padding) to the left to position it inside the LineNumberToolbar */\n\t\t\t\ttransform: translateX(calc(-100% - ", "));\n\n\t\t\t\t/* We can fit 3 digits before ellipses. This is not very responsive but saves us having to add expensive width\n recalculation logic to the LineNumberToolbar for a scenario that *should* never happen. */\n\t\t\t\tmax-width: 30px;\n\t\t\t\ttext-overflow: ellipsis;\n\t\t\t\toverflow: hidden;\n\t\t\t\twhite-space: nowrap;\n\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t"])), function (props) {
|
|
126
125
|
return rowHeight * props.defaultMaxRows + getEditorInputVerticalPadding(props.isCompact) * 2;
|
|
127
126
|
}, rowHeight / 14, function (props) {
|
|
128
|
-
return props.defaultRows
|
|
127
|
+
return props.defaultRows ? 'height: ' + (rowHeight * props.defaultRows + getEditorInputVerticalPadding(props.isCompact) * 2) + 'px;' : '';
|
|
129
128
|
}, function (props) {
|
|
130
|
-
return props.defaultRows
|
|
129
|
+
return props.defaultRows ? 'min-height: ' + (rowHeight * props.defaultRows + getEditorInputVerticalPadding(props.isCompact) * 2) + 'px;' : '';
|
|
131
130
|
}, "var(--ds-font-family-code, \"Atlassian Mono\", ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)", function (props) {
|
|
132
131
|
return rowHeight * props.expandedRows + getEditorInputVerticalPadding(props.isCompact) * 2;
|
|
133
132
|
}, function (props) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/jql-editor",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.2",
|
|
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",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/button": "^23.11.0",
|
|
47
47
|
"@atlaskit/css": "^0.19.0",
|
|
48
48
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
49
|
-
"@atlaskit/emoji": "^70.
|
|
49
|
+
"@atlaskit/emoji": "^70.8.0",
|
|
50
50
|
"@atlaskit/feature-gate-js-client": "^5.5.0",
|
|
51
51
|
"@atlaskit/form": "^15.5.0",
|
|
52
52
|
"@atlaskit/icon": "^34.5.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@atlaskit/primitives": "^19.0.0",
|
|
62
62
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
63
63
|
"@atlaskit/spinner": "^19.1.0",
|
|
64
|
-
"@atlaskit/teams-avatar": "^2.
|
|
64
|
+
"@atlaskit/teams-avatar": "^2.7.0",
|
|
65
65
|
"@atlaskit/theme": "^23.2.0",
|
|
66
66
|
"@atlaskit/tokens": "^13.0.0",
|
|
67
67
|
"@atlaskit/tooltip": "^22.2.0",
|
|
@@ -151,9 +151,6 @@
|
|
|
151
151
|
"jira-membersof-team-support": {
|
|
152
152
|
"type": "boolean"
|
|
153
153
|
},
|
|
154
|
-
"list_lovability_improving_filters": {
|
|
155
|
-
"type": "boolean"
|
|
156
|
-
},
|
|
157
154
|
"jira_ai_agent_avatar_with_apptype_for_jql": {
|
|
158
155
|
"type": "boolean"
|
|
159
156
|
},
|