@bitrix24/b24ui-nuxt 2.1.17 → 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.
- package/dist/meta.d.mts +632 -11
- package/dist/meta.mjs +632 -11
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/ScrollArea.d.vue.ts +81 -0
- package/dist/runtime/components/ScrollArea.vue +187 -0
- package/dist/runtime/components/ScrollArea.vue.d.ts +81 -0
- package/dist/runtime/components/Table.d.vue.ts +1 -0
- package/dist/runtime/components/Table.vue.d.ts +1 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/{inertia/components → vue/overrides/inertia}/Link.d.vue.ts +1 -1
- package/dist/runtime/{inertia/components → vue/overrides/inertia}/Link.vue +3 -3
- package/dist/runtime/{inertia/components → vue/overrides/inertia}/Link.vue.d.ts +1 -1
- package/dist/runtime/{inertia/components → vue/overrides/inertia}/LinkBase.d.vue.ts +1 -1
- package/dist/runtime/{inertia/components → vue/overrides/inertia}/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/vue/overrides/none/Link.d.vue.ts +73 -0
- package/dist/runtime/vue/overrides/none/Link.vue +128 -0
- package/dist/runtime/vue/overrides/none/Link.vue.d.ts +73 -0
- package/dist/runtime/vue/{components → overrides/vue-router}/Link.d.vue.ts +1 -1
- package/dist/runtime/vue/{components → overrides/vue-router}/Link.vue +4 -4
- package/dist/runtime/vue/{components → overrides/vue-router}/Link.vue.d.ts +1 -1
- package/dist/runtime/vue/{stubs.d.ts → stubs/base.d.ts} +6 -7
- package/dist/runtime/vue/{stubs.js → stubs/base.js} +6 -7
- package/dist/runtime/vue/stubs/inertia.d.ts +5 -0
- package/dist/runtime/vue/stubs/inertia.js +10 -0
- package/dist/runtime/vue/stubs/none.d.ts +56 -0
- package/dist/runtime/vue/stubs/none.js +48 -0
- package/dist/runtime/vue/stubs/vue-router.d.ts +2 -0
- package/dist/runtime/vue/stubs/vue-router.js +2 -0
- package/dist/shared/{b24ui-nuxt.BeTQIwtu.mjs → b24ui-nuxt.C-CS9MBp.mjs} +37 -8
- package/dist/unplugin.d.mts +13 -0
- package/dist/unplugin.mjs +83 -61
- package/dist/vite.mjs +1 -1
- package/package.json +4 -4
- package/dist/runtime/inertia/stubs.d.ts +0 -46
- package/dist/runtime/inertia/stubs.js +0 -93
- /package/dist/runtime/{inertia/components → vue/overrides/inertia}/LinkBase.vue +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes } from 'vue';
|
|
2
|
+
interface BaseLinkProps {
|
|
3
|
+
/**
|
|
4
|
+
* Route Location the link should navigate to when clicked on.
|
|
5
|
+
*/
|
|
6
|
+
to?: string;
|
|
7
|
+
/**
|
|
8
|
+
* An alias for `to`. If used with `to`, `href` will be ignored
|
|
9
|
+
*/
|
|
10
|
+
href?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Forces the link to be considered as external (true) or internal (false). This is helpful to handle edge-cases
|
|
13
|
+
*/
|
|
14
|
+
external?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Where to display the linked URL, as the name for a browsing context.
|
|
17
|
+
*/
|
|
18
|
+
target?: '_blank' | '_parent' | '_self' | '_top' | (string & {}) | null;
|
|
19
|
+
/**
|
|
20
|
+
* A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
|
|
21
|
+
*/
|
|
22
|
+
rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {}) | null;
|
|
23
|
+
/**
|
|
24
|
+
* If set to true, no rel attribute will be added to the link
|
|
25
|
+
*/
|
|
26
|
+
noRel?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface LinkProps extends BaseLinkProps {
|
|
29
|
+
/**
|
|
30
|
+
* The element or component this component should render as when not a link.
|
|
31
|
+
* @defaultValue 'button'
|
|
32
|
+
*/
|
|
33
|
+
as?: any;
|
|
34
|
+
/**
|
|
35
|
+
* The type of the button when not a link.
|
|
36
|
+
* @defaultValue 'button'
|
|
37
|
+
*/
|
|
38
|
+
type?: ButtonHTMLAttributes['type'];
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
/** Force the link to be active independent of the current route. */
|
|
41
|
+
active?: boolean;
|
|
42
|
+
/** Will only be active if the current route is an exact match. */
|
|
43
|
+
exact?: boolean;
|
|
44
|
+
/** Allows controlling how the current route query sets the link as active. */
|
|
45
|
+
exactQuery?: boolean | 'partial';
|
|
46
|
+
/** Will only be active if the current route hash is an exact match. */
|
|
47
|
+
exactHash?: boolean;
|
|
48
|
+
/** The class to apply when the link is inactive. */
|
|
49
|
+
inactiveClass?: string;
|
|
50
|
+
/** The class to apply when the link is active. */
|
|
51
|
+
activeClass?: string;
|
|
52
|
+
/** The value of the `aria-current` attribute when the link is active. */
|
|
53
|
+
ariaCurrentValue?: string;
|
|
54
|
+
custom?: boolean;
|
|
55
|
+
/** When `true`, uses special underlined styling. */
|
|
56
|
+
isAction?: boolean;
|
|
57
|
+
/** When `true`, only styles from `class`, `activeClass`, and `inactiveClass` will be applied. */
|
|
58
|
+
raw?: boolean;
|
|
59
|
+
class?: any;
|
|
60
|
+
}
|
|
61
|
+
export interface LinkSlots {
|
|
62
|
+
default(props: {
|
|
63
|
+
active: boolean;
|
|
64
|
+
}): any;
|
|
65
|
+
}
|
|
66
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, LinkSlots>;
|
|
67
|
+
declare const _default: typeof __VLS_export;
|
|
68
|
+
export default _default;
|
|
69
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
70
|
+
new (): {
|
|
71
|
+
$slots: S;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RouterLinkProps } from 'vue-router';
|
|
2
|
-
import type { ButtonHTMLAttributes, AnchorHTMLAttributes } from '
|
|
2
|
+
import type { ButtonHTMLAttributes, AnchorHTMLAttributes } from '../../../types/html';
|
|
3
3
|
export interface LinkProps extends Partial<Omit<RouterLinkProps, 'custom'>>, /** @vue-ignore */ Omit<ButtonHTMLAttributes, 'type' | 'disabled'>, /** @vue-ignore */ Omit<AnchorHTMLAttributes, 'href' | 'target' | 'rel' | 'type'> {
|
|
4
4
|
/**
|
|
5
5
|
* The element or component this component should render as when not a link.
|
|
@@ -11,10 +11,10 @@ import { reactiveOmit } from "@vueuse/core";
|
|
|
11
11
|
import { hasProtocol } from "ufo";
|
|
12
12
|
import { useRoute, RouterLink } from "vue-router";
|
|
13
13
|
import { useAppConfig } from "#imports";
|
|
14
|
-
import { tv } from "
|
|
15
|
-
import { mergeClasses } from "
|
|
16
|
-
import { isPartiallyEqual } from "
|
|
17
|
-
import B24LinkBase from "
|
|
14
|
+
import { tv } from "../../../utils/tv";
|
|
15
|
+
import { mergeClasses } from "../../../utils";
|
|
16
|
+
import { isPartiallyEqual } from "../../../utils/link";
|
|
17
|
+
import B24LinkBase from "../../../components/LinkBase.vue";
|
|
18
18
|
defineOptions({ inheritAttrs: false });
|
|
19
19
|
const props = defineProps({
|
|
20
20
|
as: { type: null, required: false, default: "button" },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RouterLinkProps } from 'vue-router';
|
|
2
|
-
import type { ButtonHTMLAttributes, AnchorHTMLAttributes } from '
|
|
2
|
+
import type { ButtonHTMLAttributes, AnchorHTMLAttributes } from '../../../types/html';
|
|
3
3
|
export interface LinkProps extends Partial<Omit<RouterLinkProps, 'custom'>>, /** @vue-ignore */ Omit<ButtonHTMLAttributes, 'type' | 'disabled'>, /** @vue-ignore */ Omit<AnchorHTMLAttributes, 'href' | 'target' | 'rel' | 'type'> {
|
|
4
4
|
/**
|
|
5
5
|
* The element or component this component should render as when not a link.
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
2
|
import type { NuxtApp } from '#app';
|
|
3
3
|
export { useHead } from '@unhead/vue';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export { useOverlay } from '../composables/useOverlay';
|
|
4
|
+
export { useAppConfig } from '../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';
|
|
11
10
|
export declare const clearError: () => void;
|
|
12
11
|
/**
|
|
13
12
|
* @memo need add for prose components
|
|
@@ -3,13 +3,12 @@ import { createHooks } from "hookable";
|
|
|
3
3
|
import { useColorMode as useColorModeVueUse } from "@vueuse/core";
|
|
4
4
|
import appConfig from "#build/app.config";
|
|
5
5
|
export { useHead } from "@unhead/vue";
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export { useOverlay } from "../composables/useOverlay.js";
|
|
6
|
+
export { useAppConfig } from "../composables/useAppConfig.js";
|
|
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";
|
|
13
12
|
export const clearError = () => {
|
|
14
13
|
};
|
|
15
14
|
export const useRuntimeConfig = () => {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export * from './base';
|
|
2
|
+
export declare const useRoute: () => {
|
|
3
|
+
fullPath: string;
|
|
4
|
+
path: string;
|
|
5
|
+
name: null;
|
|
6
|
+
params: {};
|
|
7
|
+
query: {};
|
|
8
|
+
hash: string;
|
|
9
|
+
meta: {};
|
|
10
|
+
matched: never[];
|
|
11
|
+
redirectedFrom: undefined;
|
|
12
|
+
};
|
|
13
|
+
export declare const useRouter: () => {
|
|
14
|
+
push: () => Promise<void>;
|
|
15
|
+
replace: () => Promise<void>;
|
|
16
|
+
go: () => void;
|
|
17
|
+
back: () => void;
|
|
18
|
+
forward: () => void;
|
|
19
|
+
beforeEach: () => () => void;
|
|
20
|
+
beforeResolve: () => () => void;
|
|
21
|
+
afterEach: () => () => void;
|
|
22
|
+
onError: () => () => void;
|
|
23
|
+
isReady: () => Promise<boolean>;
|
|
24
|
+
currentRoute: import("vue").Ref<{
|
|
25
|
+
fullPath: string;
|
|
26
|
+
path: string;
|
|
27
|
+
name: null;
|
|
28
|
+
params: {};
|
|
29
|
+
query: {};
|
|
30
|
+
hash: string;
|
|
31
|
+
meta: {};
|
|
32
|
+
matched: never[];
|
|
33
|
+
redirectedFrom: undefined;
|
|
34
|
+
}, {
|
|
35
|
+
fullPath: string;
|
|
36
|
+
path: string;
|
|
37
|
+
name: null;
|
|
38
|
+
params: {};
|
|
39
|
+
query: {};
|
|
40
|
+
hash: string;
|
|
41
|
+
meta: {};
|
|
42
|
+
matched: never[];
|
|
43
|
+
redirectedFrom: undefined;
|
|
44
|
+
} | {
|
|
45
|
+
fullPath: string;
|
|
46
|
+
path: string;
|
|
47
|
+
name: null;
|
|
48
|
+
params: {};
|
|
49
|
+
query: {};
|
|
50
|
+
hash: string;
|
|
51
|
+
meta: {};
|
|
52
|
+
matched: never[];
|
|
53
|
+
redirectedFrom: undefined;
|
|
54
|
+
}>;
|
|
55
|
+
options: {};
|
|
56
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
export * from "./base.js";
|
|
3
|
+
export const useRoute = () => {
|
|
4
|
+
return {
|
|
5
|
+
fullPath: "/",
|
|
6
|
+
path: "/",
|
|
7
|
+
name: null,
|
|
8
|
+
params: {},
|
|
9
|
+
query: {},
|
|
10
|
+
hash: "",
|
|
11
|
+
meta: {},
|
|
12
|
+
matched: [],
|
|
13
|
+
redirectedFrom: void 0
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export const useRouter = () => {
|
|
17
|
+
return {
|
|
18
|
+
push: () => Promise.resolve(),
|
|
19
|
+
replace: () => Promise.resolve(),
|
|
20
|
+
go: () => {
|
|
21
|
+
},
|
|
22
|
+
back: () => {
|
|
23
|
+
},
|
|
24
|
+
forward: () => {
|
|
25
|
+
},
|
|
26
|
+
beforeEach: () => () => {
|
|
27
|
+
},
|
|
28
|
+
beforeResolve: () => () => {
|
|
29
|
+
},
|
|
30
|
+
afterEach: () => () => {
|
|
31
|
+
},
|
|
32
|
+
onError: () => () => {
|
|
33
|
+
},
|
|
34
|
+
isReady: () => Promise.resolve(true),
|
|
35
|
+
currentRoute: ref({
|
|
36
|
+
fullPath: "/",
|
|
37
|
+
path: "/",
|
|
38
|
+
name: null,
|
|
39
|
+
params: {},
|
|
40
|
+
query: {},
|
|
41
|
+
hash: "",
|
|
42
|
+
meta: {},
|
|
43
|
+
matched: [],
|
|
44
|
+
redirectedFrom: void 0
|
|
45
|
+
}),
|
|
46
|
+
options: {}
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -8,7 +8,7 @@ import { globSync } from 'tinyglobby';
|
|
|
8
8
|
import { defuFn } from 'defu';
|
|
9
9
|
|
|
10
10
|
const name = "@bitrix24/b24ui-nuxt";
|
|
11
|
-
const version = "2.1
|
|
11
|
+
const version = "2.2.1";
|
|
12
12
|
|
|
13
13
|
function getDefaultConfig(theme) {
|
|
14
14
|
return {
|
|
@@ -1665,13 +1665,13 @@ const chatMessage = {
|
|
|
1665
1665
|
variants: {
|
|
1666
1666
|
variant: {
|
|
1667
1667
|
message: {
|
|
1668
|
-
content: "
|
|
1668
|
+
content: "bg-(--ui-color-design-outline-bg) border-(--ui-color-design-outline-stroke) border-(length:--ui-design-outline-stroke-weight-alt) text-(--ui-color-design-outline-content-secondary)"
|
|
1669
1669
|
},
|
|
1670
1670
|
event: {
|
|
1671
|
-
content: "bg-(--ui-color-design-
|
|
1671
|
+
content: "bg-(--ui-color-design-tinted-na-bg) border-(--ui-color-design-tinted-na-stroke) border-(length:--ui-design-tinted-na-stroke-weight) text-(--ui-color-design-tinted-na-content)"
|
|
1672
1672
|
},
|
|
1673
1673
|
system: {
|
|
1674
|
-
content: "bg-(--ui-color-copilot-bg-content-
|
|
1674
|
+
content: "bg-(--ui-color-copilot-bg-content-1) border-(--ui-color-design-outline-copilot-stroke) text-(--ui-color-design-outline-copilot-content)"
|
|
1675
1675
|
}
|
|
1676
1676
|
},
|
|
1677
1677
|
side: {
|
|
@@ -1679,7 +1679,7 @@ const chatMessage = {
|
|
|
1679
1679
|
container: "rtl:justify-end"
|
|
1680
1680
|
},
|
|
1681
1681
|
right: {
|
|
1682
|
-
container: "ltr:justify-end ms-auto max-w-[
|
|
1682
|
+
container: "ltr:justify-end ms-auto max-w-[85%]"
|
|
1683
1683
|
}
|
|
1684
1684
|
},
|
|
1685
1685
|
leading: {
|
|
@@ -1744,7 +1744,7 @@ const chatMessage = {
|
|
|
1744
1744
|
}
|
|
1745
1745
|
},
|
|
1746
1746
|
{
|
|
1747
|
-
variant: "
|
|
1747
|
+
variant: "system",
|
|
1748
1748
|
side: "left",
|
|
1749
1749
|
class: {
|
|
1750
1750
|
content: "w-full"
|
|
@@ -1759,7 +1759,7 @@ const chatMessage = {
|
|
|
1759
1759
|
const chatMessages = {
|
|
1760
1760
|
slots: {
|
|
1761
1761
|
root: "w-full flex flex-col gap-1 flex-1 px-2.5 [&>article]:last-of-type:min-h-(--last-message-height)",
|
|
1762
|
-
indicator: "h-6 flex items-center gap-1 py-3 *:size-2 *:rounded-full *:bg-(--ui-color-
|
|
1762
|
+
indicator: "h-6 flex items-center gap-1 py-3 *:size-2 *:rounded-full *:bg-(--ui-color-design-tinted-na-content-icon) [&>*:nth-child(1)]:animate-[bounce_1s_infinite] [&>*:nth-child(2)]:animate-[bounce_1s_0.15s_infinite] [&>*:nth-child(3)]:animate-[bounce_1s_0.3s_infinite]",
|
|
1763
1763
|
viewport: "absolute inset-x-0 top-[78%] data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]",
|
|
1764
1764
|
autoScroll: "rounded-full absolute right-1/2 translate-x-1/2 bottom-0"
|
|
1765
1765
|
},
|
|
@@ -6997,6 +6997,28 @@ const range = {
|
|
|
6997
6997
|
}
|
|
6998
6998
|
};
|
|
6999
6999
|
|
|
7000
|
+
const scrollArea = {
|
|
7001
|
+
slots: {
|
|
7002
|
+
root: "relative",
|
|
7003
|
+
viewport: "relative flex",
|
|
7004
|
+
item: ""
|
|
7005
|
+
},
|
|
7006
|
+
variants: {
|
|
7007
|
+
orientation: {
|
|
7008
|
+
vertical: {
|
|
7009
|
+
root: "overflow-y-auto overflow-x-hidden",
|
|
7010
|
+
viewport: "flex-col",
|
|
7011
|
+
item: ""
|
|
7012
|
+
},
|
|
7013
|
+
horizontal: {
|
|
7014
|
+
root: "overflow-x-auto overflow-y-hidden",
|
|
7015
|
+
viewport: "flex-row",
|
|
7016
|
+
item: ""
|
|
7017
|
+
}
|
|
7018
|
+
}
|
|
7019
|
+
}
|
|
7020
|
+
};
|
|
7021
|
+
|
|
7000
7022
|
const select = () => {
|
|
7001
7023
|
return defuFn(
|
|
7002
7024
|
{
|
|
@@ -9528,6 +9550,7 @@ const theme = {
|
|
|
9528
9550
|
progress: progress,
|
|
9529
9551
|
radioGroup: radioGroup,
|
|
9530
9552
|
range: range,
|
|
9553
|
+
scrollArea: scrollArea,
|
|
9531
9554
|
select: select,
|
|
9532
9555
|
selectMenu: selectMenu,
|
|
9533
9556
|
separator: separator,
|
|
@@ -9862,7 +9885,13 @@ const callout = {
|
|
|
9862
9885
|
"[&_code]:text-(length:--ui-font-size-sm)/(--ui-font-line-height-sm)",
|
|
9863
9886
|
"[&>div]:my-2.5",
|
|
9864
9887
|
"[&_ul]:my-2.5 [&_ul]:ps-3 [&_ul]:marker:text-(--b24ui-color)",
|
|
9865
|
-
"[&_ol]:my-2.5 [&_ol]:ps-3 [&
|
|
9888
|
+
"[&_ol]:my-2.5 [&_ol]:ps-3 [&_ol]:marker:text-(--b24ui-color)",
|
|
9889
|
+
"[&>h1]:text-(--b24ui-color)",
|
|
9890
|
+
"[&>h2]:text-(--b24ui-color)",
|
|
9891
|
+
"[&>h3]:text-(--b24ui-color)",
|
|
9892
|
+
"[&>h4]:text-(--b24ui-color)",
|
|
9893
|
+
"[&>h5]:text-(--b24ui-color)",
|
|
9894
|
+
"[&>h6]:text-(--b24ui-color)",
|
|
9866
9895
|
"[&>*]:last:!mb-0",
|
|
9867
9896
|
"[&_li]:my-1.5 [&_li]:ps-1 [&_li]:text-(length:--ui-font-size-md)/(--ui-font-line-height-3xs) [&_li]:text-(--b24ui-color)",
|
|
9868
9897
|
"[&_a]:underline",
|
package/dist/unplugin.d.mts
CHANGED
|
@@ -28,10 +28,23 @@ interface Bitrix24UIOptions extends Omit<ModuleOptions, 'colorMode'> {
|
|
|
28
28
|
* Override options for `unplugin-vue-components`
|
|
29
29
|
*/
|
|
30
30
|
components?: Partial<Options$1>;
|
|
31
|
+
/**
|
|
32
|
+
* Router integration mode
|
|
33
|
+
* - `true` (default): Use vue-router integration
|
|
34
|
+
* - `false`: Disable routing, use anchor tags
|
|
35
|
+
* - `'inertia'`: Use Inertia.js compatibility layer
|
|
36
|
+
* @defaultValue `true`
|
|
37
|
+
*/
|
|
38
|
+
router?: boolean | 'inertia';
|
|
31
39
|
/**
|
|
32
40
|
* Enables compatibility layer for InertiaJS
|
|
41
|
+
* @deprecated Use `router: 'inertia'` instead
|
|
33
42
|
*/
|
|
34
43
|
inertia?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Additional packages to scan for components using Nuxt UI
|
|
46
|
+
*/
|
|
47
|
+
scanPackages?: string[];
|
|
35
48
|
}
|
|
36
49
|
declare const runtimeDir: string;
|
|
37
50
|
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 getDefaultConfig } from './shared/b24ui-nuxt.
|
|
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
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
})
|
|
162
|
-
const
|
|
163
|
-
|
|
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
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
-
|
|
222
|
+
excludeRegex,
|
|
191
223
|
/[\\/]\.git[\\/]/,
|
|
192
224
|
/[\\/]\.nuxt[\\/]/
|
|
193
225
|
],
|
|
194
226
|
resolvers: [
|
|
195
227
|
(componentName) => {
|
|
196
|
-
|
|
197
|
-
|
|
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
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
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
|
|
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
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
|
|
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.
|
|
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.
|
|
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.
|
|
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",
|