@nuxt/ui 3.0.0-alpha.7 → 3.0.0-alpha.8

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 (243) hide show
  1. package/.nuxt/ui/accordion.ts +20 -0
  2. package/.nuxt/ui/alert.ts +242 -0
  3. package/.nuxt/ui/avatar-group.ts +40 -0
  4. package/.nuxt/ui/avatar.ts +42 -0
  5. package/.nuxt/ui/badge.ts +194 -0
  6. package/.nuxt/ui/breadcrumb.ts +45 -0
  7. package/.nuxt/ui/button-group.ts +16 -0
  8. package/.nuxt/ui/button.ts +344 -0
  9. package/.nuxt/ui/card.ts +8 -0
  10. package/.nuxt/ui/carousel.ts +41 -0
  11. package/.nuxt/ui/checkbox.ts +105 -0
  12. package/.nuxt/ui/chip.ts +67 -0
  13. package/.nuxt/ui/collapsible.ts +6 -0
  14. package/.nuxt/ui/command-palette.ts +40 -0
  15. package/.nuxt/ui/container.ts +3 -0
  16. package/.nuxt/ui/context-menu.ts +198 -0
  17. package/.nuxt/ui/drawer.ts +55 -0
  18. package/.nuxt/ui/dropdown-menu.ts +199 -0
  19. package/.nuxt/ui/form-field.ts +40 -0
  20. package/.nuxt/ui/form.ts +3 -0
  21. package/.nuxt/ui/index.ts +43 -0
  22. package/.nuxt/ui/input-menu.ts +411 -0
  23. package/.nuxt/ui/input.ts +263 -0
  24. package/.nuxt/ui/kbd.ts +19 -0
  25. package/.nuxt/ui/link.ts +15 -0
  26. package/.nuxt/ui/modal.ts +28 -0
  27. package/.nuxt/ui/navigation-menu.ts +390 -0
  28. package/.nuxt/ui/pagination.ts +8 -0
  29. package/.nuxt/ui/popover.ts +6 -0
  30. package/.nuxt/ui/progress.ts +258 -0
  31. package/.nuxt/ui/radio-group.ts +112 -0
  32. package/.nuxt/ui/select-menu.ts +321 -0
  33. package/.nuxt/ui/select.ts +314 -0
  34. package/.nuxt/ui/separator.ts +143 -0
  35. package/.nuxt/ui/skeleton.ts +3 -0
  36. package/.nuxt/ui/slideover.ts +63 -0
  37. package/.nuxt/ui/slider.ts +148 -0
  38. package/.nuxt/ui/switch.ts +113 -0
  39. package/.nuxt/ui/table.ts +128 -0
  40. package/.nuxt/ui/tabs.ts +227 -0
  41. package/.nuxt/ui/textarea.ts +263 -0
  42. package/.nuxt/ui/toast.ts +66 -0
  43. package/.nuxt/ui/toaster.ts +75 -0
  44. package/.nuxt/ui/tooltip.ts +9 -0
  45. package/cli/templates.mjs +1 -1
  46. package/dist/chunks/component-meta.cjs +73264 -0
  47. package/dist/chunks/component-meta.mjs +73262 -0
  48. package/dist/client/devtools/200.html +1 -0
  49. package/dist/client/devtools/404.html +1 -0
  50. package/dist/client/devtools/_fonts/rP2Wp2ywxg089UriCZaSExd86J3t9jz86MvyyKK58UfivUw4aw-SK92LTmKP0.woff2 +0 -0
  51. package/dist/client/devtools/_fonts/rP2Wp2ywxg089UriCZaSExd86J3t9jz86MvyyKy58UfivUw-9uYm8d48E4.woff2 +0 -0
  52. package/dist/client/devtools/_fonts/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu0-K6z9mXg-VNw7NHvqnp.woff2 +0 -0
  53. package/dist/client/devtools/_fonts/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu6-K6z9mXgjU0-EkYdMs3MAX.woff2 +0 -0
  54. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-7DW3w-R7n06NbhGy.woff +0 -0
  55. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDG3w-leGNfkTmsj.woff +0 -0
  56. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDW3w-ciElMF03ku.woff +0 -0
  57. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8JCm3w-sB722Uoa0f.woff +0 -0
  58. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8JDW3w-PBDI1JDjwV.woff +0 -0
  59. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8gCm3w-0q1hqVn09O.woff +0 -0
  60. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat9XCm3w-ByvzuLy2fa.woff +0 -0
  61. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat9uCm3w-5TKCIs6EEw.woff +0 -0
  62. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat_XDW3w-r2swRDGfn2.woff +0 -0
  63. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAC5thTQ-ldB60l5U8r.woff +0 -0
  64. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAIpthTQ-wbFKGFDrgo.woff +0 -0
  65. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAIpxhTQ-LLUBv5jskj.woff +0 -0
  66. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwARZthTQ-F71RdTRbNg.woff +0 -0
  67. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwA_JxhTQ-6nh65gZkc0.woff +0 -0
  68. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAfJthTQ-aMoWEJLmTt.woff +0 -0
  69. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAkJxhTQ-WMBvmLOgKm.woff +0 -0
  70. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAop1hTQ-utGC2hnWq2.woff +0 -0
  71. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxhTQ-YpyTieVa5B.woff +0 -0
  72. package/dist/client/devtools/_nuxt/Bj9hdafK.js +1 -0
  73. package/dist/client/devtools/_nuxt/DM3_wAgz.js +62 -0
  74. package/dist/client/devtools/_nuxt/builds/latest.json +1 -0
  75. package/dist/client/devtools/_nuxt/builds/meta/e6b425f7-b919-4014-915b-0ea07c316790.json +1 -0
  76. package/dist/client/devtools/_nuxt/entry.DaJP-ZMB.css +24 -0
  77. package/dist/client/devtools/_nuxt/error-404.B0Nmv3fV.css +1 -0
  78. package/dist/client/devtools/_nuxt/error-500.C8fgTxVz.css +1 -0
  79. package/dist/client/devtools/_nuxt/hKiujHsR.js +1 -0
  80. package/dist/client/devtools/favicon.svg +1 -0
  81. package/dist/client/devtools/index.html +1 -0
  82. package/dist/devtools/runtime/DevtoolsRenderer.vue +53 -0
  83. package/dist/devtools/runtime/examples/AvatarGroupExample.vue +7 -0
  84. package/dist/devtools/runtime/examples/ButtonGroupExample.vue +8 -0
  85. package/dist/devtools/runtime/examples/CardExample.vue +13 -0
  86. package/dist/devtools/runtime/examples/CarouselExample.vue +13 -0
  87. package/dist/devtools/runtime/examples/ChipExample.vue +5 -0
  88. package/dist/devtools/runtime/examples/CollapsibleExample.vue +8 -0
  89. package/dist/devtools/runtime/examples/CommandPaletteExample.vue +29 -0
  90. package/dist/devtools/runtime/examples/ContainerExample.vue +5 -0
  91. package/dist/devtools/runtime/examples/ContextMenuExample.vue +5 -0
  92. package/dist/devtools/runtime/examples/DrawerExample.vue +8 -0
  93. package/dist/devtools/runtime/examples/DropdownMenuExample.vue +5 -0
  94. package/dist/devtools/runtime/examples/FormExample.vue +30 -0
  95. package/dist/devtools/runtime/examples/FormFieldExample.vue +5 -0
  96. package/dist/devtools/runtime/examples/LinkExample.vue +5 -0
  97. package/dist/devtools/runtime/examples/ModalExample.vue +8 -0
  98. package/dist/devtools/runtime/examples/PopoverExample.vue +8 -0
  99. package/dist/devtools/runtime/examples/SkeletonExample.vue +3 -0
  100. package/dist/devtools/runtime/examples/SlideoverExample.vue +8 -0
  101. package/dist/devtools/runtime/examples/ToasterExample.vue +11 -0
  102. package/dist/devtools/runtime/examples/TooltipExample.vue +5 -0
  103. package/dist/module.cjs +222 -4
  104. package/dist/module.d.cts +54 -0
  105. package/dist/module.d.mts +10 -0
  106. package/dist/module.d.ts +10 -0
  107. package/dist/module.json +1 -1
  108. package/dist/module.mjs +157 -2763
  109. package/dist/runtime/components/Accordion.vue +32 -1
  110. package/dist/runtime/components/Alert.vue +4 -0
  111. package/dist/runtime/components/App.vue +8 -0
  112. package/dist/runtime/components/Avatar.vue +23 -5
  113. package/dist/runtime/components/AvatarGroup.vue +3 -0
  114. package/dist/runtime/components/Badge.vue +33 -3
  115. package/dist/runtime/components/Breadcrumb.vue +25 -1
  116. package/dist/runtime/components/Button.vue +6 -1
  117. package/dist/runtime/components/ButtonGroup.vue +4 -1
  118. package/dist/runtime/components/Card.vue +3 -0
  119. package/dist/runtime/components/Carousel.vue +7 -2
  120. package/dist/runtime/components/Checkbox.vue +4 -0
  121. package/dist/runtime/components/Chip.vue +9 -2
  122. package/dist/runtime/components/Collapsible.vue +3 -0
  123. package/dist/runtime/components/CommandPalette.vue +3 -1
  124. package/dist/runtime/components/Container.vue +3 -0
  125. package/dist/runtime/components/ContextMenu.vue +64 -3
  126. package/dist/runtime/components/ContextMenuContent.vue +8 -8
  127. package/dist/runtime/components/Drawer.vue +3 -0
  128. package/dist/runtime/components/DropdownMenu.vue +52 -3
  129. package/dist/runtime/components/DropdownMenuContent.vue +8 -8
  130. package/dist/runtime/components/Form.vue +3 -0
  131. package/dist/runtime/components/FormField.vue +3 -0
  132. package/dist/runtime/components/Input.vue +1 -0
  133. package/dist/runtime/components/InputMenu.vue +23 -12
  134. package/dist/runtime/components/Kbd.vue +2 -0
  135. package/dist/runtime/components/Link.vue +50 -1
  136. package/dist/runtime/components/Modal.vue +3 -0
  137. package/dist/runtime/components/NavigationMenu.vue +91 -44
  138. package/dist/runtime/components/Pagination.vue +5 -1
  139. package/dist/runtime/components/Popover.vue +3 -0
  140. package/dist/runtime/components/Progress.vue +1 -1
  141. package/dist/runtime/components/RadioGroup.vue +4 -1
  142. package/dist/runtime/components/Select.vue +24 -13
  143. package/dist/runtime/components/SelectMenu.vue +29 -17
  144. package/dist/runtime/components/Separator.vue +1 -1
  145. package/dist/runtime/components/Skeleton.vue +3 -0
  146. package/dist/runtime/components/Slideover.vue +3 -0
  147. package/dist/runtime/components/Slider.vue +1 -1
  148. package/dist/runtime/components/Switch.vue +5 -1
  149. package/dist/runtime/components/Table.vue +16 -7
  150. package/dist/runtime/components/Tabs.vue +20 -1
  151. package/dist/runtime/components/Toast.vue +4 -0
  152. package/dist/runtime/components/Toaster.vue +7 -0
  153. package/dist/runtime/components/Tooltip.vue +3 -0
  154. package/dist/runtime/composables/defineShortcuts.js +0 -6
  155. package/dist/runtime/composables/extendDevtoolsMeta.d.ts +7 -0
  156. package/dist/runtime/composables/extendDevtoolsMeta.js +2 -0
  157. package/dist/runtime/composables/useKbd.d.ts +10 -3
  158. package/dist/runtime/composables/useKbd.js +14 -8
  159. package/dist/runtime/types/utils.d.ts +7 -0
  160. package/dist/runtime/utils/index.js +1 -1
  161. package/dist/runtime/utils/link.d.ts +1 -1
  162. package/dist/runtime/vue/components/Icon.vue +15 -0
  163. package/dist/runtime/vue/components/Link.vue +195 -0
  164. package/dist/runtime/vue/plugins/color-mode.d.ts +4 -0
  165. package/dist/runtime/vue/plugins/color-mode.js +6 -0
  166. package/dist/runtime/vue/plugins/head.d.ts +4 -0
  167. package/dist/runtime/vue/plugins/head.js +6 -0
  168. package/dist/runtime/vue/stubs.d.ts +15 -0
  169. package/dist/runtime/vue/stubs.js +27 -0
  170. package/dist/shared/ui.BU7wzH0D.cjs +2872 -0
  171. package/dist/shared/ui.BufKhDiD.mjs +2865 -0
  172. package/dist/unplugin.cjs +192 -0
  173. package/dist/unplugin.d.cts +47 -0
  174. package/dist/unplugin.d.mts +47 -0
  175. package/dist/unplugin.d.ts +47 -0
  176. package/dist/unplugin.mjs +181 -0
  177. package/dist/vite.cjs +22 -0
  178. package/dist/vite.d.cts +13 -0
  179. package/dist/vite.d.mts +13 -0
  180. package/dist/vite.d.ts +13 -0
  181. package/dist/vite.mjs +20 -0
  182. package/package.json +68 -30
  183. package/vue-plugin.d.ts +5 -0
  184. package/cli/node_modules/.ignored/citty/LICENSE +0 -36
  185. package/cli/node_modules/.ignored/citty/README.md +0 -134
  186. package/cli/node_modules/.ignored/citty/dist/index.cjs +0 -475
  187. package/cli/node_modules/.ignored/citty/dist/index.d.cts +0 -80
  188. package/cli/node_modules/.ignored/citty/dist/index.d.mts +0 -80
  189. package/cli/node_modules/.ignored/citty/dist/index.d.ts +0 -80
  190. package/cli/node_modules/.ignored/citty/dist/index.mjs +0 -463
  191. package/cli/node_modules/.ignored/citty/package.json +0 -49
  192. package/cli/node_modules/.ignored/consola/LICENSE +0 -47
  193. package/cli/node_modules/.ignored/consola/README.md +0 -318
  194. package/cli/node_modules/.ignored/consola/core.d.ts +0 -1
  195. package/cli/node_modules/.ignored/consola/dist/basic.cjs +0 -32
  196. package/cli/node_modules/.ignored/consola/dist/basic.d.ts +0 -9
  197. package/cli/node_modules/.ignored/consola/dist/basic.mjs +0 -24
  198. package/cli/node_modules/.ignored/consola/dist/browser.cjs +0 -80
  199. package/cli/node_modules/.ignored/consola/dist/browser.d.ts +0 -7
  200. package/cli/node_modules/.ignored/consola/dist/browser.mjs +0 -72
  201. package/cli/node_modules/.ignored/consola/dist/chunks/prompt.cjs +0 -436
  202. package/cli/node_modules/.ignored/consola/dist/chunks/prompt.mjs +0 -429
  203. package/cli/node_modules/.ignored/consola/dist/core.cjs +0 -415
  204. package/cli/node_modules/.ignored/consola/dist/core.d.ts +0 -124
  205. package/cli/node_modules/.ignored/consola/dist/core.mjs +0 -410
  206. package/cli/node_modules/.ignored/consola/dist/index.cjs +0 -21
  207. package/cli/node_modules/.ignored/consola/dist/index.d.ts +0 -9
  208. package/cli/node_modules/.ignored/consola/dist/index.mjs +0 -8
  209. package/cli/node_modules/.ignored/consola/dist/shared/consola.06ad8a64.mjs +0 -62
  210. package/cli/node_modules/.ignored/consola/dist/shared/consola.36c0034f.mjs +0 -636
  211. package/cli/node_modules/.ignored/consola/dist/shared/consola.4bbae468.cjs +0 -645
  212. package/cli/node_modules/.ignored/consola/dist/shared/consola.deac7d5a.cjs +0 -65
  213. package/cli/node_modules/.ignored/consola/dist/utils.cjs +0 -308
  214. package/cli/node_modules/.ignored/consola/dist/utils.d.ts +0 -169
  215. package/cli/node_modules/.ignored/consola/dist/utils.mjs +0 -284
  216. package/cli/node_modules/.ignored/consola/lib/index.cjs +0 -9
  217. package/cli/node_modules/.ignored/consola/package.json +0 -101
  218. package/cli/node_modules/.ignored/consola/utils.d.ts +0 -1
  219. package/cli/node_modules/.ignored/pathe/LICENSE +0 -44
  220. package/cli/node_modules/.ignored/pathe/README.md +0 -69
  221. package/cli/node_modules/.ignored/pathe/dist/index.cjs +0 -23
  222. package/cli/node_modules/.ignored/pathe/dist/index.d.cts +0 -36
  223. package/cli/node_modules/.ignored/pathe/dist/index.d.mts +0 -36
  224. package/cli/node_modules/.ignored/pathe/dist/index.d.ts +0 -36
  225. package/cli/node_modules/.ignored/pathe/dist/index.mjs +0 -1
  226. package/cli/node_modules/.ignored/pathe/dist/shared/pathe.1f0a373c.cjs +0 -238
  227. package/cli/node_modules/.ignored/pathe/dist/shared/pathe.ff20891b.mjs +0 -221
  228. package/cli/node_modules/.ignored/pathe/dist/utils.cjs +0 -58
  229. package/cli/node_modules/.ignored/pathe/dist/utils.d.cts +0 -5
  230. package/cli/node_modules/.ignored/pathe/dist/utils.d.mts +0 -5
  231. package/cli/node_modules/.ignored/pathe/dist/utils.d.ts +0 -5
  232. package/cli/node_modules/.ignored/pathe/dist/utils.mjs +0 -54
  233. package/cli/node_modules/.ignored/pathe/package.json +0 -48
  234. package/cli/node_modules/.ignored/pathe/utils.d.ts +0 -1
  235. package/cli/node_modules/.ignored/scule/LICENSE +0 -21
  236. package/cli/node_modules/.ignored/scule/README.md +0 -149
  237. package/cli/node_modules/.ignored/scule/dist/index.cjs +0 -92
  238. package/cli/node_modules/.ignored/scule/dist/index.d.cts +0 -57
  239. package/cli/node_modules/.ignored/scule/dist/index.d.mts +0 -57
  240. package/cli/node_modules/.ignored/scule/dist/index.d.ts +0 -57
  241. package/cli/node_modules/.ignored/scule/dist/index.mjs +0 -80
  242. package/cli/node_modules/.ignored/scule/package.json +0 -43
  243. package/cli/node_modules/.package-lock.json +0 -33
@@ -1,238 +0,0 @@
1
- 'use strict';
2
-
3
- const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
4
- function normalizeWindowsPath(input = "") {
5
- if (!input) {
6
- return input;
7
- }
8
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
9
- }
10
-
11
- const _UNC_REGEX = /^[/\\]{2}/;
12
- const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
13
- const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
14
- const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
15
- const sep = "/";
16
- const delimiter = ":";
17
- const normalize = function(path) {
18
- if (path.length === 0) {
19
- return ".";
20
- }
21
- path = normalizeWindowsPath(path);
22
- const isUNCPath = path.match(_UNC_REGEX);
23
- const isPathAbsolute = isAbsolute(path);
24
- const trailingSeparator = path[path.length - 1] === "/";
25
- path = normalizeString(path, !isPathAbsolute);
26
- if (path.length === 0) {
27
- if (isPathAbsolute) {
28
- return "/";
29
- }
30
- return trailingSeparator ? "./" : ".";
31
- }
32
- if (trailingSeparator) {
33
- path += "/";
34
- }
35
- if (_DRIVE_LETTER_RE.test(path)) {
36
- path += "/";
37
- }
38
- if (isUNCPath) {
39
- if (!isPathAbsolute) {
40
- return `//./${path}`;
41
- }
42
- return `//${path}`;
43
- }
44
- return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
45
- };
46
- const join = function(...arguments_) {
47
- if (arguments_.length === 0) {
48
- return ".";
49
- }
50
- let joined;
51
- for (const argument of arguments_) {
52
- if (argument && argument.length > 0) {
53
- if (joined === void 0) {
54
- joined = argument;
55
- } else {
56
- joined += `/${argument}`;
57
- }
58
- }
59
- }
60
- if (joined === void 0) {
61
- return ".";
62
- }
63
- return normalize(joined.replace(/\/\/+/g, "/"));
64
- };
65
- function cwd() {
66
- if (typeof process !== "undefined" && typeof process.cwd === "function") {
67
- return process.cwd().replace(/\\/g, "/");
68
- }
69
- return "/";
70
- }
71
- const resolve = function(...arguments_) {
72
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
73
- let resolvedPath = "";
74
- let resolvedAbsolute = false;
75
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
76
- const path = index >= 0 ? arguments_[index] : cwd();
77
- if (!path || path.length === 0) {
78
- continue;
79
- }
80
- resolvedPath = `${path}/${resolvedPath}`;
81
- resolvedAbsolute = isAbsolute(path);
82
- }
83
- resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
84
- if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
85
- return `/${resolvedPath}`;
86
- }
87
- return resolvedPath.length > 0 ? resolvedPath : ".";
88
- };
89
- function normalizeString(path, allowAboveRoot) {
90
- let res = "";
91
- let lastSegmentLength = 0;
92
- let lastSlash = -1;
93
- let dots = 0;
94
- let char = null;
95
- for (let index = 0; index <= path.length; ++index) {
96
- if (index < path.length) {
97
- char = path[index];
98
- } else if (char === "/") {
99
- break;
100
- } else {
101
- char = "/";
102
- }
103
- if (char === "/") {
104
- if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
105
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
106
- if (res.length > 2) {
107
- const lastSlashIndex = res.lastIndexOf("/");
108
- if (lastSlashIndex === -1) {
109
- res = "";
110
- lastSegmentLength = 0;
111
- } else {
112
- res = res.slice(0, lastSlashIndex);
113
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
114
- }
115
- lastSlash = index;
116
- dots = 0;
117
- continue;
118
- } else if (res.length > 0) {
119
- res = "";
120
- lastSegmentLength = 0;
121
- lastSlash = index;
122
- dots = 0;
123
- continue;
124
- }
125
- }
126
- if (allowAboveRoot) {
127
- res += res.length > 0 ? "/.." : "..";
128
- lastSegmentLength = 2;
129
- }
130
- } else {
131
- if (res.length > 0) {
132
- res += `/${path.slice(lastSlash + 1, index)}`;
133
- } else {
134
- res = path.slice(lastSlash + 1, index);
135
- }
136
- lastSegmentLength = index - lastSlash - 1;
137
- }
138
- lastSlash = index;
139
- dots = 0;
140
- } else if (char === "." && dots !== -1) {
141
- ++dots;
142
- } else {
143
- dots = -1;
144
- }
145
- }
146
- return res;
147
- }
148
- const isAbsolute = function(p) {
149
- return _IS_ABSOLUTE_RE.test(p);
150
- };
151
- const toNamespacedPath = function(p) {
152
- return normalizeWindowsPath(p);
153
- };
154
- const _EXTNAME_RE = /.(\.[^./]+)$/;
155
- const extname = function(p) {
156
- const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
157
- return match && match[1] || "";
158
- };
159
- const relative = function(from, to) {
160
- const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
161
- const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
162
- if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
163
- return _to.join("/");
164
- }
165
- const _fromCopy = [..._from];
166
- for (const segment of _fromCopy) {
167
- if (_to[0] !== segment) {
168
- break;
169
- }
170
- _from.shift();
171
- _to.shift();
172
- }
173
- return [..._from.map(() => ".."), ..._to].join("/");
174
- };
175
- const dirname = function(p) {
176
- const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
177
- if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
178
- segments[0] += "/";
179
- }
180
- return segments.join("/") || (isAbsolute(p) ? "/" : ".");
181
- };
182
- const format = function(p) {
183
- const segments = [p.root, p.dir, p.base ?? p.name + p.ext].filter(Boolean);
184
- return normalizeWindowsPath(
185
- p.root ? resolve(...segments) : segments.join("/")
186
- );
187
- };
188
- const basename = function(p, extension) {
189
- const lastSegment = normalizeWindowsPath(p).split("/").pop();
190
- return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
191
- };
192
- const parse = function(p) {
193
- const root = normalizeWindowsPath(p).split("/").shift() || "/";
194
- const base = basename(p);
195
- const extension = extname(base);
196
- return {
197
- root,
198
- dir: dirname(p),
199
- base,
200
- ext: extension,
201
- name: base.slice(0, base.length - extension.length)
202
- };
203
- };
204
-
205
- const path = {
206
- __proto__: null,
207
- basename: basename,
208
- delimiter: delimiter,
209
- dirname: dirname,
210
- extname: extname,
211
- format: format,
212
- isAbsolute: isAbsolute,
213
- join: join,
214
- normalize: normalize,
215
- normalizeString: normalizeString,
216
- parse: parse,
217
- relative: relative,
218
- resolve: resolve,
219
- sep: sep,
220
- toNamespacedPath: toNamespacedPath
221
- };
222
-
223
- exports.basename = basename;
224
- exports.delimiter = delimiter;
225
- exports.dirname = dirname;
226
- exports.extname = extname;
227
- exports.format = format;
228
- exports.isAbsolute = isAbsolute;
229
- exports.join = join;
230
- exports.normalize = normalize;
231
- exports.normalizeString = normalizeString;
232
- exports.normalizeWindowsPath = normalizeWindowsPath;
233
- exports.parse = parse;
234
- exports.path = path;
235
- exports.relative = relative;
236
- exports.resolve = resolve;
237
- exports.sep = sep;
238
- exports.toNamespacedPath = toNamespacedPath;
@@ -1,221 +0,0 @@
1
- const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
2
- function normalizeWindowsPath(input = "") {
3
- if (!input) {
4
- return input;
5
- }
6
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
7
- }
8
-
9
- const _UNC_REGEX = /^[/\\]{2}/;
10
- const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
11
- const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
12
- const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
13
- const sep = "/";
14
- const delimiter = ":";
15
- const normalize = function(path) {
16
- if (path.length === 0) {
17
- return ".";
18
- }
19
- path = normalizeWindowsPath(path);
20
- const isUNCPath = path.match(_UNC_REGEX);
21
- const isPathAbsolute = isAbsolute(path);
22
- const trailingSeparator = path[path.length - 1] === "/";
23
- path = normalizeString(path, !isPathAbsolute);
24
- if (path.length === 0) {
25
- if (isPathAbsolute) {
26
- return "/";
27
- }
28
- return trailingSeparator ? "./" : ".";
29
- }
30
- if (trailingSeparator) {
31
- path += "/";
32
- }
33
- if (_DRIVE_LETTER_RE.test(path)) {
34
- path += "/";
35
- }
36
- if (isUNCPath) {
37
- if (!isPathAbsolute) {
38
- return `//./${path}`;
39
- }
40
- return `//${path}`;
41
- }
42
- return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
43
- };
44
- const join = function(...arguments_) {
45
- if (arguments_.length === 0) {
46
- return ".";
47
- }
48
- let joined;
49
- for (const argument of arguments_) {
50
- if (argument && argument.length > 0) {
51
- if (joined === void 0) {
52
- joined = argument;
53
- } else {
54
- joined += `/${argument}`;
55
- }
56
- }
57
- }
58
- if (joined === void 0) {
59
- return ".";
60
- }
61
- return normalize(joined.replace(/\/\/+/g, "/"));
62
- };
63
- function cwd() {
64
- if (typeof process !== "undefined" && typeof process.cwd === "function") {
65
- return process.cwd().replace(/\\/g, "/");
66
- }
67
- return "/";
68
- }
69
- const resolve = function(...arguments_) {
70
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
71
- let resolvedPath = "";
72
- let resolvedAbsolute = false;
73
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
74
- const path = index >= 0 ? arguments_[index] : cwd();
75
- if (!path || path.length === 0) {
76
- continue;
77
- }
78
- resolvedPath = `${path}/${resolvedPath}`;
79
- resolvedAbsolute = isAbsolute(path);
80
- }
81
- resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
82
- if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
83
- return `/${resolvedPath}`;
84
- }
85
- return resolvedPath.length > 0 ? resolvedPath : ".";
86
- };
87
- function normalizeString(path, allowAboveRoot) {
88
- let res = "";
89
- let lastSegmentLength = 0;
90
- let lastSlash = -1;
91
- let dots = 0;
92
- let char = null;
93
- for (let index = 0; index <= path.length; ++index) {
94
- if (index < path.length) {
95
- char = path[index];
96
- } else if (char === "/") {
97
- break;
98
- } else {
99
- char = "/";
100
- }
101
- if (char === "/") {
102
- if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
103
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
104
- if (res.length > 2) {
105
- const lastSlashIndex = res.lastIndexOf("/");
106
- if (lastSlashIndex === -1) {
107
- res = "";
108
- lastSegmentLength = 0;
109
- } else {
110
- res = res.slice(0, lastSlashIndex);
111
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
112
- }
113
- lastSlash = index;
114
- dots = 0;
115
- continue;
116
- } else if (res.length > 0) {
117
- res = "";
118
- lastSegmentLength = 0;
119
- lastSlash = index;
120
- dots = 0;
121
- continue;
122
- }
123
- }
124
- if (allowAboveRoot) {
125
- res += res.length > 0 ? "/.." : "..";
126
- lastSegmentLength = 2;
127
- }
128
- } else {
129
- if (res.length > 0) {
130
- res += `/${path.slice(lastSlash + 1, index)}`;
131
- } else {
132
- res = path.slice(lastSlash + 1, index);
133
- }
134
- lastSegmentLength = index - lastSlash - 1;
135
- }
136
- lastSlash = index;
137
- dots = 0;
138
- } else if (char === "." && dots !== -1) {
139
- ++dots;
140
- } else {
141
- dots = -1;
142
- }
143
- }
144
- return res;
145
- }
146
- const isAbsolute = function(p) {
147
- return _IS_ABSOLUTE_RE.test(p);
148
- };
149
- const toNamespacedPath = function(p) {
150
- return normalizeWindowsPath(p);
151
- };
152
- const _EXTNAME_RE = /.(\.[^./]+)$/;
153
- const extname = function(p) {
154
- const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
155
- return match && match[1] || "";
156
- };
157
- const relative = function(from, to) {
158
- const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
159
- const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
160
- if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
161
- return _to.join("/");
162
- }
163
- const _fromCopy = [..._from];
164
- for (const segment of _fromCopy) {
165
- if (_to[0] !== segment) {
166
- break;
167
- }
168
- _from.shift();
169
- _to.shift();
170
- }
171
- return [..._from.map(() => ".."), ..._to].join("/");
172
- };
173
- const dirname = function(p) {
174
- const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
175
- if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
176
- segments[0] += "/";
177
- }
178
- return segments.join("/") || (isAbsolute(p) ? "/" : ".");
179
- };
180
- const format = function(p) {
181
- const segments = [p.root, p.dir, p.base ?? p.name + p.ext].filter(Boolean);
182
- return normalizeWindowsPath(
183
- p.root ? resolve(...segments) : segments.join("/")
184
- );
185
- };
186
- const basename = function(p, extension) {
187
- const lastSegment = normalizeWindowsPath(p).split("/").pop();
188
- return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
189
- };
190
- const parse = function(p) {
191
- const root = normalizeWindowsPath(p).split("/").shift() || "/";
192
- const base = basename(p);
193
- const extension = extname(base);
194
- return {
195
- root,
196
- dir: dirname(p),
197
- base,
198
- ext: extension,
199
- name: base.slice(0, base.length - extension.length)
200
- };
201
- };
202
-
203
- const path = {
204
- __proto__: null,
205
- basename: basename,
206
- delimiter: delimiter,
207
- dirname: dirname,
208
- extname: extname,
209
- format: format,
210
- isAbsolute: isAbsolute,
211
- join: join,
212
- normalize: normalize,
213
- normalizeString: normalizeString,
214
- parse: parse,
215
- relative: relative,
216
- resolve: resolve,
217
- sep: sep,
218
- toNamespacedPath: toNamespacedPath
219
- };
220
-
221
- export { normalize as a, normalizeString as b, relative as c, delimiter as d, extname as e, dirname as f, format as g, basename as h, isAbsolute as i, join as j, parse as k, normalizeWindowsPath as n, path as p, resolve as r, sep as s, toNamespacedPath as t };
@@ -1,58 +0,0 @@
1
- 'use strict';
2
-
3
- const index = require('./shared/pathe.1f0a373c.cjs');
4
-
5
- const pathSeparators = /* @__PURE__ */ new Set(["/", "\\", void 0]);
6
- const normalizedAliasSymbol = Symbol.for("pathe:normalizedAlias");
7
- function normalizeAliases(_aliases) {
8
- if (_aliases[normalizedAliasSymbol]) {
9
- return _aliases;
10
- }
11
- const aliases = Object.fromEntries(
12
- Object.entries(_aliases).sort(([a], [b]) => _compareAliases(a, b))
13
- );
14
- for (const key in aliases) {
15
- for (const alias in aliases) {
16
- if (alias === key || key.startsWith(alias)) {
17
- continue;
18
- }
19
- if (aliases[key].startsWith(alias) && pathSeparators.has(aliases[key][alias.length])) {
20
- aliases[key] = aliases[alias] + aliases[key].slice(alias.length);
21
- }
22
- }
23
- }
24
- Object.defineProperty(aliases, normalizedAliasSymbol, {
25
- value: true,
26
- enumerable: false
27
- });
28
- return aliases;
29
- }
30
- function resolveAlias(path, aliases) {
31
- const _path = index.normalizeWindowsPath(path);
32
- aliases = normalizeAliases(aliases);
33
- for (const [alias, to] of Object.entries(aliases)) {
34
- if (!_path.startsWith(alias)) {
35
- continue;
36
- }
37
- const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
38
- if (hasTrailingSlash(_path[_alias.length])) {
39
- return index.join(to, _path.slice(alias.length));
40
- }
41
- }
42
- return _path;
43
- }
44
- const FILENAME_RE = /(^|[/\\])([^/\\]+?)(?=(\.[^.]+)?$)/;
45
- function filename(path) {
46
- return path.match(FILENAME_RE)?.[2];
47
- }
48
- function _compareAliases(a, b) {
49
- return b.split("/").length - a.split("/").length;
50
- }
51
- function hasTrailingSlash(path = "/") {
52
- const lastChar = path[path.length - 1];
53
- return lastChar === "/" || lastChar === "\\";
54
- }
55
-
56
- exports.filename = filename;
57
- exports.normalizeAliases = normalizeAliases;
58
- exports.resolveAlias = resolveAlias;
@@ -1,5 +0,0 @@
1
- declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
2
- declare function resolveAlias(path: string, aliases: Record<string, string>): string;
3
- declare function filename(path: string): string;
4
-
5
- export { filename, normalizeAliases, resolveAlias };
@@ -1,5 +0,0 @@
1
- declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
2
- declare function resolveAlias(path: string, aliases: Record<string, string>): string;
3
- declare function filename(path: string): string;
4
-
5
- export { filename, normalizeAliases, resolveAlias };
@@ -1,5 +0,0 @@
1
- declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
2
- declare function resolveAlias(path: string, aliases: Record<string, string>): string;
3
- declare function filename(path: string): string;
4
-
5
- export { filename, normalizeAliases, resolveAlias };
@@ -1,54 +0,0 @@
1
- import { n as normalizeWindowsPath, j as join } from './shared/pathe.ff20891b.mjs';
2
-
3
- const pathSeparators = /* @__PURE__ */ new Set(["/", "\\", void 0]);
4
- const normalizedAliasSymbol = Symbol.for("pathe:normalizedAlias");
5
- function normalizeAliases(_aliases) {
6
- if (_aliases[normalizedAliasSymbol]) {
7
- return _aliases;
8
- }
9
- const aliases = Object.fromEntries(
10
- Object.entries(_aliases).sort(([a], [b]) => _compareAliases(a, b))
11
- );
12
- for (const key in aliases) {
13
- for (const alias in aliases) {
14
- if (alias === key || key.startsWith(alias)) {
15
- continue;
16
- }
17
- if (aliases[key].startsWith(alias) && pathSeparators.has(aliases[key][alias.length])) {
18
- aliases[key] = aliases[alias] + aliases[key].slice(alias.length);
19
- }
20
- }
21
- }
22
- Object.defineProperty(aliases, normalizedAliasSymbol, {
23
- value: true,
24
- enumerable: false
25
- });
26
- return aliases;
27
- }
28
- function resolveAlias(path, aliases) {
29
- const _path = normalizeWindowsPath(path);
30
- aliases = normalizeAliases(aliases);
31
- for (const [alias, to] of Object.entries(aliases)) {
32
- if (!_path.startsWith(alias)) {
33
- continue;
34
- }
35
- const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
36
- if (hasTrailingSlash(_path[_alias.length])) {
37
- return join(to, _path.slice(alias.length));
38
- }
39
- }
40
- return _path;
41
- }
42
- const FILENAME_RE = /(^|[/\\])([^/\\]+?)(?=(\.[^.]+)?$)/;
43
- function filename(path) {
44
- return path.match(FILENAME_RE)?.[2];
45
- }
46
- function _compareAliases(a, b) {
47
- return b.split("/").length - a.split("/").length;
48
- }
49
- function hasTrailingSlash(path = "/") {
50
- const lastChar = path[path.length - 1];
51
- return lastChar === "/" || lastChar === "\\";
52
- }
53
-
54
- export { filename, normalizeAliases, resolveAlias };
@@ -1,48 +0,0 @@
1
- {
2
- "name": "pathe",
3
- "version": "1.1.2",
4
- "description": "Universal filesystem path utils",
5
- "repository": "unjs/pathe",
6
- "license": "MIT",
7
- "sideEffects": false,
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.mjs",
12
- "require": "./dist/index.cjs"
13
- },
14
- "./utils": {
15
- "types": "./dist/utils.d.ts",
16
- "import": "./dist/utils.mjs",
17
- "require": "./dist/utils.cjs"
18
- }
19
- },
20
- "main": "./dist/index.cjs",
21
- "types": "./dist/index.d.ts",
22
- "files": [
23
- "dist",
24
- "utils.d.ts"
25
- ],
26
- "devDependencies": {
27
- "@types/node": "^20.10.8",
28
- "@vitest/coverage-v8": "^1.1.3",
29
- "changelogen": "^0.5.5",
30
- "eslint": "^8.56.0",
31
- "eslint-config-unjs": "^0.2.1",
32
- "jiti": "^1.21.0",
33
- "prettier": "^3.1.1",
34
- "typescript": "^5.3.3",
35
- "unbuild": "^2.0.0",
36
- "vitest": "^1.1.3"
37
- },
38
- "packageManager": "pnpm@8.14.0",
39
- "scripts": {
40
- "build": "unbuild",
41
- "dev": "vitest",
42
- "lint": "eslint --ext .ts . && prettier -c src test",
43
- "lint:fix": "eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c src test -w",
44
- "release": "pnpm test && pnpm build && changelogen --release && pnpm publish && git push --follow-tags",
45
- "test": "pnpm lint && vitest run --coverage",
46
- "test:types": "tsc --noEmit"
47
- }
48
- }
@@ -1 +0,0 @@
1
- export * from "./dist/utils";
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Pooya Parsa <pooya@pi0.io>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.