@visulima/dev-toolbar 1.0.0-alpha.3 → 1.0.0-alpha.5
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 +60 -0
- package/LICENSE.md +109 -2
- package/dist/apps/a11y/a11y-app.d.ts +0 -1
- package/dist/apps/a11y/a11y-store.d.ts +12 -16
- package/dist/apps/a11y/a11y-tooltip.d.ts +0 -1
- package/dist/apps/a11y/index.js +3 -3
- package/dist/apps/assets/assets-app.d.ts +4 -0
- package/dist/apps/assets/index.d.ts +3 -0
- package/dist/apps/assets/index.js +16 -0
- package/dist/apps/inspector/index.js +2 -2
- package/dist/apps/inspector/inspector-app.d.ts +4 -2
- package/dist/apps/module-graph/index.js +2 -2
- package/dist/apps/module-graph/module-graph-app.d.ts +0 -1
- package/dist/apps/performance/index.js +2 -2
- package/dist/apps/performance/performance-app.d.ts +0 -1
- package/dist/apps/performance/performance-tooltip.d.ts +0 -1
- package/dist/apps/seo/index.js +2 -2
- package/dist/apps/seo/seo-app.d.ts +0 -1
- package/dist/apps/settings/index.js +2 -2
- package/dist/apps/tailwind/index.js +6 -6
- package/dist/apps/tailwind/tailwind-app.d.ts +0 -1
- package/dist/apps/timeline/index.js +2 -2
- package/dist/apps/timeline/timeline-app.d.ts +0 -1
- package/dist/apps/vite-config/index.js +2 -2
- package/dist/apps/vite-config/vite-config-app.d.ts +0 -1
- package/dist/client/overlay.js +1 -1
- package/dist/hooks/create-hook.d.ts +7 -5
- package/dist/hooks/events.d.ts +4 -2
- package/dist/hooks/global-hook.d.ts +6 -6
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/packem_chunks/inject-source.js +9 -1
- package/dist/packem_shared/Alert-D2CvX4fw.js +1 -0
- package/dist/packem_shared/Badge-BEgU04nl.js +1 -0
- package/dist/packem_shared/Button-Bkx66Co7.js +1 -0
- package/dist/packem_shared/Card-CJa4vHVc.js +1 -0
- package/dist/packem_shared/Icon-B6UHkC0o.js +1 -0
- package/dist/packem_shared/Input-Cs6aduTi.js +1 -0
- package/dist/packem_shared/Label-CgCFOMDc.js +1 -0
- package/dist/packem_shared/Popover-DzH5lAc9.js +1 -0
- package/dist/packem_shared/Progress-DN6zn-0l.js +1 -0
- package/dist/packem_shared/Separator-D38mKeZv.js +1 -0
- package/dist/packem_shared/Skeleton-Dv-tcA1P.js +1 -0
- package/dist/packem_shared/Switch-C3NTpeoR.js +1 -0
- package/dist/packem_shared/Tabs-SuFWbB6d.js +1 -0
- package/dist/packem_shared/Textarea-Yfg3dLZi.js +1 -0
- package/dist/packem_shared/Tooltip-BHmzUaxu.js +1 -0
- package/dist/packem_shared/clsx-wGlvpUfw.js +1 -0
- package/dist/packem_shared/createClientRPCContext-DgRxrllw.js +1 -0
- package/dist/packem_shared/createDevToolbarHook-4bZZiHPI.js +1 -0
- package/dist/packem_shared/createServerRPCContext-CJXa8ezf.js +1 -0
- package/dist/packem_shared/getTimelineStore-B1cfjWV8.js +1 -0
- package/dist/packem_shared/{setupGlobalHook-CFuxsCyl.js → setupGlobalHook-CCf9Logv.js} +1 -1
- package/dist/packem_shared/sharedToolbarStylesheet-JFwZE8kq.js +2 -0
- package/dist/packem_shared/store-DaUtLjf3.js +1 -0
- package/dist/packem_shared/use-frame-state-CxrlPUM5.js +1 -0
- package/dist/packem_shared/use-theme-zpm4zmqP.js +1 -0
- package/dist/performance/monitor.d.ts +27 -26
- package/dist/rpc/client.d.ts +6 -4
- package/dist/rpc/functions/assets.d.ts +16 -0
- package/dist/rpc/functions/open-in-editor.d.ts +7 -5
- package/dist/rpc/functions/tailwind-config.d.ts +7 -4
- package/dist/rpc/functions/vite-config.d.ts +80 -4
- package/dist/rpc/server.d.ts +9 -6
- package/dist/timeline/capture.d.ts +3 -1
- package/dist/timeline/index.d.ts +2 -1
- package/dist/timeline/store.d.ts +12 -22
- package/dist/toolbar/app-manager.d.ts +45 -43
- package/dist/toolbar/components/app-button.d.ts +0 -1
- package/dist/toolbar/components/app-canvas.d.ts +1 -1
- package/dist/toolbar/components/first-visit-hint.d.ts +0 -1
- package/dist/toolbar/components/toolbar-bar.d.ts +2 -7
- package/dist/toolbar/components/toolbar-container.d.ts +2 -8
- package/dist/toolbar/components/vite-overlay-button.d.ts +2 -2
- package/dist/toolbar/context/toolbar-context.d.ts +20 -19
- package/dist/toolbar/global-api.d.ts +3 -3
- package/dist/toolbar/helpers.d.ts +5 -3
- package/dist/toolbar/hooks/use-apps.d.ts +5 -3
- package/dist/toolbar/hooks/use-frame-state.d.ts +26 -10
- package/dist/toolbar/hooks/use-panel-visible.d.ts +9 -7
- package/dist/toolbar/hooks/use-position.d.ts +7 -5
- package/dist/toolbar/hooks/use-theme.d.ts +6 -4
- package/dist/toolbar/hooks/use-toolbar.d.ts +4 -2
- package/dist/toolbar/index.d.ts +8 -15
- package/dist/toolbar/index.js +3 -3
- package/dist/toolbar/settings.d.ts +7 -7
- package/dist/toolbar/stylesheet.d.ts +3 -1
- package/dist/toolbar/utils/index.d.ts +3 -3
- package/dist/types/global-api.d.ts +22 -33
- package/dist/types/hooks.d.ts +32 -34
- package/dist/types/messaging.d.ts +2 -2
- package/dist/types/rpc.d.ts +11 -7
- package/dist/types/timeline.d.ts +3 -3
- package/dist/types/toolbar.d.ts +1 -1
- package/dist/ui/components/alert.d.ts +0 -1
- package/dist/ui/components/badge.d.ts +0 -1
- package/dist/ui/components/button.d.ts +0 -1
- package/dist/ui/components/card.d.ts +0 -1
- package/dist/ui/components/icon.d.ts +3 -5
- package/dist/ui/components/input.d.ts +0 -1
- package/dist/ui/components/label.d.ts +0 -1
- package/dist/ui/components/popover.d.ts +1 -1
- package/dist/ui/components/progress.d.ts +0 -1
- package/dist/ui/components/separator.d.ts +0 -1
- package/dist/ui/components/skeleton.d.ts +0 -1
- package/dist/ui/components/switch.d.ts +0 -1
- package/dist/ui/components/tabs.d.ts +1 -2
- package/dist/ui/components/textarea.d.ts +0 -1
- package/dist/ui/components/tooltip.d.ts +1 -1
- package/dist/ui/index.d.ts +0 -1
- package/dist/ui/index.js +1 -1
- package/dist/vite/inject-source.d.ts +0 -1
- package/dist/vite/matcher.d.ts +2 -1
- package/dist/vite-plugin.d.ts +10 -6
- package/dist/vite-plugin.js +2 -2
- package/package.json +14 -12
- package/dist/apps/more/index.d.ts +0 -3
- package/dist/apps/more/index.js +0 -19
- package/dist/apps/more/more-app.d.ts +0 -5
- package/dist/packem_shared/Alert-H-x1JuZ0.js +0 -1
- package/dist/packem_shared/Badge-C30mDKKG.js +0 -1
- package/dist/packem_shared/Button-DODNCTPZ.js +0 -1
- package/dist/packem_shared/Card-DdI7Wn3t.js +0 -1
- package/dist/packem_shared/Icon-DWFLZkwW.js +0 -1
- package/dist/packem_shared/Input-GfbOwAkK.js +0 -1
- package/dist/packem_shared/Label-Bzi47aUf.js +0 -1
- package/dist/packem_shared/Popover-o3Vkvndp.js +0 -1
- package/dist/packem_shared/Progress-vGfFpxRn.js +0 -1
- package/dist/packem_shared/Separator-DQGeJPQg.js +0 -1
- package/dist/packem_shared/Skeleton-BYXau6jM.js +0 -1
- package/dist/packem_shared/Switch-BeC78S_T.js +0 -1
- package/dist/packem_shared/Tabs-BBc4S-2T.js +0 -1
- package/dist/packem_shared/Textarea-DvbSX13V.js +0 -1
- package/dist/packem_shared/TimelineStore-BgBrirKd.js +0 -1
- package/dist/packem_shared/Tooltip-BwK-2I9P.js +0 -1
- package/dist/packem_shared/cn-DWLJYh3h.js +0 -1
- package/dist/packem_shared/createClientRPCContext-DzKQpKTk.js +0 -1
- package/dist/packem_shared/createDevToolbarHook-DGNxqk8N.js +0 -1
- package/dist/packem_shared/createServerRPCContext-CRd6VAWp.js +0 -1
- package/dist/packem_shared/sharedToolbarStylesheet-DHHoFz2-.js +0 -2
- package/dist/packem_shared/store-BxE0w51s.js +0 -1
- package/dist/packem_shared/use-theme-CX1gG6Sv.js +0 -1
- package/dist/utils/cn.d.ts +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,63 @@
|
|
|
1
|
+
## @visulima/dev-toolbar [1.0.0-alpha.5](https://github.com/visulima/visulima/compare/@visulima/dev-toolbar@1.0.0-alpha.4...@visulima/dev-toolbar@1.0.0-alpha.5) (2026-03-06)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **dev-toolbar:** add assets app export and make axe-core an optional peer dependency ([812bc8d](https://github.com/visulima/visulima/commit/812bc8d45ef760862d43f59665e1f86c7d4a5008))
|
|
6
|
+
* **dev-toolbar:** add singleton guard, SEO JSON-LD validation, editor preference, and tests ([7584425](https://github.com/visulima/visulima/commit/758442518f8390b1faa0fd553d7ed1aaa4d9c037))
|
|
7
|
+
* **dev-toolbar:** implement iframe app rendering and custom app registration ([a1585a8](https://github.com/visulima/visulima/commit/a1585a8bd3624ae13b40fa386cd66b62c29ca08f))
|
|
8
|
+
* **dev-toolbar:** keep inspector active after element click and fix UX issues ([8f7e88a](https://github.com/visulima/visulima/commit/8f7e88a874f6412a15bf2adde9ddd95948b07c22))
|
|
9
|
+
* **dev-toolbar:** overhaul vite config app UI with env masking and improved layout ([7cfee9d](https://github.com/visulima/visulima/commit/7cfee9da5957fb9ffbcc940d9948909c4677efb6))
|
|
10
|
+
* **dev-toolbar:** redesign vite config app with tabbed interface ([087df63](https://github.com/visulima/visulima/commit/087df630dc378933e54d1587d40c99f19fca0df0))
|
|
11
|
+
* **dev-toolbar:** remove more overflow app ([cd3f369](https://github.com/visulima/visulima/commit/cd3f369c176c598d2e9a2bcdef194b7d457d343f))
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **dev-toolbar:** move removePopupOutsideHandler declaration before first use ([d734a84](https://github.com/visulima/visulima/commit/d734a847b7f0b4574f081b9b78b2fce3d2b0e698))
|
|
16
|
+
* **dev-toolbar:** resolve all ESLint errors across src files ([165b471](https://github.com/visulima/visulima/commit/165b471c95099bff76ba78d054664e79cfcdcb9a))
|
|
17
|
+
* **dev-toolbar:** resolve ESLint errors in test files and config ([ea7e46c](https://github.com/visulima/visulima/commit/ea7e46c13db73431738a8f75febb847f3e7e530b))
|
|
18
|
+
* **dev-toolbar:** resolve ESLint errors in vite-config app and RPC function ([fedce68](https://github.com/visulima/visulima/commit/fedce686ca59ba5d5b82cd10abfffa8d91a738c1))
|
|
19
|
+
* **dev-toolbar:** split single-line mock factories to satisfy max-statements-per-line ([025b972](https://github.com/visulima/visulima/commit/025b9722b6e854cf1ae53694597e64c63493f730))
|
|
20
|
+
* **dev-toolbar:** update packem to 2.0.0-alpha.54 ([f9779c9](https://github.com/visulima/visulima/commit/f9779c9e8dc7637db3bfef341cb66233469f653f))
|
|
21
|
+
* removed old test ([bfa9e78](https://github.com/visulima/visulima/commit/bfa9e784b2e183ed481d432290070ee554b357ac))
|
|
22
|
+
|
|
23
|
+
### Performance Improvements
|
|
24
|
+
|
|
25
|
+
* **dev-toolbar:** replace tailwind-merge with clsx in cn() utility ([6c4740c](https://github.com/visulima/visulima/commit/6c4740c8ce890d955cecbf634dada65fd8a99769))
|
|
26
|
+
|
|
27
|
+
### Documentation
|
|
28
|
+
|
|
29
|
+
* **dev-toolbar:** add assets app documentation ([bea25b9](https://github.com/visulima/visulima/commit/bea25b96f7f7dbb2f3952b6c04d38d032569760d))
|
|
30
|
+
* **dev-toolbar:** add iframe app documentation and remove more app references ([03dab85](https://github.com/visulima/visulima/commit/03dab85a92c5ee27b18db018c9dc263a1a3f1ea4))
|
|
31
|
+
* **dev-toolbar:** add vite-overlay integration guide ([8f6f25a](https://github.com/visulima/visulima/commit/8f6f25aae43f0c32380ede56a93915897a4a939f))
|
|
32
|
+
* **dev-toolbar:** update a11y docs to reflect optional axe-core peer dependency ([50396e8](https://github.com/visulima/visulima/commit/50396e8b18c56e716d119a468fa0b1219e789dff))
|
|
33
|
+
* **dev-toolbar:** update built-in app docs for opt-in defaults and add SEO structured data section ([e95050a](https://github.com/visulima/visulima/commit/e95050aa419fe1a85664ccd5c88a3967de70b113))
|
|
34
|
+
|
|
35
|
+
### Miscellaneous Chores
|
|
36
|
+
|
|
37
|
+
* **dev-toolbar:** enable a11y in tanstack-start-cloudflare example and fix LICENSE whitespace ([e02cd3e](https://github.com/visulima/visulima/commit/e02cd3edf2426c709d8247cc77f999f56315438e))
|
|
38
|
+
* **dev-toolbar:** update dependencies ([1be313b](https://github.com/visulima/visulima/commit/1be313bf37cd32739ddbb275e1af58dcf029e9a1))
|
|
39
|
+
* **dev-toolbar:** update examples to enable assets and inspector apps ([b3dc74d](https://github.com/visulima/visulima/commit/b3dc74d999acbfe4ee564a141dea47cf5ea2f71a))
|
|
40
|
+
* update dependencies and fix vite-react-rolldown example ([8811909](https://github.com/visulima/visulima/commit/8811909e90877b0041e4b08cdd797d58749464e9))
|
|
41
|
+
* year update ([47f4105](https://github.com/visulima/visulima/commit/47f410596ce7190cfea36a073db32e0cec50bbcd))
|
|
42
|
+
|
|
43
|
+
### Code Refactoring
|
|
44
|
+
|
|
45
|
+
* **dev-toolbar:** replace cn wrapper with direct clsx imports ([6ac069b](https://github.com/visulima/visulima/commit/6ac069bf0f2e772f0a5626a47d9034b824a5b23a))
|
|
46
|
+
* **dev-toolbar:** replace cn() wrapper with clsx() directly ([e774b36](https://github.com/visulima/visulima/commit/e774b367f9270dd9e43fcf0b7147a8cd23a1734a))
|
|
47
|
+
|
|
48
|
+
## @visulima/dev-toolbar [1.0.0-alpha.4](https://github.com/visulima/visulima/compare/@visulima/dev-toolbar@1.0.0-alpha.3...@visulima/dev-toolbar@1.0.0-alpha.4) (2026-03-04)
|
|
49
|
+
|
|
50
|
+
### Bug Fixes
|
|
51
|
+
|
|
52
|
+
* allowed vite 8 ([807071e](https://github.com/visulima/visulima/commit/807071ea041e1beaf7e773ac6bbd23efa9f33b32))
|
|
53
|
+
* **dev-toolbar:** exclude inspector and tailwind from More "Additional Apps" ([812252a](https://github.com/visulima/visulima/commit/812252a96916ac346765631a0997ff2150e54e40))
|
|
54
|
+
|
|
55
|
+
### Miscellaneous Chores
|
|
56
|
+
|
|
57
|
+
* deps update ([9be09e9](https://github.com/visulima/visulima/commit/9be09e95e2bce8fe52e88b186c43b8cc6bae865c))
|
|
58
|
+
* **dev-toolbar:** fix all ESLint errors and warnings across src and tests ([a14d2ed](https://github.com/visulima/visulima/commit/a14d2ed116b23ff1c61db28324b76aa55931919c))
|
|
59
|
+
* **dev-toolbar:** remove external Google Fonts dependency ([2e81646](https://github.com/visulima/visulima/commit/2e81646f49a886d8ef9df7f9c951c87363f9b50d))
|
|
60
|
+
|
|
1
61
|
## @visulima/dev-toolbar [1.0.0-alpha.3](https://github.com/visulima/visulima/compare/@visulima/dev-toolbar@1.0.0-alpha.2...@visulima/dev-toolbar@1.0.0-alpha.3) (2026-03-03)
|
|
2
62
|
|
|
3
63
|
### Features
|
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
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
|
|
@@ -24,9 +24,116 @@ SOFTWARE.
|
|
|
24
24
|
|
|
25
25
|
# Licenses of bundled dependencies
|
|
26
26
|
The published @visulima/dev-toolbar artifact additionally contains code with the following licenses:
|
|
27
|
-
ISC
|
|
27
|
+
ISC, MIT
|
|
28
28
|
|
|
29
29
|
# Bundled dependencies:
|
|
30
|
+
## @babel/helper-string-parser
|
|
31
|
+
License: MIT
|
|
32
|
+
By: The Babel Team
|
|
33
|
+
Repository: https://github.com/babel/babel.git
|
|
34
|
+
|
|
35
|
+
> MIT License
|
|
36
|
+
>
|
|
37
|
+
> Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
|
38
|
+
>
|
|
39
|
+
> Permission is hereby granted, free of charge, to any person obtaining
|
|
40
|
+
> a copy of this software and associated documentation files (the
|
|
41
|
+
> "Software"), to deal in the Software without restriction, including
|
|
42
|
+
> without limitation the rights to use, copy, modify, merge, publish,
|
|
43
|
+
> distribute, sublicense, and/or sell copies of the Software, and to
|
|
44
|
+
> permit persons to whom the Software is furnished to do so, subject to
|
|
45
|
+
> the following conditions:
|
|
46
|
+
>
|
|
47
|
+
> The above copyright notice and this permission notice shall be
|
|
48
|
+
> included in all copies or substantial portions of the Software.
|
|
49
|
+
>
|
|
50
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
51
|
+
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
52
|
+
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
53
|
+
> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
54
|
+
> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
55
|
+
> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
56
|
+
> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
57
|
+
|
|
58
|
+
---------------------------------------
|
|
59
|
+
|
|
60
|
+
## @babel/helper-validator-identifier
|
|
61
|
+
License: MIT
|
|
62
|
+
By: The Babel Team
|
|
63
|
+
Repository: https://github.com/babel/babel.git
|
|
64
|
+
|
|
65
|
+
> MIT License
|
|
66
|
+
>
|
|
67
|
+
> Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
|
68
|
+
>
|
|
69
|
+
> Permission is hereby granted, free of charge, to any person obtaining
|
|
70
|
+
> a copy of this software and associated documentation files (the
|
|
71
|
+
> "Software"), to deal in the Software without restriction, including
|
|
72
|
+
> without limitation the rights to use, copy, modify, merge, publish,
|
|
73
|
+
> distribute, sublicense, and/or sell copies of the Software, and to
|
|
74
|
+
> permit persons to whom the Software is furnished to do so, subject to
|
|
75
|
+
> the following conditions:
|
|
76
|
+
>
|
|
77
|
+
> The above copyright notice and this permission notice shall be
|
|
78
|
+
> included in all copies or substantial portions of the Software.
|
|
79
|
+
>
|
|
80
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
81
|
+
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
82
|
+
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
83
|
+
> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
84
|
+
> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
85
|
+
> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
86
|
+
> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
87
|
+
|
|
88
|
+
---------------------------------------
|
|
89
|
+
|
|
90
|
+
## @babel/types
|
|
91
|
+
License: MIT
|
|
92
|
+
By: The Babel Team
|
|
93
|
+
Repository: https://github.com/babel/babel.git
|
|
94
|
+
|
|
95
|
+
> MIT License
|
|
96
|
+
>
|
|
97
|
+
> Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
|
98
|
+
>
|
|
99
|
+
> Permission is hereby granted, free of charge, to any person obtaining
|
|
100
|
+
> a copy of this software and associated documentation files (the
|
|
101
|
+
> "Software"), to deal in the Software without restriction, including
|
|
102
|
+
> without limitation the rights to use, copy, modify, merge, publish,
|
|
103
|
+
> distribute, sublicense, and/or sell copies of the Software, and to
|
|
104
|
+
> permit persons to whom the Software is furnished to do so, subject to
|
|
105
|
+
> the following conditions:
|
|
106
|
+
>
|
|
107
|
+
> The above copyright notice and this permission notice shall be
|
|
108
|
+
> included in all copies or substantial portions of the Software.
|
|
109
|
+
>
|
|
110
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
111
|
+
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
112
|
+
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
113
|
+
> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
114
|
+
> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
115
|
+
> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
116
|
+
> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
117
|
+
|
|
118
|
+
---------------------------------------
|
|
119
|
+
|
|
120
|
+
## clsx
|
|
121
|
+
License: MIT
|
|
122
|
+
By: Luke Edwards
|
|
123
|
+
Repository: lukeed/clsx
|
|
124
|
+
|
|
125
|
+
> MIT License
|
|
126
|
+
>
|
|
127
|
+
> Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
128
|
+
>
|
|
129
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
130
|
+
>
|
|
131
|
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
132
|
+
>
|
|
133
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
134
|
+
|
|
135
|
+
---------------------------------------
|
|
136
|
+
|
|
30
137
|
## lucide-static
|
|
31
138
|
License: ISC
|
|
32
139
|
Repository: https://github.com/lucide-icons/lucide.git
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
type Severity = "critical" | "minor" | "moderate" | "serious";
|
|
2
|
+
type Standard = "best-practice" | "wcag21aa" | "wcag22aa" | "wcag2a";
|
|
3
|
+
interface A11yNode {
|
|
4
4
|
html: string;
|
|
5
5
|
selector: string;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
interface A11yIssue {
|
|
8
8
|
helpUrl: string;
|
|
9
9
|
id: string;
|
|
10
10
|
impact: Severity;
|
|
@@ -12,35 +12,31 @@ export interface A11yIssue {
|
|
|
12
12
|
nodes: A11yNode[];
|
|
13
13
|
wcagTags: string[];
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
interface A11yStoreState {
|
|
16
16
|
isScanning: boolean;
|
|
17
17
|
issues: A11yIssue[];
|
|
18
|
-
lastScan:
|
|
19
|
-
scanError:
|
|
18
|
+
lastScan: string | undefined;
|
|
19
|
+
scanError: string | undefined;
|
|
20
20
|
showOverlays: boolean;
|
|
21
21
|
standard: Standard;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
declare const SEVERITY_ORDER: Severity[];
|
|
24
24
|
type Listener = () => void;
|
|
25
25
|
declare class A11yStore {
|
|
26
26
|
private listeners;
|
|
27
27
|
private state;
|
|
28
28
|
constructor();
|
|
29
|
-
/** Remove all outline highlights from the page */
|
|
30
29
|
clearHighlights(): void;
|
|
31
30
|
getState(): Readonly<A11yStoreState>;
|
|
32
|
-
/** Scroll to and outline a single issue's elements */
|
|
33
31
|
highlightIssue(issue: A11yIssue): void;
|
|
34
|
-
/** Run an axe-core scan and persist results */
|
|
35
32
|
scan(disabledRules?: string[]): Promise<void>;
|
|
36
|
-
/** Toggle overlay highlights on all affected elements */
|
|
37
33
|
setShowOverlays(show: boolean): void;
|
|
38
|
-
/** Change the WCAG standard used for future scans */
|
|
39
34
|
setStandard(standard: Standard): void;
|
|
40
|
-
subscribe(
|
|
35
|
+
subscribe(listener: Listener): () => void;
|
|
41
36
|
private notify;
|
|
42
37
|
private persist;
|
|
43
38
|
private update;
|
|
44
39
|
}
|
|
45
|
-
|
|
46
|
-
export {};
|
|
40
|
+
declare const a11yStore: A11yStore;
|
|
41
|
+
export type { A11yIssue, A11yNode, A11yStoreState, Severity, Standard };
|
|
42
|
+
export { a11yStore, SEVERITY_ORDER };
|
package/dist/apps/a11y/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var X=Object.defineProperty;var O=(a,e)=>X(a,"name",{value:e,configurable:!0});import{addHookName as k}from"preact/devtools";import{clsx as d}from"../../packem_shared/clsx-wGlvpUfw.js";import{useState as C,useEffect as L}from"preact/hooks";import{jsxs as i,jsx as t,Fragment as W}from"preact/jsx-runtime";import w from"../../packem_shared/Button-Bkx66Co7.js";import{Alert as Y,AlertDescription as Z}from"../../packem_shared/Alert-D2CvX4fw.js";const ee=`<!-- @license lucide-static v0.577.0 - ISC -->
|
|
2
2
|
<svg
|
|
3
3
|
class="lucide lucide-accessibility"
|
|
4
4
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -17,5 +17,5 @@ var Y=Object.defineProperty;var A=(a,e)=>Y(a,"name",{value:e,configurable:!0});i
|
|
|
17
17
|
<path d="M4.24 14.5a5 5 0 0 0 6.88 6" />
|
|
18
18
|
<path d="M13.76 17.5a5 5 0 0 0-6.88-6" />
|
|
19
19
|
</svg>
|
|
20
|
-
`;var te=Object.defineProperty,
|
|
21
|
-
`)],{type:"text/csv"}),
|
|
20
|
+
`;var te=Object.defineProperty,x=O((a,e)=>te(a,"name",{value:e,configurable:!0}),"i$3");const E=["critical","serious","moderate","minor"],re={critical:"rgb(239,68,68)",minor:"rgb(100,116,139)",moderate:"rgb(249,115,22)",serious:"rgb(234,179,8)"},se={"best-practice":["best-practice"],wcag2a:["wcag2a"],wcag21aa:["wcag2a","wcag2aa","wcag21a","wcag21aa"],wcag22aa:["wcag2a","wcag2aa","wcag21a","wcag21aa","wcag22a","wcag22aa"]},_="__vdt_a11y__",ne=x(()=>{try{const a=sessionStorage.getItem(_);if(a){const e=JSON.parse(a);if(Array.isArray(e.issues))return{issues:e.issues,lastScan:e.lastScan??void 0}}}catch{}return{issues:[],lastScan:void 0}},"loadFromSession"),z=x((a,e)=>{const n=a;n.dataset.vdtA11y=e,n.style.setProperty("outline",`2px solid ${re[e]}`,"important"),n.style.setProperty("outline-offset","2px","important")},"setHighlight"),I=x(()=>{for(const a of document.querySelectorAll("[data-vdt-a11y]")){const e=a;delete e.dataset.vdtA11y,e.style.removeProperty("outline"),e.style.removeProperty("outline-offset")}},"clearHighlightsDOM"),H=x(a=>{I();for(const e of a)for(const n of e.nodes)try{const r=document.querySelector(n.selector);r&&z(r,e.impact)}catch{}},"applyOverlaysDOM"),ae=x(a=>{const e=a.at(-1);return Array.isArray(e)?e.join(" "):String(e??"")},"nodeSelector"),ie=x((a,e)=>{const n=[];for(const r of a)e.includes(r.id)||n.push({helpUrl:r.helpUrl,id:r.id,impact:r.impact??"minor",message:r.help,nodes:r.nodes.map(o=>({html:o.html,selector:ae(o.target)})),wcagTags:r.tags.filter(o=>o.startsWith("wcag")||o==="best-practice")});return n},"convertViolations"),oe=x(async a=>{const e=await import("axe-core"),n=typeof e.default?.run=="function"?e.default:e;if(typeof n.run!="function")throw new TypeError("axe-core could not be loaded — .run is not available");return n.run(document,{exclude:[["dev-toolbar"]],runOnly:{type:"tag",values:se[a]}})},"runAxeScan");class ce{static{O(this,"v")}static{x(this,"A11yStore")}listeners=new Set;state;constructor(){const{issues:e,lastScan:n}=ne();this.state={isScanning:!1,issues:e,lastScan:n,scanError:void 0,showOverlays:!1,standard:"wcag21aa"}}clearHighlights(){I()}getState(){return this.state}highlightIssue(e){I();let n=!1;for(const r of e.nodes)try{const o=document.querySelector(r.selector);o&&(z(o,e.impact),n||(o.scrollIntoView({behavior:"smooth",block:"center"}),n=!0))}catch{}}async scan(e=[]){if(!this.state.isScanning){this.update({isScanning:!0,scanError:void 0});try{const n=await oe(this.state.standard),r=ie(n.violations,e);this.update({isScanning:!1,issues:r,lastScan:new Date().toISOString()}),this.persist(),this.state.showOverlays&&H(r)}catch(n){this.update({isScanning:!1,scanError:n instanceof Error?n.message:String(n)})}}}setShowOverlays(e){this.update({showOverlays:e}),e?H(this.state.issues):I()}setStandard(e){this.update({standard:e})}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){for(const e of this.listeners)e()}persist(){try{sessionStorage.setItem(_,JSON.stringify({issues:this.state.issues,lastScan:this.state.lastScan}))}catch{}}update(e){this.state={...this.state,...e},this.notify()}}const l=new ce;var le=Object.defineProperty,c=O((a,e)=>le(a,"name",{value:e,configurable:!0}),"i$2");const N={critical:"Critical",minor:"Minor",moderate:"Moderate",serious:"Serious"},J={critical:"text-destructive",minor:"text-muted-foreground",moderate:"text-warning-foreground",serious:"text-warning-foreground"},de={critical:"bg-destructive/10 border-destructive/30",minor:"bg-foreground/4 border-border",moderate:"bg-warning/10 border-warning/30",serious:"bg-warning/10 border-warning/30"},ue={critical:"bg-destructive",minor:"bg-muted-foreground/50",moderate:"bg-warning",serious:"bg-warning"},ge=c(({count:a,isActive:e,onClick:n,severity:r})=>i("button",{class:d("flex flex-col items-center gap-1 px-3 py-2.5 border cursor-pointer transition-colors",e?"ring-1 ring-inset ring-primary/40":"hover:bg-foreground/6",de[r]),onClick:n,title:`${e?"Clear":"Filter by"} ${N[r]}`,type:"button",children:[t("span",{class:d("text-xl font-bold tabular-nums leading-none",J[r]),children:a}),t("span",{class:"text-[0.6rem] font-semibold uppercase tracking-wider text-muted-foreground",children:N[r]})]}),"SeverityBucket"),pe=c(({isSelected:a,issue:e,onClick:n,onDisable:r})=>i("div",{class:d("p-3 border cursor-pointer transition-colors",a?"bg-foreground/6 border-primary/30":"border-border hover:bg-foreground/3"),onClick:n,children:[i("div",{class:"flex items-start gap-2 mb-1.5",children:[t("span",{class:d("mt-1 size-2 rounded-full shrink-0",ue[e.impact])}),t("span",{class:"text-[0.75rem] font-semibold text-foreground flex-1 leading-snug",children:e.id}),t("span",{class:d("text-[0.6rem] font-bold uppercase tracking-wide shrink-0",J[e.impact]),children:N[e.impact]})]}),t("p",{class:"text-[0.7rem] text-muted-foreground leading-relaxed mb-2 ml-4",children:e.message}),e.nodes.length>0&&i("div",{class:"mb-2 ml-4 space-y-0.5",children:[e.nodes.slice(0,3).map((o,p)=>t("code",{class:"block text-[0.65rem] text-foreground/70 font-mono bg-foreground/5 px-2 py-1 truncate",children:o.selector},p)),e.nodes.length>3&&i("span",{class:"text-[0.62rem] text-muted-foreground/60",children:["+",e.nodes.length-3," more element",e.nodes.length>4?"s":""]})]}),i("div",{class:"flex items-center gap-2 flex-wrap ml-4",children:[e.wcagTags.slice(0,3).map(o=>t("span",{class:"text-[0.58rem] font-mono uppercase bg-primary/8 text-primary/70 border border-primary/20 px-1.5 py-0.5",children:o},o)),t("span",{class:"flex-1"}),t("a",{class:"text-[0.62rem] text-primary/70 hover:text-primary transition-colors",href:e.helpUrl,onClick:c(o=>o.stopPropagation(),"onClick"),rel:"noopener noreferrer",target:"_blank",children:"Learn more ↗"}),t("button",{class:"text-[0.62rem] text-muted-foreground/60 hover:text-muted-foreground transition-colors cursor-pointer bg-transparent border-0 p-0",onClick:c(o=>{o.stopPropagation(),r(e.id)},"onClick"),title:"Disable this rule for current session",type:"button",children:"Disable"})]})]}),"IssueCard"),me=c(a=>{const[e,n]=k(C(()=>l.getState()),"storeState"),[r,o]=k(C([]),"disabledRules"),[p,M]=k(C(void 0),"minSeverity"),[S,v]=k(C(void 0),"activeIssueId"),[m,f]=k(C(void 0),"filterSeverity");L(()=>l.subscribe(()=>n(l.getState())),[]),L(()=>l.clearHighlights.bind(l),[]);const{isScanning:b,issues:h,lastScan:u,scanError:$,showOverlays:T,standard:q}=e,U=u!==void 0||$!==void 0,P=c(()=>{f(void 0),v(void 0),l.scan(r).catch(()=>{})},"handleScan"),V=c(s=>{S===s.id?(v(void 0),l.clearHighlights(),T&&l.setShowOverlays(!0)):(v(s.id),l.highlightIssue(s))},"handleIssueClick"),F=c(s=>{o(g=>[...g,s])},"handleDisableRule"),R=h.filter(s=>!(r.includes(s.id)||m&&s.impact!==m||p&&E.indexOf(s.impact)>E.indexOf(p))),K=c(s=>h.filter(g=>!r.includes(g.id)&&g.impact===s).length,"countBy");return i("div",{class:"flex flex-col h-full",children:[i("div",{class:"shrink-0 flex items-center gap-2 px-4 py-2.5 border-b border-border bg-foreground/2 flex-wrap",children:[t(w,{class:d(b?"border-primary/30 text-primary/50 bg-primary/5":""),disabled:b,onClick:P,size:"sm",variant:"outline",children:b?"Scanning…":"Scan page"}),i("label",{class:"flex items-center gap-1.5 text-[0.7rem] text-muted-foreground",children:["Standard",i("select",{class:"bg-card border border-border text-foreground text-[0.7rem] px-1.5 py-1 cursor-pointer",onChange:c(s=>l.setStandard(s.target.value),"onChange"),style:"color-scheme: dark",value:q,children:[t("option",{value:"wcag21aa",children:"WCAG 2.1 AA"}),t("option",{value:"wcag22aa",children:"WCAG 2.2 AA"}),t("option",{value:"wcag2a",children:"WCAG 2.0 A"}),t("option",{value:"best-practice",children:"Best Practice"})]})]}),i("label",{class:"flex items-center gap-1.5 text-[0.7rem] text-muted-foreground",children:["Min",i("select",{class:"bg-card border border-border text-foreground text-[0.7rem] px-1.5 py-1 cursor-pointer",onChange:c(s=>{const{value:g}=s.target;M(g||void 0)},"onChange"),style:"color-scheme: dark",value:p??"",children:[t("option",{value:"",children:"All"}),t("option",{value:"critical",children:"Critical only"}),t("option",{value:"serious",children:"Serious+"}),t("option",{value:"moderate",children:"Moderate+"})]})]}),t(w,{class:d(T?"border-primary/30 text-primary bg-primary/8":""),onClick:c(()=>l.setShowOverlays(!T),"onClick"),size:"sm",title:"Toggle visual highlights on affected elements",variant:"outline",children:"Overlays"}),U&&h.length>0&&i(W,{children:[t(w,{class:"ml-auto",onClick:c(()=>{const s=new Blob([JSON.stringify(h,void 0,2)],{type:"application/json"}),g=URL.createObjectURL(s),A=document.createElement("a");A.href=g,A.download="a11y-audit.json",A.click(),URL.revokeObjectURL(g)},"onClick"),size:"sm",title:"Export audit results as JSON",variant:"outline",children:"JSON"}),t(w,{onClick:c(()=>{const s=c(y=>`"${y.replaceAll('"','""')}"`,"q"),g=["Rule ID","Severity","Message","Selector","HTML","WCAG Tags"].join(","),A=h.flatMap(y=>y.nodes.map(G=>[s(y.id),s(y.impact),s(y.message),s(G.selector),s(G.html),s(y.wcagTags.join("; "))].join(","))),Q=new Blob([[g,...A].join(`
|
|
21
|
+
`)],{type:"text/csv"}),B=URL.createObjectURL(Q),D=document.createElement("a");D.href=B,D.download="a11y-audit.csv",D.click(),URL.revokeObjectURL(B)},"onClick"),size:"sm",title:"Export audit results as CSV",variant:"outline",children:"CSV"})]})]}),i("div",{class:"flex-1 overflow-y-auto devtools-content-scroll",children:[$&&t(Y,{class:"rounded-none border-x-0 border-t-0",variant:"destructive",children:i(Z,{children:["Scan failed: ",$]})}),!U&&!b&&i("div",{class:"flex flex-col items-center justify-center gap-4 p-8 min-h-48 text-center",children:[t("p",{class:"text-[0.8125rem] text-muted-foreground max-w-sm",children:"Run an accessibility audit using axe-core to detect WCAG violations on this page."}),t(w,{onClick:P,variant:"outline",children:"Start scan"})]}),b&&t("div",{class:"flex items-center justify-center gap-3 p-8 min-h-48",children:t("span",{class:"text-[0.8rem] text-muted-foreground",children:"Scanning for accessibility issues…"})}),U&&!b&&!$&&i("div",{class:"p-5 space-y-4",children:[t("div",{class:"grid grid-cols-4 gap-2",children:E.map(s=>t(ge,{count:K(s),isActive:m===s,onClick:c(()=>f(m===s?void 0:s),"onClick"),severity:s},s))}),R.length===0?i("div",{class:"p-6 text-center border border-border",children:[t("p",{class:"text-[0.8125rem] font-medium text-foreground/70",children:h.length===0?"No violations found!":"No issues match the current filters."}),h.length===0&&t("p",{class:"mt-1 text-[0.7rem] text-muted-foreground",children:"Great — the page passes all rules for the selected standard."})]}):i("section",{children:[i("div",{class:"flex items-center gap-2 mb-2",children:[i("span",{class:"text-[0.65rem] font-bold uppercase tracking-[0.1em] text-muted-foreground",children:[t("span",{"aria-hidden":"true",class:"text-primary/50",children:"//"})," ",R.length," issue",R.length===1?"":"s",m?` · ${N[m]} only`:""]}),m&&t(w,{class:"h-auto p-0 text-[0.62rem]",onClick:c(()=>f(void 0),"onClick"),variant:"link",children:"Clear ×"})]}),t("div",{class:"space-y-2",children:R.map(s=>t(pe,{isSelected:S===s.id,issue:s,onClick:c(()=>V(s),"onClick"),onDisable:F},s.id))})]}),r.length>0&&i("div",{class:"flex items-center gap-2 text-[0.65rem] text-muted-foreground/60",children:[i("span",{children:[r.length," rule",r.length===1?"":"s"," disabled this session."]}),t(w,{class:"h-auto p-0 text-[0.62rem]",onClick:c(()=>o([]),"onClick"),variant:"link",children:"Reset"})]})]})]})]})},"A11yApp");var he=Object.defineProperty,j=O((a,e)=>he(a,"name",{value:e,configurable:!0}),"i$1");const fe={critical:"text-destructive",minor:"text-muted-foreground",moderate:"text-warning-foreground",serious:"text-warning-foreground"},be={critical:"Crit",minor:"Min",moderate:"Mod",serious:"Ser"},xe=j(a=>{const e=new Date(a).getTime();if(Number.isNaN(e))return"unknown";const n=Math.max(0,Math.floor((Date.now()-e)/1e3));if(n<10)return"just now";if(n<60)return`${n}s ago`;const r=Math.floor(n/60);return r<60?`${r} min ago`:`${Math.floor(r/60)} hr ago`},"formatElapsed"),ve=j(a=>{const[e,n]=k(C(()=>l.getState()),"state");L(()=>l.subscribe(()=>n(l.getState())),[]);const{isScanning:r,issues:o,lastScan:p,showOverlays:M}=e,S=o.length,v={critical:0,minor:0,moderate:0,serious:0};for(const u of o)v[u.impact]=(v[u.impact]??0)+1;const m=j(u=>v[u],"countBy");let f;r?f="Scanning…":p?f="Re-scan":f="Scan";const b=M?"border-primary/30 text-primary bg-primary/8":"border-border text-muted-foreground bg-transparent hover:text-foreground",h=o.length===0?"border-border/50 text-muted-foreground/40 bg-transparent cursor-not-allowed":d("cursor-pointer",b);return i("div",{class:"space-y-3 min-w-[200px]",children:[p?i(W,{children:[i("div",{class:"flex items-baseline gap-2",children:[t("span",{class:d("text-2xl font-bold tabular-nums leading-none",S>0?"text-destructive":"text-success-foreground"),children:S}),i("span",{class:"text-[0.65rem] text-muted-foreground",children:["violation",S===1?"":"s"]})]}),t("div",{class:"grid grid-cols-4 gap-1.5",children:E.map(u=>i("div",{class:"flex flex-col items-center gap-0.5",children:[t("span",{class:d("text-[0.85rem] font-bold tabular-nums leading-none",fe[u]),children:m(u)}),t("span",{class:"text-[0.55rem] uppercase tracking-wide text-muted-foreground/70",children:be[u]})]},u))}),i("p",{class:"text-[0.62rem] text-muted-foreground/50",children:["Scanned ",xe(p)]})]}):i("div",{children:[t("p",{class:"text-[0.72rem] text-muted-foreground",children:"No scan run yet."}),t("p",{class:"text-[0.65rem] text-muted-foreground/50 mt-0.5",children:"Scan this page to detect WCAG violations."})]}),i("div",{class:"flex items-center gap-2 pt-2 border-t border-border/50",children:[t("button",{class:d("flex-1 px-2.5 py-1.5 text-[0.7rem] font-medium border transition-colors cursor-pointer",r?"border-primary/30 text-primary/50 bg-primary/5 cursor-not-allowed":"border-border text-foreground bg-transparent hover:bg-foreground/5"),disabled:r,onClick:j(()=>{l.scan().catch(()=>{})},"onClick"),type:"button",children:f}),t("button",{class:d("px-2.5 py-1.5 text-[0.7rem] border transition-colors",h),disabled:o.length===0,onClick:j(()=>l.setShowOverlays(!M),"onClick"),title:"Toggle visual highlights on affected elements",type:"button",children:"Overlays"})]})]})},"A11yTooltip"),je={component:me,icon:ee,id:"dev-toolbar:a11y",name:"Accessibility",tooltip:ve};export{je as default};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var B=Object.defineProperty;var P=(t,i)=>B(t,"name",{value:i,configurable:!0});import{addHookName as a}from"preact/devtools";import{clsx as u}from"../../packem_shared/clsx-wGlvpUfw.js";import{useState as s,useRef as N,useEffect as C}from"preact/hooks";import{jsx as e,jsxs as l}from"preact/jsx-runtime";import c from"../../packem_shared/Button-Bkx66Co7.js";import E from"../../packem_shared/Input-Cs6aduTi.js";const H=`<!-- @license lucide-static v0.577.0 - ISC -->
|
|
2
|
+
<svg
|
|
3
|
+
class="lucide lucide-folder-open"
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width="24"
|
|
6
|
+
height="24"
|
|
7
|
+
viewBox="0 0 24 24"
|
|
8
|
+
fill="none"
|
|
9
|
+
stroke="currentColor"
|
|
10
|
+
stroke-width="2"
|
|
11
|
+
stroke-linecap="round"
|
|
12
|
+
stroke-linejoin="round"
|
|
13
|
+
>
|
|
14
|
+
<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />
|
|
15
|
+
</svg>
|
|
16
|
+
`;var O=Object.defineProperty,o=P((t,i)=>O(t,"name",{value:i,configurable:!0}),"o");const j=o(t=>!Number.isFinite(t)||t<0?"–":t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`,"formatSize"),A=o(t=>t.startsWith("/")&&!t.includes(":")?t:"#","safePublicPath"),M=[{label:"All",value:"all"},{label:"Images",value:"image"},{label:"Videos",value:"video"},{label:"Audio",value:"audio"},{label:"Fonts",value:"font"},{label:"Text",value:"text"},{label:"Other",value:"other"}],D={audio:"bg-yellow-500/15 text-yellow-400 border-yellow-500/30",font:"bg-orange-500/15 text-orange-400 border-orange-500/30",image:"bg-blue-500/15 text-blue-400 border-blue-500/30",other:"bg-foreground/6 text-muted-foreground border-border",text:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",video:"bg-purple-500/15 text-purple-400 border-purple-500/30"},z=o(({type:t})=>e("span",{class:u("inline-flex px-1.5 py-0.5 text-[0.6rem] font-mono font-bold uppercase border",D[t]),children:t}),"TypeBadge"),V=o(({asset:t})=>{const i=A(t.publicPath);if(i!=="#"){if(t.type==="image")return e("div",{class:"flex items-center justify-center bg-foreground/4 border border-border h-32 overflow-hidden",children:e("img",{alt:t.publicPath,class:"max-w-full max-h-full object-contain",onError:o(p=>{p.target.style.display="none"},"onError"),src:i})});if(t.type==="video")return e("div",{class:"flex items-center justify-center bg-foreground/4 border border-border h-32 overflow-hidden",children:e("video",{class:"max-w-full max-h-full",preload:"metadata",src:i})});if(t.type==="audio")return e("div",{class:"flex items-center justify-center bg-foreground/4 border border-border h-14 px-2",children:e("audio",{class:"w-full",controls:!0,preload:"none",src:i})})}},"AssetPreview"),K=o(({helpers:t})=>{const[i,p]=a(s([]),"assets"),[F,f]=a(s(!0),"loading"),[g,v]=a(s(void 0),"error"),[y,T]=a(s(""),"search"),[d,S]=a(s("all"),"typeFilter"),[n,b]=a(s(void 0),"selected"),[I,w]=a(s(!1),"copied"),m=a(N(void 0),"copyTimerRef");C(()=>()=>clearTimeout(m.current),[]);const h=o(()=>{f(!0),v(void 0),b(void 0),t.rpc.getStaticAssets().then(r=>{p(r),f(!1)}).catch(r=>{v(r.message??"Failed to load assets"),f(!1)})},"load");C(()=>{h()},[]);const x=i.filter(r=>{const k=y.toLowerCase(),R=!k||r.publicPath.toLowerCase().includes(k),$=d==="all"||r.type===d;return R&&$}),L=o(r=>{navigator.clipboard.writeText(r.publicPath).then(()=>{clearTimeout(m.current),w(!0),m.current=setTimeout(w,1500,!1)}).catch(()=>{})},"copyPath");return F?l("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[e("div",{"aria-hidden":"true",class:"flex gap-1.5 items-center",children:[0,160,320].map(r=>e("span",{class:"size-1.5 bg-primary/50 rounded-full animate-pulse",style:{animationDelay:`${r}ms`}},r))}),e("span",{class:"text-[0.75rem] text-muted-foreground",children:"Scanning assets…"})]}):g?l("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 text-center",children:[e("p",{class:"text-[0.8rem] text-destructive",children:g}),e(c,{onClick:h,size:"sm",variant:"outline",children:"Retry"})]}):l("div",{class:"flex flex-col h-full",children:[l("div",{class:"flex items-center gap-2 px-4 py-2.5 border-b border-border shrink-0 flex-wrap",children:[e(E,{class:"flex-1 min-w-32 bg-foreground/4 font-mono text-[0.8rem] placeholder:text-muted-foreground/50 focus-visible:border-primary/50 border-border",onInput:o(r=>T(r.target.value),"onInput"),placeholder:"Filter assets…",type:"text",value:y}),l("span",{class:"text-[0.7rem] text-muted-foreground shrink-0",children:[x.length," / ",i.length]}),e(c,{onClick:h,size:"sm",variant:"outline",children:"Refresh"})]}),e("div",{"aria-label":"Filter by type",class:"flex items-center gap-1.5 px-4 py-2 border-b border-border shrink-0 flex-wrap",role:"group",children:M.map(r=>e("button",{"aria-pressed":d===r.value,class:u("px-2.5 py-0.5 text-[0.7rem] font-medium border cursor-pointer transition-colors duration-100",d===r.value?"bg-primary/15 text-primary border-primary/30":"bg-foreground/4 text-muted-foreground border-border hover:bg-foreground/8 hover:text-foreground"),onClick:o(()=>S(r.value),"onClick"),type:"button",children:r.label},r.value))}),l("div",{class:"flex flex-1 min-h-0 overflow-hidden",children:[e("div",{class:"flex-1 overflow-auto divide-y divide-border/30",role:"list",children:x.length===0?e("div",{class:"flex items-center justify-center p-8 text-[0.8rem] text-muted-foreground",children:i.length===0?"No assets found in public directory.":"No assets match the current filter."}):x.map(r=>l("button",{"aria-label":r.publicPath,"aria-selected":n?.publicPath===r.publicPath,class:u("w-full flex items-center gap-3 px-4 py-2.5 text-left border-0 bg-transparent cursor-pointer","hover:bg-foreground/4 transition-colors duration-100",n?.publicPath===r.publicPath&&"bg-primary/6"),onClick:o(()=>b(n?.publicPath===r.publicPath?void 0:r),"onClick"),role:"option",type:"button",children:[e(z,{type:r.type}),e("span",{class:"flex-1 text-[0.775rem] font-mono text-foreground/80 truncate min-w-0",children:r.publicPath}),e("span",{class:"shrink-0 text-[0.65rem] text-muted-foreground",children:j(r.size)})]},r.publicPath))}),n&&l("div",{class:"border-l border-border bg-background w-72 shrink-0 flex flex-col overflow-hidden",children:[l("div",{class:"flex items-center justify-between gap-2 px-4 py-3 border-b border-border shrink-0",children:[e("span",{class:"text-[0.7rem] font-semibold text-foreground uppercase tracking-wide",children:"Asset Info"}),e(c,{"aria-label":"Close",class:"h-6 w-6 text-xs",onClick:o(()=>b(void 0),"onClick"),size:"icon",variant:"ghost",children:"✕"})]}),l("div",{class:"flex-1 overflow-auto p-4 space-y-4",children:[e(V,{asset:n}),l("div",{children:[e("div",{class:"text-[0.6rem] uppercase tracking-wider text-muted-foreground mb-1",children:"Path"}),e("code",{class:"text-[0.7rem] font-mono text-foreground/80 break-all",children:n.publicPath})]}),l("div",{children:[e("div",{class:"text-[0.6rem] uppercase tracking-wider text-muted-foreground mb-1",children:"Type"}),e(z,{type:n.type})]}),l("div",{children:[e("div",{class:"text-[0.6rem] uppercase tracking-wider text-muted-foreground mb-1",children:"Size"}),e("span",{class:"text-[0.8rem] font-mono text-foreground",children:j(n.size)})]}),l("div",{children:[e("div",{class:"text-[0.6rem] uppercase tracking-wider text-muted-foreground mb-1",children:"Last Modified"}),e("span",{class:"text-[0.75rem] text-foreground/80",children:new Date(n.mtime).toLocaleString()})]}),l("div",{class:"flex flex-col gap-2 pt-1",children:[e(c,{class:"w-full text-[0.75rem]",onClick:o(()=>L(n),"onClick"),size:"sm",variant:"outline",children:I?"Copied!":"Copy URL"}),e("a",{class:u("w-full text-[0.75rem] inline-flex items-center justify-center","px-3 py-1.5 border border-border bg-transparent","text-foreground hover:bg-foreground/6 transition-colors duration-100"),href:A(n.publicPath),rel:"noopener noreferrer",target:"_blank",children:"Open in browser"})]})]})]})]})]})},"AssetsApp"),X={component:K,icon:H,id:"dev-toolbar:assets",name:"Assets"};export{X as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var q=Object.defineProperty;var B=(t,e)=>q(t,"name",{value:e,configurable:!0});import{b as H}from"../../packem_shared/use-frame-state-CxrlPUM5.js";const P=`<!-- @license lucide-static v0.577.0 - ISC -->
|
|
2
2
|
<svg
|
|
3
3
|
class="lucide lucide-inspect"
|
|
4
4
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -14,4 +14,4 @@ var A=Object.defineProperty;var w=(t,e)=>A(t,"name",{value:e,configurable:!0});c
|
|
|
14
14
|
<path d="M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z" />
|
|
15
15
|
<path d="M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6" />
|
|
16
16
|
</svg>
|
|
17
|
-
`;var
|
|
17
|
+
`;var A=Object.defineProperty,s=B((t,e)=>A(t,"name",{value:e,configurable:!0}),"i$1");const L={bg:"#18181b",btnBg:"rgba(196,181,253,0.08)",btnBgHover:"rgba(196,181,253,0.16)",btnBorder:"rgba(196,181,253,0.25)",btnBorderHover:"rgba(196,181,253,0.5)",fg:"#fafafa",muted:"#a1a1aa",overlayBg:"rgba(196,181,253,0.06)",overlayBorder:"rgba(196,181,253,0.7)",primary:"#c4b5fd",shadow:"0 8px 32px rgba(0,0,0,.75)"},C={bg:"#ffffff",btnBg:"rgba(124,58,237,0.08)",btnBgHover:"rgba(124,58,237,0.16)",btnBorder:"rgba(124,58,237,0.25)",btnBorderHover:"rgba(124,58,237,0.5)",fg:"#18181b",muted:"#52525b",overlayBg:"rgba(124,58,237,0.06)",overlayBorder:"rgba(124,58,237,0.7)",primary:"#7c3aed",shadow:"0 8px 32px rgba(0,0,0,.15)"},$=s(()=>{try{const t=localStorage.getItem("__v_dt__theme");if(t==="light")return C;if(t==="dark")return L}catch{}return globalThis.window?.matchMedia("(prefers-color-scheme: dark)").matches?L:C},"getThemePalette"),x="__vdt_inspector_overlay",M="__vdt_inspector_label",E="__vdt_inspector_cursor",y="__vdt_inspector_badge",T="__vdt_inspector_kf",h="__vdt_inspector_result",D=s(()=>{let t=document.querySelector(`#${x}`);if(!t){const e=$();t=document.createElement("div"),t.id=x,t.style.cssText=["position:fixed","pointer-events:none","z-index:2147483644","box-sizing:border-box",`border:1px solid ${e.overlayBorder}`,`background:${e.overlayBg}`,"transition:top 60ms,left 60ms,width 60ms,height 60ms","display:none"].join(";");const o=document.createElement("div");o.id=M,o.style.cssText=["position:absolute","bottom:calc(100% + 2px)","left:0",`background:${e.bg}`,`color:${e.primary}`,"font:11px/1.2 'JetBrains Mono',monospace","padding:2px 6px","white-space:nowrap","pointer-events:none",`border:1px solid ${e.btnBorder}`].join(";"),t.append(o),document.body.append(t)}return t},"getOrCreateOverlay"),O=s(t=>{let e=t;for(;e;){const o=e.dataset.vdtSource;if(o)return o;e=e.parentElement??void 0}},"findSource"),R=s(t=>{const e=t.split(":");if(e.length<3)return t;const o=e[e.length-2],n=e.slice(0,-2).join(":");return`${n.split("/").pop()??n}:${o}`},"formatSourceShort"),N=s(t=>{const e=document.querySelector(`#${x}`);if(!e)return;const o=t.getBoundingClientRect();e.style.display="block",e.style.top=`${o.top}px`,e.style.left=`${o.left}px`,e.style.width=`${o.width}px`,e.style.height=`${o.height}px`;const n=document.querySelector(`#${M}`);if(n){const r=t.tagName.toLowerCase(),c=t.id?`#${t.id}`:"",l=t.classList.length>0?`.${[...t.classList].slice(0,3).join(".")}`:"",d=`${r}${c}${l}`,g=O(t);n.textContent=g?`${d} · ${R(g)}`:d,o.top<28?(n.style.bottom="auto",n.style.top="calc(100% + 2px)"):(n.style.top="",n.style.bottom="calc(100% + 2px)")}},"updateOverlayPosition"),_=s(()=>{const t=document.querySelector(`#${x}`);t&&(t.style.display="none")},"hideOverlay"),V=s(()=>{document.querySelector(`#${x}`)?.remove(),document.querySelector(`#${E}`)?.remove()},"removeOverlay"),S=s(t=>{let e=document.querySelector(`#${E}`);t?(e||(e=document.createElement("style"),e.id=E,document.head.append(e)),e.textContent=`*, *::before, *::after { cursor: crosshair !important; } #${y}, #${y} *, #${h}, #${h} * { cursor: pointer !important; }`):e&&e.remove()},"setCrosshairCursor"),I=s(()=>{document.querySelector(`#${y}`)?.remove()},"removeFloatingBadge"),z=s(t=>{if(!document.querySelector(`#${T}`)){const d=document.createElement("style");d.id=T,d.textContent="@keyframes __vdt_pulse{0%,100%{opacity:1}50%{opacity:.3}}",document.head.append(d)}I();const e=$(),o=document.createElement("div");o.id=y,o.style.cssText=["position:fixed","bottom:4rem","left:50%","transform:translateX(-50%)","z-index:2147483645","display:flex","align-items:center","gap:8px","padding:6px 14px 6px 10px",`background:${e.bg}`,`border:1px solid ${e.btnBorder}`,`box-shadow:${e.shadow}`,"font:12px/1 'JetBrains Mono',monospace",`color:${e.fg}`,"pointer-events:auto","user-select:none","white-space:nowrap"].join(";"),o.addEventListener("click",d=>{d.stopPropagation(),t()});const n=document.createElement("span");n.style.cssText=`display:inline-block;width:7px;height:7px;border-radius:50%;background:${e.primary};animation:__vdt_pulse 1.4s ease-in-out infinite;flex-shrink:0;`;const r=document.createElement("span");r.textContent="Click any element to inspect";const c=document.createElement("span");c.style.cssText=`color:${e.muted};margin:0 4px;`,c.textContent="·";const l=document.createElement("span");l.textContent="Cancel",l.style.cssText=`color:${e.primary};text-decoration:underline;text-underline-offset:3px;`,o.append(n,r,c,l),document.body.append(o)},"createFloatingBadge");let v;const J=s(t=>{const e=t.split(":"),o=Number.parseInt(e.at(-1)??"0",10)||void 0,n=Number.parseInt(e.at(-2)??"0",10)||void 0,r=e.slice(0,-2).join(":");globalThis.__VISULIMA_DEVTOOLS__?.rpc?.openInEditor?.(r,n,o,H()).catch(()=>{})},"openInEditor"),b=s(()=>{v?.(),v=void 0,document.querySelector(`#${h}`)?.remove()},"removeResultPopup"),k=s((t,e)=>{const o=$(),n=document.createElement("button");return n.textContent=t,n.style.cssText=[`background:${o.btnBg}`,`border:1px solid ${o.btnBorder}`,`color:${o.primary}`,"cursor:pointer","font:11px/1 'JetBrains Mono',monospace","padding:5px 10px","white-space:nowrap"].join(";"),n.addEventListener("pointerover",()=>{n.style.background=o.btnBgHover,n.style.borderColor=o.btnBorderHover}),n.addEventListener("pointerout",()=>{n.style.background=o.btnBg,n.style.borderColor=o.btnBorder}),n.addEventListener("click",r=>{r.stopPropagation(),e()}),n},"makeActionButton"),G=s((t,e,o)=>{v?.(),v=void 0,b();const n=$(),r=document.createElement("div");r.id=h,r.style.cssText=["position:fixed","z-index:2147483646",`background:${n.bg}`,`border:1px solid ${n.btnBorder}`,"padding:10px 32px 10px 12px","font:12px/1.4 'JetBrains Mono',monospace",`color:${n.fg}`,`box-shadow:${n.shadow}`,"min-width:200px","max-width:400px","pointer-events:auto"].join(";");let c=e.bottom+8;c+110>window.innerHeight&&(c=e.top-110-8);let{left:l}=e;l+280>window.innerWidth&&(l=Math.max(8,window.innerWidth-288)),r.style.top=`${c}px`,r.style.left=`${l}px`;const d=t.tagName.toLowerCase(),g=t.id?`#${t.id}`:"",i=t.classList.length>0?`.${[...t.classList].slice(0,3).join(".")}`:"",a=document.createElement("div");if(a.style.cssText=`color:${n.primary};font-weight:bold;margin-bottom:4px;word-break:break-all;`,a.textContent=`${d}${g}${i}`,r.append(a),o){const m=document.createElement("div");m.style.cssText=`color:${n.muted};margin-bottom:10px;word-break:break-all;font-size:10px;`,m.textContent=o,r.append(m)}const u=document.createElement("div");u.style.cssText="display:flex;gap:6px;flex-wrap:wrap;",o&&u.append(k("Open in editor",()=>{J(o),b()})),u.append(k("Copy HTML",()=>{navigator.clipboard.writeText(t.outerHTML).catch(()=>{}),b()})),o&&u.append(k("Copy path",()=>{navigator.clipboard.writeText(o).catch(()=>{}),b()})),r.append(u);const p=document.createElement("button");p.textContent="×",p.style.cssText=["position:absolute","top:6px","right:8px","background:transparent","border:none",`color:${n.muted}`,"cursor:pointer","font:16px/1 'JetBrains Mono',monospace","padding:0","line-height:1","transition:color 0.15s"].join(";"),p.addEventListener("pointerover",()=>{p.style.color=n.fg}),p.addEventListener("pointerout",()=>{p.style.color=n.muted}),p.addEventListener("click",m=>{m.stopPropagation(),b()}),r.append(p),document.body.append(r);const w=s(m=>{r.contains(m.target)||(b(),document.removeEventListener("click",w,!0),v=void 0)},"handleOutside"),j=setTimeout(()=>{document.addEventListener("click",w,!0)},100);v=s(()=>{clearTimeout(j),document.removeEventListener("click",w,!0)},"removePopupOutsideHandler")},"showResultPopup");let f;const K=s(t=>{f?.(),D(),S(!0);const e=s(()=>document.querySelector(`#${y}`)??void 0,"badgeElement"),o=s(i=>{if(!i)return!1;const a=e();return!!(a&&(i===a||a.contains(i)))},"isOverBadge"),n=s(i=>{if(!i)return!1;const a=document.querySelector(`#${h}`);return!!(a&&(i===a||a.contains(i)))},"isOverResultPopup"),r={cleanup(){document.removeEventListener("mousemove",r.handleMouseMove),document.removeEventListener("click",r.handleClick,!0),document.removeEventListener("keydown",r.handleKeyDown),_(),V(),S(!1),I(),f=void 0},handleClick(i){const a=i.target;if(!a||a.tagName==="DEV-TOOLBAR"||o(a)||n(a))return;i.preventDefault(),i.stopPropagation();const u=a.getBoundingClientRect(),p=O(a);_(),G(a,u,p)},handleKeyDown(i){i.key==="Escape"&&(r.cleanup(),t())},handleMouseMove(i){const a=i.target;if(!a||a.tagName==="DEV-TOOLBAR"||o(a)||n(a)){_();return}N(a)}},{cleanup:c,handleClick:l,handleKeyDown:d,handleMouseMove:g}=r;z(()=>{c(),t()}),document.addEventListener("mousemove",g),document.addEventListener("click",l,!0),document.addEventListener("keydown",d),f=c},"startGlobalInspection"),F=s(()=>{f?.(),b()},"stopGlobalInspection"),X={icon:P,id:"dev-toolbar:inspector",name:"Inspector",onClick(){const t=globalThis.__VISULIMA_DEVTOOLS__;K(()=>{t?.setAppActive&&t.setAppActive("dev-toolbar:inspector",!1)})},onDeactivate(){F()}};export{X as default};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Start element inspection mode.
|
|
3
3
|
* Attaches crosshair cursor, hover highlight overlay, and a floating badge.
|
|
4
|
+
* Inspection stays active after each click so the user can inspect multiple
|
|
5
|
+
* elements without re-activating. Only stops on explicit cancel (Escape,
|
|
6
|
+
* badge Cancel button) or via {@link stopGlobalInspection}.
|
|
4
7
|
* Survives component unmounts — state lives at module level.
|
|
5
|
-
* @param onComplete Called when the user clicks an element (after cleanup).
|
|
6
8
|
* @param onCancel Called when the user cancels via badge button or Escape.
|
|
7
9
|
*/
|
|
8
|
-
export declare const startGlobalInspection: (
|
|
10
|
+
export declare const startGlobalInspection: (onCancel: () => void) => void;
|
|
9
11
|
/**
|
|
10
12
|
* Cancel any in-progress inspection and clean up all DOM side-effects.
|
|
11
13
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var U=Object.defineProperty;var k=(o,d)=>U(o,"name",{value:d,configurable:!0});import{addHookName as i}from"preact/devtools";import{useState as s,useRef as E,useEffect as S}from"preact/hooks";import
|
|
1
|
+
var U=Object.defineProperty;var k=(o,d)=>U(o,"name",{value:d,configurable:!0});import{addHookName as i}from"preact/devtools";import{clsx as j}from"../../packem_shared/clsx-wGlvpUfw.js";import{useState as s,useRef as E,useEffect as S}from"preact/hooks";import{jsx as r,jsxs as t}from"preact/jsx-runtime";import b from"../../packem_shared/Button-Bkx66Co7.js";import A from"../../packem_shared/Input-Cs6aduTi.js";const G=`<!-- @license lucide-static v0.577.0 - ISC -->
|
|
2
2
|
<svg
|
|
3
3
|
class="lucide lucide-network"
|
|
4
4
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -17,4 +17,4 @@ var U=Object.defineProperty;var k=(o,d)=>U(o,"name",{value:d,configurable:!0});i
|
|
|
17
17
|
<path d="M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3" />
|
|
18
18
|
<path d="M12 12V8" />
|
|
19
19
|
</svg>
|
|
20
|
-
`;var
|
|
20
|
+
`;var $=Object.defineProperty,n=k((o,d)=>$(o,"name",{value:d,configurable:!0}),"o");const B={css:"bg-purple-500/15 text-purple-400 border-purple-500/30",js:"bg-green-500/15 text-green-400 border-green-500/30",json:"bg-yellow-500/15 text-yellow-400 border-yellow-500/30",jsx:"bg-green-500/15 text-green-400 border-green-500/30",svg:"bg-orange-500/15 text-orange-400 border-orange-500/30",ts:"bg-blue-500/15 text-blue-400 border-blue-500/30",tsx:"bg-blue-500/15 text-blue-400 border-blue-500/30",vue:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30"},F=/\.([a-z]+)(?:\?|$)/i,H=n(o=>o.match(F)?.[1]?.toLowerCase()??"?","getExtension"),C=n(({ext:o})=>r("span",{class:j("inline-flex px-1.5 py-0.5 text-[0.6rem] font-mono font-bold uppercase border",B[o]??"bg-foreground/6 text-muted-foreground border-border"),children:o}),"ExtensionBadge"),N=n(({helpers:o})=>{const[d,I]=i(s([]),"modules"),[M,p]=i(s(!0),"loading"),[v,w]=i(s(void 0),"error"),[x,L]=i(s(""),"search"),[c,u]=i(s(void 0),"selectedId"),[y,h]=i(s([]),"importersList"),R=i(E(null),"searchRef"),f=n(()=>{p(!0),w(void 0),u(void 0),o.rpc.getModuleGraph().then(e=>{const a=e.map(l=>({ext:H(l.url??l.id??""),id:l.id??l.url??"",importers:l.importerCount??0,importerUrls:Array.isArray(l.importerUrls)?l.importerUrls:[],url:l.url??l.id??""}));I(a),p(!1)}).catch(e=>{w(e.message??"Failed to load module graph"),p(!1)})},"load");S(()=>{f()},[]);const g=d.filter(e=>{const a=x.toLowerCase();return!a||e.url.toLowerCase().includes(a)||e.ext.includes(a)}),m=c?d.find(e=>e.id===c):void 0,z=n(e=>{if(c===e.id){u(void 0),h([]);return}u(e.id),h(e.importerUrls)},"showImporters");return M?t("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[r("div",{"aria-hidden":"true",class:"flex gap-1.5 items-center",children:[0,160,320].map(e=>r("span",{class:"size-1.5 bg-primary/50 rounded-full animate-pulse",style:{animationDelay:`${e}ms`}},e))}),r("span",{class:"text-[0.75rem] text-muted-foreground",children:"Scanning module graph…"})]}):v?t("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 text-center",children:[r("p",{class:"text-[0.8rem] text-destructive",children:v}),r(b,{onClick:f,size:"sm",variant:"outline",children:"Retry"})]}):t("div",{class:"flex flex-col h-full",children:[t("div",{class:"flex items-center gap-2 px-4 py-2.5 border-b border-border shrink-0",children:[r(A,{class:"flex-1 bg-foreground/4 font-mono text-[0.8rem] placeholder:text-muted-foreground/50 focus-visible:border-primary/50 border-border",onInput:n(e=>L(e.target.value),"onInput"),placeholder:"Filter modules…",ref:R,type:"text",value:x}),t("span",{class:"text-[0.7rem] text-muted-foreground shrink-0",children:[g.length," / ",d.length]}),r(b,{onClick:f,size:"sm",variant:"outline",children:"Refresh"})]}),t("div",{class:"flex flex-1 min-h-0 overflow-hidden",children:[r("div",{class:"flex-1 overflow-auto divide-y divide-border/30",children:g.length===0?t("div",{class:"flex items-center justify-center p-8 text-[0.8rem] text-muted-foreground",children:['No modules match "',x,'"']}):g.map(e=>t("button",{class:j("w-full flex items-center gap-3 px-4 py-2.5 text-left border-0 bg-transparent cursor-pointer","hover:bg-foreground/4 transition-colors duration-100",c===e.id&&"bg-primary/6"),onClick:n(()=>z(e),"onClick"),type:"button",children:[r(C,{ext:e.ext}),r("span",{class:"flex-1 text-[0.775rem] font-mono text-foreground/80 truncate min-w-0",children:e.url}),e.importers>0&&t("span",{class:"shrink-0 text-[0.65rem] text-muted-foreground px-1.5 py-0.5 bg-foreground/6 border border-border/50",children:[e.importers,"↑"]})]},e.id))}),m&&t("div",{class:"border-l border-border bg-background w-72 shrink-0 flex flex-col overflow-hidden",children:[t("div",{class:"flex items-center justify-between gap-2 px-4 py-3 border-b border-border shrink-0",children:[r("span",{class:"text-[0.7rem] font-semibold text-foreground uppercase tracking-wide",children:"Module Info"}),r(b,{"aria-label":"Close",class:"h-6 w-6 text-xs",onClick:n(()=>{u(void 0),h([])},"onClick"),size:"icon",variant:"ghost",children:"✕"})]}),t("div",{class:"flex-1 overflow-auto p-4 space-y-3",children:[t("div",{children:[r("div",{class:"text-[0.6rem] uppercase tracking-wider text-muted-foreground mb-1",children:"URL"}),r("code",{class:"text-[0.7rem] font-mono text-foreground/80 break-all",children:m.url})]}),t("div",{children:[r("div",{class:"text-[0.6rem] uppercase tracking-wider text-muted-foreground mb-1",children:"Type"}),r(C,{ext:m.ext})]}),t("div",{children:[r("div",{class:"text-[0.6rem] uppercase tracking-wider text-muted-foreground mb-1",children:"Importers"}),r("span",{class:"text-[0.8rem] font-mono text-foreground",children:m.importers})]}),y.length>0&&t("div",{children:[r("div",{class:"text-[0.6rem] uppercase tracking-wider text-muted-foreground mb-1",children:"Imported by"}),r("div",{class:"space-y-1",children:y.map(e=>r("code",{class:"block text-[0.65rem] font-mono text-muted-foreground break-all",children:e},e))})]})]})]})]})]})},"ModuleGraphApp"),K={component:N,icon:G,id:"dev-toolbar:module-graph",name:"Modules"};export{K as default};
|