v-onboarding 2.8.0 → 2.8.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.
@@ -0,0 +1,75 @@
1
+ import type { createPopper } from "@popperjs/core/lib/createPopper";
2
+ import type { DefineComponent } from 'vue';
3
+ declare const VOnboardingWrapper: DefineComponent<{
4
+ steps: StepEntity[];
5
+ options?: VOnboardingWrapperOptions;
6
+ }>;
7
+ declare const VOnboardingStep: DefineComponent;
8
+ declare const useVOnboarding: (wrapperRef: any) => {
9
+ start(): void;
10
+ finish(): void;
11
+ goToStep: (newStepNumber: number | ((currentStepNumber: number) => number)) => void;
12
+ };
13
+ interface SvgOverlayOptions {
14
+ enabled?: boolean;
15
+ padding?: number | {
16
+ top?: number;
17
+ right?: number;
18
+ bottom?: number;
19
+ left?: number;
20
+ };
21
+ borderRadius?: number | {
22
+ leftTop?: number;
23
+ rightTop?: number;
24
+ rightBottom?: number;
25
+ leftBottom?: number;
26
+ };
27
+ preventOverlayInteraction?: boolean;
28
+ }
29
+ interface VOnboardingWrapperOptions {
30
+ popper?: Parameters<typeof createPopper>[2];
31
+ overlay?: SvgOverlayOptions;
32
+ scrollToStep?: {
33
+ enabled?: boolean;
34
+ options?: ScrollIntoViewOptions;
35
+ };
36
+ autoFinishByExit?: boolean;
37
+ hideButtons?: {
38
+ previous?: boolean;
39
+ next?: boolean;
40
+ exit?: boolean;
41
+ };
42
+ labels?: {
43
+ previousButton?: string;
44
+ nextButton?: string;
45
+ finishButton?: string;
46
+ };
47
+ hideNextStepDuringHook?: boolean;
48
+ }
49
+ declare type AttachableElement = string | (() => Element | null);
50
+ interface onGlobalOptions {
51
+ index: number;
52
+ step: StepEntity;
53
+ direction: 1 | -1 | number;
54
+ isForward: boolean;
55
+ isBackward: boolean;
56
+ }
57
+ declare type onBeforeStepOptions = onGlobalOptions & {};
58
+ declare type onAfterStepOptions = onGlobalOptions & {};
59
+ interface StepEntity {
60
+ content: {
61
+ title: string;
62
+ description?: string;
63
+ html?: boolean;
64
+ };
65
+ on?: {
66
+ beforeStep?: (options?: onBeforeStepOptions) => void | Promise<void>;
67
+ afterStep?: (options?: onAfterStepOptions) => void | Promise<void>;
68
+ };
69
+ attachTo: {
70
+ element: AttachableElement;
71
+ classList?: string[];
72
+ };
73
+ options?: VOnboardingWrapperOptions;
74
+ }
75
+ export { VOnboardingWrapperOptions, VOnboardingWrapper, VOnboardingStep, useVOnboarding, AttachableElement, StepEntity, onBeforeStepOptions, onAfterStepOptions, SvgOverlayOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v-onboarding",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "v-onboarding is a super-slim, fully-typed onboarding component for Vue 3",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,11 +22,9 @@
22
22
  ],
23
23
  "files": [
24
24
  "dist",
25
- "src/types/*",
26
- "src/typings.d.ts",
27
25
  "web-types"
28
26
  ],
29
- "types": "src/typings.d.ts",
27
+ "types": "./dist/index.d.ts",
30
28
  "main": "./dist/v-onboarding.umd.js",
31
29
  "module": "./dist/v-onboarding.es.js",
32
30
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "v-onboarding",
4
- "version": "1.1.0",
4
+ "version": "2.8.1",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -1,34 +0,0 @@
1
- import { VOnboardingWrapperOptions } from "@/types/VOnboardingWrapper";
2
-
3
- export type AttachableElement = string | (() => Element | null)
4
-
5
- interface onGlobalOptions {
6
- index: number
7
- step: StepEntity
8
- direction: 1 | -1 | number
9
- isForward: boolean
10
- isBackward: boolean
11
- }
12
- export type onBeforeStepOptions = onGlobalOptions & {
13
- // custom options here
14
- }
15
- export type onAfterStepOptions = onGlobalOptions & {
16
- // custom options here
17
- }
18
-
19
- export interface StepEntity {
20
- content: {
21
- title: string;
22
- description?: string;
23
- html?: boolean
24
- }
25
- on?: {
26
- beforeStep?: (options?: onBeforeStepOptions) => void | Promise<void>
27
- afterStep?: (options?: onAfterStepOptions) => void | Promise<void>
28
- },
29
- attachTo: {
30
- element: AttachableElement,
31
- classList?: string[]
32
- }
33
- options?: VOnboardingWrapperOptions
34
- }
@@ -1,69 +0,0 @@
1
- import type { createPopper } from "@popperjs/core/lib/createPopper";
2
-
3
- export interface SvgOverlayOptions {
4
- enabled?: boolean
5
- padding?: number | {
6
- top?: number;
7
- right?: number;
8
- bottom?: number;
9
- left?: number;
10
- }
11
- borderRadius?: number | {
12
- leftTop?: number;
13
- rightTop?: number;
14
- rightBottom?: number;
15
- leftBottom?: number;
16
- }
17
- preventOverlayInteraction?: boolean
18
- }
19
-
20
- export interface VOnboardingWrapperOptions {
21
- popper?: Parameters<typeof createPopper>[2]
22
- overlay?: SvgOverlayOptions,
23
- scrollToStep?: {
24
- enabled?: boolean
25
- options?: ScrollIntoViewOptions
26
- },
27
- autoFinishByExit?: boolean
28
- hideButtons?: {
29
- previous?: boolean
30
- next?: boolean
31
- exit?: boolean
32
- },
33
- labels?: {
34
- previousButton?: string
35
- nextButton?: string
36
- finishButton?: string
37
- }
38
- hideNextStepDuringHook?: boolean
39
- }
40
-
41
- export const defaultVOnboardingWrapperOptions: VOnboardingWrapperOptions = {
42
- popper: {},
43
- overlay: {
44
- enabled: true,
45
- padding: 0,
46
- borderRadius: 0,
47
- preventOverlayInteraction: true
48
- },
49
- scrollToStep: {
50
- enabled: true,
51
- options: {
52
- behavior: 'smooth',
53
- block: 'center',
54
- inline: 'center'
55
- }
56
- },
57
- autoFinishByExit: true,
58
- labels: {
59
- previousButton: 'Previous',
60
- nextButton: 'Next',
61
- finishButton: 'Finish'
62
- },
63
- hideButtons: {
64
- previous: false,
65
- next: false,
66
- exit: false
67
- },
68
- hideNextStepDuringHook: false
69
- }
@@ -1,26 +0,0 @@
1
- import { ComputedRef, InjectionKey, Ref } from "vue";
2
- import { StepEntity } from "./StepEntity";
3
- import { VOnboardingWrapperOptions } from "./VOnboardingWrapper";
4
-
5
- export interface OnboardingState {
6
- step: ComputedRef<StepEntity>;
7
- options: ComputedRef<VOnboardingWrapperOptions>;
8
- next: () => void;
9
- previous: () => void;
10
- finish: () => void;
11
- exit: () => void;
12
- isFirstStep: ComputedRef<boolean>;
13
- isLastStep: ComputedRef<boolean>;
14
-
15
- }
16
- export const STATE_INJECT_KEY = Symbol('onboardingState') as InjectionKey<Ref<OnboardingState>>
17
-
18
- export const OnboardingState = {
19
- IDLE: -1,
20
- FINISHED: -2
21
- }
22
-
23
- export const Direction = {
24
- BACKWARD: -1,
25
- FORWARD: 1
26
- }
package/src/typings.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import { DefineComponent } from 'vue'
2
- import { StepEntity } from '@/types/StepEntity'
3
- import { VOnboardingWrapperOptions } from '@/types/VOnboardingWrapper'
4
-
5
- declare const VOnboardingWrapper: DefineComponent<{
6
- steps: StepEntity[]
7
- options?: VOnboardingWrapperOptions
8
- }>
9
-
10
- declare const VOnboardingStep: DefineComponent
11
-
12
- declare const useVOnboarding: (wrapperRef: any) => {
13
- start(): void
14
- finish(): void
15
- goToStep: (newStepNumber: number | ((currentStepNumber: number) => number)) => void
16
- }
17
-
18
- export { VOnboardingWrapperOptions, VOnboardingWrapper, VOnboardingStep, useVOnboarding }