@bitrix24/b24ui-nuxt 0.1.3 → 0.1.5
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/.nuxt/b24ui/advice.ts +5 -22
- package/.nuxt/b24ui/badge.ts +1 -6
- package/.nuxt/b24ui/button.ts +1 -3
- package/.nuxt/b24ui/countdown.ts +2 -7
- package/.nuxt/b24ui/input.ts +2 -18
- package/.nuxt/b24ui/select.ts +7 -49
- package/.nuxt/b24ui/switch.ts +2 -8
- package/.nuxt/b24ui/tabs.ts +1 -8
- package/.nuxt/b24ui/textarea.ts +2 -17
- package/.nuxt/b24ui/toast.ts +1 -8
- package/.nuxt/b24ui/tooltip.ts +1 -7
- package/dist/meta.cjs +95 -95
- package/dist/meta.d.cts +95 -95
- package/dist/meta.d.mts +95 -95
- package/dist/meta.d.ts +95 -95
- package/dist/meta.mjs +95 -95
- package/dist/module.cjs +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Alert.vue +1 -1
- package/dist/runtime/components/Badge.vue +1 -0
- package/dist/runtime/components/Select.vue +1 -1
- package/dist/runtime/components/Toast.vue +1 -1
- package/dist/runtime/components/content/DescriptionList.vue +1 -1
- package/dist/shared/{b24ui-nuxt.ju-AYOH7.mjs → b24ui-nuxt.CGBDJv97.mjs} +30 -25
- package/dist/shared/{b24ui-nuxt.DKayP3fG.cjs → b24ui-nuxt.D8eTlsIC.cjs} +30 -25
- package/dist/unplugin.cjs +48 -41
- package/dist/unplugin.d.cts +10 -0
- package/dist/unplugin.d.mts +10 -0
- package/dist/unplugin.d.ts +10 -0
- package/dist/unplugin.mjs +47 -40
- package/dist/vite.cjs +2 -2
- package/dist/vite.d.cts +2 -0
- package/dist/vite.d.mts +2 -0
- package/dist/vite.d.ts +2 -0
- package/dist/vite.mjs +2 -2
- package/package.json +15 -22
package/dist/unplugin.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { fileURLToPath } from 'node:url';
|
|
2
2
|
import { join, normalize } from 'pathe';
|
|
3
3
|
import { createUnplugin } from 'unplugin';
|
|
4
|
-
import AutoImport from 'unplugin-auto-import';
|
|
5
4
|
import { defu } from 'defu';
|
|
6
5
|
import tailwind from '@tailwindcss/vite';
|
|
7
|
-
import { g as getTemplates, d as defaultOptions, a as getDefaultUiConfig } from './shared/b24ui-nuxt.
|
|
6
|
+
import { g as getTemplates, d as defaultOptions, a as getDefaultUiConfig } from './shared/b24ui-nuxt.CGBDJv97.mjs';
|
|
8
7
|
import { globSync } from 'tinyglobby';
|
|
9
8
|
import { genSafeVariableName } from 'knitwork';
|
|
10
9
|
import MagicString from 'magic-string';
|
|
11
10
|
import { resolvePathSync } from 'mlly';
|
|
12
11
|
import AutoImportComponents from 'unplugin-vue-components';
|
|
12
|
+
import AutoImport from 'unplugin-auto-import';
|
|
13
13
|
import 'scule';
|
|
14
14
|
import '@nuxt/kit';
|
|
15
15
|
|
|
@@ -90,7 +90,7 @@ function AppConfigPlugin(options, appConfig) {
|
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
function ComponentImportPlugin(
|
|
93
|
+
function ComponentImportPlugin(options, meta) {
|
|
94
94
|
const components = globSync("**/*.vue", { cwd: join(runtimeDir, "components") });
|
|
95
95
|
const componentNames = new Set(components.map((c) => `B24${c.replace(/\.vue$/, "")}`));
|
|
96
96
|
const componentsContent = globSync("**/*.vue", { cwd: join(runtimeDir, "components/content") });
|
|
@@ -99,10 +99,26 @@ function ComponentImportPlugin(framework, options) {
|
|
|
99
99
|
const componentProseNames = new Set(componentsProse.map((c) => `B24${c.replace(/\.vue$/, "")}`));
|
|
100
100
|
const overrides = globSync("**/*.vue", { cwd: join(runtimeDir, "vue/components") });
|
|
101
101
|
const overrideNames = new Set(overrides.map((c) => `B24${c.replace(/\.vue$/, "")}`));
|
|
102
|
+
const pluginOptions = defu(options.components, {
|
|
103
|
+
dts: options.dts ?? true,
|
|
104
|
+
exclude: [/[\\/]node_modules[\\/](?!\.pnpm|@nuxt\/ui)/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
|
|
105
|
+
resolvers: [
|
|
106
|
+
(componentName) => {
|
|
107
|
+
if (overrideNames.has(componentName))
|
|
108
|
+
return { name: "default", from: join(runtimeDir, "vue/components", `${componentName.slice("B24".length)}.vue`) };
|
|
109
|
+
if (componentProseNames.has(componentName))
|
|
110
|
+
return { name: "default", from: join(runtimeDir, "components/prose", `${componentName.slice("B24".length)}.vue`) };
|
|
111
|
+
if (componentContentNames.has(componentName))
|
|
112
|
+
return { name: "default", from: join(runtimeDir, "components/content", `${componentName.slice("B24".length)}.vue`) };
|
|
113
|
+
if (componentNames.has(componentName))
|
|
114
|
+
return { name: "default", from: join(runtimeDir, "components", `${componentName.slice("B24".length)}.vue`) };
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
});
|
|
102
118
|
return [
|
|
103
119
|
/**
|
|
104
120
|
* This plugin aims to ensure we override certain components with Vue-compatible versions:
|
|
105
|
-
* <
|
|
121
|
+
* <B24Link> currently.
|
|
106
122
|
*/
|
|
107
123
|
{
|
|
108
124
|
name: "bitrix24:b24ui:components",
|
|
@@ -120,38 +136,7 @@ function ComponentImportPlugin(framework, options) {
|
|
|
120
136
|
}
|
|
121
137
|
}
|
|
122
138
|
},
|
|
123
|
-
AutoImportComponents
|
|
124
|
-
dts: options.dts ?? true,
|
|
125
|
-
exclude: [/[\\/]node_modules[\\/](?!\.pnpm|@bitrix24\/b24ui)/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
|
|
126
|
-
resolvers: [
|
|
127
|
-
(componentName) => {
|
|
128
|
-
if (overrideNames.has(componentName)) {
|
|
129
|
-
return {
|
|
130
|
-
name: "default",
|
|
131
|
-
from: join(runtimeDir, "vue/components", `${componentName.slice("B24".length)}.vue`)
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
if (componentContentNames.has(componentName)) {
|
|
135
|
-
return {
|
|
136
|
-
name: "default",
|
|
137
|
-
from: join(runtimeDir, "components/content", `${componentName.slice("B24".length)}.vue`)
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
if (componentProseNames.has(componentName)) {
|
|
141
|
-
return {
|
|
142
|
-
name: "default",
|
|
143
|
-
from: join(runtimeDir, "components/prose", `${componentName.slice("B24".length)}.vue`)
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
if (componentNames.has(componentName)) {
|
|
147
|
-
return {
|
|
148
|
-
name: "default",
|
|
149
|
-
from: join(runtimeDir, "components", `${componentName.slice("B24".length)}.vue`)
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
]
|
|
154
|
-
})
|
|
139
|
+
AutoImportComponents.raw(pluginOptions, meta)
|
|
155
140
|
];
|
|
156
141
|
}
|
|
157
142
|
const RELATIVE_IMPORT_RE = /^\.{1,2}\//;
|
|
@@ -184,19 +169,41 @@ function Bitrix24EnvironmentPlugin() {
|
|
|
184
169
|
};
|
|
185
170
|
}
|
|
186
171
|
|
|
172
|
+
function AutoImportPlugin(options, meta) {
|
|
173
|
+
const pluginOptions = defu(options.autoImport, {
|
|
174
|
+
dts: options.dts ?? true,
|
|
175
|
+
dirs: [join(runtimeDir, "composables")]
|
|
176
|
+
});
|
|
177
|
+
return AutoImport.raw(pluginOptions, meta);
|
|
178
|
+
}
|
|
179
|
+
|
|
187
180
|
const runtimeDir = normalize(fileURLToPath(new URL("./runtime", import.meta.url)));
|
|
188
181
|
const Bitrix24UIPlugin = createUnplugin((_options = {}, meta) => {
|
|
189
182
|
const options = defu(_options, { fonts: false, devtools: { enabled: false } }, defaultOptions);
|
|
190
183
|
const appConfig = defu({ b24ui: options.b24ui }, { b24ui: getDefaultUiConfig() });
|
|
191
184
|
return [
|
|
192
185
|
Bitrix24EnvironmentPlugin(),
|
|
193
|
-
|
|
194
|
-
|
|
186
|
+
ComponentImportPlugin(options, meta),
|
|
187
|
+
AutoImportPlugin(options, meta),
|
|
195
188
|
tailwind(),
|
|
196
189
|
PluginsPlugin(options),
|
|
197
190
|
TemplatePlugin(options),
|
|
198
|
-
AppConfigPlugin(options, appConfig)
|
|
199
|
-
|
|
191
|
+
AppConfigPlugin(options, appConfig),
|
|
192
|
+
{
|
|
193
|
+
name: "bitrix24:b24ui:plugins-duplication-detection",
|
|
194
|
+
vite: {
|
|
195
|
+
configResolved(config) {
|
|
196
|
+
const plugins = config.plugins || [];
|
|
197
|
+
if (plugins.filter((i) => i.name === "unplugin-auto-import").length > 1) {
|
|
198
|
+
throw new Error("[Bitrix24 UI] Multiple instances of `unplugin-auto-import` detected. Nuxt UI includes `unplugin-auto-import` already, and you can configure it using `autoImport` option in Bitrix24 UI module options.");
|
|
199
|
+
}
|
|
200
|
+
if (plugins.filter((i) => i.name === "unplugin-vue-components").length > 1) {
|
|
201
|
+
throw new Error("[Bitrix24 UI] Multiple instances of `unplugin-vue-components` detected. Nuxt UI includes `unplugin-vue-components` already, and you can configure it using `components` option in Bitrix24 UI module options.");
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
].flat(1);
|
|
200
207
|
});
|
|
201
208
|
|
|
202
209
|
export { Bitrix24UIPlugin, runtimeDir };
|
package/dist/vite.cjs
CHANGED
|
@@ -4,10 +4,9 @@ const unplugin = require('./unplugin.cjs');
|
|
|
4
4
|
require('node:url');
|
|
5
5
|
require('pathe');
|
|
6
6
|
require('unplugin');
|
|
7
|
-
require('unplugin-auto-import');
|
|
8
7
|
require('defu');
|
|
9
8
|
require('@tailwindcss/vite');
|
|
10
|
-
require('./shared/b24ui-nuxt.
|
|
9
|
+
require('./shared/b24ui-nuxt.D8eTlsIC.cjs');
|
|
11
10
|
require('scule');
|
|
12
11
|
require('@nuxt/kit');
|
|
13
12
|
require('tinyglobby');
|
|
@@ -15,6 +14,7 @@ require('knitwork');
|
|
|
15
14
|
require('magic-string');
|
|
16
15
|
require('mlly');
|
|
17
16
|
require('unplugin-vue-components');
|
|
17
|
+
require('unplugin-auto-import');
|
|
18
18
|
|
|
19
19
|
const vite = unplugin.Bitrix24UIPlugin.vite;
|
|
20
20
|
|
package/dist/vite.d.cts
CHANGED
package/dist/vite.d.mts
CHANGED
package/dist/vite.d.ts
CHANGED
package/dist/vite.mjs
CHANGED
|
@@ -2,10 +2,9 @@ import { Bitrix24UIPlugin } from './unplugin.mjs';
|
|
|
2
2
|
import 'node:url';
|
|
3
3
|
import 'pathe';
|
|
4
4
|
import 'unplugin';
|
|
5
|
-
import 'unplugin-auto-import';
|
|
6
5
|
import 'defu';
|
|
7
6
|
import '@tailwindcss/vite';
|
|
8
|
-
import './shared/b24ui-nuxt.
|
|
7
|
+
import './shared/b24ui-nuxt.CGBDJv97.mjs';
|
|
9
8
|
import 'scule';
|
|
10
9
|
import '@nuxt/kit';
|
|
11
10
|
import 'tinyglobby';
|
|
@@ -13,6 +12,7 @@ import 'knitwork';
|
|
|
13
12
|
import 'magic-string';
|
|
14
13
|
import 'mlly';
|
|
15
14
|
import 'unplugin-vue-components';
|
|
15
|
+
import 'unplugin-auto-import';
|
|
16
16
|
|
|
17
17
|
const vite = Bitrix24UIPlugin.vite;
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitrix24/b24ui-nuxt",
|
|
3
3
|
"description": "Bitrix24 UI-Kit for developing web applications REST API for NUXT & VUE",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/bitrix24/b24ui.git"
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
"@bitrix24/b24style": "^1.0.1",
|
|
63
63
|
"@internationalized/date": "^3.7.0",
|
|
64
64
|
"@internationalized/number": "^3.6.0",
|
|
65
|
-
"@nuxt/kit": "^3.15.
|
|
66
|
-
"@nuxt/schema": "^3.15.
|
|
65
|
+
"@nuxt/kit": "^3.15.4",
|
|
66
|
+
"@nuxt/schema": "^3.15.4",
|
|
67
67
|
"@nuxtjs/color-mode": "^3.5.2",
|
|
68
|
-
"@tailwindcss/postcss": "^4.0.
|
|
69
|
-
"@tailwindcss/vite": "^4.0.
|
|
68
|
+
"@tailwindcss/postcss": "^4.0.1",
|
|
69
|
+
"@tailwindcss/vite": "^4.0.1",
|
|
70
70
|
"@tanstack/vue-table": "^8.20.5",
|
|
71
71
|
"@unhead/vue": "^1.11.18",
|
|
72
72
|
"@vueuse/core": "^12.5.0",
|
|
@@ -87,10 +87,10 @@
|
|
|
87
87
|
"mlly": "^1.7.4",
|
|
88
88
|
"ohash": "^1.1.4",
|
|
89
89
|
"pathe": "^2.0.2",
|
|
90
|
-
"reka-ui": "1.0.0-alpha.
|
|
90
|
+
"reka-ui": "1.0.0-alpha.9",
|
|
91
91
|
"scule": "^1.3.0",
|
|
92
92
|
"tailwind-variants": "^0.3.1",
|
|
93
|
-
"tailwindcss": "^4.0.
|
|
93
|
+
"tailwindcss": "^4.0.1",
|
|
94
94
|
"tinyglobby": "^0.2.10",
|
|
95
95
|
"unplugin": "^2.1.2",
|
|
96
96
|
"unplugin-auto-import": "^19.0.0",
|
|
@@ -108,8 +108,7 @@
|
|
|
108
108
|
"happy-dom": "15.7.4",
|
|
109
109
|
"joi": "^17.13.3",
|
|
110
110
|
"knitwork": "^1.2.0",
|
|
111
|
-
"
|
|
112
|
-
"nuxt": "^3.15.3",
|
|
111
|
+
"nuxt": "^3.15.4",
|
|
113
112
|
"nuxt-component-meta": "^0.10.0",
|
|
114
113
|
"superstruct": "^2.0.2",
|
|
115
114
|
"valibot": "^0.42.1",
|
|
@@ -136,19 +135,14 @@
|
|
|
136
135
|
"vite": "^6.0.7"
|
|
137
136
|
},
|
|
138
137
|
"scripts": {
|
|
139
|
-
"dev:prepare": "
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
"prepare:playground-vue": "vite build playground-vue",
|
|
144
|
-
"prepare:playground_components-meta": "nuxt-component-meta playground --outputDir ../src/.component-meta/",
|
|
145
|
-
"build": "npm-run-all -s build:*",
|
|
146
|
-
"build:prepare": "pnpm dev:prepare",
|
|
147
|
-
"build:build": "nuxt-module-build build",
|
|
138
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground && vite build playground-vue && nuxt-component-meta playground --outputDir ../src/.component-meta/",
|
|
139
|
+
"dev:prepare_short": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground && vite build playground-vue",
|
|
140
|
+
"build": "nuxt-module-build build",
|
|
141
|
+
"build_short": "nuxt-module-build build",
|
|
148
142
|
"dev": "set DEV=true && nuxi dev playground",
|
|
149
|
-
"dev:vue": "set DEV=true && vite playground-vue",
|
|
150
143
|
"dev:build": "nuxi build playground",
|
|
151
144
|
"dev:generate": "nuxt generate playground",
|
|
145
|
+
"dev:vue": "set DEV=true && vite playground-vue",
|
|
152
146
|
"docs:full:dev": "pnpm build && vitepress dev docs",
|
|
153
147
|
"docs:full:build": "pnpm build && vitepress build docs",
|
|
154
148
|
"docs:dev": "vitepress dev docs",
|
|
@@ -157,10 +151,9 @@
|
|
|
157
151
|
"lint": "eslint .",
|
|
158
152
|
"lint:fix": "eslint . --fix",
|
|
159
153
|
"typecheck": "vue-tsc --noEmit && nuxi typecheck playground && cd playground-vue && vue-tsc --noEmit",
|
|
154
|
+
"typecheck-window": "vue-tsc --noEmit && nuxi typecheck playground && cd ../playground-vue && vue-tsc --noEmit",
|
|
160
155
|
"test": "vitest",
|
|
161
|
-
"test:save": "vitest -u",
|
|
162
156
|
"test:vue": "vitest -c vitest.vue.config.ts",
|
|
163
|
-
"test:vue:build": "vite build playground-vue"
|
|
164
|
-
"work:done": "pnpm lint && pnpm typecheck"
|
|
157
|
+
"test:vue:build": "vite build playground-vue"
|
|
165
158
|
}
|
|
166
159
|
}
|