@visulima/vite-overlay 1.3.7 → 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +184 -23
- package/dist/index.d.ts +12002 -18
- package/dist/index.js +233 -167
- package/package.json +8 -8
- package/dist/constants.d.ts +0 -14
- package/dist/overlay/patch-overlay.d.ts +0 -5
- package/dist/types.d.ts +0 -94
- package/dist/utils/create-vite-solution-finder.d.ts +0 -13
- package/dist/utils/error-processing/index.d.ts +0 -21
- package/dist/utils/error-processing/parse-vue-compilation-error.d.ts +0 -12
- package/dist/utils/error-processing/process-hydration-diff.d.ts +0 -7
- package/dist/utils/error-processing/remap-stack-to-original.d.ts +0 -18
- package/dist/utils/error-processing/retrieve-source-texts.d.ts +0 -8
- package/dist/utils/error-processing/shiki-diff-transformer.d.ts +0 -8
- package/dist/utils/error-processing/utils/add-query-to-url.d.ts +0 -2
- package/dist/utils/error-processing/utils/extract-query-from-http-url.d.ts +0 -2
- package/dist/utils/esbuild-error.d.ts +0 -29
- package/dist/utils/find-error-in-source.d.ts +0 -12
- package/dist/utils/find-module-for-path.d.ts +0 -9
- package/dist/utils/generate-client-script.d.ts +0 -8
- package/dist/utils/get-source-from-map.d.ts +0 -6
- package/dist/utils/normalize-id-candidates.d.ts +0 -2
- package/dist/utils/position-aligner.d.ts +0 -6
- package/dist/utils/resolve-original-location.d.ts +0 -29
- package/dist/utils/ssr-error-enhancer.d.ts +0 -8
- package/dist/utils/stack-trace.d.ts +0 -38
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## @visulima/vite-overlay [2.0.0-alpha.1](https://github.com/visulima/visulima/compare/@visulima/vite-overlay@1.3.7...@visulima/vite-overlay@2.0.0-alpha.1) (2025-12-07)
|
|
2
|
+
|
|
3
|
+
### ⚠ BREAKING CHANGES
|
|
4
|
+
|
|
5
|
+
* change min node version to 22.13
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* add new package image, fixed readme rendering on npm, fixed building of packages ([b790ba2](https://github.com/visulima/visulima/commit/b790ba253ea07fef83528fd822a678facf021b5f))
|
|
10
|
+
* update Node.js engine version requirement to >=22.13 in multiple package.json files for improved compatibility ([b828e9a](https://github.com/visulima/visulima/commit/b828e9aeaebfc798eecddccd90e6ec7560c6d36a))
|
|
11
|
+
|
|
12
|
+
### Miscellaneous Chores
|
|
13
|
+
|
|
14
|
+
* moved all packages into groups ([0615e9d](https://github.com/visulima/visulima/commit/0615e9d14a8a886e11da529ce150cf31ca973c10))
|
|
15
|
+
* update @anolilab/semantic-release-pnpm and @anolilab/semantic-release-preset to versions 3.2.2 and 12.1.2 across multiple package.json files for improved compatibility ([3921626](https://github.com/visulima/visulima/commit/3921626141fe5da398749bf0ba675f1596f18afb))
|
|
16
|
+
* update dependencies across multiple packages to improve compatibility and performance, including upgrading `@anolilab/semantic-release-pnpm` and `@anolilab/semantic-release-preset` to versions 3.2.0 and 12.1.0 respectively, and updating `react`, `react-dom`, and `next` versions to 19.2.1 and 16.0.7 in various package.json files ([aee8fcd](https://github.com/visulima/visulima/commit/aee8fcd796ae9b8d055903260e7150996ea9f53d))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Dependencies
|
|
20
|
+
|
|
21
|
+
* **@visulima/error:** upgraded to 6.0.0-alpha.1
|
|
22
|
+
|
|
1
23
|
## @visulima/vite-overlay [1.3.7](https://github.com/visulima/visulima/compare/@visulima/vite-overlay@1.3.6...@visulima/vite-overlay@1.3.7) (2025-11-13)
|
|
2
24
|
|
|
3
25
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<!-- START_PACKAGE_OG_IMAGE_PLACEHOLDER -->
|
|
2
|
+
|
|
3
|
+
<a href="https://www.anolilab.com/open-source" align="center">
|
|
4
|
+
|
|
5
|
+
<img src="__assets__/package-og.svg" alt="vite-overlay" />
|
|
6
|
+
|
|
7
|
+
</a>
|
|
8
|
+
|
|
9
|
+
<h3 align="center">Improved vite overlay</h3>
|
|
10
|
+
|
|
11
|
+
<!-- END_PACKAGE_OG_IMAGE_PLACEHOLDER -->
|
|
7
12
|
|
|
8
13
|
<br />
|
|
9
14
|
|
|
10
15
|
<div align="center">
|
|
11
16
|
|
|
12
|
-
[![typescript-image]
|
|
17
|
+
[![typescript-image][typescript-badge]][typescript-url]
|
|
18
|
+
[![mit licence][license-badge]][license]
|
|
19
|
+
[![npm downloads][npm-downloads-badge]][npm-downloads]
|
|
20
|
+
[![Chat][chat-badge]][chat]
|
|
21
|
+
[![PRs Welcome][prs-welcome-badge]][prs-welcome]
|
|
13
22
|
|
|
14
23
|
</div>
|
|
15
24
|
|
|
@@ -93,6 +102,30 @@ export default defineConfig({
|
|
|
93
102
|
// Whether to show the balloon button in the overlay (default: true)
|
|
94
103
|
showBallonButton: true,
|
|
95
104
|
|
|
105
|
+
// Overlay configuration (optional)
|
|
106
|
+
overlay: {
|
|
107
|
+
// Balloon button configuration
|
|
108
|
+
balloon: {
|
|
109
|
+
enabled: true,
|
|
110
|
+
position: "bottom-right", // "top-left" | "top-right" | "bottom-left" | "bottom-right"
|
|
111
|
+
icon: "", // Optional custom icon URL
|
|
112
|
+
// Style can be a string or CSS.Properties object
|
|
113
|
+
style: {
|
|
114
|
+
background: "#ff4628",
|
|
115
|
+
color: "#ffffff",
|
|
116
|
+
},
|
|
117
|
+
// Or as a string:
|
|
118
|
+
// style: "background: #ff4628; color: #ffffff;",
|
|
119
|
+
},
|
|
120
|
+
// Custom CSS to inject for styling customization
|
|
121
|
+
// Can be a string or CSS.Properties object
|
|
122
|
+
customCSS: `
|
|
123
|
+
#__v_o__balloon {
|
|
124
|
+
border-radius: 20px;
|
|
125
|
+
}
|
|
126
|
+
`,
|
|
127
|
+
},
|
|
128
|
+
|
|
96
129
|
// Custom solution finder functions (optional)
|
|
97
130
|
solutionFinders: [],
|
|
98
131
|
|
|
@@ -105,15 +138,19 @@ export default defineConfig({
|
|
|
105
138
|
|
|
106
139
|
#### Options
|
|
107
140
|
|
|
108
|
-
| Option | Type
|
|
109
|
-
| ------------------------- |
|
|
110
|
-
| `forwardConsole` | `boolean`
|
|
111
|
-
| `forwardedConsoleMethods` | `string[]`
|
|
112
|
-
| `reactPluginName` | `string`
|
|
113
|
-
| `vuePluginName` | `string`
|
|
114
|
-
| `showBallonButton` | `boolean`
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
141
|
+
| Option | Type | Default | Description |
|
|
142
|
+
| ------------------------- | -------------------------- | ----------- | -------------------------------------------------------------------------------- |
|
|
143
|
+
| `forwardConsole` | `boolean` | `true` | Enable/disable client-side runtime error logging and overlay display |
|
|
144
|
+
| `forwardedConsoleMethods` | `string[]` | `["error"]` | Array of console method names to intercept and forward to overlay |
|
|
145
|
+
| `reactPluginName` | `string` | `undefined` | Custom React plugin name for detection (useful for custom React plugins) |
|
|
146
|
+
| `vuePluginName` | `string` | `undefined` | Custom Vue plugin name for detection (useful for custom Vue plugins) |
|
|
147
|
+
| `showBallonButton` | `boolean` | `true` | Whether to show the floating balloon button for error navigation |
|
|
148
|
+
| `overlay` | `OverlayConfig` | `undefined` | Overlay configuration options |
|
|
149
|
+
| `overlay.balloon` | `BalloonConfig` | `undefined` | Balloon button configuration |
|
|
150
|
+
| `overlay.balloon.style` | `string \| CSS.Properties` | `undefined` | Balloon button styles (string or CSS.Properties object) |
|
|
151
|
+
| `overlay.customCSS` | `string \| CSS.Properties` | `undefined` | Custom CSS to inject for styling customization (string or CSS.Properties object) |
|
|
152
|
+
| `solutionFinders` | `SolutionFinder[]` | `[]` | Array of custom solution finder functions for enhanced error analysis |
|
|
153
|
+
| `logClientRuntimeError` | `boolean` | `undefined` | **@deprecated** Use `forwardConsole` instead |
|
|
117
154
|
|
|
118
155
|
## Error Handling
|
|
119
156
|
|
|
@@ -253,6 +290,133 @@ The error overlay uses a custom design system with CSS custom properties:
|
|
|
253
290
|
--ono-v-text: #c9d1d9;
|
|
254
291
|
```
|
|
255
292
|
|
|
293
|
+
### Custom CSS Injection
|
|
294
|
+
|
|
295
|
+
You can inject custom CSS to override the default styles of the overlay and button elements. The `overlay.customCSS` option accepts a CSS string (recommended) or a `CSS.Properties` object:
|
|
296
|
+
|
|
297
|
+
```typescript
|
|
298
|
+
export default defineConfig({
|
|
299
|
+
plugins: [
|
|
300
|
+
errorOverlay({
|
|
301
|
+
overlay: {
|
|
302
|
+
customCSS: `
|
|
303
|
+
/* Customize the balloon button */
|
|
304
|
+
#__v_o__balloon {
|
|
305
|
+
border-radius: 20px;
|
|
306
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/* Customize the overlay panel */
|
|
310
|
+
#__v_o__panel {
|
|
311
|
+
border-radius: 12px;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/* Customize the backdrop */
|
|
315
|
+
#__v_o__backdrop {
|
|
316
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
317
|
+
}
|
|
318
|
+
`,
|
|
319
|
+
},
|
|
320
|
+
}),
|
|
321
|
+
],
|
|
322
|
+
});
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
**Note:** For `customCSS`, using a CSS string is recommended since you need CSS selectors. `CSS.Properties` objects are mainly useful for inline styles (like `balloon.style`).
|
|
326
|
+
|
|
327
|
+
### Balloon Button Styling
|
|
328
|
+
|
|
329
|
+
The `balloon.style` option supports both string and `CSS.Properties` object. Using `CSS.Properties` provides type safety and autocomplete:
|
|
330
|
+
|
|
331
|
+
```typescript
|
|
332
|
+
import type * as CSS from "csstype";
|
|
333
|
+
|
|
334
|
+
export default defineConfig({
|
|
335
|
+
plugins: [
|
|
336
|
+
errorOverlay({
|
|
337
|
+
overlay: {
|
|
338
|
+
balloon: {
|
|
339
|
+
// Using CSS.Properties object (type-safe with autocomplete)
|
|
340
|
+
style: {
|
|
341
|
+
background: "#ff4628",
|
|
342
|
+
color: "#ffffff",
|
|
343
|
+
borderRadius: "20px",
|
|
344
|
+
} as CSS.Properties,
|
|
345
|
+
// Or using a string:
|
|
346
|
+
// style: "background: #ff4628; color: #ffffff; border-radius: 20px;",
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
}),
|
|
350
|
+
],
|
|
351
|
+
});
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
**Note:** When using `CSS.Properties`, property names should be in camelCase (e.g., `borderRadius`), and they will be automatically converted to kebab-case CSS properties (e.g., `border-radius`) when applied.
|
|
355
|
+
|
|
356
|
+
#### Available Element IDs for Customization
|
|
357
|
+
|
|
358
|
+
The following element IDs can be targeted in your custom CSS:
|
|
359
|
+
|
|
360
|
+
**Main Overlay Elements:**
|
|
361
|
+
|
|
362
|
+
- `__v_o__root` - Root container element
|
|
363
|
+
- `__v_o__backdrop` - Backdrop element behind the overlay
|
|
364
|
+
- `__v_o__notch` - Notch container at the top of the overlay
|
|
365
|
+
- `__v_o__panel` - Main panel container
|
|
366
|
+
- `__v_o__overlay` - Overlay content container
|
|
367
|
+
|
|
368
|
+
**Navigation & Pagination:**
|
|
369
|
+
|
|
370
|
+
- `__v_o__error-overlay-pagination-previous` - Previous error button
|
|
371
|
+
- `__v_o__error-overlay-pagination-next` - Next error button
|
|
372
|
+
- `__v_o__error-overlay_pagination_count` - Pagination count container
|
|
373
|
+
- `__v_o__pagination_current` - Current page number display
|
|
374
|
+
- `__v_o__pagination_total` - Total page number display
|
|
375
|
+
|
|
376
|
+
**History:**
|
|
377
|
+
|
|
378
|
+
- `__v_o__history_toggle` - History toggle button
|
|
379
|
+
- `__v_o__history_indicator` - History indicator container
|
|
380
|
+
- `__v_o__history_count` - History count display
|
|
381
|
+
- `__v_o__history_total` - History total display
|
|
382
|
+
- `__v_o__history_timestamp` - History timestamp display
|
|
383
|
+
- `__v_o__history_layer_depth` - History layer depth container
|
|
384
|
+
- `__v_o__history_layer_depth_1` - History layer depth level 1
|
|
385
|
+
- `__v_o__history_layer_depth_2` - History layer depth level 2
|
|
386
|
+
|
|
387
|
+
**Header Elements:**
|
|
388
|
+
|
|
389
|
+
- `__v_o__header` - Header container
|
|
390
|
+
- `__v_o__header_loader` - Header loader skeleton
|
|
391
|
+
- `__v_o__title` - Title container
|
|
392
|
+
- `__v_o__heading` - Error heading/name
|
|
393
|
+
- `__v_o__filelink` - File link button
|
|
394
|
+
- `__v_o__mode` - Mode switch container (original/compiled)
|
|
395
|
+
- `__v_o__copy_error` - Copy error button
|
|
396
|
+
- `__v_o__close` - Close button
|
|
397
|
+
|
|
398
|
+
**Balloon Button:**
|
|
399
|
+
|
|
400
|
+
- `__v_o__balloon` - Floating balloon button
|
|
401
|
+
- `__v_o__balloon_count` - Error count badge in balloon
|
|
402
|
+
- `__v_o__balloon_text` - Text label in balloon
|
|
403
|
+
|
|
404
|
+
**Message & Content:**
|
|
405
|
+
|
|
406
|
+
- `__v_o__message_loader` - Message loader skeleton
|
|
407
|
+
- `__v_o__message` - Error message container
|
|
408
|
+
- `__v_o__body` - Body container
|
|
409
|
+
- `__v_o__body_loader` - Body loader skeleton
|
|
410
|
+
- `__v_o__solutions` - Solutions container
|
|
411
|
+
- `__v_o__solutions_container` - Solutions content container
|
|
412
|
+
- `__v_o__stacktrace` - Stack trace details element
|
|
413
|
+
|
|
414
|
+
**Other:**
|
|
415
|
+
|
|
416
|
+
- `__v_o__editor` - Editor selector container
|
|
417
|
+
- `editor-selector` - Editor selector dropdown
|
|
418
|
+
- `v-o-theme-switch` - Theme switch container
|
|
419
|
+
|
|
256
420
|
## Browser Support
|
|
257
421
|
|
|
258
422
|
The error overlay is designed to work in all modern browsers with at least 1% global market share. This includes:
|
|
@@ -303,13 +467,10 @@ pnpm install
|
|
|
303
467
|
- [Daniel Bannert](https://github.com/prisis)
|
|
304
468
|
- [All Contributors](https://github.com/visulima/visulima/graphs/contributors)
|
|
305
469
|
|
|
470
|
+
## Made with ❤️ at Anolilab
|
|
471
|
+
|
|
472
|
+
This is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Anolilab](https://www.anolilab.com/open-source) is a Development and AI Studio. Contact us at [hello@anolilab.com](mailto:hello@anolilab.com) if you need any help with these technologies or just want to say hi!
|
|
473
|
+
|
|
306
474
|
## License
|
|
307
475
|
|
|
308
476
|
This project is licensed under the MIT License - see the [MIT][license-url] file for details.
|
|
309
|
-
|
|
310
|
-
[typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
|
|
311
|
-
[typescript-url]: https://www.typescriptlang.org/ "TypeScript"
|
|
312
|
-
[license-image]: https://img.shields.io/npm/l/@visulima/vite-overlay?color=blueviolet&style=for-the-badge
|
|
313
|
-
[license-url]: LICENSE.md "license"
|
|
314
|
-
[npm-image]: https://img.shields.io/npm/v/@visulima/vite-overlay/latest.svg?style=for-the-badge&logo=npm
|
|
315
|
-
[npm-url]: https://www.npmjs.com/package/@visulima/vite-overlay/v/latest "npm"
|