ant-design-x-vue 1.0.5 → 1.0.7
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.mjs +87 -85
- package/dist/index.umd.js +2 -2
- package/dist/resolver/index.d.ts +25 -0
- package/dist/resolver/index.js +49 -0
- package/package.json +7 -3
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface AntDesignXResolverOptions {
|
|
2
|
+
/**
|
|
3
|
+
* exclude components that do not require automatic import
|
|
4
|
+
*
|
|
5
|
+
* @default []
|
|
6
|
+
*/
|
|
7
|
+
exclude?: string[];
|
|
8
|
+
/**
|
|
9
|
+
* rename package
|
|
10
|
+
*
|
|
11
|
+
* @default 'ant-design-x-vue'
|
|
12
|
+
*/
|
|
13
|
+
packageName?: string;
|
|
14
|
+
/**
|
|
15
|
+
* customizable prefix for resolving components
|
|
16
|
+
*
|
|
17
|
+
* @default 'AX'
|
|
18
|
+
*/
|
|
19
|
+
prefix?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function AntDesignXVueResolver(options?: AntDesignXResolverOptions): (name: string) => {
|
|
22
|
+
name: string;
|
|
23
|
+
from: string;
|
|
24
|
+
as: string;
|
|
25
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AntDesignXVueResolver = AntDesignXVueResolver;
|
|
4
|
+
/**
|
|
5
|
+
* set of components that are contained in the package
|
|
6
|
+
*/
|
|
7
|
+
var primitiveNames = new Set([
|
|
8
|
+
'Attachments',
|
|
9
|
+
'Bubble',
|
|
10
|
+
'Conversations',
|
|
11
|
+
'Prompts',
|
|
12
|
+
'Sender',
|
|
13
|
+
'Suggestion',
|
|
14
|
+
'Theme',
|
|
15
|
+
'ThoughtChain',
|
|
16
|
+
'Welcome',
|
|
17
|
+
]);
|
|
18
|
+
function isAntdXVueComponent(name) {
|
|
19
|
+
return primitiveNames.has(name);
|
|
20
|
+
}
|
|
21
|
+
// currently unnecessary to add side effects
|
|
22
|
+
// function getSideEffects(
|
|
23
|
+
// componentName: string,
|
|
24
|
+
// options: AntDesignXResolverOptions = {}
|
|
25
|
+
// ) {
|
|
26
|
+
// const { importStyle = true, packageName = 'ant-design-x-vue' } = options
|
|
27
|
+
// if (!importStyle) return
|
|
28
|
+
// return
|
|
29
|
+
// }
|
|
30
|
+
function AntDesignXVueResolver(options) {
|
|
31
|
+
if (options === void 0) { options = {}; }
|
|
32
|
+
var _a = options.prefix, prefix = _a === void 0 ? 'AX' : _a, _b = options.packageName, packageName = _b === void 0 ? 'ant-design-x-vue' : _b, _c = options.exclude, exclude = _c === void 0 ? [] : _c;
|
|
33
|
+
var resolverInfo = {
|
|
34
|
+
type: 'component',
|
|
35
|
+
resolve: function (name) {
|
|
36
|
+
if (!name.startsWith(prefix))
|
|
37
|
+
return;
|
|
38
|
+
var componentName = name.slice(prefix.length);
|
|
39
|
+
if (!isAntdXVueComponent(componentName) || exclude.includes(componentName))
|
|
40
|
+
return;
|
|
41
|
+
return {
|
|
42
|
+
name: componentName,
|
|
43
|
+
from: packageName,
|
|
44
|
+
as: "".concat(prefix).concat(componentName)
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return resolverInfo.resolve;
|
|
49
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ant-design-x-vue",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Craft AI-driven interfaces effortlessly",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"AI",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"vue"
|
|
14
14
|
],
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build": "vite build && vue-tsc --project ./tsconfig.build.json",
|
|
16
|
+
"build": "vite build && vue-tsc --project ./tsconfig.build.json && tsc resolver/index.ts --outDir dist/resolver --declaration",
|
|
17
17
|
"build:watch": "vite build --watch",
|
|
18
18
|
"docs:dev": "vitepress dev docs",
|
|
19
19
|
"docs:build": "vitepress build docs",
|
|
@@ -42,7 +42,11 @@
|
|
|
42
42
|
"import": "./dist/index.mjs",
|
|
43
43
|
"require": "./dist/index.umd.js"
|
|
44
44
|
},
|
|
45
|
-
"./dist/style.css": "./dist/style.css"
|
|
45
|
+
"./dist/style.css": "./dist/style.css",
|
|
46
|
+
"./resolver": {
|
|
47
|
+
"types": "./dist/typings/resolver/index.d.ts",
|
|
48
|
+
"import": "./dist/resolver/index.js"
|
|
49
|
+
}
|
|
46
50
|
},
|
|
47
51
|
"main": "./dist/index.umd.js",
|
|
48
52
|
"module": "./dist/index.mjs",
|