@bitrix24/b24ui-nuxt 2.1.16 → 2.2.1

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.
Files changed (46) hide show
  1. package/dist/meta.d.mts +683 -18
  2. package/dist/meta.mjs +683 -18
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +1 -1
  5. package/dist/runtime/air-design-tokens/003_b24_context_light.css +1 -1
  6. package/dist/runtime/air-design-tokens/004_b24_context_dark.css +1 -1
  7. package/dist/runtime/components/FormField.d.vue.ts +5 -0
  8. package/dist/runtime/components/FormField.vue +3 -1
  9. package/dist/runtime/components/FormField.vue.d.ts +5 -0
  10. package/dist/runtime/components/ScrollArea.d.vue.ts +81 -0
  11. package/dist/runtime/components/ScrollArea.vue +187 -0
  12. package/dist/runtime/components/ScrollArea.vue.d.ts +81 -0
  13. package/dist/runtime/components/Slideover.d.vue.ts +5 -0
  14. package/dist/runtime/components/Slideover.vue +6 -3
  15. package/dist/runtime/components/Slideover.vue.d.ts +5 -0
  16. package/dist/runtime/components/Table.d.vue.ts +1 -0
  17. package/dist/runtime/components/Table.vue.d.ts +1 -0
  18. package/dist/runtime/types/index.d.ts +1 -0
  19. package/dist/runtime/types/index.js +1 -0
  20. package/dist/runtime/{inertia/components → vue/overrides/inertia}/Link.d.vue.ts +1 -1
  21. package/dist/runtime/{inertia/components → vue/overrides/inertia}/Link.vue +3 -3
  22. package/dist/runtime/{inertia/components → vue/overrides/inertia}/Link.vue.d.ts +1 -1
  23. package/dist/runtime/{inertia/components → vue/overrides/inertia}/LinkBase.d.vue.ts +1 -1
  24. package/dist/runtime/{inertia/components → vue/overrides/inertia}/LinkBase.vue.d.ts +1 -1
  25. package/dist/runtime/vue/overrides/none/Link.d.vue.ts +73 -0
  26. package/dist/runtime/vue/overrides/none/Link.vue +128 -0
  27. package/dist/runtime/vue/overrides/none/Link.vue.d.ts +73 -0
  28. package/dist/runtime/vue/{components → overrides/vue-router}/Link.d.vue.ts +1 -1
  29. package/dist/runtime/vue/{components → overrides/vue-router}/Link.vue +4 -4
  30. package/dist/runtime/vue/{components → overrides/vue-router}/Link.vue.d.ts +1 -1
  31. package/dist/runtime/vue/{stubs.d.ts → stubs/base.d.ts} +6 -7
  32. package/dist/runtime/vue/{stubs.js → stubs/base.js} +6 -7
  33. package/dist/runtime/vue/stubs/inertia.d.ts +5 -0
  34. package/dist/runtime/vue/stubs/inertia.js +10 -0
  35. package/dist/runtime/vue/stubs/none.d.ts +56 -0
  36. package/dist/runtime/vue/stubs/none.js +48 -0
  37. package/dist/runtime/vue/stubs/vue-router.d.ts +2 -0
  38. package/dist/runtime/vue/stubs/vue-router.js +2 -0
  39. package/dist/shared/{b24ui-nuxt.DdKajqQs.mjs → b24ui-nuxt.C-CS9MBp.mjs} +225 -52
  40. package/dist/unplugin.d.mts +13 -0
  41. package/dist/unplugin.mjs +83 -61
  42. package/dist/vite.mjs +1 -1
  43. package/package.json +4 -4
  44. package/dist/runtime/inertia/stubs.d.ts +0 -46
  45. package/dist/runtime/inertia/stubs.js +0 -93
  46. /package/dist/runtime/{inertia/components → vue/overrides/inertia}/LinkBase.vue +0 -0
package/dist/unplugin.mjs CHANGED
@@ -3,7 +3,7 @@ import { join, normalize } from 'pathe';
3
3
  import { createUnplugin } from 'unplugin';
4
4
  import { defu } from 'defu';
5
5
  import tailwind from '@tailwindcss/vite';
6
- import { g as getTemplates, d as defaultOptions, a as getDefaultConfig } from './shared/b24ui-nuxt.DdKajqQs.mjs';
6
+ import { g as getTemplates, d as defaultOptions, a as getDefaultConfig } from './shared/b24ui-nuxt.C-CS9MBp.mjs';
7
7
  import fs from 'node:fs';
8
8
  import path from 'node:path';
9
9
  import MagicString from 'magic-string';
@@ -144,69 +144,90 @@ function AppConfigPlugin(_options, appConfig) {
144
144
  };
145
145
  }
146
146
 
147
- function ComponentImportPlugin(options, meta) {
148
- const components = globSync("**/*.vue", {
149
- cwd: join(runtimeDir, "components"),
150
- ignore: [
151
- !options.colorMode && "color-mode/**/*.vue",
152
- "content/*.vue",
153
- "prose/**/*.vue"
154
- ].filter(Boolean)
155
- });
156
- const componentNames = new Set(components.map((c) => `B24${c.split("/").pop()?.replace(/\.vue$/, "")}`));
157
- const componentPaths = new Map(components.map((c) => {
158
- const name = c.replace(/\.vue$/, "");
159
- const componentName = `B24${name.split("/").pop()}`;
160
- return [componentName, c];
161
- }));
162
- const componentsProse = globSync("**/*.vue", {
163
- cwd: join(runtimeDir, "components/prose")
164
- });
165
- const componentProseNames = new Set(componentsProse.map((c) => `Prose${c.replace(/\.vue$/, "")}`));
166
- const componentProsePaths = new Map(componentsProse.map((c) => {
167
- const name = c.replace(/\.vue$/, "");
168
- const componentName = `Prose${name.split("/").pop()}`;
169
- return [componentName, c];
170
- }));
171
- const overrides = globSync("**/*.vue", {
172
- cwd: join(runtimeDir, "vue/components"),
173
- ignore: [
174
- !options.colorMode && "color-mode/**/*.vue"
175
- ].filter(Boolean)
176
- });
177
- const overrideNames = new Set(overrides.map((c) => `B24${c.split("/").pop()?.replace(/\.vue$/, "")}`));
178
- const overridePaths = new Map(overrides.map((c) => {
179
- const name = c.replace(/\.vue$/, "");
180
- const componentName = `B24${name.split("/").pop()}`;
147
+ function resolveRouterMode(options) {
148
+ if (options.router === false) {
149
+ return "none";
150
+ }
151
+ if (options.router === "inertia") {
152
+ return "inertia";
153
+ }
154
+ if (options.router === void 0 && options.inertia === true) {
155
+ return "inertia";
156
+ }
157
+ return "vue-router";
158
+ }
159
+
160
+ function createComponentSource(cwd, prefix, ignore = []) {
161
+ const files = globSync("**/*.vue", { cwd, ignore: ignore.filter(Boolean) });
162
+ const names = new Set(files.map((c) => `${prefix}${c.split("/").pop()?.replace(/\.vue$/, "")}`));
163
+ const paths = new Map(files.map((c) => {
164
+ const componentName = `${prefix}${c.split("/").pop()?.replace(/\.vue$/, "")}`;
181
165
  return [componentName, c];
182
166
  }));
183
- const inertiaOverrides = globSync("**/*.vue", {
184
- cwd: join(runtimeDir, "inertia/components")
185
- });
186
- const inertiaOverrideNames = new Set(inertiaOverrides.map((c) => `B24${c.replace(/\.vue$/, "")}`));
167
+ return {
168
+ has: (name) => names.has(name),
169
+ resolve: (componentName) => {
170
+ const relativePath = paths.get(componentName);
171
+ if (!relativePath) return;
172
+ return { name: "default", from: join(cwd, relativePath) };
173
+ },
174
+ resolveFile: (filename) => {
175
+ const componentName = `${prefix}${filename}`;
176
+ const relativePath = paths.get(componentName);
177
+ if (!relativePath) return;
178
+ return join(cwd, relativePath);
179
+ }
180
+ };
181
+ }
182
+ function ComponentImportPlugin(options, meta) {
183
+ const colorModeIgnore = !options.colorMode ? ["color-mode/**/*.vue"] : [];
184
+ const routerMode = resolveRouterMode(options);
185
+ const routerOverrides = {
186
+ "vue-router": createComponentSource(join(runtimeDir, "vue/overrides/vue-router"), "B24"),
187
+ "inertia": createComponentSource(join(runtimeDir, "vue/overrides/inertia"), "B24"),
188
+ "none": createComponentSource(join(runtimeDir, "vue/overrides/none"), "B24")
189
+ };
190
+ const unpluginComponents = createComponentSource(
191
+ join(runtimeDir, "vue/components"),
192
+ "B24",
193
+ colorModeIgnore
194
+ );
195
+ const defaultComponents = createComponentSource(
196
+ join(runtimeDir, "components"),
197
+ "B24",
198
+ [...colorModeIgnore, "content/*.vue", "prose/**/*.vue"]
199
+ );
200
+ const defaultProseComponents = createComponentSource(
201
+ join(runtimeDir, "components/prose"),
202
+ "Prose",
203
+ []
204
+ );
205
+ const sources = [
206
+ routerOverrides[routerMode],
207
+ unpluginComponents,
208
+ defaultComponents,
209
+ defaultProseComponents
210
+ ].filter((s) => !!s);
211
+ const packagesToScan = [
212
+ "@bitrix24/b24ui-nuxt",
213
+ "@compodium/examples",
214
+ ...Array.isArray(options.scanPackages) ? options.scanPackages : []
215
+ ];
216
+ const escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
217
+ const packagesRegex = packagesToScan.map(escapeRegex).join("|");
218
+ const excludeRegex = new RegExp(`[\\\\/]node_modules[\\\\/](?!\\.pnpm|${packagesRegex})`);
187
219
  const pluginOptions = defu(options.components, {
188
220
  dts: options.dts ?? true,
189
221
  exclude: [
190
- /[\\/]node_modules[\\/](?!\.pnpm|@bitrix24\/b24ui-nuxt|@compodium\/examples)/,
222
+ excludeRegex,
191
223
  /[\\/]\.git[\\/]/,
192
224
  /[\\/]\.nuxt[\\/]/
193
225
  ],
194
226
  resolvers: [
195
227
  (componentName) => {
196
- if (options.inertia && inertiaOverrideNames.has(componentName)) {
197
- return { name: "default", from: join(runtimeDir, "inertia/components", `${componentName.slice("B24".length)}.vue`) };
198
- }
199
- if (overrideNames.has(componentName)) {
200
- const relativePath = overridePaths.get(componentName);
201
- return { name: "default", from: join(runtimeDir, "vue/components", relativePath) };
202
- }
203
- if (componentNames.has(componentName)) {
204
- const relativePath = componentPaths.get(componentName);
205
- return { name: "default", from: join(runtimeDir, "components", relativePath) };
206
- }
207
- if (componentProseNames.has(componentName)) {
208
- const relativePath = componentProsePaths.get(componentName);
209
- return { name: "default", from: join(runtimeDir, "components/prose", relativePath) };
228
+ for (const source of sources) {
229
+ const resolved = source.resolve(componentName);
230
+ if (resolved) return resolved;
210
231
  }
211
232
  }
212
233
  ]
@@ -227,12 +248,11 @@ function ComponentImportPlugin(options, meta) {
227
248
  return;
228
249
  }
229
250
  const filename = id.match(/([^/]+)\.vue$/)?.[1];
230
- if (filename && options.inertia && inertiaOverrideNames.has(`B24${filename}`)) {
231
- return join(runtimeDir, "inertia/components", `${filename}.vue`);
232
- }
233
- if (filename && overrideNames.has(`B24${filename}`)) {
234
- const relativePath = overridePaths.get(`B24${filename}`);
235
- return join(runtimeDir, "vue/components", relativePath);
251
+ if (filename) {
252
+ for (const source of sources) {
253
+ const resolved = source.resolveFile(filename);
254
+ if (resolved) return resolved;
255
+ }
236
256
  }
237
257
  }
238
258
  },
@@ -242,7 +262,9 @@ function ComponentImportPlugin(options, meta) {
242
262
  const RELATIVE_IMPORT_RE = /^\.{1,2}\//;
243
263
 
244
264
  function Bitrix24EnvironmentPlugin(options) {
245
- const stubPath = resolvePathSync(options.inertia ? "../runtime/inertia/stubs" : "../runtime/vue/stubs", { extensions: [".ts", ".mjs", ".js"], url: import.meta.url });
265
+ const routerMode = resolveRouterMode(options);
266
+ const stubsPath = `../runtime/vue/stubs/${routerMode}`;
267
+ const stubPath = resolvePathSync(stubsPath, { extensions: [".ts", ".mjs", ".js"], url: import.meta.url });
246
268
  return {
247
269
  name: "bitrix24:b24ui",
248
270
  enforce: "pre",
package/dist/vite.mjs CHANGED
@@ -4,7 +4,7 @@ import 'pathe';
4
4
  import 'unplugin';
5
5
  import 'defu';
6
6
  import '@tailwindcss/vite';
7
- import './shared/b24ui-nuxt.DdKajqQs.mjs';
7
+ import './shared/b24ui-nuxt.C-CS9MBp.mjs';
8
8
  import 'scule';
9
9
  import 'knitwork';
10
10
  import '@nuxt/kit';
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": "2.1.16",
4
+ "version": "2.2.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/bitrix24/b24ui.git"
@@ -109,11 +109,11 @@
109
109
  ],
110
110
  "dependencies": {
111
111
  "@bitrix24/b24icons-nuxt": "^2.0.7",
112
- "@internationalized/date": "^3.10.0",
112
+ "@internationalized/date": "^3.10.1",
113
113
  "@internationalized/number": "^3.6.5",
114
114
  "@nuxt/kit": "^4.2.2",
115
115
  "@nuxt/schema": "^4.2.2",
116
- "@standard-schema/spec": "^1.0.0",
116
+ "@standard-schema/spec": "^1.1.0",
117
117
  "@tailwindcss/postcss": "^4.1.18",
118
118
  "@tailwindcss/vite": "^4.1.18",
119
119
  "@tanstack/vue-table": "^8.21.3",
@@ -175,7 +175,7 @@
175
175
  "nuxt-component-meta": "^0.14.2",
176
176
  "sharp": "^0.34.3",
177
177
  "@vue/test-utils": "^2.4.6",
178
- "ai": "^5.0.113",
178
+ "ai": "^5.0.114",
179
179
  "embla-carousel": "^8.6.0",
180
180
  "eslint": "^9.39.2",
181
181
  "happy-dom": "^20.0.11",
@@ -1,46 +0,0 @@
1
- import type { Ref } from 'vue';
2
- import type { NuxtApp } from '#app';
3
- export { useHead } from '@unhead/vue';
4
- export { useAppConfig } from '../vue/composables/useAppConfig';
5
- export { defineShortcuts } from '../composables/defineShortcuts';
6
- export { defineLocale } from '../composables/defineLocale';
7
- export { useLocale } from '../composables/useLocale';
8
- export { useConfetti } from '../composables/useConfetti';
9
- export { useOverlay } from '../composables/useOverlay';
10
- export declare const useRoute: () => {
11
- fullPath: string;
12
- };
13
- export declare const useRouter: () => void;
14
- export declare const clearError: () => void;
15
- export declare const useColorMode: () => {
16
- forced: boolean;
17
- preference?: undefined;
18
- readonly value?: undefined;
19
- } | {
20
- preference: import("@vueuse/core").BasicColorMode | "system";
21
- readonly value: import("@vueuse/core").BasicColorMode;
22
- forced: boolean;
23
- };
24
- export declare const useCookie: <T = string>(_name: string, _options?: Record<string, any>) => {
25
- value: T;
26
- get: () => T;
27
- set: () => void;
28
- update: () => void;
29
- refresh: () => Promise<Awaited<T>>;
30
- remove: () => void;
31
- };
32
- export declare const useState: <T>(key: string, init: () => T) => Ref<T>;
33
- export declare function useNuxtApp(): {
34
- isHydrating: boolean;
35
- payload: {
36
- serverRendered: boolean;
37
- };
38
- hooks: import("hookable").Hookable<Record<string, any>, string>;
39
- hook: <NameT extends string>(name: NameT, function_: any, options?: {
40
- allowDeprecated?: boolean;
41
- }) => () => void;
42
- };
43
- export declare function useRuntimeHook(name: string, fn: (...args: any[]) => void): void;
44
- export declare function defineNuxtPlugin(plugin: (nuxtApp: NuxtApp) => void): {
45
- install(app: import("vue").App<any>): void;
46
- };
@@ -1,93 +0,0 @@
1
- import { ref, onScopeDispose } from "vue";
2
- import { createHooks } from "hookable";
3
- import { usePage } from "@inertiajs/vue3";
4
- import { useColorMode as useColorModeVueUse } from "@vueuse/core";
5
- import appConfig from "#build/app.config";
6
- export { useHead } from "@unhead/vue";
7
- export { useAppConfig } from "../vue/composables/useAppConfig.js";
8
- export { defineShortcuts } from "../composables/defineShortcuts.js";
9
- export { defineLocale } from "../composables/defineLocale.js";
10
- export { useLocale } from "../composables/useLocale.js";
11
- export { useConfetti } from "../composables/useConfetti.js";
12
- export { useOverlay } from "../composables/useOverlay.js";
13
- export const useRoute = () => {
14
- const page = usePage();
15
- return {
16
- fullPath: page.url
17
- };
18
- };
19
- export const useRouter = () => {
20
- };
21
- export const clearError = () => {
22
- };
23
- export const useColorMode = () => {
24
- if (!appConfig.colorMode) {
25
- return {
26
- forced: true
27
- };
28
- }
29
- const { store, system } = useColorModeVueUse({
30
- attribute: "class",
31
- modes: {
32
- auto: "auto",
33
- light: appConfig?.colorModeTypeLight || "light",
34
- dark: "dark"
35
- }
36
- });
37
- return {
38
- get preference() {
39
- return store.value === "auto" ? "system" : store.value;
40
- },
41
- set preference(value) {
42
- store.value = value === "system" ? "auto" : value;
43
- },
44
- get value() {
45
- return store.value === "auto" ? system.value : store.value;
46
- },
47
- forced: false
48
- };
49
- };
50
- export const useCookie = (_name, _options = {}) => {
51
- const value = ref(_options?.default?.() ?? null);
52
- return {
53
- value: value.value,
54
- get: () => value.value,
55
- set: () => {
56
- },
57
- update: () => {
58
- },
59
- refresh: () => Promise.resolve(value.value),
60
- remove: () => {
61
- }
62
- };
63
- };
64
- const state = {};
65
- export const useState = (key, init) => {
66
- if (state[key]) {
67
- return state[key];
68
- }
69
- const value = ref(init());
70
- state[key] = value;
71
- return value;
72
- };
73
- const hooks = createHooks();
74
- export function useNuxtApp() {
75
- return {
76
- isHydrating: true,
77
- payload: { serverRendered: typeof window === "undefined" },
78
- hooks,
79
- hook: hooks.hook
80
- };
81
- }
82
- export function useRuntimeHook(name, fn) {
83
- const nuxtApp = useNuxtApp();
84
- const unregister = nuxtApp.hook(name, fn);
85
- onScopeDispose(unregister);
86
- }
87
- export function defineNuxtPlugin(plugin) {
88
- return {
89
- install(app) {
90
- app.runWithContext(() => plugin({ vueApp: app }));
91
- }
92
- };
93
- }