@baleada/vue-composition 0.10.13 → 0.11.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/lib/index.d.ts +20 -22
- package/lib/index.js +27 -37
- package/package.json +3 -3
package/lib/index.d.ts
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AnimateableKeyframe, AnimateableOptions, Animateable, BroadcastableOptions, Broadcastable, CompareableOptions, Compareable, CompleteableOptions, Completeable, CopyableOptions, Copyable, DelayableEffect, DelayableOptions, Delayable,
|
|
1
|
+
import { ShallowReactive } from 'vue';
|
|
2
|
+
import { AnimateableKeyframe, AnimateableOptions, Animateable, BroadcastableOptions, Broadcastable, CompareableOptions, Compareable, CompleteableOptions, Completeable, CopyableOptions, Copyable, DelayableEffect, DelayableOptions, Delayable, DrawableStroke, DrawableOptions, Drawable, FetchableOptions, Fetchable, FullscreenableGetElement, FullscreenableOptions, Fullscreenable, GrantableOptions, Grantable, ListenableSupportedType, ListenableOptions, Listenable, NavigateableOptions, Navigateable, PickableOptions, Pickable, ListenEffectParam, RecognizeableOptions, Recognizeable, ResolveableOptions, Resolveable, ShareableOptions, Shareable, StoreableOptions, Storeable } from '@baleada/logic';
|
|
3
3
|
|
|
4
|
-
declare function useAnimateable(keyframes: AnimateableKeyframe[], options?: AnimateableOptions):
|
|
5
|
-
declare function useBroadcastable<State>(state: State, options?: BroadcastableOptions):
|
|
6
|
-
declare function useCompareable(string: string, options?: CompareableOptions):
|
|
7
|
-
declare function useCompleteable(string: string, options?: CompleteableOptions):
|
|
8
|
-
declare function useCopyable(string: string, options?: CopyableOptions):
|
|
9
|
-
declare function useDelayable(effect: DelayableEffect, options?: DelayableOptions):
|
|
10
|
-
declare function useDrawable(stroke:
|
|
11
|
-
declare function useFetchable(resource: string, options?: FetchableOptions):
|
|
12
|
-
declare function useFullscreenable<ElementType extends Element>(getElement: FullscreenableGetElement<ElementType>, options?: FullscreenableOptions):
|
|
13
|
-
declare function useGrantable
|
|
14
|
-
declare function useListenable<Type extends ListenableSupportedType, RecognizeableMetadata extends Record<any, any> = Record<any, any>>(type: Type, options?: ListenableOptions<Type, RecognizeableMetadata>):
|
|
15
|
-
declare function useNavigateable<Item>(array: Item[], options?: NavigateableOptions):
|
|
16
|
-
declare function usePickable<Item>(array: Item[], options?: PickableOptions):
|
|
17
|
-
declare function useRecognizeable<Type extends ListenableSupportedType, Metadata extends Record<any, any>>(sequence: ListenEffectParam<Type>[], options?: RecognizeableOptions<Type, Metadata>):
|
|
18
|
-
declare function useResolveable<Value>(getPromise:
|
|
19
|
-
declare function
|
|
20
|
-
declare function
|
|
21
|
-
declare function useShareable(state: ShareData, options?: ShareableOptions): Ref<Shareable>;
|
|
22
|
-
declare function useStoreable<String extends string>(key: string, options?: StoreableOptions): Ref<Storeable<String>>;
|
|
4
|
+
declare function useAnimateable<Value extends string | number | any[]>(keyframes: AnimateableKeyframe<Value>[], options?: AnimateableOptions): ShallowReactive<Animateable<Value>>;
|
|
5
|
+
declare function useBroadcastable<State>(state: State, options?: BroadcastableOptions): ShallowReactive<Broadcastable<State>>;
|
|
6
|
+
declare function useCompareable(string: string, options?: CompareableOptions): ShallowReactive<Compareable>;
|
|
7
|
+
declare function useCompleteable(string: string, options?: CompleteableOptions): ShallowReactive<Completeable>;
|
|
8
|
+
declare function useCopyable(string: string, options?: CopyableOptions): ShallowReactive<Copyable>;
|
|
9
|
+
declare function useDelayable(effect: DelayableEffect, options?: DelayableOptions): ShallowReactive<Delayable>;
|
|
10
|
+
declare function useDrawable(stroke: DrawableStroke, options?: DrawableOptions): ShallowReactive<Drawable>;
|
|
11
|
+
declare function useFetchable(resource: string, options?: FetchableOptions): ShallowReactive<Fetchable>;
|
|
12
|
+
declare function useFullscreenable<ElementType extends Element>(getElement: FullscreenableGetElement<ElementType>, options?: FullscreenableOptions): ShallowReactive<Fullscreenable<ElementType>>;
|
|
13
|
+
declare function useGrantable(descriptor: PermissionDescriptor, options?: GrantableOptions): ShallowReactive<Grantable>;
|
|
14
|
+
declare function useListenable<Type extends ListenableSupportedType, RecognizeableMetadata extends Record<any, any> = Record<any, any>>(type: Type, options?: ListenableOptions<Type, RecognizeableMetadata>): ShallowReactive<Listenable<Type, RecognizeableMetadata>>;
|
|
15
|
+
declare function useNavigateable<Item>(array: Item[], options?: NavigateableOptions): ShallowReactive<Navigateable<Item>>;
|
|
16
|
+
declare function usePickable<Item>(array: Item[], options?: PickableOptions): ShallowReactive<Pickable<Item>>;
|
|
17
|
+
declare function useRecognizeable<Type extends ListenableSupportedType, Metadata extends Record<any, any>>(sequence: ListenEffectParam<Type>[], options?: RecognizeableOptions<Type, Metadata>): ShallowReactive<Recognizeable<Type, Metadata>>;
|
|
18
|
+
declare function useResolveable<Value>(getPromise: () => Promise<Value>, options?: ResolveableOptions): ShallowReactive<Resolveable<Value>>;
|
|
19
|
+
declare function useShareable(shareData: ShareData, options?: ShareableOptions): ShallowReactive<Shareable>;
|
|
20
|
+
declare function useStoreable<String extends string>(key: string, options?: StoreableOptions): ShallowReactive<Storeable<String>>;
|
|
23
21
|
|
|
24
|
-
export { useAnimateable, useBroadcastable, useCompareable, useCompleteable, useCopyable, useDelayable, useDrawable, useFetchable, useFullscreenable, useGrantable, useListenable, useNavigateable, usePickable, useRecognizeable, useResolveable,
|
|
22
|
+
export { useAnimateable, useBroadcastable, useCompareable, useCompleteable, useCopyable, useDelayable, useDrawable, useFetchable, useFullscreenable, useGrantable, useListenable, useNavigateable, usePickable, useRecognizeable, useResolveable, useShareable, useStoreable };
|
package/lib/index.js
CHANGED
|
@@ -1,105 +1,95 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Animateable, Broadcastable, Compareable, Completeable, Copyable, Delayable, Drawable, Fetchable, Fullscreenable, Grantable, Listenable, Navigateable, Pickable, Recognizeable, Resolveable,
|
|
1
|
+
import { shallowReactive, onBeforeUnmount } from 'vue';
|
|
2
|
+
import { Animateable, Broadcastable, Compareable, Completeable, Copyable, Delayable, Drawable, Fetchable, Fullscreenable, Grantable, Listenable, Navigateable, Pickable, Recognizeable, Resolveable, Shareable, Storeable } from '@baleada/logic';
|
|
3
3
|
|
|
4
4
|
function useAnimateable(keyframes, options) {
|
|
5
5
|
const instance = new Animateable(keyframes, options);
|
|
6
|
-
const reactiveInstance =
|
|
7
|
-
onBeforeUnmount(() => reactiveInstance.
|
|
6
|
+
const reactiveInstance = shallowReactive(instance);
|
|
7
|
+
onBeforeUnmount(() => reactiveInstance.stop());
|
|
8
8
|
return reactiveInstance;
|
|
9
9
|
}
|
|
10
10
|
function useBroadcastable(state, options) {
|
|
11
11
|
const instance = new Broadcastable(state, options);
|
|
12
|
-
const reactiveInstance =
|
|
13
|
-
onBeforeUnmount(() => reactiveInstance.
|
|
12
|
+
const reactiveInstance = shallowReactive(instance);
|
|
13
|
+
onBeforeUnmount(() => reactiveInstance.stop());
|
|
14
14
|
return reactiveInstance;
|
|
15
15
|
}
|
|
16
16
|
function useCompareable(string, options) {
|
|
17
17
|
const instance = new Compareable(string, options);
|
|
18
|
-
const reactiveInstance =
|
|
18
|
+
const reactiveInstance = shallowReactive(instance);
|
|
19
19
|
return reactiveInstance;
|
|
20
20
|
}
|
|
21
21
|
function useCompleteable(string, options) {
|
|
22
22
|
const instance = new Completeable(string, options);
|
|
23
|
-
const reactiveInstance =
|
|
23
|
+
const reactiveInstance = shallowReactive(instance);
|
|
24
24
|
return reactiveInstance;
|
|
25
25
|
}
|
|
26
26
|
function useCopyable(string, options) {
|
|
27
27
|
const instance = new Copyable(string, options);
|
|
28
|
-
const reactiveInstance =
|
|
29
|
-
onBeforeUnmount(() => reactiveInstance.
|
|
28
|
+
const reactiveInstance = shallowReactive(instance);
|
|
29
|
+
onBeforeUnmount(() => reactiveInstance.stop());
|
|
30
30
|
return reactiveInstance;
|
|
31
31
|
}
|
|
32
32
|
function useDelayable(effect, options) {
|
|
33
33
|
const instance = new Delayable(effect, options);
|
|
34
|
-
const reactiveInstance =
|
|
35
|
-
onBeforeUnmount(() => reactiveInstance.
|
|
34
|
+
const reactiveInstance = shallowReactive(instance);
|
|
35
|
+
onBeforeUnmount(() => reactiveInstance.stop());
|
|
36
36
|
return reactiveInstance;
|
|
37
37
|
}
|
|
38
38
|
function useDrawable(stroke, options) {
|
|
39
39
|
const instance = new Drawable(stroke, options);
|
|
40
|
-
const reactiveInstance =
|
|
40
|
+
const reactiveInstance = shallowReactive(instance);
|
|
41
41
|
return reactiveInstance;
|
|
42
42
|
}
|
|
43
43
|
function useFetchable(resource, options) {
|
|
44
44
|
const instance = new Fetchable(resource, options);
|
|
45
|
-
const reactiveInstance =
|
|
45
|
+
const reactiveInstance = shallowReactive(instance);
|
|
46
46
|
return reactiveInstance;
|
|
47
47
|
}
|
|
48
48
|
function useFullscreenable(getElement, options) {
|
|
49
49
|
const instance = new Fullscreenable(getElement, options);
|
|
50
|
-
const reactiveInstance =
|
|
50
|
+
const reactiveInstance = shallowReactive(instance);
|
|
51
51
|
return reactiveInstance;
|
|
52
52
|
}
|
|
53
53
|
function useGrantable(descriptor, options) {
|
|
54
54
|
const instance = new Grantable(descriptor, options);
|
|
55
|
-
const reactiveInstance =
|
|
55
|
+
const reactiveInstance = shallowReactive(instance);
|
|
56
56
|
return reactiveInstance;
|
|
57
57
|
}
|
|
58
58
|
function useListenable(type, options) {
|
|
59
59
|
const instance = new Listenable(type, options);
|
|
60
|
-
const reactiveInstance =
|
|
61
|
-
onBeforeUnmount(() => reactiveInstance.
|
|
60
|
+
const reactiveInstance = shallowReactive(instance);
|
|
61
|
+
onBeforeUnmount(() => reactiveInstance.stop());
|
|
62
62
|
return reactiveInstance;
|
|
63
63
|
}
|
|
64
64
|
function useNavigateable(array, options) {
|
|
65
65
|
const instance = new Navigateable(array, options);
|
|
66
|
-
const reactiveInstance =
|
|
66
|
+
const reactiveInstance = shallowReactive(instance);
|
|
67
67
|
return reactiveInstance;
|
|
68
68
|
}
|
|
69
69
|
function usePickable(array, options) {
|
|
70
70
|
const instance = new Pickable(array, options);
|
|
71
|
-
const reactiveInstance =
|
|
71
|
+
const reactiveInstance = shallowReactive(instance);
|
|
72
72
|
return reactiveInstance;
|
|
73
73
|
}
|
|
74
74
|
function useRecognizeable(sequence, options) {
|
|
75
75
|
const instance = new Recognizeable(sequence, options);
|
|
76
|
-
const reactiveInstance =
|
|
76
|
+
const reactiveInstance = shallowReactive(instance);
|
|
77
77
|
return reactiveInstance;
|
|
78
78
|
}
|
|
79
79
|
function useResolveable(getPromise, options) {
|
|
80
80
|
const instance = new Resolveable(getPromise, options);
|
|
81
|
-
const reactiveInstance =
|
|
81
|
+
const reactiveInstance = shallowReactive(instance);
|
|
82
82
|
return reactiveInstance;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
const instance = new
|
|
86
|
-
const reactiveInstance =
|
|
87
|
-
return reactiveInstance;
|
|
88
|
-
}
|
|
89
|
-
function useSearchable(candidates, options) {
|
|
90
|
-
const instance = new Searchable(candidates, options);
|
|
91
|
-
const reactiveInstance = ref(instance);
|
|
92
|
-
return reactiveInstance;
|
|
93
|
-
}
|
|
94
|
-
function useShareable(state, options) {
|
|
95
|
-
const instance = new Shareable(state, options);
|
|
96
|
-
const reactiveInstance = ref(instance);
|
|
84
|
+
function useShareable(shareData, options) {
|
|
85
|
+
const instance = new Shareable(shareData, options);
|
|
86
|
+
const reactiveInstance = shallowReactive(instance);
|
|
97
87
|
return reactiveInstance;
|
|
98
88
|
}
|
|
99
89
|
function useStoreable(key, options) {
|
|
100
90
|
const instance = new Storeable(key, options);
|
|
101
|
-
const reactiveInstance =
|
|
91
|
+
const reactiveInstance = shallowReactive(instance);
|
|
102
92
|
return reactiveInstance;
|
|
103
93
|
}
|
|
104
94
|
|
|
105
|
-
export { useAnimateable, useBroadcastable, useCompareable, useCompleteable, useCopyable, useDelayable, useDrawable, useFetchable, useFullscreenable, useGrantable, useListenable, useNavigateable, usePickable, useRecognizeable, useResolveable,
|
|
95
|
+
export { useAnimateable, useBroadcastable, useCompareable, useCompleteable, useCopyable, useDelayable, useDrawable, useFetchable, useFullscreenable, useGrantable, useListenable, useNavigateable, usePickable, useRecognizeable, useResolveable, useShareable, useStoreable };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baleada/vue-composition",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Functions that expose Baleada Logic for composition in Vue.",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"src": "node -r esbuild-register scripts/src.ts",
|
|
13
13
|
"prepare": "npm run src && tsc && rollup --config rollup.config.ts --configPlugin typescript --bundleConfigAsCjs",
|
|
14
|
-
"test:only": "run() { uvu -r esbuild-register tests/$2 $1.test.
|
|
14
|
+
"test:only": "run() { uvu -r esbuild-register tests/$2 $1.test.ts$; }; run",
|
|
15
15
|
"test": "npm run test:only ."
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"sideEffects": false,
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@babel/runtime": "^7.22.5",
|
|
51
|
-
"@baleada/logic": "^0.
|
|
51
|
+
"@baleada/logic": "^0.24.3",
|
|
52
52
|
"vue": "^3.3.4"
|
|
53
53
|
}
|
|
54
54
|
}
|