@creopse/vue 0.0.8 → 0.0.10

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.8",
4
+ "version": "0.0.10",
5
5
  "private": false,
6
6
  "author": "Noé Gnanih <noegnanih@gmail.com>",
7
7
  "license": "MIT",
@@ -28,7 +28,7 @@
28
28
  "dev-types": "vue-tsc --noEmit -p tsconfig.app.json --watch",
29
29
  "build": "pnpm build-lib && pnpm build-types",
30
30
  "build-lib": "vite build",
31
- "build-types": "rm -f *.tsbuildinfo && vue-tsc --emitDeclarationOnly --declaration -p tsconfig.app.json",
31
+ "build-types": "rm -f *.tsbuildinfo && rm -rf types && vue-tsc --emitDeclarationOnly --declaration -p tsconfig.app.json",
32
32
  "lint": "eslint 'src/**/*.{ts,vue}'"
33
33
  },
34
34
  "peerDependencies": {
@@ -64,4 +64,4 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  }
67
- }
67
+ }
@@ -0,0 +1,15 @@
1
+ interface Props {
2
+ to: string;
3
+ }
4
+ declare var __VLS_5: {};
5
+ type __VLS_Slots = {} & {
6
+ default?: (props: typeof __VLS_5) => any;
7
+ };
8
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
10
+ export default _default;
11
+ type __VLS_WithSlots<T, S> = T & {
12
+ new (): {
13
+ $slots: S;
14
+ };
15
+ };
@@ -0,0 +1,14 @@
1
+ interface Props {
2
+ moreStr?: string;
3
+ lessStr?: string;
4
+ text: string;
5
+ link?: string;
6
+ maxChars?: number;
7
+ }
8
+ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
9
+ link: string;
10
+ moreStr: string;
11
+ lessStr: string;
12
+ maxChars: number;
13
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ export default _default;
@@ -0,0 +1,21 @@
1
+ interface Props {
2
+ bottom?: number;
3
+ zIndex?: number;
4
+ className?: string;
5
+ }
6
+ declare var __VLS_1: {};
7
+ type __VLS_Slots = {} & {
8
+ default?: (props: typeof __VLS_1) => any;
9
+ };
10
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
11
+ bottom: number;
12
+ zIndex: number;
13
+ className: string;
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
16
+ export default _default;
17
+ type __VLS_WithSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
@@ -0,0 +1,21 @@
1
+ interface Props {
2
+ top?: number;
3
+ zIndex?: number;
4
+ className?: string;
5
+ }
6
+ declare var __VLS_1: {};
7
+ type __VLS_Slots = {} & {
8
+ default?: (props: typeof __VLS_1) => any;
9
+ };
10
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
11
+ zIndex: number;
12
+ className: string;
13
+ top: number;
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
16
+ export default _default;
17
+ type __VLS_WithSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
package/types/index.d.ts CHANGED
@@ -1,9 +1,12 @@
1
1
  import type { App } from 'vue';
2
2
  import AsyncImg from './components/widgets/AsyncImg.vue';
3
3
  import CustomTransition from './components/widgets/CustomTransition.vue';
4
- import SvgComponent from './components/widgets/SvgComponent.vue';
4
+ import MountedTeleport from './components/widgets/MountedTeleport.vue';
5
+ import ReadMore from './components/widgets/ReadMore.vue';
6
+ import StickyBottom from './components/widgets/StickyBottom.vue';
7
+ import StickyTop from './components/widgets/StickyTop.vue';
5
8
  declare const plugin: {
6
9
  install(app: App): void;
7
10
  };
8
- export { CustomTransition, SvgComponent, AsyncImg };
11
+ export { CustomTransition, MountedTeleport, StickyBottom, StickyTop, ReadMore, AsyncImg, };
9
12
  export default plugin;
@@ -1,23 +0,0 @@
1
- import type { CSSProperties } from 'vue';
2
- interface Props {
3
- src: string;
4
- alt?: string;
5
- width?: string | number;
6
- height?: string | number;
7
- title?: string;
8
- loading?: 'lazy' | 'eager';
9
- style?: CSSProperties;
10
- size?: 'small' | 'medium' | 'large' | 'original';
11
- sync?: boolean;
12
- }
13
- declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
14
- alt: string;
15
- width: string | number;
16
- height: string | number;
17
- title: string;
18
- loading: "lazy" | "eager";
19
- style: CSSProperties;
20
- size: "small" | "medium" | "large" | "original";
21
- sync: boolean;
22
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
- export default _default;
@@ -1,5 +0,0 @@
1
- interface Props {
2
- path: string;
3
- }
4
- declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
- export default _default;
@@ -1,57 +0,0 @@
1
- type Method = 'get' | 'post' | 'put' | 'delete';
2
- interface Payload {
3
- method?: Method;
4
- routeBase?: string;
5
- params?: object;
6
- data?: object;
7
- url?: string;
8
- id?: string;
9
- }
10
- /**
11
- * This composable is used to make API requests.
12
- *
13
- * @function useApi
14
- * @returns {Object} An object containing the following methods:
15
- * - `request`: Makes an API request with the given payload.
16
- * - `addItem`: Adds an item to the API.
17
- * - `deleteItem`: Deletes an item from the API.
18
- * - `updateItem`: Updates an item in the API.
19
- * - `getAllItems`: Gets all items from the API.
20
- * - `getItem`: Gets an item from the API.
21
- * - `handleError`: Handles an error from the API.
22
- */
23
- export declare const useApi: () => {
24
- request: (payload: Payload) => Promise<any>;
25
- getItem: (payload: Payload) => Promise<{
26
- success: boolean;
27
- failure: boolean;
28
- result: any;
29
- error: any;
30
- }>;
31
- addItem: (payload: Payload) => Promise<{
32
- success: boolean;
33
- failure: boolean;
34
- result: any;
35
- error: any;
36
- }>;
37
- updateItem: (payload: Payload) => Promise<{
38
- success: boolean;
39
- failure: boolean;
40
- result: any;
41
- error: any;
42
- }>;
43
- deleteItem: (payload: Payload) => Promise<{
44
- success: boolean;
45
- failure: boolean;
46
- result: any;
47
- error: any;
48
- }>;
49
- getAllItems: (payload: Payload) => Promise<{
50
- success: boolean;
51
- failure: boolean;
52
- result: any;
53
- error: any;
54
- }>;
55
- handleError: (error: any) => void;
56
- };
57
- export {};
@@ -1,51 +0,0 @@
1
- import type { AppInformationKey, ContentModelItemModel, ContentModelModel, MenuItemGroupModel, MenuItemModel, MenuModel, NewsArticleModel, NewsCategoryModel, NewsTagModel, PageModel, SectionModel, SettingType, SharedProps } from '@creopse/utils';
2
- import type { ErrorBag, Errors, PageProps } from '@inertiajs/core';
3
- /**
4
- * A composable that provides a set of functions and properties for
5
- * easily accessing and manipulating page data, content models, menus,
6
- * menu items, and more.
7
- *
8
- * @returns {Object}
9
- */
10
- export declare const useContent: () => {
11
- logo: globalThis.ComputedRef<string>;
12
- icon: globalThis.ComputedRef<string>;
13
- page: import("@inertiajs/core").Page<SharedProps>;
14
- pageData: PageModel | null;
15
- newsArticle: NewsArticleModel | undefined;
16
- newsCategory: NewsCategoryModel | undefined;
17
- newsTag: NewsTagModel | undefined;
18
- contentModelItem: ContentModelItemModel | undefined;
19
- getProps: () => PageProps & SharedProps & {
20
- errors: Errors & ErrorBag;
21
- };
22
- getMenu: (name: string, filterByIsActive?: boolean) => MenuModel | undefined;
23
- getMenuByLocation: (name: string, filterByIsActive?: boolean) => MenuModel | undefined;
24
- getMenuItems: (name: string, filterByIsVisible?: boolean) => MenuItemModel[] | undefined;
25
- getMenuItemById: (id: number) => MenuItemModel | undefined;
26
- getMenuItemsByLocation: (name: string, filterByIsVisible?: boolean) => MenuItemModel[] | undefined;
27
- getMenuGroups: (name: string, byLocation?: boolean, filterByIsVisible?: boolean) => MenuItemGroupModel[];
28
- getMenuItemsByGroup: (name: string, groupId: number, byLocation?: boolean, filterByIsVisible?: boolean) => MenuItemModel[] | undefined;
29
- getMenuGroupedItems: (name: string, byLocation?: boolean, filterByIsVisible?: boolean) => {
30
- group: MenuItemGroupModel;
31
- items: MenuItemModel[] | undefined;
32
- }[];
33
- getMenuUngroupedItems: (name: string, byLocation?: boolean, filterByIsVisible?: boolean) => MenuItemModel[] | undefined;
34
- getSectionData: (slug: string) => object | any | null;
35
- getAnySectionData: (sectionSlug: string, pageSlug: string) => Promise<any>;
36
- getSectionsInOrder: () => SectionModel[];
37
- getFinalPageSections: () => SectionModel[];
38
- getSectionRootData: (slug: string) => any;
39
- getComponents: () => Record<string, any>;
40
- getContentModel: (name: string) => ContentModelModel | undefined;
41
- getContentModelItems: (name: string, filterByIsActive?: boolean) => Promise<ContentModelItemModel[]>;
42
- getPaginatedContentModelItems: (name: string, pageSize: number, filterByIsActive?: boolean) => Promise<{
43
- items: ContentModelItemModel[];
44
- total: number;
45
- currentPage: number;
46
- }>;
47
- getAppInformationValue: (key: AppInformationKey, type?: SettingType) => any;
48
- appAccentColor: globalThis.ComputedRef<string>;
49
- appPrimaryColor: globalThis.ComputedRef<string>;
50
- appSecondaryColor: globalThis.ComputedRef<string>;
51
- };
@@ -1,29 +0,0 @@
1
- import { type Language } from '@creopse/utils';
2
- /**
3
- * Returns a collection of helper functions and values.
4
- *
5
- * @returns {Object}
6
- */
7
- export declare const useHelper: () => {
8
- is2XlScreen: globalThis.ComputedRef<boolean>;
9
- isXlScreen: globalThis.ComputedRef<boolean>;
10
- isLgScreen: globalThis.ComputedRef<boolean>;
11
- isMdScreen: globalThis.ComputedRef<boolean>;
12
- isSmScreen: globalThis.ComputedRef<boolean>;
13
- getTranslation: (data: any) => string;
14
- getLangageLabel: (value: string) => string | undefined;
15
- getLanguageValue: (label: string) => string | undefined;
16
- getLinkCursorClass: (url: string) => "tw-cursor-default" | "tw-cursor-pointer";
17
- ckEditorToolbarItems: string[];
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;
21
- resolveUrl: (path: string) => string;
22
- updateLang: (val: string, reload?: boolean, updateUserPrefs?: boolean) => Promise<void>;
23
- languages: Language[];
24
- getImage: (path: string, size?: "small" | "medium" | "large" | "original") => Promise<string>;
25
- fileUrl: (path: string) => string;
26
- currentRoutePath: globalThis.ComputedRef<string>;
27
- rHtml: (data: string | null | undefined) => string;
28
- tr: (data: any) => string;
29
- };
@@ -1,29 +0,0 @@
1
- /**
2
- * A composable that exposes functions to subscribe the user to the newsletter using
3
- * email or phone.
4
- *
5
- * @returns An object containing the subscribeEmail, subscribePhone, and isLoading
6
- * properties.
7
- *
8
- * @remarks
9
- * The subscribeEmail and subscribePhone functions are asynchronous and return nothing.
10
- * The isLoading property is a boolean that indicates whether a subscription request is
11
- * being processed.
12
- *
13
- * The subscribeEmail function takes an email address and an optional success callback.
14
- * The subscribePhone function takes a phone number and an optional success callback.
15
- *
16
- * If the request is successful, the user will be subscribed to the newsletter and the
17
- * success callback will be called. If the request fails, an appropriate error message
18
- * will be displayed to the user.
19
- *
20
- * The error messages are as follows:
21
- * - If the request is invalid, the form errors will be displayed.
22
- * - If the request is valid but results in an error, a generic error message will be
23
- * displayed.
24
- */
25
- export declare const useNewsletter: () => {
26
- subscribePhone: (phone: string, displayFormError: (message: string) => void, successCallback?: (() => void) | undefined, failureCallback?: (() => void) | undefined) => Promise<void>;
27
- subscribeEmail: (email: string, displayFormError: (message: string) => void, successCallback?: (() => void) | undefined, failureCallback?: (() => void) | undefined) => Promise<void>;
28
- isLoading: globalThis.Ref<boolean, boolean>;
29
- };
@@ -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
- };
@@ -1,7 +0,0 @@
1
- export declare var API_BASE_URL: string;
2
- export declare var API_URL: string;
3
- export declare const API_REQUEST_HEADERS: {
4
- 'X-API-Key': any;
5
- };
6
- export declare const LANG_COOKIE = "Lang";
7
- export declare const ENCRYPTION_KEY = "fb8c9dd4-fef4-4b88-a9b8-fe5725f9e0c1";
@@ -1,12 +0,0 @@
1
- declare var __VLS_6: {};
2
- type __VLS_Slots = {} & {
3
- default?: (props: typeof __VLS_6) => any;
4
- };
5
- declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
7
- export default _default;
8
- type __VLS_WithSlots<T, S> = T & {
9
- new (): {
10
- $slots: S;
11
- };
12
- };
@@ -1,12 +0,0 @@
1
- declare var __VLS_1: {};
2
- type __VLS_Slots = {} & {
3
- default?: (props: typeof __VLS_1) => any;
4
- };
5
- declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
7
- export default _default;
8
- type __VLS_WithSlots<T, S> = T & {
9
- new (): {
10
- $slots: S;
11
- };
12
- };
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
- export default _default;
@@ -1,14 +0,0 @@
1
- import type { UserModel } from '@creopse/utils';
2
- export interface AuthState {
3
- userData: UserModel | null;
4
- rememberMe: boolean;
5
- accessToken: string | null;
6
- accessTokenDate: number | null;
7
- }
8
- export declare const useAuthStore: import("pinia").StoreDefinition<"auth", AuthState, {
9
- isUserConnected(state: AuthState): boolean;
10
- getUserData(state: AuthState): UserModel | null;
11
- }, {
12
- resetAuthData(): void;
13
- reloadUserData(): Promise<void>;
14
- }>;
@@ -1,7 +0,0 @@
1
- declare module 'pinia' {
2
- interface PiniaCustomProperties {
3
- router: any;
4
- }
5
- }
6
- declare const _default: import("pinia").Pinia;
7
- export default _default;