@bagelink/vue 1.6.49 → 1.6.51

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "1.6.49",
4
+ "version": "1.6.51",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
@@ -61,8 +61,7 @@
61
61
  "@types/leaflet": "^1.9.18",
62
62
  "@types/signature_pad": "^4.0.0",
63
63
  "vue": "^3.5.16",
64
- "vue-component-type-helpers": "^2.2.10",
65
- "vue-toastification": "^2.0.0-rc.5"
64
+ "vue-component-type-helpers": "^2.2.10"
66
65
  },
67
66
  "peerDependencies": {
68
67
  "@bagelink/sdk": "*",
@@ -70,15 +69,11 @@
70
69
  "vue-component-type-helpers": "^2.2.10",
71
70
  "vue": "*",
72
71
  "vue-draggable-next": "^2.2.1",
73
- "vue-router": "*",
74
- "vue-toastification": "^2"
72
+ "vue-router": "*"
75
73
  },
76
74
  "peerDependenciesMeta": {
77
75
  "vue-draggable-next": {
78
76
  "optional": true
79
- },
80
- "vue-toastification": {
81
- "optional": true
82
77
  }
83
78
  },
84
79
  "publishConfig": {
@@ -89,7 +84,8 @@
89
84
  "axios": "^1.9.0",
90
85
  "floating-vue": "^5.2.2",
91
86
  "libphonenumber-js": "1.12.9",
92
- "signature_pad": "^5.0.9"
87
+ "signature_pad": "^5.0.9",
88
+ "vue-toastification": "^2.0.0-rc.5"
93
89
  },
94
90
  "scripts": {
95
91
  "dev": "tsx watch src/index.ts",
@@ -46,7 +46,7 @@ const bind = computed(() => {
46
46
  const obj: { [key: string]: any } = {}
47
47
  if (props.to !== undefined && props.to !== '') { obj.to = props.to }
48
48
  else if (props.href !== undefined && props.href !== '') { obj.href = props.href }
49
- if (props.target !== undefined && props.target !== '' && ((props.to !== undefined && props.to !== '') || (props.href !== undefined && props.href !== ''))) { obj.target = props.target }
49
+ if (props.target !== undefined && props.target !== undefined && ((props.to !== undefined && props.to !== '') || (props.href !== undefined && props.href !== ''))) { obj.target = props.target }
50
50
 
51
51
  obj.class = {
52
52
  'notClickable': !((props.to !== undefined && props.to !== '') || (props.onClick !== undefined)),
@@ -81,7 +81,10 @@ const bind = computed(() => {
81
81
  {{ title }}
82
82
  <slot />
83
83
  </p>
84
- <p v-if="subtitle" class="txt12 m-0 m-0 py-0 ps-0 pe-1-5 opacity-7 me-2" :class="{ 'ellipsis-1': ellipsis }">
84
+ <p
85
+ v-if="subtitle" class="txt12 m-0 m-0 py-0 ps-0 pe-1-5 opacity-7 me-2"
86
+ :class="{ 'ellipsis-1': ellipsis }"
87
+ >
85
88
  {{ subtitle }}
86
89
  <slot name="subtitle" />
87
90
  </p>
@@ -90,7 +93,10 @@ const bind = computed(() => {
90
93
  </component>
91
94
  <slot name="end">
92
95
  <Icon v-if="iconEnd" :icon="iconEnd" class="transition-400" />
93
- <p v-if="end" class="txt12 m-0 py-0 ps-0 pe-1-5 opacity-7 " :class="{ 'ellipsis-1': ellipsis }" v-text="end" />
96
+ <p
97
+ v-if="end" class="txt12 m-0 py-0 ps-0 pe-1-5 opacity-7 " :class="{ 'ellipsis-1': ellipsis }"
98
+ v-text="end"
99
+ />
94
100
  </slot>
95
101
  </div>
96
102
  </template>
@@ -9,7 +9,6 @@ interface Props {
9
9
  maxScale?: number
10
10
  zoom?: number
11
11
  resetTrigger?: number
12
- aspectRatio?: number
13
12
  backgroundColor?: string
14
13
  pivot?: string // 'cursor' | 'image-center'
15
14
  zoomingElastic?: boolean
@@ -24,7 +23,6 @@ const {
24
23
  maxScale = 5,
25
24
  zoom,
26
25
  disabled = false,
27
- aspectRatio = 1,
28
26
  backgroundColor = 'transparent',
29
27
  pivot = 'cursor',
30
28
  zoomingElastic = true,
@@ -1,10 +1,11 @@
1
1
  import type { App, InjectionKey, Plugin } from 'vue'
2
2
  import { inject } from 'vue'
3
- import {
3
+ import Toast, {
4
4
  type PluginOptions as ToastOptions,
5
- type ToastInterface,
6
5
  POSITION,
6
+ useToast as useVueToast,
7
7
  } from 'vue-toastification'
8
+ import 'vue-toastification/dist/index.css'
8
9
 
9
10
  export interface ToastApi {
10
11
  success: (message: string, options?: any) => void
@@ -35,58 +36,62 @@ export function useToast(): ToastApi {
35
36
  export type BagelToastOptions = Partial<ToastOptions>
36
37
 
37
38
  export const ToastPlugin: Plugin<BagelToastOptions[]> = {
38
- install: async (app: App, options: BagelToastOptions = {}) => {
39
- try {
40
- // Dynamically import vue-toastification to avoid bundling if not used
41
- const Toast = await import('vue-toastification')
42
- const ToastInterface = Toast.default || Toast
43
-
44
- const defaultOptions: ToastOptions = {
45
- position: POSITION.TOP_RIGHT,
46
- timeout: 3000,
47
- closeOnClick: true,
48
- pauseOnFocusLoss: true,
49
- pauseOnHover: true,
50
- draggable: true,
51
- draggablePercent: 0.6,
52
- showCloseButtonOnHover: false,
53
- hideProgressBar: false,
54
- closeButton: 'button',
55
- icon: true,
56
- rtl: false,
57
- transition: 'Vue-Toastification__fade',
58
- maxToasts: 5,
59
- newestOnTop: true,
60
- ...options,
61
- }
62
-
63
- // Install vue-toastification
64
- app.use(ToastInterface as Plugin, defaultOptions)
65
-
66
- // Get the toast instance
67
- const toast: ToastInterface = app.config.globalProperties.$toast
39
+ install: (app: App, options: BagelToastOptions = {}) => {
40
+ const defaultOptions: ToastOptions = {
41
+ position: POSITION.TOP_RIGHT,
42
+ timeout: 3000,
43
+ closeOnClick: true,
44
+ pauseOnFocusLoss: true,
45
+ pauseOnHover: true,
46
+ draggable: true,
47
+ draggablePercent: 0.6,
48
+ showCloseButtonOnHover: false,
49
+ hideProgressBar: false,
50
+ closeButton: 'button',
51
+ icon: true,
52
+ rtl: false,
53
+ transition: 'Vue-Toastification__fade',
54
+ maxToasts: 5,
55
+ newestOnTop: true,
56
+ ...options,
57
+ }
68
58
 
69
- // Create the API wrapper
70
- const api: ToastApi = {
71
- success: (message: string, options?: any) => toast.success(message, options),
72
- error: (message: string, options?: any) => toast.error(message, options),
73
- info: (message: string, options?: any) => toast.info(message, options),
74
- warning: (message: string, options?: any) => toast.warning(message, options),
75
- show: (message: string, options?: any) => toast(message, options),
76
- clear: () => { toast.clear() },
77
- }
59
+ // Install vue-toastification
60
+ app.use(Toast, defaultOptions)
78
61
 
79
- // Set global singleton on first install
80
- if (!globalToastApi) {
81
- globalToastApi = api
82
- }
62
+ // Create the API wrapper using lazy evaluation
63
+ const api: ToastApi = {
64
+ success: (message: string, opts?: any) => {
65
+ const toast = useVueToast()
66
+ return toast.success(message, opts)
67
+ },
68
+ error: (message: string, opts?: any) => {
69
+ const toast = useVueToast()
70
+ return toast.error(message, opts)
71
+ },
72
+ info: (message: string, opts?: any) => {
73
+ const toast = useVueToast()
74
+ return toast.info(message, opts)
75
+ },
76
+ warning: (message: string, opts?: any) => {
77
+ const toast = useVueToast()
78
+ return toast.warning(message, opts)
79
+ },
80
+ show: (message: string, opts?: any) => {
81
+ const toast = useVueToast()
82
+ return toast(message, opts)
83
+ },
84
+ clear: () => {
85
+ const toast = useVueToast()
86
+ toast.clear()
87
+ },
88
+ }
83
89
 
84
- app.provide(ToastSymbol, api)
85
- } catch (error) {
86
- console.error('Failed to load vue-toastification. Make sure it is installed:', error)
87
- throw new Error(
88
- 'vue-toastification is required for ToastPlugin. Install it with: pnpm add vue-toastification'
89
- )
90
+ // Set global singleton on first install
91
+ if (!globalToastApi) {
92
+ globalToastApi = api
90
93
  }
94
+
95
+ app.provide(ToastSymbol, api)
91
96
  },
92
97
  }