@atlaskit/editor-plugin-find-replace 1.3.0 → 1.3.1
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 +6 -0
- package/dist/cjs/ui/Find.js +32 -25
- package/dist/cjs/ui/FindReplace.js +42 -39
- package/dist/cjs/ui/FindReplaceToolbarButton.js +1 -0
- package/dist/cjs/ui/Replace.js +4 -2
- package/dist/cjs/ui/styles.js +1 -0
- package/dist/es2019/ui/Find.js +33 -24
- package/dist/es2019/ui/FindReplace.js +43 -38
- package/dist/es2019/ui/FindReplaceToolbarButton.js +2 -0
- package/dist/es2019/ui/Replace.js +5 -1
- package/dist/es2019/ui/styles.js +1 -0
- package/dist/esm/ui/Find.js +33 -24
- package/dist/esm/ui/FindReplace.js +43 -38
- package/dist/esm/ui/FindReplaceToolbarButton.js +2 -0
- package/dist/esm/ui/Replace.js +5 -1
- package/dist/esm/ui/styles.js +1 -0
- package/package.json +45 -21
package/CHANGELOG.md
CHANGED
package/dist/cjs/ui/Find.js
CHANGED
|
@@ -25,7 +25,7 @@ var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
|
|
|
25
25
|
var _FindReplaceTooltipButton = require("./FindReplaceTooltipButton");
|
|
26
26
|
var _styles = require("./styles");
|
|
27
27
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
28
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */ /** @jsx jsx */
|
|
28
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */ /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
29
29
|
var FIND_DEBOUNCE_MS = exports.FIND_DEBOUNCE_MS = 100;
|
|
30
30
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
31
31
|
var Find = /*#__PURE__*/function (_React$Component) {
|
|
@@ -202,11 +202,15 @@ var Find = /*#__PURE__*/function (_React$Component) {
|
|
|
202
202
|
selectedMatchPosition: count.index + 1,
|
|
203
203
|
totalResultsCount: count.total
|
|
204
204
|
});
|
|
205
|
-
var elemAfterInput =
|
|
205
|
+
var elemAfterInput =
|
|
206
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
207
|
+
(0, _react2.jsx)("div", {
|
|
206
208
|
css: _styles.afterInputSection
|
|
207
209
|
}, (0, _react2.jsx)("div", {
|
|
208
210
|
"aria-live": "polite"
|
|
209
|
-
}, findText &&
|
|
211
|
+
}, findText &&
|
|
212
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
213
|
+
(0, _react2.jsx)("span", {
|
|
210
214
|
"data-testid": "textfield-count",
|
|
211
215
|
css: [_styles.countStyles, _styles.countStylesAlternateStyles]
|
|
212
216
|
}, count.total === 0 ? this.noResultsFound : resultsCount)), (0, _react2.jsx)("div", {
|
|
@@ -220,28 +224,31 @@ var Find = /*#__PURE__*/function (_React$Component) {
|
|
|
220
224
|
onClick: this.handleMatchCaseClick,
|
|
221
225
|
isPressed: shouldMatchCase
|
|
222
226
|
})));
|
|
223
|
-
return (
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
227
|
+
return (
|
|
228
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
229
|
+
(0, _react2.jsx)("div", {
|
|
230
|
+
css: [_styles.sectionWrapperStyles, _styles.sectionWrapperStylesAlternate]
|
|
231
|
+
}, (0, _react2.jsx)("div", {
|
|
232
|
+
css: _styles.textFieldWrapper
|
|
233
|
+
}, (0, _react2.jsx)(_form.Label, {
|
|
234
|
+
htmlFor: "find-text-field"
|
|
235
|
+
}, this.find), (0, _react2.jsx)(_textfield.default, {
|
|
236
|
+
name: "find",
|
|
237
|
+
id: "find-text-field",
|
|
238
|
+
testId: "find-field",
|
|
239
|
+
appearance: "standard",
|
|
240
|
+
value: this.state.localFindText,
|
|
241
|
+
ref: this.findTextfieldRef,
|
|
242
|
+
autoComplete: "off",
|
|
243
|
+
onChange: this.handleFindChange,
|
|
244
|
+
onKeyDown: this.handleFindKeyDown,
|
|
245
|
+
onKeyUp: this.handleFindKeyUp,
|
|
246
|
+
onBlur: this.props.onFindBlur,
|
|
247
|
+
onCompositionStart: this.handleCompositionStart,
|
|
248
|
+
onCompositionEnd: this.handleCompositionEnd,
|
|
249
|
+
elemAfterInput: elemAfterInput
|
|
250
|
+
})))
|
|
251
|
+
);
|
|
245
252
|
}
|
|
246
253
|
}]);
|
|
247
254
|
return Find;
|
|
@@ -18,7 +18,7 @@ var _Find = _interopRequireDefault(require("./Find"));
|
|
|
18
18
|
var _Replace = _interopRequireDefault(require("./Replace"));
|
|
19
19
|
var _styles = require("./styles");
|
|
20
20
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
21
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */ /* eslint-disable @atlaskit/design-system/prefer-primitives */ /** @jsx jsx */
|
|
21
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */ /* eslint-disable @atlaskit/design-system/prefer-primitives */ /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
22
22
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
23
23
|
var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
|
|
24
24
|
(0, _inherits2.default)(FindReplace, _React$PureComponent);
|
|
@@ -111,44 +111,47 @@ var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
111
111
|
shouldMatchCase = _this$props.shouldMatchCase,
|
|
112
112
|
onToggleMatchCase = _this$props.onToggleMatchCase;
|
|
113
113
|
var focusToolbarButton = this.props.focusToolbarButton || function () {};
|
|
114
|
-
return (
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
114
|
+
return (
|
|
115
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
116
|
+
(0, _react2.jsx)("div", {
|
|
117
|
+
ref: this.modalRef,
|
|
118
|
+
css: [_styles.wrapperStyles, _styles.wrapperPaddingStyles]
|
|
119
|
+
}, (0, _react2.jsx)(_Find.default, {
|
|
120
|
+
allowMatchCase: allowMatchCase,
|
|
121
|
+
shouldMatchCase: shouldMatchCase,
|
|
122
|
+
onToggleMatchCase: onToggleMatchCase,
|
|
123
|
+
findText: findText,
|
|
124
|
+
count: count,
|
|
125
|
+
shouldFocus: shouldFocus,
|
|
126
|
+
onFind: onFind,
|
|
127
|
+
onFindBlur: onFindBlur,
|
|
128
|
+
onFindPrev: onFindPrev,
|
|
129
|
+
onFindNext: onFindNext,
|
|
130
|
+
onFindTextfieldRefSet: this.setFindTextfieldRef,
|
|
131
|
+
onCancel: onCancel,
|
|
132
|
+
onArrowDown: this.setFocusToReplace,
|
|
133
|
+
findTyped: this.state.findTyped,
|
|
134
|
+
setFindTyped: this.setFindTyped
|
|
135
|
+
}), (0, _react2.jsx)("hr", {
|
|
136
|
+
css: _styles.ruleStyles,
|
|
137
|
+
id: "replace-hr-element"
|
|
138
|
+
}), (0, _react2.jsx)(_Replace.default, {
|
|
139
|
+
canReplace: count.total > 0,
|
|
140
|
+
replaceText: replaceText,
|
|
141
|
+
onReplace: onReplace,
|
|
142
|
+
onReplaceAll: onReplaceAll,
|
|
143
|
+
onReplaceTextfieldRefSet: this.setReplaceTextfieldRef,
|
|
144
|
+
onArrowUp: this.setFocusToFind,
|
|
145
|
+
onCancel: onCancel,
|
|
146
|
+
count: count,
|
|
147
|
+
onFindPrev: onFindPrev,
|
|
148
|
+
onFindNext: onFindNext,
|
|
149
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
150
|
+
findTyped: this.state.findTyped,
|
|
151
|
+
setFindTyped: this.setFindTyped,
|
|
152
|
+
focusToolbarButton: focusToolbarButton
|
|
153
|
+
}))
|
|
154
|
+
);
|
|
152
155
|
}
|
|
153
156
|
}]);
|
|
154
157
|
return FindReplace;
|
|
@@ -27,6 +27,7 @@ var _FindReplace = _interopRequireDefault(require("./FindReplace"));
|
|
|
27
27
|
var _templateObject;
|
|
28
28
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
29
29
|
/** @jsx jsx */
|
|
30
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
30
31
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
31
32
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
32
33
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
package/dist/cjs/ui/Replace.js
CHANGED
|
@@ -29,7 +29,7 @@ var _styles = require("./styles");
|
|
|
29
29
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
30
30
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
31
31
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
32
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */ /** @jsx jsx */
|
|
32
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */ /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
33
33
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
34
34
|
var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
35
35
|
(0, _inherits2.default)(Replace, _React$PureComponent);
|
|
@@ -261,7 +261,9 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
261
261
|
onClick: this.handleFindPrevClick,
|
|
262
262
|
disabled: count.total <= 1
|
|
263
263
|
})), (0, _react2.jsx)(_primitives.Inline, {
|
|
264
|
-
space: "space.075"
|
|
264
|
+
space: "space.075"
|
|
265
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
266
|
+
,
|
|
265
267
|
xcss: (0, _primitives.xcss)({
|
|
266
268
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
267
269
|
paddingInlineStart: 'space.050',
|
package/dist/cjs/ui/styles.js
CHANGED
|
@@ -11,6 +11,7 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
11
11
|
/* eslint-disable @atlaskit/design-system/no-nested-styles */
|
|
12
12
|
/* eslint-disable @repo/internal/styles/no-exported-styles */
|
|
13
13
|
/** @jsx jsx */
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
14
15
|
|
|
15
16
|
var fontSize = (0, _constants.fontSize)();
|
|
16
17
|
var gridSize = (0, _constants.gridSize)();
|
package/dist/es2019/ui/Find.js
CHANGED
|
@@ -2,6 +2,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import React from 'react';
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
7
|
import { jsx } from '@emotion/react';
|
|
6
8
|
import debounce from 'lodash/debounce';
|
|
7
9
|
import rafSchd from 'raf-schd';
|
|
@@ -181,11 +183,15 @@ class Find extends React.Component {
|
|
|
181
183
|
selectedMatchPosition: count.index + 1,
|
|
182
184
|
totalResultsCount: count.total
|
|
183
185
|
});
|
|
184
|
-
const elemAfterInput =
|
|
186
|
+
const elemAfterInput =
|
|
187
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
188
|
+
jsx("div", {
|
|
185
189
|
css: afterInputSection
|
|
186
190
|
}, jsx("div", {
|
|
187
191
|
"aria-live": "polite"
|
|
188
|
-
}, findText &&
|
|
192
|
+
}, findText &&
|
|
193
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
194
|
+
jsx("span", {
|
|
189
195
|
"data-testid": "textfield-count",
|
|
190
196
|
css: [countStyles, countStylesAlternateStyles]
|
|
191
197
|
}, count.total === 0 ? this.noResultsFound : resultsCount)), jsx("div", {
|
|
@@ -199,28 +205,31 @@ class Find extends React.Component {
|
|
|
199
205
|
onClick: this.handleMatchCaseClick,
|
|
200
206
|
isPressed: shouldMatchCase
|
|
201
207
|
})));
|
|
202
|
-
return
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
208
|
+
return (
|
|
209
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
210
|
+
jsx("div", {
|
|
211
|
+
css: [sectionWrapperStyles, sectionWrapperStylesAlternate]
|
|
212
|
+
}, jsx("div", {
|
|
213
|
+
css: textFieldWrapper
|
|
214
|
+
}, jsx(Label, {
|
|
215
|
+
htmlFor: "find-text-field"
|
|
216
|
+
}, this.find), jsx(Textfield, {
|
|
217
|
+
name: "find",
|
|
218
|
+
id: "find-text-field",
|
|
219
|
+
testId: "find-field",
|
|
220
|
+
appearance: "standard",
|
|
221
|
+
value: this.state.localFindText,
|
|
222
|
+
ref: this.findTextfieldRef,
|
|
223
|
+
autoComplete: "off",
|
|
224
|
+
onChange: this.handleFindChange,
|
|
225
|
+
onKeyDown: this.handleFindKeyDown,
|
|
226
|
+
onKeyUp: this.handleFindKeyUp,
|
|
227
|
+
onBlur: this.props.onFindBlur,
|
|
228
|
+
onCompositionStart: this.handleCompositionStart,
|
|
229
|
+
onCompositionEnd: this.handleCompositionEnd,
|
|
230
|
+
elemAfterInput: elemAfterInput
|
|
231
|
+
})))
|
|
232
|
+
);
|
|
224
233
|
}
|
|
225
234
|
}
|
|
226
235
|
export default injectIntl(Find);
|
|
@@ -3,6 +3,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
/* eslint-disable @atlaskit/design-system/prefer-primitives */
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import React from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
8
|
import { jsx } from '@emotion/react';
|
|
7
9
|
import Find from './Find';
|
|
8
10
|
import Replace from './Replace';
|
|
@@ -85,44 +87,47 @@ class FindReplace extends React.PureComponent {
|
|
|
85
87
|
onToggleMatchCase
|
|
86
88
|
} = this.props;
|
|
87
89
|
const focusToolbarButton = this.props.focusToolbarButton || (() => {});
|
|
88
|
-
return
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
90
|
+
return (
|
|
91
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
92
|
+
jsx("div", {
|
|
93
|
+
ref: this.modalRef,
|
|
94
|
+
css: [wrapperStyles, wrapperPaddingStyles]
|
|
95
|
+
}, jsx(Find, {
|
|
96
|
+
allowMatchCase: allowMatchCase,
|
|
97
|
+
shouldMatchCase: shouldMatchCase,
|
|
98
|
+
onToggleMatchCase: onToggleMatchCase,
|
|
99
|
+
findText: findText,
|
|
100
|
+
count: count,
|
|
101
|
+
shouldFocus: shouldFocus,
|
|
102
|
+
onFind: onFind,
|
|
103
|
+
onFindBlur: onFindBlur,
|
|
104
|
+
onFindPrev: onFindPrev,
|
|
105
|
+
onFindNext: onFindNext,
|
|
106
|
+
onFindTextfieldRefSet: this.setFindTextfieldRef,
|
|
107
|
+
onCancel: onCancel,
|
|
108
|
+
onArrowDown: this.setFocusToReplace,
|
|
109
|
+
findTyped: this.state.findTyped,
|
|
110
|
+
setFindTyped: this.setFindTyped
|
|
111
|
+
}), jsx("hr", {
|
|
112
|
+
css: ruleStyles,
|
|
113
|
+
id: "replace-hr-element"
|
|
114
|
+
}), jsx(Replace, {
|
|
115
|
+
canReplace: count.total > 0,
|
|
116
|
+
replaceText: replaceText,
|
|
117
|
+
onReplace: onReplace,
|
|
118
|
+
onReplaceAll: onReplaceAll,
|
|
119
|
+
onReplaceTextfieldRefSet: this.setReplaceTextfieldRef,
|
|
120
|
+
onArrowUp: this.setFocusToFind,
|
|
121
|
+
onCancel: onCancel,
|
|
122
|
+
count: count,
|
|
123
|
+
onFindPrev: onFindPrev,
|
|
124
|
+
onFindNext: onFindNext,
|
|
125
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
126
|
+
findTyped: this.state.findTyped,
|
|
127
|
+
setFindTyped: this.setFindTyped,
|
|
128
|
+
focusToolbarButton: focusToolbarButton
|
|
129
|
+
}))
|
|
130
|
+
);
|
|
126
131
|
}
|
|
127
132
|
}
|
|
128
133
|
export default FindReplace;
|
|
@@ -3,6 +3,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import React from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
8
|
import { css, jsx } from '@emotion/react';
|
|
7
9
|
import { injectIntl } from 'react-intl-next';
|
|
8
10
|
import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
@@ -2,6 +2,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import React, { Fragment } from 'react';
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
7
|
import { jsx } from '@emotion/react';
|
|
6
8
|
import { injectIntl } from 'react-intl-next';
|
|
7
9
|
import Button from '@atlaskit/button/new';
|
|
@@ -237,7 +239,9 @@ class Replace extends React.PureComponent {
|
|
|
237
239
|
onClick: this.handleFindPrevClick,
|
|
238
240
|
disabled: count.total <= 1
|
|
239
241
|
})), jsx(Inline, {
|
|
240
|
-
space: "space.075"
|
|
242
|
+
space: "space.075"
|
|
243
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
244
|
+
,
|
|
241
245
|
xcss: xcss({
|
|
242
246
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
243
247
|
paddingInlineStart: 'space.050',
|
package/dist/es2019/ui/styles.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/design-system/no-nested-styles */
|
|
2
2
|
/* eslint-disable @repo/internal/styles/no-exported-styles */
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
5
|
import { css } from '@emotion/react';
|
|
5
6
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
6
7
|
import { N30A } from '@atlaskit/theme/colors';
|
package/dist/esm/ui/Find.js
CHANGED
|
@@ -10,6 +10,8 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
10
10
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
11
11
|
/** @jsx jsx */
|
|
12
12
|
import React from 'react';
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
15
|
import { jsx } from '@emotion/react';
|
|
14
16
|
import debounce from 'lodash/debounce';
|
|
15
17
|
import rafSchd from 'raf-schd';
|
|
@@ -197,11 +199,15 @@ var Find = /*#__PURE__*/function (_React$Component) {
|
|
|
197
199
|
selectedMatchPosition: count.index + 1,
|
|
198
200
|
totalResultsCount: count.total
|
|
199
201
|
});
|
|
200
|
-
var elemAfterInput =
|
|
202
|
+
var elemAfterInput =
|
|
203
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
204
|
+
jsx("div", {
|
|
201
205
|
css: afterInputSection
|
|
202
206
|
}, jsx("div", {
|
|
203
207
|
"aria-live": "polite"
|
|
204
|
-
}, findText &&
|
|
208
|
+
}, findText &&
|
|
209
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
210
|
+
jsx("span", {
|
|
205
211
|
"data-testid": "textfield-count",
|
|
206
212
|
css: [countStyles, countStylesAlternateStyles]
|
|
207
213
|
}, count.total === 0 ? this.noResultsFound : resultsCount)), jsx("div", {
|
|
@@ -215,28 +221,31 @@ var Find = /*#__PURE__*/function (_React$Component) {
|
|
|
215
221
|
onClick: this.handleMatchCaseClick,
|
|
216
222
|
isPressed: shouldMatchCase
|
|
217
223
|
})));
|
|
218
|
-
return
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
224
|
+
return (
|
|
225
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
226
|
+
jsx("div", {
|
|
227
|
+
css: [sectionWrapperStyles, sectionWrapperStylesAlternate]
|
|
228
|
+
}, jsx("div", {
|
|
229
|
+
css: textFieldWrapper
|
|
230
|
+
}, jsx(Label, {
|
|
231
|
+
htmlFor: "find-text-field"
|
|
232
|
+
}, this.find), jsx(Textfield, {
|
|
233
|
+
name: "find",
|
|
234
|
+
id: "find-text-field",
|
|
235
|
+
testId: "find-field",
|
|
236
|
+
appearance: "standard",
|
|
237
|
+
value: this.state.localFindText,
|
|
238
|
+
ref: this.findTextfieldRef,
|
|
239
|
+
autoComplete: "off",
|
|
240
|
+
onChange: this.handleFindChange,
|
|
241
|
+
onKeyDown: this.handleFindKeyDown,
|
|
242
|
+
onKeyUp: this.handleFindKeyUp,
|
|
243
|
+
onBlur: this.props.onFindBlur,
|
|
244
|
+
onCompositionStart: this.handleCompositionStart,
|
|
245
|
+
onCompositionEnd: this.handleCompositionEnd,
|
|
246
|
+
elemAfterInput: elemAfterInput
|
|
247
|
+
})))
|
|
248
|
+
);
|
|
240
249
|
}
|
|
241
250
|
}]);
|
|
242
251
|
return Find;
|
|
@@ -11,6 +11,8 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
11
11
|
/* eslint-disable @atlaskit/design-system/prefer-primitives */
|
|
12
12
|
/** @jsx jsx */
|
|
13
13
|
import React from 'react';
|
|
14
|
+
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
14
16
|
import { jsx } from '@emotion/react';
|
|
15
17
|
import Find from './Find';
|
|
16
18
|
import Replace from './Replace';
|
|
@@ -107,44 +109,47 @@ var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
107
109
|
shouldMatchCase = _this$props.shouldMatchCase,
|
|
108
110
|
onToggleMatchCase = _this$props.onToggleMatchCase;
|
|
109
111
|
var focusToolbarButton = this.props.focusToolbarButton || function () {};
|
|
110
|
-
return
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
112
|
+
return (
|
|
113
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
114
|
+
jsx("div", {
|
|
115
|
+
ref: this.modalRef,
|
|
116
|
+
css: [wrapperStyles, wrapperPaddingStyles]
|
|
117
|
+
}, jsx(Find, {
|
|
118
|
+
allowMatchCase: allowMatchCase,
|
|
119
|
+
shouldMatchCase: shouldMatchCase,
|
|
120
|
+
onToggleMatchCase: onToggleMatchCase,
|
|
121
|
+
findText: findText,
|
|
122
|
+
count: count,
|
|
123
|
+
shouldFocus: shouldFocus,
|
|
124
|
+
onFind: onFind,
|
|
125
|
+
onFindBlur: onFindBlur,
|
|
126
|
+
onFindPrev: onFindPrev,
|
|
127
|
+
onFindNext: onFindNext,
|
|
128
|
+
onFindTextfieldRefSet: this.setFindTextfieldRef,
|
|
129
|
+
onCancel: onCancel,
|
|
130
|
+
onArrowDown: this.setFocusToReplace,
|
|
131
|
+
findTyped: this.state.findTyped,
|
|
132
|
+
setFindTyped: this.setFindTyped
|
|
133
|
+
}), jsx("hr", {
|
|
134
|
+
css: ruleStyles,
|
|
135
|
+
id: "replace-hr-element"
|
|
136
|
+
}), jsx(Replace, {
|
|
137
|
+
canReplace: count.total > 0,
|
|
138
|
+
replaceText: replaceText,
|
|
139
|
+
onReplace: onReplace,
|
|
140
|
+
onReplaceAll: onReplaceAll,
|
|
141
|
+
onReplaceTextfieldRefSet: this.setReplaceTextfieldRef,
|
|
142
|
+
onArrowUp: this.setFocusToFind,
|
|
143
|
+
onCancel: onCancel,
|
|
144
|
+
count: count,
|
|
145
|
+
onFindPrev: onFindPrev,
|
|
146
|
+
onFindNext: onFindNext,
|
|
147
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
148
|
+
findTyped: this.state.findTyped,
|
|
149
|
+
setFindTyped: this.setFindTyped,
|
|
150
|
+
focusToolbarButton: focusToolbarButton
|
|
151
|
+
}))
|
|
152
|
+
);
|
|
148
153
|
}
|
|
149
154
|
}]);
|
|
150
155
|
return FindReplace;
|
|
@@ -13,6 +13,8 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
13
13
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
14
14
|
/** @jsx jsx */
|
|
15
15
|
import React from 'react';
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
16
18
|
import { css, jsx } from '@emotion/react';
|
|
17
19
|
import { injectIntl } from 'react-intl-next';
|
|
18
20
|
import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
package/dist/esm/ui/Replace.js
CHANGED
|
@@ -10,6 +10,8 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
10
10
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
11
11
|
/** @jsx jsx */
|
|
12
12
|
import React, { Fragment } from 'react';
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
15
|
import { jsx } from '@emotion/react';
|
|
14
16
|
import { injectIntl } from 'react-intl-next';
|
|
15
17
|
import Button from '@atlaskit/button/new';
|
|
@@ -253,7 +255,9 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
253
255
|
onClick: this.handleFindPrevClick,
|
|
254
256
|
disabled: count.total <= 1
|
|
255
257
|
})), jsx(Inline, {
|
|
256
|
-
space: "space.075"
|
|
258
|
+
space: "space.075"
|
|
259
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
260
|
+
,
|
|
257
261
|
xcss: xcss({
|
|
258
262
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
259
263
|
paddingInlineStart: 'space.050',
|
package/dist/esm/ui/styles.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/design-system/no-nested-styles */
|
|
2
2
|
/* eslint-disable @repo/internal/styles/no-exported-styles */
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
5
|
import { css } from '@emotion/react';
|
|
5
6
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
6
7
|
import { N30A } from '@atlaskit/theme/colors';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-find-replace",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "find replace plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -19,28 +19,33 @@
|
|
|
19
19
|
"types": "dist/types/index.d.ts",
|
|
20
20
|
"typesVersions": {
|
|
21
21
|
">=4.5 <4.9": {
|
|
22
|
-
"*": [
|
|
22
|
+
"*": [
|
|
23
|
+
"dist/types-ts4.5/*",
|
|
24
|
+
"dist/types-ts4.5/index.d.ts"
|
|
25
|
+
]
|
|
23
26
|
}
|
|
24
27
|
},
|
|
25
|
-
"sideEffects": [
|
|
28
|
+
"sideEffects": [
|
|
29
|
+
"*.compiled.css"
|
|
30
|
+
],
|
|
26
31
|
"atlaskit:src": "src/index.ts",
|
|
27
32
|
"af:exports": {
|
|
28
33
|
".": "./src/index.ts",
|
|
29
34
|
"./styles": "./src/styles.ts"
|
|
30
35
|
},
|
|
31
36
|
"dependencies": {
|
|
32
|
-
"@atlaskit/button": "^17.
|
|
33
|
-
"@atlaskit/editor-common": "^82.
|
|
37
|
+
"@atlaskit/button": "^17.22.0",
|
|
38
|
+
"@atlaskit/editor-common": "^82.9.0",
|
|
34
39
|
"@atlaskit/editor-plugin-analytics": "^1.2.0",
|
|
35
40
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
36
41
|
"@atlaskit/editor-shared-styles": "^2.12.0",
|
|
37
|
-
"@atlaskit/form": "^10.
|
|
38
|
-
"@atlaskit/icon": "^22.
|
|
39
|
-
"@atlaskit/primitives": "^
|
|
40
|
-
"@atlaskit/textfield": "^6.
|
|
41
|
-
"@atlaskit/theme": "^12.
|
|
42
|
-
"@atlaskit/tokens": "^1.
|
|
43
|
-
"@atlaskit/tooltip": "^18.
|
|
42
|
+
"@atlaskit/form": "^10.4.0",
|
|
43
|
+
"@atlaskit/icon": "^22.4.0",
|
|
44
|
+
"@atlaskit/primitives": "^8.0.0",
|
|
45
|
+
"@atlaskit/textfield": "^6.4.0",
|
|
46
|
+
"@atlaskit/theme": "^12.10.0",
|
|
47
|
+
"@atlaskit/tokens": "^1.51.0",
|
|
48
|
+
"@atlaskit/tooltip": "^18.5.0",
|
|
44
49
|
"@babel/runtime": "^7.0.0",
|
|
45
50
|
"@emotion/react": "^11.7.1",
|
|
46
51
|
"lodash": "^4.17.21",
|
|
@@ -62,23 +67,42 @@
|
|
|
62
67
|
},
|
|
63
68
|
"techstack": {
|
|
64
69
|
"@atlassian/frontend": {
|
|
65
|
-
"import-structure": [
|
|
66
|
-
|
|
70
|
+
"import-structure": [
|
|
71
|
+
"atlassian-conventions"
|
|
72
|
+
],
|
|
73
|
+
"circular-dependencies": [
|
|
74
|
+
"file-and-folder-level"
|
|
75
|
+
]
|
|
67
76
|
},
|
|
68
77
|
"@repo/internal": {
|
|
69
78
|
"dom-events": "use-bind-event-listener",
|
|
70
|
-
"analytics": [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"
|
|
79
|
+
"analytics": [
|
|
80
|
+
"analytics-next"
|
|
81
|
+
],
|
|
82
|
+
"design-tokens": [
|
|
83
|
+
"color"
|
|
84
|
+
],
|
|
85
|
+
"theming": [
|
|
86
|
+
"react-context"
|
|
87
|
+
],
|
|
88
|
+
"ui-components": [
|
|
89
|
+
"lite-mode"
|
|
90
|
+
],
|
|
74
91
|
"deprecation": "no-deprecated-imports",
|
|
75
|
-
"styling": [
|
|
76
|
-
|
|
92
|
+
"styling": [
|
|
93
|
+
"emotion",
|
|
94
|
+
"emotion"
|
|
95
|
+
],
|
|
96
|
+
"imports": [
|
|
97
|
+
"import-no-extraneous-disable-for-examples-and-docs"
|
|
98
|
+
]
|
|
77
99
|
}
|
|
78
100
|
},
|
|
79
101
|
"stricter": {
|
|
80
102
|
"no-unused-dependencies": {
|
|
81
|
-
"exclude": [
|
|
103
|
+
"exclude": [
|
|
104
|
+
"@atlaskit/editor-plugin-analytics"
|
|
105
|
+
]
|
|
82
106
|
}
|
|
83
107
|
}
|
|
84
108
|
}
|