@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.
Files changed (102) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/{plugin.js → findReplacePlugin.js} +1 -1
  3. package/dist/cjs/index.js +2 -2
  4. package/dist/cjs/{commands.js → pm-plugins/commands.js} +1 -1
  5. package/dist/cjs/pm-plugins/keymap.js +1 -1
  6. package/dist/cjs/pm-plugins/plugin-factory.js +6 -4
  7. package/dist/cjs/{utils → pm-plugins/utils}/batch-decorations.js +1 -1
  8. package/dist/cjs/{utils → pm-plugins/utils}/index.js +1 -1
  9. package/dist/cjs/types/index.js +5 -0
  10. package/dist/cjs/ui/Find.js +6 -6
  11. package/dist/cjs/ui/FindReplace.js +3 -3
  12. package/dist/cjs/{FindReplaceToolbarButtonWithState.js → ui/FindReplaceToolbarButtonWithState.js} +3 -3
  13. package/dist/cjs/ui/Replace.js +8 -8
  14. package/dist/cjs/ui/styles.js +17 -145
  15. package/dist/cjs/ui/ui-styles.js +152 -0
  16. package/dist/es2019/{plugin.js → findReplacePlugin.js} +1 -1
  17. package/dist/es2019/index.js +1 -1
  18. package/dist/es2019/{commands.js → pm-plugins/commands.js} +1 -1
  19. package/dist/es2019/pm-plugins/keymap.js +1 -1
  20. package/dist/es2019/pm-plugins/plugin-factory.js +4 -4
  21. package/dist/es2019/{utils → pm-plugins/utils}/batch-decorations.js +1 -1
  22. package/dist/es2019/{utils → pm-plugins/utils}/index.js +1 -1
  23. package/dist/es2019/ui/Find.js +1 -1
  24. package/dist/es2019/ui/FindReplace.js +1 -1
  25. package/dist/es2019/{FindReplaceToolbarButtonWithState.js → ui/FindReplaceToolbarButtonWithState.js} +3 -3
  26. package/dist/es2019/ui/Replace.js +1 -1
  27. package/dist/es2019/ui/styles.js +15 -143
  28. package/dist/es2019/ui/ui-styles.js +147 -0
  29. package/dist/esm/{plugin.js → findReplacePlugin.js} +1 -1
  30. package/dist/esm/findReplacePluginType.js +1 -0
  31. package/dist/esm/index.js +1 -1
  32. package/dist/esm/{commands.js → pm-plugins/commands.js} +1 -1
  33. package/dist/esm/pm-plugins/keymap.js +1 -1
  34. package/dist/esm/pm-plugins/plugin-factory.js +4 -4
  35. package/dist/esm/{utils → pm-plugins/utils}/batch-decorations.js +1 -1
  36. package/dist/esm/{utils → pm-plugins/utils}/index.js +1 -1
  37. package/dist/esm/types/index.js +1 -0
  38. package/dist/esm/ui/Find.js +1 -1
  39. package/dist/esm/ui/FindReplace.js +1 -1
  40. package/dist/esm/{FindReplaceToolbarButtonWithState.js → ui/FindReplaceToolbarButtonWithState.js} +3 -3
  41. package/dist/esm/ui/Replace.js +1 -1
  42. package/dist/esm/ui/styles.js +17 -146
  43. package/dist/esm/ui/ui-styles.js +147 -0
  44. package/dist/types/findReplacePlugin.d.ts +2 -0
  45. package/dist/types/findReplacePluginType.d.ts +18 -0
  46. package/dist/types/index.d.ts +3 -2
  47. package/dist/types/{actions.d.ts → pm-plugins/actions.d.ts} +1 -1
  48. package/dist/types/pm-plugins/plugin-factory.d.ts +1 -1
  49. package/dist/types/{reducer.d.ts → pm-plugins/reducer.d.ts} +1 -1
  50. package/dist/types/{utils → pm-plugins/utils}/index.d.ts +1 -1
  51. package/dist/{types-ts4.5/types.d.ts → types/types/index.d.ts} +2 -20
  52. package/dist/types/{FindReplaceToolbarButtonWithState.d.ts → ui/FindReplaceToolbarButtonWithState.d.ts} +1 -1
  53. package/dist/types/ui/styles.d.ts +3 -15
  54. package/dist/types/ui/ui-styles.d.ts +15 -0
  55. package/dist/types-ts4.5/findReplacePlugin.d.ts +2 -0
  56. package/dist/types-ts4.5/findReplacePluginType.d.ts +21 -0
  57. package/dist/types-ts4.5/index.d.ts +3 -2
  58. package/dist/types-ts4.5/{actions.d.ts → pm-plugins/actions.d.ts} +1 -1
  59. package/dist/types-ts4.5/pm-plugins/plugin-factory.d.ts +1 -1
  60. package/dist/types-ts4.5/{reducer.d.ts → pm-plugins/reducer.d.ts} +1 -1
  61. package/dist/types-ts4.5/{utils → pm-plugins/utils}/index.d.ts +1 -1
  62. package/dist/{types/types.d.ts → types-ts4.5/types/index.d.ts} +2 -17
  63. package/dist/types-ts4.5/{FindReplaceToolbarButtonWithState.d.ts → ui/FindReplaceToolbarButtonWithState.d.ts} +1 -1
  64. package/dist/types-ts4.5/ui/styles.d.ts +3 -15
  65. package/dist/types-ts4.5/ui/ui-styles.d.ts +15 -0
  66. package/package.json +14 -11
  67. package/styles/package.json +5 -5
  68. package/dist/cjs/styles.js +0 -24
  69. package/dist/es2019/styles.js +0 -19
  70. package/dist/esm/styles.js +0 -18
  71. package/dist/types/plugin.d.ts +0 -2
  72. package/dist/types/styles.d.ts +0 -3
  73. package/dist/types-ts4.5/plugin.d.ts +0 -2
  74. package/dist/types-ts4.5/styles.d.ts +0 -3
  75. /package/dist/cjs/{types.js → findReplacePluginType.js} +0 -0
  76. /package/dist/cjs/{actions.js → pm-plugins/actions.js} +0 -0
  77. /package/dist/cjs/{commands-with-analytics.js → pm-plugins/commands-with-analytics.js} +0 -0
  78. /package/dist/cjs/{reducer.js → pm-plugins/reducer.js} +0 -0
  79. /package/dist/cjs/{utils → pm-plugins/utils}/array.js +0 -0
  80. /package/dist/cjs/{utils → pm-plugins/utils}/commands.js +0 -0
  81. /package/dist/es2019/{types.js → findReplacePluginType.js} +0 -0
  82. /package/dist/es2019/{actions.js → pm-plugins/actions.js} +0 -0
  83. /package/dist/es2019/{commands-with-analytics.js → pm-plugins/commands-with-analytics.js} +0 -0
  84. /package/dist/es2019/{reducer.js → pm-plugins/reducer.js} +0 -0
  85. /package/dist/es2019/{utils → pm-plugins/utils}/array.js +0 -0
  86. /package/dist/es2019/{utils → pm-plugins/utils}/commands.js +0 -0
  87. /package/dist/{esm/types.js → es2019/types/index.js} +0 -0
  88. /package/dist/esm/{actions.js → pm-plugins/actions.js} +0 -0
  89. /package/dist/esm/{commands-with-analytics.js → pm-plugins/commands-with-analytics.js} +0 -0
  90. /package/dist/esm/{reducer.js → pm-plugins/reducer.js} +0 -0
  91. /package/dist/esm/{utils → pm-plugins/utils}/array.js +0 -0
  92. /package/dist/esm/{utils → pm-plugins/utils}/commands.js +0 -0
  93. /package/dist/types/{commands-with-analytics.d.ts → pm-plugins/commands-with-analytics.d.ts} +0 -0
  94. /package/dist/types/{commands.d.ts → pm-plugins/commands.d.ts} +0 -0
  95. /package/dist/types/{utils → pm-plugins/utils}/array.d.ts +0 -0
  96. /package/dist/types/{utils → pm-plugins/utils}/batch-decorations.d.ts +0 -0
  97. /package/dist/types/{utils → pm-plugins/utils}/commands.d.ts +0 -0
  98. /package/dist/types-ts4.5/{commands-with-analytics.d.ts → pm-plugins/commands-with-analytics.d.ts} +0 -0
  99. /package/dist/types-ts4.5/{commands.d.ts → pm-plugins/commands.d.ts} +0 -0
  100. /package/dist/types-ts4.5/{utils → pm-plugins/utils}/array.d.ts +0 -0
  101. /package/dist/types-ts4.5/{utils → pm-plugins/utils}/batch-decorations.d.ts +0 -0
  102. /package/dist/types-ts4.5/{utils → pm-plugins/utils}/commands.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { getPluginState } from '../pm-plugins/plugin-factory';
1
+ import { getPluginState } from '../plugin-factory';
2
2
  import { createDecorations, findDecorationFromMatch } from './index';
3
3
 
4
4
  // 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 '../styles';
3
+ import { searchMatchClass, selectedSearchMatchClass } from '../../ui/styles';
4
4
  export function getSelectedText(selection) {
5
5
  let text = '';
6
6
  const selectedContent = selection.content().content;
@@ -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) {
@@ -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 './commands';
4
- import { activateWithAnalytics, cancelSearchWithAnalytics, findNextWithAnalytics, findPrevWithAnalytics, findWithAnalytics, replaceAllWithAnalytics, replaceWithAnalytics } from './commands-with-analytics';
5
- import FindReplaceToolbarButton from './ui/FindReplaceToolbarButton';
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) {
@@ -1,147 +1,19 @@
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
- });
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
- // 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`
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
- // 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`
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 './plugin';
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 './pm-plugins/plugin-factory';
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 '../commands-with-analytics';
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 '../pm-plugins/plugin-factory';
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 '../styles';
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 {};
@@ -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);
@@ -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 './commands';
5
- import { activateWithAnalytics, cancelSearchWithAnalytics, findNextWithAnalytics, findPrevWithAnalytics, findWithAnalytics, replaceAllWithAnalytics, replaceWithAnalytics } from './commands-with-analytics';
6
- import FindReplaceToolbarButton from './ui/FindReplaceToolbarButton';
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
@@ -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);