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