@pierre/diffs 1.3.0-beta.4 → 1.3.0-beta.5

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 (89) hide show
  1. package/README.md +6 -6
  2. package/dist/components/CodeView.d.ts.map +1 -1
  3. package/dist/components/CodeView.js +6 -6
  4. package/dist/components/CodeView.js.map +1 -1
  5. package/dist/components/File.d.ts +1 -0
  6. package/dist/components/File.d.ts.map +1 -1
  7. package/dist/components/File.js +26 -12
  8. package/dist/components/File.js.map +1 -1
  9. package/dist/components/FileDiff.d.ts +1 -0
  10. package/dist/components/FileDiff.d.ts.map +1 -1
  11. package/dist/components/FileDiff.js +12 -11
  12. package/dist/components/FileDiff.js.map +1 -1
  13. package/dist/components/FileStream.js +4 -2
  14. package/dist/components/FileStream.js.map +1 -1
  15. package/dist/components/UnresolvedFile.d.ts.map +1 -1
  16. package/dist/components/VirtualizedFile.d.ts +5 -1
  17. package/dist/components/VirtualizedFile.d.ts.map +1 -1
  18. package/dist/components/VirtualizedFile.js +82 -21
  19. package/dist/components/VirtualizedFile.js.map +1 -1
  20. package/dist/components/VirtualizedFileDiff.d.ts +6 -1
  21. package/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
  22. package/dist/components/VirtualizedFileDiff.js +77 -15
  23. package/dist/components/VirtualizedFileDiff.js.map +1 -1
  24. package/dist/components/VirtulizerDevelopment.d.ts.map +1 -1
  25. package/dist/editor/command.d.ts +1 -1
  26. package/dist/editor/command.d.ts.map +1 -1
  27. package/dist/editor/command.js +3 -3
  28. package/dist/editor/command.js.map +1 -1
  29. package/dist/editor/editor.d.ts +31 -5
  30. package/dist/editor/editor.d.ts.map +1 -1
  31. package/dist/editor/editor.js +240 -178
  32. package/dist/editor/editor.js.map +1 -1
  33. package/dist/editor/editor2.js +1 -1
  34. package/dist/editor/editor2.js.map +1 -1
  35. package/dist/editor/index.d.ts +2 -2
  36. package/dist/editor/marker.d.ts +2 -2
  37. package/dist/editor/marker.d.ts.map +1 -1
  38. package/dist/editor/marker.js +2 -2
  39. package/dist/editor/marker.js.map +1 -1
  40. package/dist/editor/pieceTable.d.ts +6 -1
  41. package/dist/editor/pieceTable.d.ts.map +1 -1
  42. package/dist/editor/pieceTable.js +32 -1
  43. package/dist/editor/pieceTable.js.map +1 -1
  44. package/dist/editor/searchPanel.d.ts +12 -3
  45. package/dist/editor/searchPanel.d.ts.map +1 -1
  46. package/dist/editor/searchPanel.js +168 -54
  47. package/dist/editor/searchPanel.js.map +1 -1
  48. package/dist/editor/selection.d.ts.map +1 -1
  49. package/dist/editor/sprite.d.ts +2 -2
  50. package/dist/editor/sprite.d.ts.map +1 -1
  51. package/dist/editor/sprite.js +10 -3
  52. package/dist/editor/sprite.js.map +1 -1
  53. package/dist/editor/textMeasure.d.ts +1 -0
  54. package/dist/editor/textMeasure.d.ts.map +1 -1
  55. package/dist/editor/textMeasure.js +6 -0
  56. package/dist/editor/textMeasure.js.map +1 -1
  57. package/dist/editor/tokenzier.js +9 -6
  58. package/dist/editor/tokenzier.js.map +1 -1
  59. package/dist/managers/InteractionManager.js +1 -1
  60. package/dist/managers/InteractionManager.js.map +1 -1
  61. package/dist/managers/ResizeManager.js +1 -1
  62. package/dist/managers/ResizeManager.js.map +1 -1
  63. package/dist/react/CodeView.js +1 -1
  64. package/dist/react/jsx.d.ts.map +1 -1
  65. package/dist/renderers/DiffHunksRenderer.d.ts +3 -2
  66. package/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
  67. package/dist/renderers/DiffHunksRenderer.js +49 -2
  68. package/dist/renderers/DiffHunksRenderer.js.map +1 -1
  69. package/dist/renderers/FileRenderer.js +12 -0
  70. package/dist/renderers/FileRenderer.js.map +1 -1
  71. package/dist/ssr/FileDiffReact.js +1 -1
  72. package/dist/types.d.ts +17 -2
  73. package/dist/types.d.ts.map +1 -1
  74. package/dist/utils/includesFileAnnotations.d.ts +17 -0
  75. package/dist/utils/includesFileAnnotations.d.ts.map +1 -0
  76. package/dist/utils/includesFileAnnotations.js +19 -0
  77. package/dist/utils/includesFileAnnotations.js.map +1 -0
  78. package/dist/utils/parseMergeConflictDiffFromFile.js.map +1 -1
  79. package/dist/utils/renderDiffWithHighlighter.js +4 -2
  80. package/dist/utils/renderDiffWithHighlighter.js.map +1 -1
  81. package/dist/utils/renderFileWithHighlighter.js +4 -2
  82. package/dist/utils/renderFileWithHighlighter.js.map +1 -1
  83. package/dist/worker/{wasm-BaDzIkIn.js → wasm-qE0LgnY3.js} +2 -2
  84. package/dist/worker/{wasm-BaDzIkIn.js.map → wasm-qE0LgnY3.js.map} +1 -1
  85. package/dist/worker/worker-portable.js +289 -253
  86. package/dist/worker/worker-portable.js.map +1 -1
  87. package/dist/worker/worker.js +8 -4
  88. package/dist/worker/worker.js.map +1 -1
  89. package/package.json +4 -10
@@ -1,13 +1,16 @@
1
1
  import { isPrimaryModifier } from "./platform.js";
2
2
  import { h } from "./utils.js";
3
+ import { buildSearchReplacementText } from "./pieceTable.js";
3
4
  import { getEditorIconSvg } from "./sprite.js";
4
5
 
5
6
  //#region src/editor/searchPanel.ts
6
7
  var SearchPanelWidget = class {
7
8
  #container;
8
9
  #inputElement;
10
+ #updateMatches;
11
+ #applyMode;
9
12
  constructor(options) {
10
- const { textDocument, containerElement, defaultQuery, initialMatch, scrollToMatch, onUpdate, onClose } = options;
13
+ const { textDocument, containerElement, defaultQuery, mode = "find", initialMatch, scrollToMatch, applyReplace, onUpdate, onClose } = options;
11
14
  const searchParams = {
12
15
  text: defaultQuery,
13
16
  replaceText: "",
@@ -19,28 +22,38 @@ var SearchPanelWidget = class {
19
22
  all: [],
20
23
  current: void 0
21
24
  };
22
- const matchResultElement = h("div", { dataset: "matches" });
23
- const updateMatches = () => {
25
+ const matchResultElement = h("div", {
26
+ dataset: {
27
+ matches: "",
28
+ noMatches: ""
29
+ },
30
+ textContent: "No results"
31
+ });
32
+ const updateMatches = (options$1) => {
24
33
  matches.all = searchParams.text !== "" ? textDocument.search(searchParams) : [];
25
- this.#container.querySelectorAll("[data-disabled]").forEach((element) => {
34
+ this.#container.querySelectorAll("[data-icon][data-disabled]").forEach((element) => {
26
35
  element.dataset.disabled = String(matches.all.length === 0);
27
36
  });
28
37
  if (searchParams.text === "") {
29
- matchResultElement.textContent = "";
30
- delete matchResultElement.dataset.noMatches;
38
+ matchResultElement.textContent = "No results";
39
+ matchResultElement.dataset.noMatches = "";
31
40
  return;
32
41
  }
33
42
  if (matches.all.length === 0) {
34
43
  matchResultElement.textContent = "No results";
35
44
  matchResultElement.dataset.noMatches = "";
36
- } else {
37
- delete matchResultElement.dataset.noMatches;
38
- updateCurrentMatch(onUpdate(matches.all));
45
+ matches.current = void 0;
46
+ onUpdate([]);
39
47
  return;
40
48
  }
41
- matches.current = void 0;
42
- onUpdate([]);
49
+ delete matchResultElement.dataset.noMatches;
50
+ if (options$1?.syncSelection === false) {
51
+ updateCurrentMatch(onUpdate(matches.all, { syncSelection: false }));
52
+ return;
53
+ }
54
+ updateCurrentMatch(onUpdate(matches.all));
43
55
  };
56
+ this.#updateMatches = updateMatches;
44
57
  const updateCurrentMatch = (currentMatch) => {
45
58
  if (currentMatch === void 0) matchResultElement.textContent = `${matches.all.length} results`;
46
59
  else {
@@ -74,6 +87,32 @@ var SearchPanelWidget = class {
74
87
  }
75
88
  matches.current = nextMatch;
76
89
  };
90
+ const buildReplacementEdit = (matchStart, matchEnd) => ({
91
+ start: matchStart,
92
+ end: matchEnd,
93
+ text: buildSearchReplacementText((offset) => textDocument.positionAt(offset), (position) => textDocument.offsetAt(position), (line) => textDocument.getLineText(line), searchParams, matchStart, matchEnd)
94
+ });
95
+ const replace = () => {
96
+ if (searchParams.text === "" || matches.all.length === 0) return;
97
+ let currentMatch = matches.current;
98
+ if (currentMatch === void 0) {
99
+ findNextMatch(false, true);
100
+ currentMatch = matches.current;
101
+ if (currentMatch === void 0) return;
102
+ }
103
+ const [start, end] = currentMatch;
104
+ const edit = buildReplacementEdit(start, end);
105
+ applyReplace([edit]);
106
+ scrollToMatch([start + edit.text.length, start + edit.text.length], true);
107
+ matches.current = void 0;
108
+ updateMatches();
109
+ };
110
+ const replaceAll = () => {
111
+ if (searchParams.text === "" || matches.all.length === 0) return;
112
+ applyReplace(matches.all.map(([start, end]) => buildReplacementEdit(start, end)));
113
+ matches.current = void 0;
114
+ updateMatches();
115
+ };
77
116
  const close = () => {
78
117
  this.cleanup();
79
118
  onClose();
@@ -97,6 +136,15 @@ var SearchPanelWidget = class {
97
136
  const caseSensitiveToggle = makeToggle("case", "Match Case", "caseSensitive");
98
137
  const wholeWordToggle = makeToggle("whole-word", "Whole Word", "wholeWord");
99
138
  const regexToggle = makeToggle("regex", "Regexp", "regex");
139
+ const replaceInputElement = h("input", {
140
+ type: "text",
141
+ placeholder: "Replace",
142
+ dataset: "replace",
143
+ value: "",
144
+ oninput: (e) => {
145
+ searchParams.replaceText = e.target.value;
146
+ }
147
+ });
100
148
  this.#inputElement = h("input", {
101
149
  type: "text",
102
150
  placeholder: "Search",
@@ -114,53 +162,113 @@ var SearchPanelWidget = class {
114
162
  } else if (e.key === "Enter") {
115
163
  e.preventDefault();
116
164
  findNextMatch(false, true);
117
- } else if (e.key === "f" && isPrimaryModifier(e)) e.preventDefault();
165
+ } else if (isPrimaryModifier(e) && (e.key === "f" || e.code === "KeyF")) {
166
+ e.preventDefault();
167
+ applyMode(e.altKey ? "replace" : "find");
168
+ }
118
169
  }
119
170
  });
171
+ const searchTogglesElement = h("div", {
172
+ dataset: "searchToggles",
173
+ children: [
174
+ caseSensitiveToggle,
175
+ wholeWordToggle,
176
+ regexToggle
177
+ ]
178
+ });
179
+ const findInputBox = h("div", {
180
+ dataset: {
181
+ inputBox: "",
182
+ find: ""
183
+ },
184
+ children: [this.#inputElement, searchTogglesElement]
185
+ });
186
+ const replaceInputBox = h("div", {
187
+ dataset: {
188
+ inputBox: "",
189
+ replace: "",
190
+ replaceCell: ""
191
+ },
192
+ children: [replaceInputElement]
193
+ });
194
+ const replaceActionsElement = h("div", {
195
+ dataset: {
196
+ replaceActions: "",
197
+ replaceCell: ""
198
+ },
199
+ children: [h("div", {
200
+ dataset: { icon: "replace" },
201
+ title: "Replace",
202
+ innerHTML: getEditorIconSvg("replace"),
203
+ onclick: () => {
204
+ replace();
205
+ }
206
+ }), h("div", {
207
+ dataset: { icon: "replace-all" },
208
+ title: "Replace All",
209
+ innerHTML: getEditorIconSvg("replace-all"),
210
+ onclick: () => {
211
+ replaceAll();
212
+ }
213
+ })]
214
+ });
215
+ const navElement = h("div", {
216
+ dataset: "searchNav",
217
+ children: [
218
+ h("div", {
219
+ dataset: {
220
+ icon: "arrow-up",
221
+ disabled: "true"
222
+ },
223
+ title: "Previous",
224
+ innerHTML: getEditorIconSvg("arrow-up"),
225
+ onclick: () => {
226
+ findNextMatch(true);
227
+ }
228
+ }),
229
+ h("div", {
230
+ dataset: {
231
+ icon: "arrow-down",
232
+ disabled: "true"
233
+ },
234
+ title: "Next",
235
+ innerHTML: getEditorIconSvg("arrow-down"),
236
+ onclick: () => {
237
+ findNextMatch();
238
+ }
239
+ }),
240
+ h("div", {
241
+ dataset: { icon: "close" },
242
+ title: "Close",
243
+ innerHTML: getEditorIconSvg("close"),
244
+ onclick: close
245
+ })
246
+ ]
247
+ });
248
+ const gridElement = h("div", {
249
+ dataset: {
250
+ searchGrid: "",
251
+ mode
252
+ },
253
+ children: [
254
+ findInputBox,
255
+ matchResultElement,
256
+ navElement,
257
+ replaceInputBox,
258
+ replaceActionsElement
259
+ ]
260
+ });
261
+ const applyMode = (next) => {
262
+ gridElement.dataset.mode = next;
263
+ this.#inputElement.focus();
264
+ this.#inputElement.select();
265
+ };
266
+ this.#applyMode = applyMode;
120
267
  this.#container = h("div", {
121
- dataset: ["searchPanel", "editorWidget"],
268
+ dataset: "searchPanel",
122
269
  children: [h("div", {
123
- dataset: "searchPanelRow",
124
- children: [
125
- h("div", {
126
- dataset: { icon: "search" },
127
- innerHTML: getEditorIconSvg("search")
128
- }),
129
- this.#inputElement,
130
- matchResultElement,
131
- caseSensitiveToggle,
132
- wholeWordToggle,
133
- regexToggle,
134
- h("div", { dataset: "divider" }),
135
- h("div", {
136
- dataset: {
137
- icon: "arrow-up",
138
- disabled: "true"
139
- },
140
- title: "Previous",
141
- innerHTML: getEditorIconSvg("arrow-up"),
142
- onclick: () => {
143
- findNextMatch(true);
144
- }
145
- }),
146
- h("div", {
147
- dataset: {
148
- icon: "arrow-down",
149
- disabled: "true"
150
- },
151
- title: "Next",
152
- innerHTML: getEditorIconSvg("arrow-down"),
153
- onclick: () => {
154
- findNextMatch();
155
- }
156
- }),
157
- h("div", {
158
- dataset: { icon: "close" },
159
- title: "Close",
160
- innerHTML: getEditorIconSvg("close"),
161
- onclick: close
162
- })
163
- ]
270
+ dataset: "editorWidget",
271
+ children: [gridElement]
164
272
  })]
165
273
  });
166
274
  matches.current = initialMatch;
@@ -174,6 +282,12 @@ var SearchPanelWidget = class {
174
282
  focus() {
175
283
  this.#inputElement.focus();
176
284
  }
285
+ updateMatches(options) {
286
+ this.#updateMatches?.(options);
287
+ }
288
+ setMode(mode) {
289
+ this.#applyMode?.(mode);
290
+ }
177
291
  cleanup() {
178
292
  this.#container.remove();
179
293
  }
@@ -1 +1 @@
1
- {"version":3,"file":"searchPanel.js","names":["searchParams: SearchParams","#container","nextMatch: MatchRange | undefined","#inputElement"],"sources":["../../src/editor/searchPanel.ts"],"sourcesContent":["import { isPrimaryModifier } from './platform';\nimport { getEditorIconSvg, type SVGSpriteNames } from './sprite';\nimport type { TextDocument } from './textDocument';\nimport { h } from './utils';\n\nexport type MatchRange = [startOffset: number, endOffset: number];\n\nexport interface SearchParams {\n text: string;\n replaceText: string;\n caseSensitive: boolean;\n wholeWord: boolean;\n regex: boolean;\n}\n\nexport interface SearchPanelOptions {\n textDocument: TextDocument<unknown>;\n containerElement: HTMLElement;\n defaultQuery: string;\n initialMatch?: MatchRange;\n scrollToMatch: (nextMatch: MatchRange, retainFocus: boolean) => void;\n onUpdate: (matches: MatchRange[]) => MatchRange | undefined;\n onClose: () => void;\n}\n\nexport class SearchPanelWidget {\n #container: HTMLDivElement;\n #inputElement: HTMLInputElement;\n\n constructor(options: SearchPanelOptions) {\n const {\n textDocument,\n containerElement,\n defaultQuery,\n initialMatch,\n scrollToMatch,\n onUpdate,\n onClose,\n } = options;\n\n const searchParams: SearchParams = {\n text: defaultQuery,\n replaceText: '',\n caseSensitive: false,\n wholeWord: false,\n regex: false,\n };\n\n const matches = {\n all: [] as MatchRange[],\n current: undefined as MatchRange | undefined,\n };\n\n const matchResultElement = h('div', { dataset: 'matches' });\n const updateMatches = () => {\n matches.all =\n searchParams.text !== '' ? textDocument.search(searchParams) : [];\n this.#container\n .querySelectorAll<HTMLElement>('[data-disabled]')\n .forEach((element) => {\n element.dataset.disabled = String(matches.all.length === 0);\n });\n\n if (searchParams.text === '') {\n matchResultElement.textContent = '';\n delete matchResultElement.dataset.noMatches;\n return;\n }\n\n if (matches.all.length === 0) {\n matchResultElement.textContent = 'No results';\n matchResultElement.dataset.noMatches = '';\n } else {\n delete matchResultElement.dataset.noMatches;\n updateCurrentMatch(onUpdate(matches.all));\n return;\n }\n\n matches.current = undefined;\n onUpdate([]);\n };\n\n const updateCurrentMatch = (currentMatch: MatchRange | undefined) => {\n if (currentMatch === undefined) {\n matchResultElement.textContent = `${matches.all.length} results`;\n } else {\n const [start, end] = currentMatch;\n const index = matches.all.findIndex(\n (m) => m[0] === start && m[1] === end\n );\n matchResultElement.textContent = `${index + 1} of ${matches.all.length}`;\n }\n matches.current = currentMatch;\n };\n\n const updateSearchParam = <K extends keyof SearchParams>(\n key: K,\n value: SearchParams[K]\n ) => {\n searchParams[key] = value;\n updateMatches();\n };\n\n const findNextMatch = (\n findPrevious: boolean = false,\n retainFocus: boolean = false\n ) => {\n const allMatches = matches.all;\n let nextMatch: MatchRange | undefined = allMatches[0];\n if (allMatches.length > 0) {\n if (findPrevious) {\n const searchOffset = matches.current?.[0] ?? 0;\n nextMatch = allMatches.at(-1);\n for (const m of allMatches) {\n if (m[1] <= searchOffset) {\n nextMatch = m;\n } else {\n break;\n }\n }\n } else {\n const searchOffset = matches.current?.[1] ?? 0;\n for (const m of allMatches) {\n if (m[0] >= searchOffset) {\n nextMatch = m;\n break;\n }\n }\n }\n }\n if (nextMatch !== undefined) {\n updateCurrentMatch(nextMatch);\n scrollToMatch(nextMatch, retainFocus);\n }\n matches.current = nextMatch;\n };\n\n const close = () => {\n this.cleanup();\n onClose();\n };\n\n // Builds an always-visible icon button that toggles one boolean search\n // option (case/whole-word/regex). The button reflects its on/off state via\n // the `data-active` attribute so the stylesheet can highlight it.\n const makeToggle = (\n icon: SVGSpriteNames,\n title: string,\n key: 'caseSensitive' | 'wholeWord' | 'regex'\n ) => {\n const button = h('div', {\n dataset: { icon, active: String(searchParams[key]) },\n title,\n innerHTML: getEditorIconSvg(icon),\n onclick: () => {\n const next = !searchParams[key];\n button.dataset.active = String(next);\n updateSearchParam(key, next);\n },\n });\n return button;\n };\n\n const caseSensitiveToggle = makeToggle(\n 'case',\n 'Match Case',\n 'caseSensitive'\n );\n const wholeWordToggle = makeToggle('whole-word', 'Whole Word', 'wholeWord');\n const regexToggle = makeToggle('regex', 'Regexp', 'regex');\n\n this.#inputElement = h('input', {\n type: 'text',\n placeholder: 'Search',\n dataset: 'search',\n value: defaultQuery,\n oninput: (e: Event) => {\n searchParams.text = (e.target as HTMLInputElement).value;\n matches.current = undefined;\n updateMatches();\n },\n onkeydown: (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.preventDefault();\n close();\n } else if (e.key === 'Enter') {\n e.preventDefault();\n findNextMatch(false, true);\n } else if (e.key === 'f' && isPrimaryModifier(e)) {\n // prevent the default browser search panel open behavior\n e.preventDefault();\n }\n },\n });\n\n this.#container = h('div', {\n dataset: ['searchPanel', 'editorWidget'],\n children: [\n h('div', {\n dataset: 'searchPanelRow',\n children: [\n h('div', {\n dataset: { icon: 'search' },\n innerHTML: getEditorIconSvg('search'),\n }),\n this.#inputElement,\n matchResultElement,\n caseSensitiveToggle,\n wholeWordToggle,\n regexToggle,\n h('div', { dataset: 'divider' }),\n h('div', {\n dataset: { icon: 'arrow-up', disabled: 'true' },\n title: 'Previous',\n innerHTML: getEditorIconSvg('arrow-up'),\n onclick: () => {\n findNextMatch(true);\n },\n }),\n h('div', {\n dataset: { icon: 'arrow-down', disabled: 'true' },\n title: 'Next',\n innerHTML: getEditorIconSvg('arrow-down'),\n onclick: () => {\n findNextMatch();\n },\n }),\n h('div', {\n dataset: { icon: 'close' },\n title: 'Close',\n innerHTML: getEditorIconSvg('close'),\n onclick: close,\n }),\n ],\n }),\n ],\n });\n\n matches.current = initialMatch;\n containerElement.before(this.#container);\n\n requestAnimationFrame(() => {\n if (initialMatch !== undefined) {\n updateMatches();\n } else {\n onUpdate([]);\n }\n this.#inputElement.select();\n });\n }\n\n focus(): void {\n this.#inputElement.focus();\n }\n\n cleanup(): void {\n this.#container.remove();\n }\n}\n"],"mappings":";;;;;AAyBA,IAAa,oBAAb,MAA+B;CAC7B;CACA;CAEA,YAAY,SAA6B;EACvC,MAAM,EACJ,cACA,kBACA,cACA,cACA,eACA,UACA,YACE;EAEJ,MAAMA,eAA6B;GACjC,MAAM;GACN,aAAa;GACb,eAAe;GACf,WAAW;GACX,OAAO;GACR;EAED,MAAM,UAAU;GACd,KAAK,EAAE;GACP,SAAS;GACV;EAED,MAAM,qBAAqB,EAAE,OAAO,EAAE,SAAS,WAAW,CAAC;EAC3D,MAAM,sBAAsB;AAC1B,WAAQ,MACN,aAAa,SAAS,KAAK,aAAa,OAAO,aAAa,GAAG,EAAE;AACnE,SAAKC,UACF,iBAA8B,kBAAkB,CAChD,SAAS,YAAY;AACpB,YAAQ,QAAQ,WAAW,OAAO,QAAQ,IAAI,WAAW,EAAE;KAC3D;AAEJ,OAAI,aAAa,SAAS,IAAI;AAC5B,uBAAmB,cAAc;AACjC,WAAO,mBAAmB,QAAQ;AAClC;;AAGF,OAAI,QAAQ,IAAI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C1B,OAAO;MACP,WAAW,iBAAiB,QAAQ;MACpC,SAAS;MACV,CAAC;KACH;IACF,CAAC,CACH;GACF,CAAC;AAEF,UAAQ,UAAU;AAClB,mBAAiB,OAAO,MAAKF,UAAW;AAExC,8BAA4B;AAC1B,OAAI,iBAAiB,OACnB,gBAAe;OAEf,UAAS,EAAE,CAAC;AAEd,SAAKE,aAAc,QAAQ;IAC3B;;CAGJ,QAAc;AACZ,QAAKA,aAAc,OAAO;;CAG5B,UAAgB;AACd,QAAKF,UAAW,QAAQ"}
1
+ {"version":3,"file":"searchPanel.js","names":["searchParams: SearchParams","#container","options","#updateMatches","nextMatch: MatchRange | undefined","#inputElement","#applyMode"],"sources":["../../src/editor/searchPanel.ts"],"sourcesContent":["import { buildSearchReplacementText } from './pieceTable';\nimport { isPrimaryModifier } from './platform';\nimport { getEditorIconSvg, type SVGSpriteNames } from './sprite';\nimport type { ResolvedTextEdit, TextDocument } from './textDocument';\nimport { h } from './utils';\n\nexport type MatchRange = [startOffset: number, endOffset: number];\n\nexport type SearchPanelMode = 'find' | 'replace';\n\nexport interface SearchParams {\n text: string;\n replaceText: string;\n caseSensitive: boolean;\n wholeWord: boolean;\n regex: boolean;\n}\n\nexport interface SearchPanelOptions {\n textDocument: TextDocument<unknown>;\n containerElement: HTMLElement;\n defaultQuery: string;\n mode?: SearchPanelMode;\n initialMatch?: MatchRange;\n scrollToMatch: (nextMatch: MatchRange, retainFocus: boolean) => void;\n applyReplace: (edits: ResolvedTextEdit[]) => void;\n onUpdate: (\n matches: MatchRange[],\n options?: { syncSelection?: boolean }\n ) => MatchRange | undefined;\n onClose: () => void;\n}\n\nexport class SearchPanelWidget {\n #container: HTMLDivElement;\n #inputElement: HTMLInputElement;\n #updateMatches?: (options?: { syncSelection?: boolean }) => void;\n #applyMode?: (mode: SearchPanelMode) => void;\n\n constructor(options: SearchPanelOptions) {\n const {\n textDocument,\n containerElement,\n defaultQuery,\n mode = 'find',\n initialMatch,\n scrollToMatch,\n applyReplace,\n onUpdate,\n onClose,\n } = options;\n\n const searchParams: SearchParams = {\n text: defaultQuery,\n replaceText: '',\n caseSensitive: false,\n wholeWord: false,\n regex: false,\n };\n\n const matches = {\n all: [] as MatchRange[],\n current: undefined as MatchRange | undefined,\n };\n\n // Default to the empty-query \"no results\" state so it shows on open before\n // any search runs.\n const matchResultElement = h('div', {\n dataset: { matches: '', noMatches: '' },\n textContent: 'No results',\n });\n const updateMatches = (options?: { syncSelection?: boolean }) => {\n matches.all =\n searchParams.text !== '' ? textDocument.search(searchParams) : [];\n this.#container\n .querySelectorAll<HTMLElement>('[data-icon][data-disabled]')\n .forEach((element) => {\n element.dataset.disabled = String(matches.all.length === 0);\n });\n\n if (searchParams.text === '') {\n matchResultElement.textContent = 'No results';\n matchResultElement.dataset.noMatches = '';\n return;\n }\n\n if (matches.all.length === 0) {\n matchResultElement.textContent = 'No results';\n matchResultElement.dataset.noMatches = '';\n matches.current = undefined;\n onUpdate([]);\n return;\n }\n\n delete matchResultElement.dataset.noMatches;\n if (options?.syncSelection === false) {\n const currentMatch = onUpdate(matches.all, { syncSelection: false });\n updateCurrentMatch(currentMatch);\n return;\n }\n\n updateCurrentMatch(onUpdate(matches.all));\n };\n this.#updateMatches = updateMatches;\n\n const updateCurrentMatch = (currentMatch: MatchRange | undefined) => {\n if (currentMatch === undefined) {\n matchResultElement.textContent = `${matches.all.length} results`;\n } else {\n const [start, end] = currentMatch;\n const index = matches.all.findIndex(\n (m) => m[0] === start && m[1] === end\n );\n matchResultElement.textContent = `${index + 1} of ${matches.all.length}`;\n }\n matches.current = currentMatch;\n };\n\n const updateSearchParam = <K extends keyof SearchParams>(\n key: K,\n value: SearchParams[K]\n ) => {\n searchParams[key] = value;\n updateMatches();\n };\n\n const findNextMatch = (\n findPrevious: boolean = false,\n retainFocus: boolean = false\n ) => {\n const allMatches = matches.all;\n let nextMatch: MatchRange | undefined = allMatches[0];\n if (allMatches.length > 0) {\n if (findPrevious) {\n const searchOffset = matches.current?.[0] ?? 0;\n nextMatch = allMatches.at(-1);\n for (const m of allMatches) {\n if (m[1] <= searchOffset) {\n nextMatch = m;\n } else {\n break;\n }\n }\n } else {\n const searchOffset = matches.current?.[1] ?? 0;\n for (const m of allMatches) {\n if (m[0] >= searchOffset) {\n nextMatch = m;\n break;\n }\n }\n }\n }\n if (nextMatch !== undefined) {\n updateCurrentMatch(nextMatch);\n scrollToMatch(nextMatch, retainFocus);\n }\n matches.current = nextMatch;\n };\n\n const buildReplacementEdit = (\n matchStart: number,\n matchEnd: number\n ): ResolvedTextEdit => ({\n start: matchStart,\n end: matchEnd,\n text: buildSearchReplacementText(\n (offset) => textDocument.positionAt(offset),\n (position) => textDocument.offsetAt(position),\n (line) => textDocument.getLineText(line),\n searchParams,\n matchStart,\n matchEnd\n ),\n });\n\n const replace = () => {\n if (searchParams.text === '' || matches.all.length === 0) {\n return;\n }\n\n let currentMatch = matches.current;\n if (currentMatch === undefined) {\n findNextMatch(false, true);\n currentMatch = matches.current;\n if (currentMatch === undefined) {\n return;\n }\n }\n\n const [start, end] = currentMatch;\n const edit = buildReplacementEdit(start, end);\n applyReplace([edit]);\n\n // Collapse after the replacement so the next search pass advances.\n scrollToMatch([start + edit.text.length, start + edit.text.length], true);\n matches.current = undefined;\n updateMatches();\n };\n\n const replaceAll = () => {\n if (searchParams.text === '' || matches.all.length === 0) {\n return;\n }\n\n applyReplace(\n matches.all.map(([start, end]) => buildReplacementEdit(start, end))\n );\n matches.current = undefined;\n updateMatches();\n };\n\n const close = () => {\n this.cleanup();\n onClose();\n };\n\n // Builds an always-visible icon button that toggles one boolean search\n // option (case/whole-word/regex). The button reflects its on/off state via\n // the `data-active` attribute so the stylesheet can highlight it.\n const makeToggle = (\n icon: SVGSpriteNames,\n title: string,\n key: 'caseSensitive' | 'wholeWord' | 'regex'\n ) => {\n const button = h('div', {\n dataset: { icon, active: String(searchParams[key]) },\n title,\n innerHTML: getEditorIconSvg(icon),\n onclick: () => {\n const next = !searchParams[key];\n button.dataset.active = String(next);\n updateSearchParam(key, next);\n },\n });\n return button;\n };\n\n const caseSensitiveToggle = makeToggle(\n 'case',\n 'Match Case',\n 'caseSensitive'\n );\n const wholeWordToggle = makeToggle('whole-word', 'Whole Word', 'wholeWord');\n const regexToggle = makeToggle('regex', 'Regexp', 'regex');\n\n const replaceInputElement = h('input', {\n type: 'text',\n placeholder: 'Replace',\n dataset: 'replace',\n value: '',\n oninput: (e: Event) => {\n searchParams.replaceText = (e.target as HTMLInputElement).value;\n },\n });\n\n this.#inputElement = h('input', {\n type: 'text',\n placeholder: 'Search',\n dataset: 'search',\n value: defaultQuery,\n oninput: (e: Event) => {\n searchParams.text = (e.target as HTMLInputElement).value;\n matches.current = undefined;\n updateMatches();\n },\n onkeydown: (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.preventDefault();\n close();\n } else if (e.key === 'Enter') {\n e.preventDefault();\n findNextMatch(false, true);\n } else if (\n isPrimaryModifier(e) &&\n (e.key === 'f' || e.code === 'KeyF')\n ) {\n // Prevent the default browser search panel and switch the panel mode\n // in place (cmd+f -> find, cmd+opt+f -> find/replace).\n e.preventDefault();\n applyMode(e.altKey ? 'replace' : 'find');\n }\n },\n });\n\n // The three search-option toggles are overlaid on the right edge of the\n // find input instead of sitting beside it.\n const searchTogglesElement = h('div', {\n dataset: 'searchToggles',\n children: [caseSensitiveToggle, wholeWordToggle, regexToggle],\n });\n\n const findInputBox = h('div', {\n dataset: { inputBox: '', find: '' },\n children: [this.#inputElement, searchTogglesElement],\n });\n\n // The replace input and its action buttons are tagged as replace cells so\n // they can be hidden together when the panel is in find-only mode.\n const replaceInputBox = h('div', {\n dataset: { inputBox: '', replace: '', replaceCell: '' },\n children: [replaceInputElement],\n });\n\n const replaceActionsElement = h('div', {\n dataset: { replaceActions: '', replaceCell: '' },\n children: [\n h('div', {\n dataset: { icon: 'replace' },\n title: 'Replace',\n innerHTML: getEditorIconSvg('replace'),\n onclick: () => {\n replace();\n },\n }),\n h('div', {\n dataset: { icon: 'replace-all' },\n title: 'Replace All',\n innerHTML: getEditorIconSvg('replace-all'),\n onclick: () => {\n replaceAll();\n },\n }),\n ],\n });\n\n const navElement = h('div', {\n dataset: 'searchNav',\n children: [\n h('div', {\n dataset: { icon: 'arrow-up', disabled: 'true' },\n title: 'Previous',\n innerHTML: getEditorIconSvg('arrow-up'),\n onclick: () => {\n findNextMatch(true);\n },\n }),\n h('div', {\n dataset: { icon: 'arrow-down', disabled: 'true' },\n title: 'Next',\n innerHTML: getEditorIconSvg('arrow-down'),\n onclick: () => {\n findNextMatch();\n },\n }),\n h('div', {\n dataset: { icon: 'close' },\n title: 'Close',\n innerHTML: getEditorIconSvg('close'),\n onclick: close,\n }),\n ],\n });\n\n // A 2x2 grid of inputs (find/replace) and their trailing content (results\n // text / replace actions), with the find navigation buttons in a third\n // column on the first row. DOM order drives grid auto-placement:\n // row 1: find input | results text | nav buttons\n // row 2: replace input | replace actions\n const gridElement = h('div', {\n dataset: { searchGrid: '', mode },\n children: [\n findInputBox,\n matchResultElement,\n navElement,\n replaceInputBox,\n replaceActionsElement,\n ],\n });\n\n // Toggles the panel between find and find/replace modes by showing or\n // hiding the replace cells, then returns focus to the find input.\n const applyMode = (next: SearchPanelMode) => {\n gridElement.dataset.mode = next;\n this.#inputElement.focus();\n this.#inputElement.select();\n };\n this.#applyMode = applyMode;\n\n this.#container = h('div', {\n dataset: 'searchPanel',\n children: [\n h('div', {\n dataset: 'editorWidget',\n children: [gridElement],\n }),\n ],\n });\n\n matches.current = initialMatch;\n containerElement.before(this.#container);\n\n requestAnimationFrame(() => {\n if (initialMatch !== undefined) {\n updateMatches();\n } else {\n onUpdate([]);\n }\n this.#inputElement.select();\n });\n }\n\n focus(): void {\n this.#inputElement.focus();\n }\n\n updateMatches(options?: { syncSelection?: boolean }): void {\n this.#updateMatches?.(options);\n }\n\n setMode(mode: SearchPanelMode): void {\n this.#applyMode?.(mode);\n }\n\n cleanup(): void {\n this.#container.remove();\n }\n}\n"],"mapp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A;IACA;IACA;IACA;IACD;GACF,CAAC;EAIF,MAAM,aAAa,SAA0B;AAC3C,eAAY,QAAQ,OAAO;AAC3B,SAAKA,aAAc,OAAO;AAC1B,SAAKA,aAAc,QAAQ;;AAE7B,QAAKC,YAAa;AAElB,QAAKL,YAAa,EAAE,OAAO;GACzB,SAAS;GACT,UAAU,CACR,EAAE,OAAO;IACP,SAAS;IACT,UAAU,CAAC,YAAY;IACxB,CAAC,CACH;GACF,CAAC;AAEF,UAAQ,UAAU;AAClB,mBAAiB,OAAO,MAAKA,UAAW;AAExC,8BAA4B;AAC1B,OAAI,iBAAiB,OACnB,gBAAe;OAEf,UAAS,EAAE,CAAC;AAEd,SAAKI,aAAc,QAAQ;IAC3B;;CAGJ,QAAc;AACZ,QAAKA,aAAc,OAAO;;CAG5B,cAAc,SAA6C;AACzD,QAAKF,gBAAiB,QAAQ;;CAGhC,QAAQ,MAA6B;AACnC,QAAKG,YAAa,KAAK;;CAGzB,UAAgB;AACd,QAAKL,UAAW,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"selection.d.ts","names":["DiffLineAnnotation","Position","Range","ResolvedTextEdit","TextDocument","TextDocumentChange","TextEdit","DirectionBackward","DirectionNone","DirectionForward","SelectionDirection","EditorSelection","convertSelection","StaticRange","resolveIndentEdits","mapCursorMove","mapSelectionShift","applyTextChangeToSelections","LAnnotation","applyTextReplaceToSelections","applyTransposeToSelections","applyDeleteHardLineForwardToSelections","applyDeleteSoftLineBackwardToSelections","applyDeleteWordBackwardToSelections","isCollapsedSelection","getCaretPosition","isLineEditable","selectionIntersects","comparePosition","createSelectionFromAnchorAndFocusOffsets","createSelectionFrom","extendSelection","extendSelections","mergeOverlappingSelections","findNexMatch","getDocumentFullSelection","getDocumentBoundarySelection","getSelectionText","getSelectionAnchor","HTMLElement","Node","expandCollapsedSelectionToWord"],"sources":["../../src/editor/selection.d.ts"],"sourcesContent":["import type { DiffLineAnnotation } from '../types';\nimport type { Position, Range, ResolvedTextEdit, TextDocument, TextDocumentChange, TextEdit } from './textDocument';\nexport declare const DirectionBackward = -1;\nexport declare const DirectionNone = 0;\nexport declare const DirectionForward = 1;\nexport type SelectionDirection = typeof DirectionBackward | typeof DirectionNone | typeof DirectionForward;\nexport interface EditorSelection extends Range {\n direction: SelectionDirection;\n}\n/**\n * Converts a selection from a web selection to an editor selection.\n */\nexport declare function convertSelection(range: StaticRange, direction?: SelectionDirection): EditorSelection | undefined;\n/**\n * Resolves the indent edits for a selection.\n */\nexport declare function resolveIndentEdits(textDocument: TextDocument<unknown>, selection: EditorSelection, tabSize: number, outdent: boolean): [edits: TextEdit[], nextSelection: EditorSelection];\n/**\n * Maps the cursor move to all selections.\n */\nexport declare function mapCursorMove(textDocument: TextDocument<unknown>, selections: EditorSelection[], shortcut: 'textStart' | 'start' | 'end' | 'up' | 'down' | 'left' | 'right'): EditorSelection[];\n/**\n * Same as mapCursorMove, but with shift key pressed.\n */\nexport declare function mapSelectionShift(textDocument: TextDocument<unknown>, selections: EditorSelection[], shortcut: 'textStart' | 'start' | 'end' | 'up' | 'down' | 'left' | 'right'): EditorSelection[];\n/**\n * Applies a text change to the given text document\n */\nexport declare function applyTextChangeToSelections<LAnnotation>(textDocument: TextDocument<LAnnotation>, selections: EditorSelection[], edit: ResolvedTextEdit, lineAnnotations?: DiffLineAnnotation<LAnnotation>[], tabSize?: number): {\n nextSelections: EditorSelection[];\n change?: TextDocumentChange;\n};\n/**\n * Applies a text replace to multiple selections.\n */\nexport declare function applyTextReplaceToSelections<LAnnotation>(textDocument: TextDocument<LAnnotation>, selections: EditorSelection[], texts: string[], lineAnnotations?: DiffLineAnnotation<LAnnotation>[]): {\n nextSelections: EditorSelection[];\n change?: TextDocumentChange;\n};\n/**\n * Swaps the two characters adjacent to a collapsed selection, matching browser\n * insertTranspose (Ctrl+T) behavior.\n */\nexport declare function applyTransposeToSelections<LAnnotation>(textDocument: TextDocument<LAnnotation>, selections: EditorSelection[], lineAnnotations?: DiffLineAnnotation<LAnnotation>[]): {\n nextSelections: EditorSelection[];\n change?: TextDocumentChange;\n};\n/**\n * Deletes from each selection to the end of its line, including the line break\n * when the caret is already at the end of a non-final line. Non-collapsed\n * selections delete their selected text instead.\n */\nexport declare function applyDeleteHardLineForwardToSelections<LAnnotation>(textDocument: TextDocument<LAnnotation>, selections: EditorSelection[], lineAnnotations?: DiffLineAnnotation<LAnnotation>[]): {\n nextSelections: EditorSelection[];\n change?: TextDocumentChange;\n};\n/**\n * Deletes from each selection back to the start of its soft (visual) line.\n * Non-collapsed selections delete their selected text instead.\n */\nexport declare function applyDeleteSoftLineBackwardToSelections<LAnnotation>(textDocument: TextDocument<LAnnotation>, selections: EditorSelection[], getSoftLineStart?: (line: number, character: number) => number, lineAnnotations?: DiffLineAnnotation<LAnnotation>[]): {\n nextSelections: EditorSelection[];\n change?: TextDocumentChange;\n};\n/**\n * Deletes the word or separator group immediately before each selection.\n * Non-collapsed selections delete their selected text instead.\n */\nexport declare function applyDeleteWordBackwardToSelections<LAnnotation>(textDocument: TextDocument<LAnnotation>, selections: EditorSelection[], lineAnnotations?: DiffLineAnnotation<LAnnotation>[]): {\n nextSelections: EditorSelection[];\n change?: TextDocumentChange;\n};\n/**\n * Checks if a selection is collapsed.\n */\nexport declare function isCollapsedSelection(selection: EditorSelection | Range): boolean;\n/**\n * Returns the caret (focus) position for a selection.\n */\nexport declare function getCaretPosition(selection: EditorSelection): Position;\n/**\n * Checks if a line is editable.\n */\nexport declare function isLineEditable(lineType: string): boolean;\n/**\n * Checks whether selections `a` and `b` intersect.\n */\nexport declare function selectionIntersects(a: EditorSelection | Range, b: EditorSelection | Range): boolean;\n/**\n * Compares two positions.\n */\nexport declare function comparePosition(a: Position, b: Position): number;\n/**\n * Creates a selection from anchor and focus offsets.\n */\nexport declare function createSelectionFromAnchorAndFocusOffsets(textDocument: TextDocument<unknown>, anchorOffset: number, focusOffset: number): EditorSelection;\n/**\n * Creates a selection from a anchor and focus selection.\n */\nexport declare function createSelectionFrom(anchorSelection: EditorSelection, focusSelection: EditorSelection): EditorSelection;\n/**\n * Extends or shrinks the selection `original` using the endpoints of `target`, \\\n * matching contenteditable shift + click extend behavior.\n */\nexport declare function extendSelection(original: EditorSelection, target: EditorSelection): EditorSelection;\n/**\n * Extends multiple selections.\n */\nexport declare function extendSelections(selections: EditorSelection[], target: EditorSelection): EditorSelection[];\n/**\n * Merges overlapping selections.\n */\nexport declare function mergeOverlappingSelections(selections: EditorSelection[]): EditorSelection[];\n/**\n * Finds the next matching word and updates the selections.\n */\nexport declare function findNexMatch(textDocument: TextDocument<unknown>, selections: EditorSelection[]): EditorSelection[] | undefined;\n/**\n * Get the full selection of the document.\n */\nexport declare function getDocumentFullSelection(textDocument: TextDocument<unknown>): EditorSelection;\n/**\n * Get the boundary selection of the document.\n */\nexport declare function getDocumentBoundarySelection(textDocument: TextDocument<unknown>, atEnd: boolean): EditorSelection;\n/**\n * Get the text of the selections for the given text document.\n */\nexport declare function getSelectionText(textDocument: TextDocument<unknown>, selections: EditorSelection[]): string;\n/**\n * Get the anchor node and offset for a selection.\n */\nexport declare function getSelectionAnchor(lineElement: HTMLElement, character: number): [Node, number];\n/**\n * Expands a zero-width selection to the word-like segment that contains the caret.\n */\nexport declare function expandCollapsedSelectionToWord(textDocument: TextDocument<unknown>, selection: EditorSelection): EditorSelection;\n//# sourceMappingURL=selection.d.ts.map"],"mappings":";;;;cAEqBO,iBAAAA;cACAC,aAAAA;AADAD,cAEAE,gBAAAA,GAFiB,CAAA;AACjBD,KAETE,kBAAAA,GAFsB,OAEMH,iBAFN,GAAA,OAEiCC,aAFjC,GAAA,OAEwDC,gBAFxD;AACbA,UAEJE,eAAAA,SAAwBT,KAFJ,CAAA;EACzBQ,SAAAA,EAEGA,kBAFe;;;;;AACbC,iBAMOC,gBAAAA,CALTF,KAAAA,EAKiCG,WANPX,EAAK,SAAA,CAAA,EAM2BQ,kBAN3B,CAAA,EAMgDC,eANhD,GAAA,SAAA;AAM9C;;;AAA8FA,iBA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KlCA,eALkC;AAK/H;;;AAA6FA,iBAIrEqB,gBAAAA,CAJqErB,UAAAA,EAIxCA,eAJwCA,EAAAA,EAAAA,MAAAA,EAIbA,eAJaA,CAAAA,EAIKA,eAJLA,EAAAA;;AAI7F;;AAAgFA,iBAIxDsB,0BAAAA,CAJwDtB,UAAAA,EAIjBA,eAJiBA,EAAAA,CAAAA,EAIGA,eAJHA,EAAAA;;;AAIhF;AAIwBuB,iBAAAA,YAAAA,CAAY,YAAA,EAAe9B,YAAf,CAAA,OAAA,CAAA,EAAA,UAAA,EAAkDO,eAAlD,EAAA,CAAA,EAAsEA,eAAtE,EAAA,GAAA,SAAA;;;;AAAqF,iBAIjGwB,wBAAAA,CAJiG,YAAA,EAI1D/B,YAJ0D,CAAA,OAAA,CAAA,CAAA,EAIlCO,eAJkC;AAIzH;AAIA;AAIA;AAIwB2B,iBARAF,4BAAAA,CAQkEI,YAAI,EAR3BpC,YAQ2B,CAAA,OAAA,CAAA,EAAA,KAAA,EAAA,OAAA,CAAA,EARaO,eAQb;AAI9F;;;AAAyHA,iBARjG0B,gBAAAA,CAQiG1B,YAAAA,EARlEP,YAQkEO,CAAAA,OAAAA,CAAAA,EAAAA,UAAAA,EAR/BA,eAQ+BA,EAAAA,CAAAA,EAAAA,MAAAA;;;;iBAJjG2B,kBAAAA,cAAgCC,kCAAkCC;;;;iBAIlEC,8BAAAA,eAA6CrC,kCAAkCO,kBAAkBA"}
1
+ {"version":3,"file":"selection.d.ts","names":["DiffLineAnnotation","Position","Range","ResolvedTextEdit","TextDocument","TextDocumentChange","TextEdit","DirectionBackward","DirectionNone","DirectionForward","SelectionDirection","EditorSelection","convertSelection","StaticRange","resolveIndentEdits","mapCursorMove","mapSelectionShift","applyTextChangeToSelections","LAnnotation","applyTextReplaceToSelections","applyTransposeToSelections","applyDeleteHardLineForwardToSelections","applyDeleteSoftLineBackwardToSelections","applyDeleteWordBackwardToSelections","isCollapsedSelection","getCaretPosition","isLineEditable","selectionIntersects","comparePosition","createSelectionFromAnchorAndFocusOffsets","createSelectionFrom","extendSelection","extendSelections","mergeOverlappingSelections","findNexMatch","getDocumentFullSelection","getDocumentBoundarySelection","getSelectionText","getSelectionAnchor","HTMLElement","Node","expandCollapsedSelectionToWord"],"sources":["../../src/editor/selection.d.ts"],"sourcesContent":["import type { DiffLineAnnotation } from '../types';\nimport type { Position, Range, ResolvedTextEdit, TextDocument, TextDocumentChange, TextEdit } from './textDocument';\nexport declare const DirectionBackward = -1;\nexport declare const DirectionNone = 0;\nexport declare const DirectionForward = 1;\nexport type SelectionDirection = typeof DirectionBackward | typeof DirectionNone | typeof DirectionForward;\nexport interface EditorSelection extends Range {\n direction: SelectionDirection;\n}\n/**\n * Converts a selection from a web selection to an editor selection.\n */\nexport declare function convertSelection(range: StaticRange, direction?: SelectionDirection): EditorSelection | undefined;\n/**\n * Resolves the indent edits for a selection.\n */\nexport declare function resolveIndentEdits(textDocument: TextDocument<unknown>, selection: EditorSelection, tabSize: number, outdent: boolean): [edits: TextEdit[], nextSelection: EditorSelection];\n/**\n * Maps the cursor move to all selections.\n */\nexport declare function mapCursorMove(textDocument: TextDocument<unknown>, selections: EditorSelection[], shortcut: 'textStart' | 'start' | 'end' | 'up' | 'down' | 'left' | 'right'): EditorSelection[];\n/**\n * Same as mapCursorMove, but with shift key pressed.\n */\nexport declare function mapSelectionShift(textDocument: TextDocument<unknown>, selections: EditorSelection[], shortcut: 'textStart' | 'start' | 'end' | 'up' | 'down' | 'left' | 'right'): EditorSelection[];\n/**\n * Applies a text change to the given text document\n */\nexport declare function applyTextChangeToSelections<LAnnotation>(textDocument: TextDocument<LAnnotation>, selections: EditorSelection[], edit: ResolvedTextEdit, lineAnnotations?: DiffLineAnnotation<LAnnotation>[], tabSize?: number): {\n nextSelections: EditorSelection[];\n change?: TextDocumentChange;\n};\n/**\n * Applies a text replace to multiple selections.\n */\nexport declare function applyTextReplaceToSelections<LAnnotation>(textDocument: TextDocument<LAnnotation>, selections: EditorSelection[], texts: string[], lineAnnotations?: DiffLineAnnotation<LAnnotation>[]): {\n nextSelections: EditorSelection[];\n change?: TextDocumentChange;\n};\n/**\n * Swaps the two characters adjacent to a collapsed selection, matching browser\n * insertTranspose (Ctrl+T) behavior.\n */\nexport declare function applyTransposeToSelections<LAnnotation>(textDocument: TextDocument<LAnnotation>, selections: EditorSelection[], lineAnnotations?: DiffLineAnnotation<LAnnotation>[]): {\n nextSelections: EditorSelection[];\n change?: TextDocumentChange;\n};\n/**\n * Deletes from each selection to the end of its line, including the line break\n * when the caret is already at the end of a non-final line. Non-collapsed\n * selections delete their selected text instead.\n */\nexport declare function applyDeleteHardLineForwardToSelections<LAnnotation>(textDocument: TextDocument<LAnnotation>, selections: EditorSelection[], lineAnnotations?: DiffLineAnnotation<LAnnotation>[]): {\n nextSelections: EditorSelection[];\n change?: TextDocumentChange;\n};\n/**\n * Deletes from each selection back to the start of its soft (visual) line.\n * Non-collapsed selections delete their selected text instead.\n */\nexport declare function applyDeleteSoftLineBackwardToSelections<LAnnotation>(textDocument: TextDocument<LAnnotation>, selections: EditorSelection[], getSoftLineStart?: (line: number, character: number) => number, lineAnnotations?: DiffLineAnnotation<LAnnotation>[]): {\n nextSelections: EditorSelection[];\n change?: TextDocumentChange;\n};\n/**\n * Deletes the word or separator group immediately before each selection.\n * Non-collapsed selections delete their selected text instead.\n */\nexport declare function applyDeleteWordBackwardToSelections<LAnnotation>(textDocument: TextDocument<LAnnotation>, selections: EditorSelection[], lineAnnotations?: DiffLineAnnotation<LAnnotation>[]): {\n nextSelections: EditorSelection[];\n change?: TextDocumentChange;\n};\n/**\n * Checks if a selection is collapsed.\n */\nexport declare function isCollapsedSelection(selection: EditorSelection | Range): boolean;\n/**\n * Returns the caret (focus) position for a selection.\n */\nexport declare function getCaretPosition(selection: EditorSelection): Position;\n/**\n * Checks if a line is editable.\n */\nexport declare function isLineEditable(lineType: string): boolean;\n/**\n * Checks whether selections `a` and `b` intersect.\n */\nexport declare function selectionIntersects(a: EditorSelection | Range, b: EditorSelection | Range): boolean;\n/**\n * Compares two positions.\n */\nexport declare function comparePosition(a: Position, b: Position): number;\n/**\n * Creates a selection from anchor and focus offsets.\n */\nexport declare function createSelectionFromAnchorAndFocusOffsets(textDocument: TextDocument<unknown>, anchorOffset: number, focusOffset: number): EditorSelection;\n/**\n * Creates a selection from a anchor and focus selection.\n */\nexport declare function createSelectionFrom(anchorSelection: EditorSelection, focusSelection: EditorSelection): EditorSelection;\n/**\n * Extends or shrinks the selection `original` using the endpoints of `target`, \\\n * matching contenteditable shift + click extend behavior.\n */\nexport declare function extendSelection(original: EditorSelection, target: EditorSelection): EditorSelection;\n/**\n * Extends multiple selections.\n */\nexport declare function extendSelections(selections: EditorSelection[], target: EditorSelection): EditorSelection[];\n/**\n * Merges overlapping selections.\n */\nexport declare function mergeOverlappingSelections(selections: EditorSelection[]): EditorSelection[];\n/**\n * Finds the next matching word and updates the selections.\n */\nexport declare function findNexMatch(textDocument: TextDocument<unknown>, selections: EditorSelection[]): EditorSelection[] | undefined;\n/**\n * Get the full selection of the document.\n */\nexport declare function getDocumentFullSelection(textDocument: TextDocument<unknown>): EditorSelection;\n/**\n * Get the boundary selection of the document.\n */\nexport declare function getDocumentBoundarySelection(textDocument: TextDocument<unknown>, atEnd: boolean): EditorSelection;\n/**\n * Get the text of the selections for the given text document.\n */\nexport declare function getSelectionText(textDocument: TextDocument<unknown>, selections: EditorSelection[]): string;\n/**\n * Get the anchor node and offset for a selection.\n */\nexport declare function getSelectionAnchor(lineElement: HTMLElement, character: number): [Node, number];\n/**\n * Expands a zero-width selection to the word-like segment that contains the caret.\n */\nexport declare function expandCollapsedSelectionToWord(textDocument: TextDocument<unknown>, selection: EditorSelection): EditorSelection;\n//# sourceMappingURL=selection.d.ts.map"],"mappings":";;;;cAEqBO,iBAAAA;cACAC,aAAAA;AADAD,cAEAE,gBAAAA,GAFiB,CAAA;AACjBD,KAETE,kBAAAA,GAFsB,OAEMH,iBAFN,GAAA,OAEiCC,aAFj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' | 'regex' | 'search' | 'whole-word';
3
- declare const SVGSpriteSheet = "<svg data-icon-sprite aria-hidden=\"true\" width=\"0\" height=\"0\">\n <symbol id=\"diffs-editor-icon-search\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M10.7747 12.8961C9.68558 13.5948 8.39011 14 7 14C3.13401 14 0 10.866 0 7C0 3.13401 3.13401 0 7 0C10.866 0 14 3.13401 14 7C14 8.39011 13.5948 9.68558 12.8961 10.7747L15.5607 13.4393C16.1464 14.0251 16.1464 14.9749 15.5607 15.5607C14.9749 16.1464 14.0251 16.1464 13.4393 15.5607L10.7747 12.8961ZM7 1.5C10.0376 1.5 12.5 3.96243 12.5 7C12.5 10.0376 10.0376 12.5 7 12.5C3.96243 12.5 1.5 10.0376 1.5 7C1.5 3.96243 3.96243 1.5 7 1.5Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-close\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" d=\"M3.21967 3.21967C3.51256 2.92678 3.98744 2.92678 4.28033 3.21967L8 6.93934L11.7197 3.21967C12.0126 2.92678 12.4874 2.92678 12.7803 3.21967C13.0732 3.51256 13.0732 3.98744 12.7803 4.28033L9.06066 8L12.7803 11.7197C13.0732 12.0126 13.0732 12.4874 12.7803 12.7803C12.4874 13.0732 12.0126 13.0732 11.7197 12.7803L8 9.06066L4.28033 12.7803C3.98744 13.0732 3.51256 13.0732 3.21967 12.7803C2.92678 12.4874 2.92678 12.0126 3.21967 11.7197L6.93934 8L3.21967 4.28033C2.92678 3.98744 2.92678 3.51256 3.21967 3.21967Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-arrow-up\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" transform=\"rotate(-90 8 8)\" d=\"M8.46967 4.21967C8.17678 4.51256 8.17678 4.98744 8.46967 5.28033L10.4393 7.25H3.75C3.33579 7.25 3 7.58579 3 8C3 8.41421 3.33579 8.75 3.75 8.75H10.4393L8.46967 10.7197C8.17678 11.0126 8.17678 11.4874 8.46967 11.7803C8.76256 12.0732 9.23744 12.0732 9.53033 11.7803L12.7803 8.53033C13.0732 8.23744 13.0732 7.76256 12.7803 7.46967L9.53033 4.21967C9.23744 3.92678 8.76256 3.92678 8.46967 4.21967Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-arrow-down\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" transform=\"rotate(90 8 8)\" d=\"M8.46967 4.21967C8.17678 4.51256 8.17678 4.98744 8.46967 5.28033L10.4393 7.25H3.75C3.33579 7.25 3 7.58579 3 8C3 8.41421 3.33579 8.75 3.75 8.75H10.4393L8.46967 10.7197C8.17678 11.0126 8.17678 11.4874 8.46967 11.7803C8.76256 12.0732 9.23744 12.0732 9.53033 11.7803L12.7803 8.53033C13.0732 8.23744 13.0732 7.76256 12.7803 7.46967L9.53033 4.21967C9.23744 3.92678 8.76256 3.92678 8.46967 4.21967Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-case\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" d=\"M12.2969 12.9969C10.7109 12.9969 9.61719 12.0125 9.61719 10.5047C9.61719 9.06719 10.6172 8.16094 12.5 8.15312H14.6641V7.31719C14.6641 6.23906 14.0391 5.64531 12.9297 5.64531C11.875 5.64531 11.2734 6.18437 11.1953 7.00469H9.92969C10.0156 5.56719 10.9922 4.52031 12.9766 4.52031C14.7266 4.52031 16 5.47344 16 7.2V12.8641H14.7109V11.8406H14.6719C14.2578 12.5047 13.5078 12.9969 12.2969 12.9969ZM12.6562 11.8797C13.8047 11.8797 14.6641 11.1609 14.6641 10.1375V9.18437H12.6016C11.4766 9.18437 10.9922 9.71562 10.9922 10.4578C10.9922 11.4266 11.7969 11.8797 12.6562 11.8797Z\"></path>\n <path fill=\"currentColor\" d=\"M1.42188 12.8641H0L3.79688 2H5.1875L8.98438 12.8641H7.54688L6.46875 9.66094H2.5L1.42188 12.8641ZM4.50781 3.60938H4.46875L2.86719 8.55937H6.10156L4.50781 3.60938Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-whole-word\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" d=\"M11.4089 9.99449C11.1417 9.99449 10.8961 9.95595 10.6722 9.87887C10.4519 9.80179 10.2605 9.69167 10.098 9.54852C9.93551 9.40537 9.81453 9.23469 9.73508 9.03648H9.67007V9.91191H8.5V2H9.70258V5.01721H9.76758C9.81092 4.86671 9.88314 4.7309 9.98426 4.60977C10.089 4.48497 10.2136 4.37853 10.358 4.29043C10.5025 4.19867 10.6668 4.13076 10.851 4.08672C11.0352 4.039 11.2302 4.01514 11.436 4.01514C11.8802 4.01514 12.2648 4.11792 12.5898 4.32347C12.9149 4.52535 13.164 4.81532 13.3374 5.19339C13.5107 5.57146 13.5974 6.02478 13.5974 6.55334V7.45079C13.5974 7.97568 13.5089 8.429 13.332 8.81074C13.1586 9.1888 12.9076 9.48061 12.579 9.68617C12.2504 9.89172 11.8604 9.99449 11.4089 9.99449ZM11.0785 8.99243C11.353 8.99243 11.5859 8.92636 11.7773 8.79422C11.9723 8.66208 12.1204 8.46937 12.2215 8.2161C12.3226 7.95916 12.3732 7.65267 12.3732 7.29663V6.73503C12.3732 6.37164 12.3208 6.06332 12.2161 5.81005C12.115 5.55311 11.9669 5.35673 11.7719 5.22092C11.5769 5.08511 11.3385 5.01721 11.0568 5.01721C10.7824 5.01721 10.5422 5.08328 10.3364 5.21542C10.1341 5.34389 9.97704 5.52925 9.86509 5.77151C9.75675 6.01009 9.70258 6.2964 9.70258 6.63042V7.47281C9.70258 7.77013 9.76036 8.03441 9.87592 8.26566C9.99509 8.49323 10.1576 8.67125 10.3635 8.79972C10.5729 8.92819 10.8113 8.99243 11.0785 8.99243Z\"></path>\n <path fill=\"currentColor\" d=\"M4.70482 9.99449C4.15229 9.99449 3.70087 9.83482 3.35057 9.51548C3.00388 9.19247 2.83054 8.75935 2.83054 8.2161C2.83054 7.70223 3.00207 7.28745 3.34515 6.97178C3.69184 6.65244 4.19562 6.49277 4.8565 6.49277H6.30284V5.94769C6.30284 5.61367 6.20533 5.36774 6.01032 5.20991C5.81531 5.04841 5.55349 4.96765 5.22485 4.96765C5.00817 4.96765 4.82941 4.99702 4.68857 5.05575C4.54773 5.11081 4.43758 5.18789 4.35813 5.28699C4.27868 5.38243 4.22271 5.49621 4.19021 5.62835H3.04722C3.06527 5.3861 3.12305 5.16586 3.22056 4.96765C3.32168 4.76577 3.46252 4.59326 3.64309 4.4501C3.82727 4.30328 4.05297 4.19133 4.32021 4.11425C4.59106 4.03716 4.90525 3.99862 5.26277 3.99862C5.67086 3.99862 6.04463 4.06286 6.38409 4.19133C6.72356 4.31613 6.99441 4.52168 7.19665 4.80798C7.39888 5.09429 7.5 5.4797 7.5 5.96421V9.9064H6.35701V9.1521H6.30284C6.21978 9.29892 6.10783 9.43657 5.96698 9.56504C5.82614 9.69351 5.65099 9.79812 5.44153 9.87887C5.23569 9.95595 4.99012 9.99449 4.70482 9.99449ZM5.07318 9.04749C5.3043 9.04749 5.51196 8.99977 5.69613 8.90434C5.88031 8.80523 6.02657 8.67309 6.13491 8.50791C6.24686 8.34274 6.30284 8.1537 6.30284 7.94081V7.31314H5.04609C4.69579 7.31314 4.43939 7.39206 4.27688 7.5499C4.11798 7.70773 4.03853 7.90961 4.03853 8.15554C4.03853 8.4602 4.14326 8.68594 4.35272 8.83276C4.56578 8.97591 4.80594 9.04749 5.07318 9.04749Z\"></path>\n <path fill=\"currentColor\" d=\"M2.5 12.5L13.5 12.5C14.3284 12.5 15 11.8284 15 11V9.5C15 9.22386 15.2239 9 15.5 9C15.7761 9 16 9.22386 16 9.5V11C16 12.3807 14.8807 13.5 13.5 13.5L2.5 13.5C1.11929 13.5 -7.56324e-07 12.3807 0 11L6.55675e-08 9.5C3.58362e-07 9.22386 0.223858 9 0.5 9C0.776142 9 1 9.22386 1 9.5L1 11C0.999999 11.8284 1.67157 12.5 2.5 12.5Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-regex\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" d=\"M8.60788 6.59074C8.78227 6.46701 9.02141 6.60508 9.00146 6.81797L8.77564 9.22666C8.76189 9.37331 8.87726 9.5 9.02455 9.5H9.97548C10.1228 9.5 10.2381 9.37331 10.2244 9.22667L9.99858 6.81801C9.97862 6.60513 10.2178 6.46706 10.3922 6.59079L12.3652 7.99066C12.4853 8.07589 12.6527 8.03932 12.7264 7.91177L13.2018 7.08823C13.2755 6.96068 13.2234 6.79742 13.0896 6.73601L10.8907 5.72723C10.6963 5.63807 10.6963 5.36193 10.8907 5.27277L13.0896 4.264C13.2234 4.20258 13.2755 4.03932 13.2018 3.91177L12.7263 3.08824C12.6527 2.96068 12.4853 2.92411 12.3652 3.00934L10.3922 4.40921C10.2178 4.53294 9.97862 4.39486 9.99858 4.18198L10.2244 1.77334C10.2381 1.62669 10.1228 1.5 9.97548 1.5H9.02455C8.87726 1.5 8.76189 1.62669 8.77564 1.77334L9.00146 4.18203C9.02141 4.39491 8.78227 4.53298 8.60788 4.40926L6.63479 3.00934C6.51466 2.92411 6.34726 2.96068 6.27362 3.08823L5.79815 3.91177C5.72451 4.03932 5.77654 4.20258 5.91041 4.26399L8.10929 5.27277C8.30363 5.36193 8.30363 5.63807 8.10929 5.72723L5.91041 6.73601C5.77653 6.79742 5.7245 6.96068 5.79814 7.08824L6.27361 7.91177C6.34725 8.03932 6.51466 8.07589 6.63478 7.99066L8.60788 6.59074Z\"></path>\n <path fill=\"currentColor\" d=\"M4 11C3.44772 11 3 11.4477 3 12V13C3 13.5523 3.44772 14 4 14H5C5.55228 14 6 13.5523 6 13V12C6 11.4477 5.55228 11 5 11H4Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-quick\" viewBox=\"0 0 20 20\">\n <polygon points=\"11 3 9 9 16 9 9 17 11 11 4 11 11 3\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"></polygon>\n </symbol>\n</svg>";
2
+ type SVGSpriteNames = 'arrow-down' | 'arrow-up' | 'case' | 'close' | 'quick' | 'regex' | 'whole-word' | 'replace' | 'replace-all';
3
+ declare const SVGSpriteSheet = "<svg data-icon-sprite aria-hidden=\"true\" width=\"0\" height=\"0\">\n <symbol id=\"diffs-editor-icon-close\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" d=\"M3.21967 3.21967C3.51256 2.92678 3.98744 2.92678 4.28033 3.21967L8 6.93934L11.7197 3.21967C12.0126 2.92678 12.4874 2.92678 12.7803 3.21967C13.0732 3.51256 13.0732 3.98744 12.7803 4.28033L9.06066 8L12.7803 11.7197C13.0732 12.0126 13.0732 12.4874 12.7803 12.7803C12.4874 13.0732 12.0126 13.0732 11.7197 12.7803L8 9.06066L4.28033 12.7803C3.98744 13.0732 3.51256 13.0732 3.21967 12.7803C2.92678 12.4874 2.92678 12.0126 3.21967 11.7197L6.93934 8L3.21967 4.28033C2.92678 3.98744 2.92678 3.51256 3.21967 3.21967Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-arrow-up\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" transform=\"rotate(-90 8 8)\" d=\"M8.46967 4.21967C8.17678 4.51256 8.17678 4.98744 8.46967 5.28033L10.4393 7.25H3.75C3.33579 7.25 3 7.58579 3 8C3 8.41421 3.33579 8.75 3.75 8.75H10.4393L8.46967 10.7197C8.17678 11.0126 8.17678 11.4874 8.46967 11.7803C8.76256 12.0732 9.23744 12.0732 9.53033 11.7803L12.7803 8.53033C13.0732 8.23744 13.0732 7.76256 12.7803 7.46967L9.53033 4.21967C9.23744 3.92678 8.76256 3.92678 8.46967 4.21967Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-arrow-down\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" transform=\"rotate(90 8 8)\" d=\"M8.46967 4.21967C8.17678 4.51256 8.17678 4.98744 8.46967 5.28033L10.4393 7.25H3.75C3.33579 7.25 3 7.58579 3 8C3 8.41421 3.33579 8.75 3.75 8.75H10.4393L8.46967 10.7197C8.17678 11.0126 8.17678 11.4874 8.46967 11.7803C8.76256 12.0732 9.23744 12.0732 9.53033 11.7803L12.7803 8.53033C13.0732 8.23744 13.0732 7.76256 12.7803 7.46967L9.53033 4.21967C9.23744 3.92678 8.76256 3.92678 8.46967 4.21967Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-case\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" d=\"M12.2969 12.9969C10.7109 12.9969 9.61719 12.0125 9.61719 10.5047C9.61719 9.06719 10.6172 8.16094 12.5 8.15312H14.6641V7.31719C14.6641 6.23906 14.0391 5.64531 12.9297 5.64531C11.875 5.64531 11.2734 6.18437 11.1953 7.00469H9.92969C10.0156 5.56719 10.9922 4.52031 12.9766 4.52031C14.7266 4.52031 16 5.47344 16 7.2V12.8641H14.7109V11.8406H14.6719C14.2578 12.5047 13.5078 12.9969 12.2969 12.9969ZM12.6562 11.8797C13.8047 11.8797 14.6641 11.1609 14.6641 10.1375V9.18437H12.6016C11.4766 9.18437 10.9922 9.71562 10.9922 10.4578C10.9922 11.4266 11.7969 11.8797 12.6562 11.8797Z\"></path>\n <path fill=\"currentColor\" d=\"M1.42188 12.8641H0L3.79688 2H5.1875L8.98438 12.8641H7.54688L6.46875 9.66094H2.5L1.42188 12.8641ZM4.50781 3.60938H4.46875L2.86719 8.55937H6.10156L4.50781 3.60938Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-whole-word\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" d=\"M11.4089 9.99449C11.1417 9.99449 10.8961 9.95595 10.6722 9.87887C10.4519 9.80179 10.2605 9.69167 10.098 9.54852C9.93551 9.40537 9.81453 9.23469 9.73508 9.03648H9.67007V9.91191H8.5V2H9.70258V5.01721H9.76758C9.81092 4.86671 9.88314 4.7309 9.98426 4.60977C10.089 4.48497 10.2136 4.37853 10.358 4.29043C10.5025 4.19867 10.6668 4.13076 10.851 4.08672C11.0352 4.039 11.2302 4.01514 11.436 4.01514C11.8802 4.01514 12.2648 4.11792 12.5898 4.32347C12.9149 4.52535 13.164 4.81532 13.3374 5.19339C13.5107 5.57146 13.5974 6.02478 13.5974 6.55334V7.45079C13.5974 7.97568 13.5089 8.429 13.332 8.81074C13.1586 9.1888 12.9076 9.48061 12.579 9.68617C12.2504 9.89172 11.8604 9.99449 11.4089 9.99449ZM11.0785 8.99243C11.353 8.99243 11.5859 8.92636 11.7773 8.79422C11.9723 8.66208 12.1204 8.46937 12.2215 8.2161C12.3226 7.95916 12.3732 7.65267 12.3732 7.29663V6.73503C12.3732 6.37164 12.3208 6.06332 12.2161 5.81005C12.115 5.55311 11.9669 5.35673 11.7719 5.22092C11.5769 5.08511 11.3385 5.01721 11.0568 5.01721C10.7824 5.01721 10.5422 5.08328 10.3364 5.21542C10.1341 5.34389 9.97704 5.52925 9.86509 5.77151C9.75675 6.01009 9.70258 6.2964 9.70258 6.63042V7.47281C9.70258 7.77013 9.76036 8.03441 9.87592 8.26566C9.99509 8.49323 10.1576 8.67125 10.3635 8.79972C10.5729 8.92819 10.8113 8.99243 11.0785 8.99243Z\"></path>\n <path fill=\"currentColor\" d=\"M4.70482 9.99449C4.15229 9.99449 3.70087 9.83482 3.35057 9.51548C3.00388 9.19247 2.83054 8.75935 2.83054 8.2161C2.83054 7.70223 3.00207 7.28745 3.34515 6.97178C3.69184 6.65244 4.19562 6.49277 4.8565 6.49277H6.30284V5.94769C6.30284 5.61367 6.20533 5.36774 6.01032 5.20991C5.81531 5.04841 5.55349 4.96765 5.22485 4.96765C5.00817 4.96765 4.82941 4.99702 4.68857 5.05575C4.54773 5.11081 4.43758 5.18789 4.35813 5.28699C4.27868 5.38243 4.22271 5.49621 4.19021 5.62835H3.04722C3.06527 5.3861 3.12305 5.16586 3.22056 4.96765C3.32168 4.76577 3.46252 4.59326 3.64309 4.4501C3.82727 4.30328 4.05297 4.19133 4.32021 4.11425C4.59106 4.03716 4.90525 3.99862 5.26277 3.99862C5.67086 3.99862 6.04463 4.06286 6.38409 4.19133C6.72356 4.31613 6.99441 4.52168 7.19665 4.80798C7.39888 5.09429 7.5 5.4797 7.5 5.96421V9.9064H6.35701V9.1521H6.30284C6.21978 9.29892 6.10783 9.43657 5.96698 9.56504C5.82614 9.69351 5.65099 9.79812 5.44153 9.87887C5.23569 9.95595 4.99012 9.99449 4.70482 9.99449ZM5.07318 9.04749C5.3043 9.04749 5.51196 8.99977 5.69613 8.90434C5.88031 8.80523 6.02657 8.67309 6.13491 8.50791C6.24686 8.34274 6.30284 8.1537 6.30284 7.94081V7.31314H5.04609C4.69579 7.31314 4.43939 7.39206 4.27688 7.5499C4.11798 7.70773 4.03853 7.90961 4.03853 8.15554C4.03853 8.4602 4.14326 8.68594 4.35272 8.83276C4.56578 8.97591 4.80594 9.04749 5.07318 9.04749Z\"></path>\n <path fill=\"currentColor\" d=\"M2.5 12.5L13.5 12.5C14.3284 12.5 15 11.8284 15 11V9.5C15 9.22386 15.2239 9 15.5 9C15.7761 9 16 9.22386 16 9.5V11C16 12.3807 14.8807 13.5 13.5 13.5L2.5 13.5C1.11929 13.5 -7.56324e-07 12.3807 0 11L6.55675e-08 9.5C3.58362e-07 9.22386 0.223858 9 0.5 9C0.776142 9 1 9.22386 1 9.5L1 11C0.999999 11.8284 1.67157 12.5 2.5 12.5Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-regex\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" d=\"M8.60788 6.59074C8.78227 6.46701 9.02141 6.60508 9.00146 6.81797L8.77564 9.22666C8.76189 9.37331 8.87726 9.5 9.02455 9.5H9.97548C10.1228 9.5 10.2381 9.37331 10.2244 9.22667L9.99858 6.81801C9.97862 6.60513 10.2178 6.46706 10.3922 6.59079L12.3652 7.99066C12.4853 8.07589 12.6527 8.03932 12.7264 7.91177L13.2018 7.08823C13.2755 6.96068 13.2234 6.79742 13.0896 6.73601L10.8907 5.72723C10.6963 5.63807 10.6963 5.36193 10.8907 5.27277L13.0896 4.264C13.2234 4.20258 13.2755 4.03932 13.2018 3.91177L12.7263 3.08824C12.6527 2.96068 12.4853 2.92411 12.3652 3.00934L10.3922 4.40921C10.2178 4.53294 9.97862 4.39486 9.99858 4.18198L10.2244 1.77334C10.2381 1.62669 10.1228 1.5 9.97548 1.5H9.02455C8.87726 1.5 8.76189 1.62669 8.77564 1.77334L9.00146 4.18203C9.02141 4.39491 8.78227 4.53298 8.60788 4.40926L6.63479 3.00934C6.51466 2.92411 6.34726 2.96068 6.27362 3.08823L5.79815 3.91177C5.72451 4.03932 5.77654 4.20258 5.91041 4.26399L8.10929 5.27277C8.30363 5.36193 8.30363 5.63807 8.10929 5.72723L5.91041 6.73601C5.77653 6.79742 5.7245 6.96068 5.79814 7.08824L6.27361 7.91177C6.34725 8.03932 6.51466 8.07589 6.63478 7.99066L8.60788 6.59074Z\"></path>\n <path fill=\"currentColor\" d=\"M4 11C3.44772 11 3 11.4477 3 12V13C3 13.5523 3.44772 14 4 14H5C5.55228 14 6 13.5523 6 13V12C6 11.4477 5.55228 11 5 11H4Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-quick\" viewBox=\"0 0 20 20\">\n <polygon points=\"11 3 9 9 16 9 9 17 11 11 4 11 11 3\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"></polygon>\n </symbol>\n <symbol id=\"diffs-editor-icon-replace\" viewBox=\"0 0 20 20\">\n <path d=\"m3,11h11c1.657,0,3-1.343,3-3v-3\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"></path>\n <polyline points=\"7 7 3 11 7 15\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"></polyline>\n </symbol>\n <symbol id=\"diffs-editor-icon-replace-all\" viewBox=\"0 0 20 20\">\n <path d=\"m16,6H6c-1.657,0-3,1.343-3,3v1\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"></path>\n <polyline points=\"13.25 8.75 16 6 13.25 3.25\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"></polyline>\n <path d=\"m4,14h10c1.657,0,3-1.343,3-3v-1\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"></path>\n <polyline points=\"6.75 11.25 4 14 6.75 16.75\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"></polyline>\n </symbol>\n</svg>";
4
4
  declare const createSpriteElement: () => SVGSVGElement;
5
5
  declare const getEditorIconSvg: (name: SVGSpriteNames, size?: number) => string;
6
6
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"sprite.d.ts","names":["SVGSpriteNames","SVGSpriteSheet","createSpriteElement","SVGSVGElement","getEditorIconSvg"],"sources":["../../src/editor/sprite.d.ts"],"sourcesContent":["export type SVGSpriteNames = 'arrow-down' | 'arrow-up' | 'case' | 'close' | 'quick' | 'regex' | 'search' | 'whole-word';\nexport declare const SVGSpriteSheet = \"<svg data-icon-sprite aria-hidden=\\\"true\\\" width=\\\"0\\\" height=\\\"0\\\">\\n <symbol id=\\\"diffs-editor-icon-search\\\" viewBox=\\\"0 0 16 16\\\">\\n <path fill=\\\"currentColor\\\" fill-rule=\\\"evenodd\\\" clip-rule=\\\"evenodd\\\" d=\\\"M10.7747 12.8961C9.68558 13.5948 8.39011 14 7 14C3.13401 14 0 10.866 0 7C0 3.13401 3.13401 0 7 0C10.866 0 14 3.13401 14 7C14 8.39011 13.5948 9.68558 12.8961 10.7747L15.5607 13.4393C16.1464 14.0251 16.1464 14.9749 15.5607 15.5607C14.9749 16.1464 14.0251 16.1464 13.4393 15.5607L10.7747 12.8961ZM7 1.5C10.0376 1.5 12.5 3.96243 12.5 7C12.5 10.0376 10.0376 12.5 7 12.5C3.96243 12.5 1.5 10.0376 1.5 7C1.5 3.96243 3.96243 1.5 7 1.5Z\\\"></path>\\n </symbol>\\n <symbol id=\\\"diffs-editor-icon-close\\\" viewBox=\\\"0 0 16 16\\\">\\n <path fill=\\\"currentColor\\\" d=\\\"M3.21967 3.21967C3.51256 2.92678 3.98744 2.92678 4.28033 3.21967L8 6.93934L11.7197 3.21967C12.0126 2.92678 12.4874 2.92678 12.7803 3.21967C13.0732 3.51256 13.0732 3.98744 12.7803 4.28033L9.06066 8L12.7803 11.7197C13.0732 12.0126 13.0732 12.4874 12.7803 12.7803C12.4874 13.0732 12.0126 13.0732 11.7197 12.7803L8 9.06066L4.28033 12.7803C3.98744 13.0732 3.51256 13.0732 3.21967 12.7803C2.92678 12.4874 2.92678 12.0126 3.21967 11.7197L6.93934 8L3.21967 4.28033C2.92678 3.98744 2.92678 3.51256 3.21967 3.21967Z\\\"></path>\\n </symbol>\\n <symbol id=\\\"diffs-editor-icon-arrow-up\\\" viewBox=\\\"0 0 16 16\\\">\\n <path fill=\\\"currentColor\\\" transform=\\\"rotate(-90 8 8)\\\" d=\\\"M8.46967 4.21967C8.17678 4.51256 8.17678 4.98744 8.46967 5.28033L10.4393 7.25H3.75C3.33579 7.25 3 7.58579 3 8C3 8.41421 3.33579 8.75 3.75 8.75H10.4393L8.46967 10.7197C8.17678 11.0126 8.17678 11.4874 8.46967 11.7803C8.76256 12.0732 9.23744 12.0732 9.53033 11.7803L12.7803 8.53033C13.0732 8.23744 13.0732 7.76256 12.7803 7.46967L9.53033 4.21967C9.23744 3.92678 8.76256 3.92678 8.46967 4.21967Z\\\"></path>\\n </symbol>\\n <symbol id=\\\"diffs-editor-icon-arrow-down\\\" viewBox=\\\"0 0 16 16\\\">\\n <path fill=\\\"currentColor\\\" transform=\\\"rotate(90 8 8)\\\" d=\\\"M8.46967 4.21967C8.17678 4.51256 8.17678 4.98744 8.46967 5.28033L10.4393 7.25H3.75C3.33579 7.25 3 7.58579 3 8C3 8.41421 3.33579 8.75 3.75 8.75H10.4393L8.46967 10.7197C8.17678 11.0126 8.17678 11.4874 8.46967 11.7803C8.76256 12.0732 9.23744 12.0732 9.53033 11.7803L12.7803 8.53033C13.0732 8.23744 13.0732 7.76256 12.7803 7.46967L9.53033 4.21967C9.23744 3.92678 8.76256 3.92678 8.46967 4.21967Z\\\"></path>\\n </symbol>\\n <symbol id=\\\"diffs-editor-icon-case\\\" viewBox=\\\"0 0 16 16\\\">\\n <path fill=\\\"currentColor\\\" d=\\\"M12.2969 12.9969C10.7109 12.9969 9.61719 12.0125 9.61719 10.5047C9.61719 9.06719 10.6172 8.16094 12.5 8.15312H14.6641V7.31719C14.6641 6.23906 14.0391 5.64531 12.9297 5.64531C11.875 5.64531 11.2734 6.18437 11.1953 7.00469H9.92969C10.0156 5.56719 10.9922 4.52031 12.9766 4.52031C14.7266 4.52031 16 5.47344 16 7.2V12.8641H14.7109V11.8406H14.6719C14.2578 12.5047 13.5078 12.9969 12.2969 12.9969ZM12.6562 11.8797C13.8047 11.8797 14.6641 11.1609 14.6641 10.1375V9.18437H12.6016C11.4766 9.18437 10.9922 9.71562 10.9922 10.4578C10.9922 11.4266 11.7969 11.8797 12.6562 11.8797Z\\\"></path>\\n <path fill=\\\"currentColor\\\" d=\\\"M1.42188 12.8641H0L3.79688 2H5.1875L8.98438 12.8641H7.54688L6.46875 9.66094H2.5L1.42188 12.8641ZM4.50781 3.60938H4.46875L2.86719 8.55937H6.10156L4.50781 3.60938Z\\\"></path>\\n </symbol>\\n <symbol id=\\\"diffs-editor-icon-whole-word\\\" viewBox=\\\"0 0 16 16\\\">\\n <path fill=\\\"currentColor\\\" d=\\\"M11.4089 9.99449C11.1417 9.99449 10.8961 9.95595 10.6722 9.87887C10.4519 9.80179 10.2605 9.69167 10.098 9.54852C9.93551 9.40537 9.81453 9.23469 9.73508 9.03648H9.67007V9.91191H8.5V2H9.70258V5.01721H9.76758C9.81092 4.86671 9.88314 4.7309 9.98426 4.60977C10.089 4.48497 10.2136 4.37853 10.358 4.29043C10.5025 4.19867 10.6668 4.13076 10.851 4.08672C11.0352 4.039 11.2302 4.01514 11.436 4.01514C11.8802 4.01514 12.2648 4.11792 12.5898 4.32347C12.9149 4.52535 13.164 4.81532 13.3374 5.19339C13.5107 5.57146 13.5974 6.02478 13.5974 6.55334V7.45079C13.5974 7.97568 13.5089 8.429 13.332 8.81074C13.1586 9.1888 12.9076 9.48061 12.579 9.68617C12.2504 9.89172 11.8604 9.99449 11.4089 9.99449ZM11.0785 8.99243C11.353 8.99243 11.5859 8.92636 11.7773 8.79422C11.9723 8.66208 12.1204 8.46937 12.2215 8.2161C12.3226 7.95916 12.3732 7.65267 12.3732 7.29663V6.73503C12.3732 6.37164 12.3208 6.06332 12.2161 5.81005C12.115 5.55311 11.9669 5.35673 11.7719 5.22092C11.5769 5.08511 11.3385 5.01721 11.0568 5.01721C10.7824 5.01721 10.5422 5.08328 10.3364 5.21542C10.1341 5.34389 9.97704 5.52925 9.86509 5.77151C9.75675 6.01009 9.70258 6.2964 9.70258 6.63042V7.47281C9.70258 7.77013 9.76036 8.03441 9.87592 8.26566C9.99509 8.49323 10.1576 8.67125 10.3635 8.79972C10.5729 8.92819 10.8113 8.99243 11.0785 8.99243Z\\\"></path>\\n <path fill=\\\"currentColor\\\" d=\\\"M4.70482 9.99449C4.15229 9.99449 3.70087 9.83482 3.35057 9.51548C3.00388 9.19247 2.83054 8.75935 2.83054 8.2161C2.83054 7.70223 3.00207 7.28745 3.34515 6.97178C3.69184 6.65244 4.19562 6.49277 4.8565 6.49277H6.30284V5.94769C6.30284 5.61367 6.20533 5.36774 6.01032 5.20991C5.81531 5.04841 5.55349 4.96765 5.22485 4.96765C5.00817 4.96765 4.82941 4.99702 4.68857 5.05575C4.54773 5.11081 4.43758 5.18789 4.35813 5.28699C4.27868 5.38243 4.22271 5.49621 4.19021 5.62835H3.04722C3.06527 5.3861 3.12305 5.16586 3.22056 4.96765C3.32168 4.76577 3.46252 4.59326 3.64309 4.4501C3.82727 4.30328 4.05297 4.19133 4.32021 4.11425C4.59106 4.03716 4.90525 3.99862 5.26277 3.99862C5.67086 3.99862 6.04463 4.06286 6.38409 4.19133C6.72356 4.31613 6.99441 4.52168 7.19665 4.80798C7.39888 5.09429 7.5 5.4797 7.5 5.96421V9.9064H6.35701V9.1521H6.30284C6.21978 9.29892 6.10783 9.43657 5.96698 9.56504C5.82614 9.69351 5.65099 9.79812 5.44153 9.87887C5.23569 9.95595 4.99012 9.99449 4.70482 9.99449ZM5.07318 9.04749C5.3043 9.04749 5.51196 8.99977 5.69613 8.90434C5.88031 8.80523 6.02657 8.67309 6.13491 8.50791C6.24686 8.34274 6.30284 8.1537 6.30284 7.94081V7.31314H5.04609C4.69579 7.31314 4.43939 7.39206 4.27688 7.5499C4.11798 7.70773 4.03853 7.90961 4.03853 8.15554C4.03853 8.4602 4.14326 8.68594 4.35272 8.83276C4.56578 8.97591 4.80594 9.04749 5.07318 9.04749Z\\\"></path>\\n <path fill=\\\"currentColor\\\" d=\\\"M2.5 12.5L13.5 12.5C14.3284 12.5 15 11.8284 15 11V9.5C15 9.22386 15.2239 9 15.5 9C15.7761 9 16 9.22386 16 9.5V11C16 12.3807 14.8807 13.5 13.5 13.5L2.5 13.5C1.11929 13.5 -7.56324e-07 12.3807 0 11L6.55675e-08 9.5C3.58362e-07 9.22386 0.223858 9 0.5 9C0.776142 9 1 9.22386 1 9.5L1 11C0.999999 11.8284 1.67157 12.5 2.5 12.5Z\\\"></path>\\n </symbol>\\n <symbol id=\\\"diffs-editor-icon-regex\\\" viewBox=\\\"0 0 16 16\\\">\\n <path fill=\\\"currentColor\\\" d=\\\"M8.60788 6.59074C8.78227 6.46701 9.02141 6.60508 9.00146 6.81797L8.77564 9.22666C8.76189 9.37331 8.87726 9.5 9.02455 9.5H9.97548C10.1228 9.5 10.2381 9.37331 10.2244 9.22667L9.99858 6.81801C9.97862 6.60513 10.2178 6.46706 10.3922 6.59079L12.3652 7.99066C12.4853 8.07589 12.6527 8.03932 12.7264 7.91177L13.2018 7.08823C13.2755 6.96068 13.2234 6.79742 13.0896 6.73601L10.8907 5.72723C10.6963 5.63807 10.6963 5.36193 10.8907 5.27277L13.0896 4.264C13.2234 4.20258 13.2755 4.03932 13.2018 3.91177L12.7263 3.08824C12.6527 2.96068 12.4853 2.92411 12.3652 3.00934L10.3922 4.40921C10.2178 4.53294 9.97862 4.39486 9.99858 4.18198L10.2244 1.77334C10.2381 1.62669 10.1228 1.5 9.97548 1.5H9.02455C8.87726 1.5 8.76189 1.62669 8.77564 1.77334L9.00146 4.18203C9.02141 4.39491 8.78227 4.53298 8.60788 4.40926L6.63479 3.00934C6.51466 2.92411 6.34726 2.96068 6.27362 3.08823L5.79815 3.91177C5.72451 4.03932 5.77654 4.20258 5.91041 4.26399L8.10929 5.27277C8.30363 5.36193 8.30363 5.63807 8.10929 5.72723L5.91041 6.73601C5.77653 6.79742 5.7245 6.96068 5.79814 7.08824L6.27361 7.91177C6.34725 8.03932 6.51466 8.07589 6.63478 7.99066L8.60788 6.59074Z\\\"></path>\\n <path fill=\\\"currentColor\\\" d=\\\"M4 11C3.44772 11 3 11.4477 3 12V13C3 13.5523 3.44772 14 4 14H5C5.55228 14 6 13.5523 6 13V12C6 11.4477 5.55228 11 5 11H4Z\\\"></path>\\n </symbol>\\n <symbol id=\\\"diffs-editor-icon-quick\\\" viewBox=\\\"0 0 20 20\\\">\\n <polygon points=\\\"11 3 9 9 16 9 9 17 11 11 4 11 11 3\\\" fill=\\\"currentColor\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"></polygon>\\n </symbol>\\n</svg>\";\nexport declare const createSpriteElement: () => SVGSVGElement;\nexport declare const getEditorIconSvg: (name: SVGSpriteNames, size?: number) => string;\n//# sourceMappingURL=sprite.d.ts.map"],"mappings":";KAAYA,cAAAA;AAAAA,cACSC,cAAAA,GADK,i+PAAA;AACLA,cACAC,mBADc,EAAA,GAAA,GACaC,aADb;AACdD,cACAE,gBADwC,EAAbD,CAAAA,IAAAA,EACFH,cADe,EAAA,IAAA,CAAA,EAAA,MAAA,EAAA,GAAA,MAAA"}
1
+ {"version":3,"file":"sprite.d.ts","names":["SVGSpriteNames","SVGSpriteSheet","createSpriteElement","SVGSVGElement","getEditorIconSvg"],"sources":["../../src/editor/sprite.d.ts"],"sourcesContent":["export type SVGSpriteNames = 'arrow-down' | 'arrow-up' | 'case' | 'close' | 'quick' | 'regex' | 'whole-word' | 'replace' | 'replace-all';\nexport declare const SVGSpriteSheet = \"<svg data-icon-sprite aria-hidden=\\\"true\\\" width=\\\"0\\\" height=\\\"0\\\">\\n <symbol id=\\\"diffs-editor-icon-close\\\" viewBox=\\\"0 0 16 16\\\">\\n <path fill=\\\"currentColor\\\" d=\\\"M3.21967 3.21967C3.51256 2.92678 3.98744 2.92678 4.28033 3.21967L8 6.93934L11.7197 3.21967C12.0126 2.92678 12.4874 2.92678 12.7803 3.21967C13.0732 3.51256 13.0732 3.98744 12.7803 4.28033L9.06066 8L12.7803 11.7197C13.0732 12.0126 13.0732 12.4874 12.7803 12.7803C12.4874 13.0732 12.0126 13.0732 11.7197 12.7803L8 9.06066L4.28033 12.7803C3.98744 13.0732 3.51256 13.0732 3.21967 12.7803C2.92678 12.4874 2.92678 12.0126 3.21967 11.7197L6.93934 8L3.21967 4.28033C2.92678 3.98744 2.92678 3.51256 3.21967 3.21967Z\\\"></path>\\n </symbol>\\n <symbol id=\\\"diffs-editor-icon-arrow-up\\\" viewBox=\\\"0 0 16 16\\\">\\n <path fill=\\\"currentColor\\\" transform=\\\"rotate(-90 8 8)\\\" d=\\\"M8.46967 4.21967C8.17678 4.51256 8.17678 4.98744 8.46967 5.28033L10.4393 7.25H3.75C3.33579 7.25 3 7.58579 3 8C3 8.41421 3.33579 8.75 3.75 8.75H10.4393L8.46967 10.7197C8.17678 11.0126 8.17678 11.4874 8.46967 11.7803C8.76256 12.0732 9.23744 12.0732 9.53033 11.7803L12.7803 8.53033C13.0732 8.23744 13.0732 7.76256 12.7803 7.46967L9.53033 4.21967C9.23744 3.92678 8.76256 3.92678 8.46967 4.21967Z\\\"></path>\\n </symbol>\\n <symbol id=\\\"diffs-editor-icon-arrow-down\\\" viewBox=\\\"0 0 16 16\\\">\\n <path fill=\\\"currentColor\\\" transform=\\\"rotate(90 8 8)\\\" d=\\\"M8.46967 4.21967C8.17678 4.51256 8.17678 4.98744 8.46967 5.28033L10.4393 7.25H3.75C3.33579 7.25 3 7.58579 3 8C3 8.41421 3.33579 8.75 3.75 8.75H10.4393L8.46967 10.7197C8.17678 11.0126 8.17678 11.4874 8.46967 11.7803C8.76256 12.0732 9.23744 12.0732 9.53033 11.7803L12.7803 8.53033C13.0732 8.23744 13.0732 7.76256 12.7803 7.46967L9.53033 4.21967C9.23744 3.92678 8.76256 3.92678 8.46967 4.21967Z\\\"></path>\\n </symbol>\\n <symbol id=\\\"diffs-editor-icon-case\\\" viewBox=\\\"0 0 16 16\\\">\\n <path fill=\\\"currentColor\\\" d=\\\"M12.2969 12.9969C10.7109 12.9969 9.61719 12.0125 9.61719 10.5047C9.61719 9.06719 10.6172 8.16094 12.5 8.15312H14.6641V7.31719C14.6641 6.23906 14.0391 5.64531 12.9297 5.64531C11.875 5.64531 11.2734 6.18437 11.1953 7.00469H9.92969C10.0156 5.56719 10.9922 4.52031 12.9766 4.52031C14.7266 4.52031 16 5.47344 16 7.2V12.8641H14.7109V11.8406H14.6719C14.2578 12.5047 13.5078 12.9969 12.2969 12.9969ZM12.6562 11.8797C13.8047 11.8797 14.6641 11.1609 14.6641 10.1375V9.18437H12.6016C11.4766 9.18437 10.9922 9.71562 10.9922 10.4578C10.9922 11.4266 11.7969 11.8797 12.6562 11.8797Z\\\"></path>\\n <path fill=\\\"currentColor\\\" d=\\\"M1.42188 12.8641H0L3.79688 2H5.1875L8.98438 12.8641H7.54688L6.46875 9.66094H2.5L1.42188 12.8641ZM4.50781 3.60938H4.46875L2.86719 8.55937H6.10156L4.50781 3.60938Z\\\"></path>\\n </symbol>\\n <symbol id=\\\"diffs-editor-icon-whole-word\\\" viewBox=\\\"0 0 16 16\\\">\\n <path fill=\\\"currentColor\\\" d=\\\"M11.4089 9.99449C11.1417 9.99449 10.8961 9.95595 10.6722 9.87887C10.4519 9.80179 10.2605 9.69167 10.098 9.54852C9.93551 9.40537 9.81453 9.23469 9.73508 9.03648H9.67007V9.91191H8.5V2H9.70258V5.01721H9.76758C9.81092 4.86671 9.88314 4.7309 9.98426 4.60977C10.089 4.48497 10.2136 4.37853 10.358 4.29043C10.5025 4.19867 10.6668 4.13076 10.851 4.08672C11.0352 4.039 11.2302 4.01514 11.436 4.01514C11.8802 4.01514 12.2648 4.11792 12.5898 4.32347C12.9149 4.52535 13.164 4.81532 13.3374 5.19339C13.5107 5.57146 13.5974 6.02478 13.5974 6.55334V7.45079C13.5974 7.97568 13.5089 8.429 13.332 8.81074C13.1586 9.1888 12.9076 9.48061 12.579 9.68617C12.2504 9.89172 11.8604 9.99449 11.4089 9.99449ZM11.0785 8.99243C11.353 8.99243 11.5859 8.92636 11.7773 8.79422C11.9723 8.66208 12.1204 8.46937 12.2215 8.2161C12.3226 7.95916 12.3732 7.65267 12.3732 7.29663V6.73503C12.3732 6.37164 12.3208 6.06332 12.2161 5.81005C12.115 5.55311 11.9669 5.35673 11.7719 5.22092C11.5769 5.08511 11.3385 5.01721 11.0568 5.01721C10.7824 5.01721 10.5422 5.08328 10.3364 5.21542C10.1341 5.34389 9.97704 5.52925 9.86509 5.77151C9.75675 6.01009 9.70258 6.2964 9.70258 6.63042V7.47281C9.70258 7.77013 9.76036 8.03441 9.87592 8.26566C9.99509 8.49323 10.1576 8.67125 10.3635 8.79972C10.5729 8.92819 10.8113 8.99243 11.0785 8.99243Z\\\"></path>\\n <path fill=\\\"currentColor\\\" d=\\\"M4.70482 9.99449C4.15229 9.99449 3.70087 9.83482 3.35057 9.51548C3.00388 9.19247 2.83054 8.75935 2.83054 8.2161C2.83054 7.70223 3.00207 7.28745 3.34515 6.97178C3.69184 6.65244 4.19562 6.49277 4.8565 6.49277H6.30284V5.94769C6.30284 5.61367 6.20533 5.36774 6.01032 5.20991C5.81531 5.04841 5.55349 4.96765 5.22485 4.96765C5.00817 4.96765 4.82941 4.99702 4.68857 5.05575C4.54773 5.11081 4.43758 5.18789 4.35813 5.28699C4.27868 5.38243 4.22271 5.49621 4.19021 5.62835H3.04722C3.06527 5.3861 3.12305 5.16586 3.22056 4.96765C3.32168 4.76577 3.46252 4.59326 3.64309 4.4501C3.82727 4.30328 4.05297 4.19133 4.32021 4.11425C4.59106 4.03716 4.90525 3.99862 5.26277 3.99862C5.67086 3.99862 6.04463 4.06286 6.38409 4.19133C6.72356 4.31613 6.99441 4.52168 7.19665 4.80798C7.39888 5.09429 7.5 5.4797 7.5 5.96421V9.9064H6.35701V9.1521H6.30284C6.21978 9.29892 6.10783 9.43657 5.96698 9.56504C5.82614 9.69351 5.65099 9.79812 5.44153 9.87887C5.23569 9.95595 4.99012 9.99449 4.70482 9.99449ZM5.07318 9.04749C5.3043 9.04749 5.51196 8.99977 5.69613 8.90434C5.88031 8.80523 6.02657 8.67309 6.13491 8.50791C6.24686 8.34274 6.30284 8.1537 6.30284 7.94081V7.31314H5.04609C4.69579 7.31314 4.43939 7.39206 4.27688 7.5499C4.11798 7.70773 4.03853 7.90961 4.03853 8.15554C4.03853 8.4602 4.14326 8.68594 4.35272 8.83276C4.56578 8.97591 4.80594 9.04749 5.07318 9.04749Z\\\"></path>\\n <path fill=\\\"currentColor\\\" d=\\\"M2.5 12.5L13.5 12.5C14.3284 12.5 15 11.8284 15 11V9.5C15 9.22386 15.2239 9 15.5 9C15.7761 9 16 9.22386 16 9.5V11C16 12.3807 14.8807 13.5 13.5 13.5L2.5 13.5C1.11929 13.5 -7.56324e-07 12.3807 0 11L6.55675e-08 9.5C3.58362e-07 9.22386 0.223858 9 0.5 9C0.776142 9 1 9.22386 1 9.5L1 11C0.999999 11.8284 1.67157 12.5 2.5 12.5Z\\\"></path>\\n </symbol>\\n <symbol id=\\\"diffs-editor-icon-regex\\\" viewBox=\\\"0 0 16 16\\\">\\n <path fill=\\\"currentColor\\\" d=\\\"M8.60788 6.59074C8.78227 6.46701 9.02141 6.60508 9.00146 6.81797L8.77564 9.22666C8.76189 9.37331 8.87726 9.5 9.02455 9.5H9.97548C10.1228 9.5 10.2381 9.37331 10.2244 9.22667L9.99858 6.81801C9.97862 6.60513 10.2178 6.46706 10.3922 6.59079L12.3652 7.99066C12.4853 8.07589 12.6527 8.03932 12.7264 7.91177L13.2018 7.08823C13.2755 6.96068 13.2234 6.79742 13.0896 6.73601L10.8907 5.72723C10.6963 5.63807 10.6963 5.36193 10.8907 5.27277L13.0896 4.264C13.2234 4.20258 13.2755 4.03932 13.2018 3.91177L12.7263 3.08824C12.6527 2.96068 12.4853 2.92411 12.3652 3.00934L10.3922 4.40921C10.2178 4.53294 9.97862 4.39486 9.99858 4.18198L10.2244 1.77334C10.2381 1.62669 10.1228 1.5 9.97548 1.5H9.02455C8.87726 1.5 8.76189 1.62669 8.77564 1.77334L9.00146 4.18203C9.02141 4.39491 8.78227 4.53298 8.60788 4.40926L6.63479 3.00934C6.51466 2.92411 6.34726 2.96068 6.27362 3.08823L5.79815 3.91177C5.72451 4.03932 5.77654 4.20258 5.91041 4.26399L8.10929 5.27277C8.30363 5.36193 8.30363 5.63807 8.10929 5.72723L5.91041 6.73601C5.77653 6.79742 5.7245 6.96068 5.79814 7.08824L6.27361 7.91177C6.34725 8.03932 6.51466 8.07589 6.63478 7.99066L8.60788 6.59074Z\\\"></path>\\n <path fill=\\\"currentColor\\\" d=\\\"M4 11C3.44772 11 3 11.4477 3 12V13C3 13.5523 3.44772 14 4 14H5C5.55228 14 6 13.5523 6 13V12C6 11.4477 5.55228 11 5 11H4Z\\\"></path>\\n </symbol>\\n <symbol id=\\\"diffs-editor-icon-quick\\\" viewBox=\\\"0 0 20 20\\\">\\n <polygon points=\\\"11 3 9 9 16 9 9 17 11 11 4 11 11 3\\\" fill=\\\"currentColor\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"></polygon>\\n </symbol>\\n <symbol id=\\\"diffs-editor-icon-replace\\\" viewBox=\\\"0 0 20 20\\\">\\n <path d=\\\"m3,11h11c1.657,0,3-1.343,3-3v-3\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\"></path>\\n <polyline points=\\\"7 7 3 11 7 15\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\"></polyline>\\n </symbol>\\n <symbol id=\\\"diffs-editor-icon-replace-all\\\" viewBox=\\\"0 0 20 20\\\">\\n <path d=\\\"m16,6H6c-1.657,0-3,1.343-3,3v1\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\"></path>\\n <polyline points=\\\"13.25 8.75 16 6 13.25 3.25\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\"></polyline>\\n <path d=\\\"m4,14h10c1.657,0,3-1.343,3-3v-1\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\"></path>\\n <polyline points=\\\"6.75 11.25 4 14 6.75 16.75\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\"></polyline>\\n </symbol>\\n</svg>\";\nexport declare const createSpriteElement: () => SVGSVGElement;\nexport declare const getEditorIconSvg: (name: SVGSpriteNames, size?: number) => string;\n//# sourceMappingURL=sprite.d.ts.map"],"mappings":";KAAYA,cAAAA;AAAAA,cACSC,cAAAA,GADK,kiRAAA;AACLA,cACAC,mBADc,EAAA,GAAA,GACaC,aADb;AACdD,cACAE,gBADwC,EAAbD,CAAAA,IAAAA,EACFH,cADe,EAAA,IAAA,CAAA,EAAA,MAAA,EAAA,GAAA,MAAA"}
@@ -1,8 +1,5 @@
1
1
  //#region src/editor/sprite.ts
2
2
  const SVGSpriteSheet = `<svg data-icon-sprite aria-hidden="true" width="0" height="0">
3
- <symbol id="diffs-editor-icon-search" viewBox="0 0 16 16">
4
- <path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M10.7747 12.8961C9.68558 13.5948 8.39011 14 7 14C3.13401 14 0 10.866 0 7C0 3.13401 3.13401 0 7 0C10.866 0 14 3.13401 14 7C14 8.39011 13.5948 9.68558 12.8961 10.7747L15.5607 13.4393C16.1464 14.0251 16.1464 14.9749 15.5607 15.5607C14.9749 16.1464 14.0251 16.1464 13.4393 15.5607L10.7747 12.8961ZM7 1.5C10.0376 1.5 12.5 3.96243 12.5 7C12.5 10.0376 10.0376 12.5 7 12.5C3.96243 12.5 1.5 10.0376 1.5 7C1.5 3.96243 3.96243 1.5 7 1.5Z"></path>
5
- </symbol>
6
3
  <symbol id="diffs-editor-icon-close" viewBox="0 0 16 16">
7
4
  <path fill="currentColor" d="M3.21967 3.21967C3.51256 2.92678 3.98744 2.92678 4.28033 3.21967L8 6.93934L11.7197 3.21967C12.0126 2.92678 12.4874 2.92678 12.7803 3.21967C13.0732 3.51256 13.0732 3.98744 12.7803 4.28033L9.06066 8L12.7803 11.7197C13.0732 12.0126 13.0732 12.4874 12.7803 12.7803C12.4874 13.0732 12.0126 13.0732 11.7197 12.7803L8 9.06066L4.28033 12.7803C3.98744 13.0732 3.51256 13.0732 3.21967 12.7803C2.92678 12.4874 2.92678 12.0126 3.21967 11.7197L6.93934 8L3.21967 4.28033C2.92678 3.98744 2.92678 3.51256 3.21967 3.21967Z"></path>
8
5
  </symbol>
@@ -28,6 +25,16 @@ const SVGSpriteSheet = `<svg data-icon-sprite aria-hidden="true" width="0" heigh
28
25
  <symbol id="diffs-editor-icon-quick" viewBox="0 0 20 20">
29
26
  <polygon points="11 3 9 9 16 9 9 17 11 11 4 11 11 3" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></polygon>
30
27
  </symbol>
28
+ <symbol id="diffs-editor-icon-replace" viewBox="0 0 20 20">
29
+ <path d="m3,11h11c1.657,0,3-1.343,3-3v-3" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
30
+ <polyline points="7 7 3 11 7 15" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></polyline>
31
+ </symbol>
32
+ <symbol id="diffs-editor-icon-replace-all" viewBox="0 0 20 20">
33
+ <path d="m16,6H6c-1.657,0-3,1.343-3,3v1" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
34
+ <polyline points="13.25 8.75 16 6 13.25 3.25" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></polyline>
35
+ <path d="m4,14h10c1.657,0,3-1.343,3-3v-1" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
36
+ <polyline points="6.75 11.25 4 14 6.75 16.75" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></polyline>
37
+ </symbol>
31
38
  </svg>`;
32
39
  const createSpriteElement = () => {
33
40
  const fragment = document.createElement("div");
@@ -1 +1 @@
1
- {"version":3,"file":"sprite.js","names":[],"sources":["../../src/editor/sprite.ts"],"sourcesContent":["export type SVGSpriteNames =\n | 'arrow-down'\n | 'arrow-up'\n | 'case'\n | 'close'\n | 'quick'\n | 'regex'\n | 'search'\n | 'whole-word';\n\n// Icon artwork is sourced from `@pierre/icons` (IconSearch, IconX,\n// IconArrowRightShort, IconType, IconTypeWord, IconRegex) so the editor matches\n// the rest of the product. The arrow glyph is the short right arrow rotated to\n// point up/down for the search \"previous\"/\"next\" controls. `quick` is the only\n// hand-authored glyph and uses its own 0 0 20 20 viewBox; `getEditorIconSvg`\n// omits an outer viewBox so each symbol scales to fill the requested size\n// regardless of its intrinsic coordinate system.\nexport const SVGSpriteSheet = `<svg data-icon-sprite aria-hidden=\"true\" width=\"0\" height=\"0\">\n <symbol id=\"diffs-editor-icon-search\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M10.7747 12.8961C9.68558 13.5948 8.39011 14 7 14C3.13401 14 0 10.866 0 7C0 3.13401 3.13401 0 7 0C10.866 0 14 3.13401 14 7C14 8.39011 13.5948 9.68558 12.8961 10.7747L15.5607 13.4393C16.1464 14.0251 16.1464 14.9749 15.5607 15.5607C14.9749 16.1464 14.0251 16.1464 13.4393 15.5607L10.7747 12.8961ZM7 1.5C10.0376 1.5 12.5 3.96243 12.5 7C12.5 10.0376 10.0376 12.5 7 12.5C3.96243 12.5 1.5 10.0376 1.5 7C1.5 3.96243 3.96243 1.5 7 1.5Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-close\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" d=\"M3.21967 3.21967C3.51256 2.92678 3.98744 2.92678 4.28033 3.21967L8 6.93934L11.7197 3.21967C12.0126 2.92678 12.4874 2.92678 12.7803 3.21967C13.0732 3.51256 13.0732 3.98744 12.7803 4.28033L9.06066 8L12.7803 11.7197C13.0732 12.0126 13.0732 12.4874 12.7803 12.7803C12.4874 13.0732 12.0126 13.0732 11.7197 12.7803L8 9.06066L4.28033 12.7803C3.98744 13.0732 3.51256 13.0732 3.21967 12.7803C2.92678 12.4874 2.92678 12.0126 3.21967 11.7197L6.93934 8L3.21967 4.28033C2.92678 3.98744 2.92678 3.51256 3.21967 3.21967Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-arrow-up\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" transform=\"rotate(-90 8 8)\" d=\"M8.46967 4.21967C8.17678 4.51256 8.17678 4.98744 8.46967 5.28033L10.4393 7.25H3.75C3.33579 7.25 3 7.58579 3 8C3 8.41421 3.33579 8.75 3.75 8.75H10.4393L8.46967 10.7197C8.17678 11.0126 8.17678 11.4874 8.46967 11.7803C8.76256 12.0732 9.23744 12.0732 9.53033 11.7803L12.7803 8.53033C13.0732 8.23744 13.0732 7.76256 12.7803 7.46967L9.53033 4.21967C9.23744 3.92678 8.76256 3.92678 8.46967 4.21967Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-arrow-down\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" transform=\"rotate(90 8 8)\" d=\"M8.46967 4.21967C8.17678 4.51256 8.17678 4.98744 8.46967 5.28033L10.4393 7.25H3.75C3.33579 7.25 3 7.58579 3 8C3 8.41421 3.33579 8.75 3.75 8.75H10.4393L8.46967 10.7197C8.17678 11.0126 8.17678 11.4874 8.46967 11.7803C8.76256 12.0732 9.23744 12.0732 9.53033 11.7803L12.7803 8.53033C13.0732 8.23744 13.0732 7.76256 12.7803 7.46967L9.53033 4.21967C9.23744 3.92678 8.76256 3.92678 8.46967 4.21967Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-case\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" d=\"M12.2969 12.9969C10.7109 12.9969 9.61719 12.0125 9.61719 10.5047C9.61719 9.06719 10.6172 8.16094 12.5 8.15312H14.6641V7.31719C14.6641 6.23906 14.0391 5.64531 12.9297 5.64531C11.875 5.64531 11.2734 6.18437 11.1953 7.00469H9.92969C10.0156 5.56719 10.9922 4.52031 12.9766 4.52031C14.7266 4.52031 16 5.47344 16 7.2V12.8641H14.7109V11.8406H14.6719C14.2578 12.5047 13.5078 12.9969 12.2969 12.9969ZM12.6562 11.8797C13.8047 11.8797 14.6641 11.1609 14.6641 10.1375V9.18437H12.6016C11.4766 9.18437 10.9922 9.71562 10.9922 10.4578C10.9922 11.4266 11.7969 11.8797 12.6562 11.8797Z\"></path>\n <path fill=\"currentColor\" d=\"M1.42188 12.8641H0L3.79688 2H5.1875L8.98438 12.8641H7.54688L6.46875 9.66094H2.5L1.42188 12.8641ZM4.50781 3.60938H4.46875L2.86719 8.55937H6.10156L4.50781 3.60938Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-whole-word\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" d=\"M11.4089 9.99449C11.1417 9.99449 10.8961 9.95595 10.6722 9.87887C10.4519 9.80179 10.2605 9.69167 10.098 9.54852C9.93551 9.40537 9.81453 9.23469 9.73508 9.03648H9.67007V9.91191H8.5V2H9.70258V5.01721H9.76758C9.81092 4.86671 9.88314 4.7309 9.98426 4.60977C10.089 4.48497 10.2136 4.37853 10.358 4.29043C10.5025 4.19867 10.6668 4.13076 10.851 4.08672C11.0352 4.039 11.2302 4.01514 11.436 4.01514C11.8802 4.01514 12.2648 4.11792 12.5898 4.32347C12.9149 4.52535 13.164 4.81532 13.3374 5.19339C13.5107 5.57146 13.5974 6.02478 13.5974 6.55334V7.45079C13.5974 7.97568 13.5089 8.429 13.332 8.81074C13.1586 9.1888 12.9076 9.48061 12.579 9.68617C12.2504 9.89172 11.8604 9.99449 11.4089 9.99449ZM11.0785 8.99243C11.353 8.99243 11.5859 8.92636 11.7773 8.79422C11.9723 8.66208 12.1204 8.46937 12.2215 8.2161C12.3226 7.95916 12.3732 7.65267 12.3732 7.29663V6.73503C12.3732 6.37164 12.3208 6.06332 12.2161 5.81005C12.115 5.55311 11.9669 5.35673 11.7719 5.22092C11.5769 5.08511 11.3385 5.01721 11.0568 5.01721C10.7824 5.01721 10.5422 5.08328 10.3364 5.21542C10.1341 5.34389 9.97704 5.52925 9.86509 5.77151C9.75675 6.01009 9.70258 6.2964 9.70258 6.63042V7.47281C9.70258 7.77013 9.76036 8.03441 9.87592 8.26566C9.99509 8.49323 10.1576 8.67125 10.3635 8.79972C10.5729 8.92819 10.8113 8.99243 11.0785 8.99243Z\"></path>\n <path fill=\"currentColor\" d=\"M4.70482 9.99449C4.15229 9.99449 3.70087 9.83482 3.35057 9.51548C3.00388 9.19247 2.83054 8.75935 2.83054 8.2161C2.83054 7.70223 3.00207 7.28745 3.34515 6.97178C3.69184 6.65244 4.19562 6.49277 4.8565 6.49277H6.30284V5.94769C6.30284 5.61367 6.20533 5.36774 6.01032 5.20991C5.81531 5.04841 5.55349 4.96765 5.22485 4.96765C5.00817 4.96765 4.82941 4.99702 4.68857 5.05575C4.54773 5.11081 4.43758 5.18789 4.35813 5.28699C4.27868 5.38243 4.22271 5.49621 4.19021 5.62835H3.04722C3.06527 5.3861 3.12305 5.16586 3.22056 4.96765C3.32168 4.76577 3.46252 4.59326 3.64309 4.4501C3.82727 4.30328 4.05297 4.19133 4.32021 4.11425C4.59106 4.03716 4.90525 3.99862 5.26277 3.99862C5.67086 3.99862 6.04463 4.06286 6.38409 4.19133C6.72356 4.31613 6.99441 4.52168 7.19665 4.80798C7.39888 5.09429 7.5 5.4797 7.5 5.96421V9.9064H6.35701V9.1521H6.30284C6.21978 9.29892 6.10783 9.43657 5.96698 9.56504C5.82614 9.69351 5.65099 9.79812 5.44153 9.87887C5.23569 9.95595 4.99012 9.99449 4.70482 9.99449ZM5.07318 9.04749C5.3043 9.04749 5.51196 8.99977 5.69613 8.90434C5.88031 8.80523 6.02657 8.67309 6.13491 8.50791C6.24686 8.34274 6.30284 8.1537 6.30284 7.94081V7.31314H5.04609C4.69579 7.31314 4.43939 7.39206 4.27688 7.5499C4.11798 7.70773 4.03853 7.90961 4.03853 8.15554C4.03853 8.4602 4.14326 8.68594 4.35272 8.83276C4.56578 8.97591 4.80594 9.04749 5.07318 9.04749Z\"></path>\n <path fill=\"currentColor\" d=\"M2.5 12.5L13.5 12.5C14.3284 12.5 15 11.8284 15 11V9.5C15 9.22386 15.2239 9 15.5 9C15.7761 9 16 9.22386 16 9.5V11C16 12.3807 14.8807 13.5 13.5 13.5L2.5 13.5C1.11929 13.5 -7.56324e-07 12.3807 0 11L6.55675e-08 9.5C3.58362e-07 9.22386 0.223858 9 0.5 9C0.776142 9 1 9.22386 1 9.5L1 11C0.999999 11.8284 1.67157 12.5 2.5 12.5Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-regex\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" d=\"M8.60788 6.59074C8.78227 6.46701 9.02141 6.60508 9.00146 6.81797L8.77564 9.22666C8.76189 9.37331 8.87726 9.5 9.02455 9.5H9.97548C10.1228 9.5 10.2381 9.37331 10.2244 9.22667L9.99858 6.81801C9.97862 6.60513 10.2178 6.46706 10.3922 6.59079L12.3652 7.99066C12.4853 8.07589 12.6527 8.03932 12.7264 7.91177L13.2018 7.08823C13.2755 6.96068 13.2234 6.79742 13.0896 6.73601L10.8907 5.72723C10.6963 5.63807 10.6963 5.36193 10.8907 5.27277L13.0896 4.264C13.2234 4.20258 13.2755 4.03932 13.2018 3.91177L12.7263 3.08824C12.6527 2.96068 12.4853 2.92411 12.3652 3.00934L10.3922 4.40921C10.2178 4.53294 9.97862 4.39486 9.99858 4.18198L10.2244 1.77334C10.2381 1.62669 10.1228 1.5 9.97548 1.5H9.02455C8.87726 1.5 8.76189 1.62669 8.77564 1.77334L9.00146 4.18203C9.02141 4.39491 8.78227 4.53298 8.60788 4.40926L6.63479 3.00934C6.51466 2.92411 6.34726 2.96068 6.27362 3.08823L5.79815 3.91177C5.72451 4.03932 5.77654 4.20258 5.91041 4.26399L8.10929 5.27277C8.30363 5.36193 8.30363 5.63807 8.10929 5.72723L5.91041 6.73601C5.77653 6.79742 5.7245 6.96068 5.79814 7.08824L6.27361 7.91177C6.34725 8.03932 6.51466 8.07589 6.63478 7.99066L8.60788 6.59074Z\"></path>\n <path fill=\"currentColor\" d=\"M4 11C3.44772 11 3 11.4477 3 12V13C3 13.5523 3.44772 14 4 14H5C5.55228 14 6 13.5523 6 13V12C6 11.4477 5.55228 11 5 11H4Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-quick\" viewBox=\"0 0 20 20\">\n <polygon points=\"11 3 9 9 16 9 9 17 11 11 4 11 11 3\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"></polygon>\n </symbol>\n</svg>`;\n\nexport const createSpriteElement = (): SVGSVGElement => {\n const fragment = document.createElement('div');\n fragment.innerHTML = SVGSpriteSheet;\n const sprite = fragment.firstElementChild;\n if (sprite === null || !(sprite instanceof SVGSVGElement)) {\n throw new Error('Failed to create sprite element');\n }\n return sprite;\n};\n\nexport const getEditorIconSvg = (name: SVGSpriteNames, size = 16): string =>\n `<svg width=\"${size}\" height=\"${size}\" aria-hidden=\"true\" focusable=\"false\">\n<use href=\"#diffs-editor-icon-${name}\"></use>\n</svg>`;\n"],"mappings":";AAiBA,MAAa,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+B9B,MAAa,4BAA2C;CACtD,MAAM,WAAW,SAAS,cAAc,MAAM;AAC9C,UAAS,YAAY;CACrB,MAAM,SAAS,SAAS;AACxB,KAAI,WAAW,QAAQ,EAAE,kBAAkB,eACzC,OAAM,IAAI,MAAM,kCAAkC;AAEpD,QAAO;;AAGT,MAAa,oBAAoB,MAAsB,OAAO,OAC5D,eAAe,KAAK,YAAY,KAAK;gCACP,KAAK"}
1
+ {"version":3,"file":"sprite.js","names":[],"sources":["../../src/editor/sprite.ts"],"sourcesContent":["export type SVGSpriteNames =\n | 'arrow-down'\n | 'arrow-up'\n | 'case'\n | 'close'\n | 'quick'\n | 'regex'\n | 'whole-word'\n | 'replace'\n | 'replace-all';\n\n// Icon artwork is sourced from `@pierre/icons` (IconSearch, IconX,\n// IconArrowRightShort, IconType, IconTypeWord, IconRegex) so the editor matches\n// the rest of the product. The arrow glyph is the short right arrow rotated to\n// point up/down for the search \"previous\"/\"next\" controls. `quick` is the only\n// hand-authored glyph and uses its own 0 0 20 20 viewBox; `getEditorIconSvg`\n// omits an outer viewBox so each symbol scales to fill the requested size\n// regardless of its intrinsic coordinate system.\nexport const SVGSpriteSheet = `<svg data-icon-sprite aria-hidden=\"true\" width=\"0\" height=\"0\">\n <symbol id=\"diffs-editor-icon-close\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" d=\"M3.21967 3.21967C3.51256 2.92678 3.98744 2.92678 4.28033 3.21967L8 6.93934L11.7197 3.21967C12.0126 2.92678 12.4874 2.92678 12.7803 3.21967C13.0732 3.51256 13.0732 3.98744 12.7803 4.28033L9.06066 8L12.7803 11.7197C13.0732 12.0126 13.0732 12.4874 12.7803 12.7803C12.4874 13.0732 12.0126 13.0732 11.7197 12.7803L8 9.06066L4.28033 12.7803C3.98744 13.0732 3.51256 13.0732 3.21967 12.7803C2.92678 12.4874 2.92678 12.0126 3.21967 11.7197L6.93934 8L3.21967 4.28033C2.92678 3.98744 2.92678 3.51256 3.21967 3.21967Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-arrow-up\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" transform=\"rotate(-90 8 8)\" d=\"M8.46967 4.21967C8.17678 4.51256 8.17678 4.98744 8.46967 5.28033L10.4393 7.25H3.75C3.33579 7.25 3 7.58579 3 8C3 8.41421 3.33579 8.75 3.75 8.75H10.4393L8.46967 10.7197C8.17678 11.0126 8.17678 11.4874 8.46967 11.7803C8.76256 12.0732 9.23744 12.0732 9.53033 11.7803L12.7803 8.53033C13.0732 8.23744 13.0732 7.76256 12.7803 7.46967L9.53033 4.21967C9.23744 3.92678 8.76256 3.92678 8.46967 4.21967Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-arrow-down\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" transform=\"rotate(90 8 8)\" d=\"M8.46967 4.21967C8.17678 4.51256 8.17678 4.98744 8.46967 5.28033L10.4393 7.25H3.75C3.33579 7.25 3 7.58579 3 8C3 8.41421 3.33579 8.75 3.75 8.75H10.4393L8.46967 10.7197C8.17678 11.0126 8.17678 11.4874 8.46967 11.7803C8.76256 12.0732 9.23744 12.0732 9.53033 11.7803L12.7803 8.53033C13.0732 8.23744 13.0732 7.76256 12.7803 7.46967L9.53033 4.21967C9.23744 3.92678 8.76256 3.92678 8.46967 4.21967Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-case\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" d=\"M12.2969 12.9969C10.7109 12.9969 9.61719 12.0125 9.61719 10.5047C9.61719 9.06719 10.6172 8.16094 12.5 8.15312H14.6641V7.31719C14.6641 6.23906 14.0391 5.64531 12.9297 5.64531C11.875 5.64531 11.2734 6.18437 11.1953 7.00469H9.92969C10.0156 5.56719 10.9922 4.52031 12.9766 4.52031C14.7266 4.52031 16 5.47344 16 7.2V12.8641H14.7109V11.8406H14.6719C14.2578 12.5047 13.5078 12.9969 12.2969 12.9969ZM12.6562 11.8797C13.8047 11.8797 14.6641 11.1609 14.6641 10.1375V9.18437H12.6016C11.4766 9.18437 10.9922 9.71562 10.9922 10.4578C10.9922 11.4266 11.7969 11.8797 12.6562 11.8797Z\"></path>\n <path fill=\"currentColor\" d=\"M1.42188 12.8641H0L3.79688 2H5.1875L8.98438 12.8641H7.54688L6.46875 9.66094H2.5L1.42188 12.8641ZM4.50781 3.60938H4.46875L2.86719 8.55937H6.10156L4.50781 3.60938Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-whole-word\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" d=\"M11.4089 9.99449C11.1417 9.99449 10.8961 9.95595 10.6722 9.87887C10.4519 9.80179 10.2605 9.69167 10.098 9.54852C9.93551 9.40537 9.81453 9.23469 9.73508 9.03648H9.67007V9.91191H8.5V2H9.70258V5.01721H9.76758C9.81092 4.86671 9.88314 4.7309 9.98426 4.60977C10.089 4.48497 10.2136 4.37853 10.358 4.29043C10.5025 4.19867 10.6668 4.13076 10.851 4.08672C11.0352 4.039 11.2302 4.01514 11.436 4.01514C11.8802 4.01514 12.2648 4.11792 12.5898 4.32347C12.9149 4.52535 13.164 4.81532 13.3374 5.19339C13.5107 5.57146 13.5974 6.02478 13.5974 6.55334V7.45079C13.5974 7.97568 13.5089 8.429 13.332 8.81074C13.1586 9.1888 12.9076 9.48061 12.579 9.68617C12.2504 9.89172 11.8604 9.99449 11.4089 9.99449ZM11.0785 8.99243C11.353 8.99243 11.5859 8.92636 11.7773 8.79422C11.9723 8.66208 12.1204 8.46937 12.2215 8.2161C12.3226 7.95916 12.3732 7.65267 12.3732 7.29663V6.73503C12.3732 6.37164 12.3208 6.06332 12.2161 5.81005C12.115 5.55311 11.9669 5.35673 11.7719 5.22092C11.5769 5.08511 11.3385 5.01721 11.0568 5.01721C10.7824 5.01721 10.5422 5.08328 10.3364 5.21542C10.1341 5.34389 9.97704 5.52925 9.86509 5.77151C9.75675 6.01009 9.70258 6.2964 9.70258 6.63042V7.47281C9.70258 7.77013 9.76036 8.03441 9.87592 8.26566C9.99509 8.49323 10.1576 8.67125 10.3635 8.79972C10.5729 8.92819 10.8113 8.99243 11.0785 8.99243Z\"></path>\n <path fill=\"currentColor\" d=\"M4.70482 9.99449C4.15229 9.99449 3.70087 9.83482 3.35057 9.51548C3.00388 9.19247 2.83054 8.75935 2.83054 8.2161C2.83054 7.70223 3.00207 7.28745 3.34515 6.97178C3.69184 6.65244 4.19562 6.49277 4.8565 6.49277H6.30284V5.94769C6.30284 5.61367 6.20533 5.36774 6.01032 5.20991C5.81531 5.04841 5.55349 4.96765 5.22485 4.96765C5.00817 4.96765 4.82941 4.99702 4.68857 5.05575C4.54773 5.11081 4.43758 5.18789 4.35813 5.28699C4.27868 5.38243 4.22271 5.49621 4.19021 5.62835H3.04722C3.06527 5.3861 3.12305 5.16586 3.22056 4.96765C3.32168 4.76577 3.46252 4.59326 3.64309 4.4501C3.82727 4.30328 4.05297 4.19133 4.32021 4.11425C4.59106 4.03716 4.90525 3.99862 5.26277 3.99862C5.67086 3.99862 6.04463 4.06286 6.38409 4.19133C6.72356 4.31613 6.99441 4.52168 7.19665 4.80798C7.39888 5.09429 7.5 5.4797 7.5 5.96421V9.9064H6.35701V9.1521H6.30284C6.21978 9.29892 6.10783 9.43657 5.96698 9.56504C5.82614 9.69351 5.65099 9.79812 5.44153 9.87887C5.23569 9.95595 4.99012 9.99449 4.70482 9.99449ZM5.07318 9.04749C5.3043 9.04749 5.51196 8.99977 5.69613 8.90434C5.88031 8.80523 6.02657 8.67309 6.13491 8.50791C6.24686 8.34274 6.30284 8.1537 6.30284 7.94081V7.31314H5.04609C4.69579 7.31314 4.43939 7.39206 4.27688 7.5499C4.11798 7.70773 4.03853 7.90961 4.03853 8.15554C4.03853 8.4602 4.14326 8.68594 4.35272 8.83276C4.56578 8.97591 4.80594 9.04749 5.07318 9.04749Z\"></path>\n <path fill=\"currentColor\" d=\"M2.5 12.5L13.5 12.5C14.3284 12.5 15 11.8284 15 11V9.5C15 9.22386 15.2239 9 15.5 9C15.7761 9 16 9.22386 16 9.5V11C16 12.3807 14.8807 13.5 13.5 13.5L2.5 13.5C1.11929 13.5 -7.56324e-07 12.3807 0 11L6.55675e-08 9.5C3.58362e-07 9.22386 0.223858 9 0.5 9C0.776142 9 1 9.22386 1 9.5L1 11C0.999999 11.8284 1.67157 12.5 2.5 12.5Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-regex\" viewBox=\"0 0 16 16\">\n <path fill=\"currentColor\" d=\"M8.60788 6.59074C8.78227 6.46701 9.02141 6.60508 9.00146 6.81797L8.77564 9.22666C8.76189 9.37331 8.87726 9.5 9.02455 9.5H9.97548C10.1228 9.5 10.2381 9.37331 10.2244 9.22667L9.99858 6.81801C9.97862 6.60513 10.2178 6.46706 10.3922 6.59079L12.3652 7.99066C12.4853 8.07589 12.6527 8.03932 12.7264 7.91177L13.2018 7.08823C13.2755 6.96068 13.2234 6.79742 13.0896 6.73601L10.8907 5.72723C10.6963 5.63807 10.6963 5.36193 10.8907 5.27277L13.0896 4.264C13.2234 4.20258 13.2755 4.03932 13.2018 3.91177L12.7263 3.08824C12.6527 2.96068 12.4853 2.92411 12.3652 3.00934L10.3922 4.40921C10.2178 4.53294 9.97862 4.39486 9.99858 4.18198L10.2244 1.77334C10.2381 1.62669 10.1228 1.5 9.97548 1.5H9.02455C8.87726 1.5 8.76189 1.62669 8.77564 1.77334L9.00146 4.18203C9.02141 4.39491 8.78227 4.53298 8.60788 4.40926L6.63479 3.00934C6.51466 2.92411 6.34726 2.96068 6.27362 3.08823L5.79815 3.91177C5.72451 4.03932 5.77654 4.20258 5.91041 4.26399L8.10929 5.27277C8.30363 5.36193 8.30363 5.63807 8.10929 5.72723L5.91041 6.73601C5.77653 6.79742 5.7245 6.96068 5.79814 7.08824L6.27361 7.91177C6.34725 8.03932 6.51466 8.07589 6.63478 7.99066L8.60788 6.59074Z\"></path>\n <path fill=\"currentColor\" d=\"M4 11C3.44772 11 3 11.4477 3 12V13C3 13.5523 3.44772 14 4 14H5C5.55228 14 6 13.5523 6 13V12C6 11.4477 5.55228 11 5 11H4Z\"></path>\n </symbol>\n <symbol id=\"diffs-editor-icon-quick\" viewBox=\"0 0 20 20\">\n <polygon points=\"11 3 9 9 16 9 9 17 11 11 4 11 11 3\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"></polygon>\n </symbol>\n <symbol id=\"diffs-editor-icon-replace\" viewBox=\"0 0 20 20\">\n <path d=\"m3,11h11c1.657,0,3-1.343,3-3v-3\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"></path>\n <polyline points=\"7 7 3 11 7 15\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"></polyline>\n </symbol>\n <symbol id=\"diffs-editor-icon-replace-all\" viewBox=\"0 0 20 20\">\n <path d=\"m16,6H6c-1.657,0-3,1.343-3,3v1\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"></path>\n <polyline points=\"13.25 8.75 16 6 13.25 3.25\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"></polyline>\n <path d=\"m4,14h10c1.657,0,3-1.343,3-3v-1\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"></path>\n <polyline points=\"6.75 11.25 4 14 6.75 16.75\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"></polyline>\n </symbol>\n</svg>`;\n\nexport const createSpriteElement = (): SVGSVGElement => {\n const fragment = document.createElement('div');\n fragment.innerHTML = SVGSpriteSheet;\n const sprite = fragment.firstElementChild;\n if (sprite === null || !(sprite instanceof SVGSVGElement)) {\n throw new Error('Failed to create sprite element');\n }\n return sprite;\n};\n\nexport const getEditorIconSvg = (name: SVGSpriteNames, size = 16): string =>\n `<svg width=\"${size}\" height=\"${size}\" aria-hidden=\"true\" focusable=\"false\">\n<use href=\"#diffs-editor-icon-${name}\"></use>\n</svg>`;\n"],"mappings":";AAkBA,MAAa,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsC9B,MAAa,4BAA2C;CACtD,MAAM,WAAW,SAAS,cAAc,MAAM;AAC9C,UAAS,YAAY;CACrB,MAAM,SAAS,SAAS;AACxB,KAAI,WAAW,QAAQ,EAAE,kBAAkB,eACzC,OAAM,IAAI,MAAM,kCAAkC;AAEpD,QAAO;;AAGT,MAAa,oBAAoB,MAAsB,OAAO,OAC5D,eAAe,KAAK,YAAY,KAAK;gCACP,KAAK"}
@@ -7,6 +7,7 @@ declare class Metrics {
7
7
  tabSize: number;
8
8
  /** Height of the code line. */
9
9
  lineHeight: number;
10
+ paddingTop: number;
10
11
  /** initialize the metrics */
11
12
  init(root: HTMLElement): void;
12
13
  /** measure the width of the text */
@@ -1 +1 @@
1
- {"version":3,"file":"textMeasure.d.ts","names":["Metrics","HTMLElement","needsDomTextMeasurement","snapTextOffsetToUnicodeBoundary","getUnicodeMeasurementOffsets","getExpandedAsciiTextColumns"],"sources":["../../src/editor/textMeasure.d.ts"],"sourcesContent":["export declare class Metrics {\n #private;\n /** Width of the '0' character. */\n ch: number;\n /** Size of a tab(\\t) character. */\n tabSize: number;\n /** Height of the code line. */\n lineHeight: number;\n /** initialize the metrics */\n init(root: HTMLElement): void;\n /** measure the width of the text */\n measureTextWidth(text: string): number;\n /** measure the width of the text using the canvas measureText API */\n canvasMeasureTextWidth(text: string): number;\n /**\n * measure the width of the text using the DOM\n * this is slow because it cause a reflow, use it for non-ascii text\n */\n domMeasureTextWidth(text: string): number;\n}\n/** Check if the text needs DOM text measurement. */\nexport declare function needsDomTextMeasurement(text: string): boolean;\n/** snap the text offset to the Unicode boundary */\nexport declare function snapTextOffsetToUnicodeBoundary(text: string, offset: number): number;\n/** get the offsets of the Unicode grapheme clusters in the text */\nexport declare function getUnicodeMeasurementOffsets(text: string): number[] | undefined;\n/** get the number of columns of the ASCII text */\nexport declare function getExpandedAsciiTextColumns(text: string, tabSize: number): number;\n//# sourceMappingURL=textMeasure.d.ts.map"],"mappings":";cAAqBA,OAAAA;EAAAA,CAAAA,OAAAA;EAqBGE;EAEAC,EAAAA,EAAAA,MAAAA;EAEAC;EAEAC,OAAAA,EAAAA,MAAAA;;;;aAlBTJ;;;;;;;;;;;;iBAYSC,uBAAAA;;iBAEAC,+BAAAA;;iBAEAC,4BAAAA;;iBAEAC,2BAAAA"}
1
+ {"version":3,"file":"textMeasure.d.ts","names":["Metrics","HTMLElement","needsDomTextMeasurement","snapTextOffsetToUnicodeBoundary","getUnicodeMeasurementOffsets","getExpandedAsciiTextColumns"],"sources":["../../src/editor/textMeasure.d.ts"],"sourcesContent":["export declare class Metrics {\n #private;\n /** Width of the '0' character. */\n ch: number;\n /** Size of a tab(\\t) character. */\n tabSize: number;\n /** Height of the code line. */\n lineHeight: number;\n paddingTop: number;\n /** initialize the metrics */\n init(root: HTMLElement): void;\n /** measure the width of the text */\n measureTextWidth(text: string): number;\n /** measure the width of the text using the canvas measureText API */\n canvasMeasureTextWidth(text: string): number;\n /**\n * measure the width of the text using the DOM\n * this is slow because it cause a reflow, use it for non-ascii text\n */\n domMeasureTextWidth(text: string): number;\n}\n/** Check if the text needs DOM text measurement. */\nexport declare function needsDomTextMeasurement(text: string): boolean;\n/** snap the text offset to the Unicode boundary */\nexport declare function snapTextOffsetToUnicodeBoundary(text: string, offset: number): number;\n/** get the offsets of the Unicode grapheme clusters in the text */\nexport declare function getUnicodeMeasurementOffsets(text: string): number[] | undefined;\n/** get the number of columns of the ASCII text */\nexport declare function getExpandedAsciiTextColumns(text: string, tabSize: number): number;\n//# sourceMappingURL=textMeasure.d.ts.map"],"mappings":";cAAqBA,OAAAA;EAAAA,CAAAA,OAAAA;EAsBGE;EAEAC,EAAAA,EAAAA,MAAAA;EAEAC;EAEAC,OAAAA,EAAAA,MAAAA;;;;;aAlBTJ;;;;;;;;;;;;iBAYSC,uBAAAA;;iBAEAC,+BAAAA;;iBAEAC,4BAAAA;;iBAEAC,2BAAAA"}