@bitrix24/b24ui-nuxt 0.6.1 → 0.6.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.
@@ -0,0 +1,153 @@
1
+ <script>
2
+ import theme from "#build/b24ui/link";
3
+ </script>
4
+
5
+ <script setup>
6
+ import { computed } from "vue";
7
+ import { defu } from "defu";
8
+ import { useForwardProps } from "reka-ui";
9
+ import { reactiveOmit } from "@vueuse/core";
10
+ import { usePage, Link as InertiaLink } from "@inertiajs/vue3";
11
+ import { hasProtocol } from "ufo";
12
+ import { useAppConfig } from "#imports";
13
+ import { tv } from "../../utils/tv";
14
+ import B24LinkBase from "./../../components/LinkBase.vue";
15
+ defineOptions({ inheritAttrs: false });
16
+ const props = defineProps({
17
+ as: { type: null, required: false, default: "button" },
18
+ type: { type: null, required: false, default: "button" },
19
+ disabled: { type: Boolean, required: false },
20
+ active: { type: Boolean, required: false, default: void 0 },
21
+ exact: { type: Boolean, required: false },
22
+ inactiveClass: { type: String, required: false, default: "" },
23
+ custom: { type: Boolean, required: false },
24
+ isAction: { type: Boolean, required: false, default: false },
25
+ raw: { type: Boolean, required: false },
26
+ class: { type: null, required: false },
27
+ activeClass: { type: String, required: false, default: "" },
28
+ to: { type: String, required: false },
29
+ href: { type: String, required: false },
30
+ external: { type: Boolean, required: false },
31
+ target: { type: [String, Object, null], required: false },
32
+ ariaCurrentValue: { type: String, required: false },
33
+ data: { type: Object, required: false },
34
+ method: { type: String, required: false },
35
+ headers: { type: Object, required: false },
36
+ onClick: { type: Function, required: false },
37
+ preserveScroll: { type: [Boolean, String, Function], required: false },
38
+ preserveState: { type: [Boolean, String, Function], required: false },
39
+ replace: { type: Boolean, required: false },
40
+ only: { type: Array, required: false },
41
+ except: { type: Array, required: false },
42
+ onCancelToken: { type: Function, required: false },
43
+ onBefore: { type: Function, required: false },
44
+ onStart: { type: Function, required: false },
45
+ onProgress: { type: Function, required: false },
46
+ onFinish: { type: Function, required: false },
47
+ onCancel: { type: Function, required: false },
48
+ onSuccess: { type: Function, required: false },
49
+ onError: { type: Function, required: false },
50
+ queryStringArrayFormat: { type: String, required: false },
51
+ async: { type: Boolean, required: false },
52
+ prefetch: { type: [Boolean, String, Array], required: false },
53
+ cacheFor: { type: [Number, String, Array], required: false }
54
+ });
55
+ defineSlots();
56
+ const appConfig = useAppConfig();
57
+ const routerLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "activeClass", "inactiveClass", "to", "raw", "class"));
58
+ const b24ui = computed(() => tv({
59
+ extend: tv(theme),
60
+ ...defu({
61
+ variants: {
62
+ active: {
63
+ true: props.activeClass,
64
+ false: props.inactiveClass
65
+ }
66
+ }
67
+ }, appConfig.b24ui?.link || {})
68
+ }));
69
+ const isExternal = computed(() => {
70
+ if (!props.to) return false;
71
+ return typeof props.to === "string" && hasProtocol(props.to, { acceptRelative: true });
72
+ });
73
+ const linkClass = computed(() => {
74
+ const active = isActive.value;
75
+ if (props.raw) {
76
+ return [props.class, active ? props.activeClass : props.inactiveClass];
77
+ }
78
+ return b24ui.value({
79
+ class: props.class,
80
+ active,
81
+ disabled: props.disabled,
82
+ isAction: Boolean(props.isAction)
83
+ });
84
+ });
85
+ const page = usePage();
86
+ const url = computed(() => props.to ?? props.href ?? "#");
87
+ const isActive = computed(() => props.active || (props.exact ? url.value === props.href : page?.url.startsWith(url.value)));
88
+ </script>
89
+
90
+ <template>
91
+ <template v-if="!isExternal">
92
+ <InertiaLink v-bind="routerLinkProps" :href="url" custom>
93
+ <template v-if="custom">
94
+ <slot
95
+ v-bind="{
96
+ ...$attrs,
97
+ as,
98
+ type,
99
+ disabled,
100
+ href: url,
101
+ active: isActive
102
+ }"
103
+ />
104
+ </template>
105
+ <B24LinkBase
106
+ v-else
107
+ v-bind="{
108
+ ...$attrs,
109
+ as,
110
+ type,
111
+ disabled,
112
+ href: url,
113
+ active: isActive
114
+ }"
115
+ :class="linkClass"
116
+ >
117
+ <slot :active="isActive" />
118
+ </B24LinkBase>
119
+ </InertiaLink>
120
+ </template>
121
+
122
+ <template v-else>
123
+ <template v-if="custom">
124
+ <slot
125
+ v-bind="{
126
+ ...$attrs,
127
+ as,
128
+ type,
129
+ disabled,
130
+ href: to,
131
+ target: isExternal ? '_blank' : void 0,
132
+ active: isActive
133
+ }"
134
+ />
135
+ </template>
136
+ <B24LinkBase
137
+ v-else
138
+ v-bind="{
139
+ ...$attrs,
140
+ as,
141
+ type,
142
+ disabled,
143
+ href: url,
144
+ target: isExternal ? '_blank' : void 0,
145
+ active: isActive
146
+ }"
147
+ :is-external="isExternal"
148
+ :class="linkClass"
149
+ >
150
+ <slot :active="isActive" />
151
+ </B24LinkBase>
152
+ </template>
153
+ </template>
@@ -0,0 +1,97 @@
1
+ import type { ButtonHTMLAttributes } from 'vue';
2
+ import type { InertiaLinkProps } from '@inertiajs/vue3';
3
+ interface NuxtLinkProps extends Omit<InertiaLinkProps, 'href'> {
4
+ activeClass?: string;
5
+ /**
6
+ * Route Location the link should navigate to when clicked on.
7
+ */
8
+ to?: string;
9
+ /**
10
+ * An alias for `to`. If used with `to`, `href` will be ignored
11
+ */
12
+ href?: NuxtLinkProps['to'];
13
+ /**
14
+ * Forces the link to be considered as external (true) or internal (false). This is helpful to handle edge-cases
15
+ */
16
+ external?: boolean;
17
+ /**
18
+ * Where to display the linked URL, as the name for a browsing context.
19
+ */
20
+ target?: '_blank' | '_parent' | '_self' | '_top' | (string & {}) | null;
21
+ ariaCurrentValue?: string;
22
+ }
23
+ export interface LinkProps extends NuxtLinkProps {
24
+ /**
25
+ * The element or component this component should render as when not a link.
26
+ * @defaultValue 'button'
27
+ */
28
+ as?: any;
29
+ /**
30
+ * The type of the button when not a link.
31
+ * @defaultValue 'button'
32
+ */
33
+ type?: ButtonHTMLAttributes['type'];
34
+ disabled?: boolean;
35
+ /** Force the link to be active independent of the current route. */
36
+ active?: boolean;
37
+ /** Will only be active if the current route is an exact match. */
38
+ exact?: boolean;
39
+ /** The class to apply when the link is inactive. */
40
+ inactiveClass?: string;
41
+ custom?: boolean;
42
+ /** When `true`, uses special underlined styling. */
43
+ isAction?: boolean;
44
+ /** When `true`, only styles from `class`, `activeClass`, and `inactiveClass` will be applied. */
45
+ raw?: boolean;
46
+ class?: any;
47
+ }
48
+ export interface LinkSlots {
49
+ default(props: {
50
+ active: boolean;
51
+ }): any;
52
+ }
53
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<LinkProps>, {
54
+ as: string;
55
+ type: string;
56
+ active: undefined;
57
+ isAction: boolean;
58
+ activeClass: string;
59
+ inactiveClass: string;
60
+ }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<LinkProps>, {
61
+ as: string;
62
+ type: string;
63
+ active: undefined;
64
+ isAction: boolean;
65
+ activeClass: string;
66
+ inactiveClass: string;
67
+ }>>> & Readonly<{}>, {
68
+ as: any;
69
+ type: "reset" | "submit" | "button";
70
+ activeClass: string;
71
+ active: boolean;
72
+ inactiveClass: string;
73
+ isAction: boolean;
74
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, Readonly<LinkSlots> & LinkSlots>;
75
+ export default _default;
76
+ type __VLS_WithDefaults<P, D> = {
77
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
78
+ default: D[K];
79
+ }> : P[K];
80
+ };
81
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
82
+ type __VLS_TypePropsToOption<T> = {
83
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
84
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
85
+ } : {
86
+ type: import('vue').PropType<T[K]>;
87
+ required: true;
88
+ };
89
+ };
90
+ type __VLS_WithTemplateSlots<T, S> = T & {
91
+ new (): {
92
+ $slots: S;
93
+ };
94
+ };
95
+ type __VLS_PrettifyLocal<T> = {
96
+ [K in keyof T]: T[K];
97
+ } & {};
@@ -0,0 +1,45 @@
1
+ import type { Ref } from 'vue';
2
+ import type { NuxtApp } from '#app';
3
+ export { useHead } from '@unhead/vue';
4
+ export { defineShortcuts } from '../composables/defineShortcuts';
5
+ export { defineLocale } from '../composables/defineLocale';
6
+ export { useLocale } from '../composables/useLocale';
7
+ export { useConfetti } from '../composables/useConfetti';
8
+ export { useOverlay } from '../composables/useOverlay';
9
+ export declare const useRoute: () => {
10
+ fullPath: string;
11
+ };
12
+ export declare const useRouter: () => void;
13
+ export declare const useColorMode: () => {
14
+ forced: boolean;
15
+ preference?: undefined;
16
+ readonly value?: undefined;
17
+ } | {
18
+ preference: "light" | "dark" | "system";
19
+ readonly value: import("@vueuse/core").BasicColorMode;
20
+ forced: boolean;
21
+ };
22
+ export declare const useAppConfig: () => any;
23
+ export declare const useCookie: <T = string>(_name: string, _options?: Record<string, any>) => {
24
+ value: Ref<T, T>;
25
+ get: () => T;
26
+ set: () => void;
27
+ update: () => void;
28
+ refresh: () => Promise<Awaited<T>>;
29
+ remove: () => void;
30
+ };
31
+ export declare const useState: <T>(key: string, init: () => T) => Ref<T>;
32
+ export declare function useNuxtApp(): {
33
+ isHydrating: boolean;
34
+ payload: {
35
+ serverRendered: boolean;
36
+ };
37
+ hooks: import("hookable").Hookable<Record<string, any>, string>;
38
+ hook: <NameT extends string>(name: NameT, function_: any, options?: {
39
+ allowDeprecated?: boolean;
40
+ }) => () => void;
41
+ };
42
+ export declare function useRuntimeHook(name: string, fn: (...args: any[]) => void): void;
43
+ export declare function defineNuxtPlugin(plugin: (nuxtApp: NuxtApp) => void): {
44
+ install(app: import("vue").App<any>): void;
45
+ };
@@ -0,0 +1,84 @@
1
+ import { ref, onScopeDispose } from "vue";
2
+ import { createHooks } from "hookable";
3
+ import appConfig from "#build/app.config";
4
+ import { useColorMode as useColorModeVueUse } from "@vueuse/core";
5
+ import { usePage } from "@inertiajs/vue3";
6
+ export { useHead } from "@unhead/vue";
7
+ export { defineShortcuts } from "../composables/defineShortcuts.js";
8
+ export { defineLocale } from "../composables/defineLocale.js";
9
+ export { useLocale } from "../composables/useLocale.js";
10
+ export { useConfetti } from "../composables/useConfetti.js";
11
+ export { useOverlay } from "../composables/useOverlay.js";
12
+ export const useRoute = () => {
13
+ const page = usePage();
14
+ return {
15
+ fullPath: page.url
16
+ };
17
+ };
18
+ export const useRouter = () => {
19
+ };
20
+ export const useColorMode = () => {
21
+ if (!appConfig.colorMode) {
22
+ return {
23
+ forced: true
24
+ };
25
+ }
26
+ const { store, system } = useColorModeVueUse();
27
+ return {
28
+ get preference() {
29
+ return store.value === "auto" ? "system" : store.value;
30
+ },
31
+ set preference(value) {
32
+ store.value = value === "system" ? "auto" : value;
33
+ },
34
+ get value() {
35
+ return store.value === "auto" ? system.value : store.value;
36
+ },
37
+ forced: false
38
+ };
39
+ };
40
+ export const useAppConfig = () => appConfig;
41
+ export const useCookie = (_name, _options = {}) => {
42
+ const value = ref(null);
43
+ return {
44
+ value,
45
+ get: () => value.value,
46
+ set: () => {
47
+ },
48
+ update: () => {
49
+ },
50
+ refresh: () => Promise.resolve(value.value),
51
+ remove: () => {
52
+ }
53
+ };
54
+ };
55
+ const state = {};
56
+ export const useState = (key, init) => {
57
+ if (state[key]) {
58
+ return state[key];
59
+ }
60
+ const value = ref(init());
61
+ state[key] = value;
62
+ return value;
63
+ };
64
+ const hooks = createHooks();
65
+ export function useNuxtApp() {
66
+ return {
67
+ isHydrating: true,
68
+ payload: { serverRendered: false },
69
+ hooks,
70
+ hook: hooks.hook
71
+ };
72
+ }
73
+ export function useRuntimeHook(name, fn) {
74
+ const nuxtApp = useNuxtApp();
75
+ const unregister = nuxtApp.hook(name, fn);
76
+ onScopeDispose(unregister);
77
+ }
78
+ export function defineNuxtPlugin(plugin) {
79
+ return {
80
+ install(app) {
81
+ app.runWithContext(() => plugin({ vueApp: app }));
82
+ }
83
+ };
84
+ }
@@ -9,14 +9,15 @@ export type DeepPartial<T, O = any> = {
9
9
  } & {
10
10
  [key: string]: O | TightMap<O>;
11
11
  };
12
+ export type DynamicSlotsKeys<Name extends string | undefined, Suffix extends string | undefined = undefined> = (Name extends string ? Suffix extends string ? Name | `${Name}-${Suffix}` : Name : never);
12
13
  export type DynamicSlots<T extends {
13
14
  slot?: string;
14
- }, S extends string | undefined = undefined, D extends object = {}> = {
15
- [K in T['slot'] as K extends string ? S extends string ? (K | `${K}-${S}`) : K : never]?: (props: {
15
+ }, Suffix extends string | undefined = undefined, ExtraProps extends object = {}> = {
16
+ [K in DynamicSlotsKeys<T['slot'], Suffix>]: (props: {
16
17
  item: Extract<T, {
17
- slot: K extends `${infer Base}-${S}` ? Base : K;
18
+ slot: K extends `${infer Base}-${Suffix}` ? Base : K;
18
19
  }>;
19
- } & D) => any;
20
+ } & ExtraProps) => any;
20
21
  };
21
22
  export type GetObjectField<MaybeObject, Key extends string> = MaybeObject extends Record<string, any> ? MaybeObject[Key] : never;
22
23
  export type AcceptableValue = Exclude<_AcceptableValue, Record<string, any>>;
@@ -15,6 +15,7 @@ export function pickLinkProps(link) {
15
15
  "exactQuery",
16
16
  "external",
17
17
  "href",
18
+ "download",
18
19
  "inactiveClass",
19
20
  "noPrefetch",
20
21
  "noRel",
@@ -9,8 +9,8 @@ import { isEqual, diff } from "ohash/utils";
9
9
  import { useForwardProps } from "reka-ui";
10
10
  import { reactiveOmit } from "@vueuse/core";
11
11
  import { hasProtocol } from "ufo";
12
- import { useRoute, useAppConfig } from "#imports";
13
- import { RouterLink } from "vue-router";
12
+ import { useRoute, RouterLink } from "vue-router";
13
+ import { useAppConfig } from "#imports";
14
14
  import { tv } from "../../utils/tv";
15
15
  import B24LinkBase from "./../../components/LinkBase.vue";
16
16
  defineOptions({ inheritAttrs: false });
@@ -12,7 +12,7 @@ export declare const useColorMode: () => {
12
12
  preference?: undefined;
13
13
  readonly value?: undefined;
14
14
  } | {
15
- preference: "dark" | "light" | "system";
15
+ preference: "light" | "dark" | "system";
16
16
  readonly value: import("@vueuse/core").BasicColorMode;
17
17
  forced: boolean;
18
18
  };
@@ -1,7 +1,7 @@
1
1
  import { fileURLToPath } from 'node:url';
2
2
  import { kebabCase } from 'scule';
3
3
  import { addTypeTemplate, addTemplate } from '@nuxt/kit';
4
- import { defuFn, defu } from 'defu';
4
+ import { defuFn } from 'defu';
5
5
 
6
6
  const getDefaultUiConfig = () => ({});
7
7
  const defaultOptions = {
@@ -1822,6 +1822,7 @@ const dropdownMenu = {
1822
1822
  "shadow-lg rounded-2xs ring ring-base-300 dark:ring-base-800",
1823
1823
  "overflow-y-auto",
1824
1824
  "motion-safe:data-[state=open]:animate-[scale-in_100ms_ease-out] motion-safe:data-[state=closed]:animate-[scale-out_100ms_ease-in]",
1825
+ "origin-(--reka-dropdown-menu-content-transform-origin)",
1825
1826
  "divide-y divide-base-master/10 dark:divide-base-100/20 scroll-py-1",
1826
1827
  "pointer-events-auto"
1827
1828
  ].join(" "),
@@ -2785,13 +2786,15 @@ const inputMenu = () => {
2785
2786
  trailing: "group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75",
2786
2787
  arrow: "fill-base-master/10 dark:fill-base-100/20",
2787
2788
  content: [
2788
- "w-(--reka-popper-anchor-width)",
2789
+ "w-(--reka-combobox-trigger-width)",
2789
2790
  // 'max-h-60',
2791
+ "min-w-fit",
2790
2792
  // 'h-(--reka-popper-available-height)',
2791
2793
  "bg-white dark:bg-base-dark",
2792
2794
  "shadow-md rounded-2xs ring ring-base-300 dark:ring-base-800",
2793
2795
  "overflow-hidden",
2794
2796
  "data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
2797
+ "origin-(--reka-combobox-content-transform-origin)",
2795
2798
  "pointer-events-auto"
2796
2799
  ].join(" "),
2797
2800
  viewport: "divide-y divide-base-master/10 dark:divide-base-100/20 scroll-py-1",
@@ -4615,6 +4618,7 @@ const popover = {
4615
4618
  "bg-white dark:bg-base-dark",
4616
4619
  "shadow-lg rounded-2xs ring ring-base-300 dark:ring-base-800",
4617
4620
  "motion-safe:data-[state=open]:animate-[scale-in_100ms_ease-out] motion-safe:data-[state=closed]:animate-[scale-out_100ms_ease-in]",
4621
+ "origin-(--reka-popover-content-transform-origin)",
4618
4622
  "focus:outline-none pointer-events-auto"
4619
4623
  ].join(" "),
4620
4624
  arrow: "fill-white dark:fill-base-dark stroke-base-300 dark:stroke-base-800"
@@ -5407,13 +5411,15 @@ const select = () => {
5407
5411
  placeholder: "truncate text-base-400 dark:text-base-300",
5408
5412
  arrow: "fill-base-master/10 dark:fill-base-100/20",
5409
5413
  content: [
5410
- "w-(--reka-popper-anchor-width)",
5414
+ "w-(--reka-select-trigger-width)",
5411
5415
  // 'max-h-60',
5416
+ "min-w-fit",
5412
5417
  // 'h-(--reka-popper-available-height)',
5413
5418
  "bg-white dark:bg-base-dark",
5414
5419
  "shadow-md rounded-2xs ring ring-base-300 dark:ring-base-800",
5415
5420
  "overflow-hidden",
5416
5421
  "data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
5422
+ "origin-(--reka-select-content-transform-origin)",
5417
5423
  "pointer-events-auto"
5418
5424
  ].join(" "),
5419
5425
  scrollUpDownButton: [
@@ -5470,10 +5476,11 @@ const select = () => {
5470
5476
  };
5471
5477
 
5472
5478
  const selectMenu = () => {
5473
- return defu({
5479
+ return defuFn({
5474
5480
  slots: {
5475
5481
  input: "border-b border-base-300 dark:dark:border-base-800",
5476
- focusScope: "flex flex-col min-h-0"
5482
+ focusScope: "flex flex-col min-h-0",
5483
+ content: (content) => [content, "origin-(--reka-combobox-content-transform-origin) w-(--reka-combobox-trigger-width)"]
5477
5484
  },
5478
5485
  variants: {
5479
5486
  addNew: {
@@ -6739,6 +6746,7 @@ const tooltip = {
6739
6746
  "min-h-6 px-2 py-1 text-xs",
6740
6747
  "bg-base-dark text-white",
6741
6748
  "dark:bg-base-dark dark:text-base-150 dark:ring dark:ring-base-100/20",
6749
+ "origin-(--reka-tooltip-content-transform-origin)",
6742
6750
  "pointer-events-auto"
6743
6751
  ].join(" "),
6744
6752
  arrow: "fill-base-dark dark:fill-base-100/20",
@@ -25,6 +25,10 @@ interface Bitrix24UIOptions extends Omit<ModuleOptions, 'colorMode'> {
25
25
  * Override options for `unplugin-vue-components`
26
26
  */
27
27
  components?: Partial<Options$1>;
28
+ /**
29
+ * Enables compatibility layer for InertiaJS
30
+ */
31
+ inertia?: boolean;
28
32
  }
29
33
  declare const runtimeDir: string;
30
34
  declare const Bitrix24UIPlugin: unplugin.UnpluginInstance<Bitrix24UIOptions | undefined, boolean>;
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 getDefaultUiConfig } from './shared/b24ui-nuxt.wBs9vEU5.mjs';
6
+ import { g as getTemplates, d as defaultOptions, a as getDefaultUiConfig } from './shared/b24ui-nuxt.jU270f-Q.mjs';
7
7
  import { globSync } from 'tinyglobby';
8
8
  import { genSafeVariableName } from 'knitwork';
9
9
  import MagicString from 'magic-string';
@@ -98,6 +98,19 @@ function AppConfigPlugin(options, appConfig) {
98
98
  return `
99
99
  export default ${JSON.stringify(appConfig)}
100
100
  `;
101
+ },
102
+ vite: {
103
+ config() {
104
+ return {
105
+ test: {
106
+ server: {
107
+ deps: {
108
+ inline: ["@bitrix24/b24ui"]
109
+ }
110
+ }
111
+ }
112
+ };
113
+ }
101
114
  }
102
115
  };
103
116
  }
@@ -107,6 +120,8 @@ function ComponentImportPlugin(options, meta) {
107
120
  const componentNames = new Set(components.map((c) => `B24${c.replace(/\.vue$/, "")}`));
108
121
  const componentsContent = globSync("**/*.vue", { cwd: join(runtimeDir, "components/content") });
109
122
  const componentContentNames = new Set(componentsContent.map((c) => `B24${c.replace(/\.vue$/, "")}`));
123
+ const inertiaOverrides = globSync("**/*.vue", { cwd: join(runtimeDir, "inertia/components") });
124
+ const inertiaOverrideNames = new Set(inertiaOverrides.map((c) => `B24${c.replace(/\.vue$/, "")}`));
110
125
  const componentsProse = globSync("**/*.vue", { cwd: join(runtimeDir, "prose") });
111
126
  const componentProseNames = new Set(componentsProse.map((c) => `Prose${c.replace(/\.vue$/, "")}`));
112
127
  const overrides = globSync("**/*.vue", { cwd: join(runtimeDir, "vue/components") });
@@ -120,6 +135,9 @@ function ComponentImportPlugin(options, meta) {
120
135
  ],
121
136
  resolvers: [
122
137
  (componentName) => {
138
+ if (options.inertia && inertiaOverrideNames.has(componentName)) {
139
+ return { name: "default", from: join(runtimeDir, "inertia/components", `${componentName.slice("B24".length)}.vue`) };
140
+ }
123
141
  if (overrideNames.has(componentName))
124
142
  return { name: "default", from: join(runtimeDir, "vue/components", `${componentName.slice("B24".length)}.vue`) };
125
143
  if (componentProseNames.has(componentName))
@@ -147,6 +165,9 @@ function ComponentImportPlugin(options, meta) {
147
165
  return;
148
166
  }
149
167
  const filename = id.match(/([^/]+)\.vue$/)?.[1];
168
+ if (filename && options.inertia && inertiaOverrideNames.has(`B24${filename}`)) {
169
+ return join(runtimeDir, "inertia/components", `${filename}.vue`);
170
+ }
150
171
  if (filename && overrideNames.has(`B24${filename}`)) {
151
172
  return join(runtimeDir, "vue/components", `${filename}.vue`);
152
173
  }
@@ -157,8 +178,8 @@ function ComponentImportPlugin(options, meta) {
157
178
  }
158
179
  const RELATIVE_IMPORT_RE = /^\.{1,2}\//;
159
180
 
160
- function Bitrix24EnvironmentPlugin() {
161
- const stubPath = resolvePathSync("../runtime/vue/stubs", { extensions: [".ts", ".mjs", ".js"], url: import.meta.url });
181
+ function Bitrix24EnvironmentPlugin(options) {
182
+ const stubPath = resolvePathSync(options.inertia ? "../runtime/inertia/stubs" : "../runtime/vue/stubs", { extensions: [".ts", ".mjs", ".js"], url: import.meta.url });
162
183
  return {
163
184
  name: "bitrix24:b24ui",
164
185
  enforce: "pre",
@@ -198,7 +219,7 @@ const Bitrix24UIPlugin = createUnplugin((_options = {}, meta) => {
198
219
  const options = defu(_options, {}, defaultOptions);
199
220
  const appConfig = defu({ b24ui: options.b24ui, colorMode: options.colorMode }, { b24ui: getDefaultUiConfig() });
200
221
  return [
201
- Bitrix24EnvironmentPlugin(),
222
+ Bitrix24EnvironmentPlugin(options),
202
223
  ComponentImportPlugin(options, meta),
203
224
  AutoImportPlugin(options, meta),
204
225
  tailwind(),
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.wBs9vEU5.mjs';
7
+ import './shared/b24ui-nuxt.jU270f-Q.mjs';
8
8
  import 'scule';
9
9
  import '@nuxt/kit';
10
10
  import 'tinyglobby';