@creopse/bridge 0.1.0 → 0.1.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 (82) hide show
  1. package/dist/index-BWhWXGj9.js +13 -0
  2. package/dist/react/bridge.js +27 -0
  3. package/dist/react/bridge10.js +24 -0
  4. package/dist/react/bridge11.js +32 -0
  5. package/dist/react/bridge12.js +23 -0
  6. package/dist/react/bridge13.js +18 -0
  7. package/dist/react/bridge2.js +66 -0
  8. package/dist/react/bridge3.js +37 -0
  9. package/dist/react/bridge4.js +20 -0
  10. package/dist/react/bridge5.js +54 -0
  11. package/dist/react/bridge6.js +54 -0
  12. package/dist/react/bridge7.js +70 -0
  13. package/dist/react/bridge8.js +54 -0
  14. package/dist/react/bridge9.js +37 -0
  15. package/dist/vite/index.js +6 -2
  16. package/dist/vite/react.js +131 -147
  17. package/dist/vite/vue.js +123 -138
  18. package/dist/vue/bridge.js +15 -0
  19. package/dist/vue/bridge2.js +27 -0
  20. package/dist/vue/bridge3.js +1 -0
  21. package/dist/vue/bridge4.js +18 -0
  22. package/dist/vue/bridge5.js +1 -0
  23. package/dist/vue/bridge6.js +41 -0
  24. package/dist/vue/bridge7.js +16 -0
  25. package/package.json +38 -12
  26. package/dist/react/components/AsyncImg/AsyncImg.d.ts +0 -12
  27. package/dist/react/components/AsyncImg/AsyncImg.js +0 -20
  28. package/dist/react/components/AsyncImg/index.d.ts +0 -1
  29. package/dist/react/components/AsyncImg/index.js +0 -1
  30. package/dist/react/components/CustomTransition/CustomTransition.d.ts +0 -12
  31. package/dist/react/components/CustomTransition/CustomTransition.js +0 -48
  32. package/dist/react/components/CustomTransition/index.d.ts +0 -1
  33. package/dist/react/components/CustomTransition/index.js +0 -1
  34. package/dist/react/components/Image/Image.d.ts +0 -14
  35. package/dist/react/components/Image/Image.js +0 -20
  36. package/dist/react/components/Image/index.d.ts +0 -1
  37. package/dist/react/components/Image/index.js +0 -1
  38. package/dist/react/components/MountedTeleport/MountedTeleport.d.ts +0 -8
  39. package/dist/react/components/MountedTeleport/MountedTeleport.js +0 -43
  40. package/dist/react/components/MountedTeleport/index.d.ts +0 -1
  41. package/dist/react/components/MountedTeleport/index.js +0 -1
  42. package/dist/react/components/PageLayout/PageLayout.d.ts +0 -20
  43. package/dist/react/components/PageLayout/PageLayout.js +0 -30
  44. package/dist/react/components/PageLayout/index.d.ts +0 -1
  45. package/dist/react/components/PageLayout/index.js +0 -1
  46. package/dist/react/components/ReadMore/ReadMore.d.ts +0 -12
  47. package/dist/react/components/ReadMore/ReadMore.js +0 -33
  48. package/dist/react/components/ReadMore/index.d.ts +0 -1
  49. package/dist/react/components/ReadMore/index.js +0 -1
  50. package/dist/react/components/StickyBottom/StickyBottom.d.ts +0 -9
  51. package/dist/react/components/StickyBottom/StickyBottom.js +0 -57
  52. package/dist/react/components/StickyBottom/index.d.ts +0 -1
  53. package/dist/react/components/StickyBottom/index.js +0 -1
  54. package/dist/react/components/StickyTop/StickyTop.d.ts +0 -9
  55. package/dist/react/components/StickyTop/StickyTop.js +0 -56
  56. package/dist/react/components/StickyTop/index.d.ts +0 -1
  57. package/dist/react/components/StickyTop/index.js +0 -1
  58. package/dist/react/components/index.d.ts +0 -8
  59. package/dist/react/components/index.js +0 -8
  60. package/dist/react/hooks/access.d.ts +0 -25
  61. package/dist/react/hooks/access.js +0 -41
  62. package/dist/react/hooks/core-bridge.d.ts +0 -13
  63. package/dist/react/hooks/core-bridge.js +0 -19
  64. package/dist/react/hooks/responsive.d.ts +0 -15
  65. package/dist/react/hooks/responsive.js +0 -42
  66. package/dist/react/hooks/user-preference.d.ts +0 -4
  67. package/dist/react/hooks/user-preference.js +0 -17
  68. package/dist/utils/constants.d.ts +0 -2
  69. package/dist/utils/constants.js +0 -3
  70. package/dist/utils/functions.d.ts +0 -33
  71. package/dist/utils/functions.js +0 -53
  72. package/dist/vite/index.d.ts +0 -2
  73. package/dist/vite/react.d.ts +0 -45
  74. package/dist/vite/vue.d.ts +0 -40
  75. package/dist/vue/composables/access.d.ts +0 -25
  76. package/dist/vue/composables/access.js +0 -58
  77. package/dist/vue/composables/core-bridge.d.ts +0 -12
  78. package/dist/vue/composables/core-bridge.js +0 -15
  79. package/dist/vue/composables/responsive.d.ts +0 -15
  80. package/dist/vue/composables/responsive.js +0 -35
  81. package/dist/vue/composables/user-preference.d.ts +0 -12
  82. package/dist/vue/composables/user-preference.js +0 -14
@@ -1,41 +0,0 @@
1
- import { AccessGuard, Permission, UserRole } from '@creopse/utils/enums';
2
- export const useAccess = () => {
3
- // ── Permissions ───────────────────────────────────────────────────────────
4
- const userCan = (permissions, permissionName) => {
5
- return ((permissions?.findIndex((permission) => permission.name === permissionName) ?? -1) > -1);
6
- };
7
- const userIs = (roles, roleName) => {
8
- return (roles?.findIndex((role) => role.name === roleName) ?? -1) > -1;
9
- };
10
- const userIsSuperAdmin = (roles) => {
11
- return userIs(roles, UserRole.SUPER_ADMIN);
12
- };
13
- const isPermissionNative = (name) => {
14
- return Object.values(Permission).includes(name);
15
- };
16
- // ── Access Guards ─────────────────────────────────────────────────────────
17
- const accessGuards = [
18
- { label: 'API', value: AccessGuard.API, tagType: 'warning' },
19
- { label: 'Web', value: AccessGuard.WEB, tagType: 'info' },
20
- { label: 'Admin', value: AccessGuard.ADMIN, tagType: 'success' },
21
- { label: 'Mobile', value: AccessGuard.MOBILE, tagType: 'error' },
22
- ];
23
- const getAccessGuardLabel = (value) => accessGuards.find((guard) => guard.value === value)?.label;
24
- const getAccessGuardTagType = (value) => (accessGuards.find((guard) => guard.value === value)?.tagType ||
25
- 'default');
26
- // ── Roles ─────────────────────────────────────────────────────────────────
27
- const getRoleName = (roles, id) => {
28
- return (roles?.find((r) => r.id === id)?.name ||
29
- window.__creopse__.i18n.t('undefined'));
30
- };
31
- return {
32
- accessGuards,
33
- getAccessGuardLabel,
34
- getAccessGuardTagType,
35
- getRoleName,
36
- isPermissionNative,
37
- userIsSuperAdmin,
38
- userCan,
39
- userIs,
40
- };
41
- };
@@ -1,13 +0,0 @@
1
- import { BridgeAuthState, BridgeServerState, UserInterfaceState } from '@creopse/utils';
2
- export declare const useCoreBridge: () => {
3
- locale: string | undefined;
4
- env: Readonly<import("@creopse/utils").EnvData> | undefined;
5
- appConfig: Readonly<import("@creopse/utils").AppConfig> | undefined;
6
- api: import("@creopse/utils").Api;
7
- i18n: import("@creopse/utils").BridgeI18n;
8
- router: import("@creopse/utils").BridgeRouter;
9
- helpers: import("@creopse/utils").BridgeHelpers;
10
- auth: BridgeAuthState;
11
- server: BridgeServerState;
12
- ui: UserInterfaceState;
13
- };
@@ -1,19 +0,0 @@
1
- import { useStore } from 'zustand';
2
- export const useCoreBridge = () => {
3
- const { sharedData, api, i18n, router, helpers, stores } = window.__creopse__;
4
- const authState = useStore(stores.auth);
5
- const serverState = useStore(stores.server);
6
- const uiState = useStore(stores.ui);
7
- return {
8
- locale: sharedData?.locale,
9
- env: sharedData?.env,
10
- appConfig: sharedData?.appConfig,
11
- api,
12
- i18n,
13
- router,
14
- helpers,
15
- auth: authState,
16
- server: serverState,
17
- ui: uiState,
18
- };
19
- };
@@ -1,15 +0,0 @@
1
- export declare const useResponsive: () => {
2
- is2XlScreen: boolean;
3
- isXlScreen: boolean;
4
- isLgScreen: boolean;
5
- isMdScreen: boolean;
6
- isSmScreen: boolean;
7
- fromSm: boolean;
8
- fromMd: boolean;
9
- fromLg: boolean;
10
- fromXl: boolean;
11
- from2Xl: boolean;
12
- isMobile: boolean;
13
- isTablet: boolean;
14
- isDesktop: boolean;
15
- };
@@ -1,42 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- const query = (q) => window.matchMedia(q);
3
- const useMediaQuery = (q) => {
4
- const [matches, setMatches] = useState(() => query(q).matches);
5
- useEffect(() => {
6
- const mq = query(q);
7
- const handler = (e) => setMatches(e.matches);
8
- mq.addEventListener('change', handler);
9
- return () => mq.removeEventListener('change', handler);
10
- }, [q]);
11
- return matches;
12
- };
13
- export const useResponsive = () => {
14
- const is2XlScreen = useMediaQuery('(min-width: 1536px)');
15
- const isXlScreen = useMediaQuery('(min-width: 1280px) and (max-width: 1535px)');
16
- const isLgScreen = useMediaQuery('(min-width: 1024px) and (max-width: 1279px)');
17
- const isMdScreen = useMediaQuery('(min-width: 768px) and (max-width: 1023px)');
18
- const isSmScreen = useMediaQuery('(max-width: 767px)');
19
- const fromSm = useMediaQuery('(min-width: 640px)');
20
- const fromMd = useMediaQuery('(min-width: 768px)');
21
- const fromLg = useMediaQuery('(min-width: 1024px)');
22
- const fromXl = useMediaQuery('(min-width: 1280px)');
23
- const from2Xl = useMediaQuery('(min-width: 1536px)');
24
- const isMobile = !fromMd;
25
- const isTablet = fromMd && !fromLg;
26
- const isDesktop = fromLg;
27
- return {
28
- is2XlScreen,
29
- isXlScreen,
30
- isLgScreen,
31
- isMdScreen,
32
- isSmScreen,
33
- fromSm,
34
- fromMd,
35
- fromLg,
36
- fromXl,
37
- from2Xl,
38
- isMobile,
39
- isTablet,
40
- isDesktop,
41
- };
42
- };
@@ -1,4 +0,0 @@
1
- import type { UserPrefs } from '@creopse/utils/types';
2
- export declare const useUserPreference: () => {
3
- defaultPrefs: UserPrefs;
4
- };
@@ -1,17 +0,0 @@
1
- import { Bool } from '@creopse/utils/enums';
2
- import { useEffect, useState } from 'react';
3
- export const useUserPreference = () => {
4
- const [defaultPrefs, setDefaultPrefs] = useState({
5
- inAppNotifEnabled: Bool.TRUE,
6
- emailNotifEnabled: Bool.TRUE,
7
- locale: window.__creopse__.i18n.getLocale(),
8
- });
9
- useEffect(() => {
10
- // Resync if the locale changes on the host
11
- setDefaultPrefs((prev) => ({
12
- ...prev,
13
- locale: window.__creopse__.i18n.getLocale(),
14
- }));
15
- }, []);
16
- return { defaultPrefs };
17
- };
@@ -1,2 +0,0 @@
1
- export declare const DASHBOARD_MODULE_NAME = "PluginDashboard";
2
- export declare const SETTINGS_MODULE_NAME = "PluginSettings";
@@ -1,3 +0,0 @@
1
- // Modules
2
- export const DASHBOARD_MODULE_NAME = 'PluginDashboard';
3
- export const SETTINGS_MODULE_NAME = 'PluginSettings';
@@ -1,33 +0,0 @@
1
- /**
2
- * Returns the base URL of the current window location.
3
- *
4
- * @return {string} The base URL of the current window location.
5
- */
6
- export declare const getBaseUrl: () => string;
7
- /**
8
- * Returns the URL of the current page by appending the base URL with the pathname.
9
- *
10
- * @return {string} The URL of the current page.
11
- */
12
- export declare const getPageUrl: () => string;
13
- /**
14
- * Removes the trailing slash from a given path.
15
- *
16
- * @param {string} path - The path to remove the trailing slash from.
17
- * @return {string} The path without the trailing slash.
18
- */
19
- export declare const removeTrailingSlash: (path: string) => string;
20
- /**
21
- * Determines if a given string is a valid JSON string representing an object.
22
- *
23
- * @param {string} str - The string to be checked.
24
- * @return {boolean} Returns true if the string is a valid JSON string of an object, false otherwise.
25
- */
26
- export declare const isStringifiedObject: (str: string) => boolean;
27
- /**
28
- * Sanitizes an ID by removing any characters that are not a letter, number, slash, or dash and replacing any slashes with dashes.
29
- *
30
- * @param {string} id - The ID to be sanitized.
31
- * @return {string} The sanitized ID.
32
- */
33
- export declare const sanitizeId: (id: string) => string;
@@ -1,53 +0,0 @@
1
- /**
2
- * Returns the base URL of the current window location.
3
- *
4
- * @return {string} The base URL of the current window location.
5
- */
6
- export const getBaseUrl = () => {
7
- const { protocol, hostname, port } = window.location;
8
- return protocol + '//' + hostname + (port ? `:${port}` : '');
9
- };
10
- /**
11
- * Returns the URL of the current page by appending the base URL with the pathname.
12
- *
13
- * @return {string} The URL of the current page.
14
- */
15
- export const getPageUrl = () => {
16
- return getBaseUrl() + window.location.pathname;
17
- };
18
- /**
19
- * Removes the trailing slash from a given path.
20
- *
21
- * @param {string} path - The path to remove the trailing slash from.
22
- * @return {string} The path without the trailing slash.
23
- */
24
- export const removeTrailingSlash = (path) => {
25
- if (path.length > 1 && path.charAt(path.length - 1) === '/') {
26
- return path.substring(0, path.length - 1);
27
- }
28
- return path;
29
- };
30
- /**
31
- * Determines if a given string is a valid JSON string representing an object.
32
- *
33
- * @param {string} str - The string to be checked.
34
- * @return {boolean} Returns true if the string is a valid JSON string of an object, false otherwise.
35
- */
36
- export const isStringifiedObject = (str) => {
37
- try {
38
- const parsed = JSON.parse(str);
39
- return (typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed));
40
- }
41
- catch (e) {
42
- return false;
43
- }
44
- };
45
- /**
46
- * Sanitizes an ID by removing any characters that are not a letter, number, slash, or dash and replacing any slashes with dashes.
47
- *
48
- * @param {string} id - The ID to be sanitized.
49
- * @return {string} The sanitized ID.
50
- */
51
- export const sanitizeId = (id) => {
52
- return id.replace(/[^a-z0-9\/-]/g, '').replace(/\//g, '-');
53
- };
@@ -1,2 +0,0 @@
1
- export * from './vue';
2
- export * from './react';
@@ -1,45 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- export interface CreopseReactPluginOptions {
3
- /**
4
- * Path to the manifest.jsonc file, relative to the project root.
5
- * @default './manifest.jsonc'
6
- */
7
- manifestPath?: string;
8
- /**
9
- * Source directory, relative to the project root.
10
- * @default './src'
11
- */
12
- srcDir?: string;
13
- /**
14
- * Output directory for the build.
15
- * @default 'frontend'
16
- */
17
- outDir?: string;
18
- /**
19
- * Path to the i18n locales directory, relative to the project root.
20
- * @default './src/i18n/locales'
21
- */
22
- i18nLocalesPath?: string;
23
- /**
24
- * Directories to scan for auto-imports, relative to the project root.
25
- * @default ['src/hooks']
26
- */
27
- hooksDirs?: string[];
28
- /**
29
- * Shared modules for Module Federation.
30
- * 'react', 'react-dom' and 'zustand' are always included.
31
- * @default []
32
- */
33
- shared?: string[];
34
- /**
35
- * Whether to enable UnoCSS.
36
- * @default false
37
- */
38
- unocss?: boolean;
39
- /**
40
- * Whether to generate an eslint auto-import config file.
41
- * @default false
42
- */
43
- eslintAutoImport?: boolean;
44
- }
45
- export declare function CreopseReactPlugin(options?: CreopseReactPluginOptions): Plugin;
@@ -1,40 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- export interface CreopseVuePluginOptions {
3
- /**
4
- * Path to the manifest.jsonc file, relative to the project root.
5
- * @default './manifest.jsonc'
6
- */
7
- manifestPath?: string;
8
- /**
9
- * Source directory, relative to the project root.
10
- * @default './src'
11
- */
12
- srcDir?: string;
13
- /**
14
- * Output directory for the build.
15
- * @default 'frontend'
16
- */
17
- outDir?: string;
18
- /**
19
- * Path to the i18n locales directory, relative to the project root.
20
- * @default './src/i18n/locales'
21
- */
22
- i18nLocalesPath?: string;
23
- /**
24
- * Directories to scan for auto-imports, relative to the project root.
25
- * @default ['src/composables']
26
- */
27
- composablesDirs?: string[];
28
- /**
29
- * Shared modules for Module Federation.
30
- * The 'vue' and 'pinia' are always included.
31
- * @default []
32
- */
33
- shared?: string[];
34
- /**
35
- * Whether to enable UnoCSS.
36
- * @default false
37
- */
38
- unocss?: boolean;
39
- }
40
- export declare function CreopseVuePlugin(options?: CreopseVuePluginOptions): Plugin;
@@ -1,25 +0,0 @@
1
- import { AccessGuard } from '@creopse/utils/enums';
2
- import type { NTagType } from '@creopse/utils/types';
3
- export declare const useAccess: () => {
4
- accessGuards: {
5
- label: string;
6
- value: AccessGuard;
7
- tagType: string;
8
- }[];
9
- getAccessGuardLabel: (value: AccessGuard) => string | undefined;
10
- getAccessGuardTagType: (value: AccessGuard) => NTagType;
11
- getRoleName: (roles: {
12
- id: number;
13
- name: string;
14
- }[], id: number) => string;
15
- isPermissionNative: (name: string) => boolean;
16
- userIsSuperAdmin: (roles: {
17
- name: string;
18
- }[]) => boolean;
19
- userCan: (permissions: {
20
- name: string;
21
- }[], permissionName: string) => boolean;
22
- userIs: (roles: {
23
- name: string;
24
- }[], roleName: string) => boolean;
25
- };
@@ -1,58 +0,0 @@
1
- import { AccessGuard, Permission, UserRole } from '@creopse/utils/enums';
2
- import { useI18n } from 'vue-i18n';
3
- export const useAccess = () => {
4
- const { t } = useI18n();
5
- // ── Permissions ───────────────────────────────────────────────────────────
6
- const userCan = (permissions, permissionName) => {
7
- return ((permissions?.findIndex((permission) => permission.name === permissionName) ?? -1) > -1);
8
- };
9
- const userIs = (roles, roleName) => {
10
- return (roles?.findIndex((role) => role.name === roleName) ?? -1) > -1;
11
- };
12
- const userIsSuperAdmin = (roles) => {
13
- return userIs(roles, UserRole.SUPER_ADMIN);
14
- };
15
- const isPermissionNative = (name) => {
16
- return Object.values(Permission).includes(name);
17
- };
18
- // ── Access Guards ─────────────────────────────────────────────────────────
19
- const accessGuards = [
20
- {
21
- label: 'API',
22
- value: AccessGuard.API,
23
- tagType: 'warning',
24
- },
25
- {
26
- label: 'Web',
27
- value: AccessGuard.WEB,
28
- tagType: 'info',
29
- },
30
- {
31
- label: 'Admin',
32
- value: AccessGuard.ADMIN,
33
- tagType: 'success',
34
- },
35
- {
36
- label: 'Mobile',
37
- value: AccessGuard.MOBILE,
38
- tagType: 'error',
39
- },
40
- ];
41
- const getAccessGuardLabel = (value) => accessGuards.find((guard) => guard.value === value)?.label;
42
- const getAccessGuardTagType = (value) => (accessGuards.find((guard) => guard.value === value)?.tagType ||
43
- 'default');
44
- // ── Roles ─────────────────────────────────────────────────────────────────
45
- const getRoleName = (roles, id) => {
46
- return roles?.find((r) => r.id === id)?.name || t('undefined');
47
- };
48
- return {
49
- accessGuards,
50
- getAccessGuardLabel,
51
- getAccessGuardTagType,
52
- getRoleName,
53
- isPermissionNative,
54
- userIsSuperAdmin,
55
- userCan,
56
- userIs,
57
- };
58
- };
@@ -1,12 +0,0 @@
1
- export declare const useCoreBridge: () => {
2
- locale: string | undefined;
3
- env: Readonly<import("@creopse/utils").EnvData> | undefined;
4
- appConfig: Readonly<import("@creopse/utils").AppConfig> | undefined;
5
- api: import("@creopse/utils").Api;
6
- i18n: import("@creopse/utils").BridgeI18n;
7
- router: import("@creopse/utils").BridgeRouter;
8
- helpers: import("@creopse/utils").BridgeHelpers;
9
- auth: import("@creopse/utils").BridgeStore<import("@creopse/utils").BridgeAuthState>;
10
- server: import("@creopse/utils").BridgeStore<import("@creopse/utils").BridgeServerState>;
11
- ui: import("@creopse/utils").BridgeStore<import("@creopse/utils").UserInterfaceState>;
12
- };
@@ -1,15 +0,0 @@
1
- export const useCoreBridge = () => {
2
- const { sharedData, api, i18n, router, helpers, stores } = window.__creopse__;
3
- return {
4
- locale: sharedData?.locale,
5
- env: sharedData?.env,
6
- appConfig: sharedData?.appConfig,
7
- api,
8
- i18n,
9
- router,
10
- helpers,
11
- auth: stores.auth,
12
- server: stores.server,
13
- ui: stores.ui,
14
- };
15
- };
@@ -1,15 +0,0 @@
1
- export declare const useResponsive: () => {
2
- is2XlScreen: import("vue").Ref<boolean, boolean>;
3
- isXlScreen: import("vue").Ref<boolean, boolean>;
4
- isLgScreen: import("vue").Ref<boolean, boolean>;
5
- isMdScreen: import("vue").Ref<boolean, boolean>;
6
- isSmScreen: import("vue").Ref<boolean, boolean>;
7
- fromSm: import("vue").Ref<boolean, boolean>;
8
- fromMd: import("vue").Ref<boolean, boolean>;
9
- fromLg: import("vue").Ref<boolean, boolean>;
10
- fromXl: import("vue").Ref<boolean, boolean>;
11
- from2Xl: import("vue").Ref<boolean, boolean>;
12
- isMobile: import("vue").ComputedRef<boolean>;
13
- isTablet: import("vue").ComputedRef<boolean>;
14
- isDesktop: import("vue").ComputedRef<boolean>;
15
- };
@@ -1,35 +0,0 @@
1
- import { useMediaQuery } from '@vueuse/core';
2
- import { computed } from 'vue';
3
- export const useResponsive = () => {
4
- // ── Approach (closed ranks) ─────────────────────────────
5
- const is2XlScreen = useMediaQuery('(min-width: 1536px)');
6
- const isXlScreen = useMediaQuery('(min-width: 1280px) and (max-width: 1535px)');
7
- const isLgScreen = useMediaQuery('(min-width: 1024px) and (max-width: 1279px)');
8
- const isMdScreen = useMediaQuery('(min-width: 768px) and (max-width: 1023px)');
9
- const isSmScreen = useMediaQuery('(max-width: 767px)');
10
- // ── Approach (min-width, mobile-first) ────────────────────
11
- const fromSm = useMediaQuery('(min-width: 640px)');
12
- const fromMd = useMediaQuery('(min-width: 768px)');
13
- const fromLg = useMediaQuery('(min-width: 1024px)');
14
- const fromXl = useMediaQuery('(min-width: 1280px)');
15
- const from2Xl = useMediaQuery('(min-width: 1536px)');
16
- // ── Semantic aliases ────────
17
- const isMobile = computed(() => !fromMd.value);
18
- const isTablet = computed(() => fromMd.value && !fromLg.value);
19
- const isDesktop = computed(() => fromLg.value);
20
- return {
21
- is2XlScreen,
22
- isXlScreen,
23
- isLgScreen,
24
- isMdScreen,
25
- isSmScreen,
26
- fromSm,
27
- fromMd,
28
- fromLg,
29
- fromXl,
30
- from2Xl,
31
- isMobile,
32
- isTablet,
33
- isDesktop,
34
- };
35
- };
@@ -1,12 +0,0 @@
1
- import { Bool, UserPrefs } from '@creopse/utils';
2
- export declare const useUserPreference: () => {
3
- defaultPrefs: import("vue").Ref<{
4
- inAppNotifEnabled?: Bool | undefined;
5
- emailNotifEnabled?: Bool | undefined;
6
- locale?: string | undefined;
7
- }, UserPrefs | {
8
- inAppNotifEnabled?: Bool | undefined;
9
- emailNotifEnabled?: Bool | undefined;
10
- locale?: string | undefined;
11
- }>;
12
- };
@@ -1,14 +0,0 @@
1
- import { Bool } from '@creopse/utils';
2
- import { ref } from 'vue';
3
- import { useI18n } from 'vue-i18n';
4
- export const useUserPreference = () => {
5
- const { locale } = useI18n();
6
- const defaultPrefs = ref({
7
- inAppNotifEnabled: Bool.TRUE,
8
- emailNotifEnabled: Bool.TRUE,
9
- locale: locale.value,
10
- });
11
- return {
12
- defaultPrefs,
13
- };
14
- };