A self-hosted media server and file management system
Vue ffmpegfile-serverjellyfinlaravelmediamedia-playermedia-servermediabrowsermediaservermusicmusic-librarymusic-playermusicplayerself-hostedvuejs
make toasts nicer lol
aminnausin49d965602526
diff --git a/resources/js/App.vue b/resources/js/App.vueindex 79ed03fa..ac589cce 100755--- a/resources/js/App.vue+++ b/resources/js/App.vue@@ -9,7 +9,6 @@ import { RouterView } from 'vue-router';import { Toaster } from 'vue-sonner';import ToastController from '@/components/pinesUI/ToastController.vue';-import { toast } from './service/toaster/state';const appStore = useAppStore();const toastPosition = ref<ToastPostion>();@@ -20,7 +19,6 @@ onMounted(async () => {initDarkMode();initAmbientMode();initPlaybackHeatmap();- toast.add('hi');const screenSize = getScreenSize();if (screenSize === 'default') {diff --git a/resources/js/components/dashboard/DashboardAnalytics.vue b/resources/js/components/dashboard/DashboardAnalytics.vueindex 7fed6064..7ef20f79 100644--- a/resources/js/components/dashboard/DashboardAnalytics.vue+++ b/resources/js/components/dashboard/DashboardAnalytics.vue@@ -14,7 +14,7 @@ import ButtonText from '@/components/inputs/ButtonText.vue';import LucideChartNoAxesCombined from '~icons/lucide/chart-no-axes-combined';import ProiconsArrowSync from '~icons/proicons/arrow-sync';-import { useToast } from '@/composables/useToast';+import { toast } from '@/service/toaster/state';const validPeriods: { key: string; value: string }[] = [{ key: '1h', value: '1_hour' },@@ -35,8 +35,6 @@ const setPeriod = (newPeriod: string) => {period.value = newPeriod;};-const toast = useToast();-watch(() => rawPulseData.value,() => {diff --git a/resources/js/components/panels/NavBar.vue b/resources/js/components/panels/NavBar.vueindex b26dd005..f3c47b5e 100755--- a/resources/js/components/panels/NavBar.vue+++ b/resources/js/components/panels/NavBar.vue@@ -86,7 +86,7 @@ watch(userData, handleAuthEvent, { immediate: false });</NavButton><NavButtonv-if="$route.name === 'home'"- @click="cycleSideBar('folders', '#list-card')"+ @click="cycleSideBar('folders', 'list-card')":label="'folders'":active="selectedSideBar === 'folders'":class="`ring-1 ring-gray-900/5`"@@ -97,7 +97,7 @@ watch(userData, handleAuthEvent, { immediate: false });</NavButton><NavButtonv-if="username && $route.name === 'home'"- @click="cycleSideBar('history', '#list-card')"+ @click="cycleSideBar('history', 'list-card')":label="'history'":active="selectedSideBar === 'history'":class="`ring-1 ring-gray-900/5`"@@ -108,7 +108,7 @@ watch(userData, handleAuthEvent, { immediate: false });</NavButton><NavButtonv-if="username && $route.name === 'dashboard'"- @click="cycleSideBar('dashboard', '#left-card')"+ @click="cycleSideBar('dashboard', 'left-card')":label="'dashboard'":active="selectedSideBar === 'dashboard'":class="`ring-1 ring-gray-900/5`"diff --git a/resources/js/components/pinesUI/Toast.vue b/resources/js/components/pinesUI/Toast.vuedeleted file mode 100644index e513caaf..00000000--- a/resources/js/components/pinesUI/Toast.vue+++ /dev/null@@ -1,402 +0,0 @@-<script lang="ts" setup>-import './styles.css';--import { computed, onBeforeUnmount, onMounted, ref, watch, watchEffect } from 'vue';-import { type HeightT, type ToastProps, type ToastT, isAction } from './types';-import { useIsDocumentHidden } from '/hooks';--const props = defineProps<ToastProps>();--const emit = defineEmits<{- (e: 'update:heights', heights: HeightT[]): void;- (e: 'removeToast', toast: ToastT): void;-}>();--// Default lifetime of a toasts (in ms)-const TOAST_LIFETIME = 4000;--const SWIPE_THRESHOLD = 20;--const TIME_BEFORE_UNMOUNT = 200;--const mounted = ref(false);-const removed = ref(false);-const swiping = ref(false);-const swipeOut = ref(false);-const swiped = ref(false);-const offsetBeforeRemove = ref(0);-const initialHeight = ref(0);-const remainingTime = ref(props.toast.duration || props.duration || TOAST_LIFETIME);-const dragStartTime = ref<Date | null>(null);-const toastRef = ref<HTMLLIElement | null>(null);-const isFront = computed(() => props.index === 0);-const isVisible = computed(() => props.index + 1 <= props.visibleToasts);-const toastType = computed(() => props.toast.type);-const dismissible = computed(() => props.toast.dismissible !== false);-const toastClass = computed(() => props.toast.class || '');-const toastDescriptionClass = computed(() => props.descriptionClass || '');--const toastStyle = props.toast.style || {};--// Height index is used to calculate the offset as it gets updated before the toast array, which means we can calculate the new layout faster.-const heightIndex = computed(() => props.heights.findIndex((height) => height.toastId === props.toast.id) || 0);-const closeButton = computed(() => props.toast.closeButton ?? props.closeButton);-const duration = computed(() => props.toast.duration || props.duration || TOAST_LIFETIME);--const closeTimerStartTimeRef = ref(0);-const lastCloseTimerStartTimeRef = ref(0);-const pointerStartRef = ref<{ x: number; y: number } | null>(null);-const coords = computed(() => props.position.split('-'));-const y = computed(() => coords.value[0]);-const x = computed(() => coords.value[1]);-const isStringOfTitle = computed(() => typeof props.toast.title !== 'string');-const isStringOfDescription = computed(() => typeof props.toast.description !== 'string');--const toastsHeightBefore = computed(() => {- return props.heights.reduce((prev, curr, reducerIndex) => {- // Calculate offset up untill current toast- if (reducerIndex >= heightIndex.value) {- return prev;- }-- return prev + curr.height;- }, 0);-});-const isDocumentHidden = useIsDocumentHidden();-const invert = computed(() => props.toast.invert || props.invert);-const disabled = computed(() => toastType.value === 'loading');--const offset = computed(() => {- return heightIndex.value * props.gap! + toastsHeightBefore.value || 0;-});--onMounted(() => {- if (!mounted.value) return;-- const toastNode = toastRef.value;- const originalHeight = toastNode?.style.height;- toastNode!.style.height = 'auto';- const newHeight = toastNode!.getBoundingClientRect().height;- toastNode!.style.height = originalHeight as string;-- initialHeight.value = newHeight;-- let newHeightArr;-- const alreadyExists = props.heights.find((height) => height.toastId === props.toast.id);-- if (!alreadyExists) {- newHeightArr = [- {- toastId: props.toast.id,- height: newHeight,- position: props.toast.position,- },- ...props.heights,- ];- } else {- newHeightArr = props.heights.map((height) => (height.toastId === props.toast.id ? { ...height, height: newHeight } : height));- }-- emit('update:heights', newHeightArr as HeightT[]);-});--function deleteToast() {- // Save the offset for the exit swipe animation- removed.value = true;- offsetBeforeRemove.value = offset.value;- const height = props.heights.filter((height) => height.toastId !== props.toast.id);- emit('update:heights', height);-- setTimeout(() => {- emit('removeToast', props.toast);- }, TIME_BEFORE_UNMOUNT);-}--function handleCloseToast() {- if (disabled.value || !dismissible.value) {- return {};- }-- deleteToast();- props.toast.onDismiss?.(props.toast);-}--function onPointerDown(event: PointerEvent) {- if (disabled.value || !dismissible.value) return;- dragStartTime.value = new Date();- offsetBeforeRemove.value = offset.value;- // Ensure we maintain correct pointer capture even when going outside of the toast (e.g. when swiping)- (event.target as HTMLElement).setPointerCapture(event.pointerId);- if ((event.target as HTMLElement).tagName === 'BUTTON') return;- swiping.value = true;- pointerStartRef.value = { x: event.clientX, y: event.clientY };-}--function onPointerUp() {- if (swipeOut.value || !dismissible) return;- pointerStartRef.value = null;-- const swipeAmount = Number(toastRef.value?.style.getPropertyValue('--swipe-amount').replace('px', '') || 0);-- const timeTaken = new Date().getTime() - dragStartTime.value?.getTime()!;- const velocity = Math.abs(swipeAmount) / timeTaken;-- // Remove only if treshold is met- if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {- offsetBeforeRemove.value = offset.value;- props.toast.onDismiss?.(props.toast);- deleteToast();- swipeOut.value = true;- swiped.value = false;- return;- }-- toastRef.value?.style.setProperty('--swipe-amount', '0px');- swiping.value = false;-}--function onPointerMove(event: PointerEvent) {- if (!pointerStartRef.value || !dismissible.value) return;-- const yPosition = event.clientY - pointerStartRef.value.y;-- // @ts-expect-error- const isHighlighted = window.getSelection()?.toString().length > 0;-- const swipeAmount = y.value === 'top' ? Math.min(0, yPosition) : Math.max(0, yPosition);-- if (Math.abs(swipeAmount) > 0) {- swiped.value = true;- }-- if (isHighlighted) return;-- toastRef.value?.style.setProperty('--swipe-amount', `${swipeAmount}px`);-}--watchEffect((onInvalidate) => {- if ((props.toast.promise && toastType.value === 'loading') || props.toast.duration === Infinity || props.toast.type === 'loading') {- return;- }- let timeoutId: ReturnType<typeof setTimeout>;-- // Pause the timer on each hover- const pauseTimer = () => {- if (lastCloseTimerStartTimeRef.value < closeTimerStartTimeRef.value) {- // Get the elapsed time since the timer started- const elapsedTime = new Date().getTime() - closeTimerStartTimeRef.value;-- remainingTime.value = remainingTime.value - elapsedTime;- }-- lastCloseTimerStartTimeRef.value = new Date().getTime();- };-- const startTimer = () => {- if (remainingTime.value === Infinity) return;- closeTimerStartTimeRef.value = new Date().getTime();-- // Let the toast know it has started- timeoutId = setTimeout(() => {- props.toast.onAutoClose?.(props.toast);- deleteToast();- }, remainingTime.value);- };-- if (props.expanded || props.interacting || (props.pauseWhenPageIsHidden && isDocumentHidden)) {- pauseTimer();- } else {- startTimer();- }-- onInvalidate(() => {- clearTimeout(timeoutId);- });-});--watch(- () => props.toast.delete,- () => {- if (props.toast.delete) {- deleteToast();- }- },- {- deep: true,- },-);--onMounted(() => {- mounted.value = true;-- if (toastRef.value) {- const height = toastRef.value.getBoundingClientRect().height;- // Add toast height tot heights array after the toast is mounted- initialHeight.value = height;-- const newHeights = [{ toastId: props.toast.id, height, position: props.toast.position! }, ...props.heights];- emit('update:heights', newHeights);- }-});--onBeforeUnmount(() => {- if (toastRef.value) {- const newHeights = props.heights.filter((height) => height.toastId !== props.toast.id);- emit('update:heights', newHeights);- }-});-</script>--<template>- <li- ref="toastRef"- :aria-live="toast.important ? 'assertive' : 'polite'"- aria-atomic="true"- role="status"- tabindex="0"- data-sonner-toast="true"- :class="- cn(- props.class,- toastClass,- classes?.toast,- toast.classes?.toast,- // @ts-ignore- classes?.[toastType],- // @ts-ignore- toast?.classes?.[toastType],- )- "- :data-rich-colors="toast.richColors ?? defaultRichColors"- :data-styled="!Boolean(toast.component || toast?.unstyled || unstyled)"- :data-mounted="mounted"- :data-promise="Boolean(toast.promise)"- :data-removed="removed"- :data-visible="isVisible"- :data-y-position="y"- :data-x-position="x"- :data-index="index"- :data-front="isFront"- :data-swiping="swiping"- :data-dismissible="dismissible"- :data-type="toastType"- :data-invert="invert"- :data-swipe-out="swipeOut"- :data-expanded="Boolean(expanded || (expandByDefault && mounted))"- :style="{- '--index': index,- '--toasts-before': index,- '--z-index': toasts.length - index,- '--offset': `${removed ? offsetBeforeRemove : offset}px`,- '--initial-height': expandByDefault ? 'auto' : `${initialHeight}px`,- ...style,- ...toastStyle,- }"- @pointerdown="onPointerDown"- @pointerup="onPointerUp"- @pointermove="onPointerMove"- >- <template v-if="closeButton && !toast.component">- <button- :aria-label="closeButtonAriaLabel || 'Close toast'"- :data-disabled="disabled"- data-close-button="true"- :class="cn(classes?.closeButton, toast?.classes?.closeButton)"- @click="handleCloseToast"- >- <template v-if="icons?.close">- <component :is="icons?.close" />- </template>- <template v-else>- <slot name="close-icon" />- </template>- </button>- </template>-- <template v-if="toast.component">- <component :is="toast.component" v-bind="toast.componentProps" :onCloseToast="handleCloseToast" />- </template>-- <template v-else>- <template v-if="toastType !== 'default' || toast.icon || toast.promise">- <div data-icon="" :class="cn(classes?.icon, toast?.classes?.icon)">- <template v-if="(toast.promise || toastType === 'loading') && !toast.icon">- <slot name="loading-icon" />- </template>-- <component :is="toast.icon" v-if="toast.icon" />-- <template v-else>- <slot v-if="toastType === 'success'" name="success-icon" />- <slot v-else-if="toastType === 'error'" name="error-icon" />- <slot v-else-if="toastType === 'warning'" name="warning-icon" />- <slot v-else-if="toastType === 'info'" name="info-icon" />- </template>- </div>- </template>-- <div data-content="" :class="cn(classes?.content, toast?.classes?.content)">- <div data-title="" :class="cn(classes?.title, toast.classes?.title)">- <template v-if="isStringOfTitle">- <component :is="toast.title" v-bind="toast.componentProps" />- </template>- <template v-else>- {{ toast.title }}- </template>- </div>-- <template v-if="toast.description">- <div- data-description=""- :class="cn(descriptionClass, toastDescriptionClass, classes?.description, toast.classes?.description)"- >- <template v-if="isStringOfDescription">- <component :is="toast.description" v-bind="toast.componentProps" />- </template>- <template v-else>- {{ toast.description }}- </template>- </div>- </template>- </div>- <template v-if="toast.cancel">- <button- :style="toast.cancelButtonStyle || cancelButtonStyle"- :class="cn(classes?.cancelButton, toast.classes?.cancelButton)"- data-button- data-cancel- @click="- (event) => {- if (!isAction(toast.cancel!)) return;- if (!dismissible) return;- toast.cancel.onClick?.(event);- deleteToast();- }- "- >- {{ isAction(toast.cancel) ? toast.cancel?.label : toast.cancel }}- </button>- </template>- <template v-if="toast.action">- <button- :style="toast.actionButtonStyle || actionButtonStyle"- :class="cn(classes?.actionButton, toast.classes?.actionButton)"- data-button- data-action- @click="- (event) => {- if (!isAction(toast.action!)) return;- if (event.defaultPrevented) return;- toast.action.onClick?.(event);- if (event.defaultPrevented) return;- deleteToast();- }- "- >- {{ isAction(toast.action) ? toast.action?.label : toast.action }}- </button>- </template>- </template>- </li>-</template>diff --git a/resources/js/components/pinesUI/ToastController.vue b/resources/js/components/pinesUI/ToastController.vueindex 99202cb7..4fbb0ba9 100755--- a/resources/js/components/pinesUI/ToastController.vue+++ b/resources/js/components/pinesUI/ToastController.vue@@ -1,6 +1,14 @@-<script lang="ts">+<script setup lang="ts">+// This is so bad lol pls fix+import { type Message, type ToastControllerProps, type ToastLayout, type ToastPostion, type ToastToDismiss } from '@/types/pinesTypes';++import { nextTick, onMounted, ref, watch, watchEffect } from 'vue';+import { ToastState } from '@/service/toaster/state';++import ToastNotification from '@/components/pinesUI/ToastNotification.vue';+// Visible toasts amount-const VISIBLE_TOASTS_AMOUNT = 3;+const VISIBLE_TOASTS_AMOUNT = 6;// Viewport paddingconst VIEWPORT_OFFSET = '24px';@@ -10,16 +18,7 @@ const MOBILE_VIEWPORT_OFFSET = '16px';const TOAST_WIDTH = 0;// Default gap between toasts-const GAP = 16;-</script>--<script setup lang="ts">-// This is so bad lol pls fix-import { type ExternalToast, type Message, type ToastControllerProps, type ToastLayout, type ToastPostion } from '@/types/pinesTypes';-import { onBeforeUnmount, onMounted, ref, watch } from 'vue';--import ToastNotification from '@/components/pinesUI/ToastNotification.vue';-import ToastEventBus from '@/service/toastEventBus';+const DEFAULT_GAP = 16;const props = withDefaults(defineProps<ToastControllerProps>(), {layout: 'default',@@ -28,7 +27,7 @@ const props = withDefaults(defineProps<ToastControllerProps>(), {maxVisibleToasts: VISIBLE_TOASTS_AMOUNT,viewportOffset: VIEWPORT_OFFSET,mobileViewportOffset: MOBILE_VIEWPORT_OFFSET,- paddingBetweenToasts: GAP,+ paddingBetweenToasts: DEFAULT_GAP,});const container = ref<HTMLElement>();@@ -42,47 +41,31 @@ const expanded = ref(props.layout === 'expanded' ? true : false);const paddingBetweenToasts = ref(props.paddingBetweenToasts);const heightRecalculateTimeout = ref<null | number>(null);-function UniqueComponentId(prefix = 'pv_id_') {- return prefix + Math.random().toString(16).slice(2);-}+// function UniqueComponentId(prefix = 'pv_id_') {+// return prefix + Math.random().toString(16).slice(2);+// }-function onAdd(toast: ExternalToast) {- console.log(toast);+// function onAdd(toast) {+// console.log(toast);- if (toast.options.position) position.value = toast.options.position;+// if (toast.options.position) position.value = toast.options.position;- if (toast.options.id == null) {- toast.options.id = UniqueComponentId('toast_');- }- messages.value.unshift({- ...toast.options,- id: toast.options.id ?? UniqueComponentId('toast_'),- type: toast.options.type ?? 'default',- position: toast.options.position ?? position.value,- life: toast.options.life ?? props.defaultLife,- title: toast.title,- });-}-function onRemove(message: Message) {- let params = { message, type: 'close' };- if (!params.message.id) return; // This is slow and causes issues. Every second remove is not called because the last one is blocking the event somehow. Doing it right in the event watcher makes it work correctly.- // for (let i = 0; i < this.messages.length; i++) {- // if (this.messages[i].idx === params.message.idx) {- // console.log('found ' + params.message.idx);-- // this.messages.splice(i, 1);- // break;- // }- // }- // if (this.messages[params.message.idx]) {- // // delete this.messages[params.message.idx]- // // this.$emit(params.type, { message: params.message });- // }- deleteToastWithId(params.message.id);-}+// if (toast.options.id == null) {+// toast.options.id = UniqueComponentId('toast_');+// }+// messages.value.unshift({+// ...toast.options,+// id: toast.options.id ?? UniqueComponentId('toast_'),+// type: toast.options.type ?? 'default',+// position: toast.options.position ?? position.value,+// life: toast.options.life ?? props.defaultLife,+// title: toast.title,+// });+// }function deleteToastWithId(id: string) {messages.value = messages.value.filter((msg) => msg.id !== id);+ ToastState.dismiss(id);stackToasts();}@@ -122,12 +105,17 @@ function positionToasts() {toast.style.top = 'auto';toast.style.bottom = totalHeight + 'px';} else toast.style.top = totalHeight + 'px';- // console.log('totalHeight', i + 1, totalHeight);- totalHeight += toast.getBoundingClientRect().height;- // console.log(toast.getBoundingClientRect().height);+ // console.log('scale', toast.style.scale);- toast.style.scale = `100%`;+ totalHeight += toast.offsetHeight;+ // toast.style.scale === '1'+ // ? toast.getBoundingClientRect().height+ // : Math.round(toast.getBoundingClientRect().height / scaleBuffer);+ // totalHeight += toast.getBoundingClientRect().height;+ // console.log('totalHeight', i + 1, totalHeight);++ toast.style.scale = `1`;toast.style.transform = `translateY(0px)`;} else if (i > 0) {toast.style.scale = `${scaleBuffer}`;@@ -165,21 +153,6 @@ function positionToasts() {}}-function alignBottom(element1: HTMLElement, element2: HTMLElement) {- // Get the top position and height of the first element- let top1 = element1.offsetTop;- let height1 = element1.offsetHeight;-- // Get the height of the second element- let height2 = element2.offsetHeight;-- // Calculate the top position for the second element- let top2 = top1 + (height1 - height2);-- // Apply the calculated top position to the second element- element2.style.top = top2 + 'px';-}-function calculateHeightOfToastsContainer() {if (!container.value) return;@@ -207,6 +180,21 @@ function calculateHeightOfToastsContainer() {}}+function alignBottom(element1: HTMLElement, element2: HTMLElement) {+ // Get the top position and height of the first element+ let top1 = element1.offsetTop;+ let height1 = element1.offsetHeight;++ // Get the height of the second element+ let height2 = element2.offsetHeight;++ // Calculate the top position for the second element+ let top2 = top1 + (height1 - height2);++ // Apply the calculated top position to the second element+ element2.style.top = top2 + 'px';+}+function resetBottom() {for (let i = 0; i < messages.value.length; i++) {let toastElement = document.getElementById(`${messages.value[i]?.id}`);@@ -215,6 +203,7 @@ function resetBottom() {}}}+function resetTop() {for (let i = 0; i < messages.value.length; i++) {let toastElement = document.getElementById(`${messages.value[i]?.id}`);@@ -224,17 +213,45 @@ function resetTop() {}}+//#region Old Toast Event Bus Code++// onMounted(() => {+// ToastEventBus.on('add', onAdd);+// ToastEventBus.on('remove', onRemove);+// stackToasts();+// });++// onBeforeUnmount(() => {+// ToastEventBus.off('add', onAdd);+// ToastEventBus.off('remove', onRemove);+// });++// function onRemove(message: Message) {+// console.log('remove');++// let params = { message, type: 'close' };+// if (!params.message.id) return; // This is slow and causes issues. Every second remove is not called because the last one is blocking the event somehow. Doing it right in the event watcher makes it work correctly.+// // for (let i = 0; i < this.messages.length; i++) {+// // if (this.messages[i].idx === params.message.idx) {+// // console.log('found ' + params.message.idx);++// // this.messages.splice(i, 1);+// // break;+// // }+// // }+// // if (this.messages[params.message.idx]) {+// // // delete this.messages[params.message.idx]+// // // this.$emit(params.type, { message: params.message });+// // }+// deleteToastWithId(params.message.id);+// }++//#endregion+onMounted(() => {- ToastEventBus.on('add', onAdd);- ToastEventBus.on('remove', onRemove);stackToasts();});-onBeforeUnmount(() => {- ToastEventBus.off('add', onAdd);- ToastEventBus.off('remove', onRemove);-});-watch(() => toastsHovered.value,(value) => {@@ -254,9 +271,9 @@ watch(} else {if (layout.value == 'default') {expanded.value = false;- setTimeout(function () {- stackToasts();- }, 10);+ //setTimeout(function(){+ stackToasts();+ //}, 10);setTimeout(function () {stackToasts();}, 10);@@ -265,6 +282,46 @@ watch(}},);++watchEffect((onInvalidate) => {+ const unsubscribe = ToastState.subscribe((newToast) => {+ // ? toast is deleted locally already why is there an extra step+ if ((newToast as ToastToDismiss).dismiss) {+ // messages.value = messages.value.map((t) => (t.id === toast.id ? { ...t, delete: true } : t));+ return;+ }++ nextTick(() => {+ const indexOfExistingToast = messages.value.findIndex((t) => t.id === newToast.id);++ // Update the toast if it already exists+ if (indexOfExistingToast !== -1) {+ messages.value = [+ ...messages.value.slice(0, indexOfExistingToast),+ { ...messages.value[indexOfExistingToast], ...newToast },+ ...messages.value.slice(indexOfExistingToast + 1),+ ];+ } else {+ let toast = newToast as Message;++ if (toast.position) position.value = toast.position;++ messages.value.unshift({+ ...toast,+ id: toast.id,+ type: toast.type ?? 'default',+ position: toast.position ?? position.value,+ life: toast.life ?? props.defaultLife,+ title: toast.title,+ });++ // messages.value = [toast as Message, ...messages.value];+ }+ });+ });++ onInvalidate(unsubscribe);+});</script><template>@@ -274,7 +331,7 @@ watch(ref="container":tabIndex="-1":class="- `fixed w-full ${TOAST_WIDTH ? `sm:w-[${TOAST_WIDTH}px]` : 'sm:max-w-sm'} group z-[99] [&>*]:px-[${mobileViewportOffset ?? viewportOffset}] [&>*]:sm:px-[${viewportOffset}] my-[${mobileViewportOffset ?? viewportOffset}] sm:my-[${viewportOffset}] ` ++ `fixed w-full ${TOAST_WIDTH ? `sm:w-[${TOAST_WIDTH}px]` : 'sm:max-w-sm'} group z-[99] [&>*]:px-4 [&>*]:px-[${mobileViewportOffset ?? viewportOffset}] [&>*]:sm:px-6 [&>*]:sm:px-[${viewportOffset}] my-4 sm:my-6 my-[${mobileViewportOffset ?? viewportOffset}] sm:my-[${viewportOffset}] ` +`${position == 'top-right' ? 'right-0 top-0' : ''} ` +`${position == 'top-left' ? 'left-0 top-0' : ''} ` +`${position == 'top-center' ? 'left-1/2 -translate-x-1/2 top-0' : ''} ` +diff --git a/resources/js/components/pinesUI/ToastNotification.vue b/resources/js/components/pinesUI/ToastNotification.vueindex de87170e..b1817f56 100755--- a/resources/js/components/pinesUI/ToastNotification.vue+++ b/resources/js/components/pinesUI/ToastNotification.vue@@ -1,10 +1,10 @@<script setup lang="ts">import type { ToastProps } from '@/types/pinesTypes';+import { onBeforeUnmount, onMounted, ref } from 'vue';const emit = defineEmits<{- // (e: 'update:heights', heights: HeightT[]): void;- (e: 'close', toast: any): void; // removeToast+ (e: 'close', id: string): void; // removeToast}>();const props = withDefaults(defineProps<ToastProps>(), {@@ -58,7 +58,7 @@ onMounted(() => {if (props.life) {animateTimeout.value = setTimeout(() => {- // onClose();+ onClose();}, props.life);}});diff --git a/resources/js/components/pinesUI/Toaster.vue b/resources/js/components/pinesUI/Toaster.vuedeleted file mode 100644index 32f96f9f..00000000--- a/resources/js/components/pinesUI/Toaster.vue+++ /dev/null@@ -1,372 +0,0 @@-<script lang="ts">-// Visible toasts amount-const VISIBLE_TOASTS_AMOUNT = 3;--// Viewport padding-const VIEWPORT_OFFSET = '32px';--// Default toast width-const TOAST_WIDTH = 356;--// Default gap between toasts-const GAP = 14;--const isClient = typeof window !== 'undefined' && typeof document !== 'undefined';--function _cn(...classes: (string | undefined)[]) {- return classes.filter(Boolean).join(' ');-}-</script>--<script lang="ts" setup>-import { computed, nextTick, ref, toRaw, useAttrs, watch, watchEffect } from 'vue';-import type { HeightT, Position, ToastT, ToastToDismiss, ToasterProps } from './types';-import { ToastState } from './state';-import Toast from './Toast.vue';-import CloseIcon from './assets/CloseIcon.vue';-import LoaderIcon from './assets/Loader.vue';-import SuccessIcon from './assets/SuccessIcon.vue';-import InfoIcon from './assets/InfoIcon.vue';-import WarningIcon from './assets/WarningIcon.vue';-import ErrorIcon from './assets/ErrorIcon.vue';--defineOptions({- name: 'Toaster',- inheritAttrs: false,-});--const props = withDefaults(defineProps<ToasterProps>(), {- invert: false,- position: 'bottom-right',- hotkey: () => ['altKey', 'KeyT'],- expand: false,- closeButton: false,- class: '',- offset: VIEWPORT_OFFSET,- theme: 'light',- richColors: false,- style: () => ({}),- visibleToasts: VISIBLE_TOASTS_AMOUNT,- toastOptions: () => ({}),- dir: 'auto',- gap: GAP,- containerAriaLabel: 'Notifications',- pauseWhenPageIsHidden: false,- cn: _cn,-});--function getDocumentDirection(): ToasterProps['dir'] {- if (typeof window === 'undefined') return 'ltr';- if (typeof document === 'undefined') return 'ltr'; // For Fresh purpose-- const dirAttribute = document.documentElement.getAttribute('dir');-- if (dirAttribute === 'auto' || !dirAttribute) {- return window.getComputedStyle(document.documentElement).direction as ToasterProps['dir'];- }-- return dirAttribute as ToasterProps['dir'];-}--const attrs = useAttrs();-const toasts = ref<ToastT[]>([]);-const filteredToasts = computed(() => {- return (pos: string, index: number) => toasts.value.filter((toast) => (!toast.position && index === 0) || toast.position === pos);-});-const possiblePositions = computed(() => {- const posList = toasts.value.filter((toast) => toast.position).map((toast) => toast.position) as Position[];- return posList.length > 0 ? Array.from(new Set([props.position].concat(posList))) : [props.position];-});-const heights = ref<HeightT[]>([]);-const expanded = ref(false);-const interacting = ref(false);-const actualTheme = ref(- props.theme !== 'system'- ? props.theme- : typeof window !== 'undefined'- ? window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches- ? 'dark'- : 'light'- : 'light',-);--const listRef = ref<HTMLOListElement[] | HTMLOListElement | null>(null);-const lastFocusedElementRef = ref<HTMLElement | null>(null);-const isFocusWithinRef = ref(false);--const hotkeyLabel = props.hotkey.join('+').replace(/Key/g, '').replace(/Digit/g, '');--function removeToast(toastToRemove: ToastT) {- if (!toasts.value.find((toast) => toast.id === toastToRemove.id)?.delete) {- ToastState.dismiss(toastToRemove.id);- }-- toasts.value = toasts.value.filter(({ id }) => id !== toastToRemove.id);-}--function onBlur(event: FocusEvent | any) {- if (isFocusWithinRef.value && !event.currentTarget?.contains?.(event.relatedTarget)) {- isFocusWithinRef.value = false;- if (lastFocusedElementRef.value) {- lastFocusedElementRef.value.focus({ preventScroll: true });- lastFocusedElementRef.value = null;- }- }-}--function onFocus(event: FocusEvent | any) {- const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false';-- if (isNotDismissible) return;-- if (!isFocusWithinRef.value) {- isFocusWithinRef.value = true;- lastFocusedElementRef.value = event.relatedTarget as HTMLElement;- }-}--function onPointerDown(event: PointerEvent) {- if (event.target) {- const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false';-- if (isNotDismissible) return;- }- interacting.value = true;-}--watchEffect((onInvalidate) => {- const unsubscribe = ToastState.subscribe((toast) => {- if ((toast as ToastToDismiss).dismiss) {- toasts.value = toasts.value.map((t) => (t.id === toast.id ? { ...t, delete: true } : t));- return;- }-- nextTick(() => {- const indexOfExistingToast = toasts.value.findIndex((t) => t.id === toast.id);-- // Update the toast if it already exists- if (indexOfExistingToast !== -1) {- toasts.value = [- ...toasts.value.slice(0, indexOfExistingToast),- { ...toasts.value[indexOfExistingToast], ...toast },- ...toasts.value.slice(indexOfExistingToast + 1),- ];- } else {- toasts.value = [toast, ...toasts.value];- }- });- });-- onInvalidate(unsubscribe);-});--watch(- () => props.theme,- (newTheme) => {- if (newTheme !== 'system') {- actualTheme.value = newTheme;- return;- }-- if (newTheme === 'system') {- // check if current preference is dark- if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {- // it's currently dark- actualTheme.value = 'dark';- } else {- // it's not dark- actualTheme.value = 'light';- }- }-- if (typeof window === 'undefined') return;-- const darkMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');-- try {- // Chrome & Firefox- darkMediaQuery.addEventListener('change', ({ matches }) => {- if (matches) {- actualTheme.value = 'dark';- } else {- actualTheme.value = 'light';- }- });- } catch (error) {- darkMediaQuery.addListener(({ matches }) => {- try {- if (matches) {- actualTheme.value = 'dark';- } else {- actualTheme.value = 'light';- }- } catch (e) {- console.error(e);- }- });- }- },-);--watchEffect(() => {- if (listRef.value && lastFocusedElementRef.value) {- lastFocusedElementRef.value.focus({ preventScroll: true });- lastFocusedElementRef.value = null;- isFocusWithinRef.value = false;- }-});--watchEffect(() => {- // Ensure expanded is always false when no toasts are present / only one left- if (toasts.value.length <= 1) {- expanded.value = false;- }-});--watchEffect((onInvalidate) => {- function handleKeyDown(event: KeyboardEvent) {- const isHotkeyPressed = props.hotkey.every((key) => (event as any)[key] || event.code === key);-- const listRefItem = Array.isArray(listRef.value) ? listRef.value[0] : listRef.value;-- if (isHotkeyPressed) {- expanded.value = true;- listRefItem?.focus();- }-- const isItemActive = document.activeElement === listRef.value || listRefItem?.contains(document.activeElement);-- if (event.code === 'Escape' && isItemActive) {- expanded.value = false;- }- }-- if (!isClient) return;-- document.addEventListener('keydown', handleKeyDown);-- onInvalidate(() => {- document.removeEventListener('keydown', handleKeyDown);- });-});-</script>--<template>- <!-- Remove item from normal navigation flow, only available via hotkey -->- <section- :aria-label="`${containerAriaLabel} ${hotkeyLabel}`"- :tabIndex="-1"- aria-live="polite"- aria-relevant="additions text"- aria-atomic="false"- >- <template v-for="(pos, index) in possiblePositions" :key="pos">- <ol- ref="listRef"- data-sonner-toaster- :class="props.class"- :dir="dir === 'auto' ? getDocumentDirection() : dir"- :tabIndex="-1"- :data-theme="theme"- :data-rich-colors="richColors"- :data-y-position="pos.split('-')[0]"- :data-x-position="pos.split('-')[1]"- :data-lifted="expanded && toasts.length > 1 && !expand"- :style="{- '--front-toast-height': `${heights[0]?.height}px`,- '--offset': typeof offset === 'number' ? `${offset}px` : offset || VIEWPORT_OFFSET,- '--width': `${TOAST_WIDTH}px`,- '--gap': `${gap}px`,- ...style,- ...(attrs as Record<string, Record<string, any>>).style,- }"- v-bind="$attrs"- @blur="onBlur"- @focus="onFocus"- @mouseenter="() => (expanded = true)"- @mousemove="() => (expanded = true)"- @mouseleave="- () => {- // Avoid setting expanded to false when interacting with a toast, e.g. swiping- if (!interacting) {- expanded = false;- }- }- "- @pointerdown="onPointerDown"- @pointerup="() => (interacting = false)"- >- <template v-for="(toast, idx) in filteredToasts(pos, index)" :key="toast.id">- <Toast- :heights="heights.filter((h) => h.position === toast.position)"- :icons="icons"- :index="idx"- :toast="toast"- :defaultRichColors="richColors"- :duration="toastOptions?.duration ?? duration"- :class="toastOptions?.class ?? ''"- :descriptionClass="toastOptions?.descriptionClass"- :invert="invert"- :visibleToasts="visibleToasts"- :closeButton="toastOptions?.closeButton ?? closeButton"- :interacting="interacting"- :position="pos"- :style="toastOptions?.style"- :unstyled="toastOptions?.unstyled"- :classes="toastOptions?.classes"- :cancelButtonStyle="toastOptions?.cancelButtonStyle"- :actionButtonStyle="toastOptions?.actionButtonStyle"- :toasts="toasts.filter((t) => t.position === toast.position)"- :expandByDefault="expand"- :gap="gap"- :expanded="expanded"- :pauseWhenPageIsHidden="pauseWhenPageIsHidden"- :cn="cn"- @update:heights="- (h) => {- heights = h;- }- "- @removeToast="removeToast"- >- <template #close-icon>- <slot name="close-icon">- <CloseIcon />- </slot>- </template>-- <template #loading-icon>- <slot name="loading-icon">- <LoaderIcon :visible="toast.type === 'loading'" />- </slot>- </template>-- <template #success-icon>- <slot name="success-icon">- <SuccessIcon />- </slot>- </template>-- <template #error-icon>- <slot name="error-icon">- <ErrorIcon />- </slot>- </template>-- <template #warning-icon>- <slot name="warning-icon">- <WarningIcon />- </slot>- </template>-- <template #info-icon>- <slot name="info-icon">- <InfoIcon />- </slot>- </template>- </Toast>- </template>- </ol>- </template>- </section>-</template>diff --git a/resources/js/components/pulse/PulseUserCard.vue b/resources/js/components/pulse/PulseUserCard.vueindex 4dfc6238..ba3221be 100644--- a/resources/js/components/pulse/PulseUserCard.vue+++ b/resources/js/components/pulse/PulseUserCard.vue@@ -3,7 +3,7 @@ const props = defineProps<{ user: { name: string; extra?: any; avatar?: string }</script><template><div- class="flex items-center justify-between p-4 gap-2 rounded-md dark:bg-primary-dark-800/70 bg-primary-900 ring-1 ring-gray-900/5 shadow-sm ring-inset"+ class="flex items-center justify-between p-4 gap-2 rounded-md dark:bg-primary-dark-800 bg-primary-900 ring-1 ring-gray-900/5 shadow-sm ring-inset"><div class="flex items-center gap-3 overflow-hidden"><imgdiff --git a/resources/js/components/pulseCards/PulseQueues.vue b/resources/js/components/pulseCards/PulseQueues.vueindex 64c51e44..a535f06b 100644--- a/resources/js/components/pulseCards/PulseQueues.vue+++ b/resources/js/components/pulseCards/PulseQueues.vue@@ -10,6 +10,8 @@ import PulseNoResults from '../pulse/PulseNoResults.vue';import PulseScroll from '../pulse/PulseScroll.vue';import PulseLineChart from '../charts/PulseLineChart.vue';+const validPeriods = ['1_hour', '6_hours', '24_hours', '7_days'];+const props = withDefaults(defineProps<{cols?: number | string;@@ -185,7 +187,7 @@ watch(:class="props.class"name="Queues":title="`Time: ${format_number(pulseData?.queues?.time ?? 0)}ms; Run at: ${pulseData?.servers?.runAt ? new Date(pulseData?.servers?.runAt).toLocaleDateString() : ''};`"- :details="`past ${periodForHumans(period)}`"+ :details="`past ${validPeriods.indexOf(period) !== -1 ? periodForHumans(period) : periodForHumans(validPeriods[0])}`"><template #icon><IconQueueList />@@ -247,7 +249,7 @@ watch(<div class="h-14"><PulseLineChart- :class="' !bg-primary-900'"+ :class="' dark:!bg-primary-dark-800 !bg-primary-900 '":chart-data="{labels: Object.keys(queues[queue].queued).map((v) => pulseFormatDate(v)),datasets: [diff --git a/resources/js/components/pulseCards/PulseUsage.vue b/resources/js/components/pulseCards/PulseUsage.vueindex 533ec796..029ee8ae 100644--- a/resources/js/components/pulseCards/PulseUsage.vue+++ b/resources/js/components/pulseCards/PulseUsage.vue@@ -20,6 +20,8 @@ const requestOptions = [{ value: 'jobs', title: 'dispatching jobs', key: 'jobsCounts' },];+const validPeriods = ['1_hour', '6_hours', '24_hours', '7_days'];+const props = withDefaults(defineProps<{cols?: number | string;@@ -75,7 +77,7 @@ watch([() => props.pulseData, type], () => {:class="`${props.class} col-span-2 lg:col-span-4`":name="`${'Application Usage'}`":title="`Time: ${format_number(pulseData?.queues?.time ?? 0)}ms; Run at: ${pulseData?.servers?.runAt ? new Date(pulseData?.servers?.runAt).toLocaleDateString() : ''};`"- :details="`past ${periodForHumans(period)}`"+ :details="`past ${validPeriods.indexOf(period) !== -1 ? periodForHumans(period) : periodForHumans(validPeriods[0])}`"><template #icon><IconArrowTrendingUp v-if="type.value === 'requests'" />diff --git a/resources/js/layouts/LayoutBase.vue b/resources/js/layouts/LayoutBase.vueindex e55be175..fc3ed6ce 100755--- a/resources/js/layouts/LayoutBase.vue+++ b/resources/js/layouts/LayoutBase.vue@@ -25,7 +25,7 @@ const scrollBody = ref(null);><sectionid="left-card"- :class="`col-span-1 h-fit order-2 lg:order-1 bg-primary-900 dark:bg-primary-dark-900 dark:text-[#e2e0e2] shadow-xl rounded-2xl space-y-2 scroll-mt-6 z-20 ring-gray-900/5 ${selectedSideBar && sideBarTarget === '#left-card' ? 'ring-1' : 'invisible'}`"+ :class="`col-span-1 h-fit order-2 lg:order-1 bg-primary-900 dark:bg-primary-dark-900 dark:text-[#e2e0e2] shadow-xl rounded-2xl space-y-2 scroll-mt-6 z-20 ring-gray-900/5 ${selectedSideBar && sideBarTarget === 'left-card' ? 'ring-1' : 'invisible'}`"><slot name="leftSidebar"></slot></section>@@ -39,7 +39,7 @@ const scrollBody = ref(null);</section><sectionid="list-card"- :class="`col-span-1 h-fit order-3 bg-primary-900 dark:bg-primary-dark-900 dark:text-[#e2e0e2] shadow-xl rounded-2xl space-y-2 scroll-mt-6 z-20 ring-1 ring-gray-900/5 ${selectedSideBar && sideBarTarget === '#list-card' ? 'ring-1' : 'hidden'}`"+ :class="`col-span-1 h-fit order-3 bg-primary-900 dark:bg-primary-dark-900 dark:text-[#e2e0e2] shadow-xl rounded-2xl space-y-2 scroll-mt-6 z-20 ring-1 ring-gray-900/5 ${selectedSideBar && sideBarTarget === 'list-card' ? 'ring-1' : 'hidden'}`"><!-- w-full h-fit lg:w-1/6 lg:max-w-72 sm:min-w-32 shrink-0 --><!-- class="bg-primary-900 dark:bg-primary-dark-900 dark:text-[#e2e0e2] shadow-xl p-3 rounded-2xl w-full h-fit lg:w-1/6 lg:max-w-72 sm:min-w-32 shrink-0 space-y-2 scroll-mt-6 z-20 ring-1 ring-gray-900/5" -->diff --git a/resources/js/service/toaster/state.ts b/resources/js/service/toaster/state.tsindex 8bf0b417..1c10d16e 100644--- a/resources/js/service/toaster/state.ts+++ b/resources/js/service/toaster/state.ts@@ -1,13 +1,11 @@-import type { ExternalToast, Message, ToastOptions, ToastType } from '@/types/pinesTypes';-import type { Component } from 'vue';+import type { ExternalToast, Message, ToastOptions, ToastToDismiss, ToastType } from '@/types/pinesTypes';function UniqueComponentId(prefix = 'pv_id_') {return prefix + Math.random().toString(16).slice(2);}-let toastsCounter = 0;class Observer {- subscribers: Array<(toast: Message | { id: string }) => void>;+ subscribers: Array<(toast: Message | ToastToDismiss) => void>;toasts: Array<Message>;constructor() {@@ -16,16 +14,15 @@ class Observer {}// We use arrow functions to maintain the correct `this` reference- subscribe = (subscriber: (toast: Message | { id: string }) => void) => {+ subscribe = (subscriber: (toast: Message | ToastToDismiss) => void) => {this.subscribers.push(subscriber as any);-return () => {const index = this.subscribers.indexOf(subscriber as any);this.subscribers.splice(index, 1);};};- publish = (data: Message) => {+ publish = (data: Message | ToastToDismiss) => {this.subscribers.forEach((subscriber) => subscriber(data));};@@ -34,15 +31,8 @@ class Observer {this.toasts = [...this.toasts, data];};- create = (- data: ExternalToast & {- message?: string;- type?: ToastType;- life?: number;- },- ) => {- const { message, ...rest } = data;- const id = data.options.id ?? UniqueComponentId('toast_');+ create = (title: string, options: ToastOptions) => {+ const id = options.id ?? UniqueComponentId('toast_');const alreadyExists = this.toasts.find((toast) => {return toast.id === id;});@@ -50,12 +40,12 @@ class Observer {if (alreadyExists) {this.toasts = this.toasts.map((toast) => {if (toast.id === id) {- this.publish({ ...toast, ...data, id, title: message ?? '' });+ this.publish({ ...toast, ...options, id, title });return {...toast,- ...data,+ ...options,id,- title: message ?? '',+ title,};}@@ -63,29 +53,28 @@ class Observer {});} else {this.addToast({- ...rest,- title: message ?? '',+ title,id,- position: 'bottom-right',- life: 3000,- type: 'success',+ ...options,});}return id;};dismiss = (id?: string) => {- if (id) {- this.subscribers.forEach((subscriber) => subscriber({ id }));+ if (!id) {+ this.toasts.forEach((toast) => {+ this.publish({ id: toast.id, dismiss: true });+ });+ this.toasts = [];+ } else {+ this.publish({ id, dismiss: true });+ this.toasts = this.toasts.filter((t) => t.id !== id);}- this.toasts.forEach((toast) => {- this.subscribers.forEach((subscriber) => subscriber({ id: toast.id }));- });- return id;};add = (message: string, options?: ToastOptions) => {- return this.create({ title: message, options: options ?? {} });+ return this.create(message, { ...options });};}@@ -93,15 +82,11 @@ export const ToastState = new Observer();function toastFunction(message: string, options?: ToastOptions) {const id = UniqueComponentId('toast_');-- ToastState.create({ title: message, options: { type: 'default', ...options, id: id } });-+ ToastState.create(message, { ...options, id });return id;}-const basicToast = toastFunction;--export const toast = Object.assign(basicToast, {+export const toast = Object.assign(toastFunction, {add: ToastState.add,dismiss: ToastState.dismiss,});diff --git a/resources/js/stores/AppStore.ts b/resources/js/stores/AppStore.tsindex a149b179..6970181f 100644--- a/resources/js/stores/AppStore.ts+++ b/resources/js/stores/AppStore.ts@@ -52,7 +52,7 @@ export const useAppStore = defineStore('App', () => {localStorage.setItem('playbackHeatmap', booleanToString(playbackHeatmap.value));}- async function cycleSideBar(target = '', scrollTarget: '' | '#left-card' | '#list-card' | 'root' = '') {+ async function cycleSideBar(target = '', scrollTarget: '' | 'left-card' | 'list-card' | 'root' = '') {sideBarTarget.value = scrollTarget;if (selectedSideBar.value === target) {diff --git a/resources/js/types/pinesTypes.ts b/resources/js/types/pinesTypes.tsindex 3e16db15..29c4bb83 100644--- a/resources/js/types/pinesTypes.ts+++ b/resources/js/types/pinesTypes.ts@@ -42,9 +42,9 @@ export interface ToastProps {}export interface Message<T extends Component = Component> {- type: ToastType;- position: ToastPostion;- life: number;+ type?: ToastType;+ position?: ToastPostion;+ life?: number;id: string;title: string;description?: string;@@ -69,4 +69,8 @@ export interface ToastT {id: string;}+export declare interface ToastToDismiss {+ id: string;+ dismiss: boolean;+}export declare const toast: (title: string, options?: ToastOptions) => string | number;diff --git a/resources/js/views/DashboardView.vue b/resources/js/views/DashboardView.vueindex 346618db..b1caadaa 100644--- a/resources/js/views/DashboardView.vue+++ b/resources/js/views/DashboardView.vue@@ -18,9 +18,10 @@ import ProiconsBookAdd2 from '~icons/proicons/book-add-2';import ProiconsAddSquareMultiple from '~icons/proicons/add-square-multiple';import LucideUsers from '~icons/lucide/users';import ProiconsHistory from '~icons/proicons/history';+import ProiconsGraph from '~icons/proicons/graph';const dashboardTabs: { name: string; title?: string; icon?: Component }[] = [- { name: 'overview', title: 'Website Analytics', icon: LucideChartNoAxesColumnIncreasing },+ { name: 'overview', title: 'Analytics', icon: ProiconsGraph },{ name: 'libraries', icon: ProiconsLibrary },{ name: 'activity', icon: ProiconsHistory },{ name: 'users', icon: LucideUsers },@@ -40,7 +41,7 @@ onMounted(async () => {pageTitle.value = defaultTab.title ?? defaultTab.name;dashboardTab.value = defaultTab;- cycleSideBar('dashboard', '#left-card');+ cycleSideBar('dashboard', 'left-card');});watch(diff --git a/resources/js/views/LoginView.vue b/resources/js/views/LoginView.vueindex 3b950602..b53bec1e 100755--- a/resources/js/views/LoginView.vue+++ b/resources/js/views/LoginView.vue@@ -29,8 +29,6 @@ const form = useForm({const handleLogin = async () => {form.submit(async (fields: any) => {- console.log(fields);-return await login(fields);},{diff --git a/resources/js/views/ProfileView.vue b/resources/js/views/ProfileView.vueindex 563e22cc..473d594f 100755--- a/resources/js/views/ProfileView.vue+++ b/resources/js/views/ProfileView.vue@@ -4,10 +4,9 @@ import { storeToRefs } from 'pinia';import { onMounted } from 'vue';import { useToast } from '../composables/useToast';-import { toast } from 'vue-sonner';-import LayoutBase from '../layouts/LayoutBase.vue';import ButtonText from '../components/inputs/ButtonText.vue';+import { toast } from '@/service/toaster/state';const toastr = useToast();const appStore = useAppStore();@@ -26,14 +25,14 @@ onMounted(() => {<div class="relative w-auto h-auto"><div class="relative space-y-5"><div class="relative">- <p class="mb-2 text-xs font-medium text-center text-gray-500 sm:text-left">Tests</p><div class="relative flex flex-col px-10 space-y-2 sm:space-x-5 sm:space-y-0 sm:flex-row sm:px-0"><ButtonText@click="- toastr.add('Default Toast Notification', {+ toast.add('Default Toast Notification', {type: 'danger',description: 'This is an example toast notification',life: 3000,+ position: 'top-right',})">@@ -41,10 +40,11 @@ onMounted(() => {</ButtonText><ButtonText@click="- toastr.add('Default Toast Notification', {+ toast.add('Default Toast Notification', {type: 'success',description: 'This is an example toast notification',life: 3000,+ position: 'bottom-left',})">@@ -52,7 +52,7 @@ onMounted(() => {</ButtonText><ButtonText@click="- toastr.add('Default Toast Notification', {+ toast.add('Default Toast Notification', {type: 'warning',description: 'This is an example toast notification',life: 3000,@@ -63,7 +63,7 @@ onMounted(() => {</ButtonText><ButtonText@click="- toastr.add('Default Toast Notification', {+ toast.add('Default Toast Notification', {type: 'info',life: 3000,})@@ -71,7 +71,7 @@ onMounted(() => {><template #text> Test </template></ButtonText>- <ButtonText @click="toast.success('Event has been created')">+ <ButtonText @click="toast('Event has been created')"><template #text> Test </template></ButtonText></div>