@formriff/onboarding-vue 0.0.0-stage → 0.1.2
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/LICENSE +22 -0
- package/README.md +164 -2
- package/dist/index.cjs +141 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +41 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +123 -0
- package/dist/index.js.map +1 -0
- package/package.json +48 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Onboarding Kit contributors
|
|
4
|
+
Copyright (c) 2026 Zero
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,165 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @formriff/onboarding-vue
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Vue 3.3+ bindings for Onboarding Kit. MIT. No eager `vue-router` dependency.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add @formriff/onboarding-vue @formriff/onboarding vue
|
|
9
|
+
# or
|
|
10
|
+
npm install @formriff/onboarding-vue @formriff/onboarding vue
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Import **core CSS separately**, once in the application entry:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import '@formriff/onboarding/styles.css';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Minimal usage: plugin + composable
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { createApp } from 'vue';
|
|
23
|
+
import { createOnboardingPlugin } from '@formriff/onboarding-vue';
|
|
24
|
+
import { localStorageAdapter } from '@formriff/onboarding';
|
|
25
|
+
import App from './App.vue';
|
|
26
|
+
import '@formriff/onboarding/styles.css';
|
|
27
|
+
|
|
28
|
+
createApp(App)
|
|
29
|
+
.use(
|
|
30
|
+
createOnboardingPlugin({
|
|
31
|
+
storage: localStorageAdapter('my-app'),
|
|
32
|
+
tours: [
|
|
33
|
+
{
|
|
34
|
+
id: 'onboarding',
|
|
35
|
+
steps: [
|
|
36
|
+
{
|
|
37
|
+
id: 'welcome',
|
|
38
|
+
target: '[data-onboarding="welcome"]',
|
|
39
|
+
title: 'Welcome',
|
|
40
|
+
content: 'Everything starts here.',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
}),
|
|
46
|
+
)
|
|
47
|
+
.mount('#app');
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```vue
|
|
51
|
+
<script setup lang="ts">
|
|
52
|
+
import { useOnboarding } from '@formriff/onboarding-vue';
|
|
53
|
+
const { kit, state } = useOnboarding();
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<template>
|
|
57
|
+
<section v-onboarding-step="'welcome'">Your workspace</section>
|
|
58
|
+
<button @click="kit.start('onboarding')">Start onboarding</button>
|
|
59
|
+
<output>{{ state.status }}</output>
|
|
60
|
+
</template>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`useOnboarding()` returns `{ kit, state }`, where `state` is a computed ref of
|
|
64
|
+
deeply read-only snapshots (use `state.value` in JavaScript).
|
|
65
|
+
It requires a provider or the plugin.
|
|
66
|
+
The plugin registers `v-onboarding-step`; the directive maintains a
|
|
67
|
+
`data-onboarding` attribute without changing children. Its SSR hook emits the
|
|
68
|
+
same attribute on the server. For local registration in `<script setup>`,
|
|
69
|
+
import `vOnboardingStep` directly.
|
|
70
|
+
|
|
71
|
+
## Component provider / scoped slots
|
|
72
|
+
|
|
73
|
+
Use the component instead of the plugin to scope a kit to a subtree:
|
|
74
|
+
|
|
75
|
+
```vue
|
|
76
|
+
<script setup lang="ts">
|
|
77
|
+
import { OnboardingProvider, vOnboardingStep } from '@formriff/onboarding-vue';
|
|
78
|
+
import type { OnboardingOptions } from '@formriff/onboarding';
|
|
79
|
+
const options: OnboardingOptions = {
|
|
80
|
+
tours: [
|
|
81
|
+
{
|
|
82
|
+
id: 'onboarding',
|
|
83
|
+
steps: [{ id: 'welcome', title: 'Welcome', content: 'A new beginning.' }],
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
};
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<template>
|
|
90
|
+
<OnboardingProvider :options="options">
|
|
91
|
+
<template #default="{ kit, state }">
|
|
92
|
+
<section v-onboarding-step="'welcome'">Your workspace</section>
|
|
93
|
+
<button @click="kit.start('onboarding')">Start onboarding</button>
|
|
94
|
+
<output>{{ state.status }}</output>
|
|
95
|
+
</template>
|
|
96
|
+
<template #step="{ kit, state, labels }">
|
|
97
|
+
<aside :aria-label="state.step?.title">
|
|
98
|
+
<h2>{{ state.step?.title }}</h2>
|
|
99
|
+
<p>
|
|
100
|
+
<strong>{{ state.step?.content }}</strong>
|
|
101
|
+
</p>
|
|
102
|
+
<button @click="kit.skip()">{{ labels.skip }}</button>
|
|
103
|
+
<button :disabled="state.stepIndex === 0" @click="kit.prev()">
|
|
104
|
+
{{ labels.back }}
|
|
105
|
+
</button>
|
|
106
|
+
<button @click="kit.next()">
|
|
107
|
+
{{ state.stepIndex === state.totalSteps - 1 ? labels.done : labels.next }}
|
|
108
|
+
</button>
|
|
109
|
+
</aside>
|
|
110
|
+
</template>
|
|
111
|
+
</OnboardingProvider>
|
|
112
|
+
</template>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Both slots receive the core renderer context `{ kit, state, labels }`, where
|
|
116
|
+
slot `state` is the snapshot, not a ref. The default slot always renders, so
|
|
117
|
+
targets exist before a tour starts. `#step` renders only while running and
|
|
118
|
+
automatically selects `renderer: 'none'` for an owned kit. Use a `Teleport` for
|
|
119
|
+
an overlay if desired. You own positioning, focus and dialog/focus-trap
|
|
120
|
+
semantics; core handles headless keyboard shortcuts.
|
|
121
|
+
|
|
122
|
+
Alternatively use `renderer: 'none'` and render from `useOnboarding()` elsewhere.
|
|
123
|
+
Pass `:kit="existingKit"` instead of `:options` to share an existing kit.
|
|
124
|
+
External kits must already have `renderer: 'none'` for custom UI, and their
|
|
125
|
+
slot labels use English defaults. Headless UI need not import core CSS.
|
|
126
|
+
|
|
127
|
+
## Vue Router
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
import { createVueRouterAdapter, createOnboardingPlugin } from '@formriff/onboarding-vue';
|
|
131
|
+
|
|
132
|
+
app.use(router);
|
|
133
|
+
app.use(
|
|
134
|
+
createOnboardingPlugin({
|
|
135
|
+
tours, // steps may specify route: '/' and route: '/settings'
|
|
136
|
+
router: createVueRouterAdapter(router),
|
|
137
|
+
}),
|
|
138
|
+
);
|
|
139
|
+
await router.isReady();
|
|
140
|
+
app.mount('#app');
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The helper uses a structural `currentRoute`, `push`, `afterEach` interface.
|
|
144
|
+
`getPath()` returns `currentRoute.value.path`; subscriptions use actual
|
|
145
|
+
`afterEach` notifications and return its unsubscribe function. It never imports
|
|
146
|
+
`vue-router`. You can also supply any core `RouterAdapter`. Keep the provider
|
|
147
|
+
outside `RouterView`. See `examples/vue`.
|
|
148
|
+
|
|
149
|
+
## SSR and lifecycle
|
|
150
|
+
|
|
151
|
+
Create an app/plugin or component provider **per request**, not an SSR singleton.
|
|
152
|
+
Kit construction is SSR-safe; no mounting or subscription takes place until
|
|
153
|
+
Vue mounts in the browser. Keep initial options/markup deterministic and start
|
|
154
|
+
tours after hydration. The same core can serve a Next.js app via the React
|
|
155
|
+
adapter; see `@formriff/onboarding-react` and `examples/nextjs` for App Router hydration.
|
|
156
|
+
|
|
157
|
+
The provider captures options/kit/labels during setup. Use a different component
|
|
158
|
+
key for new configuration; declare a `#step` slot from the start rather than
|
|
159
|
+
adding it dynamically. The plugin attaches once at the app root's mounted hook.
|
|
160
|
+
Both clean up subscriptions and call the reversible `mount()` cleanup on
|
|
161
|
+
unmount, **not `destroy()`**, so externally owned kits can be reused. Unmounting
|
|
162
|
+
resets active state to idle but retains storage. Give each kit one lifecycle
|
|
163
|
+
owner; many children can consume it. Permanently retiring an external kit is
|
|
164
|
+
the owner's responsibility: call `destroy()` after unmount, and clean up your
|
|
165
|
+
own `kit.on` listeners.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
OnboardingProvider: () => OnboardingProvider,
|
|
24
|
+
createOnboardingPlugin: () => createOnboardingPlugin,
|
|
25
|
+
createVueRouterAdapter: () => createVueRouterAdapter,
|
|
26
|
+
useOnboarding: () => useOnboarding,
|
|
27
|
+
vOnboardingStep: () => vOnboardingStep
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(index_exports);
|
|
30
|
+
var import_vue = require("vue");
|
|
31
|
+
var import_onboarding = require("@formriff/onboarding");
|
|
32
|
+
var onboardingKey = /* @__PURE__ */ Symbol("onboarding");
|
|
33
|
+
function createBinding(kit) {
|
|
34
|
+
const snapshot = (0, import_vue.shallowRef)(kit.getState());
|
|
35
|
+
const context = { kit, state: (0, import_vue.computed)(() => (0, import_vue.readonly)(snapshot.value)) };
|
|
36
|
+
let release;
|
|
37
|
+
return {
|
|
38
|
+
context,
|
|
39
|
+
snapshot,
|
|
40
|
+
mount() {
|
|
41
|
+
if (release) return;
|
|
42
|
+
const unsubscribe = kit.subscribe((state) => {
|
|
43
|
+
snapshot.value = state;
|
|
44
|
+
});
|
|
45
|
+
snapshot.value = kit.getState();
|
|
46
|
+
const unmount = kit.mount();
|
|
47
|
+
release = () => {
|
|
48
|
+
unsubscribe();
|
|
49
|
+
unmount();
|
|
50
|
+
release = void 0;
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
unmount() {
|
|
54
|
+
release?.();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
var vOnboardingStep = {
|
|
59
|
+
mounted: (element, binding) => element.setAttribute("data-onboarding", binding.value),
|
|
60
|
+
updated: (element, binding) => element.setAttribute("data-onboarding", binding.value),
|
|
61
|
+
unmounted: (element) => element.removeAttribute("data-onboarding"),
|
|
62
|
+
getSSRProps: (binding) => ({ "data-onboarding": binding.value })
|
|
63
|
+
};
|
|
64
|
+
function useOnboarding() {
|
|
65
|
+
const context = (0, import_vue.inject)(onboardingKey, null);
|
|
66
|
+
if (!context)
|
|
67
|
+
throw new Error(
|
|
68
|
+
"useOnboarding must be used within a OnboardingProvider or createOnboardingPlugin."
|
|
69
|
+
);
|
|
70
|
+
return context;
|
|
71
|
+
}
|
|
72
|
+
var defaultLabels = {
|
|
73
|
+
next: "Next",
|
|
74
|
+
back: "Back",
|
|
75
|
+
skip: "Skip",
|
|
76
|
+
done: "Done",
|
|
77
|
+
stepOf: (current, total) => `Step ${current} of ${total}`
|
|
78
|
+
};
|
|
79
|
+
var OnboardingProvider = (0, import_vue.defineComponent)({
|
|
80
|
+
name: "OnboardingProvider",
|
|
81
|
+
props: {
|
|
82
|
+
options: Object,
|
|
83
|
+
kit: Object
|
|
84
|
+
},
|
|
85
|
+
slots: Object,
|
|
86
|
+
setup(props, { slots }) {
|
|
87
|
+
if (!props.kit && !props.options)
|
|
88
|
+
throw new Error("OnboardingProvider requires options or kit.");
|
|
89
|
+
const kit = props.kit ?? (0, import_onboarding.createOnboarding)({
|
|
90
|
+
...props.options,
|
|
91
|
+
...slots.step ? { renderer: "none" } : {}
|
|
92
|
+
});
|
|
93
|
+
const binding = createBinding(kit);
|
|
94
|
+
const labels = { ...defaultLabels, ...props.options?.labels };
|
|
95
|
+
(0, import_vue.provide)(onboardingKey, binding.context);
|
|
96
|
+
(0, import_vue.onMounted)(binding.mount);
|
|
97
|
+
(0, import_vue.onBeforeUnmount)(binding.unmount);
|
|
98
|
+
return () => {
|
|
99
|
+
const context = { kit, state: binding.snapshot.value, labels };
|
|
100
|
+
return [
|
|
101
|
+
slots.default?.(context),
|
|
102
|
+
context.state.status === "running" ? slots.step?.(context) : null
|
|
103
|
+
];
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
function createOnboardingPlugin(options) {
|
|
108
|
+
return {
|
|
109
|
+
install(app) {
|
|
110
|
+
const binding = createBinding((0, import_onboarding.createOnboarding)(options));
|
|
111
|
+
app.provide(onboardingKey, binding.context);
|
|
112
|
+
app.directive("onboarding-step", vOnboardingStep);
|
|
113
|
+
app.mixin({
|
|
114
|
+
mounted() {
|
|
115
|
+
if (this === this.$root) binding.mount();
|
|
116
|
+
},
|
|
117
|
+
beforeUnmount() {
|
|
118
|
+
if (this === this.$root) binding.unmount();
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function createVueRouterAdapter(router) {
|
|
125
|
+
return {
|
|
126
|
+
getPath: () => router.currentRoute.value.path,
|
|
127
|
+
navigate: async (path) => {
|
|
128
|
+
await router.push(path);
|
|
129
|
+
},
|
|
130
|
+
subscribe: (listener) => router.afterEach(listener)
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
134
|
+
0 && (module.exports = {
|
|
135
|
+
OnboardingProvider,
|
|
136
|
+
createOnboardingPlugin,
|
|
137
|
+
createVueRouterAdapter,
|
|
138
|
+
useOnboarding,
|
|
139
|
+
vOnboardingStep
|
|
140
|
+
});
|
|
141
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n computed,\n defineComponent,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n readonly,\n shallowRef,\n type AllowedComponentProps,\n type ComponentCustomProps,\n type ComponentPublicInstance,\n type ComputedRef,\n type DeepReadonly,\n type Directive,\n type InjectionKey,\n type Plugin,\n type PropType,\n type SlotsType,\n type VNode,\n type VNodeProps,\n} from 'vue';\nimport {\n createOnboarding,\n type Labels,\n type RendererContext,\n type RouterAdapter,\n type Onboarding,\n type OnboardingOptions,\n type OnboardingState,\n} from '@formriff/onboarding';\n\nexport interface OnboardingContextValue {\n kit: Onboarding;\n /** Read-only ref; the core owns its state snapshots. */\n state: ComputedRef<DeepReadonly<OnboardingState>>;\n}\n\nconst onboardingKey: InjectionKey<OnboardingContextValue> = Symbol('onboarding');\n\nfunction createBinding(kit: Onboarding) {\n const snapshot = shallowRef(kit.getState());\n const context: OnboardingContextValue = { kit, state: computed(() => readonly(snapshot.value)) };\n let release: (() => void) | undefined;\n return {\n context,\n snapshot,\n mount() {\n if (release) return;\n const unsubscribe = kit.subscribe((state) => {\n snapshot.value = state;\n });\n snapshot.value = kit.getState();\n const unmount = kit.mount();\n release = () => {\n unsubscribe();\n unmount();\n release = undefined;\n };\n },\n unmount() {\n release?.();\n },\n };\n}\n\n/** Can also be imported locally as vOnboardingStep in script setup. */\nexport const vOnboardingStep: Directive<HTMLElement, string> = {\n mounted: (element, binding) => element.setAttribute('data-onboarding', binding.value),\n updated: (element, binding) => element.setAttribute('data-onboarding', binding.value),\n unmounted: (element) => element.removeAttribute('data-onboarding'),\n getSSRProps: (binding) => ({ 'data-onboarding': binding.value }),\n};\n\nexport function useOnboarding(): OnboardingContextValue {\n const context = inject(onboardingKey, null);\n if (!context)\n throw new Error(\n 'useOnboarding must be used within a OnboardingProvider or createOnboardingPlugin.',\n );\n return context;\n}\n\nconst defaultLabels: Labels = {\n next: 'Next',\n back: 'Back',\n skip: 'Skip',\n done: 'Done',\n stepOf: (current, total) => `Step ${current} of ${total}`,\n};\n\nexport interface OnboardingProviderProps {\n options?: OnboardingOptions;\n kit?: Onboarding;\n}\n\nexport interface OnboardingProviderSlots {\n default?: (context: RendererContext) => VNode[];\n step?: (context: RendererContext) => VNode[];\n}\n\n/**\n * Create a provider per SSR request. The explicit public type also supports Vue 3.3.\n */\nexport const OnboardingProvider: new () => ComponentPublicInstance<\n OnboardingProviderProps & AllowedComponentProps & VNodeProps & ComponentCustomProps\n> & {\n $slots: OnboardingProviderSlots;\n} = defineComponent({\n name: 'OnboardingProvider',\n props: {\n options: Object as PropType<OnboardingOptions>,\n kit: Object as PropType<Onboarding>,\n },\n slots: Object as SlotsType<OnboardingProviderSlots>,\n setup(props, { slots }) {\n if (!props.kit && !props.options)\n throw new Error('OnboardingProvider requires options or kit.');\n const kit =\n props.kit ??\n createOnboarding({\n ...props.options!,\n ...(slots.step ? { renderer: 'none' as const } : {}),\n });\n const binding = createBinding(kit);\n const labels = { ...defaultLabels, ...props.options?.labels };\n provide(onboardingKey, binding.context);\n onMounted(binding.mount);\n onBeforeUnmount(binding.unmount);\n return () => {\n const context: RendererContext = { kit, state: binding.snapshot.value, labels };\n return [\n slots.default?.(context),\n context.state.status === 'running' ? slots.step?.(context) : null,\n ];\n };\n },\n});\n\n/** Optional app-wide provider; instantiate once per app/request, not as an SSR singleton. */\nexport function createOnboardingPlugin(options: OnboardingOptions): Plugin {\n return {\n install(app) {\n const binding = createBinding(createOnboarding(options));\n app.provide(onboardingKey, binding.context);\n app.directive('onboarding-step', vOnboardingStep);\n // Vue 3.3-compatible root lifecycle: no browser work during SSR.\n app.mixin({\n mounted() {\n if (this === this.$root) binding.mount();\n },\n beforeUnmount() {\n if (this === this.$root) binding.unmount();\n },\n });\n },\n };\n}\n\n/** Structural interface: importing this adapter never imports vue-router. */\nexport interface VueRouterLike {\n currentRoute: { readonly value: { readonly path: string } };\n push(path: string): unknown;\n afterEach(listener: () => void): () => void;\n}\n\nexport function createVueRouterAdapter(router: VueRouterLike): RouterAdapter {\n return {\n getPath: () => router.currentRoute.value.path,\n navigate: async (path) => {\n await router.push(path);\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B,QAAsC;AAC3E,SAAO;AAAA,IACL,SAAS,MAAM,OAAO,aAAa,MAAM;AAAA,IACzC,UAAU,OAAO,SAAS;AACxB,YAAM,OAAO,KAAK,IAAI;AAAA,IACxB;AAAA,IACA,WAAW,CAAC,aAAa,OAAO,UAAU,QAAQ;AAAA,EACpD;AACF;","names":[]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ComputedRef, DeepReadonly, ComponentPublicInstance, AllowedComponentProps, VNodeProps, ComponentCustomProps, VNode, Plugin, Directive } from 'vue';
|
|
2
|
+
import { Onboarding, OnboardingState, OnboardingOptions, RendererContext, RouterAdapter } from '@formriff/onboarding';
|
|
3
|
+
|
|
4
|
+
interface OnboardingContextValue {
|
|
5
|
+
kit: Onboarding;
|
|
6
|
+
/** Read-only ref; the core owns its state snapshots. */
|
|
7
|
+
state: ComputedRef<DeepReadonly<OnboardingState>>;
|
|
8
|
+
}
|
|
9
|
+
/** Can also be imported locally as vOnboardingStep in script setup. */
|
|
10
|
+
declare const vOnboardingStep: Directive<HTMLElement, string>;
|
|
11
|
+
declare function useOnboarding(): OnboardingContextValue;
|
|
12
|
+
interface OnboardingProviderProps {
|
|
13
|
+
options?: OnboardingOptions;
|
|
14
|
+
kit?: Onboarding;
|
|
15
|
+
}
|
|
16
|
+
interface OnboardingProviderSlots {
|
|
17
|
+
default?: (context: RendererContext) => VNode[];
|
|
18
|
+
step?: (context: RendererContext) => VNode[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Create a provider per SSR request. The explicit public type also supports Vue 3.3.
|
|
22
|
+
*/
|
|
23
|
+
declare const OnboardingProvider: new () => ComponentPublicInstance<OnboardingProviderProps & AllowedComponentProps & VNodeProps & ComponentCustomProps> & {
|
|
24
|
+
$slots: OnboardingProviderSlots;
|
|
25
|
+
};
|
|
26
|
+
/** Optional app-wide provider; instantiate once per app/request, not as an SSR singleton. */
|
|
27
|
+
declare function createOnboardingPlugin(options: OnboardingOptions): Plugin;
|
|
28
|
+
/** Structural interface: importing this adapter never imports vue-router. */
|
|
29
|
+
interface VueRouterLike {
|
|
30
|
+
currentRoute: {
|
|
31
|
+
readonly value: {
|
|
32
|
+
readonly path: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
push(path: string): unknown;
|
|
36
|
+
afterEach(listener: () => void): () => void;
|
|
37
|
+
}
|
|
38
|
+
declare function createVueRouterAdapter(router: VueRouterLike): RouterAdapter;
|
|
39
|
+
|
|
40
|
+
export { OnboardingProvider, createOnboardingPlugin, createVueRouterAdapter, useOnboarding, vOnboardingStep };
|
|
41
|
+
export type { OnboardingContextValue, OnboardingProviderProps, OnboardingProviderSlots, VueRouterLike };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ComputedRef, DeepReadonly, ComponentPublicInstance, AllowedComponentProps, VNodeProps, ComponentCustomProps, VNode, Plugin, Directive } from 'vue';
|
|
2
|
+
import { Onboarding, OnboardingState, OnboardingOptions, RendererContext, RouterAdapter } from '@formriff/onboarding';
|
|
3
|
+
|
|
4
|
+
interface OnboardingContextValue {
|
|
5
|
+
kit: Onboarding;
|
|
6
|
+
/** Read-only ref; the core owns its state snapshots. */
|
|
7
|
+
state: ComputedRef<DeepReadonly<OnboardingState>>;
|
|
8
|
+
}
|
|
9
|
+
/** Can also be imported locally as vOnboardingStep in script setup. */
|
|
10
|
+
declare const vOnboardingStep: Directive<HTMLElement, string>;
|
|
11
|
+
declare function useOnboarding(): OnboardingContextValue;
|
|
12
|
+
interface OnboardingProviderProps {
|
|
13
|
+
options?: OnboardingOptions;
|
|
14
|
+
kit?: Onboarding;
|
|
15
|
+
}
|
|
16
|
+
interface OnboardingProviderSlots {
|
|
17
|
+
default?: (context: RendererContext) => VNode[];
|
|
18
|
+
step?: (context: RendererContext) => VNode[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Create a provider per SSR request. The explicit public type also supports Vue 3.3.
|
|
22
|
+
*/
|
|
23
|
+
declare const OnboardingProvider: new () => ComponentPublicInstance<OnboardingProviderProps & AllowedComponentProps & VNodeProps & ComponentCustomProps> & {
|
|
24
|
+
$slots: OnboardingProviderSlots;
|
|
25
|
+
};
|
|
26
|
+
/** Optional app-wide provider; instantiate once per app/request, not as an SSR singleton. */
|
|
27
|
+
declare function createOnboardingPlugin(options: OnboardingOptions): Plugin;
|
|
28
|
+
/** Structural interface: importing this adapter never imports vue-router. */
|
|
29
|
+
interface VueRouterLike {
|
|
30
|
+
currentRoute: {
|
|
31
|
+
readonly value: {
|
|
32
|
+
readonly path: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
push(path: string): unknown;
|
|
36
|
+
afterEach(listener: () => void): () => void;
|
|
37
|
+
}
|
|
38
|
+
declare function createVueRouterAdapter(router: VueRouterLike): RouterAdapter;
|
|
39
|
+
|
|
40
|
+
export { OnboardingProvider, createOnboardingPlugin, createVueRouterAdapter, useOnboarding, vOnboardingStep };
|
|
41
|
+
export type { OnboardingContextValue, OnboardingProviderProps, OnboardingProviderSlots, VueRouterLike };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import {
|
|
3
|
+
computed,
|
|
4
|
+
defineComponent,
|
|
5
|
+
inject,
|
|
6
|
+
onBeforeUnmount,
|
|
7
|
+
onMounted,
|
|
8
|
+
provide,
|
|
9
|
+
readonly,
|
|
10
|
+
shallowRef
|
|
11
|
+
} from "vue";
|
|
12
|
+
import {
|
|
13
|
+
createOnboarding
|
|
14
|
+
} from "@formriff/onboarding";
|
|
15
|
+
var onboardingKey = /* @__PURE__ */ Symbol("onboarding");
|
|
16
|
+
function createBinding(kit) {
|
|
17
|
+
const snapshot = shallowRef(kit.getState());
|
|
18
|
+
const context = { kit, state: computed(() => readonly(snapshot.value)) };
|
|
19
|
+
let release;
|
|
20
|
+
return {
|
|
21
|
+
context,
|
|
22
|
+
snapshot,
|
|
23
|
+
mount() {
|
|
24
|
+
if (release) return;
|
|
25
|
+
const unsubscribe = kit.subscribe((state) => {
|
|
26
|
+
snapshot.value = state;
|
|
27
|
+
});
|
|
28
|
+
snapshot.value = kit.getState();
|
|
29
|
+
const unmount = kit.mount();
|
|
30
|
+
release = () => {
|
|
31
|
+
unsubscribe();
|
|
32
|
+
unmount();
|
|
33
|
+
release = void 0;
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
unmount() {
|
|
37
|
+
release?.();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
var vOnboardingStep = {
|
|
42
|
+
mounted: (element, binding) => element.setAttribute("data-onboarding", binding.value),
|
|
43
|
+
updated: (element, binding) => element.setAttribute("data-onboarding", binding.value),
|
|
44
|
+
unmounted: (element) => element.removeAttribute("data-onboarding"),
|
|
45
|
+
getSSRProps: (binding) => ({ "data-onboarding": binding.value })
|
|
46
|
+
};
|
|
47
|
+
function useOnboarding() {
|
|
48
|
+
const context = inject(onboardingKey, null);
|
|
49
|
+
if (!context)
|
|
50
|
+
throw new Error(
|
|
51
|
+
"useOnboarding must be used within a OnboardingProvider or createOnboardingPlugin."
|
|
52
|
+
);
|
|
53
|
+
return context;
|
|
54
|
+
}
|
|
55
|
+
var defaultLabels = {
|
|
56
|
+
next: "Next",
|
|
57
|
+
back: "Back",
|
|
58
|
+
skip: "Skip",
|
|
59
|
+
done: "Done",
|
|
60
|
+
stepOf: (current, total) => `Step ${current} of ${total}`
|
|
61
|
+
};
|
|
62
|
+
var OnboardingProvider = defineComponent({
|
|
63
|
+
name: "OnboardingProvider",
|
|
64
|
+
props: {
|
|
65
|
+
options: Object,
|
|
66
|
+
kit: Object
|
|
67
|
+
},
|
|
68
|
+
slots: Object,
|
|
69
|
+
setup(props, { slots }) {
|
|
70
|
+
if (!props.kit && !props.options)
|
|
71
|
+
throw new Error("OnboardingProvider requires options or kit.");
|
|
72
|
+
const kit = props.kit ?? createOnboarding({
|
|
73
|
+
...props.options,
|
|
74
|
+
...slots.step ? { renderer: "none" } : {}
|
|
75
|
+
});
|
|
76
|
+
const binding = createBinding(kit);
|
|
77
|
+
const labels = { ...defaultLabels, ...props.options?.labels };
|
|
78
|
+
provide(onboardingKey, binding.context);
|
|
79
|
+
onMounted(binding.mount);
|
|
80
|
+
onBeforeUnmount(binding.unmount);
|
|
81
|
+
return () => {
|
|
82
|
+
const context = { kit, state: binding.snapshot.value, labels };
|
|
83
|
+
return [
|
|
84
|
+
slots.default?.(context),
|
|
85
|
+
context.state.status === "running" ? slots.step?.(context) : null
|
|
86
|
+
];
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
function createOnboardingPlugin(options) {
|
|
91
|
+
return {
|
|
92
|
+
install(app) {
|
|
93
|
+
const binding = createBinding(createOnboarding(options));
|
|
94
|
+
app.provide(onboardingKey, binding.context);
|
|
95
|
+
app.directive("onboarding-step", vOnboardingStep);
|
|
96
|
+
app.mixin({
|
|
97
|
+
mounted() {
|
|
98
|
+
if (this === this.$root) binding.mount();
|
|
99
|
+
},
|
|
100
|
+
beforeUnmount() {
|
|
101
|
+
if (this === this.$root) binding.unmount();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function createVueRouterAdapter(router) {
|
|
108
|
+
return {
|
|
109
|
+
getPath: () => router.currentRoute.value.path,
|
|
110
|
+
navigate: async (path) => {
|
|
111
|
+
await router.push(path);
|
|
112
|
+
},
|
|
113
|
+
subscribe: (listener) => router.afterEach(listener)
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
export {
|
|
117
|
+
OnboardingProvider,
|
|
118
|
+
createOnboardingPlugin,
|
|
119
|
+
createVueRouterAdapter,
|
|
120
|
+
useOnboarding,
|
|
121
|
+
vOnboardingStep
|
|
122
|
+
};
|
|
123
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n computed,\n defineComponent,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n readonly,\n shallowRef,\n type AllowedComponentProps,\n type ComponentCustomProps,\n type ComponentPublicInstance,\n type ComputedRef,\n type DeepReadonly,\n type Directive,\n type InjectionKey,\n type Plugin,\n type PropType,\n type SlotsType,\n type VNode,\n type VNodeProps,\n} from 'vue';\nimport {\n createOnboarding,\n type Labels,\n type RendererContext,\n type RouterAdapter,\n type Onboarding,\n type OnboardingOptions,\n type OnboardingState,\n} from '@formriff/onboarding';\n\nexport interface OnboardingContextValue {\n kit: Onboarding;\n /** Read-only ref; the core owns its state snapshots. */\n state: ComputedRef<DeepReadonly<OnboardingState>>;\n}\n\nconst onboardingKey: InjectionKey<OnboardingContextValue> = Symbol('onboarding');\n\nfunction createBinding(kit: Onboarding) {\n const snapshot = shallowRef(kit.getState());\n const context: OnboardingContextValue = { kit, state: computed(() => readonly(snapshot.value)) };\n let release: (() => void) | undefined;\n return {\n context,\n snapshot,\n mount() {\n if (release) return;\n const unsubscribe = kit.subscribe((state) => {\n snapshot.value = state;\n });\n snapshot.value = kit.getState();\n const unmount = kit.mount();\n release = () => {\n unsubscribe();\n unmount();\n release = undefined;\n };\n },\n unmount() {\n release?.();\n },\n };\n}\n\n/** Can also be imported locally as vOnboardingStep in script setup. */\nexport const vOnboardingStep: Directive<HTMLElement, string> = {\n mounted: (element, binding) => element.setAttribute('data-onboarding', binding.value),\n updated: (element, binding) => element.setAttribute('data-onboarding', binding.value),\n unmounted: (element) => element.removeAttribute('data-onboarding'),\n getSSRProps: (binding) => ({ 'data-onboarding': binding.value }),\n};\n\nexport function useOnboarding(): OnboardingContextValue {\n const context = inject(onboardingKey, null);\n if (!context)\n throw new Error(\n 'useOnboarding must be used within a OnboardingProvider or createOnboardingPlugin.',\n );\n return context;\n}\n\nconst defaultLabels: Labels = {\n next: 'Next',\n back: 'Back',\n skip: 'Skip',\n done: 'Done',\n stepOf: (current, total) => `Step ${current} of ${total}`,\n};\n\nexport interface OnboardingProviderProps {\n options?: OnboardingOptions;\n kit?: Onboarding;\n}\n\nexport interface OnboardingProviderSlots {\n default?: (context: RendererContext) => VNode[];\n step?: (context: RendererContext) => VNode[];\n}\n\n/**\n * Create a provider per SSR request. The explicit public type also supports Vue 3.3.\n */\nexport const OnboardingProvider: new () => ComponentPublicInstance<\n OnboardingProviderProps & AllowedComponentProps & VNodeProps & ComponentCustomProps\n> & {\n $slots: OnboardingProviderSlots;\n} = defineComponent({\n name: 'OnboardingProvider',\n props: {\n options: Object as PropType<OnboardingOptions>,\n kit: Object as PropType<Onboarding>,\n },\n slots: Object as SlotsType<OnboardingProviderSlots>,\n setup(props, { slots }) {\n if (!props.kit && !props.options)\n throw new Error('OnboardingProvider requires options or kit.');\n const kit =\n props.kit ??\n createOnboarding({\n ...props.options!,\n ...(slots.step ? { renderer: 'none' as const } : {}),\n });\n const binding = createBinding(kit);\n const labels = { ...defaultLabels, ...props.options?.labels };\n provide(onboardingKey, binding.context);\n onMounted(binding.mount);\n onBeforeUnmount(binding.unmount);\n return () => {\n const context: RendererContext = { kit, state: binding.snapshot.value, labels };\n return [\n slots.default?.(context),\n context.state.status === 'running' ? slots.step?.(context) : null,\n ];\n };\n },\n});\n\n/** Optional app-wide provider; instantiate once per app/request, not as an SSR singleton. */\nexport function createOnboardingPlugin(options: OnboardingOptions): Plugin {\n return {\n install(app) {\n const binding = createBinding(createOnboarding(options));\n app.provide(onboardingKey, binding.context);\n app.directive('onboarding-step', vOnboardingStep);\n // Vue 3.3-compatible root lifecycle: no browser work during SSR.\n app.mixin({\n mounted() {\n if (this === this.$root) binding.mount();\n },\n beforeUnmount() {\n if (this === this.$root) binding.unmount();\n },\n });\n },\n };\n}\n\n/** Structural interface: importing this adapter never imports vue-router. */\nexport interface VueRouterLike {\n currentRoute: { readonly value: { readonly path: string } };\n push(path: string): unknown;\n afterEach(listener: () => void): () => void;\n}\n\nexport function createVueRouterAdapter(router: VueRouterLike): RouterAdapter {\n return {\n getPath: () => router.currentRoute.value.path,\n navigate: async (path) => {\n await router.push(path);\n },\n subscribe: (listener) => router.afterEach(listener),\n };\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAaK;AACP;AAAA,EACE;AAAA,OAOK;AAQP,IAAM,gBAAsD,uBAAO,YAAY;AAE/E,SAAS,cAAc,KAAiB;AACtC,QAAM,WAAW,WAAW,IAAI,SAAS,CAAC;AAC1C,QAAM,UAAkC,EAAE,KAAK,OAAO,SAAS,MAAM,SAAS,SAAS,KAAK,CAAC,EAAE;AAC/F,MAAI;AACJ,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,QAAQ;AACN,UAAI,QAAS;AACb,YAAM,cAAc,IAAI,UAAU,CAAC,UAAU;AAC3C,iBAAS,QAAQ;AAAA,MACnB,CAAC;AACD,eAAS,QAAQ,IAAI,SAAS;AAC9B,YAAM,UAAU,IAAI,MAAM;AAC1B,gBAAU,MAAM;AACd,oBAAY;AACZ,gBAAQ;AACR,kBAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,UAAU;AACR,gBAAU;AAAA,IACZ;AAAA,EACF;AACF;AAGO,IAAM,kBAAkD;AAAA,EAC7D,SAAS,CAAC,SAAS,YAAY,QAAQ,aAAa,mBAAmB,QAAQ,KAAK;AAAA,EACpF,SAAS,CAAC,SAAS,YAAY,QAAQ,aAAa,mBAAmB,QAAQ,KAAK;AAAA,EACpF,WAAW,CAAC,YAAY,QAAQ,gBAAgB,iBAAiB;AAAA,EACjE,aAAa,CAAC,aAAa,EAAE,mBAAmB,QAAQ,MAAM;AAChE;AAEO,SAAS,gBAAwC;AACtD,QAAM,UAAU,OAAO,eAAe,IAAI;AAC1C,MAAI,CAAC;AACH,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AACF,SAAO;AACT;AAEA,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AI,SAAS,KAAK,MAAO,SAAQ,QAAQ;AAAA,QAC3C;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;AASO,SAAS,uBAAuB,QAAsC;AAC3E,SAAO;AAAA,IACL,SAAS,MAAM,OAAO,aAAa,MAAM;AAAA,IACzC,UAAU,OAAO,SAAS;AACxB,YAAM,OAAO,KAAK,IAAI;AAAA,IACxB;AAAA,IACA,WAAW,CAAC,aAAa,OAAO,UAAU,QAAQ;AAAA,EACpD;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formriff/onboarding-vue",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Vue bindings for Onboarding Kit",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/FormRiff/onboarding-kit.git",
|
|
9
|
+
"directory": "packages/vue"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/FormRiff/onboarding-kit#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/FormRiff/onboarding-kit/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/index.cjs",
|
|
17
|
+
"module": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"import": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"require": {
|
|
26
|
+
"types": "./dist/index.d.cts",
|
|
27
|
+
"default": "./dist/index.cjs"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md",
|
|
34
|
+
"LICENSE"
|
|
35
|
+
],
|
|
36
|
+
"sideEffects": false,
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@formriff/onboarding": "^0.1.2"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"vue": "^3.3.0"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsup && node ../../scripts/copy-assets.mjs vue",
|
|
48
|
+
"typecheck": "tsc --noEmit",
|
|
49
|
+
"check:package": "publint && attw --pack"
|
|
50
|
+
}
|
|
6
51
|
}
|