g-ui-core 0.0.1 → 0.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "g-ui-core",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "G-UI Web Components built with Stencil",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -12,8 +12,21 @@
12
12
  "unpkg": "dist/g-ui/g-ui.esm.js",
13
13
  "files": [
14
14
  "dist/",
15
- "loader/"
15
+ "loader/",
16
+ "vue/"
16
17
  ],
18
+ "exports": {
19
+ ".": {
20
+ "import": "./dist/index.js",
21
+ "require": "./dist/index.cjs.js",
22
+ "types": "./dist/types/index.d.ts"
23
+ },
24
+ "./vue": {
25
+ "types": "./vue/index.d.ts",
26
+ "import": "./vue/index.ts",
27
+ "default": "./vue/index.ts"
28
+ }
29
+ },
17
30
  "scripts": {
18
31
  "dev": "stencil build --dev --watch --serve",
19
32
  "build": "stencil build",
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+
3
+ // 增强 Vue 全局组件类型(Volar 智能提示)
4
+ declare module '@vue/runtime-core' {
5
+ export interface GlobalComponents {
6
+ GButton: import('../dist/types/components').Components.GButton
7
+ }
8
+ }
9
+
10
+ export {}
package/vue/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ declare const plugin: { install: (app: any) => void }
2
+ export default plugin
package/vue/index.ts ADDED
@@ -0,0 +1,11 @@
1
+ import '../dist/components/g-button.js'
2
+
3
+ const plugin = {
4
+ install(app: any) {
5
+ const original = app.config?.compilerOptions?.isCustomElement
6
+ app.config.compilerOptions.isCustomElement = (tag: string) =>
7
+ tag.startsWith('g-') || (typeof original === 'function' && original(tag))
8
+ }
9
+ }
10
+
11
+ export default plugin