@visulima/vite-overlay 1.3.7 → 2.0.0-alpha.10

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 (30) hide show
  1. package/CHANGELOG.md +169 -0
  2. package/LICENSE.md +1 -1
  3. package/README.md +200 -26
  4. package/dist/index.d.ts +25 -27
  5. package/dist/index.js +569 -335
  6. package/dist/packem_chunks/github-dark-default.js +1 -0
  7. package/dist/packem_chunks/github-light.js +1 -0
  8. package/package.json +8 -9
  9. package/dist/constants.d.ts +0 -14
  10. package/dist/overlay/patch-overlay.d.ts +0 -5
  11. package/dist/types.d.ts +0 -94
  12. package/dist/utils/create-vite-solution-finder.d.ts +0 -13
  13. package/dist/utils/error-processing/index.d.ts +0 -21
  14. package/dist/utils/error-processing/parse-vue-compilation-error.d.ts +0 -12
  15. package/dist/utils/error-processing/process-hydration-diff.d.ts +0 -7
  16. package/dist/utils/error-processing/remap-stack-to-original.d.ts +0 -18
  17. package/dist/utils/error-processing/retrieve-source-texts.d.ts +0 -8
  18. package/dist/utils/error-processing/shiki-diff-transformer.d.ts +0 -8
  19. package/dist/utils/error-processing/utils/add-query-to-url.d.ts +0 -2
  20. package/dist/utils/error-processing/utils/extract-query-from-http-url.d.ts +0 -2
  21. package/dist/utils/esbuild-error.d.ts +0 -29
  22. package/dist/utils/find-error-in-source.d.ts +0 -12
  23. package/dist/utils/find-module-for-path.d.ts +0 -9
  24. package/dist/utils/generate-client-script.d.ts +0 -8
  25. package/dist/utils/get-source-from-map.d.ts +0 -6
  26. package/dist/utils/normalize-id-candidates.d.ts +0 -2
  27. package/dist/utils/position-aligner.d.ts +0 -6
  28. package/dist/utils/resolve-original-location.d.ts +0 -29
  29. package/dist/utils/ssr-error-enhancer.d.ts +0 -8
  30. package/dist/utils/stack-trace.d.ts +0 -38
package/CHANGELOG.md CHANGED
@@ -1,3 +1,172 @@
1
+ ## @visulima/vite-overlay [2.0.0-alpha.10](https://github.com/visulima/visulima/compare/@visulima/vite-overlay@2.0.0-alpha.9...@visulima/vite-overlay@2.0.0-alpha.10) (2026-03-26)
2
+
3
+ ### Features
4
+
5
+ * **web:** auto-generate packages page from workspace metadata ([623e520](https://github.com/visulima/visulima/commit/623e5207693a7fe720f5f2f179593a3654c880e3))
6
+
7
+
8
+ ### Dependencies
9
+
10
+ * **@visulima/error:** upgraded to 6.0.0-alpha.7
11
+ * **@visulima/path:** upgraded to 3.0.0-alpha.7
12
+
13
+ ## @visulima/vite-overlay [2.0.0-alpha.9](https://github.com/visulima/visulima/compare/@visulima/vite-overlay@2.0.0-alpha.8...@visulima/vite-overlay@2.0.0-alpha.9) (2026-03-26)
14
+
15
+ ### Bug Fixes
16
+
17
+ * **vite-overlay:** use workspace:* for internal [@visulima](https://github.com/visulima) deps ([cf5aedc](https://github.com/visulima/visulima/commit/cf5aedcc8621fedf4a1b4f39b574699292f85a5a))
18
+ * **web:** improve build setup with incremental stats caching and prod install ([fe33e75](https://github.com/visulima/visulima/commit/fe33e75827586779b4b3a0c6d57b39f889ee6207))
19
+
20
+ ### Miscellaneous Chores
21
+
22
+ * visulima website ([#591](https://github.com/visulima/visulima/issues/591)) ([59ab2e2](https://github.com/visulima/visulima/commit/59ab2e2befb03e51cd2088956f83d9b87de6d033))
23
+ * **vite-overlay:** migrate deps to pnpm catalogs ([7553183](https://github.com/visulima/visulima/commit/7553183ae573d60405ab9f5227106eca8073f85c))
24
+ * **vite-overlay:** update dependencies ([d93e9e0](https://github.com/visulima/visulima/commit/d93e9e06cc4563c9c9a087515b6701598057b2b3))
25
+
26
+ ### Code Refactoring
27
+
28
+ * **vite-overlay:** replace vite-tsconfig-paths with native Vite 8 resolve.tsconfigPaths ([3d1e454](https://github.com/visulima/visulima/commit/3d1e454fd7d2e7178df2c795d50ad93927635a74))
29
+
30
+
31
+ ### Dependencies
32
+
33
+ * **@visulima/error:** upgraded to 6.0.0-alpha.6
34
+ * **@visulima/path:** upgraded to 3.0.0-alpha.6
35
+
36
+ ## @visulima/vite-overlay [2.0.0-alpha.8](https://github.com/visulima/visulima/compare/@visulima/vite-overlay@2.0.0-alpha.7...@visulima/vite-overlay@2.0.0-alpha.8) (2026-03-06)
37
+
38
+ ### Bug Fixes
39
+
40
+ * **vite-overlay:** fix formatting and minor code style issues ([ec96733](https://github.com/visulima/visulima/commit/ec9673362fdf82ff4dacaf03aeb1c59250cd4eb0))
41
+ * **vite-overlay:** replace rolldown-vite alias with vite@8 beta ([0596412](https://github.com/visulima/visulima/commit/0596412d437625183db5909d3b3ad1328293d8ef))
42
+ * **vite-overlay:** resolve ESLint errors and expand braceless if statements ([f837bcd](https://github.com/visulima/visulima/commit/f837bcd2a1a743290b63e7471d843a953fd75b54))
43
+ * **vite-overlay:** show balloon button alongside overlay for client errors ([6b9d8d4](https://github.com/visulima/visulima/commit/6b9d8d414ef1d21ab5ccee5f5a5aebb544d6f2c2))
44
+ * **vite-overlay:** update packem to 2.0.0-alpha.54 ([73b70e3](https://github.com/visulima/visulima/commit/73b70e398cda6ee38aed18fa798bd2198b732024))
45
+
46
+ ### Miscellaneous Chores
47
+
48
+ * **vite-overlay:** regenerate tanstack hydration example route tree ([11ceaa0](https://github.com/visulima/visulima/commit/11ceaa09ded9ff1223f99646b477b00ceeffea40))
49
+ * **vite-overlay:** update dependencies ([53e7915](https://github.com/visulima/visulima/commit/53e7915ce97385edce947318aac47602bb11c905))
50
+ * year update ([47f4105](https://github.com/visulima/visulima/commit/47f410596ce7190cfea36a073db32e0cec50bbcd))
51
+
52
+
53
+ ### Dependencies
54
+
55
+ * **@visulima/error:** upgraded to 6.0.0-alpha.5
56
+ * **@visulima/path:** upgraded to 3.0.0-alpha.5
57
+
58
+ ## @visulima/vite-overlay [2.0.0-alpha.7](https://github.com/visulima/visulima/compare/@visulima/vite-overlay@2.0.0-alpha.6...@visulima/vite-overlay@2.0.0-alpha.7) (2026-03-04)
59
+
60
+ ### Bug Fixes
61
+
62
+ * added hint to the overlay back ([5df1227](https://github.com/visulima/visulima/commit/5df122779364090d10d60f440e61a595c7e1ee83))
63
+ * **vite-overlay:** clear balloon on HMR update and fix pre-existing TS errors ([6904661](https://github.com/visulima/visulima/commit/69046610f5a5c36ba68539ecb7a088cb767922ca))
64
+ * **vite-overlay:** explicitly override forms plugin background on editor select ([9614446](https://github.com/visulima/visulima/commit/96144461dd00fad5dad3dd1aa3976af1ec34a896)), closes [#fff](https://github.com/visulima/visulima/issues/fff) [select#editor-selector](https://github.com/visulima/select/issues/editor-selector)
65
+ * **vite-overlay:** fix all ESLint errors and prevent e2e specs from running in vitest ([c212416](https://github.com/visulima/visulima/commit/c212416be37c7bbe2276e440401103146838b8e5))
66
+ * **vite-overlay:** fix editor select chevron and options popup in dark/light mode ([69e3274](https://github.com/visulima/visulima/commit/69e327476990e4b37a300f6655bf73af0aba2060))
67
+ * **vite-overlay:** fix syntheticError typo, blank line lint error, and rewrite corrupted docs ([a990844](https://github.com/visulima/visulima/commit/a99084491d19f07704488d10ab4930c5b7b779d0))
68
+ * **vite-overlay:** resolve 10 runtime bugs in error overlay ([da43fcb](https://github.com/visulima/visulima/commit/da43fcb1eeec62e7855c3bcbc9f365613fa9001c))
69
+
70
+ ### Documentation
71
+
72
+ * **vite-overlay:** fix incorrect BalloonConfig properties and add client API docs ([6f045cf](https://github.com/visulima/visulima/commit/6f045cf186dc9ca7552e3cd21ff959414ddf2b13))
73
+
74
+ ## @visulima/vite-overlay [2.0.0-alpha.6](https://github.com/visulima/visulima/compare/@visulima/vite-overlay@2.0.0-alpha.5...@visulima/vite-overlay@2.0.0-alpha.6) (2026-02-28)
75
+
76
+ ### Features
77
+
78
+ * **dev-toolbar:** initialize dev-toolbar package ([#586](https://github.com/visulima/visulima/issues/586)) ([a3ab9d6](https://github.com/visulima/visulima/commit/a3ab9d6e6c768853854b95fa8eee908b95235ea5))
79
+
80
+ ### Documentation
81
+
82
+ * **error,error-handler,ono,inspector,source-map,vite-overlay:** add comprehensive Fumadocs documentation ([a0c8c92](https://github.com/visulima/visulima/commit/a0c8c92949cff2730fc6122f717fe344c030f366))
83
+
84
+ ### Miscellaneous Chores
85
+
86
+ * **error-debugging:** update dependencies ([6002ece](https://github.com/visulima/visulima/commit/6002ece1803b2ba8261cff42a362dd6e8ddcc3ee))
87
+ * update lock file maintenance ([d83e716](https://github.com/visulima/visulima/commit/d83e71697b75d24704185b66bb521a934d2db02d))
88
+
89
+ ## @visulima/vite-overlay [2.0.0-alpha.5](https://github.com/visulima/visulima/compare/@visulima/vite-overlay@2.0.0-alpha.4...@visulima/vite-overlay@2.0.0-alpha.5) (2026-01-17)
90
+
91
+ ### Miscellaneous Chores
92
+
93
+ * **vite-overlay:** update dependencies ([622d520](https://github.com/visulima/visulima/commit/622d5209d4afefc082cbb9eb294d6aeee6f25bcb))
94
+
95
+
96
+ ### Dependencies
97
+
98
+ * **@visulima/error:** upgraded to 6.0.0-alpha.4
99
+
100
+ ## @visulima/vite-overlay [2.0.0-alpha.4](https://github.com/visulima/visulima/compare/@visulima/vite-overlay@2.0.0-alpha.3...@visulima/vite-overlay@2.0.0-alpha.4) (2025-12-27)
101
+
102
+ ### Bug Fixes
103
+
104
+ * **vite-overlay:** update package files ([fd8f5c1](https://github.com/visulima/visulima/commit/fd8f5c13f384d945f3597b00cfdfaf615e100de9))
105
+
106
+ ### Miscellaneous Chores
107
+
108
+ * **dependencies:** update msw to version 2.12.6, jsdom to version 27.4.0, and [@tanstack](https://github.com/tanstack) packages to version 1.144.0 in package.json files ([1aa0236](https://github.com/visulima/visulima/commit/1aa0236e1f8190eecf7526cf2dc0f369cac02d87))
109
+ * fixed project.json names and schema path ([964722f](https://github.com/visulima/visulima/commit/964722f691db205c7edb9aa6db29e849a647500b))
110
+
111
+ ### Code Refactoring
112
+
113
+ * **overlay:** improve balloon count display with animation and update styles for consistency ([146c2a7](https://github.com/visulima/visulima/commit/146c2a77b96ce9c61f6ae2d3fb85990fc73eab6b))
114
+
115
+
116
+ ### Dependencies
117
+
118
+ * **@visulima/error:** upgraded to 6.0.0-alpha.3
119
+ * **@visulima/path:** upgraded to 3.0.0-alpha.4
120
+
121
+ ## @visulima/vite-overlay [2.0.0-alpha.3](https://github.com/visulima/visulima/compare/@visulima/vite-overlay@2.0.0-alpha.2...@visulima/vite-overlay@2.0.0-alpha.3) (2025-12-11)
122
+
123
+ ### Bug Fixes
124
+
125
+ * update license information and add badges in README files ([340af5d](https://github.com/visulima/visulima/commit/340af5d227b3450a86da7861eeea5fee63ab4446))
126
+ * update package OG images across multiple packages ([f08e4dd](https://github.com/visulima/visulima/commit/f08e4dd2b105ccb29c8412020a9c2be36d6c1e9e))
127
+
128
+ ### Miscellaneous Chores
129
+
130
+ * update package dependencies and improve configuration ([4ed22d6](https://github.com/visulima/visulima/commit/4ed22d6511aa8150dcd4ba7b9dccf05dbe2d6adc))
131
+
132
+ ### Code Refactoring
133
+
134
+ * improve stack trace viewer and resolve original location utilities ([c6ff5c8](https://github.com/visulima/visulima/commit/c6ff5c85714944f34cd3f758eb4fc1d16271f5b6))
135
+
136
+
137
+ ### Dependencies
138
+
139
+ * **@visulima/error:** upgraded to 6.0.0-alpha.2
140
+ * **@visulima/path:** upgraded to 3.0.0-alpha.3
141
+
142
+ ## @visulima/vite-overlay [2.0.0-alpha.2](https://github.com/visulima/visulima/compare/@visulima/vite-overlay@2.0.0-alpha.1...@visulima/vite-overlay@2.0.0-alpha.2) (2025-12-11)
143
+
144
+ ### Bug Fixes
145
+
146
+ * update dependencies and improve error handling in error-debugging packages ([b95fea4](https://github.com/visulima/visulima/commit/b95fea4ef0e0a6777b3dd465603b1dd3c40aa4e8))
147
+
148
+ ## @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)
149
+
150
+ ### ⚠ BREAKING CHANGES
151
+
152
+ * change min node version to 22.13
153
+
154
+ ### Bug Fixes
155
+
156
+ * add new package image, fixed readme rendering on npm, fixed building of packages ([b790ba2](https://github.com/visulima/visulima/commit/b790ba253ea07fef83528fd822a678facf021b5f))
157
+ * 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))
158
+
159
+ ### Miscellaneous Chores
160
+
161
+ * moved all packages into groups ([0615e9d](https://github.com/visulima/visulima/commit/0615e9d14a8a886e11da529ce150cf31ca973c10))
162
+ * 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))
163
+ * 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))
164
+
165
+
166
+ ### Dependencies
167
+
168
+ * **@visulima/error:** upgraded to 6.0.0-alpha.1
169
+
1
170
  ## @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
171
 
3
172
  ### Bug Fixes
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 visulima
3
+ Copyright (c) 2026 visulima
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,15 +1,24 @@
1
- <div align="center">
2
- <h3>Enhanced Error Overlay for Vite</h3>
3
- <p>
4
- A powerful development tool that provides rich error displays with source mapping, cause chain navigation, and intelligent solutions for Vite applications.
5
- </p>
6
- </div>
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]][typescript-url] [![npm-image]][npm-url] [![license-image]][license-url]
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
 
@@ -25,9 +34,9 @@
25
34
 
26
35
  ---
27
36
 
28
- | Light Mode | Dark Mode | Solution Mode |
29
- | -------------------------------- | ------------------------------ | ------------------------------------- |
30
- | ![light](./__assets__/light.png) | ![dark](./__assets__/dark.png) | ![light](./__assets__/light-hint.png) |
37
+ | Light Mode | Dark Mode | Solution Mode |
38
+ | -------------------------------- | ------------------------------ | ------------------------------- |
39
+ | ![light](./__assets__/light.jpg) | ![dark](./__assets__/dark.jpg) | ![light](./__assets__/hint.jpg) |
31
40
 
32
41
  ## Features
33
42
 
@@ -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 | Default | Description |
109
- | ------------------------- | ------------------ | ----------- | ------------------------------------------------------------------------ |
110
- | `forwardConsole` | `boolean` | `true` | Enable/disable client-side runtime error logging and overlay display |
111
- | `forwardedConsoleMethods` | `string[]` | `["error"]` | Array of console method names to intercept and forward to overlay |
112
- | `reactPluginName` | `string` | `undefined` | Custom React plugin name for detection (useful for custom React plugins) |
113
- | `vuePluginName` | `string` | `undefined` | Custom Vue plugin name for detection (useful for custom Vue plugins) |
114
- | `showBallonButton` | `boolean` | `true` | Whether to show the floating balloon button for error navigation |
115
- | `solutionFinders` | `SolutionFinder[]` | `[]` | Array of custom solution finder functions for enhanced error analysis |
116
- | `logClientRuntimeError` | `boolean` | `undefined` | **@deprecated** Use `forwardConsole` instead |
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,23 @@ 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
- This project is licensed under the MIT License - see the [MIT][license-url] file for details.
476
+ The visulima vite-overlay is open-sourced software licensed under the [MIT][license]
477
+
478
+ <!-- badges -->
309
479
 
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"
480
+ [license-badge]: https://img.shields.io/npm/l/@visulima/vite-overlay?style=for-the-badge
481
+ [license]: https://github.com/visulima/visulima/blob/main/LICENSE
482
+ [npm-downloads-badge]: https://img.shields.io/npm/dm/@visulima/vite-overlay?style=for-the-badge
483
+ [npm-downloads]: https://www.npmjs.com/package/@visulima/vite-overlay
484
+ [prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge
485
+ [prs-welcome]: https://github.com/visulima/visulima/blob/main/.github/CONTRIBUTING.md
486
+ [chat-badge]: https://img.shields.io/discord/932323359193186354.svg?style=for-the-badge
487
+ [chat]: https://discord.gg/TtFJY8xkFK
488
+ [typescript-badge]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
489
+ [typescript-url]: https://www.typescriptlang.org/
package/dist/index.d.ts CHANGED
@@ -1,29 +1,27 @@
1
- import type { SolutionFinder } from "@visulima/error/solution";
2
- import type { Plugin } from "vite";
3
- /**
4
- * Main Vite plugin for error overlay functionality.
5
- * Intercepts runtime errors and displays them in a user-friendly overlay.
6
- * @param options Plugin configuration options
7
- * @param options.forwardConsole Whether to log client runtime errors (optional)
8
- * @param options.forwardedConsoleMethods Array of console method names to forward (optional)
9
- * @param [options.logClientRuntimeError] [deprecated] Use forwardConsole instead
10
- * @param options.reactPluginName Custom React plugin name (optional)
11
- * @param options.solutionFinders Custom solution finders (optional)
12
- * @param options.vuePluginName Custom Vue plugin name (optional)
13
- * @param options.showBallonButton Whether to show the balloon button (optional)
14
- * @returns The Vite plugin configuration
15
- */
1
+ import { SolutionFinder } from '@visulima/error/solution';
2
+ import { Plugin } from 'vite';
3
+ import '@visulima/error/error';
4
+ import { Properties } from 'csstype';
5
+ type BalloonPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
6
+ type BalloonStyle = string | Properties;
7
+ interface BalloonConfig {
8
+ readonly enabled?: boolean;
9
+ readonly icon?: string;
10
+ readonly position?: BalloonPosition;
11
+ readonly style?: BalloonStyle;
12
+ }
13
+ interface OverlayConfig {
14
+ readonly balloon?: BalloonConfig;
15
+ readonly customCSS?: string | Properties;
16
+ }
16
17
  declare const errorOverlayPlugin: (options?: {
17
- forwardConsole?: boolean;
18
- forwardedConsoleMethods?: string[];
19
- logClientRuntimeError?: boolean;
20
- reactPluginName?: string;
21
- showBallonButton?: boolean;
22
- solutionFinders?: SolutionFinder[];
23
- vuePluginName?: string;
18
+ forwardConsole?: boolean;
19
+ forwardedConsoleMethods?: string[];
20
+ logClientRuntimeError?: boolean;
21
+ overlay?: OverlayConfig;
22
+ reactPluginName?: string;
23
+ showBallonButton?: boolean;
24
+ solutionFinders?: SolutionFinder[];
25
+ vuePluginName?: string;
24
26
  }) => Plugin;
25
- /**
26
- * Default export of the Vite error overlay plugin.
27
- * Use this plugin to enable error overlay functionality in your Vite project.
28
- */
29
- export default errorOverlayPlugin;
27
+ export { errorOverlayPlugin as default };