@veltra/vite 2.0.0 → 2.0.2

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.
@@ -0,0 +1,2 @@
1
+ import { VeltraDesktopUIResolver, VeltraDesktopUIResolverOptions } from "./resolver.js";
2
+ export { VeltraDesktopUIResolver, type VeltraDesktopUIResolverOptions };
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import { VeltraDesktopUIResolver } from "./resolver.js";
2
+ export { VeltraDesktopUIResolver };
@@ -24,11 +24,12 @@ interface VeltraDesktopUIResolverOptions {
24
24
  * components and their style side effects.
25
25
  *
26
26
  * Style resolution relies on `@veltra/desktop` package exports conditions:
27
- * - **development** (Vite dev): resolves to `src/components/<dir>/style.ts`
27
+ * - **veltra-dev** (Vite dev): resolves to `src/components/<dir>/style.ts`
28
28
  * (source SCSS pipeline, full HMR)
29
29
  * - **production** (Vite build): resolves to `dist/components/<dir>/style.js`
30
- * (pre-compiled, CSS already injected)
30
+ * (pre-compiled, CSS imported by the JS entry)
31
31
  */
32
32
  declare function VeltraDesktopUIResolver(options?: VeltraDesktopUIResolverOptions): ComponentResolver;
33
33
  //#endregion
34
- export { VeltraDesktopUIResolver, type VeltraDesktopUIResolverOptions };
34
+ export { VeltraDesktopUIResolver, VeltraDesktopUIResolverOptions };
35
+ //# sourceMappingURL=resolver.d.ts.map
@@ -17,8 +17,10 @@ const SHARED_STYLE_DIR = {
17
17
  "checkbox-button": "checkbox",
18
18
  "grid-item": "grid",
19
19
  "list-item": "list",
20
- "menu-sub": "menu",
21
- "menu-item": "menu",
20
+ "nav-sub": "nav",
21
+ "nav-item": "nav",
22
+ "dual-nav-app": "dual-nav",
23
+ "group-nav-item": "group-nav",
22
24
  "tabs-horizontal": "tabs",
23
25
  "tabs-vertical": "tabs"
24
26
  };
@@ -46,7 +48,7 @@ const DESKTOP_COMPONENTS = new Set([
46
48
  "UCheckboxGroup",
47
49
  "UCodeEditor",
48
50
  "UConditionEditor",
49
- "UContextMenu",
51
+ "UContextmenu",
50
52
  "UDatePanel",
51
53
  "UDatePicker",
52
54
  "UDateRangePicker",
@@ -66,14 +68,18 @@ const DESKTOP_COMPONENTS = new Set([
66
68
  "UGridItem",
67
69
  "UGroupInput",
68
70
  "UIcon",
71
+ "UKbd",
69
72
  "UInput",
70
73
  "ULayout",
71
74
  "UList",
72
75
  "UListItem",
73
76
  "ULoading",
74
- "UMenu",
75
- "UMenuItem",
76
- "UMenuSub",
77
+ "UDualNav",
78
+ "UGroupNav",
79
+ "UGroupNavItem",
80
+ "UNav",
81
+ "UNavItem",
82
+ "UNavSub",
77
83
  "UMessage",
78
84
  "UMessageConfirm",
79
85
  "UMultiSelect",
@@ -119,10 +125,10 @@ function pascalToKebab(str) {
119
125
  * components and their style side effects.
120
126
  *
121
127
  * Style resolution relies on `@veltra/desktop` package exports conditions:
122
- * - **development** (Vite dev): resolves to `src/components/<dir>/style.ts`
128
+ * - **veltra-dev** (Vite dev): resolves to `src/components/<dir>/style.ts`
123
129
  * (source SCSS pipeline, full HMR)
124
130
  * - **production** (Vite build): resolves to `dist/components/<dir>/style.js`
125
- * (pre-compiled, CSS already injected)
131
+ * (pre-compiled, CSS imported by the JS entry)
126
132
  */
127
133
  function VeltraDesktopUIResolver(options = {}) {
128
134
  const { exclude = [], importStyle = true, include = [] } = options;
@@ -146,3 +152,5 @@ function VeltraDesktopUIResolver(options = {}) {
146
152
  }
147
153
  //#endregion
148
154
  export { VeltraDesktopUIResolver };
155
+
156
+ //# sourceMappingURL=resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolver.js","names":[],"sources":["../src/resolver.ts"],"sourcesContent":["import type { ComponentResolver } from 'unplugin-vue-components/types'\n\nexport interface VeltraDesktopUIResolverOptions {\n /**\n * Component style directories to exclude.\n * @example ['button', 'loading']\n */\n exclude?: string[]\n /**\n * Component style directories to include. Empty or omitted means all known\n * desktop components are eligible.\n * @example ['button', 'input', 'dialog']\n */\n include?: string[]\n /**\n * Whether to import component styles as side effects.\n * @default true\n */\n importStyle?: boolean\n}\n\n/**\n * Components that reside in another component's directory and share its style entry.\n *\n * These components don't have their own `style.ts` — they live inside a parent\n * component directory and use the parent's style (e.g. `UButtonGroup` lives in\n * `button/` and uses `button/style.ts`).\n */\nconst SHARED_STYLE_DIR: Record<string, string> = {\n 'button-group': 'button',\n 'collapse-item': 'collapse',\n 'action-group': 'action',\n 'card-header': 'card',\n 'card-cover': 'card',\n 'card-content': 'card',\n 'card-action': 'card',\n 'checkbox-button': 'checkbox',\n 'grid-item': 'grid',\n 'list-item': 'list',\n 'nav-sub': 'nav',\n 'nav-item': 'nav',\n 'dual-nav-app': 'dual-nav',\n 'group-nav-item': 'group-nav',\n 'tabs-horizontal': 'tabs',\n 'tabs-vertical': 'tabs'\n}\n\nconst DESKTOP_COMPONENTS = new Set([\n 'UAction',\n 'UActionGroup',\n 'UAutoComplete',\n 'UBadge',\n 'UBatchEdit',\n 'UBreadcrumb',\n 'UButton',\n 'UButtonGroup',\n 'UCalendar',\n 'UCard',\n 'UCardAction',\n 'UCardContent',\n 'UCardCover',\n 'UCardHeader',\n 'UCascade',\n 'UCheckTag',\n 'UCheckbox',\n 'UCollapse',\n 'UCollapseItem',\n 'UCheckboxButton',\n 'UCheckboxGroup',\n 'UCodeEditor',\n 'UConditionEditor',\n 'UContextmenu',\n 'UDatePanel',\n 'UDatePicker',\n 'UDateRangePicker',\n 'UDialog',\n 'UDrawer',\n 'UDropdown',\n 'UEmpty',\n 'UExpressionEditor',\n 'UFilePicker',\n 'UFileViewer',\n 'UFloatButton',\n 'UForm',\n 'UFormItem',\n 'UGanttChart',\n 'UGrid',\n 'UGridInput',\n 'UGridItem',\n 'UGroupInput',\n 'UIcon',\n 'UKbd',\n 'UInput',\n 'ULayout',\n 'UList',\n 'UListItem',\n 'ULoading',\n 'UDualNav',\n 'UGroupNav',\n 'UGroupNavItem',\n 'UNav',\n 'UNavItem',\n 'UNavSub',\n 'UMessage',\n 'UMessageConfirm',\n 'UMultiSelect',\n 'UMultiTreeSelect',\n 'UNodeRender',\n 'UNotification',\n 'UNumber',\n 'UNumberInput',\n 'UNumberRangeInput',\n 'UPaginator',\n 'UPalette',\n 'UPasswordInput',\n 'UPopConfirm',\n 'UProgress',\n 'UProgressNodes',\n 'URadio',\n 'URadioGroup',\n 'URichTextEditor',\n 'UScroll',\n 'USelect',\n 'USlider',\n 'USteps',\n 'USwitch',\n 'UTable',\n 'UTableEditor',\n 'UTabs',\n 'UTabsHorizontal',\n 'UTabsVertical',\n 'UTag',\n 'UText',\n 'UTextarea',\n 'UTheme',\n 'UTip',\n 'UTree',\n 'UTreeSelect',\n 'UWatermark'\n])\n\nfunction pascalToKebab(str: string): string {\n return str.replace(/[A-Z]/g, (char, index) => (index > 0 ? '-' : '') + char.toLowerCase())\n}\n\n/**\n * Resolver for `unplugin-vue-components` that auto-imports `@veltra/desktop`\n * components and their style side effects.\n *\n * Style resolution relies on `@veltra/desktop` package exports conditions:\n * - **veltra-dev** (Vite dev): resolves to `src/components/<dir>/style.ts`\n * (source SCSS pipeline, full HMR)\n * - **production** (Vite build): resolves to `dist/components/<dir>/style.js`\n * (pre-compiled, CSS imported by the JS entry)\n */\nexport function VeltraDesktopUIResolver(\n options: VeltraDesktopUIResolverOptions = {}\n): ComponentResolver {\n const { exclude = [], importStyle = true, include = [] } = options\n const excluded = new Set(exclude)\n const included = new Set(include)\n\n return {\n type: 'component',\n resolve(name: string) {\n if (!DESKTOP_COMPONENTS.has(name)) return\n\n const kebabName = pascalToKebab(name.slice(1))\n const styleDir = SHARED_STYLE_DIR[kebabName] ?? kebabName\n if (excluded.has(styleDir)) return\n if (included.size > 0 && !included.has(styleDir)) return\n\n return {\n name,\n from: '@veltra/desktop',\n sideEffects: importStyle ? `@veltra/desktop/components/${styleDir}/style` : undefined\n }\n }\n }\n}\n"],"mappings":";;;;;;;;AA4BA,MAAM,mBAA2C;CAC/C,gBAAgB;CAChB,iBAAiB;CACjB,gBAAgB;CAChB,eAAe;CACf,cAAc;CACd,gBAAgB;CAChB,eAAe;CACf,mBAAmB;CACnB,aAAa;CACb,aAAa;CACb,WAAW;CACX,YAAY;CACZ,gBAAgB;CAChB,kBAAkB;CAClB,mBAAmB;CACnB,iBAAiB;AACnB;AAEA,MAAM,qBAAqB,IAAI,IAAI;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAS,cAAc,KAAqB;CAC1C,OAAO,IAAI,QAAQ,WAAW,MAAM,WAAW,QAAQ,IAAI,MAAM,MAAM,KAAK,YAAY,CAAC;AAC3F;;;;;;;;;;;AAYA,SAAgB,wBACd,UAA0C,CAAC,GACxB;CACnB,MAAM,EAAE,UAAU,CAAC,GAAG,cAAc,MAAM,UAAU,CAAC,MAAM;CAC3D,MAAM,WAAW,IAAI,IAAI,OAAO;CAChC,MAAM,WAAW,IAAI,IAAI,OAAO;CAEhC,OAAO;EACL,MAAM;EACN,QAAQ,MAAc;GACpB,IAAI,CAAC,mBAAmB,IAAI,IAAI,GAAG;GAEnC,MAAM,YAAY,cAAc,KAAK,MAAM,CAAC,CAAC;GAC7C,MAAM,WAAW,iBAAiB,cAAc;GAChD,IAAI,SAAS,IAAI,QAAQ,GAAG;GAC5B,IAAI,SAAS,OAAO,KAAK,CAAC,SAAS,IAAI,QAAQ,GAAG;GAElD,OAAO;IACL;IACA,MAAM;IACN,aAAa,cAAc,8BAA8B,SAAS,UAAU,KAAA;GAC9E;EACF;CACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltra/vite",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "Vite helpers for Veltra UI (e.g. unplugin-vue-components resolver for @veltra/desktop)",
5
5
  "files": [
6
6
  "dist",
@@ -9,19 +9,15 @@
9
9
  "type": "module",
10
10
  "exports": {
11
11
  ".": {
12
- "types": "./dist/index.d.mts",
13
- "import": "./dist/index.mjs"
12
+ "import": "./dist/index.js",
13
+ "types": "./dist/index.d.ts"
14
14
  }
15
15
  },
16
- "scripts": {
17
- "build": "tsdown",
18
- "check-types": "tsc -p tsconfig.json --noEmit"
19
- },
20
16
  "devDependencies": {
21
- "@veltra/desktop": "2.0.0"
17
+ "@veltra/desktop": "1.3.2"
22
18
  },
23
19
  "peerDependencies": {
24
- "@veltra/desktop": "2.0.0",
20
+ "@veltra/desktop": "1.3.2",
25
21
  "unplugin-vue-components": ">=32.0.0"
26
22
  }
27
23
  }
package/src/resolver.ts CHANGED
@@ -37,8 +37,10 @@ const SHARED_STYLE_DIR: Record<string, string> = {
37
37
  'checkbox-button': 'checkbox',
38
38
  'grid-item': 'grid',
39
39
  'list-item': 'list',
40
- 'menu-sub': 'menu',
41
- 'menu-item': 'menu',
40
+ 'nav-sub': 'nav',
41
+ 'nav-item': 'nav',
42
+ 'dual-nav-app': 'dual-nav',
43
+ 'group-nav-item': 'group-nav',
42
44
  'tabs-horizontal': 'tabs',
43
45
  'tabs-vertical': 'tabs'
44
46
  }
@@ -67,7 +69,7 @@ const DESKTOP_COMPONENTS = new Set([
67
69
  'UCheckboxGroup',
68
70
  'UCodeEditor',
69
71
  'UConditionEditor',
70
- 'UContextMenu',
72
+ 'UContextmenu',
71
73
  'UDatePanel',
72
74
  'UDatePicker',
73
75
  'UDateRangePicker',
@@ -87,14 +89,18 @@ const DESKTOP_COMPONENTS = new Set([
87
89
  'UGridItem',
88
90
  'UGroupInput',
89
91
  'UIcon',
92
+ 'UKbd',
90
93
  'UInput',
91
94
  'ULayout',
92
95
  'UList',
93
96
  'UListItem',
94
97
  'ULoading',
95
- 'UMenu',
96
- 'UMenuItem',
97
- 'UMenuSub',
98
+ 'UDualNav',
99
+ 'UGroupNav',
100
+ 'UGroupNavItem',
101
+ 'UNav',
102
+ 'UNavItem',
103
+ 'UNavSub',
98
104
  'UMessage',
99
105
  'UMessageConfirm',
100
106
  'UMultiSelect',
@@ -142,10 +148,10 @@ function pascalToKebab(str: string): string {
142
148
  * components and their style side effects.
143
149
  *
144
150
  * Style resolution relies on `@veltra/desktop` package exports conditions:
145
- * - **development** (Vite dev): resolves to `src/components/<dir>/style.ts`
151
+ * - **veltra-dev** (Vite dev): resolves to `src/components/<dir>/style.ts`
146
152
  * (source SCSS pipeline, full HMR)
147
153
  * - **production** (Vite build): resolves to `dist/components/<dir>/style.js`
148
- * (pre-compiled, CSS already injected)
154
+ * (pre-compiled, CSS imported by the JS entry)
149
155
  */
150
156
  export function VeltraDesktopUIResolver(
151
157
  options: VeltraDesktopUIResolverOptions = {}