@veltra/vite 1.1.15 → 1.1.19
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/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -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
|
-
* - **
|
|
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
|
|
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,
|
|
34
|
+
export { VeltraDesktopUIResolver, VeltraDesktopUIResolverOptions };
|
|
35
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -120,10 +120,10 @@ function pascalToKebab(str) {
|
|
|
120
120
|
* components and their style side effects.
|
|
121
121
|
*
|
|
122
122
|
* Style resolution relies on `@veltra/desktop` package exports conditions:
|
|
123
|
-
* - **
|
|
123
|
+
* - **veltra-dev** (Vite dev): resolves to `src/components/<dir>/style.ts`
|
|
124
124
|
* (source SCSS pipeline, full HMR)
|
|
125
125
|
* - **production** (Vite build): resolves to `dist/components/<dir>/style.js`
|
|
126
|
-
* (pre-compiled, CSS
|
|
126
|
+
* (pre-compiled, CSS imported by the JS entry)
|
|
127
127
|
*/
|
|
128
128
|
function VeltraDesktopUIResolver(options = {}) {
|
|
129
129
|
const { exclude = [], importStyle = true, include = [] } = options;
|
|
@@ -147,3 +147,5 @@ function VeltraDesktopUIResolver(options = {}) {
|
|
|
147
147
|
}
|
|
148
148
|
//#endregion
|
|
149
149
|
export { VeltraDesktopUIResolver };
|
|
150
|
+
|
|
151
|
+
//# 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 'menu-sub': 'menu',\n 'menu-item': 'menu',\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 'UMenu',\n 'UMenuItem',\n 'UMenuSub',\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,YAAY;CACZ,aAAa;CACb,mBAAmB;CACnB,iBAAiB;CAClB;AAED,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;CACD,CAAC;AAEF,SAAS,cAAc,KAAqB;CAC1C,OAAO,IAAI,QAAQ,WAAW,MAAM,WAAW,QAAQ,IAAI,MAAM,MAAM,KAAK,aAAa,CAAC;;;;;;;;;;;;AAa5F,SAAgB,wBACd,UAA0C,EAAE,EACzB;CACnB,MAAM,EAAE,UAAU,EAAE,EAAE,cAAc,MAAM,UAAU,EAAE,KAAK;CAC3D,MAAM,WAAW,IAAI,IAAI,QAAQ;CACjC,MAAM,WAAW,IAAI,IAAI,QAAQ;CAEjC,OAAO;EACL,MAAM;EACN,QAAQ,MAAc;GACpB,IAAI,CAAC,mBAAmB,IAAI,KAAK,EAAE;GAEnC,MAAM,YAAY,cAAc,KAAK,MAAM,EAAE,CAAC;GAC9C,MAAM,WAAW,iBAAiB,cAAc;GAChD,IAAI,SAAS,IAAI,SAAS,EAAE;GAC5B,IAAI,SAAS,OAAO,KAAK,CAAC,SAAS,IAAI,SAAS,EAAE;GAElD,OAAO;IACL;IACA,MAAM;IACN,aAAa,cAAc,8BAA8B,SAAS,UAAU,KAAA;IAC7E;;EAEJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veltra/vite",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.19",
|
|
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,18 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
-
"
|
|
13
|
-
"
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "
|
|
18
|
-
"check-types": "tsc -p tsconfig.json --noEmit"
|
|
17
|
+
"build": "vp pack"
|
|
19
18
|
},
|
|
20
19
|
"devDependencies": {
|
|
21
|
-
"@veltra/desktop": "1.1.
|
|
20
|
+
"@veltra/desktop": "1.1.19"
|
|
22
21
|
},
|
|
23
22
|
"peerDependencies": {
|
|
24
|
-
"@veltra/desktop": "1.1.
|
|
23
|
+
"@veltra/desktop": "1.1.19",
|
|
25
24
|
"unplugin-vue-components": ">=32.0.0"
|
|
26
25
|
}
|
|
27
26
|
}
|
package/src/resolver.ts
CHANGED
|
@@ -143,10 +143,10 @@ function pascalToKebab(str: string): string {
|
|
|
143
143
|
* components and their style side effects.
|
|
144
144
|
*
|
|
145
145
|
* Style resolution relies on `@veltra/desktop` package exports conditions:
|
|
146
|
-
* - **
|
|
146
|
+
* - **veltra-dev** (Vite dev): resolves to `src/components/<dir>/style.ts`
|
|
147
147
|
* (source SCSS pipeline, full HMR)
|
|
148
148
|
* - **production** (Vite build): resolves to `dist/components/<dir>/style.js`
|
|
149
|
-
* (pre-compiled, CSS
|
|
149
|
+
* (pre-compiled, CSS imported by the JS entry)
|
|
150
150
|
*/
|
|
151
151
|
export function VeltraDesktopUIResolver(
|
|
152
152
|
options: VeltraDesktopUIResolverOptions = {}
|