@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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ColorSchemeInfo, MatchScheme, SchemeOptions } from "@pastweb/tools/createMatchScheme/types";
|
|
2
|
+
|
|
3
|
+
//#region src/useColorScheme/useColorScheme.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Vue composable for reading and updating the current color scheme.
|
|
6
|
+
*
|
|
7
|
+
* The signature mirrors `useColorScheme` from `@pastweb/tools` and the React
|
|
8
|
+
* package: pass options to create an internal `MatchScheme`, or pass a
|
|
9
|
+
* pre-created `matchScheme` as the second argument. The Vue wrapper subscribes
|
|
10
|
+
* to mode/system changes and cleans those listeners up before component
|
|
11
|
+
* unmount.
|
|
12
|
+
*
|
|
13
|
+
* @param options - Options passed to `createMatchScheme` when `matchScheme` is not provided.
|
|
14
|
+
* @param matchScheme - Optional pre-created `MatchScheme` instance.
|
|
15
|
+
* @returns A tuple with the current color scheme info and the mode setter.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { useColorScheme } from '@pastweb/vue';
|
|
20
|
+
*
|
|
21
|
+
* const [scheme, setMode] = useColorScheme({ defaultMode: 'auto' });
|
|
22
|
+
*
|
|
23
|
+
* setMode(scheme.selected === 'dark' ? 'light' : 'dark');
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare function useColorScheme(options?: SchemeOptions, matchScheme?: MatchScheme): [ColorSchemeInfo, (mode: string) => void];
|
|
27
|
+
//#endregion
|
|
28
|
+
export { useColorScheme };
|
|
29
|
+
//# sourceMappingURL=useColorScheme.d.cts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ColorSchemeInfo, MatchScheme, SchemeOptions } from "@pastweb/tools/createMatchScheme/types";
|
|
2
|
+
|
|
3
|
+
//#region src/useColorScheme/useColorScheme.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Vue composable for reading and updating the current color scheme.
|
|
6
|
+
*
|
|
7
|
+
* The signature mirrors `useColorScheme` from `@pastweb/tools` and the React
|
|
8
|
+
* package: pass options to create an internal `MatchScheme`, or pass a
|
|
9
|
+
* pre-created `matchScheme` as the second argument. The Vue wrapper subscribes
|
|
10
|
+
* to mode/system changes and cleans those listeners up before component
|
|
11
|
+
* unmount.
|
|
12
|
+
*
|
|
13
|
+
* @param options - Options passed to `createMatchScheme` when `matchScheme` is not provided.
|
|
14
|
+
* @param matchScheme - Optional pre-created `MatchScheme` instance.
|
|
15
|
+
* @returns A tuple with the current color scheme info and the mode setter.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { useColorScheme } from '@pastweb/vue';
|
|
20
|
+
*
|
|
21
|
+
* const [scheme, setMode] = useColorScheme({ defaultMode: 'auto' });
|
|
22
|
+
*
|
|
23
|
+
* setMode(scheme.selected === 'dark' ? 'light' : 'dark');
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare function useColorScheme(options?: SchemeOptions, matchScheme?: MatchScheme): [ColorSchemeInfo, (mode: string) => void];
|
|
27
|
+
//#endregion
|
|
28
|
+
export { useColorScheme };
|
|
29
|
+
//# sourceMappingURL=useColorScheme.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useBeforeUnmount } from "../useBeforeUnmount/useBeforeUnmount.js";
|
|
2
|
+
import "../useBeforeUnmount/index.js";
|
|
3
|
+
import { shallowReactive } from "vue";
|
|
4
|
+
import { update } from "@pastweb/tools/update";
|
|
5
|
+
import { createMatchScheme } from "@pastweb/tools/createMatchScheme";
|
|
6
|
+
//#region src/useColorScheme/useColorScheme.ts
|
|
7
|
+
/**
|
|
8
|
+
* Vue composable for reading and updating the current color scheme.
|
|
9
|
+
*
|
|
10
|
+
* The signature mirrors `useColorScheme` from `@pastweb/tools` and the React
|
|
11
|
+
* package: pass options to create an internal `MatchScheme`, or pass a
|
|
12
|
+
* pre-created `matchScheme` as the second argument. The Vue wrapper subscribes
|
|
13
|
+
* to mode/system changes and cleans those listeners up before component
|
|
14
|
+
* unmount.
|
|
15
|
+
*
|
|
16
|
+
* @param options - Options passed to `createMatchScheme` when `matchScheme` is not provided.
|
|
17
|
+
* @param matchScheme - Optional pre-created `MatchScheme` instance.
|
|
18
|
+
* @returns A tuple with the current color scheme info and the mode setter.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { useColorScheme } from '@pastweb/vue';
|
|
23
|
+
*
|
|
24
|
+
* const [scheme, setMode] = useColorScheme({ defaultMode: 'auto' });
|
|
25
|
+
*
|
|
26
|
+
* setMode(scheme.selected === 'dark' ? 'light' : 'dark');
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
function useColorScheme(options = {}, matchScheme) {
|
|
30
|
+
const scheme = matchScheme ?? createMatchScheme(options);
|
|
31
|
+
const current = shallowReactive(scheme.getInfo());
|
|
32
|
+
const updateCurrent = () => update(current, scheme.getInfo());
|
|
33
|
+
const onModeChange = scheme.onModeChange(updateCurrent);
|
|
34
|
+
const onSysChange = scheme.onSysSchemeChange(updateCurrent);
|
|
35
|
+
updateCurrent();
|
|
36
|
+
useBeforeUnmount(() => {
|
|
37
|
+
onModeChange.removeListener();
|
|
38
|
+
onSysChange.removeListener();
|
|
39
|
+
});
|
|
40
|
+
return [current, scheme.setMode];
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { useColorScheme };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=useColorScheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColorScheme.js","names":[],"sources":["../../src/useColorScheme/useColorScheme.ts"],"sourcesContent":["import { shallowReactive } from 'vue';\nimport { createMatchScheme } from '@pastweb/tools/createMatchScheme';\nimport { update } from '@pastweb/tools/update';\nimport { useBeforeUnmount } from '../useBeforeUnmount';\nimport type { RemoveListener } from '@pastweb/tools/createEventEmitter/types';\nimport type { MatchScheme, ColorSchemeInfo, SchemeOptions } from '@pastweb/tools/createMatchScheme/types';\n\n/**\n * Vue composable for reading and updating the current color scheme.\n *\n * The signature mirrors `useColorScheme` from `@pastweb/tools` and the React\n * package: pass options to create an internal `MatchScheme`, or pass a\n * pre-created `matchScheme` as the second argument. The Vue wrapper subscribes\n * to mode/system changes and cleans those listeners up before component\n * unmount.\n *\n * @param options - Options passed to `createMatchScheme` when `matchScheme` is not provided.\n * @param matchScheme - Optional pre-created `MatchScheme` instance.\n * @returns A tuple with the current color scheme info and the mode setter.\n *\n * @example\n * ```ts\n * import { useColorScheme } from '@pastweb/vue';\n *\n * const [scheme, setMode] = useColorScheme({ defaultMode: 'auto' });\n *\n * setMode(scheme.selected === 'dark' ? 'light' : 'dark');\n * ```\n */\nexport function useColorScheme(options: SchemeOptions = {}, matchScheme?: MatchScheme): [ColorSchemeInfo, (mode: string) => void] {\n const scheme = matchScheme ?? createMatchScheme(options);\n const current = shallowReactive(scheme.getInfo()) as ColorSchemeInfo;\n\n const updateCurrent = () => update(current, scheme.getInfo());\n\n const onModeChange: RemoveListener = scheme.onModeChange(updateCurrent);\n const onSysChange: RemoveListener = scheme.onSysSchemeChange(updateCurrent);\n\n updateCurrent();\n\n useBeforeUnmount(() => {\n onModeChange.removeListener();\n onSysChange.removeListener();\n });\n\n return [current, scheme.setMode];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAgB,eAAe,UAAyB,CAAC,GAAG,aAAsE;CAChI,MAAM,SAAS,eAAe,kBAAkB,OAAO;CACvD,MAAM,UAAU,gBAAgB,OAAO,QAAQ,CAAC;CAEhD,MAAM,sBAAsB,OAAO,SAAS,OAAO,QAAQ,CAAC;CAE5D,MAAM,eAA+B,OAAO,aAAa,aAAa;CACtE,MAAM,cAA8B,OAAO,kBAAkB,aAAa;CAE1E,cAAc;CAEd,uBAAuB;EACrB,aAAa,eAAe;EAC5B,YAAY,eAAe;CAC7B,CAAC;CAED,OAAO,CAAC,SAAS,OAAO,OAAO;AACjC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_getContext_getContext = require("../getContext/getContext.cjs");
|
|
3
|
+
require("../getContext/index.cjs");
|
|
4
|
+
const require_setContext_setContext = require("../setContext/setContext.cjs");
|
|
5
|
+
require("../setContext/index.cjs");
|
|
6
|
+
const require_useMediator_utils = require("./utils.cjs");
|
|
7
|
+
let vue = require("vue");
|
|
8
|
+
let _pastweb_tools_reactivity = require("@pastweb/tools/reactivity");
|
|
9
|
+
let _pastweb_tools_update = require("@pastweb/tools/update");
|
|
10
|
+
let _pastweb_tools_getFunctionSignature = require("@pastweb/tools/getFunctionSignature");
|
|
11
|
+
let _pastweb_tools_globalContext_createMediatorContextUtils = require("@pastweb/tools/globalContext/createMediatorContextUtils");
|
|
12
|
+
let _pastweb_tools_isHMREnabled = require("@pastweb/tools/isHMREnabled");
|
|
13
|
+
//#region src/useMediator/useMediator.ts
|
|
14
|
+
/**
|
|
15
|
+
* Creates a tools mediator inside a Vue component.
|
|
16
|
+
*
|
|
17
|
+
* The mediator is created once for the component instance. Props and extras are
|
|
18
|
+
* copied into tools reactive objects and kept in sync with Vue updates, while
|
|
19
|
+
* mediator state is mirrored into Vue shallow reactivity for rendering.
|
|
20
|
+
*
|
|
21
|
+
* Vue does not need React's render-time mediator store because `setup()` runs
|
|
22
|
+
* once per component instance. This hook still keeps an instance-local store so
|
|
23
|
+
* mediator state persists across prop updates and Vue watchers are stopped on
|
|
24
|
+
* unmount. During development HMR, a changed mediator source signature
|
|
25
|
+
* reinitializes the mediator in place and refreshes the Vue state mirror.
|
|
26
|
+
*
|
|
27
|
+
* @typeParam T - Mediator return type.
|
|
28
|
+
* @param mediator - Tools mediator factory.
|
|
29
|
+
* @param props - Props passed to the mediator. `children` is ignored.
|
|
30
|
+
* @param extras - Extra values passed to the mediator.
|
|
31
|
+
* @returns Mediator return value with Vue-rendered state.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* counterMediator.ts
|
|
35
|
+
*
|
|
36
|
+
* ```ts
|
|
37
|
+
* import { reactive } from '@pastweb/tools';
|
|
38
|
+
*
|
|
39
|
+
* export function createCounter(props: { initial: number }) {
|
|
40
|
+
* const state = reactive({ count: props.initial });
|
|
41
|
+
*
|
|
42
|
+
* return {
|
|
43
|
+
* state,
|
|
44
|
+
* increment: () => {
|
|
45
|
+
* state.count += 1;
|
|
46
|
+
* },
|
|
47
|
+
* };
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* CounterButton.vue
|
|
52
|
+
*
|
|
53
|
+
* ```vue
|
|
54
|
+
* <script setup lang="ts">
|
|
55
|
+
* import { useMediator } from '@pastweb/vue';
|
|
56
|
+
* import { createCounter } from './counterMediator';
|
|
57
|
+
*
|
|
58
|
+
* const counter = useMediator(createCounter, { initial: 0 });
|
|
59
|
+
* <\/script>
|
|
60
|
+
*
|
|
61
|
+
* <template>
|
|
62
|
+
* <button @click="counter.increment">
|
|
63
|
+
* {{ counter.state.count }}
|
|
64
|
+
* </button>
|
|
65
|
+
* </template>
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
const useMediator = (mediator, props = {}, extras = {}) => {
|
|
69
|
+
const { children: _children, ...restProps } = props;
|
|
70
|
+
const stops = /* @__PURE__ */ new Set();
|
|
71
|
+
const hmr = (0, _pastweb_tools_isHMREnabled.isHMREnabled)();
|
|
72
|
+
let isDisposed = false;
|
|
73
|
+
let activeGeneration = 0;
|
|
74
|
+
let storedMediator = mediator;
|
|
75
|
+
let storedMediatorSignature = (0, _pastweb_tools_getFunctionSignature.getFunctionSignature)(storedMediator);
|
|
76
|
+
const storedProps = (0, _pastweb_tools_reactivity.reactive)({ ...restProps });
|
|
77
|
+
const storedExtras = (0, _pastweb_tools_reactivity.reactive)({ ...extras });
|
|
78
|
+
const contextUtils = {
|
|
79
|
+
getContext: require_getContext_getContext.getContext,
|
|
80
|
+
setContext: require_setContext_setContext.setContext
|
|
81
|
+
};
|
|
82
|
+
let mediatorResult = createMediator();
|
|
83
|
+
const state = (0, vue.shallowReactive)({ ...mediatorResult.state || {} });
|
|
84
|
+
const output = {
|
|
85
|
+
...mediatorResult,
|
|
86
|
+
state
|
|
87
|
+
};
|
|
88
|
+
function createMediator() {
|
|
89
|
+
return (0, _pastweb_tools_globalContext_createMediatorContextUtils.createMediatorContextUtils)(storedMediator, storedProps, storedExtras, contextUtils);
|
|
90
|
+
}
|
|
91
|
+
function syncOutput() {
|
|
92
|
+
Object.keys(output).forEach((key) => {
|
|
93
|
+
if (key !== "state" && !(key in mediatorResult)) delete output[key];
|
|
94
|
+
});
|
|
95
|
+
Object.entries(mediatorResult).forEach(([key, value]) => {
|
|
96
|
+
if (key !== "state") output[key] = value;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function bridgeState() {
|
|
100
|
+
const generation = ++activeGeneration;
|
|
101
|
+
require_useMediator_utils.syncRecord(state, mediatorResult.state || {});
|
|
102
|
+
if (mediatorResult.state) (0, _pastweb_tools_reactivity.effect)(() => {
|
|
103
|
+
if (!isDisposed && generation === activeGeneration && mediatorResult.state) (0, _pastweb_tools_update.update)(state, mediatorResult.state);
|
|
104
|
+
}, mediatorResult.state);
|
|
105
|
+
}
|
|
106
|
+
function reinitializeMediator(nextMediator) {
|
|
107
|
+
storedMediator = nextMediator;
|
|
108
|
+
storedMediatorSignature = (0, _pastweb_tools_getFunctionSignature.getFunctionSignature)(storedMediator);
|
|
109
|
+
mediatorResult = createMediator();
|
|
110
|
+
syncOutput();
|
|
111
|
+
bridgeState();
|
|
112
|
+
}
|
|
113
|
+
syncOutput();
|
|
114
|
+
bridgeState();
|
|
115
|
+
stops.add((0, vue.watchEffect)(() => {
|
|
116
|
+
const { children: _children, ...nextProps } = props;
|
|
117
|
+
require_useMediator_utils.syncRecord(storedProps, nextProps);
|
|
118
|
+
if (hmr) {
|
|
119
|
+
const nextSignature = (0, _pastweb_tools_getFunctionSignature.getFunctionSignature)(mediator);
|
|
120
|
+
if (storedMediatorSignature !== nextSignature) reinitializeMediator(mediator);
|
|
121
|
+
}
|
|
122
|
+
}));
|
|
123
|
+
stops.add((0, vue.watchEffect)(() => {
|
|
124
|
+
require_useMediator_utils.syncRecord(storedExtras, extras);
|
|
125
|
+
}));
|
|
126
|
+
(0, vue.onBeforeUnmount)(() => {
|
|
127
|
+
isDisposed = true;
|
|
128
|
+
activeGeneration += 1;
|
|
129
|
+
stops.forEach((stop) => stop());
|
|
130
|
+
stops.clear();
|
|
131
|
+
});
|
|
132
|
+
return output;
|
|
133
|
+
};
|
|
134
|
+
//#endregion
|
|
135
|
+
exports.useMediator = useMediator;
|
|
136
|
+
|
|
137
|
+
//# sourceMappingURL=useMediator.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMediator.cjs","names":[],"sources":["../../src/useMediator/useMediator.ts"],"sourcesContent":["import { onBeforeUnmount, shallowReactive as vueReactive, watchEffect, type WatchHandle } from 'vue';\nimport { getFunctionSignature } from '@pastweb/tools/getFunctionSignature';\nimport { createMediatorContextUtils } from '@pastweb/tools/globalContext/createMediatorContextUtils';\nimport { isHMREnabled } from '@pastweb/tools/isHMREnabled';\nimport { effect, reactive } from '@pastweb/tools/reactivity';\nimport { update } from '@pastweb/tools/update';\nimport { getContext } from '../getContext';\nimport { setContext } from '../setContext';\nimport { syncRecord } from './utils';\nimport type { ContextUtils, Extras, Mediator, MediatorFunction, Props } from './types';\n\n/**\n * Creates a tools mediator inside a Vue component.\n *\n * The mediator is created once for the component instance. Props and extras are\n * copied into tools reactive objects and kept in sync with Vue updates, while\n * mediator state is mirrored into Vue shallow reactivity for rendering.\n *\n * Vue does not need React's render-time mediator store because `setup()` runs\n * once per component instance. This hook still keeps an instance-local store so\n * mediator state persists across prop updates and Vue watchers are stopped on\n * unmount. During development HMR, a changed mediator source signature\n * reinitializes the mediator in place and refreshes the Vue state mirror.\n *\n * @typeParam T - Mediator return type.\n * @param mediator - Tools mediator factory.\n * @param props - Props passed to the mediator. `children` is ignored.\n * @param extras - Extra values passed to the mediator.\n * @returns Mediator return value with Vue-rendered state.\n *\n * @example\n * counterMediator.ts\n *\n * ```ts\n * import { reactive } from '@pastweb/tools';\n *\n * export function createCounter(props: { initial: number }) {\n * const state = reactive({ count: props.initial });\n *\n * return {\n * state,\n * increment: () => {\n * state.count += 1;\n * },\n * };\n * }\n * ```\n *\n * CounterButton.vue\n *\n * ```vue\n * <script setup lang=\"ts\">\n * import { useMediator } from '@pastweb/vue';\n * import { createCounter } from './counterMediator';\n *\n * const counter = useMediator(createCounter, { initial: 0 });\n * </script>\n *\n * <template>\n * <button @click=\"counter.increment\">\n * {{ counter.state.count }}\n * </button>\n * </template>\n * ```\n */\nexport const useMediator = <T>(mediator: MediatorFunction<T>, props: Props = {}, extras: Extras = {}): T => {\n const { children: _children, ...restProps } = props;\n const stops = new Set<WatchHandle>();\n const hmr = isHMREnabled();\n let isDisposed = false;\n let activeGeneration = 0;\n let storedMediator = mediator;\n let storedMediatorSignature = getFunctionSignature(storedMediator);\n\n const storedProps = reactive({ ...restProps });\n const storedExtras = reactive({ ...extras });\n const contextUtils: ContextUtils = {\n getContext,\n setContext,\n };\n let mediatorResult = createMediator();\n const state: Record<string, any> = vueReactive({ ...(mediatorResult.state || {}) });\n const output = { ...mediatorResult, state } as Mediator & Record<string, any>;\n\n function createMediator(): Mediator & Record<string, any> {\n return createMediatorContextUtils(\n storedMediator,\n storedProps,\n storedExtras,\n contextUtils,\n ) as Mediator & Record<string, any>;\n }\n\n function syncOutput(): void {\n Object.keys(output).forEach(key => {\n if (key !== 'state' && !(key in mediatorResult)) delete output[key];\n });\n\n Object.entries(mediatorResult).forEach(([key, value]) => {\n if (key !== 'state') output[key] = value;\n });\n }\n\n function bridgeState(): void {\n const generation = ++activeGeneration;\n\n syncRecord(state, mediatorResult.state || {});\n\n if (mediatorResult.state) {\n effect(() => {\n if (!isDisposed && generation === activeGeneration && mediatorResult.state) {\n update(state, mediatorResult.state);\n }\n }, mediatorResult.state);\n }\n }\n\n function reinitializeMediator(nextMediator: MediatorFunction<T>): void {\n storedMediator = nextMediator;\n storedMediatorSignature = getFunctionSignature(storedMediator);\n mediatorResult = createMediator();\n\n syncOutput();\n bridgeState();\n }\n\n syncOutput();\n bridgeState();\n\n stops.add(watchEffect(() => {\n const { children: _children, ...nextProps } = props;\n syncRecord(storedProps, nextProps);\n\n if (hmr) {\n const nextSignature = getFunctionSignature(mediator);\n\n if (storedMediatorSignature !== nextSignature) {\n reinitializeMediator(mediator);\n }\n }\n }));\n\n stops.add(watchEffect(() => {\n syncRecord(storedExtras, extras);\n }));\n\n onBeforeUnmount(() => {\n isDisposed = true;\n activeGeneration += 1;\n stops.forEach(stop => stop());\n stops.clear();\n });\n\n return output as T;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,MAAa,eAAkB,UAA+B,QAAe,CAAC,GAAG,SAAiB,CAAC,MAAS;CAC1G,MAAM,EAAE,UAAU,WAAW,GAAG,cAAc;CAC9C,MAAM,wBAAQ,IAAI,IAAiB;CACnC,MAAM,OAAA,GAAA,4BAAA,aAAA,CAAmB;CACzB,IAAI,aAAa;CACjB,IAAI,mBAAmB;CACvB,IAAI,iBAAiB;CACrB,IAAI,2BAAA,GAAA,oCAAA,qBAAA,CAA+C,cAAc;CAEjE,MAAM,eAAA,GAAA,0BAAA,SAAA,CAAuB,EAAE,GAAG,UAAU,CAAC;CAC7C,MAAM,gBAAA,GAAA,0BAAA,SAAA,CAAwB,EAAE,GAAG,OAAO,CAAC;CAC3C,MAAM,eAA6B;EACjC,YAAA,8BAAA;EACA,YAAA,8BAAA;CACF;CACA,IAAI,iBAAiB,eAAe;CACpC,MAAM,SAAA,GAAA,IAAA,gBAAA,CAAyC,EAAE,GAAI,eAAe,SAAS,CAAC,EAAG,CAAC;CAClF,MAAM,SAAS;EAAE,GAAG;EAAgB;CAAM;CAE1C,SAAS,iBAAiD;EACxD,QAAA,GAAA,wDAAA,2BAAA,CACE,gBACA,aACA,cACA,YACF;CACF;CAEA,SAAS,aAAmB;EAC1B,OAAO,KAAK,MAAM,CAAC,CAAC,SAAQ,QAAO;GACjC,IAAI,QAAQ,WAAW,EAAE,OAAO,iBAAiB,OAAO,OAAO;EACjE,CAAC;EAED,OAAO,QAAQ,cAAc,CAAC,CAAC,SAAS,CAAC,KAAK,WAAW;GACvD,IAAI,QAAQ,SAAS,OAAO,OAAO;EACrC,CAAC;CACH;CAEA,SAAS,cAAoB;EAC3B,MAAM,aAAa,EAAE;EAErB,0BAAA,WAAW,OAAO,eAAe,SAAS,CAAC,CAAC;EAE5C,IAAI,eAAe,OACjB,CAAA,GAAA,0BAAA,OAAA,OAAa;GACX,IAAI,CAAC,cAAc,eAAe,oBAAoB,eAAe,OACnE,CAAA,GAAA,sBAAA,OAAA,CAAO,OAAO,eAAe,KAAK;EAEtC,GAAG,eAAe,KAAK;CAE3B;CAEA,SAAS,qBAAqB,cAAyC;EACrE,iBAAiB;EACjB,2BAAA,GAAA,oCAAA,qBAAA,CAA+C,cAAc;EAC7D,iBAAiB,eAAe;EAEhC,WAAW;EACX,YAAY;CACd;CAEA,WAAW;CACX,YAAY;CAEZ,MAAM,KAAA,GAAA,IAAA,YAAA,OAAsB;EAC1B,MAAM,EAAE,UAAU,WAAW,GAAG,cAAc;EAC9C,0BAAA,WAAW,aAAa,SAAS;EAEjC,IAAI,KAAK;GACP,MAAM,iBAAA,GAAA,oCAAA,qBAAA,CAAqC,QAAQ;GAEnD,IAAI,4BAA4B,eAC9B,qBAAqB,QAAQ;EAEjC;CACF,CAAC,CAAC;CAEF,MAAM,KAAA,GAAA,IAAA,YAAA,OAAsB;EAC1B,0BAAA,WAAW,cAAc,MAAM;CACjC,CAAC,CAAC;CAEF,CAAA,GAAA,IAAA,gBAAA,OAAsB;EACpB,aAAa;EACb,oBAAoB;EACpB,MAAM,SAAQ,SAAQ,KAAK,CAAC;EAC5B,MAAM,MAAM;CACd,CAAC;CAED,OAAO;AACT"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Extras, MediatorFunction, Props } from "./types.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/useMediator/useMediator.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a tools mediator inside a Vue component.
|
|
6
|
+
*
|
|
7
|
+
* The mediator is created once for the component instance. Props and extras are
|
|
8
|
+
* copied into tools reactive objects and kept in sync with Vue updates, while
|
|
9
|
+
* mediator state is mirrored into Vue shallow reactivity for rendering.
|
|
10
|
+
*
|
|
11
|
+
* Vue does not need React's render-time mediator store because `setup()` runs
|
|
12
|
+
* once per component instance. This hook still keeps an instance-local store so
|
|
13
|
+
* mediator state persists across prop updates and Vue watchers are stopped on
|
|
14
|
+
* unmount. During development HMR, a changed mediator source signature
|
|
15
|
+
* reinitializes the mediator in place and refreshes the Vue state mirror.
|
|
16
|
+
*
|
|
17
|
+
* @typeParam T - Mediator return type.
|
|
18
|
+
* @param mediator - Tools mediator factory.
|
|
19
|
+
* @param props - Props passed to the mediator. `children` is ignored.
|
|
20
|
+
* @param extras - Extra values passed to the mediator.
|
|
21
|
+
* @returns Mediator return value with Vue-rendered state.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* counterMediator.ts
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* import { reactive } from '@pastweb/tools';
|
|
28
|
+
*
|
|
29
|
+
* export function createCounter(props: { initial: number }) {
|
|
30
|
+
* const state = reactive({ count: props.initial });
|
|
31
|
+
*
|
|
32
|
+
* return {
|
|
33
|
+
* state,
|
|
34
|
+
* increment: () => {
|
|
35
|
+
* state.count += 1;
|
|
36
|
+
* },
|
|
37
|
+
* };
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* CounterButton.vue
|
|
42
|
+
*
|
|
43
|
+
* ```vue
|
|
44
|
+
* <script setup lang="ts">
|
|
45
|
+
* import { useMediator } from '@pastweb/vue';
|
|
46
|
+
* import { createCounter } from './counterMediator';
|
|
47
|
+
*
|
|
48
|
+
* const counter = useMediator(createCounter, { initial: 0 });
|
|
49
|
+
* </script>
|
|
50
|
+
*
|
|
51
|
+
* <template>
|
|
52
|
+
* <button @click="counter.increment">
|
|
53
|
+
* {{ counter.state.count }}
|
|
54
|
+
* </button>
|
|
55
|
+
* </template>
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare const useMediator: <T>(mediator: MediatorFunction<T>, props?: Props, extras?: Extras) => T;
|
|
59
|
+
//#endregion
|
|
60
|
+
export { useMediator };
|
|
61
|
+
//# sourceMappingURL=useMediator.d.cts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Extras, MediatorFunction, Props } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/useMediator/useMediator.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a tools mediator inside a Vue component.
|
|
6
|
+
*
|
|
7
|
+
* The mediator is created once for the component instance. Props and extras are
|
|
8
|
+
* copied into tools reactive objects and kept in sync with Vue updates, while
|
|
9
|
+
* mediator state is mirrored into Vue shallow reactivity for rendering.
|
|
10
|
+
*
|
|
11
|
+
* Vue does not need React's render-time mediator store because `setup()` runs
|
|
12
|
+
* once per component instance. This hook still keeps an instance-local store so
|
|
13
|
+
* mediator state persists across prop updates and Vue watchers are stopped on
|
|
14
|
+
* unmount. During development HMR, a changed mediator source signature
|
|
15
|
+
* reinitializes the mediator in place and refreshes the Vue state mirror.
|
|
16
|
+
*
|
|
17
|
+
* @typeParam T - Mediator return type.
|
|
18
|
+
* @param mediator - Tools mediator factory.
|
|
19
|
+
* @param props - Props passed to the mediator. `children` is ignored.
|
|
20
|
+
* @param extras - Extra values passed to the mediator.
|
|
21
|
+
* @returns Mediator return value with Vue-rendered state.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* counterMediator.ts
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* import { reactive } from '@pastweb/tools';
|
|
28
|
+
*
|
|
29
|
+
* export function createCounter(props: { initial: number }) {
|
|
30
|
+
* const state = reactive({ count: props.initial });
|
|
31
|
+
*
|
|
32
|
+
* return {
|
|
33
|
+
* state,
|
|
34
|
+
* increment: () => {
|
|
35
|
+
* state.count += 1;
|
|
36
|
+
* },
|
|
37
|
+
* };
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* CounterButton.vue
|
|
42
|
+
*
|
|
43
|
+
* ```vue
|
|
44
|
+
* <script setup lang="ts">
|
|
45
|
+
* import { useMediator } from '@pastweb/vue';
|
|
46
|
+
* import { createCounter } from './counterMediator';
|
|
47
|
+
*
|
|
48
|
+
* const counter = useMediator(createCounter, { initial: 0 });
|
|
49
|
+
* </script>
|
|
50
|
+
*
|
|
51
|
+
* <template>
|
|
52
|
+
* <button @click="counter.increment">
|
|
53
|
+
* {{ counter.state.count }}
|
|
54
|
+
* </button>
|
|
55
|
+
* </template>
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare const useMediator: <T>(mediator: MediatorFunction<T>, props?: Props, extras?: Extras) => T;
|
|
59
|
+
//#endregion
|
|
60
|
+
export { useMediator };
|
|
61
|
+
//# sourceMappingURL=useMediator.d.ts.map
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { getContext } from "../getContext/getContext.js";
|
|
2
|
+
import "../getContext/index.js";
|
|
3
|
+
import { setContext } from "../setContext/setContext.js";
|
|
4
|
+
import "../setContext/index.js";
|
|
5
|
+
import { syncRecord } from "./utils.js";
|
|
6
|
+
import { onBeforeUnmount, shallowReactive, watchEffect } from "vue";
|
|
7
|
+
import { effect, reactive as reactive$1 } from "@pastweb/tools/reactivity";
|
|
8
|
+
import { update } from "@pastweb/tools/update";
|
|
9
|
+
import { getFunctionSignature } from "@pastweb/tools/getFunctionSignature";
|
|
10
|
+
import { createMediatorContextUtils } from "@pastweb/tools/globalContext/createMediatorContextUtils";
|
|
11
|
+
import { isHMREnabled } from "@pastweb/tools/isHMREnabled";
|
|
12
|
+
//#region src/useMediator/useMediator.ts
|
|
13
|
+
/**
|
|
14
|
+
* Creates a tools mediator inside a Vue component.
|
|
15
|
+
*
|
|
16
|
+
* The mediator is created once for the component instance. Props and extras are
|
|
17
|
+
* copied into tools reactive objects and kept in sync with Vue updates, while
|
|
18
|
+
* mediator state is mirrored into Vue shallow reactivity for rendering.
|
|
19
|
+
*
|
|
20
|
+
* Vue does not need React's render-time mediator store because `setup()` runs
|
|
21
|
+
* once per component instance. This hook still keeps an instance-local store so
|
|
22
|
+
* mediator state persists across prop updates and Vue watchers are stopped on
|
|
23
|
+
* unmount. During development HMR, a changed mediator source signature
|
|
24
|
+
* reinitializes the mediator in place and refreshes the Vue state mirror.
|
|
25
|
+
*
|
|
26
|
+
* @typeParam T - Mediator return type.
|
|
27
|
+
* @param mediator - Tools mediator factory.
|
|
28
|
+
* @param props - Props passed to the mediator. `children` is ignored.
|
|
29
|
+
* @param extras - Extra values passed to the mediator.
|
|
30
|
+
* @returns Mediator return value with Vue-rendered state.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* counterMediator.ts
|
|
34
|
+
*
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { reactive } from '@pastweb/tools';
|
|
37
|
+
*
|
|
38
|
+
* export function createCounter(props: { initial: number }) {
|
|
39
|
+
* const state = reactive({ count: props.initial });
|
|
40
|
+
*
|
|
41
|
+
* return {
|
|
42
|
+
* state,
|
|
43
|
+
* increment: () => {
|
|
44
|
+
* state.count += 1;
|
|
45
|
+
* },
|
|
46
|
+
* };
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* CounterButton.vue
|
|
51
|
+
*
|
|
52
|
+
* ```vue
|
|
53
|
+
* <script setup lang="ts">
|
|
54
|
+
* import { useMediator } from '@pastweb/vue';
|
|
55
|
+
* import { createCounter } from './counterMediator';
|
|
56
|
+
*
|
|
57
|
+
* const counter = useMediator(createCounter, { initial: 0 });
|
|
58
|
+
* <\/script>
|
|
59
|
+
*
|
|
60
|
+
* <template>
|
|
61
|
+
* <button @click="counter.increment">
|
|
62
|
+
* {{ counter.state.count }}
|
|
63
|
+
* </button>
|
|
64
|
+
* </template>
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
const useMediator = (mediator, props = {}, extras = {}) => {
|
|
68
|
+
const { children: _children, ...restProps } = props;
|
|
69
|
+
const stops = /* @__PURE__ */ new Set();
|
|
70
|
+
const hmr = isHMREnabled();
|
|
71
|
+
let isDisposed = false;
|
|
72
|
+
let activeGeneration = 0;
|
|
73
|
+
let storedMediator = mediator;
|
|
74
|
+
let storedMediatorSignature = getFunctionSignature(storedMediator);
|
|
75
|
+
const storedProps = reactive$1({ ...restProps });
|
|
76
|
+
const storedExtras = reactive$1({ ...extras });
|
|
77
|
+
const contextUtils = {
|
|
78
|
+
getContext,
|
|
79
|
+
setContext
|
|
80
|
+
};
|
|
81
|
+
let mediatorResult = createMediator();
|
|
82
|
+
const state = shallowReactive({ ...mediatorResult.state || {} });
|
|
83
|
+
const output = {
|
|
84
|
+
...mediatorResult,
|
|
85
|
+
state
|
|
86
|
+
};
|
|
87
|
+
function createMediator() {
|
|
88
|
+
return createMediatorContextUtils(storedMediator, storedProps, storedExtras, contextUtils);
|
|
89
|
+
}
|
|
90
|
+
function syncOutput() {
|
|
91
|
+
Object.keys(output).forEach((key) => {
|
|
92
|
+
if (key !== "state" && !(key in mediatorResult)) delete output[key];
|
|
93
|
+
});
|
|
94
|
+
Object.entries(mediatorResult).forEach(([key, value]) => {
|
|
95
|
+
if (key !== "state") output[key] = value;
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function bridgeState() {
|
|
99
|
+
const generation = ++activeGeneration;
|
|
100
|
+
syncRecord(state, mediatorResult.state || {});
|
|
101
|
+
if (mediatorResult.state) effect(() => {
|
|
102
|
+
if (!isDisposed && generation === activeGeneration && mediatorResult.state) update(state, mediatorResult.state);
|
|
103
|
+
}, mediatorResult.state);
|
|
104
|
+
}
|
|
105
|
+
function reinitializeMediator(nextMediator) {
|
|
106
|
+
storedMediator = nextMediator;
|
|
107
|
+
storedMediatorSignature = getFunctionSignature(storedMediator);
|
|
108
|
+
mediatorResult = createMediator();
|
|
109
|
+
syncOutput();
|
|
110
|
+
bridgeState();
|
|
111
|
+
}
|
|
112
|
+
syncOutput();
|
|
113
|
+
bridgeState();
|
|
114
|
+
stops.add(watchEffect(() => {
|
|
115
|
+
const { children: _children, ...nextProps } = props;
|
|
116
|
+
syncRecord(storedProps, nextProps);
|
|
117
|
+
if (hmr) {
|
|
118
|
+
const nextSignature = getFunctionSignature(mediator);
|
|
119
|
+
if (storedMediatorSignature !== nextSignature) reinitializeMediator(mediator);
|
|
120
|
+
}
|
|
121
|
+
}));
|
|
122
|
+
stops.add(watchEffect(() => {
|
|
123
|
+
syncRecord(storedExtras, extras);
|
|
124
|
+
}));
|
|
125
|
+
onBeforeUnmount(() => {
|
|
126
|
+
isDisposed = true;
|
|
127
|
+
activeGeneration += 1;
|
|
128
|
+
stops.forEach((stop) => stop());
|
|
129
|
+
stops.clear();
|
|
130
|
+
});
|
|
131
|
+
return output;
|
|
132
|
+
};
|
|
133
|
+
//#endregion
|
|
134
|
+
export { useMediator };
|
|
135
|
+
|
|
136
|
+
//# sourceMappingURL=useMediator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMediator.js","names":["reactive","vueReactive"],"sources":["../../src/useMediator/useMediator.ts"],"sourcesContent":["import { onBeforeUnmount, shallowReactive as vueReactive, watchEffect, type WatchHandle } from 'vue';\nimport { getFunctionSignature } from '@pastweb/tools/getFunctionSignature';\nimport { createMediatorContextUtils } from '@pastweb/tools/globalContext/createMediatorContextUtils';\nimport { isHMREnabled } from '@pastweb/tools/isHMREnabled';\nimport { effect, reactive } from '@pastweb/tools/reactivity';\nimport { update } from '@pastweb/tools/update';\nimport { getContext } from '../getContext';\nimport { setContext } from '../setContext';\nimport { syncRecord } from './utils';\nimport type { ContextUtils, Extras, Mediator, MediatorFunction, Props } from './types';\n\n/**\n * Creates a tools mediator inside a Vue component.\n *\n * The mediator is created once for the component instance. Props and extras are\n * copied into tools reactive objects and kept in sync with Vue updates, while\n * mediator state is mirrored into Vue shallow reactivity for rendering.\n *\n * Vue does not need React's render-time mediator store because `setup()` runs\n * once per component instance. This hook still keeps an instance-local store so\n * mediator state persists across prop updates and Vue watchers are stopped on\n * unmount. During development HMR, a changed mediator source signature\n * reinitializes the mediator in place and refreshes the Vue state mirror.\n *\n * @typeParam T - Mediator return type.\n * @param mediator - Tools mediator factory.\n * @param props - Props passed to the mediator. `children` is ignored.\n * @param extras - Extra values passed to the mediator.\n * @returns Mediator return value with Vue-rendered state.\n *\n * @example\n * counterMediator.ts\n *\n * ```ts\n * import { reactive } from '@pastweb/tools';\n *\n * export function createCounter(props: { initial: number }) {\n * const state = reactive({ count: props.initial });\n *\n * return {\n * state,\n * increment: () => {\n * state.count += 1;\n * },\n * };\n * }\n * ```\n *\n * CounterButton.vue\n *\n * ```vue\n * <script setup lang=\"ts\">\n * import { useMediator } from '@pastweb/vue';\n * import { createCounter } from './counterMediator';\n *\n * const counter = useMediator(createCounter, { initial: 0 });\n * </script>\n *\n * <template>\n * <button @click=\"counter.increment\">\n * {{ counter.state.count }}\n * </button>\n * </template>\n * ```\n */\nexport const useMediator = <T>(mediator: MediatorFunction<T>, props: Props = {}, extras: Extras = {}): T => {\n const { children: _children, ...restProps } = props;\n const stops = new Set<WatchHandle>();\n const hmr = isHMREnabled();\n let isDisposed = false;\n let activeGeneration = 0;\n let storedMediator = mediator;\n let storedMediatorSignature = getFunctionSignature(storedMediator);\n\n const storedProps = reactive({ ...restProps });\n const storedExtras = reactive({ ...extras });\n const contextUtils: ContextUtils = {\n getContext,\n setContext,\n };\n let mediatorResult = createMediator();\n const state: Record<string, any> = vueReactive({ ...(mediatorResult.state || {}) });\n const output = { ...mediatorResult, state } as Mediator & Record<string, any>;\n\n function createMediator(): Mediator & Record<string, any> {\n return createMediatorContextUtils(\n storedMediator,\n storedProps,\n storedExtras,\n contextUtils,\n ) as Mediator & Record<string, any>;\n }\n\n function syncOutput(): void {\n Object.keys(output).forEach(key => {\n if (key !== 'state' && !(key in mediatorResult)) delete output[key];\n });\n\n Object.entries(mediatorResult).forEach(([key, value]) => {\n if (key !== 'state') output[key] = value;\n });\n }\n\n function bridgeState(): void {\n const generation = ++activeGeneration;\n\n syncRecord(state, mediatorResult.state || {});\n\n if (mediatorResult.state) {\n effect(() => {\n if (!isDisposed && generation === activeGeneration && mediatorResult.state) {\n update(state, mediatorResult.state);\n }\n }, mediatorResult.state);\n }\n }\n\n function reinitializeMediator(nextMediator: MediatorFunction<T>): void {\n storedMediator = nextMediator;\n storedMediatorSignature = getFunctionSignature(storedMediator);\n mediatorResult = createMediator();\n\n syncOutput();\n bridgeState();\n }\n\n syncOutput();\n bridgeState();\n\n stops.add(watchEffect(() => {\n const { children: _children, ...nextProps } = props;\n syncRecord(storedProps, nextProps);\n\n if (hmr) {\n const nextSignature = getFunctionSignature(mediator);\n\n if (storedMediatorSignature !== nextSignature) {\n reinitializeMediator(mediator);\n }\n }\n }));\n\n stops.add(watchEffect(() => {\n syncRecord(storedExtras, extras);\n }));\n\n onBeforeUnmount(() => {\n isDisposed = true;\n activeGeneration += 1;\n stops.forEach(stop => stop());\n stops.clear();\n });\n\n return output as T;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,MAAa,eAAkB,UAA+B,QAAe,CAAC,GAAG,SAAiB,CAAC,MAAS;CAC1G,MAAM,EAAE,UAAU,WAAW,GAAG,cAAc;CAC9C,MAAM,wBAAQ,IAAI,IAAiB;CACnC,MAAM,MAAM,aAAa;CACzB,IAAI,aAAa;CACjB,IAAI,mBAAmB;CACvB,IAAI,iBAAiB;CACrB,IAAI,0BAA0B,qBAAqB,cAAc;CAEjE,MAAM,cAAcA,WAAS,EAAE,GAAG,UAAU,CAAC;CAC7C,MAAM,eAAeA,WAAS,EAAE,GAAG,OAAO,CAAC;CAC3C,MAAM,eAA6B;EACjC;EACA;CACF;CACA,IAAI,iBAAiB,eAAe;CACpC,MAAM,QAA6BC,gBAAY,EAAE,GAAI,eAAe,SAAS,CAAC,EAAG,CAAC;CAClF,MAAM,SAAS;EAAE,GAAG;EAAgB;CAAM;CAE1C,SAAS,iBAAiD;EACxD,OAAO,2BACL,gBACA,aACA,cACA,YACF;CACF;CAEA,SAAS,aAAmB;EAC1B,OAAO,KAAK,MAAM,CAAC,CAAC,SAAQ,QAAO;GACjC,IAAI,QAAQ,WAAW,EAAE,OAAO,iBAAiB,OAAO,OAAO;EACjE,CAAC;EAED,OAAO,QAAQ,cAAc,CAAC,CAAC,SAAS,CAAC,KAAK,WAAW;GACvD,IAAI,QAAQ,SAAS,OAAO,OAAO;EACrC,CAAC;CACH;CAEA,SAAS,cAAoB;EAC3B,MAAM,aAAa,EAAE;EAErB,WAAW,OAAO,eAAe,SAAS,CAAC,CAAC;EAE5C,IAAI,eAAe,OACjB,aAAa;GACX,IAAI,CAAC,cAAc,eAAe,oBAAoB,eAAe,OACnE,OAAO,OAAO,eAAe,KAAK;EAEtC,GAAG,eAAe,KAAK;CAE3B;CAEA,SAAS,qBAAqB,cAAyC;EACrE,iBAAiB;EACjB,0BAA0B,qBAAqB,cAAc;EAC7D,iBAAiB,eAAe;EAEhC,WAAW;EACX,YAAY;CACd;CAEA,WAAW;CACX,YAAY;CAEZ,MAAM,IAAI,kBAAkB;EAC1B,MAAM,EAAE,UAAU,WAAW,GAAG,cAAc;EAC9C,WAAW,aAAa,SAAS;EAEjC,IAAI,KAAK;GACP,MAAM,gBAAgB,qBAAqB,QAAQ;GAEnD,IAAI,4BAA4B,eAC9B,qBAAqB,QAAQ;EAEjC;CACF,CAAC,CAAC;CAEF,MAAM,IAAI,kBAAkB;EAC1B,WAAW,cAAc,MAAM;CACjC,CAAC,CAAC;CAEF,sBAAsB;EACpB,aAAa;EACb,oBAAoB;EACpB,MAAM,SAAQ,SAAQ,KAAK,CAAC;EAC5B,MAAM,MAAM;CACd,CAAC;CAED,OAAO;AACT"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _pastweb_tools_update = require("@pastweb/tools/update");
|
|
3
|
+
//#region src/useMediator/utils.ts
|
|
4
|
+
/**
|
|
5
|
+
* Synchronizes a mutable record with a source object.
|
|
6
|
+
*
|
|
7
|
+
* Keys missing from the source are removed from the target, then remaining
|
|
8
|
+
* values are merged with the shared tools `update` helper.
|
|
9
|
+
*
|
|
10
|
+
* @param target - Mutable record to update in place.
|
|
11
|
+
* @param source - Source values that should remain on the target.
|
|
12
|
+
*/
|
|
13
|
+
function syncRecord(target, source) {
|
|
14
|
+
Object.keys(target).forEach((key) => {
|
|
15
|
+
if (!(key in source)) delete target[key];
|
|
16
|
+
});
|
|
17
|
+
(0, _pastweb_tools_update.update)(target, source);
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
exports.syncRecord = syncRecord;
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.cjs","names":[],"sources":["../../src/useMediator/utils.ts"],"sourcesContent":["import { update } from '@pastweb/tools/update';\n\n/**\n * Synchronizes a mutable record with a source object.\n *\n * Keys missing from the source are removed from the target, then remaining\n * values are merged with the shared tools `update` helper.\n *\n * @param target - Mutable record to update in place.\n * @param source - Source values that should remain on the target.\n */\nexport function syncRecord(target: Record<string, any>, source: Record<string, any>): void {\n Object.keys(target).forEach(key => {\n if (!(key in source)) delete target[key];\n });\n\n update(target, source);\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,WAAW,QAA6B,QAAmC;CACzF,OAAO,KAAK,MAAM,CAAC,CAAC,SAAQ,QAAO;EACjC,IAAI,EAAE,OAAO,SAAS,OAAO,OAAO;CACtC,CAAC;CAED,CAAA,GAAA,sBAAA,OAAA,CAAO,QAAQ,MAAM;AACvB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/useMediator/utils.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Synchronizes a mutable record with a source object.
|
|
4
|
+
*
|
|
5
|
+
* Keys missing from the source are removed from the target, then remaining
|
|
6
|
+
* values are merged with the shared tools `update` helper.
|
|
7
|
+
*
|
|
8
|
+
* @param target - Mutable record to update in place.
|
|
9
|
+
* @param source - Source values that should remain on the target.
|
|
10
|
+
*/
|
|
11
|
+
declare function syncRecord(target: Record<string, any>, source: Record<string, any>): void;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { syncRecord };
|
|
14
|
+
//# sourceMappingURL=utils.d.cts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/useMediator/utils.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Synchronizes a mutable record with a source object.
|
|
4
|
+
*
|
|
5
|
+
* Keys missing from the source are removed from the target, then remaining
|
|
6
|
+
* values are merged with the shared tools `update` helper.
|
|
7
|
+
*
|
|
8
|
+
* @param target - Mutable record to update in place.
|
|
9
|
+
* @param source - Source values that should remain on the target.
|
|
10
|
+
*/
|
|
11
|
+
declare function syncRecord(target: Record<string, any>, source: Record<string, any>): void;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { syncRecord };
|
|
14
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { update } from "@pastweb/tools/update";
|
|
2
|
+
//#region src/useMediator/utils.ts
|
|
3
|
+
/**
|
|
4
|
+
* Synchronizes a mutable record with a source object.
|
|
5
|
+
*
|
|
6
|
+
* Keys missing from the source are removed from the target, then remaining
|
|
7
|
+
* values are merged with the shared tools `update` helper.
|
|
8
|
+
*
|
|
9
|
+
* @param target - Mutable record to update in place.
|
|
10
|
+
* @param source - Source values that should remain on the target.
|
|
11
|
+
*/
|
|
12
|
+
function syncRecord(target, source) {
|
|
13
|
+
Object.keys(target).forEach((key) => {
|
|
14
|
+
if (!(key in source)) delete target[key];
|
|
15
|
+
});
|
|
16
|
+
update(target, source);
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { syncRecord };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=utils.js.map
|