@singapore-editor/find 0.1.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/README.md +28 -0
- package/dist/findController.d.ts +175 -0
- package/dist/findController.d.ts.map +1 -0
- package/dist/findController.js +681 -0
- package/dist/findController.js.map +1 -0
- package/dist/findIcons.d.ts +49 -0
- package/dist/findIcons.d.ts.map +1 -0
- package/dist/findIcons.js +65 -0
- package/dist/findIcons.js.map +1 -0
- package/dist/findWidget.d.ts +45 -0
- package/dist/findWidget.d.ts.map +1 -0
- package/dist/findWidget.js +194 -0
- package/dist/findWidget.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/plugin.d.ts +14 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +408 -0
- package/dist/plugin.js.map +1 -0
- package/dist/replacePattern.d.ts +18 -0
- package/dist/replacePattern.d.ts.map +1 -0
- package/dist/replacePattern.js +212 -0
- package/dist/replacePattern.js.map +1 -0
- package/dist/search.d.ts +83 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +470 -0
- package/dist/search.js.map +1 -0
- package/dist/style.css +198 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +48 -0
package/dist/style.css
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
.editor-find-widget {
|
|
2
|
+
--editor-find-background-fallback: #252526;
|
|
3
|
+
--editor-find-border-fallback: rgba(255, 255, 255, 0.12);
|
|
4
|
+
--editor-find-control-background-fallback: #3c3c3c;
|
|
5
|
+
--editor-find-control-border-fallback: rgba(255, 255, 255, 0.16);
|
|
6
|
+
--editor-find-count-fallback: #a1a1aa;
|
|
7
|
+
--editor-find-focus-fallback: #007fd4;
|
|
8
|
+
--editor-find-foreground-fallback: #cccccc;
|
|
9
|
+
--editor-find-hover-background-fallback: rgba(255, 255, 255, 0.12);
|
|
10
|
+
--editor-find-placeholder-fallback: #8f8f8f;
|
|
11
|
+
--editor-find-strong-foreground-fallback: #ffffff;
|
|
12
|
+
|
|
13
|
+
align-items: stretch;
|
|
14
|
+
background: color-mix(
|
|
15
|
+
in srgb,
|
|
16
|
+
var(--editor-background, var(--editor-find-background-fallback)) 94%,
|
|
17
|
+
var(--editor-foreground, var(--editor-find-foreground-fallback)) 6%
|
|
18
|
+
);
|
|
19
|
+
border: 1px solid var(--editor-find-border-fallback);
|
|
20
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
color: var(--editor-foreground, var(--editor-find-foreground-fallback));
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
26
|
+
font-size: 12px;
|
|
27
|
+
gap: 4px;
|
|
28
|
+
max-width: min(620px, calc(100% - 24px));
|
|
29
|
+
padding: 6px;
|
|
30
|
+
position: absolute;
|
|
31
|
+
right: 18px;
|
|
32
|
+
top: 8px;
|
|
33
|
+
z-index: 20;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.editor-find-widget[hidden] {
|
|
37
|
+
display: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.editor-find-row {
|
|
41
|
+
align-items: center;
|
|
42
|
+
display: flex;
|
|
43
|
+
gap: 4px;
|
|
44
|
+
min-width: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.editor-find-replace-row {
|
|
48
|
+
padding-left: 28px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.editor-find-replace-row[hidden] {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.editor-find-input-frame {
|
|
56
|
+
align-items: center;
|
|
57
|
+
background: color-mix(
|
|
58
|
+
in srgb,
|
|
59
|
+
var(--editor-background, var(--editor-find-control-background-fallback)) 86%,
|
|
60
|
+
var(--editor-foreground, var(--editor-find-foreground-fallback)) 14%
|
|
61
|
+
);
|
|
62
|
+
border: 1px solid var(--editor-find-control-border-fallback);
|
|
63
|
+
box-sizing: border-box;
|
|
64
|
+
display: flex;
|
|
65
|
+
flex: 1 1 250px;
|
|
66
|
+
height: 24px;
|
|
67
|
+
min-width: 180px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.editor-find-input-frame:focus-within {
|
|
71
|
+
border-color: var(--editor-caret-color, var(--editor-find-focus-fallback));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.editor-find-input {
|
|
75
|
+
background: transparent;
|
|
76
|
+
border: 0;
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
color: var(--editor-foreground, var(--editor-find-strong-foreground-fallback));
|
|
79
|
+
flex: 1 1 auto;
|
|
80
|
+
font: inherit;
|
|
81
|
+
height: 100%;
|
|
82
|
+
min-width: 0;
|
|
83
|
+
outline: none;
|
|
84
|
+
padding: 2px 6px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.editor-find-input::placeholder {
|
|
88
|
+
color: color-mix(
|
|
89
|
+
in srgb,
|
|
90
|
+
var(--editor-foreground, var(--editor-find-placeholder-fallback)) 58%,
|
|
91
|
+
transparent
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.editor-find-input-standalone {
|
|
96
|
+
background: color-mix(
|
|
97
|
+
in srgb,
|
|
98
|
+
var(--editor-background, var(--editor-find-control-background-fallback)) 86%,
|
|
99
|
+
var(--editor-foreground, var(--editor-find-foreground-fallback)) 14%
|
|
100
|
+
);
|
|
101
|
+
border: 1px solid var(--editor-find-control-border-fallback);
|
|
102
|
+
flex: 1 1 250px;
|
|
103
|
+
height: 24px;
|
|
104
|
+
min-width: 180px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.editor-find-input-standalone:focus {
|
|
108
|
+
border-color: var(--editor-caret-color, var(--editor-find-focus-fallback));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.editor-find-input-controls {
|
|
112
|
+
align-items: center;
|
|
113
|
+
display: flex;
|
|
114
|
+
flex: 0 0 auto;
|
|
115
|
+
height: 100%;
|
|
116
|
+
padding-right: 2px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.editor-find-count {
|
|
120
|
+
color: color-mix(
|
|
121
|
+
in srgb,
|
|
122
|
+
var(--editor-foreground, var(--editor-find-count-fallback)) 72%,
|
|
123
|
+
transparent
|
|
124
|
+
);
|
|
125
|
+
flex: 0 0 auto;
|
|
126
|
+
min-width: 64px;
|
|
127
|
+
text-align: right;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.editor-find-button {
|
|
131
|
+
align-items: center;
|
|
132
|
+
appearance: none;
|
|
133
|
+
background: transparent;
|
|
134
|
+
border: 0;
|
|
135
|
+
border-radius: 3px;
|
|
136
|
+
color: var(--editor-foreground, var(--editor-find-foreground-fallback));
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
display: inline-flex;
|
|
139
|
+
flex: 0 0 24px;
|
|
140
|
+
font: inherit;
|
|
141
|
+
height: 24px;
|
|
142
|
+
justify-content: center;
|
|
143
|
+
line-height: 0;
|
|
144
|
+
min-width: 24px;
|
|
145
|
+
padding: 0;
|
|
146
|
+
width: 24px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.editor-find-button:focus-visible {
|
|
150
|
+
outline: 1px solid var(--editor-caret-color, var(--editor-find-focus-fallback));
|
|
151
|
+
outline-offset: -1px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.editor-find-button .editor-find-icon {
|
|
155
|
+
display: block;
|
|
156
|
+
height: 16px;
|
|
157
|
+
width: 16px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.editor-find-button:hover,
|
|
161
|
+
.editor-find-button.active,
|
|
162
|
+
.editor-find-button[aria-expanded='true'],
|
|
163
|
+
.editor-find-button[aria-pressed='true'] {
|
|
164
|
+
background: color-mix(
|
|
165
|
+
in srgb,
|
|
166
|
+
var(--editor-foreground, var(--editor-find-hover-background-fallback)) 14%,
|
|
167
|
+
transparent
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.editor-find-button.active,
|
|
172
|
+
.editor-find-button[aria-expanded='true'],
|
|
173
|
+
.editor-find-button[aria-pressed='true'] {
|
|
174
|
+
color: var(--editor-foreground, var(--editor-find-strong-foreground-fallback));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
@media (prefers-color-scheme: light) {
|
|
178
|
+
.editor-find-widget {
|
|
179
|
+
--editor-find-background-fallback: #ffffff;
|
|
180
|
+
--editor-find-border-fallback: rgba(15, 23, 42, 0.16);
|
|
181
|
+
--editor-find-control-background-fallback: #f8fafc;
|
|
182
|
+
--editor-find-control-border-fallback: rgba(15, 23, 42, 0.18);
|
|
183
|
+
--editor-find-count-fallback: #64748b;
|
|
184
|
+
--editor-find-focus-fallback: #2563eb;
|
|
185
|
+
--editor-find-foreground-fallback: #0f172a;
|
|
186
|
+
--editor-find-hover-background-fallback: rgba(15, 23, 42, 0.1);
|
|
187
|
+
--editor-find-placeholder-fallback: #64748b;
|
|
188
|
+
--editor-find-strong-foreground-fallback: #020617;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.editor-find-replace-toggle .editor-find-icon {
|
|
193
|
+
transition: transform 120ms ease;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.editor-find-replace-toggle[aria-expanded='true'] .editor-find-icon {
|
|
197
|
+
transform: rotate(90deg);
|
|
198
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type EditorFindOptions = {
|
|
2
|
+
readonly loop?: boolean;
|
|
3
|
+
readonly seedSearchStringFromSelection?: 'never' | 'always' | 'selection';
|
|
4
|
+
readonly findOnType?: boolean;
|
|
5
|
+
readonly cursorMoveOnType?: boolean;
|
|
6
|
+
readonly autoFindInSelection?: 'never' | 'always' | 'multiline';
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,6BAA6B,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAA;IACzE,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IACnC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAA;CAChE,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@singapore-editor/find",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"files": [
|
|
5
|
+
"README.md",
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"type": "module",
|
|
9
|
+
"sideEffects": [
|
|
10
|
+
"./dist/style.css"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./style.css": "./dist/style.css"
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public",
|
|
22
|
+
"registry": "https://registry.npmjs.org/"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "bun ../../scripts/build-package.ts",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"bench:search": "bun bench/search.ts",
|
|
28
|
+
"bench:matchers": "bun bench/matchers.ts",
|
|
29
|
+
"typecheck": "tsgo --noEmit",
|
|
30
|
+
"lint": "oxlint .",
|
|
31
|
+
"format": "oxfmt --write .",
|
|
32
|
+
"format:check": "oxfmt --check ."
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@playwright/test": "^1.63.0",
|
|
36
|
+
"@singapore-editor/core": "0.1.2",
|
|
37
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
38
|
+
"@vitest/browser-playwright": "^5.0.2",
|
|
39
|
+
"happy-dom": "^20.14.5",
|
|
40
|
+
"oxfmt": "0.70.0",
|
|
41
|
+
"oxlint": "1.85.0",
|
|
42
|
+
"typescript": "~6.0.3",
|
|
43
|
+
"vitest": "^5.0.2"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@singapore-editor/core": "0.1.2"
|
|
47
|
+
}
|
|
48
|
+
}
|