@pastweb/vue 2.0.0
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 +21 -0
- package/README.md +1455 -0
- package/dist/EntryAdapter/EntryAdapter.cjs +6 -0
- package/dist/EntryAdapter/EntryAdapter.cjs.map +1 -0
- package/dist/EntryAdapter/EntryAdapter.js +7 -0
- package/dist/EntryAdapter/EntryAdapter.js.map +1 -0
- package/dist/EntryAdapter/EntryAdapter.vue.d.cts +36 -0
- package/dist/EntryAdapter/EntryAdapter.vue.d.ts +37 -0
- package/dist/EntryAdapter/EntryAdapter.vue_vue_type_script_lang.cjs +62 -0
- package/dist/EntryAdapter/EntryAdapter.vue_vue_type_script_lang.cjs.map +1 -0
- package/dist/EntryAdapter/EntryAdapter.vue_vue_type_script_lang.js +62 -0
- package/dist/EntryAdapter/EntryAdapter.vue_vue_type_script_lang.js.map +1 -0
- package/dist/EntryAdapter/constants.cjs +14 -0
- package/dist/EntryAdapter/constants.cjs.map +1 -0
- package/dist/EntryAdapter/constants.d.cts +14 -0
- package/dist/EntryAdapter/constants.d.ts +14 -0
- package/dist/EntryAdapter/constants.js +13 -0
- package/dist/EntryAdapter/constants.js.map +1 -0
- package/dist/EntryAdapter/index.cjs +3 -0
- package/dist/EntryAdapter/index.d.cts +2 -0
- package/dist/EntryAdapter/index.d.ts +2 -0
- package/dist/EntryAdapter/index.js +2 -0
- package/dist/EntryAdapter/types.cjs +0 -0
- package/dist/EntryAdapter/types.d.cts +44 -0
- package/dist/EntryAdapter/types.d.ts +44 -0
- package/dist/EntryAdapter/types.js +0 -0
- package/dist/EntryAdapter/utils.cjs +62 -0
- package/dist/EntryAdapter/utils.cjs.map +1 -0
- package/dist/EntryAdapter/utils.d.cts +36 -0
- package/dist/EntryAdapter/utils.d.ts +36 -0
- package/dist/EntryAdapter/utils.js +60 -0
- package/dist/EntryAdapter/utils.js.map +1 -0
- package/dist/Island/Island.cjs +6 -0
- package/dist/Island/Island.cjs.map +1 -0
- package/dist/Island/Island.js +7 -0
- package/dist/Island/Island.js.map +1 -0
- package/dist/Island/Island.vue.d.cts +22 -0
- package/dist/Island/Island.vue.d.ts +23 -0
- package/dist/Island/Island.vue_vue_type_script_setup_true_lang.cjs +145 -0
- package/dist/Island/Island.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/Island/Island.vue_vue_type_script_setup_true_lang.js +144 -0
- package/dist/Island/Island.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/Island/constants.cjs +12 -0
- package/dist/Island/constants.cjs.map +1 -0
- package/dist/Island/constants.d.cts +11 -0
- package/dist/Island/constants.d.ts +11 -0
- package/dist/Island/constants.js +10 -0
- package/dist/Island/constants.js.map +1 -0
- package/dist/Island/index.cjs +9 -0
- package/dist/Island/index.d.cts +5 -0
- package/dist/Island/index.d.ts +5 -0
- package/dist/Island/index.js +4 -0
- package/dist/Island/types.cjs +0 -0
- package/dist/Island/types.d.cts +18 -0
- package/dist/Island/types.d.ts +18 -0
- package/dist/Island/types.js +0 -0
- package/dist/Island/useIsland.cjs +23 -0
- package/dist/Island/useIsland.cjs.map +1 -0
- package/dist/Island/useIsland.d.cts +15 -0
- package/dist/Island/useIsland.d.ts +15 -0
- package/dist/Island/useIsland.js +21 -0
- package/dist/Island/useIsland.js.map +1 -0
- package/dist/Render/Render.cjs +6 -0
- package/dist/Render/Render.cjs.map +1 -0
- package/dist/Render/Render.js +7 -0
- package/dist/Render/Render.js.map +1 -0
- package/dist/Render/Render.vue.d.cts +10 -0
- package/dist/Render/Render.vue.d.ts +11 -0
- package/dist/Render/Render.vue_vue_type_script_lang.cjs +47 -0
- package/dist/Render/Render.vue_vue_type_script_lang.cjs.map +1 -0
- package/dist/Render/Render.vue_vue_type_script_lang.js +47 -0
- package/dist/Render/Render.vue_vue_type_script_lang.js.map +1 -0
- package/dist/Render/index.cjs +3 -0
- package/dist/Render/index.d.cts +3 -0
- package/dist/Render/index.d.ts +3 -0
- package/dist/Render/index.js +2 -0
- package/dist/Render/types.cjs +0 -0
- package/dist/Render/types.d.cts +21 -0
- package/dist/Render/types.d.ts +21 -0
- package/dist/Render/types.js +0 -0
- package/dist/Slot/Slot.cjs +89 -0
- package/dist/Slot/Slot.cjs.map +1 -0
- package/dist/Slot/Slot.d.cts +38 -0
- package/dist/Slot/Slot.d.ts +39 -0
- package/dist/Slot/Slot.js +89 -0
- package/dist/Slot/Slot.js.map +1 -0
- package/dist/Slot/index.cjs +3 -0
- package/dist/Slot/index.d.cts +3 -0
- package/dist/Slot/index.d.ts +3 -0
- package/dist/Slot/index.js +2 -0
- package/dist/Slot/types.cjs +0 -0
- package/dist/Slot/types.d.cts +17 -0
- package/dist/Slot/types.d.ts +17 -0
- package/dist/Slot/types.js +0 -0
- package/dist/_virtual/_rolldown/runtime.cjs +4 -0
- package/dist/api/hooks/index.cjs +20 -0
- package/dist/api/hooks/index.d.cts +12 -0
- package/dist/api/hooks/index.d.ts +12 -0
- package/dist/api/hooks/index.js +13 -0
- package/dist/api/hooks/reuseQuery/index.cjs +4 -0
- package/dist/api/hooks/reuseQuery/index.d.cts +2 -0
- package/dist/api/hooks/reuseQuery/index.d.ts +2 -0
- package/dist/api/hooks/reuseQuery/index.js +2 -0
- package/dist/api/hooks/reuseQuery/reuseQuery.cjs +44 -0
- package/dist/api/hooks/reuseQuery/reuseQuery.cjs.map +1 -0
- package/dist/api/hooks/reuseQuery/reuseQuery.d.cts +37 -0
- package/dist/api/hooks/reuseQuery/reuseQuery.d.ts +37 -0
- package/dist/api/hooks/reuseQuery/reuseQuery.js +42 -0
- package/dist/api/hooks/reuseQuery/reuseQuery.js.map +1 -0
- package/dist/api/hooks/useApiQueryCache/index.cjs +3 -0
- package/dist/api/hooks/useApiQueryCache/index.d.cts +2 -0
- package/dist/api/hooks/useApiQueryCache/index.d.ts +2 -0
- package/dist/api/hooks/useApiQueryCache/index.js +2 -0
- package/dist/api/hooks/useApiQueryCache/useApiQueryCache.cjs +31 -0
- package/dist/api/hooks/useApiQueryCache/useApiQueryCache.cjs.map +1 -0
- package/dist/api/hooks/useApiQueryCache/useApiQueryCache.d.cts +24 -0
- package/dist/api/hooks/useApiQueryCache/useApiQueryCache.d.ts +24 -0
- package/dist/api/hooks/useApiQueryCache/useApiQueryCache.js +30 -0
- package/dist/api/hooks/useApiQueryCache/useApiQueryCache.js.map +1 -0
- package/dist/api/hooks/useInfiniteQuery/index.cjs +3 -0
- package/dist/api/hooks/useInfiniteQuery/index.d.cts +3 -0
- package/dist/api/hooks/useInfiniteQuery/index.d.ts +3 -0
- package/dist/api/hooks/useInfiniteQuery/index.js +2 -0
- package/dist/api/hooks/useInfiniteQuery/useInfiniteQuery.cjs +34 -0
- package/dist/api/hooks/useInfiniteQuery/useInfiniteQuery.cjs.map +1 -0
- package/dist/api/hooks/useInfiniteQuery/useInfiniteQuery.d.cts +29 -0
- package/dist/api/hooks/useInfiniteQuery/useInfiniteQuery.d.ts +29 -0
- package/dist/api/hooks/useInfiniteQuery/useInfiniteQuery.js +33 -0
- package/dist/api/hooks/useInfiniteQuery/useInfiniteQuery.js.map +1 -0
- package/dist/api/hooks/useMutation/index.cjs +3 -0
- package/dist/api/hooks/useMutation/index.d.cts +3 -0
- package/dist/api/hooks/useMutation/index.d.ts +3 -0
- package/dist/api/hooks/useMutation/index.js +2 -0
- package/dist/api/hooks/useMutation/useMutation.cjs +30 -0
- package/dist/api/hooks/useMutation/useMutation.cjs.map +1 -0
- package/dist/api/hooks/useMutation/useMutation.d.cts +25 -0
- package/dist/api/hooks/useMutation/useMutation.d.ts +25 -0
- package/dist/api/hooks/useMutation/useMutation.js +29 -0
- package/dist/api/hooks/useMutation/useMutation.js.map +1 -0
- package/dist/api/hooks/useQueries/index.cjs +3 -0
- package/dist/api/hooks/useQueries/index.d.cts +3 -0
- package/dist/api/hooks/useQueries/index.d.ts +3 -0
- package/dist/api/hooks/useQueries/index.js +2 -0
- package/dist/api/hooks/useQueries/useQueries.cjs +32 -0
- package/dist/api/hooks/useQueries/useQueries.cjs.map +1 -0
- package/dist/api/hooks/useQueries/useQueries.d.cts +28 -0
- package/dist/api/hooks/useQueries/useQueries.d.ts +28 -0
- package/dist/api/hooks/useQueries/useQueries.js +31 -0
- package/dist/api/hooks/useQueries/useQueries.js.map +1 -0
- package/dist/api/hooks/useQuery/index.cjs +3 -0
- package/dist/api/hooks/useQuery/index.d.cts +3 -0
- package/dist/api/hooks/useQuery/index.d.ts +3 -0
- package/dist/api/hooks/useQuery/index.js +2 -0
- package/dist/api/hooks/useQuery/useQuery.cjs +30 -0
- package/dist/api/hooks/useQuery/useQuery.cjs.map +1 -0
- package/dist/api/hooks/useQuery/useQuery.d.cts +25 -0
- package/dist/api/hooks/useQuery/useQuery.d.ts +25 -0
- package/dist/api/hooks/useQuery/useQuery.js +29 -0
- package/dist/api/hooks/useQuery/useQuery.js.map +1 -0
- package/dist/api/hooks/utils/index.cjs +4 -0
- package/dist/api/hooks/utils/index.d.cts +2 -0
- package/dist/api/hooks/utils/index.d.ts +2 -0
- package/dist/api/hooks/utils/index.js +2 -0
- package/dist/api/hooks/utils/useReactiveRender.cjs +56 -0
- package/dist/api/hooks/utils/useReactiveRender.cjs.map +1 -0
- package/dist/api/hooks/utils/useReactiveRender.d.cts +29 -0
- package/dist/api/hooks/utils/useReactiveRender.d.ts +29 -0
- package/dist/api/hooks/utils/useReactiveRender.js +54 -0
- package/dist/api/hooks/utils/useReactiveRender.js.map +1 -0
- package/dist/api/index.cjs +18 -0
- package/dist/api/index.d.cts +15 -0
- package/dist/api/index.d.ts +15 -0
- package/dist/api/index.js +10 -0
- package/dist/api/installApiCache/index.cjs +3 -0
- package/dist/api/installApiCache/index.d.cts +3 -0
- package/dist/api/installApiCache/index.d.ts +3 -0
- package/dist/api/installApiCache/index.js +2 -0
- package/dist/api/installApiCache/installApiCache.cjs +35 -0
- package/dist/api/installApiCache/installApiCache.cjs.map +1 -0
- package/dist/api/installApiCache/installApiCache.d.cts +29 -0
- package/dist/api/installApiCache/installApiCache.d.ts +29 -0
- package/dist/api/installApiCache/installApiCache.js +34 -0
- package/dist/api/installApiCache/installApiCache.js.map +1 -0
- package/dist/api/installApiCache/types.cjs +0 -0
- package/dist/api/installApiCache/types.d.cts +21 -0
- package/dist/api/installApiCache/types.d.ts +21 -0
- package/dist/api/installApiCache/types.js +0 -0
- package/dist/api/types.cjs +0 -0
- package/dist/api/types.d.cts +2 -0
- package/dist/api/types.d.ts +2 -0
- package/dist/api/types.js +0 -0
- package/dist/computed/computed.cjs +28 -0
- package/dist/computed/computed.cjs.map +1 -0
- package/dist/computed/computed.d.cts +25 -0
- package/dist/computed/computed.d.ts +25 -0
- package/dist/computed/computed.js +27 -0
- package/dist/computed/computed.js.map +1 -0
- package/dist/computed/index.cjs +3 -0
- package/dist/computed/index.d.cts +2 -0
- package/dist/computed/index.d.ts +2 -0
- package/dist/computed/index.js +2 -0
- package/dist/createEntry/UpdateEntry/UpdateEntry.cjs +6 -0
- package/dist/createEntry/UpdateEntry/UpdateEntry.cjs.map +1 -0
- package/dist/createEntry/UpdateEntry/UpdateEntry.js +7 -0
- package/dist/createEntry/UpdateEntry/UpdateEntry.js.map +1 -0
- package/dist/createEntry/UpdateEntry/UpdateEntry.vue.d.cts +6 -0
- package/dist/createEntry/UpdateEntry/UpdateEntry.vue.d.ts +7 -0
- package/dist/createEntry/UpdateEntry/UpdateEntry.vue_vue_type_script_setup_true_lang.cjs +35 -0
- package/dist/createEntry/UpdateEntry/UpdateEntry.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/createEntry/UpdateEntry/UpdateEntry.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/createEntry/UpdateEntry/UpdateEntry.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/createEntry/UpdateEntry/Vnode.cjs +19 -0
- package/dist/createEntry/UpdateEntry/Vnode.cjs.map +1 -0
- package/dist/createEntry/UpdateEntry/Vnode.d.cts +20 -0
- package/dist/createEntry/UpdateEntry/Vnode.d.ts +20 -0
- package/dist/createEntry/UpdateEntry/Vnode.js +18 -0
- package/dist/createEntry/UpdateEntry/Vnode.js.map +1 -0
- package/dist/createEntry/UpdateEntry/index.cjs +3 -0
- package/dist/createEntry/UpdateEntry/index.d.cts +3 -0
- package/dist/createEntry/UpdateEntry/index.d.ts +3 -0
- package/dist/createEntry/UpdateEntry/index.js +2 -0
- package/dist/createEntry/UpdateEntry/types.cjs +0 -0
- package/dist/createEntry/UpdateEntry/types.d.cts +18 -0
- package/dist/createEntry/UpdateEntry/types.d.ts +18 -0
- package/dist/createEntry/UpdateEntry/types.js +0 -0
- package/dist/createEntry/WaitFor/WaitFor.cjs +6 -0
- package/dist/createEntry/WaitFor/WaitFor.cjs.map +1 -0
- package/dist/createEntry/WaitFor/WaitFor.js +7 -0
- package/dist/createEntry/WaitFor/WaitFor.js.map +1 -0
- package/dist/createEntry/WaitFor/WaitFor.vue.d.cts +6 -0
- package/dist/createEntry/WaitFor/WaitFor.vue.d.ts +7 -0
- package/dist/createEntry/WaitFor/WaitFor.vue_vue_type_script_setup_true_lang.cjs +50 -0
- package/dist/createEntry/WaitFor/WaitFor.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/createEntry/WaitFor/WaitFor.vue_vue_type_script_setup_true_lang.js +50 -0
- package/dist/createEntry/WaitFor/WaitFor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/createEntry/WaitFor/index.cjs +3 -0
- package/dist/createEntry/WaitFor/index.d.cts +3 -0
- package/dist/createEntry/WaitFor/index.d.ts +3 -0
- package/dist/createEntry/WaitFor/index.js +2 -0
- package/dist/createEntry/WaitFor/types.cjs +0 -0
- package/dist/createEntry/WaitFor/types.d.cts +21 -0
- package/dist/createEntry/WaitFor/types.d.ts +21 -0
- package/dist/createEntry/WaitFor/types.js +0 -0
- package/dist/createEntry/createEntry.cjs +32 -0
- package/dist/createEntry/createEntry.cjs.map +1 -0
- package/dist/createEntry/createEntry.d.cts +17 -0
- package/dist/createEntry/createEntry.d.ts +17 -0
- package/dist/createEntry/createEntry.js +31 -0
- package/dist/createEntry/createEntry.js.map +1 -0
- package/dist/createEntry/createServerEntry.cjs +45 -0
- package/dist/createEntry/createServerEntry.cjs.map +1 -0
- package/dist/createEntry/createServerEntry.d.cts +17 -0
- package/dist/createEntry/createServerEntry.d.ts +17 -0
- package/dist/createEntry/createServerEntry.js +43 -0
- package/dist/createEntry/createServerEntry.js.map +1 -0
- package/dist/createEntry/index.cjs +5 -0
- package/dist/createEntry/index.d.cts +5 -0
- package/dist/createEntry/index.d.ts +5 -0
- package/dist/createEntry/index.js +3 -0
- package/dist/createEntry/types.cjs +0 -0
- package/dist/createEntry/types.d.cts +75 -0
- package/dist/createEntry/types.d.ts +75 -0
- package/dist/createEntry/types.js +0 -0
- package/dist/createEntry/utils/createServerVueApp/createServerVueApp.cjs +28 -0
- package/dist/createEntry/utils/createServerVueApp/createServerVueApp.cjs.map +1 -0
- package/dist/createEntry/utils/createServerVueApp/createServerVueApp.d.cts +27 -0
- package/dist/createEntry/utils/createServerVueApp/createServerVueApp.d.ts +27 -0
- package/dist/createEntry/utils/createServerVueApp/createServerVueApp.js +27 -0
- package/dist/createEntry/utils/createServerVueApp/createServerVueApp.js.map +1 -0
- package/dist/createEntry/utils/createServerVueApp/index.cjs +3 -0
- package/dist/createEntry/utils/createServerVueApp/index.d.cts +2 -0
- package/dist/createEntry/utils/createServerVueApp/index.d.ts +2 -0
- package/dist/createEntry/utils/createServerVueApp/index.js +2 -0
- package/dist/createEntry/utils/createServerVueApp/types.cjs +0 -0
- package/dist/createEntry/utils/createServerVueApp/types.d.cts +7 -0
- package/dist/createEntry/utils/createServerVueApp/types.d.ts +7 -0
- package/dist/createEntry/utils/createServerVueApp/types.js +0 -0
- package/dist/createEntry/utils/createVueApp/createVueApp.cjs +43 -0
- package/dist/createEntry/utils/createVueApp/createVueApp.cjs.map +1 -0
- package/dist/createEntry/utils/createVueApp/createVueApp.d.cts +22 -0
- package/dist/createEntry/utils/createVueApp/createVueApp.d.ts +22 -0
- package/dist/createEntry/utils/createVueApp/createVueApp.js +42 -0
- package/dist/createEntry/utils/createVueApp/createVueApp.js.map +1 -0
- package/dist/createEntry/utils/createVueApp/index.cjs +3 -0
- package/dist/createEntry/utils/createVueApp/index.d.cts +2 -0
- package/dist/createEntry/utils/createVueApp/index.d.ts +2 -0
- package/dist/createEntry/utils/createVueApp/index.js +2 -0
- package/dist/createEntry/utils/index.cjs +10 -0
- package/dist/createEntry/utils/index.d.cts +5 -0
- package/dist/createEntry/utils/index.d.ts +5 -0
- package/dist/createEntry/utils/index.js +6 -0
- package/dist/createEntry/utils/normalizeVueOptions/index.cjs +3 -0
- package/dist/createEntry/utils/normalizeVueOptions/index.d.cts +2 -0
- package/dist/createEntry/utils/normalizeVueOptions/index.d.ts +2 -0
- package/dist/createEntry/utils/normalizeVueOptions/index.js +2 -0
- package/dist/createEntry/utils/normalizeVueOptions/normalizeVueOptions.cjs +28 -0
- package/dist/createEntry/utils/normalizeVueOptions/normalizeVueOptions.cjs.map +1 -0
- package/dist/createEntry/utils/normalizeVueOptions/normalizeVueOptions.d.cts +17 -0
- package/dist/createEntry/utils/normalizeVueOptions/normalizeVueOptions.d.ts +17 -0
- package/dist/createEntry/utils/normalizeVueOptions/normalizeVueOptions.js +27 -0
- package/dist/createEntry/utils/normalizeVueOptions/normalizeVueOptions.js.map +1 -0
- package/dist/createEntry/utils/setupVueEntry/index.cjs +3 -0
- package/dist/createEntry/utils/setupVueEntry/index.d.cts +2 -0
- package/dist/createEntry/utils/setupVueEntry/index.d.ts +2 -0
- package/dist/createEntry/utils/setupVueEntry/index.js +2 -0
- package/dist/createEntry/utils/setupVueEntry/setupVueEntry.cjs +31 -0
- package/dist/createEntry/utils/setupVueEntry/setupVueEntry.cjs.map +1 -0
- package/dist/createEntry/utils/setupVueEntry/setupVueEntry.d.cts +17 -0
- package/dist/createEntry/utils/setupVueEntry/setupVueEntry.d.ts +17 -0
- package/dist/createEntry/utils/setupVueEntry/setupVueEntry.js +30 -0
- package/dist/createEntry/utils/setupVueEntry/setupVueEntry.js.map +1 -0
- package/dist/createPiniaAsyncStore/createPiniaAsyncStore.cjs +49 -0
- package/dist/createPiniaAsyncStore/createPiniaAsyncStore.cjs.map +1 -0
- package/dist/createPiniaAsyncStore/createPiniaAsyncStore.d.cts +33 -0
- package/dist/createPiniaAsyncStore/createPiniaAsyncStore.d.ts +33 -0
- package/dist/createPiniaAsyncStore/createPiniaAsyncStore.js +48 -0
- package/dist/createPiniaAsyncStore/createPiniaAsyncStore.js.map +1 -0
- package/dist/createPiniaAsyncStore/index.cjs +3 -0
- package/dist/createPiniaAsyncStore/index.d.cts +3 -0
- package/dist/createPiniaAsyncStore/index.d.ts +3 -0
- package/dist/createPiniaAsyncStore/index.js +2 -0
- package/dist/createPiniaAsyncStore/types.cjs +0 -0
- package/dist/createPiniaAsyncStore/types.d.cts +22 -0
- package/dist/createPiniaAsyncStore/types.d.ts +22 -0
- package/dist/createPiniaAsyncStore/types.js +0 -0
- package/dist/getContext/getContext.cjs +29 -0
- package/dist/getContext/getContext.cjs.map +1 -0
- package/dist/getContext/getContext.d.cts +24 -0
- package/dist/getContext/getContext.d.ts +24 -0
- package/dist/getContext/getContext.js +28 -0
- package/dist/getContext/getContext.js.map +1 -0
- package/dist/getContext/index.cjs +3 -0
- package/dist/getContext/index.d.cts +2 -0
- package/dist/getContext/index.d.ts +2 -0
- package/dist/getContext/index.js +2 -0
- package/dist/getEventHandlers/getEventHandlers.cjs +65 -0
- package/dist/getEventHandlers/getEventHandlers.cjs.map +1 -0
- package/dist/getEventHandlers/getEventHandlers.d.cts +45 -0
- package/dist/getEventHandlers/getEventHandlers.d.ts +45 -0
- package/dist/getEventHandlers/getEventHandlers.js +64 -0
- package/dist/getEventHandlers/getEventHandlers.js.map +1 -0
- package/dist/getEventHandlers/index.cjs +3 -0
- package/dist/getEventHandlers/index.d.cts +3 -0
- package/dist/getEventHandlers/index.d.ts +3 -0
- package/dist/getEventHandlers/index.js +2 -0
- package/dist/getEventHandlers/types.cjs +0 -0
- package/dist/getEventHandlers/types.d.cts +7 -0
- package/dist/getEventHandlers/types.d.ts +7 -0
- package/dist/getEventHandlers/types.js +0 -0
- package/dist/index.cjs +104 -0
- package/dist/index.d.cts +61 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +62 -0
- package/dist/node_modules/@babel/parser/lib/index.cjs +12599 -0
- package/dist/node_modules/@babel/parser/lib/index.cjs.map +1 -0
- package/dist/node_modules/@vue/compiler-core/dist/compiler-core.cjs.cjs +4832 -0
- package/dist/node_modules/@vue/compiler-core/dist/compiler-core.cjs.cjs.map +1 -0
- package/dist/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.cjs +4775 -0
- package/dist/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.cjs.map +1 -0
- package/dist/node_modules/@vue/compiler-core/index.cjs +18 -0
- package/dist/node_modules/@vue/compiler-core/index.cjs.map +1 -0
- package/dist/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.cjs +665 -0
- package/dist/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.cjs.map +1 -0
- package/dist/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.cjs +447 -0
- package/dist/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.cjs.map +1 -0
- package/dist/node_modules/@vue/compiler-dom/index.cjs +18 -0
- package/dist/node_modules/@vue/compiler-dom/index.cjs.map +1 -0
- package/dist/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.cjs +848 -0
- package/dist/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.cjs.map +1 -0
- package/dist/node_modules/@vue/server-renderer/dist/server-renderer.cjs.cjs +830 -0
- package/dist/node_modules/@vue/server-renderer/dist/server-renderer.cjs.cjs.map +1 -0
- package/dist/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.cjs +605 -0
- package/dist/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.cjs.map +1 -0
- package/dist/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.js +532 -0
- package/dist/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.js.map +1 -0
- package/dist/node_modules/@vue/server-renderer/index.cjs +18 -0
- package/dist/node_modules/@vue/server-renderer/index.cjs.map +1 -0
- package/dist/node_modules/@vue/shared/dist/shared.cjs.cjs +496 -0
- package/dist/node_modules/@vue/shared/dist/shared.cjs.cjs.map +1 -0
- package/dist/node_modules/@vue/shared/dist/shared.cjs.prod.cjs +495 -0
- package/dist/node_modules/@vue/shared/dist/shared.cjs.prod.cjs.map +1 -0
- package/dist/node_modules/@vue/shared/dist/shared.esm-bundler.js +166 -0
- package/dist/node_modules/@vue/shared/dist/shared.esm-bundler.js.map +1 -0
- package/dist/node_modules/@vue/shared/index.cjs +18 -0
- package/dist/node_modules/@vue/shared/index.cjs.map +1 -0
- package/dist/node_modules/entities/dist/commonjs/decode-codepoint.cjs +81 -0
- package/dist/node_modules/entities/dist/commonjs/decode-codepoint.cjs.map +1 -0
- package/dist/node_modules/entities/dist/commonjs/decode.cjs +474 -0
- package/dist/node_modules/entities/dist/commonjs/decode.cjs.map +1 -0
- package/dist/node_modules/entities/dist/commonjs/generated/decode-data-html.cjs +18 -0
- package/dist/node_modules/entities/dist/commonjs/generated/decode-data-html.cjs.map +1 -0
- package/dist/node_modules/entities/dist/commonjs/generated/decode-data-xml.cjs +18 -0
- package/dist/node_modules/entities/dist/commonjs/generated/decode-data-xml.cjs.map +1 -0
- package/dist/node_modules/entities/dist/commonjs/internal/bin-trie-flags.cjs +32 -0
- package/dist/node_modules/entities/dist/commonjs/internal/bin-trie-flags.cjs.map +1 -0
- package/dist/node_modules/entities/dist/commonjs/internal/decode-shared.cjs +26 -0
- package/dist/node_modules/entities/dist/commonjs/internal/decode-shared.cjs.map +1 -0
- package/dist/node_modules/estree-walker/dist/umd/estree-walker.cjs +254 -0
- package/dist/node_modules/estree-walker/dist/umd/estree-walker.cjs.map +1 -0
- package/dist/node_modules/source-map-js/lib/array-set.cjs +102 -0
- package/dist/node_modules/source-map-js/lib/array-set.cjs.map +1 -0
- package/dist/node_modules/source-map-js/lib/base64-vlq.cjs +75 -0
- package/dist/node_modules/source-map-js/lib/base64-vlq.cjs.map +1 -0
- package/dist/node_modules/source-map-js/lib/base64.cjs +42 -0
- package/dist/node_modules/source-map-js/lib/base64.cjs.map +1 -0
- package/dist/node_modules/source-map-js/lib/binary-search.cjs +69 -0
- package/dist/node_modules/source-map-js/lib/binary-search.cjs.map +1 -0
- package/dist/node_modules/source-map-js/lib/mapping-list.cjs +79 -0
- package/dist/node_modules/source-map-js/lib/mapping-list.cjs.map +1 -0
- package/dist/node_modules/source-map-js/lib/quick-sort.cjs +90 -0
- package/dist/node_modules/source-map-js/lib/quick-sort.cjs.map +1 -0
- package/dist/node_modules/source-map-js/lib/source-map-consumer.cjs +790 -0
- package/dist/node_modules/source-map-js/lib/source-map-consumer.cjs.map +1 -0
- package/dist/node_modules/source-map-js/lib/source-map-generator.cjs +297 -0
- package/dist/node_modules/source-map-js/lib/source-map-generator.cjs.map +1 -0
- package/dist/node_modules/source-map-js/lib/source-node.cjs +295 -0
- package/dist/node_modules/source-map-js/lib/source-node.cjs.map +1 -0
- package/dist/node_modules/source-map-js/lib/util.cjs +353 -0
- package/dist/node_modules/source-map-js/lib/util.cjs.map +1 -0
- package/dist/node_modules/source-map-js/source-map.cjs +19 -0
- package/dist/node_modules/source-map-js/source-map.cjs.map +1 -0
- package/dist/portals/Portal/Portal.cjs +6 -0
- package/dist/portals/Portal/Portal.cjs.map +1 -0
- package/dist/portals/Portal/Portal.js +7 -0
- package/dist/portals/Portal/Portal.js.map +1 -0
- package/dist/portals/Portal/Portal.vue.d.cts +6 -0
- package/dist/portals/Portal/Portal.vue.d.ts +7 -0
- package/dist/portals/Portal/Portal.vue_vue_type_script_setup_true_lang.cjs +56 -0
- package/dist/portals/Portal/Portal.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/portals/Portal/Portal.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/portals/Portal/Portal.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/portals/Portal/index.cjs +3 -0
- package/dist/portals/Portal/index.d.cts +3 -0
- package/dist/portals/Portal/index.d.ts +3 -0
- package/dist/portals/Portal/index.js +2 -0
- package/dist/portals/Portal/types.cjs +0 -0
- package/dist/portals/Portal/types.d.cts +19 -0
- package/dist/portals/Portal/types.d.ts +19 -0
- package/dist/portals/Portal/types.js +0 -0
- package/dist/portals/index.cjs +13 -0
- package/dist/portals/index.d.cts +8 -0
- package/dist/portals/index.d.ts +8 -0
- package/dist/portals/index.js +8 -0
- package/dist/portals/installPortals/index.cjs +3 -0
- package/dist/portals/installPortals/index.d.cts +3 -0
- package/dist/portals/installPortals/index.d.ts +3 -0
- package/dist/portals/installPortals/index.js +2 -0
- package/dist/portals/installPortals/installPortals.cjs +25 -0
- package/dist/portals/installPortals/installPortals.cjs.map +1 -0
- package/dist/portals/installPortals/installPortals.d.cts +25 -0
- package/dist/portals/installPortals/installPortals.d.ts +25 -0
- package/dist/portals/installPortals/installPortals.js +24 -0
- package/dist/portals/installPortals/installPortals.js.map +1 -0
- package/dist/portals/installPortals/types.cjs +0 -0
- package/dist/portals/installPortals/types.d.cts +23 -0
- package/dist/portals/installPortals/types.d.ts +23 -0
- package/dist/portals/installPortals/types.js +0 -0
- package/dist/portals/types.cjs +0 -0
- package/dist/portals/types.d.cts +40 -0
- package/dist/portals/types.d.ts +40 -0
- package/dist/portals/types.js +0 -0
- package/dist/portals/usePortal.cjs +44 -0
- package/dist/portals/usePortal.cjs.map +1 -0
- package/dist/portals/usePortal.d.cts +17 -0
- package/dist/portals/usePortal.d.ts +17 -0
- package/dist/portals/usePortal.js +43 -0
- package/dist/portals/usePortal.js.map +1 -0
- package/dist/portals/usePortalAnchors.cjs +21 -0
- package/dist/portals/usePortalAnchors.cjs.map +1 -0
- package/dist/portals/usePortalAnchors.d.cts +14 -0
- package/dist/portals/usePortalAnchors.d.ts +14 -0
- package/dist/portals/usePortalAnchors.js +20 -0
- package/dist/portals/usePortalAnchors.js.map +1 -0
- package/dist/portals/usePortals.cjs +21 -0
- package/dist/portals/usePortals.cjs.map +1 -0
- package/dist/portals/usePortals.d.cts +14 -0
- package/dist/portals/usePortals.d.ts +14 -0
- package/dist/portals/usePortals.js +20 -0
- package/dist/portals/usePortals.js.map +1 -0
- package/dist/router/RouterLink/RouterLink.cjs +6 -0
- package/dist/router/RouterLink/RouterLink.cjs.map +1 -0
- package/dist/router/RouterLink/RouterLink.js +7 -0
- package/dist/router/RouterLink/RouterLink.js.map +1 -0
- package/dist/router/RouterLink/RouterLink.vue.d.cts +18 -0
- package/dist/router/RouterLink/RouterLink.vue.d.ts +19 -0
- package/dist/router/RouterLink/RouterLink.vue_vue_type_script_setup_true_lang.cjs +59 -0
- package/dist/router/RouterLink/RouterLink.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/router/RouterLink/RouterLink.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/router/RouterLink/RouterLink.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/router/RouterLink/index.cjs +3 -0
- package/dist/router/RouterLink/index.d.cts +3 -0
- package/dist/router/RouterLink/index.d.ts +3 -0
- package/dist/router/RouterLink/index.js +2 -0
- package/dist/router/RouterLink/types.cjs +0 -0
- package/dist/router/RouterLink/types.d.cts +11 -0
- package/dist/router/RouterLink/types.d.ts +11 -0
- package/dist/router/RouterLink/types.js +0 -0
- package/dist/router/RouterView/RouterView.cjs +6 -0
- package/dist/router/RouterView/RouterView.cjs.map +1 -0
- package/dist/router/RouterView/RouterView.js +7 -0
- package/dist/router/RouterView/RouterView.js.map +1 -0
- package/dist/router/RouterView/RouterView.vue.d.cts +6 -0
- package/dist/router/RouterView/RouterView.vue.d.ts +7 -0
- package/dist/router/RouterView/RouterView.vue_vue_type_script_setup_true_lang.cjs +58 -0
- package/dist/router/RouterView/RouterView.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/router/RouterView/RouterView.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/router/RouterView/RouterView.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/router/RouterView/index.cjs +3 -0
- package/dist/router/RouterView/index.d.cts +2 -0
- package/dist/router/RouterView/index.d.ts +2 -0
- package/dist/router/RouterView/index.js +2 -0
- package/dist/router/RouterView/types.cjs +0 -0
- package/dist/router/RouterView/types.d.cts +15 -0
- package/dist/router/RouterView/types.d.ts +15 -0
- package/dist/router/RouterView/types.js +0 -0
- package/dist/router/index.cjs +28 -0
- package/dist/router/index.d.cts +12 -0
- package/dist/router/index.d.ts +12 -0
- package/dist/router/index.js +18 -0
- package/dist/router/installRouter.cjs +34 -0
- package/dist/router/installRouter.cjs.map +1 -0
- package/dist/router/installRouter.d.cts +14 -0
- package/dist/router/installRouter.d.ts +14 -0
- package/dist/router/installRouter.js +33 -0
- package/dist/router/installRouter.js.map +1 -0
- package/dist/router/types.cjs +1 -0
- package/dist/router/types.d.cts +21 -0
- package/dist/router/types.d.ts +21 -0
- package/dist/router/types.js +1 -0
- package/dist/router/useLocation/index.cjs +3 -0
- package/dist/router/useLocation/index.d.cts +2 -0
- package/dist/router/useLocation/index.d.ts +2 -0
- package/dist/router/useLocation/index.js +2 -0
- package/dist/router/useLocation/useLocation.cjs +24 -0
- package/dist/router/useLocation/useLocation.cjs.map +1 -0
- package/dist/router/useLocation/useLocation.d.cts +12 -0
- package/dist/router/useLocation/useLocation.d.ts +12 -0
- package/dist/router/useLocation/useLocation.js +23 -0
- package/dist/router/useLocation/useLocation.js.map +1 -0
- package/dist/router/useNavigate/index.cjs +3 -0
- package/dist/router/useNavigate/index.d.cts +2 -0
- package/dist/router/useNavigate/index.d.ts +2 -0
- package/dist/router/useNavigate/index.js +2 -0
- package/dist/router/useNavigate/useNavigate.cjs +17 -0
- package/dist/router/useNavigate/useNavigate.cjs.map +1 -0
- package/dist/router/useNavigate/useNavigate.d.cts +12 -0
- package/dist/router/useNavigate/useNavigate.d.ts +12 -0
- package/dist/router/useNavigate/useNavigate.js +16 -0
- package/dist/router/useNavigate/useNavigate.js.map +1 -0
- package/dist/router/usePaths/index.cjs +3 -0
- package/dist/router/usePaths/index.d.cts +2 -0
- package/dist/router/usePaths/index.d.ts +2 -0
- package/dist/router/usePaths/index.js +2 -0
- package/dist/router/usePaths/usePaths.cjs +27 -0
- package/dist/router/usePaths/usePaths.cjs.map +1 -0
- package/dist/router/usePaths/usePaths.d.cts +14 -0
- package/dist/router/usePaths/usePaths.d.ts +14 -0
- package/dist/router/usePaths/usePaths.js +26 -0
- package/dist/router/usePaths/usePaths.js.map +1 -0
- package/dist/router/useRoute/index.cjs +3 -0
- package/dist/router/useRoute/index.d.cts +2 -0
- package/dist/router/useRoute/index.d.ts +2 -0
- package/dist/router/useRoute/index.js +2 -0
- package/dist/router/useRoute/useRoute.cjs +28 -0
- package/dist/router/useRoute/useRoute.cjs.map +1 -0
- package/dist/router/useRoute/useRoute.d.cts +12 -0
- package/dist/router/useRoute/useRoute.d.ts +12 -0
- package/dist/router/useRoute/useRoute.js +27 -0
- package/dist/router/useRoute/useRoute.js.map +1 -0
- package/dist/router/useRouter/index.cjs +3 -0
- package/dist/router/useRouter/index.d.cts +2 -0
- package/dist/router/useRouter/index.d.ts +2 -0
- package/dist/router/useRouter/index.js +2 -0
- package/dist/router/useRouter/useRouter.cjs +17 -0
- package/dist/router/useRouter/useRouter.cjs.map +1 -0
- package/dist/router/useRouter/useRouter.d.cts +12 -0
- package/dist/router/useRouter/useRouter.d.ts +12 -0
- package/dist/router/useRouter/useRouter.js +16 -0
- package/dist/router/useRouter/useRouter.js.map +1 -0
- package/dist/router/useRouterLink/index.cjs +3 -0
- package/dist/router/useRouterLink/index.d.cts +3 -0
- package/dist/router/useRouterLink/index.d.ts +3 -0
- package/dist/router/useRouterLink/index.js +2 -0
- package/dist/router/useRouterLink/types.cjs +0 -0
- package/dist/router/useRouterLink/types.d.cts +2 -0
- package/dist/router/useRouterLink/types.d.ts +2 -0
- package/dist/router/useRouterLink/types.js +0 -0
- package/dist/router/useRouterLink/useRouterLink.cjs +37 -0
- package/dist/router/useRouterLink/useRouterLink.cjs.map +1 -0
- package/dist/router/useRouterLink/useRouterLink.d.cts +13 -0
- package/dist/router/useRouterLink/useRouterLink.d.ts +13 -0
- package/dist/router/useRouterLink/useRouterLink.js +36 -0
- package/dist/router/useRouterLink/useRouterLink.js.map +1 -0
- package/dist/router/useSearchParams/index.cjs +3 -0
- package/dist/router/useSearchParams/index.d.cts +2 -0
- package/dist/router/useSearchParams/index.d.ts +2 -0
- package/dist/router/useSearchParams/index.js +2 -0
- package/dist/router/useSearchParams/useSearchParams.cjs +29 -0
- package/dist/router/useSearchParams/useSearchParams.cjs.map +1 -0
- package/dist/router/useSearchParams/useSearchParams.d.cts +14 -0
- package/dist/router/useSearchParams/useSearchParams.d.ts +14 -0
- package/dist/router/useSearchParams/useSearchParams.js +28 -0
- package/dist/router/useSearchParams/useSearchParams.js.map +1 -0
- package/dist/setContext/index.cjs +3 -0
- package/dist/setContext/index.d.cts +2 -0
- package/dist/setContext/index.d.ts +2 -0
- package/dist/setContext/index.js +2 -0
- package/dist/setContext/setContext.cjs +29 -0
- package/dist/setContext/setContext.cjs.map +1 -0
- package/dist/setContext/setContext.d.cts +24 -0
- package/dist/setContext/setContext.d.ts +24 -0
- package/dist/setContext/setContext.js +28 -0
- package/dist/setContext/setContext.js.map +1 -0
- package/dist/useBeforeMount/index.cjs +3 -0
- package/dist/useBeforeMount/index.d.cts +2 -0
- package/dist/useBeforeMount/index.d.ts +2 -0
- package/dist/useBeforeMount/index.js +2 -0
- package/dist/useBeforeMount/useBeforeMount.cjs +29 -0
- package/dist/useBeforeMount/useBeforeMount.cjs.map +1 -0
- package/dist/useBeforeMount/useBeforeMount.d.cts +24 -0
- package/dist/useBeforeMount/useBeforeMount.d.ts +24 -0
- package/dist/useBeforeMount/useBeforeMount.js +28 -0
- package/dist/useBeforeMount/useBeforeMount.js.map +1 -0
- package/dist/useBeforeUnmount/index.cjs +3 -0
- package/dist/useBeforeUnmount/index.d.cts +2 -0
- package/dist/useBeforeUnmount/index.d.ts +2 -0
- package/dist/useBeforeUnmount/index.js +2 -0
- package/dist/useBeforeUnmount/useBeforeUnmount.cjs +29 -0
- package/dist/useBeforeUnmount/useBeforeUnmount.cjs.map +1 -0
- package/dist/useBeforeUnmount/useBeforeUnmount.d.cts +24 -0
- package/dist/useBeforeUnmount/useBeforeUnmount.d.ts +24 -0
- package/dist/useBeforeUnmount/useBeforeUnmount.js +28 -0
- package/dist/useBeforeUnmount/useBeforeUnmount.js.map +1 -0
- package/dist/useChildren/index.cjs +3 -0
- package/dist/useChildren/index.d.cts +2 -0
- package/dist/useChildren/index.d.ts +2 -0
- package/dist/useChildren/index.js +2 -0
- package/dist/useChildren/useChildren.cjs +35 -0
- package/dist/useChildren/useChildren.cjs.map +1 -0
- package/dist/useChildren/useChildren.d.cts +26 -0
- package/dist/useChildren/useChildren.d.ts +26 -0
- package/dist/useChildren/useChildren.js +34 -0
- package/dist/useChildren/useChildren.js.map +1 -0
- package/dist/useColorScheme/index.cjs +3 -0
- package/dist/useColorScheme/index.d.cts +2 -0
- package/dist/useColorScheme/index.d.ts +2 -0
- package/dist/useColorScheme/index.js +2 -0
- package/dist/useColorScheme/useColorScheme.cjs +46 -0
- package/dist/useColorScheme/useColorScheme.cjs.map +1 -0
- package/dist/useColorScheme/useColorScheme.d.cts +29 -0
- package/dist/useColorScheme/useColorScheme.d.ts +29 -0
- package/dist/useColorScheme/useColorScheme.js +45 -0
- package/dist/useColorScheme/useColorScheme.js.map +1 -0
- package/dist/useMediator/index.cjs +3 -0
- package/dist/useMediator/index.d.cts +3 -0
- package/dist/useMediator/index.d.ts +3 -0
- package/dist/useMediator/index.js +2 -0
- package/dist/useMediator/types.cjs +0 -0
- package/dist/useMediator/types.d.cts +2 -0
- package/dist/useMediator/types.d.ts +2 -0
- package/dist/useMediator/types.js +0 -0
- package/dist/useMediator/useMediator.cjs +137 -0
- package/dist/useMediator/useMediator.cjs.map +1 -0
- package/dist/useMediator/useMediator.d.cts +61 -0
- package/dist/useMediator/useMediator.d.ts +61 -0
- package/dist/useMediator/useMediator.js +136 -0
- package/dist/useMediator/useMediator.js.map +1 -0
- package/dist/useMediator/utils.cjs +22 -0
- package/dist/useMediator/utils.cjs.map +1 -0
- package/dist/useMediator/utils.d.cts +14 -0
- package/dist/useMediator/utils.d.ts +14 -0
- package/dist/useMediator/utils.js +21 -0
- package/dist/useMediator/utils.js.map +1 -0
- package/dist/useMounted/index.cjs +3 -0
- package/dist/useMounted/index.d.cts +2 -0
- package/dist/useMounted/index.d.ts +2 -0
- package/dist/useMounted/index.js +2 -0
- package/dist/useMounted/useMounted.cjs +29 -0
- package/dist/useMounted/useMounted.cjs.map +1 -0
- package/dist/useMounted/useMounted.d.cts +24 -0
- package/dist/useMounted/useMounted.d.ts +24 -0
- package/dist/useMounted/useMounted.js +28 -0
- package/dist/useMounted/useMounted.js.map +1 -0
- package/dist/useRef/index.cjs +3 -0
- package/dist/useRef/index.d.cts +2 -0
- package/dist/useRef/index.d.ts +2 -0
- package/dist/useRef/index.js +2 -0
- package/dist/useRef/useRef.cjs +28 -0
- package/dist/useRef/useRef.cjs.map +1 -0
- package/dist/useRef/useRef.d.cts +25 -0
- package/dist/useRef/useRef.d.ts +25 -0
- package/dist/useRef/useRef.js +27 -0
- package/dist/useRef/useRef.js.map +1 -0
- package/dist/withDefaultProps/constants.cjs +10 -0
- package/dist/withDefaultProps/constants.cjs.map +1 -0
- package/dist/withDefaultProps/constants.d.cts +8 -0
- package/dist/withDefaultProps/constants.d.ts +8 -0
- package/dist/withDefaultProps/constants.js +9 -0
- package/dist/withDefaultProps/constants.js.map +1 -0
- package/dist/withDefaultProps/index.cjs +3 -0
- package/dist/withDefaultProps/index.d.cts +3 -0
- package/dist/withDefaultProps/index.d.ts +3 -0
- package/dist/withDefaultProps/index.js +2 -0
- package/dist/withDefaultProps/types.cjs +0 -0
- package/dist/withDefaultProps/types.d.cts +25 -0
- package/dist/withDefaultProps/types.d.ts +25 -0
- package/dist/withDefaultProps/types.js +0 -0
- package/dist/withDefaultProps/withDefaultProps.cjs +85 -0
- package/dist/withDefaultProps/withDefaultProps.cjs.map +1 -0
- package/dist/withDefaultProps/withDefaultProps.d.cts +48 -0
- package/dist/withDefaultProps/withDefaultProps.d.ts +48 -0
- package/dist/withDefaultProps/withDefaultProps.js +84 -0
- package/dist/withDefaultProps/withDefaultProps.js.map +1 -0
- package/dist/withDefaultPropsHandlers/constants.cjs +7 -0
- package/dist/withDefaultPropsHandlers/constants.cjs.map +1 -0
- package/dist/withDefaultPropsHandlers/constants.d.cts +5 -0
- package/dist/withDefaultPropsHandlers/constants.d.ts +5 -0
- package/dist/withDefaultPropsHandlers/constants.js +6 -0
- package/dist/withDefaultPropsHandlers/constants.js.map +1 -0
- package/dist/withDefaultPropsHandlers/index.cjs +3 -0
- package/dist/withDefaultPropsHandlers/index.d.cts +3 -0
- package/dist/withDefaultPropsHandlers/index.d.ts +3 -0
- package/dist/withDefaultPropsHandlers/index.js +2 -0
- package/dist/withDefaultPropsHandlers/types.cjs +0 -0
- package/dist/withDefaultPropsHandlers/types.d.cts +12 -0
- package/dist/withDefaultPropsHandlers/types.d.ts +12 -0
- package/dist/withDefaultPropsHandlers/types.js +0 -0
- package/dist/withDefaultPropsHandlers/withDefaultPropsHandlers.cjs +81 -0
- package/dist/withDefaultPropsHandlers/withDefaultPropsHandlers.cjs.map +1 -0
- package/dist/withDefaultPropsHandlers/withDefaultPropsHandlers.d.cts +49 -0
- package/dist/withDefaultPropsHandlers/withDefaultPropsHandlers.d.ts +49 -0
- package/dist/withDefaultPropsHandlers/withDefaultPropsHandlers.js +80 -0
- package/dist/withDefaultPropsHandlers/withDefaultPropsHandlers.js.map +1 -0
- package/package.json +647 -0
package/README.md
ADDED
|
@@ -0,0 +1,1455 @@
|
|
|
1
|
+
# @pastweb/vue
|
|
2
|
+
|
|
3
|
+
Vue integration package for building tools-powered Vue applications.
|
|
4
|
+
|
|
5
|
+
It provides Vue-specific bindings for the framework-agnostic primitives in `@pastweb/tools`: API/query composables, router integration, entry composition, portals, rendering helpers, context helpers, lifecycle utilities, and Vue utility composables. Use it as a standalone Vue utility layer or as part of a larger Pastweb-based stack.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Tools-first architecture** - Vue composables and components wrap the core `@pastweb/tools` functionality instead of replacing it.
|
|
10
|
+
- **API/query integration** - Vue wrappers for query cache access, `useQuery`, `useMutation`, `useQueries`, `useInfiniteQuery`, and reusable query state.
|
|
11
|
+
- **Router integration** - Vue components and composables for `createViewRouter`.
|
|
12
|
+
- **Entry composition** - Vue entry helpers for mounting, updating, plugins, components, directives, and async waits.
|
|
13
|
+
- **Portal support** - Vue components and composables for portal descriptors and anchors.
|
|
14
|
+
- **TypeScript-first** - Public APIs include TSDoc and exported types for app-level integration.
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm i -S @pastweb/vue
|
|
20
|
+
# or
|
|
21
|
+
pnpm i -S @pastweb/vue
|
|
22
|
+
# or
|
|
23
|
+
yarn add -S @pastweb/vue
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Documentation Overview
|
|
27
|
+
|
|
28
|
+
The documentation is organized into the following major categories. Each section provides syntax notes, practical examples, and integration guidance where useful.
|
|
29
|
+
|
|
30
|
+
- **Core functions** - `getContext` and `setContext` helpers for sharing Vue-provided values.
|
|
31
|
+
- **API functions** - Query cache installer and Vue wrappers around tools API hooks.
|
|
32
|
+
- **Async functions** - Pinia async store helpers and color-scheme composable factory.
|
|
33
|
+
- **Routing** - Vue integration for `createViewRouter`.
|
|
34
|
+
- **Element functions** - Entry rendering, islands, portals, slots, and UI composition helpers.
|
|
35
|
+
- **Hook functions** - Vue lifecycle and mediator composables.
|
|
36
|
+
- **Utility functions** - Small Vue utilities such as `Render`, `computed`, `useRef`, `getEventHandlers`, `withDefaultProps`, and `withDefaultPropsHandlers`.
|
|
37
|
+
|
|
38
|
+
This project is distributed under the MIT licence.
|
|
39
|
+
|
|
40
|
+
## Summary
|
|
41
|
+
|
|
42
|
+
- [Core functions](#core-functions)
|
|
43
|
+
- [getContext](#getcontext)
|
|
44
|
+
- [setContext](#setcontext)
|
|
45
|
+
- [API functions](#api-functions)
|
|
46
|
+
- [installApiCache](#installapicache)
|
|
47
|
+
- [useApiQueryCache](#useapiquerycache)
|
|
48
|
+
- [reuseQuery](#reusequery)
|
|
49
|
+
- [reuseMutation](#reusemutation)
|
|
50
|
+
- [useQuery](#usequery)
|
|
51
|
+
- [useMutation](#usemutation)
|
|
52
|
+
- [useQueries](#usequeries)
|
|
53
|
+
- [useInfiniteQuery](#useinfinitequery)
|
|
54
|
+
- [Async functions](#async-functions)
|
|
55
|
+
- [createPiniaAsyncStore](#createpiniaasyncstore)
|
|
56
|
+
- [useColorScheme](#usecolorscheme)
|
|
57
|
+
- [Routing](#routing)
|
|
58
|
+
- [createRouter](#createrouter)
|
|
59
|
+
- [RouterView](#routerview)
|
|
60
|
+
- [RouterLink](#routerlink)
|
|
61
|
+
- [useLocation](#uselocation)
|
|
62
|
+
- [useNavigate](#usenavigate)
|
|
63
|
+
- [usePaths](#usepaths)
|
|
64
|
+
- [useRoute](#useroute)
|
|
65
|
+
- [useRouter](#userouter)
|
|
66
|
+
- [useRouterLink](#userouterlink)
|
|
67
|
+
- [useSearchParams](#usesearchparams)
|
|
68
|
+
- [Element functions](#element-functions)
|
|
69
|
+
- [createEntry](#createentry)
|
|
70
|
+
- [createServerEntry](#createserverentry)
|
|
71
|
+
- [EntryAdapter](#entryadapter)
|
|
72
|
+
- [Island](#island)
|
|
73
|
+
- [portals](#portals)
|
|
74
|
+
- [Render](#render)
|
|
75
|
+
- [Slot](#slot)
|
|
76
|
+
- [Hook functions](#hook-functions)
|
|
77
|
+
- [useBeforeMount](#usebeforemount)
|
|
78
|
+
- [useBeforeUnmount](#usebeforeunmount)
|
|
79
|
+
- [useMediator](#usemediator)
|
|
80
|
+
- [useMounted](#usemounted)
|
|
81
|
+
- [useRef](#useref)
|
|
82
|
+
- [Utility functions](#utility-functions)
|
|
83
|
+
- [computed](#computed)
|
|
84
|
+
- [useChildren](#usechildren)
|
|
85
|
+
- [withDefaultProps](#withdefaultprops)
|
|
86
|
+
- [getEventHandlers](#geteventhandlers)
|
|
87
|
+
- [withDefaultPropsHandlers](#withdefaultpropshandlers)
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
## Core functions
|
|
91
|
+
|
|
92
|
+
### `getContext`
|
|
93
|
+
|
|
94
|
+
Reads one value from the active Vue dependency-injection context.
|
|
95
|
+
|
|
96
|
+
Use `getContext` inside component setup or inside composables that run during setup. Package composables should use this helper instead of importing Vue `inject` directly, so context access stays consistent across the Vue integration.
|
|
97
|
+
|
|
98
|
+
> #### Syntax
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
function getContext<T = any>(key: string): T;
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Parameters
|
|
105
|
+
* `key`: `string`
|
|
106
|
+
* Context key that was provided with `setContext`, a Vue plugin, or another Vue provider.
|
|
107
|
+
|
|
108
|
+
Returns
|
|
109
|
+
* `T`
|
|
110
|
+
* The injected value cast to `T`. Include `undefined` in `T` when the provider is optional.
|
|
111
|
+
|
|
112
|
+
**Example:**
|
|
113
|
+
```ts
|
|
114
|
+
import { getContext, setContext } from '@pastweb/vue';
|
|
115
|
+
|
|
116
|
+
setContext('session', { userId: 'user-1' });
|
|
117
|
+
const session = getContext<{ userId: string }>('session');
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### `setContext`
|
|
121
|
+
|
|
122
|
+
Provides one value through Vue dependency injection.
|
|
123
|
+
|
|
124
|
+
Call it during component setup or inside a composable that runs during setup. Use it instead of importing Vue `provide` directly in package composables.
|
|
125
|
+
|
|
126
|
+
> #### Syntax
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
function setContext<T = undefined>(key: string, value: T): void;
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Example:**
|
|
133
|
+
```ts
|
|
134
|
+
import { setContext } from '@pastweb/vue';
|
|
135
|
+
|
|
136
|
+
setContext('session', { userId: 'user-1' });
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
## API functions
|
|
141
|
+
|
|
142
|
+
The API helpers are Vue wrappers around the framework-agnostic query/cache primitives from `@pastweb/tools`. The cache and agent still live in `tools`; this package provides Vue app installation, injection access, and Vue render updates for the reactive query states.
|
|
143
|
+
|
|
144
|
+
### `installApiCache`
|
|
145
|
+
|
|
146
|
+
Creates a Vue plugin that provides a `QueryCache` to API composables.
|
|
147
|
+
|
|
148
|
+
> #### Syntax
|
|
149
|
+
|
|
150
|
+
```ts
|
|
151
|
+
function installApiCache(options: ApiCacheOptions): ApiCachePlugin
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Example:**
|
|
155
|
+
```ts
|
|
156
|
+
import { createApp } from 'vue';
|
|
157
|
+
import { createQueryCache } from '@pastweb/tools';
|
|
158
|
+
import { installApiCache } from '@pastweb/vue';
|
|
159
|
+
import App from './App.vue';
|
|
160
|
+
|
|
161
|
+
const queryCache = createQueryCache();
|
|
162
|
+
|
|
163
|
+
createApp(App)
|
|
164
|
+
.use(installApiCache({ queryCache }))
|
|
165
|
+
.mount('#app');
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### `useApiQueryCache`
|
|
169
|
+
|
|
170
|
+
Returns the active `QueryCache` installed with `installApiCache`.
|
|
171
|
+
|
|
172
|
+
> #### Syntax
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
function useApiQueryCache(): QueryCache
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**Example:**
|
|
179
|
+
```ts
|
|
180
|
+
import { useApiQueryCache } from '@pastweb/vue';
|
|
181
|
+
|
|
182
|
+
const queryCache = useApiQueryCache();
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### `reuseQuery`
|
|
186
|
+
|
|
187
|
+
Bridges any tools reactive query-like state into Vue rendering. The returned object keeps the tools state shape, and Vue components update when its enumerable fields change.
|
|
188
|
+
|
|
189
|
+
> #### Syntax
|
|
190
|
+
|
|
191
|
+
```ts
|
|
192
|
+
function reuseQuery<TState extends Record<PropertyKey, any>>( createState: () => TState ): TState
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Example:**
|
|
196
|
+
```ts
|
|
197
|
+
import { createApiAgent, createQueryCache, useQuery as createToolsQuery } from '@pastweb/tools';
|
|
198
|
+
import { reuseQuery } from '@pastweb/vue';
|
|
199
|
+
|
|
200
|
+
const queryCache = createQueryCache();
|
|
201
|
+
const agent = createApiAgent({ queryCache });
|
|
202
|
+
|
|
203
|
+
export function useUsers() {
|
|
204
|
+
return reuseQuery(() => createToolsQuery({
|
|
205
|
+
fn: () => agent.get('/api/users', { queryKey: ['users'] }),
|
|
206
|
+
}));
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### `reuseMutation`
|
|
211
|
+
|
|
212
|
+
Alias of `reuseQuery` for mutation-style state. It uses the same implementation, but makes custom mutation composables easier to read.
|
|
213
|
+
|
|
214
|
+
> #### Syntax
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
function reuseMutation<TState extends Record<PropertyKey, any>>(
|
|
218
|
+
createState: () => TState,
|
|
219
|
+
): TState
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**Example:**
|
|
223
|
+
```ts
|
|
224
|
+
import { useMutation as createToolsMutation } from '@pastweb/tools';
|
|
225
|
+
import { reuseMutation } from '@pastweb/vue';
|
|
226
|
+
|
|
227
|
+
export function useSaveUser(agent: Agent) {
|
|
228
|
+
return reuseMutation(() => createToolsMutation({
|
|
229
|
+
fn: user => agent.post('/api/users', user),
|
|
230
|
+
}));
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### `useQuery`
|
|
235
|
+
|
|
236
|
+
Vue wrapper for `@pastweb/tools` `useQuery`.
|
|
237
|
+
|
|
238
|
+
> #### Syntax
|
|
239
|
+
|
|
240
|
+
```ts
|
|
241
|
+
function useQuery<T>(config: QueryConfig<T>): QueryInfo<T>
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
**Example:**
|
|
245
|
+
```vue
|
|
246
|
+
<script setup lang="ts">
|
|
247
|
+
import { useQuery } from '@pastweb/vue';
|
|
248
|
+
|
|
249
|
+
const users = useQuery({
|
|
250
|
+
fn: () => agent.get('/api/users', { queryKey: ['users'] }),
|
|
251
|
+
});
|
|
252
|
+
</script>
|
|
253
|
+
|
|
254
|
+
<template>
|
|
255
|
+
<span v-if="users.isLoading">Loading...</span>
|
|
256
|
+
<span v-else-if="users.isError">Could not load users</span>
|
|
257
|
+
<ul v-else>
|
|
258
|
+
<li v-for="user in users.data ?? []" :key="user.id">
|
|
259
|
+
{{ user.name }}
|
|
260
|
+
</li>
|
|
261
|
+
</ul>
|
|
262
|
+
</template>
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### `useMutation`
|
|
266
|
+
|
|
267
|
+
Vue wrapper for `@pastweb/tools` `useMutation`.
|
|
268
|
+
|
|
269
|
+
> #### Syntax
|
|
270
|
+
|
|
271
|
+
```ts
|
|
272
|
+
function useMutation<T>(config: MutationConfig<T>): MutationInfo<T>
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**Example:**
|
|
276
|
+
```vue
|
|
277
|
+
<script setup lang="ts">
|
|
278
|
+
import { useMutation } from '@pastweb/vue';
|
|
279
|
+
|
|
280
|
+
const saveUser = useMutation({
|
|
281
|
+
fn: payload => agent.post('/api/users', payload),
|
|
282
|
+
});
|
|
283
|
+
</script>
|
|
284
|
+
|
|
285
|
+
<template>
|
|
286
|
+
<button :disabled="saveUser.isMutating" @click="saveUser.mutate(user)">
|
|
287
|
+
Save
|
|
288
|
+
</button>
|
|
289
|
+
</template>
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### `useQueries`
|
|
293
|
+
|
|
294
|
+
Vue wrapper for multiple tools queries.
|
|
295
|
+
|
|
296
|
+
> #### Syntax
|
|
297
|
+
|
|
298
|
+
```ts
|
|
299
|
+
function useQueries<T extends readonly QueryConfig<any>[]>(
|
|
300
|
+
config: UseQueriesInput<T>,
|
|
301
|
+
): UseQueriesInfo<T>
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**Example:**
|
|
305
|
+
```ts
|
|
306
|
+
const dashboard = useQueries({
|
|
307
|
+
queries: [
|
|
308
|
+
{ fn: () => agent.get('/api/users', { queryKey: ['users'] }) },
|
|
309
|
+
{ fn: () => agent.get('/api/posts', { queryKey: ['posts'] }) },
|
|
310
|
+
],
|
|
311
|
+
});
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### `useInfiniteQuery`
|
|
315
|
+
|
|
316
|
+
Vue wrapper for paginated tools queries.
|
|
317
|
+
|
|
318
|
+
> #### Syntax
|
|
319
|
+
|
|
320
|
+
```ts
|
|
321
|
+
function useInfiniteQuery<TPage, TPageParam = unknown>(
|
|
322
|
+
config: InfiniteQueryConfig<TPage, TPageParam>,
|
|
323
|
+
): InfiniteQueryInfo<TPage, TPageParam>
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
**Example:**
|
|
327
|
+
```vue
|
|
328
|
+
<script setup lang="ts">
|
|
329
|
+
import { useInfiniteQuery } from '@pastweb/vue';
|
|
330
|
+
|
|
331
|
+
const posts = useInfiniteQuery({
|
|
332
|
+
initialPageParam: 1,
|
|
333
|
+
fn: page => agent.get(`/api/posts?page=${page}`, {
|
|
334
|
+
queryKey: ['posts', page],
|
|
335
|
+
}),
|
|
336
|
+
});
|
|
337
|
+
</script>
|
|
338
|
+
|
|
339
|
+
<template>
|
|
340
|
+
<button :disabled="!posts.hasNextPage" @click="posts.fetchNextPage">
|
|
341
|
+
More
|
|
342
|
+
</button>
|
|
343
|
+
</template>
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
## Async functions
|
|
348
|
+
|
|
349
|
+
### `createPiniaAsyncStore`
|
|
350
|
+
|
|
351
|
+
Creates a Pinia-flavored async store wrapper around tools async store primitives. The returned async store includes a Pinia instance on `store`; calling `init()` runs `onInit(pinia)` and marks the store as ready once initialization completes.
|
|
352
|
+
|
|
353
|
+
Use it when a store needs to initialize asynchronously before the application starts reading from it.
|
|
354
|
+
|
|
355
|
+
> #### Syntax
|
|
356
|
+
|
|
357
|
+
```ts
|
|
358
|
+
function createPiniaAsyncStore(options: PiniaStoreOptions): PiniaAsyncStore
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Parameters
|
|
362
|
+
|
|
363
|
+
* `name`: `string` _(optional)_
|
|
364
|
+
* Optional name suffix for the underlying async store. The generated name is `PiniaAsyncStore` or `PiniaAsyncStore:name`.
|
|
365
|
+
* `onInit`: `(pinia: Pinia) => Promise<void> | void` _(optional)_
|
|
366
|
+
* Initialization callback called with the created Pinia instance.
|
|
367
|
+
|
|
368
|
+
Returns
|
|
369
|
+
|
|
370
|
+
* `PiniaAsyncStore`
|
|
371
|
+
* A tools async store with a `store` property containing the Pinia instance.
|
|
372
|
+
|
|
373
|
+
**Example:**
|
|
374
|
+
```ts
|
|
375
|
+
import { createApp } from 'vue';
|
|
376
|
+
import { createPiniaAsyncStore } from '@pastweb/vue/createPiniaAsyncStore';
|
|
377
|
+
import App from './App.vue';
|
|
378
|
+
|
|
379
|
+
const app = createApp(App);
|
|
380
|
+
|
|
381
|
+
export const piniaStore = createPiniaAsyncStore({
|
|
382
|
+
name: 'app',
|
|
383
|
+
async onInit(pinia) {
|
|
384
|
+
app.use(pinia);
|
|
385
|
+
},
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
await piniaStore.init();
|
|
389
|
+
await piniaStore.isReady;
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### `useColorScheme`
|
|
393
|
+
|
|
394
|
+
Vue composable for color-scheme state from `@pastweb/tools`. Pass options to create an internal `MatchScheme`, or pass a pre-created `MatchScheme` as the second argument.
|
|
395
|
+
|
|
396
|
+
> #### Syntax
|
|
397
|
+
|
|
398
|
+
```ts
|
|
399
|
+
function useColorScheme(options?: SchemeOptions, matchScheme?: MatchScheme): [ColorSchemeInfo, (mode: string) => void]
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
**Example:**
|
|
403
|
+
```ts
|
|
404
|
+
import { useColorScheme } from '@pastweb/vue';
|
|
405
|
+
|
|
406
|
+
const [info, setMode] = useColorScheme({ defaultMode: 'auto' });
|
|
407
|
+
|
|
408
|
+
setMode('dark');
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
## Routing
|
|
413
|
+
|
|
414
|
+
The router helpers integrate Vue with `createViewRouter` from `@pastweb/tools`. The tools router owns the route matching and reactive router state; this package provides Vue plugin installation, Vue dependency-injection access, and Vue-friendly reactive mirrors for components and composables.
|
|
415
|
+
|
|
416
|
+
### `createRouter`
|
|
417
|
+
|
|
418
|
+
Creates a Vue plugin for a tools `ViewRouter`. It provides the router under the shared tools router context key, initializes route depth for nested `RouterView` components, and registers `RouterView` and `RouterLink` globally.
|
|
419
|
+
|
|
420
|
+
> #### Syntax
|
|
421
|
+
|
|
422
|
+
```ts
|
|
423
|
+
function createRouter(router: ViewRouter): Plugin;
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
**Example:**
|
|
427
|
+
```ts
|
|
428
|
+
import { createViewRouter, type Route } from '@pastweb/tools/createViewRouter';
|
|
429
|
+
import { createRouter, RouterView } from '@pastweb/vue';
|
|
430
|
+
|
|
431
|
+
const router = createViewRouter({
|
|
432
|
+
routes: routes as Route[],
|
|
433
|
+
RouterView,
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
app.use(createRouter(router));
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
### `RouterView`
|
|
440
|
+
|
|
441
|
+
Renders the selected route view for the active route depth. Named views use the `name` prop and route props are read from `route.meta.props`.
|
|
442
|
+
|
|
443
|
+
> #### Syntax
|
|
444
|
+
|
|
445
|
+
```ts
|
|
446
|
+
type RouterViewProps = {
|
|
447
|
+
name?: string;
|
|
448
|
+
};
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
**Example:**
|
|
452
|
+
```vue
|
|
453
|
+
<template>
|
|
454
|
+
<RouterView />
|
|
455
|
+
</template>
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
**Example with route props:**
|
|
459
|
+
```ts
|
|
460
|
+
const routes = [{
|
|
461
|
+
path: '/user/:id',
|
|
462
|
+
view: UserPage,
|
|
463
|
+
meta: {
|
|
464
|
+
props: {
|
|
465
|
+
title: 'User profile',
|
|
466
|
+
},
|
|
467
|
+
},
|
|
468
|
+
}];
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
### `RouterLink`
|
|
472
|
+
|
|
473
|
+
Renders an anchor whose `href`, active state, and click navigation come from `router.getRouterLink`.
|
|
474
|
+
|
|
475
|
+
> #### Syntax
|
|
476
|
+
|
|
477
|
+
```ts
|
|
478
|
+
type RouterLinkProps = RouterLinkOptions & {
|
|
479
|
+
className?: string;
|
|
480
|
+
preventNavigate?: boolean;
|
|
481
|
+
};
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
**Example:**
|
|
485
|
+
```vue
|
|
486
|
+
<RouterLink
|
|
487
|
+
path="/users/:id"
|
|
488
|
+
:params="{ id: 123 }"
|
|
489
|
+
:search-params="new URLSearchParams({ tab: 'profile' })"
|
|
490
|
+
hash="details"
|
|
491
|
+
>
|
|
492
|
+
User profile
|
|
493
|
+
</RouterLink>
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
### `useLocation`
|
|
497
|
+
|
|
498
|
+
Returns a Vue reactive mirror of the current tools router location.
|
|
499
|
+
|
|
500
|
+
> #### Syntax
|
|
501
|
+
|
|
502
|
+
```ts
|
|
503
|
+
function useLocation(): Location
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
**Example:**
|
|
507
|
+
```vue
|
|
508
|
+
<script setup lang="ts">
|
|
509
|
+
import { useLocation } from '@pastweb/vue';
|
|
510
|
+
|
|
511
|
+
const location = useLocation();
|
|
512
|
+
</script>
|
|
513
|
+
|
|
514
|
+
<template>
|
|
515
|
+
<span>{{ location.pathname }}</span>
|
|
516
|
+
</template>
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
### `useNavigate`
|
|
520
|
+
|
|
521
|
+
Returns the router navigation function.
|
|
522
|
+
|
|
523
|
+
> #### Syntax
|
|
524
|
+
|
|
525
|
+
```ts
|
|
526
|
+
function useNavigate(): ViewRouter['navigate']
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
**Example:**
|
|
530
|
+
```vue
|
|
531
|
+
<script setup lang="ts">
|
|
532
|
+
import { useNavigate } from '@pastweb/vue';
|
|
533
|
+
|
|
534
|
+
const navigate = useNavigate();
|
|
535
|
+
</script>
|
|
536
|
+
|
|
537
|
+
<template>
|
|
538
|
+
<button @click="navigate('/settings')">
|
|
539
|
+
Settings
|
|
540
|
+
</button>
|
|
541
|
+
</template>
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
### `usePaths`
|
|
545
|
+
|
|
546
|
+
Returns a Vue reactive route array filtered by the tools `filterRoutes` helper.
|
|
547
|
+
|
|
548
|
+
> #### Syntax
|
|
549
|
+
|
|
550
|
+
```ts
|
|
551
|
+
function usePaths(filter?: FilterDescriptor): Route[]
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
**Example:**
|
|
555
|
+
```vue
|
|
556
|
+
<script setup lang="ts">
|
|
557
|
+
import { usePaths, RouterLink } from '@pastweb/vue';
|
|
558
|
+
|
|
559
|
+
const docsPaths = usePaths({
|
|
560
|
+
section: 'docs',
|
|
561
|
+
});
|
|
562
|
+
</script>
|
|
563
|
+
|
|
564
|
+
<template>
|
|
565
|
+
<nav>
|
|
566
|
+
<RouterLink
|
|
567
|
+
v-for="route in docsPaths"
|
|
568
|
+
:key="route.path"
|
|
569
|
+
:path="route.path"
|
|
570
|
+
>
|
|
571
|
+
{{ route.meta?.title || route.path }}
|
|
572
|
+
</RouterLink>
|
|
573
|
+
</nav>
|
|
574
|
+
</template>
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
### `useRoute`
|
|
578
|
+
|
|
579
|
+
Returns a Vue reactive mirror of the selected route for the current view depth.
|
|
580
|
+
|
|
581
|
+
### `useRouter`
|
|
582
|
+
|
|
583
|
+
Returns the active tools `ViewRouter`.
|
|
584
|
+
|
|
585
|
+
**Example:**
|
|
586
|
+
```vue
|
|
587
|
+
<script setup lang="ts">
|
|
588
|
+
import { useRouter } from '@pastweb/vue';
|
|
589
|
+
|
|
590
|
+
const router = useRouter();
|
|
591
|
+
|
|
592
|
+
async function refreshRoute() {
|
|
593
|
+
await router.navigate(router.location.pathname);
|
|
594
|
+
}
|
|
595
|
+
</script>
|
|
596
|
+
|
|
597
|
+
<template>
|
|
598
|
+
<button @click="refreshRoute">
|
|
599
|
+
Refresh route
|
|
600
|
+
</button>
|
|
601
|
+
</template>
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
### `useRouterLink`
|
|
605
|
+
|
|
606
|
+
Returns a Vue reactive router link descriptor for a route target. The descriptor includes `pathname`, `isActive`, `isExactActive`, and `navigate`.
|
|
607
|
+
|
|
608
|
+
**Example:**
|
|
609
|
+
```vue
|
|
610
|
+
<script setup lang="ts">
|
|
611
|
+
import { useRouterLink } from '@pastweb/vue';
|
|
612
|
+
|
|
613
|
+
const link = useRouterLink({
|
|
614
|
+
path: '/users/:id',
|
|
615
|
+
params: { id: 123 },
|
|
616
|
+
searchParams: new URLSearchParams({ tab: 'profile' }),
|
|
617
|
+
});
|
|
618
|
+
</script>
|
|
619
|
+
|
|
620
|
+
<template>
|
|
621
|
+
<a
|
|
622
|
+
:href="link.pathname"
|
|
623
|
+
:aria-current="link.isExactActive ? 'page' : undefined"
|
|
624
|
+
@click.prevent="link.navigate()"
|
|
625
|
+
>
|
|
626
|
+
User profile
|
|
627
|
+
</a>
|
|
628
|
+
</template>
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
### `useSearchParams`
|
|
632
|
+
|
|
633
|
+
Returns URL search parameters for the current location and the router `setSearchParams` method.
|
|
634
|
+
|
|
635
|
+
**Example:**
|
|
636
|
+
```vue
|
|
637
|
+
<script setup lang="ts">
|
|
638
|
+
import { computed, useSearchParams } from '@pastweb/vue';
|
|
639
|
+
|
|
640
|
+
const search = useSearchParams();
|
|
641
|
+
const view = computed(() => search.params.get('view') || 'grid');
|
|
642
|
+
|
|
643
|
+
function setView(value: string) {
|
|
644
|
+
const params = new URLSearchParams(search.params);
|
|
645
|
+
params.set('view', value);
|
|
646
|
+
search.setSearchParams(params);
|
|
647
|
+
}
|
|
648
|
+
</script>
|
|
649
|
+
|
|
650
|
+
<template>
|
|
651
|
+
<button :aria-pressed="view === 'grid'" @click="setView('grid')">
|
|
652
|
+
Grid
|
|
653
|
+
</button>
|
|
654
|
+
<button :aria-pressed="view === 'list'" @click="setView('list')">
|
|
655
|
+
List
|
|
656
|
+
</button>
|
|
657
|
+
</template>
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
---
|
|
661
|
+
## Element functions
|
|
662
|
+
|
|
663
|
+
### `createEntry`
|
|
664
|
+
|
|
665
|
+
Creates a browser-side Vue entry object that can mount, hydrate, update, and unmount a Vue application. It supports Vue plugins, component/directive registration, and async wait/fallback configuration.
|
|
666
|
+
|
|
667
|
+
**Example:**
|
|
668
|
+
```ts
|
|
669
|
+
import { createEntry } from '@pastweb/vue';
|
|
670
|
+
import App from './App.vue';
|
|
671
|
+
|
|
672
|
+
const entry = createEntry({
|
|
673
|
+
EntryComponent: App,
|
|
674
|
+
querySelector: '#app',
|
|
675
|
+
use: [installApiCache({ queryCache })],
|
|
676
|
+
});
|
|
677
|
+
|
|
678
|
+
entry.mount();
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
### `createServerEntry`
|
|
682
|
+
|
|
683
|
+
Creates a server-side Vue entry object that renders with Vue SSR and memoizes the result through the tools SSR composition helpers. Use this for server rendering; use `createEntry` for browser mounting and hydration.
|
|
684
|
+
|
|
685
|
+
> #### Syntax
|
|
686
|
+
|
|
687
|
+
```ts
|
|
688
|
+
function createServerEntry(options?: VueEntryOptions): VueEntry
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
**Example:**
|
|
692
|
+
```ts
|
|
693
|
+
import { createServerEntry } from '@pastweb/vue';
|
|
694
|
+
import App from './App.vue';
|
|
695
|
+
|
|
696
|
+
const entry = createServerEntry({
|
|
697
|
+
EntryComponent: App,
|
|
698
|
+
initData: {
|
|
699
|
+
title: 'Hello from SSR',
|
|
700
|
+
},
|
|
701
|
+
});
|
|
702
|
+
|
|
703
|
+
const ssrId = entry.mount();
|
|
704
|
+
const html = await entry.getComposedSSR();
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
### `EntryAdapter`
|
|
708
|
+
|
|
709
|
+
`EntryAdapter` renders an entry inside a Vue tree. On the client it mounts the `entry` returned by `createEntry`; on the server it can load a separate `ssrEntry` through the SSR async task queue, keeping the server renderer out of the client bundle.
|
|
710
|
+
|
|
711
|
+
If your renderer uses the same entry implementation on client and server, omit `ssrEntry`; `EntryAdapter` will use `entry` during SSR too. `ssrEntry` is declared as an adapter prop, so it is not forwarded to the nested entry `initData` or update payload.
|
|
712
|
+
|
|
713
|
+
**Example:**
|
|
714
|
+
```vue
|
|
715
|
+
<script setup lang="ts">
|
|
716
|
+
import { createEntry, EntryAdapter } from '@pastweb/vue';
|
|
717
|
+
import ProfileCard from './ProfileCard.vue';
|
|
718
|
+
|
|
719
|
+
function createProfileEntry() {
|
|
720
|
+
return createEntry({
|
|
721
|
+
EntryComponent: ProfileCard,
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
const createProfileServerEntry = import.meta.env.SSR
|
|
726
|
+
? () => import('./profile.server-entry').then(module => module.createProfileServerEntry())
|
|
727
|
+
: undefined;
|
|
728
|
+
</script>
|
|
729
|
+
|
|
730
|
+
<template>
|
|
731
|
+
<EntryAdapter
|
|
732
|
+
:entry="createProfileEntry"
|
|
733
|
+
:ssr-entry="createProfileServerEntry"
|
|
734
|
+
:user-id="userId"
|
|
735
|
+
/>
|
|
736
|
+
</template>
|
|
737
|
+
```
|
|
738
|
+
|
|
739
|
+
`EntryAdapter` also reads the nearest `Island` context. When rendered inside an `Island`, the nested entry hydrates existing server markup; outside an island it mounts normally.
|
|
740
|
+
|
|
741
|
+
### `Island`
|
|
742
|
+
|
|
743
|
+
Hydration-aware component for browser-only or delayed rendering strategies.
|
|
744
|
+
|
|
745
|
+
**Example:**
|
|
746
|
+
```vue
|
|
747
|
+
<script setup lang="ts">
|
|
748
|
+
import { Island, EntryAdapter } from '@pastweb/vue';
|
|
749
|
+
import { createProfileEntry } from './profile.entry';
|
|
750
|
+
</script>
|
|
751
|
+
|
|
752
|
+
<template>
|
|
753
|
+
<Island client="visible" island-id="profile-card">
|
|
754
|
+
<EntryAdapter :entry="createProfileEntry" user-id="123" />
|
|
755
|
+
</Island>
|
|
756
|
+
</template>
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
### `portals`
|
|
760
|
+
|
|
761
|
+
Portal helpers provide portal anchors and render portal content through Vue components and composables. The actual portal lifecycle is powered by `@pastweb/tools`; this package installs the descriptors into Vue dependency injection and exposes Vue-friendly composables/components.
|
|
762
|
+
|
|
763
|
+
#### `installPortals`
|
|
764
|
+
|
|
765
|
+
Creates a Vue plugin that provides portal descriptors and anchor ids.
|
|
766
|
+
|
|
767
|
+
```ts
|
|
768
|
+
function installPortals(options: PortalsOptions): {
|
|
769
|
+
install(app: App): void;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
interface PortalsOptions {
|
|
773
|
+
anchorsIds: PortalAnchorsIds;
|
|
774
|
+
getEntry: (props: Record<string, any>, component: Component | VNode | null) => VueEntry;
|
|
775
|
+
idChahe?: IdCache;
|
|
776
|
+
portalsCache?: Portals;
|
|
777
|
+
}
|
|
778
|
+
```
|
|
779
|
+
|
|
780
|
+
**Example:**
|
|
781
|
+
```ts
|
|
782
|
+
import { createEntry, installPortals, Portal, usePortal } from '@pastweb/vue';
|
|
783
|
+
|
|
784
|
+
app.use(installPortals({
|
|
785
|
+
anchorsIds: {
|
|
786
|
+
modal: 'modal-root',
|
|
787
|
+
},
|
|
788
|
+
getEntry: (props, component) => createEntry({
|
|
789
|
+
EntryComponent: component,
|
|
790
|
+
initData: props,
|
|
791
|
+
}),
|
|
792
|
+
}));
|
|
793
|
+
```
|
|
794
|
+
|
|
795
|
+
#### `usePortals`
|
|
796
|
+
|
|
797
|
+
Reads the portal descriptor map installed by `installPortals`.
|
|
798
|
+
|
|
799
|
+
> #### Syntax
|
|
800
|
+
|
|
801
|
+
```ts
|
|
802
|
+
function usePortals<T>(): T;
|
|
803
|
+
```
|
|
804
|
+
|
|
805
|
+
**Example:**
|
|
806
|
+
```vue
|
|
807
|
+
<script setup lang="ts">
|
|
808
|
+
import { usePortals } from '@pastweb/vue';
|
|
809
|
+
import type { Portal } from '@pastweb/tools/portals';
|
|
810
|
+
|
|
811
|
+
type AppPortals = {
|
|
812
|
+
modal: Portal;
|
|
813
|
+
toaster: Portal;
|
|
814
|
+
};
|
|
815
|
+
|
|
816
|
+
const portals = usePortals<AppPortals>();
|
|
817
|
+
|
|
818
|
+
function scrollToModalAnchor() {
|
|
819
|
+
portals.modal.getPortalElement().scrollIntoView();
|
|
820
|
+
}
|
|
821
|
+
</script>
|
|
822
|
+
|
|
823
|
+
<template>
|
|
824
|
+
<button @click="scrollToModalAnchor">
|
|
825
|
+
Show modal anchor
|
|
826
|
+
</button>
|
|
827
|
+
</template>
|
|
828
|
+
```
|
|
829
|
+
|
|
830
|
+
#### `usePortalAnchors`
|
|
831
|
+
|
|
832
|
+
Reads the installed portal anchor ids.
|
|
833
|
+
|
|
834
|
+
> #### Syntax
|
|
835
|
+
|
|
836
|
+
```ts
|
|
837
|
+
function usePortalAnchors<T>(): T;
|
|
838
|
+
```
|
|
839
|
+
|
|
840
|
+
**Example:**
|
|
841
|
+
```vue
|
|
842
|
+
<script setup lang="ts">
|
|
843
|
+
import { usePortalAnchors } from '@pastweb/vue';
|
|
844
|
+
|
|
845
|
+
type PortalAnchors = {
|
|
846
|
+
modal: string;
|
|
847
|
+
toaster: string;
|
|
848
|
+
};
|
|
849
|
+
|
|
850
|
+
const anchors = usePortalAnchors<PortalAnchors>();
|
|
851
|
+
</script>
|
|
852
|
+
|
|
853
|
+
<template>
|
|
854
|
+
<div :id="anchors.modal" />
|
|
855
|
+
<div :id="anchors.toaster" />
|
|
856
|
+
</template>
|
|
857
|
+
```
|
|
858
|
+
|
|
859
|
+
#### `usePortal`
|
|
860
|
+
|
|
861
|
+
Creates a portal handler that can be passed to the `Portal` component. Calls made before the component binds the real handler are queued and replayed when the component is ready.
|
|
862
|
+
|
|
863
|
+
> #### Syntax
|
|
864
|
+
|
|
865
|
+
```ts
|
|
866
|
+
function usePortal(): PortalHandler & { isReady: () => void };
|
|
867
|
+
```
|
|
868
|
+
|
|
869
|
+
**Example:**
|
|
870
|
+
```vue
|
|
871
|
+
<script setup lang="ts">
|
|
872
|
+
import { Portal, usePortal } from '@pastweb/vue';
|
|
873
|
+
|
|
874
|
+
const modal = usePortal();
|
|
875
|
+
</script>
|
|
876
|
+
|
|
877
|
+
<template>
|
|
878
|
+
<button @click="modal.open()">
|
|
879
|
+
Open modal
|
|
880
|
+
</button>
|
|
881
|
+
|
|
882
|
+
<Portal path="modal" :use="modal">
|
|
883
|
+
<Dialog title="Hello from a portal" />
|
|
884
|
+
</Portal>
|
|
885
|
+
</template>
|
|
886
|
+
```
|
|
887
|
+
|
|
888
|
+
#### `Portal`
|
|
889
|
+
|
|
890
|
+
Vue component that connects a `usePortal()` handler to an installed portal path.
|
|
891
|
+
|
|
892
|
+
> #### Syntax
|
|
893
|
+
|
|
894
|
+
```ts
|
|
895
|
+
interface PortalProps {
|
|
896
|
+
path: string;
|
|
897
|
+
use: PortalHandler & { isReady: () => void };
|
|
898
|
+
}
|
|
899
|
+
```
|
|
900
|
+
|
|
901
|
+
**Example:**
|
|
902
|
+
```vue
|
|
903
|
+
<script setup lang="ts">
|
|
904
|
+
import { Portal, usePortal } from '@pastweb/vue';
|
|
905
|
+
|
|
906
|
+
const sheet = usePortal();
|
|
907
|
+
</script>
|
|
908
|
+
|
|
909
|
+
<template>
|
|
910
|
+
<button @click="sheet.open()">
|
|
911
|
+
Open sheet
|
|
912
|
+
</button>
|
|
913
|
+
|
|
914
|
+
<Portal path="viewSheet" :use="sheet">
|
|
915
|
+
<Sheet title="Route details" />
|
|
916
|
+
</Portal>
|
|
917
|
+
</template>
|
|
918
|
+
```
|
|
919
|
+
|
|
920
|
+
### `Render`
|
|
921
|
+
|
|
922
|
+
Renders primitive content, a Vue VNode, or a component definition with optional props.
|
|
923
|
+
|
|
924
|
+
> #### Syntax
|
|
925
|
+
|
|
926
|
+
```ts
|
|
927
|
+
type Content = string | number | VNode | Component;
|
|
928
|
+
|
|
929
|
+
interface RenderProps {
|
|
930
|
+
content: Content;
|
|
931
|
+
props?: Record<string, any>;
|
|
932
|
+
}
|
|
933
|
+
```
|
|
934
|
+
|
|
935
|
+
Parameters
|
|
936
|
+
* `content`: `Content`
|
|
937
|
+
* String and number values render as text.
|
|
938
|
+
* Vue VNodes are cloned with `props` merged onto the clone.
|
|
939
|
+
* Component definitions are rendered with `props`.
|
|
940
|
+
* `props`: `Record<string, any>` _(optional)_
|
|
941
|
+
* Additional props or listeners to apply to VNodes and components. Ignored for primitive content.
|
|
942
|
+
|
|
943
|
+
**Example:**
|
|
944
|
+
```vue
|
|
945
|
+
<script setup lang="ts">
|
|
946
|
+
import { h } from 'vue';
|
|
947
|
+
import { Render } from '@pastweb/vue';
|
|
948
|
+
|
|
949
|
+
const vnode = h('button', 'Save');
|
|
950
|
+
</script>
|
|
951
|
+
|
|
952
|
+
<template>
|
|
953
|
+
<Render content="Plain text" />
|
|
954
|
+
<Render :content="vnode" :props="{ class: 'primary' }" />
|
|
955
|
+
<Render :content="MyComponent" :props="{ title: 'Hello' }" />
|
|
956
|
+
</template>
|
|
957
|
+
```
|
|
958
|
+
|
|
959
|
+
### `Slot`
|
|
960
|
+
|
|
961
|
+
`Slot` renders one of its own Vue slots by name, with optional prop injection or content mapping. It is useful for small composition wrappers where the component chooses which slot to display, applies common attributes/listeners to the rendered VNodes, or wraps slot output without forcing callers to repeat markup.
|
|
962
|
+
|
|
963
|
+
When `name` is omitted, `Slot` renders the default slot. When a named slot is requested but not provided, it falls back to the default slot. If `props` are provided, the rendered VNode or VNodes are cloned with those props. If `map` is provided, it receives the slot content and its return value is rendered instead; `map` takes precedence over `props`.
|
|
964
|
+
|
|
965
|
+
Parameters
|
|
966
|
+
* `name`: `string` _(optional)_
|
|
967
|
+
* Slot name to render. Defaults to `default`.
|
|
968
|
+
* `props`: `Record<string, any>` _(optional)_
|
|
969
|
+
* Props, classes, attrs, or listeners cloned onto each rendered slot VNode.
|
|
970
|
+
* `map`: `(content: VNode | VNode[]) => VNode | VNode[]` _(optional)_
|
|
971
|
+
* Transform function for wrapping or replacing the rendered slot content.
|
|
972
|
+
|
|
973
|
+
**Example:**
|
|
974
|
+
```vue
|
|
975
|
+
<script setup lang="ts">
|
|
976
|
+
import { h } from 'vue';
|
|
977
|
+
import { Slot } from '@pastweb/vue';
|
|
978
|
+
|
|
979
|
+
const buttonProps = {
|
|
980
|
+
class: 'toolbar-action',
|
|
981
|
+
onClick: () => console.log('Action clicked'),
|
|
982
|
+
};
|
|
983
|
+
|
|
984
|
+
const wrapContent = content => h('section', { class: 'panel-body' }, content);
|
|
985
|
+
</script>
|
|
986
|
+
|
|
987
|
+
<template>
|
|
988
|
+
<Slot name="title">
|
|
989
|
+
<template #title>
|
|
990
|
+
<h2>Settings</h2>
|
|
991
|
+
</template>
|
|
992
|
+
</Slot>
|
|
993
|
+
|
|
994
|
+
<Slot :props="buttonProps">
|
|
995
|
+
<button>Save</button>
|
|
996
|
+
</Slot>
|
|
997
|
+
|
|
998
|
+
<Slot :map="wrapContent">
|
|
999
|
+
<p>Mapped default content.</p>
|
|
1000
|
+
</Slot>
|
|
1001
|
+
</template>
|
|
1002
|
+
```
|
|
1003
|
+
|
|
1004
|
+
---
|
|
1005
|
+
## Hook functions
|
|
1006
|
+
|
|
1007
|
+
### `useBeforeMount`
|
|
1008
|
+
|
|
1009
|
+
`useBeforeMount` registers a callback with Vue's `onBeforeMount` lifecycle hook. Use it for setup that should run after `setup()` has registered the component logic but before Vue mounts the component into the DOM.
|
|
1010
|
+
|
|
1011
|
+
The callback runs once for each component instance. Async callbacks are accepted, but Vue does not wait for the returned promise before continuing the mount.
|
|
1012
|
+
|
|
1013
|
+
> #### Syntax
|
|
1014
|
+
```ts
|
|
1015
|
+
function useBeforeMount(fn: () => void | Promise<void>): void
|
|
1016
|
+
```
|
|
1017
|
+
|
|
1018
|
+
Parameters
|
|
1019
|
+
* `fn`: `() => void | Promise<void>`
|
|
1020
|
+
* Callback invoked before the component mounts.
|
|
1021
|
+
|
|
1022
|
+
**Example:**
|
|
1023
|
+
```vue
|
|
1024
|
+
<script setup lang="ts">
|
|
1025
|
+
import { ref } from 'vue';
|
|
1026
|
+
import { useBeforeMount } from '@pastweb/vue';
|
|
1027
|
+
|
|
1028
|
+
const isRegistered = ref(false);
|
|
1029
|
+
|
|
1030
|
+
useBeforeMount(() => {
|
|
1031
|
+
registry.register('settings-panel');
|
|
1032
|
+
isRegistered.value = true;
|
|
1033
|
+
});
|
|
1034
|
+
</script>
|
|
1035
|
+
|
|
1036
|
+
<template>
|
|
1037
|
+
<section :data-registered="isRegistered">
|
|
1038
|
+
Settings
|
|
1039
|
+
</section>
|
|
1040
|
+
</template>
|
|
1041
|
+
```
|
|
1042
|
+
|
|
1043
|
+
### `useBeforeUnmount`
|
|
1044
|
+
|
|
1045
|
+
`useBeforeUnmount` registers a callback with Vue's `onBeforeUnmount` lifecycle hook. Use it for cleanup that must run while the component instance is still active, such as removing listeners, closing subscriptions, or flushing pending work.
|
|
1046
|
+
|
|
1047
|
+
The callback runs once for each component instance, immediately before Vue unmounts it. Async callbacks are accepted, but Vue does not wait for the returned promise before continuing unmount.
|
|
1048
|
+
|
|
1049
|
+
> #### Syntax
|
|
1050
|
+
```ts
|
|
1051
|
+
function useBeforeUnmount(fn: () => void | Promise<void>): void
|
|
1052
|
+
```
|
|
1053
|
+
|
|
1054
|
+
Parameters
|
|
1055
|
+
* `fn`: `() => void | Promise<void>`
|
|
1056
|
+
* Callback invoked before the component unmounts.
|
|
1057
|
+
|
|
1058
|
+
**Example:**
|
|
1059
|
+
```vue
|
|
1060
|
+
<script setup lang="ts">
|
|
1061
|
+
import { useBeforeUnmount, useMounted } from '@pastweb/vue';
|
|
1062
|
+
|
|
1063
|
+
let removeListener: (() => void) | undefined;
|
|
1064
|
+
|
|
1065
|
+
useMounted(() => {
|
|
1066
|
+
removeListener = bus.on('changed', value => {
|
|
1067
|
+
console.log(value);
|
|
1068
|
+
});
|
|
1069
|
+
});
|
|
1070
|
+
|
|
1071
|
+
useBeforeUnmount(() => {
|
|
1072
|
+
removeListener?.();
|
|
1073
|
+
});
|
|
1074
|
+
</script>
|
|
1075
|
+
```
|
|
1076
|
+
|
|
1077
|
+
### `useMediator`
|
|
1078
|
+
|
|
1079
|
+
`useMediator` creates a tools mediator inside a Vue component. The mediator is created once for the component instance, while `props` and `extras` are mirrored into tools reactive objects so updates from Vue props stay visible inside mediator methods.
|
|
1080
|
+
|
|
1081
|
+
Mediator `state` is copied into Vue shallow reactivity for rendering. This means tools reactive state changes can update Vue templates, while mediator methods and other returned values stay stable for the component lifetime. On unmount, Vue prop/extras watchers are stopped and pending state bridge work is ignored.
|
|
1082
|
+
|
|
1083
|
+
Unlike the React package, Vue does not need a render-time mediator store for ordinary rerenders because `setup()` runs once per component instance. Inline mediator state therefore persists across Vue prop updates naturally.
|
|
1084
|
+
|
|
1085
|
+
In development, `useMediator` also detects Vite (`import.meta.hot`) and Webpack/Rspack-compatible (`import.meta.webpackHot`) HMR through `@pastweb/tools`. When the mediator source signature changes, the mediator is reinitialized in place and the Vue state mirror is refreshed.
|
|
1086
|
+
|
|
1087
|
+
> #### Syntax
|
|
1088
|
+
```ts
|
|
1089
|
+
function useMediator<T>(mediator: MediatorFunction<T>, props?: Props, extras?: Extras): T
|
|
1090
|
+
```
|
|
1091
|
+
|
|
1092
|
+
#### Type Parameters
|
|
1093
|
+
* `T`
|
|
1094
|
+
* Mediator return type.
|
|
1095
|
+
|
|
1096
|
+
#### Parameters
|
|
1097
|
+
* `mediator`: `MediatorFunction<T>`
|
|
1098
|
+
* Function that creates mediator state and methods.
|
|
1099
|
+
* `props`: `Props` _(optional)_
|
|
1100
|
+
* Values passed to the mediator as reactive props. `children` is ignored.
|
|
1101
|
+
* `extras`: `Extras` _(optional)_
|
|
1102
|
+
* Additional values passed to the mediator as reactive extras.
|
|
1103
|
+
|
|
1104
|
+
#### Returns
|
|
1105
|
+
The mediator return value, with `state` mirrored into Vue rendering.
|
|
1106
|
+
|
|
1107
|
+
**Example:**
|
|
1108
|
+
`counterMediator.ts`
|
|
1109
|
+
|
|
1110
|
+
```ts
|
|
1111
|
+
import { reactive } from '@pastweb/tools';
|
|
1112
|
+
|
|
1113
|
+
export function createCounter(props: { initial: number }) {
|
|
1114
|
+
const state = reactive({ count: props.initial });
|
|
1115
|
+
|
|
1116
|
+
return {
|
|
1117
|
+
state,
|
|
1118
|
+
increment() {
|
|
1119
|
+
state.count += 1;
|
|
1120
|
+
},
|
|
1121
|
+
};
|
|
1122
|
+
}
|
|
1123
|
+
```
|
|
1124
|
+
|
|
1125
|
+
`CounterButton.vue`
|
|
1126
|
+
|
|
1127
|
+
```vue
|
|
1128
|
+
<script setup lang="ts">
|
|
1129
|
+
import { useMediator } from '@pastweb/vue';
|
|
1130
|
+
import { createCounter } from './counterMediator';
|
|
1131
|
+
|
|
1132
|
+
const counter = useMediator(createCounter, { initial: 0 });
|
|
1133
|
+
</script>
|
|
1134
|
+
|
|
1135
|
+
<template>
|
|
1136
|
+
<button @click="counter.increment">
|
|
1137
|
+
{{ counter.state.count }}
|
|
1138
|
+
</button>
|
|
1139
|
+
</template>
|
|
1140
|
+
```
|
|
1141
|
+
|
|
1142
|
+
### `useMounted`
|
|
1143
|
+
|
|
1144
|
+
`useMounted` registers a callback with Vue's `onMounted` lifecycle hook. Use it for client-side work that needs the component to be mounted, such as reading DOM refs, focusing inputs, or installing browser listeners.
|
|
1145
|
+
|
|
1146
|
+
The callback runs once for each component instance. Async callbacks are allowed, but returned promises are not used as cleanup functions.
|
|
1147
|
+
|
|
1148
|
+
> #### Syntax
|
|
1149
|
+
```ts
|
|
1150
|
+
function useMounted(fn: () => void | Promise<void>): void
|
|
1151
|
+
```
|
|
1152
|
+
|
|
1153
|
+
Parameters
|
|
1154
|
+
* `fn`: `() => void | Promise<void>`
|
|
1155
|
+
* Callback invoked after the component mounts.
|
|
1156
|
+
|
|
1157
|
+
**Example:**
|
|
1158
|
+
```vue
|
|
1159
|
+
<script setup lang="ts">
|
|
1160
|
+
import { useMounted, useRef } from '@pastweb/vue';
|
|
1161
|
+
|
|
1162
|
+
const input = useRef<HTMLInputElement | null>(null);
|
|
1163
|
+
|
|
1164
|
+
useMounted(() => {
|
|
1165
|
+
input.value?.focus();
|
|
1166
|
+
});
|
|
1167
|
+
</script>
|
|
1168
|
+
|
|
1169
|
+
<template>
|
|
1170
|
+
<input ref="input" />
|
|
1171
|
+
</template>
|
|
1172
|
+
```
|
|
1173
|
+
|
|
1174
|
+
### `useRef`
|
|
1175
|
+
|
|
1176
|
+
`useRef` creates a Vue `shallowRef`. It gives Vue code the same Pastweb ref helper name used in other framework packages while preserving Vue's normal `.value` access pattern.
|
|
1177
|
+
|
|
1178
|
+
Because the ref is shallow, replacing `.value` is reactive, but mutating nested object properties is not deeply tracked by this helper.
|
|
1179
|
+
|
|
1180
|
+
> #### Syntax
|
|
1181
|
+
```ts
|
|
1182
|
+
function useRef<T>(value?: T): Ref<T | undefined>
|
|
1183
|
+
```
|
|
1184
|
+
|
|
1185
|
+
Parameters
|
|
1186
|
+
* `value`: `T` _(optional)_
|
|
1187
|
+
* Initial value stored in the ref.
|
|
1188
|
+
|
|
1189
|
+
**Example:**
|
|
1190
|
+
```vue
|
|
1191
|
+
<script setup lang="ts">
|
|
1192
|
+
import { useRef } from '@pastweb/vue';
|
|
1193
|
+
|
|
1194
|
+
const count = useRef(0);
|
|
1195
|
+
|
|
1196
|
+
function increment() {
|
|
1197
|
+
count.value += 1;
|
|
1198
|
+
}
|
|
1199
|
+
</script>
|
|
1200
|
+
|
|
1201
|
+
<template>
|
|
1202
|
+
<button @click="increment">{{ count }}</button>
|
|
1203
|
+
</template>
|
|
1204
|
+
```
|
|
1205
|
+
|
|
1206
|
+
---
|
|
1207
|
+
## Utility functions
|
|
1208
|
+
|
|
1209
|
+
### `computed`
|
|
1210
|
+
|
|
1211
|
+
Alias for Vue's native `computed` function. It is provided so applications can import `computed` from `@pastweb/vue` alongside the package utilities while keeping the same Vue `ComputedRef` behavior.
|
|
1212
|
+
|
|
1213
|
+
> #### Syntax
|
|
1214
|
+
|
|
1215
|
+
```ts
|
|
1216
|
+
function computed<T = unknown>(fn: () => T): ComputedRef<T>
|
|
1217
|
+
```
|
|
1218
|
+
|
|
1219
|
+
**Example:**
|
|
1220
|
+
```ts
|
|
1221
|
+
import { ref } from 'vue';
|
|
1222
|
+
import { computed } from '@pastweb/vue';
|
|
1223
|
+
|
|
1224
|
+
const firstName = ref('Ada');
|
|
1225
|
+
const lastName = ref('Lovelace');
|
|
1226
|
+
|
|
1227
|
+
const fullName = computed(() => `${firstName.value} ${lastName.value}`);
|
|
1228
|
+
```
|
|
1229
|
+
|
|
1230
|
+
### `useChildren`
|
|
1231
|
+
|
|
1232
|
+
`useChildren` reads the active component's default slot children as Vue VNodes. Use it inside `setup()` when writing render-function utilities that need to inspect, wrap, or forward the component's default children.
|
|
1233
|
+
|
|
1234
|
+
When the current component has no default slot, it returns an empty array.
|
|
1235
|
+
|
|
1236
|
+
> #### Syntax
|
|
1237
|
+
```ts
|
|
1238
|
+
function useChildren(): VNode[]
|
|
1239
|
+
```
|
|
1240
|
+
|
|
1241
|
+
**Example:**
|
|
1242
|
+
```ts
|
|
1243
|
+
import { h } from 'vue';
|
|
1244
|
+
import { useChildren } from '@pastweb/vue';
|
|
1245
|
+
|
|
1246
|
+
export default {
|
|
1247
|
+
setup() {
|
|
1248
|
+
const children = useChildren();
|
|
1249
|
+
|
|
1250
|
+
return () => h('section', { class: 'content' }, children);
|
|
1251
|
+
},
|
|
1252
|
+
};
|
|
1253
|
+
```
|
|
1254
|
+
|
|
1255
|
+
### `withDefaultProps`
|
|
1256
|
+
|
|
1257
|
+
`withDefaultProps` merges Vue props with defaults and returns a reactive normalized object. Defaults are used only when the incoming prop value is `undefined`; explicit falsy values such as `false`, `0`, and `''` are preserved.
|
|
1258
|
+
|
|
1259
|
+
The helper also includes Vue-specific normalization. Vue coerces absent Boolean props to `false` at runtime, which means a defaulting helper cannot tell whether a Boolean prop was omitted or explicitly passed as `false`. For that reason, `booleanChars` lets you model those props as string markers first, then normalize them after defaults are applied. By default, `+` becomes `true` and `-` becomes `false`.
|
|
1260
|
+
|
|
1261
|
+
A default named `className` is exposed as Vue's `class` prop by default.
|
|
1262
|
+
|
|
1263
|
+
Use `exclude` for defaults that should not be applied by this helper. If the source props object already contains an excluded key, that provided value is preserved; otherwise the excluded default is omitted.
|
|
1264
|
+
|
|
1265
|
+
> #### Syntax
|
|
1266
|
+
```ts
|
|
1267
|
+
function withDefaultProps<T>(props: Record<string, any>, defaults: Record<string, any>, options?: Options): T
|
|
1268
|
+
|
|
1269
|
+
interface Options {
|
|
1270
|
+
booleanChars?: [string, string];
|
|
1271
|
+
className?: boolean;
|
|
1272
|
+
exclude?: string | RegExp | Array<string | RegExp>;
|
|
1273
|
+
}
|
|
1274
|
+
```
|
|
1275
|
+
|
|
1276
|
+
Parameters
|
|
1277
|
+
* `props`: `Record<string, any>`
|
|
1278
|
+
* Source Vue props object.
|
|
1279
|
+
* `defaults`: `Record<string, any>`
|
|
1280
|
+
* Defaults applied when a prop is `undefined`.
|
|
1281
|
+
* `options`: `Options` _(optional)_
|
|
1282
|
+
* `booleanChars` controls string-to-boolean conversion for Boolean-like props that need to avoid Vue's absent-Boolean-to-`false` coercion. Defaults to `['+', '-']`.
|
|
1283
|
+
* `className` controls whether `className` defaults are mapped to `class`. Defaults to `true`.
|
|
1284
|
+
* `exclude` prevents matching default keys from being applied. Strings match exact keys and regular expressions match the original key from `defaults`.
|
|
1285
|
+
|
|
1286
|
+
**Example:**
|
|
1287
|
+
```vue
|
|
1288
|
+
<script setup lang="ts">
|
|
1289
|
+
import { withDefaultProps } from '@pastweb/vue';
|
|
1290
|
+
|
|
1291
|
+
const props = defineProps<{
|
|
1292
|
+
tone?: 'neutral' | 'accent';
|
|
1293
|
+
block?: '+' | '-';
|
|
1294
|
+
className?: string;
|
|
1295
|
+
}>();
|
|
1296
|
+
|
|
1297
|
+
const p = withDefaultProps<{
|
|
1298
|
+
tone: 'neutral' | 'accent';
|
|
1299
|
+
block: boolean;
|
|
1300
|
+
class: string;
|
|
1301
|
+
}>(props, {
|
|
1302
|
+
tone: 'neutral',
|
|
1303
|
+
block: '-',
|
|
1304
|
+
className: 'button',
|
|
1305
|
+
});
|
|
1306
|
+
</script>
|
|
1307
|
+
|
|
1308
|
+
<template>
|
|
1309
|
+
<button :class="p.class" :data-tone="p.tone" :data-block="p.block">
|
|
1310
|
+
<slot />
|
|
1311
|
+
</button>
|
|
1312
|
+
</template>
|
|
1313
|
+
```
|
|
1314
|
+
|
|
1315
|
+
**Example With Exclusions:**
|
|
1316
|
+
```ts
|
|
1317
|
+
import { withDefaultProps } from '@pastweb/vue';
|
|
1318
|
+
|
|
1319
|
+
const p = withDefaultProps(
|
|
1320
|
+
props,
|
|
1321
|
+
{
|
|
1322
|
+
tone: 'neutral',
|
|
1323
|
+
debug: false,
|
|
1324
|
+
internalFlag: true,
|
|
1325
|
+
},
|
|
1326
|
+
{
|
|
1327
|
+
exclude: ['debug', /^internal/],
|
|
1328
|
+
},
|
|
1329
|
+
);
|
|
1330
|
+
```
|
|
1331
|
+
|
|
1332
|
+
### `getEventHandlers`
|
|
1333
|
+
|
|
1334
|
+
`getEventHandlers` extracts Vue-style handler props into an object that can be passed to `v-on`. Handler props must start with `on` followed by an uppercase character, such as `onClick`, `onChange`, or `onUpdateModelValue`. Regular props such as `online` or `once` are ignored.
|
|
1335
|
+
|
|
1336
|
+
The returned event names are lower kebab case after removing the `on` prefix, so `onClick` becomes `click` and `onUpdateModelValue` becomes `update-model-value`.
|
|
1337
|
+
|
|
1338
|
+
> #### Syntax
|
|
1339
|
+
```ts
|
|
1340
|
+
function getEventHandlers(
|
|
1341
|
+
props: Record<string, any>,
|
|
1342
|
+
options?: Options,
|
|
1343
|
+
): Record<string, Function>
|
|
1344
|
+
|
|
1345
|
+
interface Options {
|
|
1346
|
+
exclude?: string | RegExp | Array<string | RegExp>;
|
|
1347
|
+
}
|
|
1348
|
+
```
|
|
1349
|
+
|
|
1350
|
+
Parameters
|
|
1351
|
+
* `props`: `Record<string, any>`
|
|
1352
|
+
* Source object containing regular props and handler props.
|
|
1353
|
+
* `options`: `Options` _(optional)_
|
|
1354
|
+
* `exclude` removes matching extracted event names. Strings match exact event names and regular expressions match the kebab-cased event name.
|
|
1355
|
+
|
|
1356
|
+
Returns
|
|
1357
|
+
* `Record<string, Function>`
|
|
1358
|
+
* Event map ready for `v-on`.
|
|
1359
|
+
|
|
1360
|
+
**Example:**
|
|
1361
|
+
```vue
|
|
1362
|
+
<script setup lang="ts">
|
|
1363
|
+
import { getEventHandlers } from '@pastweb/vue';
|
|
1364
|
+
|
|
1365
|
+
const props = defineProps<{
|
|
1366
|
+
title?: string;
|
|
1367
|
+
online?: () => void;
|
|
1368
|
+
onClick?: () => void;
|
|
1369
|
+
onUpdateModelValue?: (value: string) => void;
|
|
1370
|
+
}>();
|
|
1371
|
+
|
|
1372
|
+
const events = getEventHandlers(props, {
|
|
1373
|
+
exclude: 'update-model-value',
|
|
1374
|
+
});
|
|
1375
|
+
</script>
|
|
1376
|
+
|
|
1377
|
+
<template>
|
|
1378
|
+
<button v-on="events">
|
|
1379
|
+
{{ props.title }}
|
|
1380
|
+
</button>
|
|
1381
|
+
</template>
|
|
1382
|
+
```
|
|
1383
|
+
|
|
1384
|
+
### `withDefaultPropsHandlers`
|
|
1385
|
+
|
|
1386
|
+
`withDefaultPropsHandlers` combines `withDefaultProps` with event-handler extraction. It returns normalized props for `v-bind` and a separate event map for `v-on`, which is useful for wrapper components that forward both props and listeners.
|
|
1387
|
+
|
|
1388
|
+
Event handler props are detected only when the prop name starts with `on` followed by an uppercase character, such as `onClick`, `onChange`, or `onUpdateModelValue`. This keeps regular props such as `online` or `once` from being removed from the normalized props object.
|
|
1389
|
+
|
|
1390
|
+
> #### Syntax
|
|
1391
|
+
```ts
|
|
1392
|
+
function withDefaultPropsHandlers<T>(
|
|
1393
|
+
props: Record<string, any>,
|
|
1394
|
+
defaults: Record<string, any>,
|
|
1395
|
+
options?: Options,
|
|
1396
|
+
): [T, Record<string, Function>]
|
|
1397
|
+
|
|
1398
|
+
interface Options {
|
|
1399
|
+
booleanChars?: [string, string];
|
|
1400
|
+
className?: boolean;
|
|
1401
|
+
excludeProps?: string | RegExp | Array<string | RegExp>;
|
|
1402
|
+
excludeHandlers?: string | RegExp | Array<string | RegExp>;
|
|
1403
|
+
}
|
|
1404
|
+
```
|
|
1405
|
+
|
|
1406
|
+
Parameters
|
|
1407
|
+
* `props`: `Record<string, any>`
|
|
1408
|
+
* Source Vue props object.
|
|
1409
|
+
* `defaults`: `Record<string, any>`
|
|
1410
|
+
* Defaults applied to regular props and default handlers.
|
|
1411
|
+
* `options`: `Options` _(optional)_
|
|
1412
|
+
* `booleanChars` and `className` are passed to `withDefaultProps`.
|
|
1413
|
+
* `excludeProps` excludes keys from default merging.
|
|
1414
|
+
* `excludeHandlers` excludes extracted event names after removing `on` and converting to kebab case.
|
|
1415
|
+
|
|
1416
|
+
Returns
|
|
1417
|
+
* `[T, Record<string, Function>]`
|
|
1418
|
+
* Normalized props and extracted event handlers.
|
|
1419
|
+
|
|
1420
|
+
**Example:**
|
|
1421
|
+
```vue
|
|
1422
|
+
<script setup lang="ts">
|
|
1423
|
+
import { withDefaultPropsHandlers } from '@pastweb/vue';
|
|
1424
|
+
|
|
1425
|
+
const props = defineProps<{
|
|
1426
|
+
tone?: 'neutral' | 'accent';
|
|
1427
|
+
block?: '+' | '-';
|
|
1428
|
+
online?: () => void;
|
|
1429
|
+
onClick?: () => void;
|
|
1430
|
+
onUpdateModelValue?: (value: string) => void;
|
|
1431
|
+
}>();
|
|
1432
|
+
|
|
1433
|
+
const [p, events] = withDefaultPropsHandlers<{
|
|
1434
|
+
tone: 'neutral' | 'accent';
|
|
1435
|
+
block: boolean;
|
|
1436
|
+
online: () => void;
|
|
1437
|
+
}>(props, {
|
|
1438
|
+
tone: 'neutral',
|
|
1439
|
+
block: '-',
|
|
1440
|
+
online: () => {},
|
|
1441
|
+
onClick: () => {},
|
|
1442
|
+
onUpdateModelValue: () => {},
|
|
1443
|
+
});
|
|
1444
|
+
</script>
|
|
1445
|
+
|
|
1446
|
+
<template>
|
|
1447
|
+
<button v-bind="p" v-on="events">
|
|
1448
|
+
<slot />
|
|
1449
|
+
</button>
|
|
1450
|
+
</template>
|
|
1451
|
+
```
|
|
1452
|
+
|
|
1453
|
+
## License
|
|
1454
|
+
|
|
1455
|
+
[MIT](./LICENSE) License (c) 2026 [Domenico Pasto](https://github.com/pastweb)
|