@shwfed/nuxt 0.11.17 → 0.11.18
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/dist/module.json +1 -1
- package/dist/runtime/components/ui/buttons/button-action.types.d.ts +6 -0
- package/dist/runtime/components/ui/buttons/button-action.types.js +26 -0
- package/dist/runtime/composables/useButtonAction.d.ts +2 -1
- package/dist/runtime/plugins/toast/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ButtonActionEffect, type ButtonActionEffectFactory } from '../../../composables/useButtonAction.js';
|
|
2
|
+
export declare const overlayFactoryEffect: ButtonActionEffectFactory;
|
|
3
|
+
export declare const submitFactoryEffect: ButtonActionEffectFactory;
|
|
4
|
+
export declare const promiseEffect: ButtonActionEffect;
|
|
5
|
+
export declare const syncEffect: ButtonActionEffect;
|
|
6
|
+
export declare const overlayContextEffect: ButtonActionEffectFactory;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Effect, Option } from "effect";
|
|
2
|
+
import { openOverlay } from "../../../composables/useOverlay.js";
|
|
3
|
+
import { currentButtonAction } from "../../../composables/useButtonAction.js";
|
|
4
|
+
export const overlayFactoryEffect = ({ id }) => Effect.gen(function* () {
|
|
5
|
+
const handle = yield* openOverlay(id);
|
|
6
|
+
return handle;
|
|
7
|
+
});
|
|
8
|
+
export const submitFactoryEffect = ({ title }) => Effect.gen(function* () {
|
|
9
|
+
if (title.length === 0) {
|
|
10
|
+
return yield* Effect.fail(new Error("missing title"));
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
submitted: true,
|
|
14
|
+
title
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
export const promiseEffect = Effect.promise(async () => ({
|
|
18
|
+
status: "ok"
|
|
19
|
+
}));
|
|
20
|
+
export const syncEffect = Effect.sync(() => 1);
|
|
21
|
+
export const overlayContextEffect = () => Effect.gen(function* () {
|
|
22
|
+
const action = yield* currentButtonAction();
|
|
23
|
+
const handle = yield* openOverlay(action.id);
|
|
24
|
+
const result = yield* handle.result;
|
|
25
|
+
return Option.isSome(result);
|
|
26
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Context, Effect, type Scope } from 'effect';
|
|
2
|
+
import type { OverlayService } from './useOverlay.js';
|
|
2
3
|
export type ButtonActionRuntime = Readonly<{
|
|
3
4
|
id: string;
|
|
4
5
|
locale: string;
|
|
@@ -15,7 +16,7 @@ declare const ButtonActionService_base: Context.TagClass<ButtonActionService, "s
|
|
|
15
16
|
}>>;
|
|
16
17
|
export declare class ButtonActionService extends ButtonActionService_base {
|
|
17
18
|
}
|
|
18
|
-
export type ButtonActionEffect = Effect.Effect<
|
|
19
|
+
export type ButtonActionEffect = Effect.Effect<unknown, unknown, ButtonActionService | OverlayService | Scope.Scope> | Effect.Effect<unknown, unknown, ButtonActionService | OverlayService> | Effect.Effect<unknown, unknown, ButtonActionService | Scope.Scope> | Effect.Effect<unknown, unknown, OverlayService | Scope.Scope> | Effect.Effect<unknown, unknown, ButtonActionService> | Effect.Effect<unknown, unknown, OverlayService> | Effect.Effect<unknown, unknown, Scope.Scope> | Effect.Effect<unknown, unknown, never>;
|
|
19
20
|
export type ButtonActionEffectFactory = (context: ButtonActionRuntime) => ButtonActionEffect;
|
|
20
21
|
export declare function currentButtonAction(): Effect.Effect<ButtonActionRuntime, never, ButtonActionService>;
|
|
21
22
|
export {};
|
|
@@ -7,9 +7,9 @@ declare const _default: import("#app").Plugin<{
|
|
|
7
7
|
custom: (component: import("vue").Component, data?: import("vue-sonner").ExternalToast) => string | number;
|
|
8
8
|
message: (message: string | (() => string | import("vue").Component) | import("vue").Component, data?: import("vue-sonner").ExternalToast) => string | number;
|
|
9
9
|
promise: <ToastData>(promise: Promise<ToastData> | (() => Promise<ToastData>), data?: ({
|
|
10
|
+
dismissible?: boolean | undefined;
|
|
10
11
|
id?: number | string | undefined;
|
|
11
12
|
icon?: import("vue").Component | undefined;
|
|
12
|
-
dismissible?: boolean | undefined;
|
|
13
13
|
duration?: number | undefined;
|
|
14
14
|
class?: string | undefined;
|
|
15
15
|
style?: import("vue").CSSProperties | undefined;
|
|
@@ -60,9 +60,9 @@ declare const _default: import("#app").Plugin<{
|
|
|
60
60
|
custom: (component: import("vue").Component, data?: import("vue-sonner").ExternalToast) => string | number;
|
|
61
61
|
message: (message: string | (() => string | import("vue").Component) | import("vue").Component, data?: import("vue-sonner").ExternalToast) => string | number;
|
|
62
62
|
promise: <ToastData>(promise: Promise<ToastData> | (() => Promise<ToastData>), data?: ({
|
|
63
|
+
dismissible?: boolean | undefined;
|
|
63
64
|
id?: number | string | undefined;
|
|
64
65
|
icon?: import("vue").Component | undefined;
|
|
65
|
-
dismissible?: boolean | undefined;
|
|
66
66
|
duration?: number | undefined;
|
|
67
67
|
class?: string | undefined;
|
|
68
68
|
style?: import("vue").CSSProperties | undefined;
|