@atlaskit/editor-plugin-find-replace 1.7.13 → 1.7.15
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 +15 -0
- package/dist/cjs/{plugin.js → findReplacePlugin.js} +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/{commands.js → pm-plugins/commands.js} +1 -1
- package/dist/cjs/pm-plugins/keymap.js +1 -1
- package/dist/cjs/pm-plugins/plugin-factory.js +6 -4
- package/dist/cjs/{utils → pm-plugins/utils}/batch-decorations.js +1 -1
- package/dist/cjs/{utils → pm-plugins/utils}/index.js +1 -1
- package/dist/cjs/types/index.js +5 -0
- package/dist/cjs/ui/Find.js +6 -6
- package/dist/cjs/ui/FindReplace.js +3 -3
- package/dist/cjs/{FindReplaceToolbarButtonWithState.js → ui/FindReplaceToolbarButtonWithState.js} +3 -3
- package/dist/cjs/ui/Replace.js +8 -8
- package/dist/cjs/ui/styles.js +17 -145
- package/dist/cjs/ui/ui-styles.js +152 -0
- package/dist/es2019/{plugin.js → findReplacePlugin.js} +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/{commands.js → pm-plugins/commands.js} +1 -1
- package/dist/es2019/pm-plugins/keymap.js +1 -1
- package/dist/es2019/pm-plugins/plugin-factory.js +4 -4
- package/dist/es2019/{utils → pm-plugins/utils}/batch-decorations.js +1 -1
- package/dist/es2019/{utils → pm-plugins/utils}/index.js +1 -1
- package/dist/es2019/ui/Find.js +1 -1
- package/dist/es2019/ui/FindReplace.js +1 -1
- package/dist/es2019/{FindReplaceToolbarButtonWithState.js → ui/FindReplaceToolbarButtonWithState.js} +3 -3
- package/dist/es2019/ui/Replace.js +1 -1
- package/dist/es2019/ui/styles.js +15 -143
- package/dist/es2019/ui/ui-styles.js +147 -0
- package/dist/esm/{plugin.js → findReplacePlugin.js} +1 -1
- package/dist/esm/findReplacePluginType.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/{commands.js → pm-plugins/commands.js} +1 -1
- package/dist/esm/pm-plugins/keymap.js +1 -1
- package/dist/esm/pm-plugins/plugin-factory.js +4 -4
- package/dist/esm/{utils → pm-plugins/utils}/batch-decorations.js +1 -1
- package/dist/esm/{utils → pm-plugins/utils}/index.js +1 -1
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/ui/Find.js +1 -1
- package/dist/esm/ui/FindReplace.js +1 -1
- package/dist/esm/{FindReplaceToolbarButtonWithState.js → ui/FindReplaceToolbarButtonWithState.js} +3 -3
- package/dist/esm/ui/Replace.js +1 -1
- package/dist/esm/ui/styles.js +17 -146
- package/dist/esm/ui/ui-styles.js +147 -0
- package/dist/types/findReplacePlugin.d.ts +2 -0
- package/dist/types/findReplacePluginType.d.ts +18 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/{actions.d.ts → pm-plugins/actions.d.ts} +1 -1
- package/dist/types/pm-plugins/plugin-factory.d.ts +1 -1
- package/dist/types/{reducer.d.ts → pm-plugins/reducer.d.ts} +1 -1
- package/dist/types/{utils → pm-plugins/utils}/index.d.ts +1 -1
- package/dist/{types-ts4.5/types.d.ts → types/types/index.d.ts} +2 -20
- package/dist/types/{FindReplaceToolbarButtonWithState.d.ts → ui/FindReplaceToolbarButtonWithState.d.ts} +1 -1
- package/dist/types/ui/styles.d.ts +3 -15
- package/dist/types/ui/ui-styles.d.ts +15 -0
- package/dist/types-ts4.5/findReplacePlugin.d.ts +2 -0
- package/dist/types-ts4.5/findReplacePluginType.d.ts +21 -0
- package/dist/types-ts4.5/index.d.ts +3 -2
- package/dist/types-ts4.5/{actions.d.ts → pm-plugins/actions.d.ts} +1 -1
- package/dist/types-ts4.5/pm-plugins/plugin-factory.d.ts +1 -1
- package/dist/types-ts4.5/{reducer.d.ts → pm-plugins/reducer.d.ts} +1 -1
- package/dist/types-ts4.5/{utils → pm-plugins/utils}/index.d.ts +1 -1
- package/dist/{types/types.d.ts → types-ts4.5/types/index.d.ts} +2 -17
- package/dist/types-ts4.5/{FindReplaceToolbarButtonWithState.d.ts → ui/FindReplaceToolbarButtonWithState.d.ts} +1 -1
- package/dist/types-ts4.5/ui/styles.d.ts +3 -15
- package/dist/types-ts4.5/ui/ui-styles.d.ts +15 -0
- package/package.json +14 -11
- package/styles/package.json +5 -5
- package/dist/cjs/styles.js +0 -24
- package/dist/es2019/styles.js +0 -19
- package/dist/esm/styles.js +0 -18
- package/dist/types/plugin.d.ts +0 -2
- package/dist/types/styles.d.ts +0 -3
- package/dist/types-ts4.5/plugin.d.ts +0 -2
- package/dist/types-ts4.5/styles.d.ts +0 -3
- /package/dist/cjs/{types.js → findReplacePluginType.js} +0 -0
- /package/dist/cjs/{actions.js → pm-plugins/actions.js} +0 -0
- /package/dist/cjs/{commands-with-analytics.js → pm-plugins/commands-with-analytics.js} +0 -0
- /package/dist/cjs/{reducer.js → pm-plugins/reducer.js} +0 -0
- /package/dist/cjs/{utils → pm-plugins/utils}/array.js +0 -0
- /package/dist/cjs/{utils → pm-plugins/utils}/commands.js +0 -0
- /package/dist/es2019/{types.js → findReplacePluginType.js} +0 -0
- /package/dist/es2019/{actions.js → pm-plugins/actions.js} +0 -0
- /package/dist/es2019/{commands-with-analytics.js → pm-plugins/commands-with-analytics.js} +0 -0
- /package/dist/es2019/{reducer.js → pm-plugins/reducer.js} +0 -0
- /package/dist/es2019/{utils → pm-plugins/utils}/array.js +0 -0
- /package/dist/es2019/{utils → pm-plugins/utils}/commands.js +0 -0
- /package/dist/{esm/types.js → es2019/types/index.js} +0 -0
- /package/dist/esm/{actions.js → pm-plugins/actions.js} +0 -0
- /package/dist/esm/{commands-with-analytics.js → pm-plugins/commands-with-analytics.js} +0 -0
- /package/dist/esm/{reducer.js → pm-plugins/reducer.js} +0 -0
- /package/dist/esm/{utils → pm-plugins/utils}/array.js +0 -0
- /package/dist/esm/{utils → pm-plugins/utils}/commands.js +0 -0
- /package/dist/types/{commands-with-analytics.d.ts → pm-plugins/commands-with-analytics.d.ts} +0 -0
- /package/dist/types/{commands.d.ts → pm-plugins/commands.d.ts} +0 -0
- /package/dist/types/{utils → pm-plugins/utils}/array.d.ts +0 -0
- /package/dist/types/{utils → pm-plugins/utils}/batch-decorations.d.ts +0 -0
- /package/dist/types/{utils → pm-plugins/utils}/commands.d.ts +0 -0
- /package/dist/types-ts4.5/{commands-with-analytics.d.ts → pm-plugins/commands-with-analytics.d.ts} +0 -0
- /package/dist/types-ts4.5/{commands.d.ts → pm-plugins/commands.d.ts} +0 -0
- /package/dist/types-ts4.5/{utils → pm-plugins/utils}/array.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → pm-plugins/utils}/batch-decorations.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → pm-plugins/utils}/commands.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import { searchMatchClass, selectedSearchMatchClass } from '
|
|
3
|
+
import { searchMatchClass, selectedSearchMatchClass } from '../../ui/styles';
|
|
4
4
|
export function getSelectedText(selection) {
|
|
5
5
|
let text = '';
|
|
6
6
|
const selectedContent = selection.content().content;
|
package/dist/es2019/ui/Find.js
CHANGED
|
@@ -17,7 +17,7 @@ import { Label } from '@atlaskit/form';
|
|
|
17
17
|
import MatchCaseIcon from '@atlaskit/icon/glyph/emoji/keyboard';
|
|
18
18
|
import Textfield from '@atlaskit/textfield';
|
|
19
19
|
import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
|
|
20
|
-
import { afterInputSection, countStyles, countStylesAlternateStyles, matchCaseSection, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './styles';
|
|
20
|
+
import { afterInputSection, countStyles, countStylesAlternateStyles, matchCaseSection, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './ui-styles';
|
|
21
21
|
export const FIND_DEBOUNCE_MS = 100;
|
|
22
22
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
23
23
|
class Find extends React.Component {
|
|
@@ -11,7 +11,7 @@ import React from 'react';
|
|
|
11
11
|
import { jsx } from '@emotion/react';
|
|
12
12
|
import Find from './Find';
|
|
13
13
|
import Replace from './Replace';
|
|
14
|
-
import { ruleStyles, wrapperPaddingStyles, wrapperStyles } from './styles';
|
|
14
|
+
import { ruleStyles, wrapperPaddingStyles, wrapperStyles } from './ui-styles';
|
|
15
15
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
16
16
|
class FindReplace extends React.PureComponent {
|
|
17
17
|
constructor(props) {
|
package/dist/es2019/{FindReplaceToolbarButtonWithState.js → ui/FindReplaceToolbarButtonWithState.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useLayoutEffect, useState } from 'react';
|
|
2
2
|
import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import { blur, toggleMatchCase } from '
|
|
4
|
-
import { activateWithAnalytics, cancelSearchWithAnalytics, findNextWithAnalytics, findPrevWithAnalytics, findWithAnalytics, replaceAllWithAnalytics, replaceWithAnalytics } from '
|
|
5
|
-
import FindReplaceToolbarButton from './
|
|
3
|
+
import { blur, toggleMatchCase } from '../pm-plugins/commands';
|
|
4
|
+
import { activateWithAnalytics, cancelSearchWithAnalytics, findNextWithAnalytics, findPrevWithAnalytics, findWithAnalytics, replaceAllWithAnalytics, replaceWithAnalytics } from '../pm-plugins/commands-with-analytics';
|
|
5
|
+
import FindReplaceToolbarButton from './FindReplaceToolbarButton';
|
|
6
6
|
|
|
7
7
|
// light implementation of useSharedPluginState(). This is due to findreplace
|
|
8
8
|
// being the only plugin that previously used WithPluginState with
|
|
@@ -18,7 +18,7 @@ import ChevronUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-up';
|
|
|
18
18
|
import { Inline, xcss } from '@atlaskit/primitives';
|
|
19
19
|
import Textfield from '@atlaskit/textfield';
|
|
20
20
|
import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
|
|
21
|
-
import { nextPreviousItemStyles, orderOneStyles, orderZeroStyles, sectionWrapperJustified, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './styles';
|
|
21
|
+
import { nextPreviousItemStyles, orderOneStyles, orderZeroStyles, sectionWrapperJustified, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './ui-styles';
|
|
22
22
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
23
23
|
class Replace extends React.PureComponent {
|
|
24
24
|
constructor(props) {
|
package/dist/es2019/ui/styles.js
CHANGED
|
@@ -1,147 +1,19 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/design-system/
|
|
2
|
-
/* eslint-disable @
|
|
3
|
-
|
|
4
|
-
* @jsxRuntime classic
|
|
5
|
-
* @jsx jsx
|
|
6
|
-
*/
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { css } from '@emotion/react';
|
|
9
|
-
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
10
|
-
import { N30A } from '@atlaskit/theme/colors';
|
|
11
|
-
import { fontSize as getFontSize,
|
|
12
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
13
|
-
gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
14
|
-
const fontSize = getFontSize();
|
|
15
|
-
const gridSize = getGridSize();
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
18
|
-
export const ruleStyles = css({
|
|
19
|
-
width: '100%',
|
|
20
|
-
border: 'none',
|
|
21
|
-
backgroundColor: `${`var(--ds-border, ${N30A})`}`,
|
|
22
|
-
margin: `${"var(--ds-space-050, 4px)"} 0px`,
|
|
23
|
-
height: '1px',
|
|
24
|
-
borderRadius: '1px'
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
28
|
-
export const wrapperStyles = css({
|
|
29
|
-
display: 'flex',
|
|
30
|
-
flexDirection: 'column',
|
|
31
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
32
|
-
'> *:not(#replace-hr-element)': {
|
|
33
|
-
margin: `0px ${"var(--ds-space-050, 4px)"}`
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
38
|
-
export const wrapperPaddingStyles = css({
|
|
39
|
-
padding: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-050, 4px)"}`
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
43
|
-
export const sectionWrapperStyles = css({
|
|
44
|
-
display: 'flex',
|
|
45
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
46
|
-
'& > *': {
|
|
47
|
-
display: 'inline-flex',
|
|
48
|
-
height: '32px',
|
|
49
|
-
flex: '0 0 auto'
|
|
50
|
-
},
|
|
51
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
52
|
-
'& > [data-ds--text-field--container]': {
|
|
53
|
-
display: 'flex',
|
|
54
|
-
flex: '1 1 auto'
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
59
|
-
export const sectionWrapperStylesAlternate = css({
|
|
60
|
-
display: 'flex',
|
|
61
|
-
padding: "var(--ds-space-100, 8px)",
|
|
62
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
63
|
-
'& > *': {
|
|
64
|
-
height: 'unset'
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
69
|
-
export const sectionWrapperJustified = css({
|
|
70
|
-
justifyContent: 'space-between',
|
|
71
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
72
|
-
fontSize: relativeFontSizeToBase16(14)
|
|
73
|
-
});
|
|
1
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage/preview */
|
|
2
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
3
|
+
/* eslint-disable */
|
|
74
4
|
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
5
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-4290
|
|
6
|
+
import { css } from '@emotion/react';
|
|
7
|
+
import { N40A, N50A, N60A } from '@atlaskit/theme/colors';
|
|
8
|
+
export const searchMatchClass = 'search-match';
|
|
9
|
+
export const selectedSearchMatchClass = 'selected-search-match';
|
|
10
|
+
export const findReplaceStyles = css({
|
|
11
|
+
[`.${searchMatchClass}`]: {
|
|
12
|
+
borderRadius: '3px',
|
|
13
|
+
backgroundColor: "var(--ds-background-accent-teal-subtlest, #E7F9FF)",
|
|
14
|
+
boxShadow: `var(--ds-shadow-raised, ${`0 1px 1px 0 ${N50A}, 0 0 1px 0 ${N60A}`})` + ', inset 0 0 0 1px ' + `var(--ds-border-input, ${`${N40A}`})`
|
|
83
15
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
87
|
-
fontSize: relativeFontSizeToBase16(14),
|
|
88
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
89
|
-
lineHeight: `${gridSize * 2}px`
|
|
16
|
+
[`.${selectedSearchMatchClass}`]: {
|
|
17
|
+
backgroundColor: "var(--ds-background-accent-teal-subtle, #6CC3E0)"
|
|
90
18
|
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
94
|
-
export const afterInputSection = css({
|
|
95
|
-
display: 'flex',
|
|
96
|
-
flex: '0 0 auto',
|
|
97
|
-
alignItems: 'center'
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
101
|
-
export const matchCaseSection = css({
|
|
102
|
-
paddingRight: "var(--ds-space-100, 8px)",
|
|
103
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
104
|
-
button: {
|
|
105
|
-
width: '20px',
|
|
106
|
-
height: '20px'
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
111
|
-
export const nextPreviousItemStyles = css({
|
|
112
|
-
padding: `0px ${"var(--ds-space-025, 2px)"}`
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
116
|
-
export const countStyles = css({
|
|
117
|
-
color: `${"var(--ds-text-subtlest, #626F86)"}`,
|
|
118
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
119
|
-
fontSize: `${relativeFontSizeToBase16(12)}`,
|
|
120
|
-
flex: '0 0 auto',
|
|
121
|
-
justifyContent: 'center',
|
|
122
|
-
alignItems: 'center',
|
|
123
|
-
marginLeft: "var(--ds-space-050, 4px)",
|
|
124
|
-
marginRight: "var(--ds-space-100, 8px)"
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
128
|
-
export const countStylesAlternateStyles = css({
|
|
129
|
-
display: 'inline-flex',
|
|
130
|
-
height: '32px'
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
134
|
-
export const countWrapperStyles = css({
|
|
135
|
-
alignItems: 'center'
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
139
|
-
export const orderZeroStyles = css({
|
|
140
|
-
order: '0',
|
|
141
|
-
marginInline: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-025, 2px)"}`
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
145
|
-
export const orderOneStyles = css({
|
|
146
|
-
order: '1'
|
|
147
19
|
});
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/design-system/no-nested-styles */
|
|
2
|
+
/* eslint-disable @repo/internal/styles/no-exported-styles */
|
|
3
|
+
/**
|
|
4
|
+
* @jsxRuntime classic
|
|
5
|
+
* @jsx jsx
|
|
6
|
+
*/
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
+
import { css } from '@emotion/react';
|
|
9
|
+
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
10
|
+
import { N30A } from '@atlaskit/theme/colors';
|
|
11
|
+
import { fontSize as getFontSize,
|
|
12
|
+
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
13
|
+
gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
14
|
+
const fontSize = getFontSize();
|
|
15
|
+
const gridSize = getGridSize();
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
18
|
+
export const ruleStyles = css({
|
|
19
|
+
width: '100%',
|
|
20
|
+
border: 'none',
|
|
21
|
+
backgroundColor: `${`var(--ds-border, ${N30A})`}`,
|
|
22
|
+
margin: `${"var(--ds-space-050, 4px)"} 0px`,
|
|
23
|
+
height: '1px',
|
|
24
|
+
borderRadius: '1px'
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
28
|
+
export const wrapperStyles = css({
|
|
29
|
+
display: 'flex',
|
|
30
|
+
flexDirection: 'column',
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
32
|
+
'> *:not(#replace-hr-element)': {
|
|
33
|
+
margin: `0px ${"var(--ds-space-050, 4px)"}`
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
38
|
+
export const wrapperPaddingStyles = css({
|
|
39
|
+
padding: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-050, 4px)"}`
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
43
|
+
export const sectionWrapperStyles = css({
|
|
44
|
+
display: 'flex',
|
|
45
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
46
|
+
'& > *': {
|
|
47
|
+
display: 'inline-flex',
|
|
48
|
+
height: '32px',
|
|
49
|
+
flex: '0 0 auto'
|
|
50
|
+
},
|
|
51
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
52
|
+
'& > [data-ds--text-field--container]': {
|
|
53
|
+
display: 'flex',
|
|
54
|
+
flex: '1 1 auto'
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
59
|
+
export const sectionWrapperStylesAlternate = css({
|
|
60
|
+
display: 'flex',
|
|
61
|
+
padding: "var(--ds-space-100, 8px)",
|
|
62
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
63
|
+
'& > *': {
|
|
64
|
+
height: 'unset'
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
69
|
+
export const sectionWrapperJustified = css({
|
|
70
|
+
justifyContent: 'space-between',
|
|
71
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
72
|
+
fontSize: relativeFontSizeToBase16(14)
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
76
|
+
export const textFieldWrapper = css({
|
|
77
|
+
flex: '1 100%',
|
|
78
|
+
flexWrap: 'wrap',
|
|
79
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
80
|
+
'#find-text-field, #replace-text-field': {
|
|
81
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
82
|
+
height: `${gridSize * 4.5 / fontSize}em`
|
|
83
|
+
},
|
|
84
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
85
|
+
label: {
|
|
86
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
87
|
+
fontSize: relativeFontSizeToBase16(14),
|
|
88
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
89
|
+
lineHeight: `${gridSize * 2}px`
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
94
|
+
export const afterInputSection = css({
|
|
95
|
+
display: 'flex',
|
|
96
|
+
flex: '0 0 auto',
|
|
97
|
+
alignItems: 'center'
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
101
|
+
export const matchCaseSection = css({
|
|
102
|
+
paddingRight: "var(--ds-space-100, 8px)",
|
|
103
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
104
|
+
button: {
|
|
105
|
+
width: '20px',
|
|
106
|
+
height: '20px'
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
111
|
+
export const nextPreviousItemStyles = css({
|
|
112
|
+
padding: `0px ${"var(--ds-space-025, 2px)"}`
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
116
|
+
export const countStyles = css({
|
|
117
|
+
color: `${"var(--ds-text-subtlest, #626F86)"}`,
|
|
118
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
119
|
+
fontSize: `${relativeFontSizeToBase16(12)}`,
|
|
120
|
+
flex: '0 0 auto',
|
|
121
|
+
justifyContent: 'center',
|
|
122
|
+
alignItems: 'center',
|
|
123
|
+
marginLeft: "var(--ds-space-050, 4px)",
|
|
124
|
+
marginRight: "var(--ds-space-100, 8px)"
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
128
|
+
export const countStylesAlternateStyles = css({
|
|
129
|
+
display: 'inline-flex',
|
|
130
|
+
height: '32px'
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
134
|
+
export const countWrapperStyles = css({
|
|
135
|
+
alignItems: 'center'
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
139
|
+
export const orderZeroStyles = css({
|
|
140
|
+
order: '0',
|
|
141
|
+
marginInline: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-025, 2px)"}`
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
145
|
+
export const orderOneStyles = css({
|
|
146
|
+
order: '1'
|
|
147
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
-
import FindReplaceToolbarButtonWithState from './FindReplaceToolbarButtonWithState';
|
|
5
4
|
import keymapPlugin from './pm-plugins/keymap';
|
|
6
5
|
import { createPlugin } from './pm-plugins/main';
|
|
7
6
|
import { findReplacePluginKey } from './pm-plugins/plugin-key';
|
|
7
|
+
import FindReplaceToolbarButtonWithState from './ui/FindReplaceToolbarButtonWithState';
|
|
8
8
|
export var findReplacePlugin = function findReplacePlugin(_ref) {
|
|
9
9
|
var _api$primaryToolbar;
|
|
10
10
|
var props = _ref.config,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { findReplacePlugin } from './
|
|
1
|
+
export { findReplacePlugin } from './findReplacePlugin';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import { FindReplaceActionTypes } from './actions';
|
|
4
|
-
import { createCommand, getPluginState } from './
|
|
4
|
+
import { createCommand, getPluginState } from './plugin-factory';
|
|
5
5
|
import { createDecoration, findDecorationFromMatch, findMatches, findSearchIndex, getSelectedText, getSelectionForMatch, nextIndex, prevIndex, removeDecorationsFromSet, removeMatchesFromSet } from './utils';
|
|
6
6
|
import batchDecorations from './utils/batch-decorations';
|
|
7
7
|
import { withScrollIntoView } from './utils/commands';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { bindKeymapWithCommand, find as findKeymap } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
|
-
import { activateWithAnalytics } from '
|
|
4
|
+
import { activateWithAnalytics } from './commands-with-analytics';
|
|
5
5
|
var activateFindReplace = function activateFindReplace(editorAnalyticsAPI) {
|
|
6
6
|
return function (state, dispatch) {
|
|
7
7
|
activateWithAnalytics(editorAnalyticsAPI)({
|
|
@@ -4,12 +4,12 @@ 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 { pluginFactory, stepHasSlice } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
-
import reducer from '../reducer';
|
|
8
|
-
import { createDecorations, findDecorationFromMatch, findMatches, findSearchIndex, isMatchAffectedByStep, removeDecorationsFromSet, removeMatchesFromSet } from '../utils';
|
|
9
|
-
import { findUniqueItemsIn } from '../utils/array'; // TODO: move into index export
|
|
10
|
-
|
|
11
7
|
import { initialState } from './main';
|
|
12
8
|
import { findReplacePluginKey } from './plugin-key';
|
|
9
|
+
import reducer from './reducer';
|
|
10
|
+
import { createDecorations, findDecorationFromMatch, findMatches, findSearchIndex, isMatchAffectedByStep, removeDecorationsFromSet, removeMatchesFromSet } from './utils';
|
|
11
|
+
import { findUniqueItemsIn } from './utils/array'; // TODO: move into index export
|
|
12
|
+
|
|
13
13
|
var handleDocChanged = function handleDocChanged(tr, pluginState) {
|
|
14
14
|
var isActive = pluginState.isActive,
|
|
15
15
|
findText = pluginState.findText;
|
|
@@ -2,7 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
-
import { getPluginState } from '../
|
|
5
|
+
import { getPluginState } from '../plugin-factory';
|
|
6
6
|
import { createDecorations, findDecorationFromMatch } from './index';
|
|
7
7
|
|
|
8
8
|
// max number of decorations to apply at once
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import { searchMatchClass, selectedSearchMatchClass } from '
|
|
3
|
+
import { searchMatchClass, selectedSearchMatchClass } from '../../ui/styles';
|
|
4
4
|
export function getSelectedText(selection) {
|
|
5
5
|
var text = '';
|
|
6
6
|
var selectedContent = selection.content().content;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/ui/Find.js
CHANGED
|
@@ -25,7 +25,7 @@ import { Label } from '@atlaskit/form';
|
|
|
25
25
|
import MatchCaseIcon from '@atlaskit/icon/glyph/emoji/keyboard';
|
|
26
26
|
import Textfield from '@atlaskit/textfield';
|
|
27
27
|
import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
|
|
28
|
-
import { afterInputSection, countStyles, countStylesAlternateStyles, matchCaseSection, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './styles';
|
|
28
|
+
import { afterInputSection, countStyles, countStylesAlternateStyles, matchCaseSection, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './ui-styles';
|
|
29
29
|
export var FIND_DEBOUNCE_MS = 100;
|
|
30
30
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
31
31
|
var Find = /*#__PURE__*/function (_React$Component) {
|
|
@@ -19,7 +19,7 @@ import React from 'react';
|
|
|
19
19
|
import { jsx } from '@emotion/react';
|
|
20
20
|
import Find from './Find';
|
|
21
21
|
import Replace from './Replace';
|
|
22
|
-
import { ruleStyles, wrapperPaddingStyles, wrapperStyles } from './styles';
|
|
22
|
+
import { ruleStyles, wrapperPaddingStyles, wrapperStyles } from './ui-styles';
|
|
23
23
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
24
24
|
var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
|
|
25
25
|
_inherits(FindReplace, _React$PureComponent);
|
package/dist/esm/{FindReplaceToolbarButtonWithState.js → ui/FindReplaceToolbarButtonWithState.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React, { useLayoutEffect, useState } from 'react';
|
|
3
3
|
import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { blur, toggleMatchCase } from '
|
|
5
|
-
import { activateWithAnalytics, cancelSearchWithAnalytics, findNextWithAnalytics, findPrevWithAnalytics, findWithAnalytics, replaceAllWithAnalytics, replaceWithAnalytics } from '
|
|
6
|
-
import FindReplaceToolbarButton from './
|
|
4
|
+
import { blur, toggleMatchCase } from '../pm-plugins/commands';
|
|
5
|
+
import { activateWithAnalytics, cancelSearchWithAnalytics, findNextWithAnalytics, findPrevWithAnalytics, findWithAnalytics, replaceAllWithAnalytics, replaceWithAnalytics } from '../pm-plugins/commands-with-analytics';
|
|
6
|
+
import FindReplaceToolbarButton from './FindReplaceToolbarButton';
|
|
7
7
|
|
|
8
8
|
// light implementation of useSharedPluginState(). This is due to findreplace
|
|
9
9
|
// being the only plugin that previously used WithPluginState with
|
package/dist/esm/ui/Replace.js
CHANGED
|
@@ -26,7 +26,7 @@ import ChevronUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-up';
|
|
|
26
26
|
import { Inline, xcss } from '@atlaskit/primitives';
|
|
27
27
|
import Textfield from '@atlaskit/textfield';
|
|
28
28
|
import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
|
|
29
|
-
import { nextPreviousItemStyles, orderOneStyles, orderZeroStyles, sectionWrapperJustified, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './styles';
|
|
29
|
+
import { nextPreviousItemStyles, orderOneStyles, orderZeroStyles, sectionWrapperJustified, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './ui-styles';
|
|
30
30
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
31
31
|
var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
32
32
|
_inherits(Replace, _React$PureComponent);
|