svelte-highlight 7.4.2 → 7.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md DELETED
@@ -1,428 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [7.4.2](https://github.com/metonym/svelte-highlight/releases/tag/v7.4.2) - 2023-11-25
9
-
10
- **Fixes**
11
-
12
- - Re-publish package with [provenance](https://docs.npmjs.com/generating-provenance-statements)
13
-
14
- ## [7.4.1](https://github.com/metonym/svelte-highlight/releases/tag/v7.4.1) - 2023-10-13
15
-
16
- **Fixes**
17
-
18
- - Re-publish package after correctly building it
19
-
20
- ## [7.4.0](https://github.com/metonym/svelte-highlight/releases/tag/v7.4.0) - 2023-10-13
21
-
22
- **Features**
23
-
24
- - upgrade `highlight.js` to version [11.9.0](https://github.com/highlightjs/highlight.js/releases/tag/11.9.0)
25
-
26
- ## [7.3.0](https://github.com/metonym/svelte-highlight/releases/tag/v7.3.0) - 2023-05-13
27
-
28
- **Features**
29
-
30
- - upgrade `highlight.js` to version [11.8.0](https://github.com/highlightjs/highlight.js/releases/tag/11.8.0)
31
-
32
- ## [7.2.1](https://github.com/metonym/svelte-highlight/releases/tag/v7.2.1) - 2023-04-01
33
-
34
- **Fixes**
35
-
36
- - line numbers should not be covered by a solid fill, custom line background color
37
- - line numbers column should not be covered by code if scrollable
38
-
39
- ## [7.2.0](https://github.com/metonym/svelte-highlight/releases/tag/v7.2.0) - 2023-02-14
40
-
41
- **Features**
42
-
43
- - support highlighted lines in `LineNumbers` through the `highlightedLines` prop
44
-
45
- ## [7.1.2](https://github.com/metonym/svelte-highlight/releases/tag/v7.1.2) - 2023-01-01
46
-
47
- **Fixes**
48
-
49
- - correctly set top/bottom padding in `LineNumbers` if `code` is updated
50
-
51
- ## [7.1.1](https://github.com/metonym/svelte-highlight/releases/tag/v7.1.1) - 2022-12-31
52
-
53
- **Fixes**
54
-
55
- - republish package
56
-
57
- ## [7.1.0](https://github.com/metonym/svelte-highlight/releases/tag/v7.1.0) - 2022-12-31
58
-
59
- **Features**
60
-
61
- - add `startingLineNumber` prop to `LineNumbers`
62
-
63
- ## [7.0.1](https://github.com/metonym/svelte-highlight/releases/tag/v7.0.1) - 2022-12-30
64
-
65
- **Fixes**
66
-
67
- - reset `table` styles in `LineNumbers`
68
-
69
- ## [7.0.0](https://github.com/metonym/svelte-highlight/releases/tag/v7.0.0) - 2022-12-30
70
-
71
- **Breaking Changes**
72
-
73
- - rename langtag style props
74
- - `--hljs-background` -> `--langtag-background`
75
- - `--hljs-foreground` -> `--langtag-color`
76
- - `--hljs-radius` -> `--langtag-border-radius`
77
- - mark `code`, `language` as required props
78
-
79
- **Features**
80
-
81
- - include inferred `language` in `on:highlight` event detail in `HighlightAuto`
82
- - add `LineNumbers` component to support rendering line numbers
83
- - upgrade `highlight.js` to version [11.7.0](https://github.com/highlightjs/highlight.js/releases/tag/11.7.0)
84
-
85
- **Fixes**
86
-
87
- - use `HTMLAttributes` from `svelte/elements` to correctly type `$$restProps`
88
-
89
- ## [6.2.1](https://github.com/metonym/svelte-highlight/releases/tag/v6.2.1) - 2022-08-07
90
-
91
- **Fixes**
92
-
93
- - generate types for `svelte-highlight/languages/*`, `svelte-highlight/styles/*`
94
-
95
- **Documentation**
96
-
97
- - add dynamic import example
98
- - document CDN styles usage
99
- - use TypeScript in all example set-ups
100
- - remove Snowpack example as it is no longer maintained
101
- - update set-up instructions for SvelteKit/Vite
102
-
103
- ## [6.2.0](https://github.com/metonym/svelte-highlight/releases/tag/v6.2.0) - 2022-07-13
104
-
105
- **Features**
106
-
107
- - upgrade `highlight.js` to version [11.6.0](https://github.com/highlightjs/highlight.js/releases/tag/11.6.0) (net +2 styles)
108
-
109
- ## [6.1.1](https://github.com/metonym/svelte-highlight/releases/tag/v6.1.1) - 2022-07-02
110
-
111
- **Fixes**
112
-
113
- - remove `language` prop type from `HighlightAuto` TypeScript definitions
114
-
115
- ## [6.1.1](https://github.com/metonym/svelte-highlight/releases/tag/v6.1.1) - 2022-06-27
116
-
117
- **Refactor**
118
-
119
- - remove unnecessary `language` null check when setting `data-language` attribute
120
- - reduce `.langtag` CSS specificity
121
-
122
- ## [6.1.0](https://github.com/metonym/svelte-highlight/releases/tag/v6.1.0) - 2022-06-10
123
-
124
- **Features**
125
-
126
- - port Svelte components to TypeScript
127
-
128
- **Documentation**
129
-
130
- - fix prop table types and default values
131
-
132
- ## [6.0.1](https://github.com/metonym/svelte-highlight/releases/tag/v6.0.1) - 2022-03-26
133
-
134
- **Fixes**
135
-
136
- - update generated `SUPPORTED_LANGUAGES.md` and `SUPPORTED_STYLES.md`
137
-
138
- ## [6.0.0](https://github.com/metonym/svelte-highlight/releases/tag/v6.0.0) - 2022-03-26
139
-
140
- **Breaking Changes**
141
-
142
- - use SvelteKit to package the library and auto-generate TypeScript definitions
143
- - styles are moved from `src/styles` to `styles`
144
- - languages are moved from `src/languages` to `languages`
145
-
146
- ## [5.3.2](https://github.com/metonym/svelte-highlight/releases/tag/v5.3.2) - 2022-03-16
147
-
148
- - specify in docs that Vite should optimize both "highlight.js" and "highlight.js/lib/core" if using SvelteKit or Vite
149
-
150
- ## [5.3.1](https://github.com/metonym/svelte-highlight/releases/tag/v5.3.1) - 2022-03-16
151
-
152
- - use default highlight.js library for `HighlightAuto`
153
-
154
- ## [5.3.0](https://github.com/metonym/svelte-highlight/releases/tag/v5.3.0) - 2022-03-12
155
-
156
- - upgrade `highlight.js` to version 11.5.0 (net +1 language, +3 styles)
157
-
158
- ## [5.2.2](https://github.com/metonym/svelte-highlight/releases/tag/v5.2.2) - 2022-02-25
159
-
160
- - use default export from `highlight.js/lib/core.js`
161
-
162
- ## [5.2.1](https://github.com/metonym/svelte-highlight/releases/tag/v5.2.1) - 2022-02-11
163
-
164
- - remove whitespace from `pre`tags because Svelte v3.46.4 now preserves`pre` whitespace
165
-
166
- ## [5.2.0](https://github.com/metonym/svelte-highlight/releases/tag/v5.2.0) - 2022-01-06
167
-
168
- - upgrade `highlight.js` to version 11.4.0 (net +1 style)
169
-
170
- ## [5.1.4](https://github.com/metonym/svelte-highlight/releases/tag/v5.1.4) - 2021-12-18
171
-
172
- - recommend installing `highlight.js` as a dependency for pnpm users
173
-
174
- ## [5.1.3](https://github.com/metonym/svelte-highlight/releases/tag/v5.1.3) - 2021-11-13
175
-
176
- - patch `highlight.js` to version 11.3.1
177
-
178
- ## [5.1.2](https://github.com/metonym/svelte-highlight/releases/tag/v5.1.2) - 2021-10-19
179
-
180
- **Fixes**
181
-
182
- - move TypeScript definitions components to the `src/` folder
183
-
184
- ## [5.1.1](https://github.com/metonym/svelte-highlight/releases/tag/v5.1.1) - 2021-10-19
185
-
186
- **Fixes**
187
-
188
- - emit TypeScript definitions for languages and styles to the `src/` folder
189
-
190
- ## [5.1.0](https://github.com/metonym/svelte-highlight/releases/tag/v5.1.0) - 2021-10-17
191
-
192
- **Features**
193
-
194
- - upgrade `highlight.js` to v11.3.0
195
-
196
- ## [5.0.0](https://github.com/metonym/svelte-highlight/releases/tag/v5.0.0) - 2021-10-08
197
-
198
- **Breaking Changes**
199
-
200
- - use `.svelte.d.ts` extension for TypeScript definitions
201
-
202
- ## [4.0.0](https://github.com/metonym/svelte-highlight/releases/tag/v4.0.0) - 2021-09-16
203
-
204
- **Breaking Changes**
205
-
206
- - move `.hljs` class from `pre` element to `code` to align with the intended usage of `highlight.js`
207
- - change padding of `pre.langtag::after` to `1em` to prevent overpadding
208
-
209
- ## [3.4.0](https://github.com/metonym/svelte-highlight/releases/tag/v3.4.0) - 2021-09-12
210
-
211
- **Features**
212
-
213
- - add `data-language` attribute to `pre` element to allow targeted styling
214
- - add `langtag` prop that displays the highlighted language if enabled
215
-
216
- ## [3.3.0](https://github.com/metonym/svelte-highlight/releases/tag/v3.3.0) - 2021-09-01
217
-
218
- **Features**
219
-
220
- - include named language export in `src/languages/*` files
221
-
222
- ## [3.2.1](https://github.com/metonym/svelte-highlight/releases/tag/v3.2.1) - 2021-09-01
223
-
224
- **Documentation**
225
-
226
- - update link to live demo
227
-
228
- ## [3.2.0](https://github.com/metonym/svelte-highlight/releases/tag/v3.2.0) - 2021-08-02
229
-
230
- **Features**
231
-
232
- - upgrade `highlight.js` to v11.2.0
233
-
234
- ## [3.1.0](https://github.com/metonym/svelte-highlight/releases/tag/v3.1.0) - 2021-07-08
235
-
236
- **Features**
237
-
238
- - upgrade `highlight.js` to v11.1.0
239
-
240
- ## [3.0.0](https://github.com/metonym/svelte-highlight/releases/tag/v3.0.0) - 2021-05-30
241
-
242
- **Breaking Changes**
243
-
244
- - `github-gist` style removed from `highlight.js`
245
-
246
- **Features**
247
-
248
- - upgrade `highlight.js` to v11.0.0
249
- - +2 styles (`github-dark`, `github-dark-dimmed`)
250
-
251
- ## [2.1.0](https://github.com/metonym/svelte-highlight/releases/tag/v2.1.0) - 2021-05-21
252
-
253
- **Features**
254
-
255
- - upgrade `highlight.js` to v11.0.0-beta1
256
- - +1 language (`wren`)
257
- - +1 style (`colors`)
258
-
259
- ## [2.0.0](https://github.com/metonym/svelte-highlight/releases/tag/v2.0.0) - 2021-04-30
260
-
261
- **Breaking Changes**
262
-
263
- - upgrade `highlight.js` to the next major version (v11), which supports ESM
264
- - removed languages: `c-like`, `htmlbars`, `sql_more`
265
-
266
- **Features**
267
-
268
- - added languages: `nestedtext`, `wasm`
269
- - 143 new styles
270
-
271
- ## [2.0.0-rc.1](https://github.com/metonym/svelte-highlight/releases/tag/v2.0.0-rc.1) - 2021-04-30
272
-
273
- **Fixes**
274
-
275
- - omit `.js` extension when importing `highlight.js` language
276
- - sort `types/styles/index.d.ts` by name
277
-
278
- ## [2.0.0-rc.0](https://github.com/metonym/svelte-highlight/releases/tag/v2.0.0-rc.0) - 2021-04-30
279
-
280
- **Breaking Changes**
281
-
282
- - upgrade `highlight.js` to the next major version (v11), which supports ESM
283
- - removed languages: `c-like`, `htmlbars`, `sql_more`
284
-
285
- **Features**
286
-
287
- - added languages: `nestedtext`, `wasm`
288
- - 143 new styles
289
-
290
- ## [1.0.1](https://github.com/metonym/svelte-highlight/releases/tag/v1.0.1) - 2021-04-23
291
-
292
- **Fixes**
293
-
294
- - fix typos in `README.md`
295
-
296
- ## [1.0.0](https://github.com/metonym/svelte-highlight/releases/tag/v1.0.0) - 2021-04-23
297
-
298
- **Breaking Changes**
299
-
300
- - upgrade `highlight.js` to version 10.7
301
- - remove all forwarded events from `Highlight`, `HighlightSvelte`
302
- - remove legacy component; replace with `Highlight.svelte` as the default export
303
- - remove Rollup from build process; only ship Svelte source code and languages/styles as ESM
304
- - remove `highlightjs-svelte` dependency; use XML/JavaScript/CSS as sublanguages
305
-
306
- **Features**
307
-
308
- - add `HighlightAuto` component that auto highlights code
309
- - major bundle size improvements by using only the `core` library
310
-
311
- **Fixes**
312
-
313
- - correctly type languages/styles
314
-
315
- **Other**
316
-
317
- - drop Node.js v12 from Travis CI build config
318
-
319
- **Documentation**
320
-
321
- - use SvelteKit instead of Sapper for the documentation/live demo site
322
- - provide correct NPM install command
323
-
324
- ## [0.7.1](https://github.com/metonym/svelte-highlight/releases/tag/v0.7.1) - 2021-02-13
325
-
326
- **Fixes**
327
-
328
- - include `types` folder in published files
329
-
330
- ## [0.7.0](https://github.com/metonym/svelte-highlight/releases/tag/v0.7.0) - 2021-02-13
331
-
332
- **Features**
333
-
334
- - include highlighted markup in dispatched event detail
335
- - add TypeScript definitions
336
-
337
- **Fixes**
338
-
339
- - mark CSS styles as side effects
340
-
341
- ## [0.6.2](https://github.com/metonym/svelte-highlight/releases/tag/v0.6.2) - 2020-05-10
342
-
343
- - Fix "language is undefined" error by falling back to unhighlighted code
344
-
345
- ## [0.6.1](https://github.com/metonym/svelte-highlight/releases/tag/v0.6.1) - 2020-05-10
346
-
347
- - Refactor build process to reduce bundled package size
348
-
349
- ## [0.6.0](https://github.com/metonym/svelte-highlight/releases/tag/v0.6.0) - 2020-05-03
350
-
351
- - Export new `Highlight`, `HighlightSvelte` components; maintain backwards compatibility with `Legacy` component
352
-
353
- - Require svelte^3.20.x as a peer dependency due to usage of the `$$restProps` API
354
-
355
- - Support Svelte syntax highlighting by wrapping `highlightjs-svelte`
356
-
357
- - Dispatch `highlight` event
358
-
359
- - Forward the following events to the `pre` element (on:click, on:mouseover, on:mouseenter, on:mouseleave, on:focus, on:blur)
360
-
361
- ## [0.5.0](https://github.com/metonym/svelte-highlight/releases/tag/v0.5.0) - 2020-03-27
362
-
363
- - Add editable support by exporting `contenteditable`, `spellcheck` props
364
- ([#105](https://github.com/metonym/svelte-highlight/issues/105))
365
-
366
- ## [0.4.1](https://github.com/metonym/svelte-highlight/releases/tag/v0.4.1) - 2020-02-01
367
-
368
- - Bump `highlight.js` version from `9.17.1` to `9.18.1`
369
-
370
- ## [0.4.0](https://github.com/metonym/svelte-highlight/releases/tag/v0.4.0) - 2019-12-18
371
-
372
- - Pass `id`, `style`, `class` props to `pre` element
373
- ([#48](https://github.com/metonym/svelte-highlight/issues/48))
374
-
375
- - Deprecate `darkula` style
376
- ([#49](https://github.com/metonym/svelte-highlight/issues/49))
377
-
378
- ## [0.3.5](https://github.com/metonym/svelte-highlight/releases/tag/v0.3.5) - 2019-12-14
379
-
380
- - Use `gh-pages` to publish demo
381
-
382
- - Move documentation for supported languages, styles to `docs` folder
383
-
384
- ## [0.3.4](https://github.com/metonym/svelte-highlight/releases/tag/v0.3.4) - 2019-12-14
385
-
386
- - Bump highlight.js from 9.17.0 to 9.17.1
387
-
388
- ## [0.3.3](https://github.com/metonym/svelte-highlight/releases/tag/v0.3.3) - 2019-12-12
389
-
390
- - Use consistent terminology when documenting usage
391
-
392
- - Add version number to demo
393
-
394
- ## [0.3.2](https://github.com/metonym/svelte-highlight/releases/tag/v0.3.2) - 2019-12-12
395
-
396
- - Upgrade highlight.js to v9.17.0
397
-
398
- ## [0.3.1](https://github.com/metonym/svelte-highlight/releases/tag/v0.3.1) - 2019-12-11
399
-
400
- - Move `src/docs` folder to `demo`
401
- ([#36](https://github.com/metonym/svelte-highlight/issues/36))
402
-
403
- - Document custom language highlighting in README
404
- ([#35](https://github.com/metonym/svelte-highlight/issues/35))
405
-
406
- ## [0.3.0](https://github.com/metonym/svelte-highlight/releases/tag/v0.3.0) - 2019-11-18
407
-
408
- - Add `code` prop for dynamically updating code
409
-
410
- ## [0.2.2](https://github.com/metonym/svelte-highlight/releases/tag/v0.2.2) - 2019-11-17
411
-
412
- - Add new live demo and remove storybook
413
-
414
- ## [0.2.1](https://github.com/metonym/svelte-highlight/releases/tag/v0.2.1) - 2019-11-15
415
-
416
- - Document supported languages, styles
417
-
418
- ## [0.2.0](https://github.com/metonym/svelte-highlight/releases/tag/v0.2.0) - 2019-11-10
419
-
420
- - Export highlight.js theme CSS files as JavaScript
421
-
422
- ## [0.1.1](https://github.com/metonym/svelte-highlight/releases/tag/v0.1.1) - 2019-11-09
423
-
424
- - Fix broken `svelte` import by publishing `src` folder
425
-
426
- ## [0.1.0](https://github.com/metonym/svelte-highlight/releases/tag/v0.1.0) - 2019-11-09
427
-
428
- - Initial release
package/shared.d.ts DELETED
@@ -1,61 +0,0 @@
1
- import type { HTMLAttributes } from "svelte/elements";
2
- import type { LanguageType } from "./languages";
3
-
4
- export interface Props extends HTMLAttributes<HTMLPreElement> {
5
- /**
6
- * Specify the text to highlight.
7
- */
8
- code: any;
9
-
10
- /**
11
- * Provide the language grammar used to highlight the code.
12
- * Import languages from `svelte-highlight/languages/*`.
13
- * @example
14
- * import typescript from "svelte-highlight/languages/typescript";
15
- */
16
- language: LanguageType<string>;
17
-
18
- /**
19
- * Set to `true` for the language name to be
20
- * displayed at the top right of the code block.
21
- *
22
- * Use style props to customize styles:
23
- * - `--langtag-background`
24
- * - `--langtag-color`
25
- * - `--langtag-border-radius`
26
- *
27
- * @default false
28
- */
29
- langtag?: boolean;
30
-
31
- /**
32
- * Customize the background color of the langtag.
33
- */
34
- "--langtag-background"?: string;
35
-
36
- /**
37
- * Customize the text color of the langtag.
38
- */
39
- "--langtag-color"?: string;
40
-
41
- /**
42
- * Customize the border radius of the langtag.
43
- */
44
- "--langtag-border-radius"?: string;
45
- }
46
-
47
- export interface HighlightedCode {
48
- /**
49
- * The highlighted HTML as a string.
50
- * @example "<span>...</span>"
51
- */
52
- highlighted: string;
53
- }
54
-
55
- export interface Slots {
56
- default: HighlightedCode;
57
- }
58
-
59
- export interface Events<THighlight = HighlightedCode> {
60
- highlight: CustomEvent<THighlight>;
61
- }