@aparte/plugin-diff 0.0.0-stage → 1.7.0

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.
@@ -0,0 +1,45 @@
1
+ /**
2
+ * `setupDiff()` — a tool's result shown as a diff, under the tool's line in the reply.
3
+ *
4
+ * An edit tool's row keeps everything core gives it: its name, the summary the app set, its
5
+ * states (running, waiting for approval, refused, failed). What it holds behind its line is
6
+ * the change, opened — `<aparte-diff>` in place of the raw Input and Output. Through the
7
+ * display's `details`, so it is the same row in every framework and every state.
8
+ *
9
+ * DOM-free at import: the element is created only when a chat draws a resolved call, in a
10
+ * browser. On a server the setup registers the same display and draws nothing.
11
+ */
12
+ import { type AparteConfig, type AparteToolCallSegment, type AparteToolMatcher } from '@aparte/core';
13
+ import type { AparteDiffInput } from './types.js';
14
+ /** How an app shows a tool's result as a diff. */
15
+ export interface DiffSetupOptions {
16
+ /** The tool (or tools) whose result is a change. */
17
+ tool: AparteToolMatcher | AparteToolMatcher[];
18
+ /**
19
+ * The change, from the tool's result — its `structuredContent` when it has one, else its
20
+ * text parsed as JSON, else the text — and the call's input: a unified diff's text,
21
+ * `{ path, before, after }`, or a list of files. Return `null` for a result with no change
22
+ * to show. Without `map`, the result must already be one of those.
23
+ */
24
+ map?: (result: any, input: Record<string, unknown>, segment: AparteToolCallSegment) => AparteDiffInput | null | undefined;
25
+ /** Let the reader comment on its lines: `aparte-diff-comment` bubbles out of the chat. Off by default. */
26
+ commentable?: boolean;
27
+ /** Show the diff opened under the line (the default), or `false` for closed until the reader opens it. */
28
+ open?: boolean;
29
+ }
30
+ /**
31
+ * Show a tool's result as a diff, under the tool's line in the reply. Returns the function that
32
+ * takes it off again.
33
+ *
34
+ * The rest of the tool's display (its label, its summary, its icon) stays the app's: set it
35
+ * with `registerToolDisplay` before or after. Taking the setup off gives back what the tool
36
+ * showed behind its line before.
37
+ *
38
+ * @example
39
+ * setupDiff({
40
+ * tool: 'edit_file',
41
+ * map: (result, input) => ({ path: String(input.path), before: result.before, after: result.after }),
42
+ * });
43
+ */
44
+ export declare function setupDiff(options: DiffSetupOptions, config?: AparteConfig): () => void;
45
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAsB,KAAK,YAAY,EAAE,KAAK,qBAAqB,EAA0B,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjJ,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,kDAAkD;AAClD,MAAM,WAAW,gBAAgB;IAC7B,oDAAoD;IACpD,IAAI,EAAE,iBAAiB,GAAG,iBAAiB,EAAE,CAAC;IAC9C;;;;;OAKG;IAGH,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,qBAAqB,KAAK,eAAe,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1H,0GAA0G;IAC1G,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0GAA0G;IAC1G,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAqCD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,GAAE,YAAiC,GAAG,MAAM,IAAI,CAuD1G"}
@@ -0,0 +1,5 @@
1
+ /** The sheet, as the element puts it on the page. */
2
+ export declare const DIFF_STYLES: string;
3
+ /** Put the sheet on the page, unless it is there already. */
4
+ export declare function ensureStyles(doc?: Document): void;
5
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAOA,qDAAqD;AACrD,eAAO,MAAM,WAAW,QAAS,CAAC;AAElC,6DAA6D;AAC7D,wBAAgB,YAAY,CAAC,GAAG,GAAE,QAAmB,GAAG,IAAI,CAM3D"}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * The shape of a change, shared by the computation (`diffTexts`, `parseUnifiedDiff`), the
3
+ * element and the setup. Plain data: no DOM, so a server can build it and send it as JSON.
4
+ */
5
+ /** What a line of a hunk is: unchanged, added, or removed. */
6
+ export type AparteDiffLineKind = 'context' | 'add' | 'del';
7
+ /** One line of a hunk. */
8
+ export interface AparteDiffLine {
9
+ kind: AparteDiffLineKind;
10
+ /** The line's text, without its `+` / `-` / space marker and without its line ending. */
11
+ text: string;
12
+ /** Its number in the old file: on a removed or an unchanged line. */
13
+ oldLine?: number;
14
+ /** Its number in the new file: on an added or an unchanged line. */
15
+ newLine?: number;
16
+ /** The file ends on this line without a newline (``). */
17
+ noNewline?: boolean;
18
+ }
19
+ /** A run of changes with the unchanged lines around them, as one `@@ … @@` block. */
20
+ export interface AparteDiffHunk {
21
+ /** The first old line the hunk covers (the line before it when `oldCount` is 0). */
22
+ oldStart: number;
23
+ oldCount: number;
24
+ /** The first new line the hunk covers (the line before it when `newCount` is 0). */
25
+ newStart: number;
26
+ newCount: number;
27
+ /** What follows the second `@@`, when the tool that made the diff wrote it: the function the hunk is in. */
28
+ section?: string;
29
+ lines: AparteDiffLine[];
30
+ }
31
+ /** What happened to a file. */
32
+ export type AparteDiffFileStatus = 'modified' | 'added' | 'deleted' | 'renamed';
33
+ /** One file's change. */
34
+ export interface AparteDiffFile {
35
+ /** The file's path: the new one, or the old one for a deleted file. */
36
+ path: string;
37
+ /** Its path before, when it was renamed. */
38
+ oldPath?: string;
39
+ /** What happened to it. Absent reads as `modified`, or `renamed` when `oldPath` differs from `path`. */
40
+ status?: AparteDiffFileStatus;
41
+ /** How many lines were added. */
42
+ added: number;
43
+ /** How many lines were removed. */
44
+ removed: number;
45
+ hunks: AparteDiffHunk[];
46
+ /** A binary file: the diff says it changed, and shows no line. */
47
+ binary?: boolean;
48
+ }
49
+ /**
50
+ * A file's text before and after: the element computes the diff, and can show every unchanged
51
+ * line. A side that does not exist is `null` — `before: null` for a file created, `after: null`
52
+ * for one deleted — and `''` is a file that exists and is empty.
53
+ */
54
+ export interface AparteDiffSource {
55
+ path: string;
56
+ before: string | null;
57
+ after: string | null;
58
+ /** Its path before, when it was renamed. */
59
+ oldPath?: string;
60
+ }
61
+ /** What `<aparte-diff>` shows: a unified diff's text, a file's two texts, or a list of files. */
62
+ export type AparteDiffInput = string | AparteDiffSource | ReadonlyArray<AparteDiffFile | AparteDiffSource>;
63
+ /** Which side of the change a line number counts on: the old file, or the new one. */
64
+ export type AparteDiffSide = 'old' | 'new';
65
+ /** A comment on a line or a range, as the app hands it to `<aparte-diff>` to show. */
66
+ export interface AparteDiffComment {
67
+ /** Yours, to tell comments apart. The element does not read it. */
68
+ id?: string;
69
+ path: string;
70
+ side: AparteDiffSide;
71
+ startLine: number;
72
+ endLine: number;
73
+ text: string;
74
+ /** Where it stands: kept to be sent (`pending`), or sent. Shown beside the comment. */
75
+ state?: 'pending' | 'sent';
76
+ }
77
+ /**
78
+ * A reader wrote a comment on a line or a range of `<aparte-diff commentable>` and sent it.
79
+ * Bubbles out of the chat, and is cancelable: cancel it to keep the form open with the text
80
+ * (the comment could not be kept, say). The element shows nothing of it on its own: hand it
81
+ * back through `comments` to show it under its lines.
82
+ *
83
+ * @event aparte-diff-comment
84
+ */
85
+ export interface AparteDiffCommentEventDetail {
86
+ path: string;
87
+ side: AparteDiffSide;
88
+ startLine: number;
89
+ endLine: number;
90
+ text: string;
91
+ /** The lines commented on, as they read on that side, joined with `\n`. */
92
+ code: string;
93
+ }
94
+ interface DiffEventMap {
95
+ 'aparte-diff-comment': CustomEvent<AparteDiffCommentEventDetail>;
96
+ }
97
+ declare global {
98
+ interface HTMLElementEventMap extends DiffEventMap {
99
+ }
100
+ interface DocumentEventMap extends DiffEventMap {
101
+ }
102
+ interface WindowEventMap extends DiffEventMap {
103
+ }
104
+ }
105
+ export {};
106
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,8DAA8D;AAC9D,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,CAAC;AAE3D,0BAA0B;AAC1B,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,kBAAkB,CAAC;IACzB,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,qFAAqF;AACrF,MAAM,WAAW,cAAc;IAC3B,oFAAoF;IACpF,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,4GAA4G;IAC5G,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,cAAc,EAAE,CAAC;CAC3B;AAED,+BAA+B;AAC/B,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAEhF,yBAAyB;AACzB,MAAM,WAAW,cAAc;IAC3B,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wGAAwG;IACxG,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,kEAAkE;IAClE,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iGAAiG;AACjG,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,gBAAgB,GAAG,aAAa,CAAC,cAAc,GAAG,gBAAgB,CAAC,CAAC;AAE3G,sFAAsF;AACtF,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,CAAC;AAE3C,sFAAsF;AACtF,MAAM,WAAW,iBAAiB;IAC9B,mEAAmE;IACnE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,uFAAuF;IACvF,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,4BAA4B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;CAChB;AAKD,UAAU,YAAY;IAClB,qBAAqB,EAAE,WAAW,CAAC,4BAA4B,CAAC,CAAC;CACpE;AACD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,mBAAoB,SAAQ,YAAY;KAAG;IACrD,UAAU,gBAAiB,SAAQ,YAAY;KAAG;IAClD,UAAU,cAAe,SAAQ,YAAY;KAAG;CACnD"}
@@ -0,0 +1,334 @@
1
+ /**
2
+ * The words `<aparte-diff>` says, in the chat's language.
3
+ *
4
+ * Core's locale is a closed list of what CORE draws, so this plugin reads its own keys off
5
+ * `getLocale()` and defaults them here: the app's locale first, then this table for the
6
+ * chat's language (the ten `@aparte/locales` ships), then English.
7
+ *
8
+ * aparteGlobalConfig.extendLocale({ diffCommentSubmit: 'Envoyer' });
9
+ *
10
+ * A count is a set of plural forms, each named by its `Intl.PluralRules` category, as core's
11
+ * `turnTools` is: Russian needs `few` and `many`, Japanese, Korean and Chinese one form.
12
+ */
13
+ import { type AparteConfig } from '@aparte/core';
14
+ export declare const WORDS: {
15
+ /** A file's added lines, said to a screen reader beside the `+3` it shows. */
16
+ diffAdded: {
17
+ en: string;
18
+ fr: string;
19
+ de: string;
20
+ es: string;
21
+ it: string;
22
+ ja: string;
23
+ ko: string;
24
+ pt: string;
25
+ ru: string;
26
+ zh: string;
27
+ };
28
+ /** A file's removed lines, said to a screen reader beside the `−1` it shows. */
29
+ diffRemoved: {
30
+ en: string;
31
+ fr: string;
32
+ de: string;
33
+ es: string;
34
+ it: string;
35
+ ja: string;
36
+ ko: string;
37
+ pt: string;
38
+ ru: string;
39
+ zh: string;
40
+ };
41
+ /** What the `+` of an added line says to a screen reader. */
42
+ diffMarkerAdded: {
43
+ en: string;
44
+ fr: string;
45
+ de: string;
46
+ es: string;
47
+ it: string;
48
+ ja: string;
49
+ ko: string;
50
+ pt: string;
51
+ ru: string;
52
+ zh: string;
53
+ };
54
+ /** What the `−` of a removed line says to a screen reader. */
55
+ diffMarkerRemoved: {
56
+ en: string;
57
+ fr: string;
58
+ de: string;
59
+ es: string;
60
+ it: string;
61
+ ja: string;
62
+ ko: string;
63
+ pt: string;
64
+ ru: string;
65
+ zh: string;
66
+ };
67
+ /** The button over a run of unchanged lines the element can show. */
68
+ diffShowUnchanged: {
69
+ en: string;
70
+ fr: string;
71
+ de: string;
72
+ es: string;
73
+ it: string;
74
+ ja: string;
75
+ ko: string;
76
+ pt: string;
77
+ ru: string;
78
+ zh: string;
79
+ };
80
+ /** A run of unchanged lines the diff does not hold (a unified diff's text), between two hunks. */
81
+ diffUnchanged: {
82
+ en: string;
83
+ fr: string;
84
+ de: string;
85
+ es: string;
86
+ it: string;
87
+ ja: string;
88
+ ko: string;
89
+ pt: string;
90
+ ru: string;
91
+ zh: string;
92
+ };
93
+ /** A new file's tag, beside its path. */
94
+ diffStatusAdded: {
95
+ en: string;
96
+ fr: string;
97
+ de: string;
98
+ es: string;
99
+ it: string;
100
+ ja: string;
101
+ ko: string;
102
+ pt: string;
103
+ ru: string;
104
+ zh: string;
105
+ };
106
+ /** A deleted file's tag, beside its path. */
107
+ diffStatusDeleted: {
108
+ en: string;
109
+ fr: string;
110
+ de: string;
111
+ es: string;
112
+ it: string;
113
+ ja: string;
114
+ ko: string;
115
+ pt: string;
116
+ ru: string;
117
+ zh: string;
118
+ };
119
+ /** A renamed file's tag, beside its paths. */
120
+ diffStatusRenamed: {
121
+ en: string;
122
+ fr: string;
123
+ de: string;
124
+ es: string;
125
+ it: string;
126
+ ja: string;
127
+ ko: string;
128
+ pt: string;
129
+ ru: string;
130
+ zh: string;
131
+ };
132
+ /** Where a binary file's lines would be. */
133
+ diffBinary: {
134
+ en: string;
135
+ fr: string;
136
+ de: string;
137
+ es: string;
138
+ it: string;
139
+ ja: string;
140
+ ko: string;
141
+ pt: string;
142
+ ru: string;
143
+ zh: string;
144
+ };
145
+ /** Under the last line of a file that ends without a newline. */
146
+ diffNoNewline: {
147
+ en: string;
148
+ fr: string;
149
+ de: string;
150
+ es: string;
151
+ it: string;
152
+ ja: string;
153
+ ko: string;
154
+ pt: string;
155
+ ru: string;
156
+ zh: string;
157
+ };
158
+ /** An unchanged line's number, as its button and a comment name it. */
159
+ diffLine: {
160
+ en: string;
161
+ fr: string;
162
+ de: string;
163
+ es: string;
164
+ it: string;
165
+ ja: string;
166
+ ko: string;
167
+ pt: string;
168
+ ru: string;
169
+ zh: string;
170
+ };
171
+ /** An added line's number, as its button names it. */
172
+ diffLineAdded: {
173
+ en: string;
174
+ fr: string;
175
+ de: string;
176
+ es: string;
177
+ it: string;
178
+ ja: string;
179
+ ko: string;
180
+ pt: string;
181
+ ru: string;
182
+ zh: string;
183
+ };
184
+ /** A removed line's number, as its button and a comment name it. */
185
+ diffLineRemoved: {
186
+ en: string;
187
+ fr: string;
188
+ de: string;
189
+ es: string;
190
+ it: string;
191
+ ja: string;
192
+ ko: string;
193
+ pt: string;
194
+ ru: string;
195
+ zh: string;
196
+ };
197
+ /** A range a comment is on. */
198
+ diffLines: {
199
+ en: string;
200
+ fr: string;
201
+ de: string;
202
+ es: string;
203
+ it: string;
204
+ ja: string;
205
+ ko: string;
206
+ pt: string;
207
+ ru: string;
208
+ zh: string;
209
+ };
210
+ /** A range of removed lines a comment is on. */
211
+ diffLinesRemoved: {
212
+ en: string;
213
+ fr: string;
214
+ de: string;
215
+ es: string;
216
+ it: string;
217
+ ja: string;
218
+ ko: string;
219
+ pt: string;
220
+ ru: string;
221
+ zh: string;
222
+ };
223
+ /** The comment field's name, on one line. */
224
+ diffCommentLine: {
225
+ en: string;
226
+ fr: string;
227
+ de: string;
228
+ es: string;
229
+ it: string;
230
+ ja: string;
231
+ ko: string;
232
+ pt: string;
233
+ ru: string;
234
+ zh: string;
235
+ };
236
+ /** The comment field's name, on a range. */
237
+ diffCommentLines: {
238
+ en: string;
239
+ fr: string;
240
+ de: string;
241
+ es: string;
242
+ it: string;
243
+ ja: string;
244
+ ko: string;
245
+ pt: string;
246
+ ru: string;
247
+ zh: string;
248
+ };
249
+ /** What the empty comment field shows. */
250
+ diffCommentPlaceholder: {
251
+ en: string;
252
+ fr: string;
253
+ de: string;
254
+ es: string;
255
+ it: string;
256
+ ja: string;
257
+ ko: string;
258
+ pt: string;
259
+ ru: string;
260
+ zh: string;
261
+ };
262
+ /** The button that sends the comment. */
263
+ diffCommentSubmit: {
264
+ en: string;
265
+ fr: string;
266
+ de: string;
267
+ es: string;
268
+ it: string;
269
+ ja: string;
270
+ ko: string;
271
+ pt: string;
272
+ ru: string;
273
+ zh: string;
274
+ };
275
+ /** The button that closes the comment field. */
276
+ diffCommentCancel: {
277
+ en: string;
278
+ fr: string;
279
+ de: string;
280
+ es: string;
281
+ it: string;
282
+ ja: string;
283
+ ko: string;
284
+ pt: string;
285
+ ru: string;
286
+ zh: string;
287
+ };
288
+ /** A comment kept to be sent. */
289
+ diffCommentPending: {
290
+ en: string;
291
+ fr: string;
292
+ de: string;
293
+ es: string;
294
+ it: string;
295
+ ja: string;
296
+ ko: string;
297
+ pt: string;
298
+ ru: string;
299
+ zh: string;
300
+ };
301
+ /** A comment that was sent. */
302
+ diffCommentSent: {
303
+ en: string;
304
+ fr: string;
305
+ de: string;
306
+ es: string;
307
+ it: string;
308
+ ja: string;
309
+ ko: string;
310
+ pt: string;
311
+ ru: string;
312
+ zh: string;
313
+ };
314
+ /** A diff with no change in it. */
315
+ diffEmpty: {
316
+ en: string;
317
+ fr: string;
318
+ de: string;
319
+ es: string;
320
+ it: string;
321
+ ja: string;
322
+ ko: string;
323
+ pt: string;
324
+ ru: string;
325
+ zh: string;
326
+ };
327
+ };
328
+ export type WordKey = keyof typeof WORDS;
329
+ /**
330
+ * The word for `key`: the app's locale, else this table in the chat's language, else English;
331
+ * `{name}` slots filled from `vars`, and a count's plural form chosen when `vars.n` is a number.
332
+ */
333
+ export declare function word(config: AparteConfig, key: WordKey, vars?: Record<string, string | number>): string;
334
+ //# sourceMappingURL=words.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"words.d.ts","sourceRoot":"","sources":["../src/words.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAK5D,eAAO,MAAM,KAAK;IACd,8EAA8E;;;;;;;;;;;;;IAa9E,gFAAgF;;;;;;;;;;;;;IAahF,6DAA6D;;;;;;;;;;;;;IAK7D,8DAA8D;;;;;;;;;;;;;IAK9D,qEAAqE;;;;;;;;;;;;;IAarE,kGAAkG;;;;;;;;;;;;;IAalG,yCAAyC;;;;;;;;;;;;;IAKzC,6CAA6C;;;;;;;;;;;;;IAK7C,8CAA8C;;;;;;;;;;;;;IAK9C,4CAA4C;;;;;;;;;;;;;IAQ5C,iEAAiE;;;;;;;;;;;;;IAQjE,uEAAuE;;;;;;;;;;;;;IAKvE,sDAAsD;;;;;;;;;;;;;IAMtD,oEAAoE;;;;;;;;;;;;;IAMpE,+BAA+B;;;;;;;;;;;;;IAM/B,gDAAgD;;;;;;;;;;;;;IAOhD,6CAA6C;;;;;;;;;;;;;IAM7C,4CAA4C;;;;;;;;;;;;;IAO5C,0CAA0C;;;;;;;;;;;;;IAM1C,yCAAyC;;;;;;;;;;;;;IAKzC,gDAAgD;;;;;;;;;;;;;IAKhD,iCAAiC;;;;;;;;;;;;;IAKjC,+BAA+B;;;;;;;;;;;;;IAK/B,mCAAmC;;;;;;;;;;;;;CAKP,CAAC;AAEjC,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,KAAK,CAAC;AAQzC;;;GAGG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAM,GAAG,MAAM,CAS3G"}
package/package.json CHANGED
@@ -1,6 +1,95 @@
1
1
  {
2
2
  "name": "@aparte/plugin-diff",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.7.0",
4
+ "homepage": "https://apartejs.dev/components/diff/",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "description": "A diff view for aparté — a file change as hunks with old and new line numbers, in the reply or beside it, with comments on a line or a range.",
9
+ "customElements": "dist/custom-elements.json",
10
+ "type": "module",
11
+ "sideEffects": [
12
+ "./dist/*.js",
13
+ "./src/index.ts",
14
+ "./src/aparte-diff.ts"
15
+ ],
16
+ "main": "./dist/index.js",
17
+ "module": "./dist/index.js",
18
+ "types": "./dist/index.d.ts",
19
+ "exports": {
20
+ ".": {
21
+ "@aparte-workspace/source": "./src/index.ts",
22
+ "node": {
23
+ "types": "./dist/index.node.d.ts",
24
+ "default": "./dist/index.node.js"
25
+ },
26
+ "worker": {
27
+ "types": "./dist/index.node.d.ts",
28
+ "default": "./dist/index.node.js"
29
+ },
30
+ "workerd": {
31
+ "types": "./dist/index.node.d.ts",
32
+ "default": "./dist/index.node.js"
33
+ },
34
+ "edge-light": {
35
+ "types": "./dist/index.node.d.ts",
36
+ "default": "./dist/index.node.js"
37
+ },
38
+ "deno": {
39
+ "types": "./dist/index.node.d.ts",
40
+ "default": "./dist/index.node.js"
41
+ },
42
+ "bun": {
43
+ "types": "./dist/index.node.d.ts",
44
+ "default": "./dist/index.node.js"
45
+ },
46
+ "types": "./dist/index.d.ts",
47
+ "import": "./dist/index.js",
48
+ "default": "./dist/index.js"
49
+ }
50
+ },
51
+ "files": [
52
+ "dist",
53
+ "README.md",
54
+ "LICENSE"
55
+ ],
56
+ "engines": {
57
+ "node": ">=18"
58
+ },
59
+ "peerDependencies": {
60
+ "@aparte/core": ">=1.7.0 <2.0.0"
61
+ },
62
+ "devDependencies": {
63
+ "@custom-elements-manifest/analyzer": "^0.11.0",
64
+ "typescript": "^5.4.0",
65
+ "vite": "^6.0.0",
66
+ "@aparte/core": "1.7.0"
67
+ },
68
+ "keywords": [
69
+ "aparte",
70
+ "plugin",
71
+ "diff",
72
+ "unified-diff",
73
+ "code-review",
74
+ "patch",
75
+ "web-components"
76
+ ],
77
+ "license": "MIT",
78
+ "repository": {
79
+ "type": "git",
80
+ "url": "git+https://github.com/apartejs/aparte.git",
81
+ "directory": "packages/plugins/diff"
82
+ },
83
+ "bugs": {
84
+ "url": "https://github.com/apartejs/aparte/issues"
85
+ },
86
+ "scripts": {
87
+ "dev": "vite",
88
+ "build": "vite build && tsc -b --emitDeclarationOnly --force && pnpm run analyze && node ../../../scripts/stamp-dist.mjs",
89
+ "analyze": "cem analyze",
90
+ "preview": "vite preview",
91
+ "test": "vitest",
92
+ "test:run": "vitest run",
93
+ "test:coverage": "vitest run --coverage"
94
+ }
6
95
  }