@creopse/vue 0.0.17 → 0.0.19

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@creopse/vue",
3
3
  "description": "Creopse Vue Toolkit",
4
- "version": "0.0.17",
4
+ "version": "0.0.19",
5
5
  "private": false,
6
6
  "author": "Noé Gnanih <noegnanih@gmail.com>",
7
7
  "license": "MIT",
@@ -13,7 +13,7 @@ import type { Payload } from '@/types/api';
13
13
  * - `handleError`: Handles an error from the API.
14
14
  */
15
15
  export declare const useApi: () => {
16
- request: (payload: Payload) => Promise<any>;
16
+ request: (payload: Payload, accessToken?: string, accessForbiddenCallback?: () => void) => Promise<any>;
17
17
  getItem: (payload: Payload) => Promise<{
18
18
  success: boolean;
19
19
  failure: boolean;
@@ -10,14 +10,13 @@ export declare const useHelper: () => {
10
10
  isLgScreen: globalThis.ComputedRef<boolean>;
11
11
  isMdScreen: globalThis.ComputedRef<boolean>;
12
12
  isSmScreen: globalThis.ComputedRef<boolean>;
13
- getTranslation: (data: any) => string;
13
+ getTranslation: (data: any, lang: string) => string;
14
14
  getLangageLabel: (value: string) => string | undefined;
15
15
  getLanguageValue: (label: string) => string | undefined;
16
16
  getLinkCursorClass: (url: string) => "tw:cursor-default" | "tw:cursor-pointer";
17
17
  ckEditorToolbarItems: string[];
18
18
  displayFormErrors: (errors: any, displayError: (message: string) => void) => void;
19
- resolveHtmlLinks: (data: string | null | undefined) => string;
20
- pickByTheme: (lightVal: string | number | null, darkVal: string | number | null) => string | number | null;
19
+ resolveHtmlLinks: (data: string | null | undefined, lang: string) => string;
21
20
  resolveUrl: (path: string) => string;
22
21
  updateLang: (val: string, reload?: boolean, updateUserPrefs?: boolean) => Promise<void>;
23
22
  languages: Language[];
@@ -27,6 +26,6 @@ export declare const useHelper: () => {
27
26
  openLink: (str: string) => void;
28
27
  openMenu: (menu?: MenuItemModel) => void;
29
28
  getMenuHref: (menu: MenuItemModel) => string;
30
- rHtml: (data: string | null | undefined) => string;
31
- tr: (data: any) => string;
29
+ rHtml: (data: string | null | undefined, lang: string) => string;
30
+ tr: (data: any, lang: string) => string;
32
31
  };
@@ -1,4 +1,5 @@
1
1
  declare const PropsSymbol: unique symbol;
2
2
  declare const ConfigSymbol: unique symbol;
3
+ declare const RouterSymbol: unique symbol;
3
4
  declare const ResolveSectionsSymbol: unique symbol;
4
- export { PropsSymbol, ConfigSymbol, ResolveSectionsSymbol };
5
+ export { PropsSymbol, ConfigSymbol, RouterSymbol, ResolveSectionsSymbol };
package/types/index.d.ts CHANGED
@@ -16,7 +16,6 @@ export { useConfig } from './composables/config';
16
16
  export { useHelper } from './composables/helper';
17
17
  export { useContent } from './composables/content';
18
18
  export { useNewsletter } from './composables/newsletter';
19
- export { useUserPreference } from './composables/user-preference';
20
19
  export type { PropsManager };
21
20
  export { RootContainer, CustomTransition, MountedTeleport, StickyBottom, StickyTop, ReadMore, AsyncImg, Image, };
22
21
  export type { PluginOptions };
@@ -1,3 +1,4 @@
1
+ import type { Router } from '@inertiajs/core';
1
2
  export interface PluginConfig {
2
3
  debug: boolean;
3
4
  appUrl: string;
@@ -7,9 +8,7 @@ export interface PluginConfig {
7
8
  }
8
9
  export interface PluginOptions {
9
10
  initialProps: Record<string, any>;
10
- router?: {
11
- on: (event: string, callback: (e: any) => void) => void;
12
- };
11
+ router?: Router;
13
12
  resolveSections: () => Record<string, unknown>;
14
13
  config: PluginConfig;
15
14
  }
@@ -1,26 +0,0 @@
1
- import { Bool, type UserPrefs } from '@creopse/utils';
2
- /**
3
- * A composable that exposes the default user preferences.
4
- *
5
- * @returns An object containing the `defaultPrefs` property, which is a reactive
6
- * ref to the default user preferences.
7
- *
8
- * The `defaultPrefs` object contains the following properties:
9
- *
10
- * - `inAppNotifEnabled`: A boolean indicating whether in-app notifications are
11
- * enabled by default.
12
- * - `emailNotifEnabled`: A boolean indicating whether email notifications are
13
- * enabled by default.
14
- * - `locale`: The user's preferred locale.
15
- */
16
- export declare const useUserPreference: () => {
17
- defaultPrefs: globalThis.Ref<{
18
- inAppNotifEnabled?: Bool | undefined;
19
- emailNotifEnabled?: Bool | undefined;
20
- locale?: string | undefined;
21
- }, UserPrefs | {
22
- inAppNotifEnabled?: Bool | undefined;
23
- emailNotifEnabled?: Bool | undefined;
24
- locale?: string | undefined;
25
- }>;
26
- };