@antcde/vue-utils 0.1.7 → 0.2.7
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/README.md +4 -1
- package/dist/index.js +116 -1317
- package/dist/types/index.d.ts +1 -1
- package/dist/types/useAntColorMode.d.ts +1 -1
- package/dist/types/useAntI18n.d.ts +3 -3
- package/dist/types/useCommsClient.d.ts +2 -3
- package/dist/types/useCommsHost.d.ts +1 -1
- package/dist/types/utils.d.ts +8 -2
- package/package.json +5 -5
package/dist/types/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export { useAntColorMode, type UseAntColorModeOptions, type UseAntColorModeRetur
|
|
|
2
2
|
export { useAntI18n, type UseAntI18nReturn } from './useAntI18n';
|
|
3
3
|
export { type UseCommsClient, useCommsClient } from './useCommsClient';
|
|
4
4
|
export { type CommsHostArgs, type UseCommsHost, useCommsHost } from './useCommsHost';
|
|
5
|
-
export { type AnyUseApiReturn, type CommsToolbar, useApi, type UseApiReturn, useCommsInjection, useSingleton } from './utils';
|
|
5
|
+
export { type AnyUseApiReturn, type CommsToolbar, useApi, type UseApiReturn, useCommsInjection, useSignal, useSingleton, } from './utils';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UseCommsClient } from './useCommsClient';
|
|
2
1
|
import { BasicColorSchema, UseColorModeOptions, UseColorModeReturn } from '@vueuse/core';
|
|
2
|
+
import { UseCommsClient } from './useCommsClient';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
4
|
|
|
5
5
|
export type UseAntColorModeOptions = UseColorModeOptions<BasicColorSchema>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Composer, UseI18nOptions } from 'vue-i18n';
|
|
2
2
|
import { UseCommsClient } from './useCommsClient';
|
|
3
3
|
|
|
4
|
-
export type UseAntI18nReturn
|
|
4
|
+
export type UseAntI18nReturn = Composer;
|
|
5
5
|
/**
|
|
6
6
|
* Listens to the changing locale received from comms and translations will automatically refresh due to internal watcher.
|
|
7
7
|
* @param comms
|
|
8
8
|
* @param options
|
|
9
9
|
*/
|
|
10
|
-
export declare function useAntI18n
|
|
10
|
+
export declare function useAntI18n(comms: UseCommsClient, options?: UseI18nOptions): UseAntI18nReturn;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { AntConnect, Client, Context,
|
|
1
|
+
import { AntConnect, Client, Context, Signal } from '@antcde/connect-ts';
|
|
2
2
|
import { ObservableInput } from 'rxjs';
|
|
3
3
|
import { CommsToolbar } from './utils';
|
|
4
4
|
import { Ref } from 'vue';
|
|
5
5
|
|
|
6
|
-
export interface UseCommsClient extends Omit<Client, 'context' | 'toolbar' | 'appState'
|
|
6
|
+
export interface UseCommsClient extends Omit<Client, 'context' | 'toolbar' | 'appState'> {
|
|
7
7
|
context: Ref<Context>;
|
|
8
8
|
toolbar: CommsToolbar;
|
|
9
9
|
appState: Ref<string>;
|
|
10
|
-
locales: Ref<LocaleData>;
|
|
11
10
|
}
|
|
12
11
|
type KeyboardShortcutsHook = (signal: Signal) => ObservableInput<Signal>;
|
|
13
12
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AntConnect, License, Notepad, Notification, ProjectShort, SignalReceiver, SignalSender, Task, User } from '@antcde/connect-ts';
|
|
2
|
+
import { CommsToolbar } from './utils';
|
|
2
3
|
import { SubscriptionLike } from 'rxjs';
|
|
3
4
|
import { Ref } from 'vue';
|
|
4
|
-
import { CommsToolbar } from './utils';
|
|
5
5
|
|
|
6
6
|
type Nullable<T> = NonNullable<T> | null | undefined;
|
|
7
7
|
export interface CommsHostArgs {
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ToolbarItem } from '@antcde/connect-ts';
|
|
1
|
+
import { Signal, ToolbarItem } from '@antcde/connect-ts';
|
|
2
2
|
import { UseAsyncStateOptions, UseAsyncStateReturn } from '@vueuse/core';
|
|
3
|
-
import { FunctionPlugin, Ref, UnwrapRef } from 'vue';
|
|
3
|
+
import { DeepReadonly, FunctionPlugin, Ref, UnwrapRef, WatchStopHandle } from 'vue';
|
|
4
4
|
import { UseCommsClient } from './useCommsClient';
|
|
5
5
|
|
|
6
6
|
type RefObject<T> = {
|
|
@@ -29,4 +29,10 @@ export interface UseApiReturn<Data, Params extends any[], Shallow extends boolea
|
|
|
29
29
|
* A shorthand that implies all the generics to be any
|
|
30
30
|
*/
|
|
31
31
|
export type AnyUseApiReturn = UseApiReturn<any, any, any>;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves the last emitted signal
|
|
34
|
+
*
|
|
35
|
+
* @param comms
|
|
36
|
+
*/
|
|
37
|
+
export declare function useSignal(comms: UseCommsClient): [DeepReadonly<Ref<Signal | undefined>>, WatchStopHandle];
|
|
32
38
|
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antcde/vue-utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.7",
|
|
5
5
|
"description": "Helper to use ANT Comms in Vue 3",
|
|
6
6
|
"author": "CollaborAll",
|
|
7
7
|
"repository": {
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@vueuse/core": "^12.0.0",
|
|
30
30
|
"vue": "^3.5.10",
|
|
31
|
-
"vue-i18n": "^
|
|
31
|
+
"vue-i18n": "^10.0.1",
|
|
32
|
+
"rxjs": "^7.0.0"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"
|
|
35
|
-
"@antcde/connect-ts": "0.1.6"
|
|
35
|
+
"@antcde/connect-ts": "0.4.9"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@vitejs/plugin-vue": "^5.0.3",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"vue-tsc": "^1.8.27"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
|
-
"build": "vite build",
|
|
46
|
+
"build": "pnpm clean && vite build",
|
|
47
47
|
"type-check": "vue-tsc --noEmit",
|
|
48
48
|
"clean": "pnpm dlx rimraf dist"
|
|
49
49
|
}
|