Skip to content

Commit

Permalink
imp: Updated dependencies. + New release. 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
Byloth committed Feb 24, 2024
1 parent 8397d25 commit b8cc623
Show file tree
Hide file tree
Showing 13 changed files with 655 additions and 554 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "1.2.2-rc.4",
"version": "1.3.0",
"npmClient": "yarn"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuert/root",
"version": "1.2.2-rc.4",
"version": "1.3.0",
"packageManager": "[email protected]",
"workspaces": [
"packages/*"
Expand Down
26 changes: 13 additions & 13 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@byloth/vuert",
"version": "1.2.2-rc.4",
"version": "1.3.0",
"description": "The headless alerts, notifications & popups library for Vue.js craftsmen. ℹ",
"keywords": [
"Alert",
Expand Down Expand Up @@ -53,21 +53,21 @@
"lint:prod": "NODE_ENV=\"production\" yarn lint"
},
"dependencies": {
"@byloth/core": "^1.3.0-rc.2",
"@byloth/exceptions": "^2.2.2",
"vue": "^3.4.18"
"@byloth/core": "^1.3.0",
"@byloth/exceptions": "^2.2.4",
"vue": "^3.4.19"
},
"devDependencies": {
"@byloth/eslint-config-typescript": "^2.6.8",
"@byloth/eslint-config-vue": "^2.6.8",
"@types/node": "^20.11.17",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@vitejs/plugin-vue": "^5.0.3",
"eslint": "^8.56.0",
"eslint-plugin-vue": "^9.21.1",
"@byloth/eslint-config-typescript": "^2.7.0",
"@byloth/eslint-config-vue": "^2.7.0",
"@types/node": "^20.11.20",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"@vitejs/plugin-vue": "^5.0.4",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.22.0",
"typescript": "^5.3.3",
"vite": "^5.1.1",
"vite": "^5.1.4",
"vue-eslint-parser": "^9.4.2",
"vue-tsc": "^1.8.27"
}
Expand Down
23 changes: 15 additions & 8 deletions packages/core/src/components/AlertHandler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
:alert="context.alert"
:custom-component="context.component"
:is-open="context.isOpen.value"
:queue="queue"
:resolve="context.resolve"
:reject="context.reject"></slot>
</Component>
</template>

<script lang="ts" setup>
import { nextTick, onMounted, onUnmounted, shallowRef } from "vue";
import { nextTick, onMounted, onUnmounted, ref, shallowRef } from "vue";
import type { Component, PropType } from "vue";
import { useVuert } from "../functions.js";
Expand All @@ -20,7 +21,7 @@
import type { AlertOptions } from "../types/alert/index.js";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type AnyContext = Context<any>;
type AnyContext = Context<any, any>;
const props = defineProps({
is: {
Expand Down Expand Up @@ -53,13 +54,15 @@
});
const emit = defineEmits({
opening: <R>(alert: Alert<R>) => (alert instanceof Alert),
opened: <R>(alert: Alert<R>) => (alert instanceof Alert),
closing: <R>(alert: Alert<R>) => (alert instanceof Alert),
closed: <R>(alert: Alert<R>) => (alert instanceof Alert)
opening: <R, P extends Record<string, unknown>>(alert: Alert<R, P>) => (alert instanceof Alert),
opened: <R, P extends Record<string, unknown>>(alert: Alert<R, P>) => (alert instanceof Alert),
closing: <R, P extends Record<string, unknown>>(alert: Alert<R, P>) => (alert instanceof Alert),
closed: <R, P extends Record<string, unknown>>(alert: Alert<R, P>) => (alert instanceof Alert)
});
const contexts: AnyContext[] = [];
const queue = ref<number>(0);
const context = shallowRef<AnyContext>();
const open = async (): Promise<void> =>
Expand All @@ -76,6 +79,8 @@
contexts.shift();
context.value = undefined;
queue.value -= 1;
await nextTick();
if (contexts.length > 0) { open(); }
Expand All @@ -86,13 +91,15 @@
await ctx.open();
};
const register = <R>(options: AlertOptions<R>): Context<R> =>
const register = <R, P extends Record<string, unknown>>(options: AlertOptions<R, P>): Context<R, P> =>
{
const ctx = new Context(options, props.transitionDuration);
const ctx = new Context<R, P>(options, props.transitionDuration);
contexts.push(ctx);
if (contexts.length === 1) { open(); }
queue.value += 1;
return ctx;
};
Expand Down
20 changes: 11 additions & 9 deletions packages/core/src/components/AlertHandler.vue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
validator: (value: unknown) => boolean;
};
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
opening: (alert: Alert<unknown>) => void;
opened: (alert: Alert<unknown>) => void;
closing: (alert: Alert<unknown>) => void;
closed: (alert: Alert<unknown>) => void;
opening: (alert: Alert<unknown, Record<string, unknown>>) => void;
opened: (alert: Alert<unknown, Record<string, unknown>>) => void;
closing: (alert: Alert<unknown, Record<string, unknown>>) => void;
closed: (alert: Alert<unknown, Record<string, unknown>>) => void;
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
is: {
default: string;
Expand All @@ -36,18 +36,20 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
validator: (value: unknown) => boolean;
};
}>> & {
onOpening?: ((alert: Alert<unknown>) => any) | undefined;
onOpened?: ((alert: Alert<unknown>) => any) | undefined;
onClosing?: ((alert: Alert<unknown>) => any) | undefined;
onClosed?: ((alert: Alert<unknown>) => any) | undefined;
onOpening?: ((alert: Alert<unknown, Record<string, unknown>>) => any) | undefined;
onOpened?: ((alert: Alert<unknown, Record<string, unknown>>) => any) | undefined;
onClosing?: ((alert: Alert<unknown, Record<string, unknown>>) => any) | undefined;
onClosed?: ((alert: Alert<unknown, Record<string, unknown>>) => any) | undefined;
}, {
filter: (options: AlertOptions<unknown>) => boolean;
transitionDuration: number | Duration;
is: string | Component;
}, {}>, {
default?(_: {
alert: Alert<any>;
alert: Alert<any, any>;
customComponent: Component | undefined;
isOpen: boolean;
queue: number;
resolve: import("@byloth/core").PromiseResolver<any>;
reject: import("@byloth/core").PromiseRejecter<unknown>;
}): any;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types/action/value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import type { CoreAction } from "./core";
export interface ValueAction<R = void> extends CoreAction
{
callback?: never;
value: R;
value?: R;
}
2 changes: 1 addition & 1 deletion packages/core/src/vuert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type VuertSubscriber<R = void> = (alert: AlertOptions<R>) => Context<R> |

export default class Vuert
{
public static readonly VERSION: string = "1.2.2-rc.4";
public static readonly VERSION: string = "1.3.0";

public static get DEFAULT_OPTS(): VuertOptions
{
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default defineConfig({
{ text: "Guide", link: "/guide/" },
{ text: "Configs", link: "/config/" },
{
text: "1.2.2-rc.4",
text: "1.3.0",
items: [{ text: "Releases", link: `${REPO_HOME}/releases` }]
}
],
Expand Down
24 changes: 12 additions & 12 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@byloth/vuert-docs",
"version": "1.2.2-rc.4",
"version": "1.3.0",
"type": "module",
"scripts": {
"dev": "vitepress dev",
Expand All @@ -12,21 +12,21 @@
},
"dependencies": {
"@byloth/vuert": "workspace:^",
"vue": "^3.4.18"
"vue": "^3.4.19"
},
"devDependencies": {
"@byloth/eslint-config-typescript": "^2.6.8",
"@byloth/eslint-config-vue": "^2.6.8",
"@byloth/eslint-config-typescript": "^2.7.0",
"@byloth/eslint-config-vue": "^2.7.0",
"@fortawesome/fontawesome-free": "^6.5.1",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@vitejs/plugin-vue": "^5.0.3",
"eslint": "^8.56.0",
"eslint-plugin-vue": "^9.21.1",
"sass": "^1.70.0",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"@vitejs/plugin-vue": "^5.0.4",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.22.0",
"sass": "^1.71.1",
"typescript": "^5.3.3",
"vite": "^5.1.1",
"vitepress": "^1.0.0-rc.42",
"vite": "^5.1.4",
"vitepress": "^1.0.0-rc.44",
"vue-eslint-parser": "^9.4.2",
"vue-tsc": "^1.8.27"
},
Expand Down
12 changes: 8 additions & 4 deletions packages/docs/src/components/alerts/ModalAlert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
</button>
</div>
<div class="modal-body">
<pre v-if="alert.message" class="modal-message">{{ alert.message }}</pre>
<template v-else>
<component :is="alert.component" v-bind="alert.props" />
<template v-if="customComponent">
<component :is="customComponent" v-bind="alert.payload" />
</template>
<pre v-else class="modal-message">{{ alert.message }}</pre>
</div>
<div v-if="alert.actions" class="flex modal-footer">
<VuertButton v-for="action in alert.actions"
Expand All @@ -39,7 +39,7 @@
</template>

<script lang="ts" setup>
import type { PropType } from "vue";
import type { Component, PropType } from "vue";
import { Alert } from "@byloth/vuert";
Expand All @@ -53,6 +53,10 @@
close: {
required: true,
type: Function as PropType<(result?: unknown) => void>
},
customComponent: {
default: undefined,
type: Object as PropType<Component>
}
});
</script>
Expand Down
13 changes: 7 additions & 6 deletions packages/docs/src/layouts/VuertLayout.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
<template>
<AlertHandler v-slot="{ alert, isOpen, resolve }"
<AlertHandler v-slot="{ alert, customComponent, isOpen, resolve }"
class="modal-handler"
:filter="modalFilter">
<Transition appear
name="modal"
mode="in-out">
<ModalAlert v-if="isOpen"
:alert="alert"
:close="resolve" />
:close="resolve"
:custom-component="customComponent" />
</Transition>
</AlertHandler>
<AlertHandler v-slot="{ alert, isOpen }"
<AlertHandler v-slot="{ alert, customComponent, isOpen }"
class="toast-handler"
:filter="toastFilter">
<Transition appear
name="toast"
mode="in-out">
<Component :is="alert.component"
<Component :is="customComponent"
v-if="isOpen"
v-bind="alert.props" />
v-bind="alert.payload" />
</Transition>
</AlertHandler>
<DefaultTheme.Layout />
Expand Down Expand Up @@ -133,7 +134,7 @@
position: fixed;
right: 0;
top: 0;
z-index: 22;
z-index: 31;
}
.modal-enter-active,
Expand Down
26 changes: 13 additions & 13 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@byloth/nuxt-vuert-module",
"version": "1.2.2-rc.4",
"version": "1.3.0",
"description": "The headless alerts, notifications & popups module for Nuxt.js craftsmen. ℹ",
"keywords": [
"Alert",
Expand Down Expand Up @@ -51,24 +51,24 @@
},
"dependencies": {
"@byloth/vuert": "workspace:^",
"@nuxt/kit": "^3.10.1",
"@nuxt/kit": "^3.10.3",
"defu": "^6.1.4"
},
"devDependencies": {
"@byloth/eslint-config-typescript": "^2.6.8",
"@byloth/eslint-config-vue": "^2.6.8",
"@byloth/eslint-config-typescript": "^2.7.0",
"@byloth/eslint-config-vue": "^2.7.0",
"@nuxt/devtools": "^1.0.8",
"@nuxt/module-builder": "^0.5.5",
"@nuxt/schema": "^3.10.1",
"@types/node": "^20.11.17",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"eslint": "^8.56.0",
"eslint-plugin-vue": "^9.21.1",
"nuxi": "^3.10.0",
"nuxt": "^3.10.1",
"@nuxt/schema": "^3.10.3",
"@types/node": "^20.11.20",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.22.0",
"nuxi": "^3.10.1",
"nuxt": "^3.10.3",
"typescript": "^5.3.3",
"vite": "^5.1.1",
"vite": "^5.1.4",
"vue-eslint-parser": "^9.4.2",
"vue-tsc": "^1.8.27"
}
Expand Down
Loading

0 comments on commit b8cc623

Please sign in to comment.